fix: bundle

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-05-18 22:54:31 +08:00
parent 441bc8ae3b
commit 7e616eeb88
7 changed files with 2764 additions and 1328 deletions

View File

@@ -21,7 +21,7 @@
"dev": "npm run start",
"dev:encrypt": "npm run start -- --encrypt_enable --encrypt_key=33b9405ac49f63ef4ccbf6b338aeeff8152e844d942ef22278abbec2b1f93b5e",
"repl": "npm run start -- --entryFile repl",
"bundle": "rimraf out && npm run build && cd dist/src && npx ncc build main.js -o ../../out --minify -s && cd ../.. && chmod +x out/index.js && node scripts/after-bundle.js",
"bundle": "sh scripts/bundle.sh",
"start": "cross-env NODE_ENV=development nest start -w --path tsconfig.json -- ",
"start:debug": "cross-env NODE_ENV=development nest start --debug --watch",
"start:cluster": "cross-env NODE_ENV=development nest start --watch -- --cluster --cluster_workers 2",
@@ -49,8 +49,8 @@
},
"dependencies": {
"@algolia/client-search": "^4.22.1",
"@antfu/install-pkg": "1.1.0",
"@aws-sdk/client-s3": "3.808.0",
"@antfu/install-pkg": "1.0.0",
"@aws-sdk/client-s3": "3.802.0",
"@babel/core": "7.27.1",
"@babel/plugin-transform-modules-commonjs": "7.27.1",
"@babel/plugin-transform-typescript": "7.27.1",
@@ -134,6 +134,7 @@
},
"devDependencies": {
"@langchain/core": "0.3.55",
"@langchain/langgraph": "0.2.72",
"@nestjs/cli": "11.0.7",
"@nestjs/schematics": "11.0.5",
"@nestjs/testing": "11.1.1",
@@ -159,6 +160,7 @@
"ioredis": "5.6.1",
"mongodb-memory-server": "^10.1.4",
"redis-memory-server": "^0.12.1",
"rimraf": "6.0.1",
"sharp": "0.34.1",
"socket.io": "^4.8.1",
"typescript": "5.7.3",

View File

@@ -0,0 +1,18 @@
#!/bin/bash
set -e
# Add node_modules/.bin to PATH
export PATH="$(pwd)/node_modules/.bin:$(pwd)/../../node_modules/.bin:$PATH"
rimraf out
npm run build
# Check if RELEASE environment variable is set to true
if [ "$RELEASE" = "true" ]; then
ncc build dist/src/main.js -o $(pwd)/out --minify -s
else
ncc build dist/src/main.js -o $(pwd)/out -s
fi
chmod +x out/index.js
node scripts/after-bundle.js

View File

@@ -19,10 +19,6 @@
"lint": "pnpm -C \"apps/core\" run lint",
"publish:core": "cd apps/core && npm run publish"
},
"dependencies": {
"@langchain/langgraph": "0.2.68",
"zx-cjs": "7.0.7-0"
},
"devDependencies": {
"@innei/prettier": "0.15.0",
"@sxzz/eslint-config": "7.0.0",
@@ -30,14 +26,17 @@
"cross-env": "7.0.3",
"eslint": "^9.24.0",
"lint-staged": "15.5.0",
"mongodb-memory-server": "10.1.4",
"prettier": "3.5.3",
"redis-memory-server": "0.12.1",
"rimraf": "6.0.1",
"simple-git-hooks": "2.12.1",
"ts-node": "10.9.2",
"tsconfig-paths": "4.2.0",
"tsup": "8.4.0",
"typescript": "5.7.3",
"vite-tsconfig-paths": "5.1.4"
"vite-tsconfig-paths": "5.1.4",
"zx-cjs": "7.0.7-0"
},
"resolutions": {
"get-pixels@^3>request": "./external/request",

View File

@@ -56,7 +56,7 @@
"lodash": "^4.17.21",
"tsup": "8.4.0",
"umi-request": "1.4.0",
"vite": "5.4.10",
"vitest": "1.5.2"
"vite": "^6.0.3",
"vitest": "2.1.8"
}
}

View File

@@ -5,7 +5,6 @@
"main": "dist/index.cjs",
"exports": {
".": "./dist/index.cjs",
"./zx-global": "./zx-global.cjs",
"./auth": "./dist/auth.cjs",
"./zod": "./dist/zod.cjs"
},

4050
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff