-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4363 from janhq/chore/reduce-extensions-build-time
chore: refactor extensions build script for optimization
- Loading branch information
Showing
78 changed files
with
747 additions
and
2,368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,27 @@ | ||
{ | ||
"name": "@janhq/assistant-extension", | ||
"productName": "Jan Assistant", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "This extension enables assistants, including Jan, a default assistant that can call all downloaded models", | ||
"main": "dist/index.js", | ||
"node": "dist/node/index.js", | ||
"author": "Jan <[email protected]>", | ||
"license": "AGPL-3.0", | ||
"scripts": { | ||
"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-universal-hnswlib": "[ \"$IS_TEST\" = \"true\" ] && echo \"Skip universal build\" || (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 && rolldown -c rolldown.config.mjs", | ||
"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" | ||
"build:publish": "run-script-os", | ||
"build:dev": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^25.0.7", | ||
"@rollup/plugin-json": "^6.1.0", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@rollup/plugin-replace": "^5.0.5", | ||
"@types/pdf-parse": "^1.1.4", | ||
"cpx": "^1.5.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", | ||
"rolldown": "1.0.0-beta.1", | ||
"run-script-os": "^1.1.6", | ||
"typescript": "^5.3.3" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { defineConfig } from 'rolldown' | ||
import pkgJson from './package.json' with { type: 'json' } | ||
|
||
export default defineConfig([ | ||
{ | ||
input: 'src/index.ts', | ||
output: { | ||
format: 'esm', | ||
file: 'dist/index.js', | ||
}, | ||
platform: 'browser', | ||
define: { | ||
NODE: JSON.stringify(`${pkgJson.name}/${pkgJson.node}`), | ||
VERSION: JSON.stringify(pkgJson.version), | ||
}, | ||
}, | ||
{ | ||
input: 'src/node/index.ts', | ||
external: ['@janhq/core/node', 'path', 'hnswlib-node'], | ||
output: { | ||
format: 'cjs', | ||
file: 'dist/node/index.js', | ||
sourcemap: false, | ||
inlineDynamicImports: true, | ||
}, | ||
resolve: { | ||
extensions: ['.js', '.ts'], | ||
}, | ||
platform: 'node', | ||
}, | ||
]) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from 'rolldown' | ||
|
||
export default defineConfig({ | ||
input: 'src/index.ts', | ||
output: { | ||
format: 'esm', | ||
file: 'dist/index.js', | ||
}, | ||
platform: 'browser', | ||
define: { | ||
API_URL: JSON.stringify('http://127.0.0.1:39291'), | ||
SOCKET_URL: JSON.stringify('ws://127.0.0.1:39291'), | ||
}, | ||
}) |
21 changes: 9 additions & 12 deletions
21
extensions/conversational-extension/src/@types/global.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
export {} | ||
declare global { | ||
declare const API_URL: string | ||
declare const SOCKET_URL: string | ||
declare const API_URL: string | ||
declare const SOCKET_URL: string | ||
|
||
interface Core { | ||
api: APIFunctions | ||
events: EventEmitter | ||
} | ||
interface Window { | ||
core?: Core | undefined | ||
electronAPI?: any | undefined | ||
} | ||
interface Core { | ||
api: APIFunctions | ||
events: EventEmitter | ||
} | ||
interface Window { | ||
core?: Core | undefined | ||
electronAPI?: any | undefined | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 11 additions & 14 deletions
25
extensions/engine-management-extension/src/@types/global.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
export {} | ||
declare global { | ||
declare const API_URL: string | ||
declare const CORTEX_ENGINE_VERSION: string | ||
declare const SOCKET_URL: string | ||
declare const NODE: string | ||
declare const API_URL: string | ||
declare const CORTEX_ENGINE_VERSION: string | ||
declare const SOCKET_URL: string | ||
declare const NODE: string | ||
|
||
interface Core { | ||
api: APIFunctions | ||
events: EventEmitter | ||
} | ||
interface Window { | ||
core?: Core | undefined | ||
electronAPI?: any | undefined | ||
} | ||
interface Core { | ||
api: APIFunctions | ||
events: EventEmitter | ||
} | ||
interface Window { | ||
core?: Core | undefined | ||
electronAPI?: any | undefined | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,27 +4,20 @@ | |
"version": "1.0.3", | ||
"description": "This extension enables Anthropic chat completion API calls", | ||
"main": "dist/index.js", | ||
"module": "dist/module.js", | ||
"engine": "anthropic", | ||
"author": "Jan <[email protected]>", | ||
"license": "AGPL-3.0", | ||
"scripts": { | ||
"test": "jest test", | ||
"build": "tsc -b . && webpack --config webpack.config.js", | ||
"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": { | ||
".": "./dist/index.js", | ||
"./main": "./dist/module.js" | ||
"build": "rolldown -c rolldown.config.mjs", | ||
"build:publish": "rimraf *.tgz --glob || true && yarn build && npm pack && cpx *.tgz ../../pre-install" | ||
}, | ||
"devDependencies": { | ||
"cpx": "^1.5.0", | ||
"rimraf": "^3.0.2", | ||
"rolldown": "1.0.0-beta.1", | ||
"ts-loader": "^9.5.0", | ||
"typescript": "^5.7.2", | ||
"webpack": "^5.88.2", | ||
"webpack-cli": "^5.1.4" | ||
"typescript": "^5.7.2" | ||
}, | ||
"dependencies": { | ||
"@janhq/core": "../../core/package.tgz", | ||
|
Oops, something went wrong.