chore: upgrade to turbo v2 and reduce ci quality gate runtime (#4324)

* chore: upgrade to turbo v2 and reduce ci quality gate runtime

* chore: upgrade to yarn v4 and deprecate turborepo

* chore: reconfigure modules and fix tests

* chore: switch to github-hosted runner

* fix: dependency resolving

* chore: clean redundant step

* chore: headless test

* chore: remove headed param

* fix: resolve dependency version

* fix: ubuntu no-sandbox test

---------

Co-authored-by: Hien To <tominhhien97@gmail.com>
Co-authored-by: Louis <louis@jan.ai>
This commit is contained in:
hiento09 2024-12-29 17:46:15 +07:00 committed by GitHub
parent da4336cc49
commit bd0e525d66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
48 changed files with 30330 additions and 299 deletions

View File

@ -66,7 +66,7 @@ jobs:
test-on-macos:
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: [self-hosted, macOS, macos-desktop]
runs-on: macos-latest
steps:
- name: Getting the repo
uses: actions/checkout@v3
@ -100,18 +100,13 @@ jobs:
- name: Linter and test
run: |
npm config set registry ${{ secrets.NPM_PROXY }} --global
yarn config set registry ${{ secrets.NPM_PROXY }} --global
make test
env:
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
# TURBO_API: '${{ secrets.TURBO_API }}'
# TURBO_TEAM: 'macos'
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
test-on-macos-pr-target:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
runs-on: [self-hosted, macOS, macos-desktop]
runs-on: macos-latest
steps:
- name: Getting the repo
uses: actions/checkout@v3
@ -131,8 +126,6 @@ jobs:
- name: Linter and test
run: |
npm config set registry https://registry.npmjs.org --global
yarn config set registry https://registry.npmjs.org --global
make test
env:
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
@ -182,13 +175,8 @@ jobs:
- name: Linter and test
shell: powershell
run: |
npm config set registry ${{ secrets.NPM_PROXY }} --global
yarn config set registry ${{ secrets.NPM_PROXY }} --global
make test
# env:
# TURBO_API: '${{ secrets.TURBO_API }}'
# TURBO_TEAM: 'windows'
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
test-on-windows-pr:
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
runs-on: windows-desktop-default-windows-security
@ -230,17 +218,11 @@ jobs:
- name: Linter and test
shell: powershell
run: |
npm config set registry ${{ secrets.NPM_PROXY }} --global
yarn config set registry ${{ secrets.NPM_PROXY }} --global
make test
# env:
# TURBO_API: '${{ secrets.TURBO_API }}'
# TURBO_TEAM: 'windows'
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
test-on-windows-pr-target:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
runs-on: windows-desktop-default-windows-security
runs-on: windows-latest
steps:
- name: Getting the repo
uses: actions/checkout@v3
@ -268,12 +250,10 @@ jobs:
- name: Linter and test
shell: powershell
run: |
npm config set registry https://registry.npmjs.org --global
yarn config set registry https://registry.npmjs.org --global
make test
test-on-ubuntu:
runs-on: [self-hosted, Linux, ubuntu-desktop]
runs-on: ubuntu-latest
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- name: Getting the repo
@ -311,13 +291,7 @@ jobs:
run: |
export DISPLAY=$(w -h | awk 'NR==1 {print $2}')
echo -e "Display ID: $DISPLAY"
npm config set registry ${{ secrets.NPM_PROXY }} --global
yarn config set registry ${{ secrets.NPM_PROXY }} --global
make test
# env:
# TURBO_API: '${{ secrets.TURBO_API }}'
# TURBO_TEAM: 'linux'
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
- uses: actions/upload-artifact@v4
if: always()
@ -327,7 +301,7 @@ jobs:
retention-days: 2
coverage-check:
runs-on: [self-hosted, Linux, ubuntu-desktop]
runs-on: ubuntu-latest
needs: base_branch_cov
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
@ -341,6 +315,9 @@ jobs:
with:
node-version: 20
- name: Install yarn
run: npm install -g yarn
- name: 'Cleanup cache'
continue-on-error: true
run: |
@ -356,15 +333,9 @@ jobs:
run: |
export DISPLAY=$(w -h | awk 'NR==1 {print $2}')
echo -e "Display ID: $DISPLAY"
npm config set registry ${{ secrets.NPM_PROXY }} --global
yarn config set registry ${{ secrets.NPM_PROXY }} --global
make lint
yarn build:test
yarn test:coverage
# env:
# TURBO_API: '${{ secrets.TURBO_API }}'
# TURBO_TEAM: 'linux'
# TURBO_TOKEN: '${{ secrets.TURBO_TOKEN }}'
- name: Generate Code Coverage report
id: code-coverage
@ -377,7 +348,7 @@ jobs:
show-annotations: 'warning'
test-on-ubuntu-pr-target:
runs-on: [self-hosted, Linux, ubuntu-desktop]
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Getting the repo
@ -400,6 +371,4 @@ jobs:
run: |
export DISPLAY=$(w -h | awk 'NR==1 {print $2}')
echo -e "Display ID: $DISPLAY"
npm config set registry https://registry.npmjs.org --global
yarn config set registry https://registry.npmjs.org --global
make test

View File

@ -1,4 +1,4 @@
name: Publish plugin models Package to npmjs
name: Publish core Package to npmjs
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+-core"]
@ -45,7 +45,7 @@ jobs:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: cd core && yarn install && yarn build
- run: cd core && corepack enable && corepack prepare yarn@4.5.3 --activate && yarn --version && yarn install && yarn build
- run: cd core && yarn publish --access public
if: github.event_name == 'push'

View File

@ -1,4 +1,4 @@
name: Publish plugin models Package to npmjs
name: Publish joi Package to npmjs
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+-joi"]
@ -45,7 +45,7 @@ jobs:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: cd joi && yarn install && yarn build
- run: cd joi && corepack enable && corepack prepare yarn@4.5.3 --activate && yarn --version && yarn install && yarn build
- run: cd joi && yarn publish --access public
if: github.event_name == 'push'

4
.gitignore vendored
View File

@ -8,7 +8,6 @@ error.log
node_modules
*.tgz
!charts/server/charts/*.tgz
yarn.lock
dist
build
.DS_Store
@ -48,3 +47,6 @@ coverage
test_results.html
*.tsbuildinfo
electron/shared/**
# docs
docs/yarn.lock

3
.yarnrc.yml Normal file
View File

@ -0,0 +1,3 @@
nmHoistingLimits: workspaces
nodeLinker: node-modules
checksumBehavior: update

View File

@ -10,20 +10,23 @@ REPORT_PORTAL_DESCRIPTION ?= "Jan App report"
all:
@echo "Specify a target to run"
# Config yarn version
config-yarn:
corepack enable
corepack prepare yarn@4.5.3 --activate
yarn --version
yarn config set -H enableImmutableInstalls false
# Builds the UI kit
build-joi:
ifeq ($(OS),Windows_NT)
cd joi && yarn config set network-timeout 300000 && yarn install && yarn build
else
build-joi: config-yarn
cd joi && yarn install && yarn build
endif
# Installs yarn dependencies and builds core and extensions
install-and-build: build-joi
ifeq ($(OS),Windows_NT)
yarn config set network-timeout 300000
echo "skip"
endif
yarn global add turbo@1.13.2
yarn build:core
yarn build:server
yarn install
@ -117,9 +120,8 @@ build: check-file-counts
clean:
ifeq ($(OS),Windows_NT)
-powershell -Command "Get-ChildItem -Path . -Include node_modules, .next, dist, build, out, .turbo -Recurse -Directory | Remove-Item -Recurse -Force"
-powershell -Command "Get-ChildItem -Path . -Include package-lock.json -Recurse -File | Remove-Item -Recurse -Force"
-powershell -Command "Get-ChildItem -Path . -Include yarn.lock -Recurse -File | Remove-Item -Recurse -Force"
-powershell -Command "Get-ChildItem -Path . -Include node_modules, .next, dist, build, out, .turbo, .yarn -Recurse -Directory | Remove-Item -Recurse -Force"
-powershell -Command "Get-ChildItem -Path . -Include package-lock.json, tsconfig.tsbuildinfo -Recurse -File | Remove-Item -Recurse -Force"
-powershell -Command "Remove-Item -Recurse -Force ./pre-install/*.tgz"
-powershell -Command "Remove-Item -Recurse -Force ./extensions/*/*.tgz"
-powershell -Command "Remove-Item -Recurse -Force ./electron/pre-install/*.tgz"
@ -131,8 +133,8 @@ else ifeq ($(shell uname -s),Linux)
find . -name "build" -type d -exec rm -rf '{}' +
find . -name "out" -type d -exec rm -rf '{}' +
find . -name ".turbo" -type d -exec rm -rf '{}' +
find . -name ".yarn" -type d -exec rm -rf '{}' +
find . -name "packake-lock.json" -type f -exec rm -rf '{}' +
find . -name "yarn.lock" -type f -exec rm -rf '{}' +
find . -name "package-lock.json" -type f -exec rm -rf '{}' +
rm -rf ./pre-install/*.tgz
rm -rf ./extensions/*/*.tgz
@ -146,8 +148,8 @@ else
find . -name "build" -type d -exec rm -rf '{}' +
find . -name "out" -type d -exec rm -rf '{}' +
find . -name ".turbo" -type d -exec rm -rf '{}' +
find . -name ".yarn" -type d -exec rm -rf '{}' +
find . -name "package-lock.json" -type f -exec rm -rf '{}' +
find . -name "yarn.lock" -type f -exec rm -rf '{}' +
rm -rf ./pre-install/*.tgz
rm -rf ./extensions/*/*.tgz
rm -rf ./electron/pre-install/*.tgz

View File

@ -8,8 +8,9 @@
],
"homepage": "https://jan.ai",
"license": "AGPL-3.0",
"browser": "dist/core.es5.js",
"main": "dist/core.es5.js",
"module": "dist/core.cjs.js",
"module": "dist/index.cjs.js",
"typings": "dist/types/index.d.ts",
"files": [
"dist",
@ -36,18 +37,24 @@
"lint": "tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
"test": "jest",
"prebuild": "rimraf dist",
"build": "tsc --module commonjs && rollup -c rollup.config.ts",
"start": "rollup -c rollup.config.ts -w"
"build": "rollup -c rollup.config.ts"
},
"devDependencies": {
"@npmcli/arborist": "^9.0.0",
"@rollup/plugin-replace": "^5.0.5",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.4",
"@types/jest": "^29.5.14",
"@types/node": "^22.10.0",
"@types/pacote": "^11.1.8",
"@types/request": "^2.48.12",
"electron": "33.2.1",
"eslint": "8.57.0",
"eslint-plugin-jest": "^27.9.0",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"jest-runner": "^29.7.0",
"pacote": "^21.0.0",
"request": "^2.88.2",
"request-progress": "^3.0.0",
"rimraf": "^3.0.2",
"rollup": "^2.38.5",
"rollup-plugin-commonjs": "^9.1.8",
@ -62,5 +69,6 @@
"dependencies": {
"rxjs": "^7.8.1",
"ulidx": "^2.3.0"
}
},
"packageManager": "yarn@4.5.3"
}

View File

@ -23,9 +23,12 @@ export default [
// Allow json resolution
json(),
// Compile TypeScript files
typescript({ useTsconfigDeclarationDir: true }),
typescript({
useTsconfigDeclarationDir: true,
exclude: ['**/*.test.ts', 'src/node/**'],
}),
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs(),
// commonjs(),
// Allow node_modules resolution, so you can use 'external' to control
// which external modules to include in the bundle
// https://github.com/rollup/rollup-plugin-node-resolve#usage
@ -44,7 +47,9 @@ export default [
},
{
input: `src/node/index.ts`,
output: [{ file: 'dist/node/index.cjs.js', format: 'cjs', sourcemap: true }],
output: [
{ file: 'dist/node/index.cjs.js', format: 'cjs', sourcemap: true },
],
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: [
'fs/promises',
@ -70,7 +75,10 @@ export default [
// Allow json resolution
json(),
// Compile TypeScript files
typescript({ useTsconfigDeclarationDir: true }),
typescript({
useTsconfigDeclarationDir: true,
exclude: ['**/*.test.ts', 'src/browser/**'],
}),
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs(),
// Allow node_modules resolution, so you can use 'external' to control

View File

@ -4,16 +4,6 @@ jest.mock('../../helper', () => ({
}))
import { App } from './app'
it('should call stopServer', () => {
const app = new App()
const stopServerMock = jest.fn().mockResolvedValue('Server stopped')
jest.mock('@janhq/server', () => ({
stopServer: stopServerMock,
}))
app.stopServer()
expect(stopServerMock).toHaveBeenCalled()
})
it('should correctly retrieve basename', () => {
const app = new App()
const result = app.baseName('/path/to/file.txt')
@ -23,7 +13,8 @@ it('should correctly retrieve basename', () => {
it('should correctly identify subdirectories', () => {
const app = new App()
const basePath = process.platform === 'win32' ? 'C:\\path\\to' : '/path/to'
const subPath = process.platform === 'win32' ? 'C:\\path\\to\\subdir' : '/path/to/subdir'
const subPath =
process.platform === 'win32' ? 'C:\\path\\to\\subdir' : '/path/to/subdir'
const result = app.isSubdirectory(basePath, subPath)
expect(result).toBe(true)
})
@ -31,7 +22,8 @@ it('should correctly identify subdirectories', () => {
it('should correctly join multiple paths', () => {
const app = new App()
const result = app.joinPath(['path', 'to', 'file'])
const expectedPath = process.platform === 'win32' ? 'path\\to\\file' : 'path/to/file'
const expectedPath =
process.platform === 'win32' ? 'path\\to\\file' : 'path/to/file'
expect(result).toBe(expectedPath)
})
@ -52,5 +44,7 @@ it('should retrieve the directory name from a file path (Unix/Windows)', async (
it('should retrieve the directory name when using file protocol', async () => {
const app = new App()
const path = 'file:/models/file.txt'
expect(await app.dirName(path)).toBe(process.platform === 'win32' ? 'app\\models' : 'app/models')
expect(await app.dirName(path)).toBe(
process.platform === 'win32' ? 'app\\models' : 'app/models'
)
})

View File

@ -13,9 +13,8 @@
"declarationDir": "dist/types",
"outDir": "dist/lib",
"importHelpers": true,
"types": ["@types/jest"],
"resolveJsonModule": true
"types": ["jest", "node"]
},
"include": ["src"],
"exclude": ["**/*.test.ts"]
"exclude": ["*.test.ts"]
}

