Skip to content

Commit

Permalink
chore: fix NPM package
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Jul 3, 2024
1 parent b01da3b commit d437eb9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cortex-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: yarn install && yarn build
- run: yarn build:cpuinfo && yarn install && yarn build
working-directory: ./cortex-js
- run: npm publish --access public
env:
Expand Down
26 changes: 14 additions & 12 deletions cortex-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
"license": "AGPL-3.0",
"homepage": "https://github.com/janhq/cortex",
"bin": {
"cortex": "./dist/src/command.js"
"cortex": "./command/index.js"
},
"scripts": {
"dev": "nest dev",
"preinstall": "(cd cpuinfo && npm install) && (npx node-gyp rebuild -C ./cpuinfo)",
"compile": "npx ncc build ./dist/src/command.js -o command",
"build": "nest build",
"build:cpuInfo": "npx node-gyp rebuild -C ./cpuinfo",
"build:binary": "yarn build:cpuInfo && yarn build && yarn compile && npx -q patch-package && npx @yao-pkg/pkg .",
"build:cpuinfo": "(cd cpuinfo && npm install) && (npx node-gyp rebuild -C ./cpuinfo)",
"build": "ncc build ./src/command.ts -o command",
"build:binary": "yarn build && npx -q patch-package && npx @yao-pkg/pkg .",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"build:extensions": "run-script-os",
"build:extensions:windows": "powershell -command \"$jobs = Get-ChildItem -Path './src/extensions' -Directory | ForEach-Object { Start-Job -Name ($_.Name) -ScriptBlock { param($_dir); try { Set-Location $_dir; yarn; yarn build; Write-Output 'Build successful in ' + $_dir } catch { Write-Error 'Error in ' + $_dir; throw } } -ArgumentList $_.FullName }; $jobs | Wait-Job; $jobs | ForEach-Object { Receive-Job -Job $_ -Keep } | ForEach-Object { Write-Host $_ }; $failed = $jobs | Where-Object { $_.State -ne 'Completed' -or $_.ChildJobs[0].JobStateInfo.State -ne 'Completed' }; if ($failed) { Exit 1 }\"",
Expand All @@ -36,7 +34,8 @@
"build:dev:macos": "chmod +x ./dist/src/command.js",
"build:dev:linux": "chmod +x ./dist/src/command.js"
},
"dependencies": {
"dependencies": {},
"devDependencies": {
"@huggingface/gguf": "^0.1.5",
"@huggingface/hub": "^0.15.1",
"@nestjs/axios": "^3.0.2",
Expand Down Expand Up @@ -66,9 +65,7 @@
"ulid": "^2.3.0",
"uuid": "^9.0.1",
"yaml": "^2.4.2",
"cpuinfo": "file:./cpuinfo"
},
"devDependencies": {
"cpuinfo": "file:./cpuinfo",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
Expand Down Expand Up @@ -112,7 +109,7 @@
"whatwg-url": "14.0.0"
},
"files": [
"dist"
"command"
],
"jest": {
"moduleFileExtensions": [
Expand All @@ -137,7 +134,12 @@
},
"pkg": {
"scripts": "command/**/*.js",
"assets": ["command/*.node", "**/package.json", "node_modules/axios/**/*", "cpuinfo/**/*"],
"assets": [
"command/*.node",
"**/package.json",
"node_modules/axios/**/*",
"cpuinfo/**/*"
],
"outputPath": "dist"
}
}

0 comments on commit d437eb9

Please sign in to comment.