**chore: update dependencies and streamline build/deployment scripts**

### Changes:
- Added new TensorFlow.js dependencies:
  - `@tensorflow/tfjs-backend-cpu`
  - `@tensorflow/tfjs-converter`
  - `@tensorflow/tfjs-core`
  - `@tensorflow/tfjs-layers`
- Updated `package-lock.json` to reflect dependency updates and changes in peer dependencies.
- Refactored build scripts for clarity and consistency:
  - Simplified build commands using `BUILD_TYPE` environment variable for unified and browser builds.
  - Updated `demo` and `publish` scripts to align with new build structure.
  - Introduced specific deployment scripts for AWS, GCP, and Cloudflare in `cloud-wrapper`:
    - `deploy☁️aws`
    - `deploy☁️gcp`
    - `deploy☁️cloudflare`
  - Added a user-friendly `deploy:cloud` script for deployment guidance.
- Removed redundant script configurations and legacy-based Rollup files.

### Purpose:
Enhanced dependency management and standardized build/deployment workflows by improving script clarity, removing redundancy, and aligning configurations with TensorFlow.js changes. This improves maintainability and user experience in development and production environments.
This commit is contained in:
David Snelling 2025-06-19 16:03:16 -07:00
parent 1b78e5425a
commit ced7c6eaec
2 changed files with 22 additions and 21 deletions

27
package-lock.json generated
View file

@ -13,6 +13,10 @@
"@aws-sdk/client-s3": "^3.427.0",
"@tensorflow-models/universal-sentence-encoder": "^1.3.3",
"@tensorflow/tfjs": "^4.22.0",
"@tensorflow/tfjs-backend-cpu": "^4.22.0",
"@tensorflow/tfjs-converter": "^4.22.0",
"@tensorflow/tfjs-core": "^4.22.0",
"@tensorflow/tfjs-layers": "^4.22.0",
"buffer": "^6.0.3",
"commander": "^14.0.0",
"omelette": "^0.4.17",
@ -43,11 +47,6 @@
},
"engines": {
"node": ">=23.11.0"
},
"optionalDependencies": {
"@tensorflow/tfjs-backend-cpu": "^4.22.0",
"@tensorflow/tfjs-core": "^4.22.0",
"@tensorflow/tfjs-layers": "^4.22.0"
}
},
"node_modules/@ampproject/remapping": {
@ -3368,6 +3367,15 @@
"@tensorflow/tfjs-core": "4.22.0"
}
},
"node_modules/@tensorflow/tfjs-converter": {
"version": "4.22.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-4.22.0.tgz",
"integrity": "sha512-PT43MGlnzIo+YfbsjM79Lxk9lOq6uUwZuCc8rrp0hfpLjF6Jv8jS84u2jFb+WpUeuF4K33ZDNx8CjiYrGQ2trQ==",
"license": "Apache-2.0",
"peerDependencies": {
"@tensorflow/tfjs-core": "4.22.0"
}
},
"node_modules/@tensorflow/tfjs-core": {
"version": "4.22.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-core/-/tfjs-core-4.22.0.tgz",
@ -3416,15 +3424,6 @@
"@tensorflow/tfjs-core": "4.22.0"
}
},
"node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-converter": {
"version": "4.22.0",
"resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-4.22.0.tgz",
"integrity": "sha512-PT43MGlnzIo+YfbsjM79Lxk9lOq6uUwZuCc8rrp0hfpLjF6Jv8jS84u2jFb+WpUeuF4K33ZDNx8CjiYrGQ2trQ==",
"license": "Apache-2.0",
"peerDependencies": {
"@tensorflow/tfjs-core": "4.22.0"
}
},
"node_modules/@types/babel__core": {
"version": "7.20.5",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",

View file

@ -29,18 +29,19 @@
},
"scripts": {
"prebuild": "node scripts/generate-version.js",
"build:tsc": "tsc -p tsconfig.unified.json",
"build:browser": "rollup -c rollup_config.js",
"build:unified": "rollup -c rollup.unified.js",
"build": "npm run build:unified",
"build:all": "npm run build:tsc && npm run build:browser && npm run build:unified",
"build": "BUILD_TYPE=unified rollup -c rollup.config.js",
"build:browser": "BUILD_TYPE=browser rollup -c rollup.config.js",
"start": "node dist/unified.js",
"demo": "npm run build:all && npx http-server -o /examples/demo.html",
"demo": "npm run build && npm run build:browser && npx http-server -o /examples/demo.html",
"cli": "node ./cli-wrapper.js",
"version:patch": "npm version patch",
"version:minor": "npm version minor",
"version:major": "npm version major",
"deploy": "npm run build:all && npm publish",
"publish": "npm run build && npm publish",
"deploy:cloud:aws": "cd cloud-wrapper && npm run build && npm run deploy:aws",
"deploy:cloud:gcp": "cd cloud-wrapper && npm run build && npm run deploy:gcp",
"deploy:cloud:cloudflare": "cd cloud-wrapper && npm run build && npm run deploy:cloudflare",
"deploy:cloud": "echo 'Please use one of the following commands to deploy to a specific cloud provider:' && echo ' npm run deploy:cloud:aws' && echo ' npm run deploy:cloud:gcp' && echo ' npm run deploy:cloud:cloudflare'",
"postinstall": "echo 'Note: If you encounter dependency conflicts with TensorFlow.js packages, please use: npm install --legacy-peer-deps'"
},
"bin": {
@ -99,6 +100,7 @@
"@tensorflow-models/universal-sentence-encoder": "^1.3.3",
"@tensorflow/tfjs": "^4.22.0",
"@tensorflow/tfjs-backend-cpu": "^4.22.0",
"@tensorflow/tfjs-converter": "^4.22.0",
"@tensorflow/tfjs-core": "^4.22.0",
"@tensorflow/tfjs-layers": "^4.22.0"
},