-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 #4342 from janhq/chore/local-engine-select-default…
…-engine feat: local engine - symlink bundled variants
- Loading branch information
Showing
19 changed files
with
219 additions
and
290 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,36 +4,43 @@ | |
"version": "1.0.0", | ||
"description": "This extension enables manage engines", | ||
"main": "dist/index.js", | ||
"node": "dist/node/index.cjs.js", | ||
"author": "Jan <[email protected]>", | ||
"license": "MIT", | ||
"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": "rolldown -c rolldown.config.mjs", | ||
"build:publish": "rimraf *.tgz --glob && yarn build && ../../.github/scripts/auto-sign.sh && npm pack && cpx *.tgz ../../pre-install" | ||
}, | ||
"exports": { | ||
".": "./dist/index.js", | ||
"./main": "./dist/module.js" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-replace": "^6.0.2", | ||
"cpx": "^1.5.0", | ||
"rimraf": "^3.0.2", | ||
"rolldown": "^1.0.0-beta.1", | ||
"ts-loader": "^9.5.0", | ||
"webpack": "^5.88.2", | ||
"webpack-cli": "^5.1.4" | ||
}, | ||
"dependencies": { | ||
"@janhq/core": "file:../../core", | ||
"cpu-instructions": "^0.0.13", | ||
"ky": "^1.7.2", | ||
"p-queue": "^8.0.1" | ||
}, | ||
"bundledDependencies": [ | ||
"cpu-instructions", | ||
"@janhq/core" | ||
], | ||
"engines": { | ||
"node": ">=18.0.0" | ||
}, | ||
"files": [ | ||
"dist/*", | ||
"package.json", | ||
"README.md" | ||
], | ||
"bundleDependencies": [] | ||
] | ||
} |
45 changes: 45 additions & 0 deletions
45
extensions/engine-management-extension/rolldown.config.mjs
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,45 @@ | ||
import { defineConfig } from 'rolldown' | ||
import replace from '@rollup/plugin-replace' | ||
import pkgJson from './package.json' with { type: 'json' } | ||
|
||
export default defineConfig([ | ||
{ | ||
input: 'src/index.ts', | ||
output: { | ||
format: 'esm', | ||
file: 'dist/index.js', | ||
}, | ||
plugins: [ | ||
replace({ | ||
NODE: JSON.stringify(`${pkgJson.name}/${pkgJson.node}`), | ||
API_URL: JSON.stringify('http://127.0.0.1:39291'), | ||
SOCKET_URL: JSON.stringify('ws://127.0.0.1:39291'), | ||
CORTEX_ENGINE_VERSION: JSON.stringify('v0.1.42'), | ||
}), | ||
], | ||
}, | ||
{ | ||
input: 'src/node/index.ts', | ||
external: ['@janhq/core/node'], | ||
output: { | ||
format: 'cjs', | ||
file: 'dist/node/index.cjs.js', | ||
}, | ||
plugins: [ | ||
replace({ | ||
CORTEX_ENGINE_VERSION: JSON.stringify('v0.1.42'), | ||
}), | ||
], | ||
}, | ||
{ | ||
input: 'src/node/cpuInfo.ts', | ||
output: { | ||
format: 'cjs', | ||
file: 'dist/node/cpuInfo.js', | ||
}, | ||
external: ['cpu-instructions'], | ||
resolve: { | ||
extensions: ['.ts', '.js', '.svg'], | ||
}, | ||
}, | ||
]) |
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,10 @@ | ||
/** | ||
* Custom Engine Error | ||
*/ | ||
export class EngineError extends Error { | ||
message: string | ||
constructor(message: string) { | ||
super() | ||
this.message = message | ||
} | ||
} |
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
File renamed without changes.
Oops, something went wrong.