View File

@ -58,5 +58,5 @@
"prettier": "^3.2.5",
"typescript": "^5"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
"packageManager": "yarn@1.22.22"
}

0
docs/yarn.lock Normal file
View File

View File

@ -78,7 +78,7 @@
},
"scripts": {
"lint": "eslint . --ext \".js,.jsx,.ts,.tsx\"",
"test:e2e": "playwright test --workers=1",
"test:e2e": "DEBUG=pw:browser xvfb-maybe -- playwright test --workers=1",
"copy:assets": "rimraf --glob \"./pre-install/*.tgz\" && cpx \"../pre-install/*.tgz\" \"./pre-install\"",
"dev": "yarn copy:assets && tsc -p . && electron .",
"compile": "tsc -p .",
@ -98,8 +98,9 @@
},
"dependencies": {
"@alumna/reflect": "^1.1.3",
"@janhq/core": "link:./core",
"@janhq/server": "link:./server",
"@janhq/core": "link:../core",
"@janhq/server": "link:../server",
"@kirillvakalov/nut-tree__nut-js": "4.2.1-2",
"@npmcli/arborist": "^7.1.0",
"electron-store": "^8.1.0",
"electron-updater": "^6.1.7",
@ -108,12 +109,12 @@
"pacote": "^17.0.4",
"request": "^2.88.2",
"request-progress": "^3.0.0",
"ulidx": "^2.3.0",
"@kirillvakalov/nut-tree__nut-js": "4.2.1-2"
"ulidx": "^2.3.0"
},
"devDependencies": {
"@electron/notarize": "^2.5.0",
"@playwright/test": "^1.38.1",
"@reportportal/agent-js-playwright": "^5.1.7",
"@types/npmcli__arborist": "^5.6.4",
"@types/pacote": "^11.1.7",
"@types/request": "^2.48.12",
@ -129,9 +130,10 @@
"rimraf": "^5.0.5",
"run-script-os": "^1.1.6",
"typescript": "^5.3.3",
"@reportportal/agent-js-playwright": "^5.1.7"
"xvfb-maybe": "^0.2.1"
},
"installConfig": {
"hoistingLimits": "workspaces"
}
},
"packageManager": "yarn@4.5.3"
}

View File

@ -36,7 +36,7 @@ export async function setupElectron() {
expect(appInfo).toBeTruthy()
electronApp = await electron.launch({
args: [appInfo.main], // main file from package.json
args: [appInfo.main, '--no-sandbox'], // main file from package.json
executablePath: appInfo.executable, // path to the Electron executable
// recordVideo: { dir: Constants.VIDEO_DIR }, // Specify the directory for video recordings
})

3
extensions/.yarnrc.yml Normal file
View File

@ -0,0 +1,3 @@
nmHoistingLimits: workspaces
nodeLinker: node-modules
checksumBehavior: update

View File

@ -11,9 +11,9 @@
"clean:modules": "rimraf node_modules/pdf-parse/test && cd node_modules/pdf-parse/lib/pdf.js && rimraf v1.9.426 v1.10.88 v2.0.550",
"build-universal-hnswlib": "cd node_modules/hnswlib-node && arch -x86_64 npx node-gyp rebuild --arch=x64 && mv build/Release/addon.node ./addon-amd64.node && node-gyp rebuild --arch=arm64 && mv build/Release/addon.node ./addon-arm64.node && lipo -create -output build/Release/addon.node ./addon-arm64.node ./addon-amd64.node && rm ./addon-arm64.node && rm ./addon-amd64.node",
"build": "yarn clean:modules && tsc --module commonjs && rollup -c rollup.config.ts",
"build:publish:linux": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install",
"build:publish:darwin": "rimraf *.tgz --glob && yarn build-universal-hnswlib && yarn build && ../../.github/scripts/auto-sign.sh && npm pack && cpx *.tgz ../../pre-install",
"build:publish:win32": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install",
"build:publish:linux": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install",
"build:publish:darwin": "rimraf *.tgz --glob || true && yarn build-universal-hnswlib && yarn build && ../../.github/scripts/auto-sign.sh && npm pack && cpx *.tgz ../../pre-install",
"build:publish:win32": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install",
"build:publish": "run-script-os"
},
"devDependencies": {
@ -28,14 +28,15 @@
"rollup-plugin-define": "^1.0.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-typescript2": "^0.36.0",
"typescript": "^5.3.3",
"run-script-os": "^1.1.6"
"run-script-os": "^1.1.6",
"typescript": "^5.3.3"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"@langchain/community": "0.0.13",
"hnswlib-node": "^1.4.2",
"langchain": "^0.0.214",
"node-gyp": "^11.0.0",
"pdf-parse": "^1.1.1",
"ts-loader": "^9.5.0"
},
@ -47,5 +48,9 @@
"bundleDependencies": [
"@janhq/core",
"hnswlib-node"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -9,7 +9,7 @@
"scripts": {
"test": "jest",
"build": "tsc -b . && webpack --config webpack.config.js",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install"
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install"
},
"exports": {
".": "./dist/index.js",
@ -19,11 +19,12 @@
"cpx": "^1.5.0",
"rimraf": "^3.0.2",
"ts-loader": "^9.5.0",
"typescript": "^5.7.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"ky": "^1.7.2",
"p-queue": "^8.0.1"
},
@ -35,5 +36,9 @@
"package.json",
"README.md"
],
"bundleDependencies": []
"bundleDependencies": [],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -11,7 +11,7 @@
"scripts": {
"test": "jest test",
"build": "tsc -b . && webpack --config webpack.config.js",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install",
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install",
"sync:core": "cd ../.. && yarn build:core && cd extensions && rm yarn.lock && cd inference-anthropic-extension && yarn && yarn build:publish"
},
"exports": {
@ -21,12 +21,13 @@
"devDependencies": {
"cpx": "^1.5.0",
"rimraf": "^3.0.2",
"ts-loader": "^9.5.0",
"typescript": "^5.7.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"ts-loader": "^9.5.0"
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"fetch-retry": "^5.0.6",
"ulidx": "^2.3.0"
},
@ -40,5 +41,9 @@
],
"bundleDependencies": [
"fetch-retry"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -10,7 +10,7 @@
"license": "AGPL-3.0",
"scripts": {
"build": "tsc -b . && webpack --config webpack.config.js",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install",
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install",
"sync:core": "cd ../.. && yarn build:core && cd extensions && rm yarn.lock && cd inference-cohere-extension && yarn && yarn build:publish"
},
"exports": {
@ -20,12 +20,13 @@
"devDependencies": {
"cpx": "^1.5.0",
"rimraf": "^3.0.2",
"ts-loader": "^9.5.0",
"typescript": "^5.7.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"ts-loader": "^9.5.0"
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"fetch-retry": "^5.0.6",
"ulidx": "^2.3.0"
},
@ -39,5 +40,9 @@
],
"bundleDependencies": [
"fetch-retry"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -13,8 +13,8 @@
"downloadcortex:linux:darwin": "./download.sh",
"downloadcortex:win32": "download.bat",
"downloadcortex": "run-script-os",
"build:publish:darwin": "rimraf *.tgz --glob && yarn build && npm run downloadcortex && ../../.github/scripts/auto-sign.sh && cpx \"bin/**\" \"dist/bin\" && npm pack && cpx *.tgz ../../pre-install",
"build:publish:win32:linux": "rimraf *.tgz --glob && yarn build && npm run downloadcortex && cpx \"bin/**\" \"dist/bin\" && npm pack && cpx *.tgz ../../pre-install",
"build:publish:darwin": "rimraf *.tgz --glob || true && yarn build && yarn downloadcortex && ../../.github/scripts/auto-sign.sh && cpx \"bin/**\" \"dist/bin\" && npm pack && cpx *.tgz ../../pre-install",
"build:publish:win32:linux": "rimraf *.tgz --glob || true && yarn build && yarn downloadcortex && cpx \"bin/**\" \"dist/bin\" && npm pack && cpx *.tgz ../../pre-install",
"build:publish": "run-script-os"
},
"exports": {
@ -46,7 +46,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"cpu-instructions": "^0.0.13",
"decompress": "^4.2.1",
"fetch-retry": "^5.0.6",
@ -71,5 +71,9 @@
"@janhq/core",
"decompress",
"cpu-instructions"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -9,7 +9,7 @@
"license": "AGPL-3.0",
"scripts": {
"build": "tsc -b . && webpack --config webpack.config.js",
"build:publish": "rimraf *.tgz --glob && npm run build && npm pack && cpx *.tgz ../../pre-install"
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install"
},
"exports": {
".": "./dist/index.js",
@ -18,12 +18,13 @@
"devDependencies": {
"cpx": "^1.5.0",
"rimraf": "^3.0.2",
"ts-loader": "^9.5.0",
"typescript": "^5.7.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"ts-loader": "^9.5.0"
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"fetch-retry": "^5.0.6",
"ulidx": "^2.3.0"
},
@ -37,5 +38,9 @@
],
"bundleDependencies": [
"fetch-retry"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -10,7 +10,7 @@
"license": "AGPL-3.0",
"scripts": {
"build": "tsc -b . && webpack --config webpack.config.js",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install"
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install"
},
"exports": {
".": "./dist/index.js",
@ -19,12 +19,13 @@
"devDependencies": {
"cpx": "^1.5.0",
"rimraf": "^3.0.2",
"ts-loader": "^9.5.0",
"typescript": "^5.7.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"ts-loader": "^9.5.0"
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"fetch-retry": "^5.0.6",
"ulidx": "^2.3.0"
},
@ -38,5 +39,9 @@
],
"bundleDependencies": [
"fetch-retry"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -10,7 +10,7 @@
"license": "AGPL-3.0",
"scripts": {
"build": "tsc -b . && webpack --config webpack.config.js",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install"
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install"
},
"exports": {
".": "./dist/index.js",
@ -19,12 +19,13 @@
"devDependencies": {
"cpx": "^1.5.0",
"rimraf": "^3.0.2",
"ts-loader": "^9.5.0",
"typescript": "^5.7.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"ts-loader": "^9.5.0"
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"fetch-retry": "^5.0.6",
"path-browserify": "^1.0.1",
"ulidx": "^2.3.0"
@ -39,5 +40,9 @@
],
"bundleDependencies": [
"fetch-retry"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -10,7 +10,7 @@
"license": "AGPL-3.0",
"scripts": {
"build": "tsc -b . && webpack --config webpack.config.js",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install"
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install"
},
"exports": {
".": "./dist/index.js",
@ -19,12 +19,13 @@
"devDependencies": {
"cpx": "^1.5.0",
"rimraf": "^3.0.2",
"ts-loader": "^9.5.0",
"typescript": "^5.7.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"ts-loader": "^9.5.0"
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"fetch-retry": "^5.0.6",
"path-browserify": "^1.0.1",
"ulidx": "^2.3.0"
@ -39,5 +40,9 @@
],
"bundleDependencies": [
"fetch-retry"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -10,7 +10,7 @@
"license": "AGPL-3.0",
"scripts": {
"build": "tsc -b . && webpack --config webpack.config.js",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install"
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install"
},
"exports": {
".": "./dist/index.js",
@ -19,12 +19,13 @@
"devDependencies": {
"cpx": "^1.5.0",
"rimraf": "^3.0.2",
"ts-loader": "^9.5.0",
"typescript": "^5.7.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"ts-loader": "^9.5.0"
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"fetch-retry": "^5.0.6",
"ulidx": "^2.3.0"
},
@ -38,5 +39,9 @@
],
"bundleDependencies": [
"fetch-retry"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -10,7 +10,7 @@
"license": "AGPL-3.0",
"scripts": {
"build": "tsc -b . && webpack --config webpack.config.js",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install",
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install",
"sync:core": "cd ../.. && yarn build:core && cd extensions && rm yarn.lock && cd inference-openrouter-extension && yarn && yarn build:publish"
},
"exports": {
@ -20,12 +20,13 @@
"devDependencies": {
"cpx": "^1.5.0",
"rimraf": "^3.0.2",
"ts-loader": "^9.5.0",
"typescript": "^5.7.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"ts-loader": "^9.5.0"
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"fetch-retry": "^5.0.6",
"ulidx": "^2.3.0"
},
@ -39,5 +40,9 @@
],
"bundleDependencies": [
"fetch-retry"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -9,7 +9,7 @@
"license": "AGPL-3.0",
"scripts": {
"build": "tsc -b . && webpack --config webpack.config.js",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install"
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install"
},
"exports": {
".": "./dist/index.js",
@ -19,12 +19,12 @@
"cpx": "^1.5.0",
"rimraf": "^3.0.2",
"ts-loader": "^9.5.0",
"typescript": "5.3.3",
"typescript": "^5.7.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"fetch-retry": "^5.0.6",
"rxjs": "^7.8.1",
"ulidx": "^2.3.0"
@ -39,5 +39,9 @@
],
"bundleDependencies": [
"fetch-retry"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -9,7 +9,7 @@
"scripts": {
"test": "jest",
"build": "tsc --module commonjs && rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install"
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
@ -35,9 +35,13 @@
"README.md"
],
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"ky": "^1.7.2",
"p-queue": "^8.0.1"
},
"bundleDependencies": []
"bundleDependencies": [],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -8,12 +8,12 @@
"author": "Jan <service@jan.ai>",
"license": "AGPL-3.0",
"scripts": {
"build": "tsc --module commonjs && rollup -c rollup.config.ts && npm run download-artifacts",
"build": "tsc --module commonjs && rollup -c rollup.config.ts && yarn download-artifacts",
"download-artifacts": "run-script-os && cpx \"bin/**\" \"dist/bin\"",
"download-artifacts:darwin": "echo 'No artifacts to download for darwin'",
"download-artifacts:win32": "download.bat",
"download-artifacts:linux": "download https://catalog.jan.ai/vulkaninfo -o ./bin && chmod +x ./bin/vulkaninfo",
"build:publish": "rimraf *.tgz --glob && yarn build && npm pack && cpx *.tgz ../../pre-install"
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install"
},
"exports": {
".": "./dist/index.js",
@ -25,18 +25,18 @@
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/node": "^20.11.4",
"@types/node-os-utils": "^1.3.4",
"run-script-os": "^1.1.6",
"cpx": "^1.5.0",
"download-cli": "^1.1.1",
"rimraf": "^3.0.2",
"rollup": "^2.38.5",
"rollup-plugin-define": "^1.0.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-typescript2": "^0.36.0",
"typescript": "^5.3.3",
"download-cli": "^1.1.1"
"run-script-os": "^1.1.6",
"typescript": "^5.3.3"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"@rollup/plugin-replace": "^5.0.5",
"node-os-utils": "^1.3.7"
},
@ -48,5 +48,9 @@
"bundleDependencies": [
"node-os-utils",
"@janhq/core"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -3,9 +3,10 @@
"workspaces": {
"packages": [
"**"
],
"nohoist": [
"**"
]
}
},
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -24,10 +24,7 @@
"scripts": {
"test": "jest",
"build": "tsc --module commonjs && rollup -c rollup.config.ts",
"build:publish:win32": "rimraf *.tgz --glob && yarn build && cpx \"bin/**\" \"dist/bin\" && npm pack && cpx *.tgz ../../pre-install",
"build:publish:linux": "rimraf *.tgz --glob && yarn build && cpx \"bin/**\" \"dist/bin\" && npm pack && cpx *.tgz ../../pre-install",
"build:publish:darwin": "rimraf *.tgz --glob && yarn build && cpx \"bin/**\" \"dist/bin\" && npm pack && cpx *.tgz ../../pre-install",
"build:publish": "run-script-os"
"build:publish": "rimraf *.tgz --glob || true && yarn build && cpx \"bin/**\" \"dist/bin\" && npm pack && cpx *.tgz ../../pre-install"
},
"exports": {
".": "./dist/index.js",
@ -39,26 +36,26 @@
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@types/decompress": "4.2.7",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.4",
"@types/os-utils": "^0.0.4",
"@types/tcp-port-used": "^1.0.4",
"cpx": "^1.5.0",
"download-cli": "^1.1.1",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"jest-runner": "^29.7.0",
"rimraf": "^3.0.2",
"rollup": "^2.38.5",
"rollup-plugin-define": "^1.0.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-typescript2": "^0.36.0",
"run-script-os": "^1.1.6",
"typescript": "^5.2.2",
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"jest-runner": "^29.7.0",
"ts-jest": "^29.2.5"
"ts-jest": "^29.2.5",
"typescript": "^5.2.2"
},
"dependencies": {
"@janhq/core": "file:../../core",
"@janhq/core": "../../core/package.tgz",
"decompress": "^4.2.1",
"fetch-retry": "^5.0.6",
"rxjs": "^7.8.1",
@ -80,5 +77,9 @@
"decompress",
"@janhq/core",
"terminate"
]
],
"installConfig": {
"hoistingLimits": "workspaces"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -1,17 +0,0 @@
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"build:publish": {
"dependsOn": ["build"],
"outputs": ["**.tgz"]
},
"dev": {
"cache": false
},
"type-check": {}
}
}

9384
extensions/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,7 @@
{
"name": "@janhq/joi",
"version": "0.0.0",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"main": "dist/esm/index.js",
"types": "dist/index.d.ts",
"description": "A collection of UI component",
"files": [
@ -20,7 +19,7 @@
"bugs": "https://github.com/codecentrum/piksel/issues",
"scripts": {
"dev": "rollup -c -w",
"build": "rimraf ./dist && rollup -c",
"build": "rimraf ./dist || true && rollup -c",
"test": "jest"
},
"peerDependencies": {
@ -41,29 +40,38 @@
"@types/jest": "^29.5.12",
"autoprefixer": "10.4.16",
"jest": "^29.7.0",
"rollup-plugin-sass": "^1.14.0",
"tailwind-merge": "^2.2.0",
"tailwindcss": "^3.4.1",
"ts-jest": "^29.2.5"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@testing-library/dom": "^10.4.0",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-terser": "0.4.4",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"@types/react": "^18.3.12",
"@types/react-dom": "^19",
"class-variance-authority": "^0.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-transform-css": "^6.0.1",
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.6",
"rollup": "^4.12.0",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-typescript2": "^0.36.0"
}
"react": "^19.0.0",
"react-dom": "^19.0.0",
"rimraf": "^6.0.1",
"rollup": "4.12.0",
"rollup-plugin-bundle-size": "1.0.3",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-copy": "3.5.0",
"rollup-plugin-dts": "6.1.0",
"rollup-plugin-peer-deps-external": "2.2.4",
"rollup-plugin-postcss": "4.0.2",
"rollup-plugin-typescript2": "0.36.0",
"typescript": "^5.7.2"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -11,6 +11,7 @@ import tailwindcss from 'tailwindcss'
import typescriptEngine from 'typescript'
import resolve from '@rollup/plugin-node-resolve'
import copy from 'rollup-plugin-copy'
import sass from 'rollup-plugin-sass'
const packageJson = JSON.parse(readFileSync('./package.json'))
@ -22,18 +23,12 @@ export default [
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: false,
exports: 'named',
name: packageJson.name,
},
{
file: packageJson.module,
format: 'es',
exports: 'named',
sourcemap: false,
},
],
external: ['react', 'typescript', 'class-variance-authority'],
plugins: [
postcss({
plugins: [autoprefixer(), tailwindcss(tailwindConfig)],
@ -46,16 +41,24 @@ export default [
minimize: true,
extract: 'main.css',
}),
peerDepsExternal({ includeDependencies: true }),
resolve(),
commonjs(),
resolve(),
typescript({
tsconfig: './tsconfig.json',
typescript: typescriptEngine,
sourceMap: false,
exclude: ['docs', 'dist', 'node_modules/**'],
exclude: [
'docs',
'dist',
'node_modules/**',
'**/*.test.ts',
'**/*.test.tsx',
],
}),
terser(),
sass(),
],
watch: {
clearScreen: false,

View File

@ -13,5 +13,5 @@
"esModuleInterop": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
"exclude": ["node_modules", "*.test.ts"]
}

View File

@ -8,13 +8,6 @@
"electron",
"web",
"server"
],
"nohoist": [
"joi",
"core",
"electron",
"web",
"server"
]
},
"scripts": {
@ -23,22 +16,18 @@
"test:coverage": "jest --coverage",
"test": "yarn workspace jan test:e2e",
"test-local": "yarn lint && yarn build:test && yarn test",
"pre-install:darwin": "find extensions -type f -path \"**/*.tgz\" -exec cp {} pre-install \\;",
"pre-install:linux": "find extensions -type f -path \"**/*.tgz\" -exec cp {} pre-install \\;",
"pre-install:win32": "powershell -Command \"Get-ChildItem -Path \"extensions\" -Recurse -File -Filter \"*.tgz\" | ForEach-Object { Copy-Item -Path $_.FullName -Destination \"pre-install\" }\"",
"pre-install": "run-script-os",
"copy:assets": "cpx \"pre-install/*.tgz\" \"electron/pre-install/\" && cpx \"themes/**\" \"electron/themes\"",
"dev:electron": "yarn copy:assets && yarn workspace jan dev",
"dev:web": "yarn workspace @janhq/web dev",
"dev:server": "yarn workspace @janhq/server dev",
"dev": "turbo run dev --parallel --filter=!@janhq/server",
"dev": "concurrently \"yarn dev:web\" \"yarn dev:electron\"",
"build:server": "cd server && yarn install && yarn run build",
"build:core": "cd core && yarn install && yarn run build",
"build:core": "cd core && yarn install && yarn run build && yarn pack",
"build:web": "yarn workspace @janhq/web build && cpx \"web/out/**\" \"electron/renderer/\"",
"build:electron": "yarn copy:assets && yarn workspace jan build",
"build:electron:test": "yarn workspace jan build:test",
"build:extensions": "rimraf ./pre-install/*.tgz && turbo run @janhq/core#build && cd extensions && yarn install && turbo run build:publish && cd .. && yarn pre-install",
"build:test": "yarn copy:assets && turbo run @janhq/web#build && cpx \"web/out/**\" \"electron/renderer/\" && turbo run build:test",
"build:extensions": "rimraf ./pre-install/*.tgz || true && yarn workspace @janhq/core build && cd extensions && yarn install && yarn workspaces foreach -Apt run build:publish",
"build:test": "yarn copy:assets && yarn workspace @janhq/web build && cpx \"web/out/**\" \"electron/renderer/\" && yarn workspace jan build:test",
"build": "yarn build:web && yarn build:electron",
"build:publish": "yarn copy:assets && yarn build:web && yarn workspace jan build:publish",
"dev:joi": "yarn workspace @janhq/joi install && yarn workspace @janhq/joi dev",
@ -46,12 +35,21 @@
"prepare": "husky"
},
"devDependencies": {
"concurrently": "^8.2.1",
"concurrently": "^9.1.0",
"cpx": "^1.5.0",
"husky": "^9.1.5",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"rimraf": "^3.0.2",
"run-script-os": "^1.1.6",
"wait-on": "^7.0.1"
},
"version": "0.0.0"
"version": "0.0.0",
"installConfig": {
"hoistingLimits": "workspaces"
},
"resolutions": {
"yallist": "4.0.0"
},
"packageManager": "yarn@4.5.3"
}

View File

@ -25,7 +25,7 @@
"@fastify/static": "^6.12.0",
"@fastify/swagger": "^9.4.0",
"@fastify/swagger-ui": "5.2.0",
"@janhq/core": "link:./core",
"@janhq/core": "link:../core",
"@npmcli/arborist": "^7.3.1",
"dotenv": "^16.3.1",
"fastify": "^5.2.0",
@ -44,5 +44,6 @@
"eslint-plugin-react": "^7.34.0",
"run-script-os": "^1.1.6",
"typescript": "^5.3.3"
}
},
"packageManager": "yarn@4.5.3"
}

View File

@ -1,50 +0,0 @@
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
"outputs": [".next/**", "!.next/cache/**", "dist/**"]
},
"dev": {
"cache": false
},
"@janhq/web#dev": {
"cache": false,
"persistent": true,
"dependsOn": ["@janhq/core#build", "@janhq/joi#build"]
},
"@janhq/server#build": {
"outputs": ["dist/**"],
"dependsOn": ["@janhq/core#build"]
},
"jan#dev": {
"cache": false,
"persistent": true,
"dependsOn": ["@janhq/core#build", "@janhq/server#build"]
},
"@janhq/core#build": {
"outputs": ["dist/**"]
},
"@janhq/web#build": {
"outputs": ["out/**"],
"dependsOn": ["@janhq/core#build", "@janhq/joi#build"]
},
"jan#build": {
"outputs": ["dist/**"],
"dependsOn": [
"@janhq/core#build",
"@janhq/server#build",
"@janhq/web#build"
]
},
"jan#build:test": {
"outputs": ["dist/**"],
"cache": false,
"dependsOn": [
"@janhq/core#build",
"@janhq/server#build",
"@janhq/web#build"
]
},
"type-check": {}
}
}

View File

@ -6,6 +6,7 @@ import CopyOverInstruction from './index'
// Mock the `useAtom` hook from jotai
jest.mock('jotai', () => ({
useAtom: jest.fn(),
atom: jest.fn(),
}))
describe('CopyOverInstruction', () => {

View File

@ -2,14 +2,8 @@ import { ChangeEvent, useCallback } from 'react'
import { Switch } from '@janhq/joi'
import { useAtom } from 'jotai'
import { atomWithStorage } from 'jotai/utils'
const COPY_OVER_INSTRUCTION_ENABLED = 'copy_over_instruction_enabled'
export const copyOverInstructionEnabledAtom = atomWithStorage(
COPY_OVER_INSTRUCTION_ENABLED,
false
)
import { copyOverInstructionEnabledAtom } from '@/helpers/atoms/App.atom'
const CopyOverInstruction: React.FC = () => {
const [copyOverInstructionEnabled, setCopyOverInstructionEnabled] = useAtom(

View File

@ -1,3 +1,6 @@
/**
* @jest-environment jsdom
*/
import '@testing-library/jest-dom'
import React from 'react'
import { render, screen, waitFor } from '@testing-library/react'

View File

@ -23,3 +23,10 @@ export const showRightPanelAtom = atomWithStorage<boolean>(
export const showSystemMonitorPanelAtom = atom<boolean>(false)
export const appDownloadProgressAtom = atom<number>(-1)
export const updateVersionErrorAtom = atom<string | undefined>(undefined)
const COPY_OVER_INSTRUCTION_ENABLED = 'copy_over_instruction_enabled'
export const copyOverInstructionEnabledAtom = atomWithStorage(
COPY_OVER_INSTRUCTION_ENABLED,
false
)

View File

@ -14,7 +14,6 @@ import { atom, useAtom, useAtomValue, useSetAtom } from 'jotai'
import { useDebouncedCallback } from 'use-debounce'
import { copyOverInstructionEnabledAtom } from '@/containers/CopyInstruction'
import { fileUploadAtom } from '@/containers/Providers/Jotai'
import { toaster } from '@/containers/Toast'
@ -27,6 +26,7 @@ import useRecommendedModel from './useRecommendedModel'
import useSetActiveThread from './useSetActiveThread'
import { extensionManager } from '@/extension'
import { copyOverInstructionEnabledAtom } from '@/helpers/atoms/App.atom'
import { experimentalFeatureEnabledAtom } from '@/helpers/atoms/AppConfig.atom'
import { activeAssistantAtom } from '@/helpers/atoms/Assistant.atom'

View File

@ -1,3 +1,7 @@
/**
* @jest-environment jsdom
*/
import { renderHook, act } from '@testing-library/react'
import { useAtom, useAtomValue, useSetAtom } from 'jotai'
import useDeleteThread from './useDeleteThread'

View File

@ -18,6 +18,9 @@ const config = {
'rehype-katex': '<rootDir>/mock/empty-mock.tsx',
'rehype-raw': '<rootDir>/mock/empty-mock.tsx',
'remark-math': '<rootDir>/mock/empty-mock.tsx',
'^react$': '<rootDir>/node_modules/react',
'^react/jsx-runtime$': '<rootDir>/node_modules/react/jsx-runtime',
'^react-dom$': '<rootDir>/node_modules/react-dom',
},
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],

View File

@ -14,8 +14,9 @@
"test": "jest"
},
"dependencies": {
"@janhq/core": "link:./core",
"@janhq/joi": "link:./joi",
"@janhq/core": "link:../core",
"@janhq/joi": "link:../joi",
"@radix-ui/react-icons": "^1.3.2",
"@tanstack/react-virtual": "^3.10.9",
"@uppy/core": "^4.3.0",
"@uppy/react": "^4.0.4",
@ -59,7 +60,10 @@
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.0.1",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.14.200",
"@types/node": "20.8.10",
@ -89,5 +93,6 @@
},
"resolutions": {
"highlight.js": "11.10.0"
}
},
"packageManager": "yarn@4.5.3"
}

20629
yarn.lock Normal file

File diff suppressed because it is too large Load Diff