From be56ea52b7ee7837cea7e0aa957db39c87cd5cb9 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Wed, 2 Jul 2025 16:33:30 -0700 Subject: [PATCH] **chore(version): bump version to 0.9.30 and enhance publishing instructions** - Updated version to `0.9.30` in `package.json`, `cli-package/package.json`, `src/utils/version.ts`, and `README.md`. - Synced `@soulcraft/brainy` dependency version to `0.9.30` for CLI package consistency. - Modified npm version badge in `README.md` to reflect the new version. - Added detailed publishing instructions in `docs/publishing-cli.md` to guide users on publishing both, main, or CLI packages. - Introduced new npm scripts `publish:cli` and `build:cli` for streamlined package-specific operations. This update ensures cohesive versioning, provides clearer publishing guidelines, and improves maintainability with new build/publish scripts. --- README.md | 2 +- cli-package/package-lock.json | 26 +++++------------ cli-package/package.json | 2 +- docs/publishing-cli.md | 55 +++++++++++++++++++++++++++++++---- package-lock.json | 4 +-- package.json | 2 ++ src/utils/version.ts | 2 +- 7 files changed, 64 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index dbfa4aa0..d6219f70 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Node.js](https://img.shields.io/badge/node-%3E%3D23.0.0-brightgreen.svg)](https://nodejs.org/) [![TypeScript](https://img.shields.io/badge/TypeScript-5.1.6-blue.svg)](https://www.typescriptlang.org/) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) -[![npm](https://img.shields.io/badge/npm-v0.9.29-blue.svg)](https://www.npmjs.com/package/@soulcraft/brainy) +[![npm](https://img.shields.io/badge/npm-v0.9.30-blue.svg)](https://www.npmjs.com/package/@soulcraft/brainy) [//]: # ([![Cartographer](https://img.shields.io/badge/Cartographer-Official%20Standard-brightgreen)](https://github.com/sodal-project/cartographer)) diff --git a/cli-package/package-lock.json b/cli-package/package-lock.json index 103d839e..187dd7cb 100644 --- a/cli-package/package-lock.json +++ b/cli-package/package-lock.json @@ -1,16 +1,16 @@ { "name": "@soulcraft/brainy-cli", - "version": "0.9.23", + "version": "0.9.29", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@soulcraft/brainy-cli", - "version": "0.9.23", + "version": "0.9.29", "hasInstallScript": true, "license": "MIT", "dependencies": { - "@soulcraft/brainy": "0.9.23", + "@soulcraft/brainy": "0.9.29", "commander": "^14.0.0", "omelette": "^0.4.17" }, @@ -29,7 +29,7 @@ "typescript": "^5.1.6" }, "engines": { - "node": ">=24.0.0" + "node": ">=23.0.0" } }, "node_modules/@aws-crypto/crc32": { @@ -2086,9 +2086,9 @@ } }, "node_modules/@soulcraft/brainy": { - "version": "0.9.23", - "resolved": "https://registry.npmjs.org/@soulcraft/brainy/-/brainy-0.9.23.tgz", - "integrity": "sha512-5wmGNipjvyKAAXpPFTlhyJ6zkui/lWvk9o01d2V4Mmxx0XrR8m1dXSACIK67n5cb5/f6SKYFksYW7FXcVl43xA==", + "version": "0.9.29", + "resolved": "https://registry.npmjs.org/@soulcraft/brainy/-/brainy-0.9.29.tgz", + "integrity": "sha512-t1kECxPqO7Y8dC6Vh2BoWQKYtiHCUPombz6ZGNfiyhADMEf8T3E1dd7XGmAX8qUver9/aXKk1I1pfIXA7RP5Cw==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -2103,7 +2103,7 @@ "uuid": "^9.0.0" }, "engines": { - "node": ">=24.0.0" + "node": ">=23.0.0" } }, "node_modules/@soulcraft/brainy/node_modules/@tensorflow/tfjs-converter": { @@ -2181,16 +2181,6 @@ "@tensorflow/tfjs-core": "4.22.0" } }, - "node_modules/@tensorflow/tfjs-converter": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-3.21.0.tgz", - "integrity": "sha512-12Y4zVDq3yW+wSjSDpSv4HnpL2sDZrNiGSg8XNiDE4HQBdjdA+a+Q3sZF/8NV9y2yoBhL5L7V4mMLDdbZBd9/Q==", - "license": "Apache-2.0", - "peer": true, - "peerDependencies": { - "@tensorflow/tfjs-core": "3.21.0" - } - }, "node_modules/@tensorflow/tfjs-core": { "version": "4.22.0", "resolved": "https://registry.npmjs.org/@tensorflow/tfjs-core/-/tfjs-core-4.22.0.tgz", diff --git a/cli-package/package.json b/cli-package/package.json index e33015cd..b0a67830 100644 --- a/cli-package/package.json +++ b/cli-package/package.json @@ -57,4 +57,4 @@ "engines": { "node": ">=23.0.0" } -} +} \ No newline at end of file diff --git a/docs/publishing-cli.md b/docs/publishing-cli.md index 5ef9a32d..5cc6e3d1 100644 --- a/docs/publishing-cli.md +++ b/docs/publishing-cli.md @@ -26,10 +26,14 @@ cd /path/to/brainy git pull ``` -### 3. Build and publish both packages +### 3. Build and publish packages + +You have three options for publishing: + +#### Option A: Publish both packages together ```bash -npm run deploy:both +npm run publish:both ``` This command will: @@ -40,6 +44,27 @@ This command will: - Publish the main package to npm - Publish the CLI package to npm +#### Option B: Publish only the main package + +```bash +npm run publish +``` + +This command will: +- Build the main package +- Publish the main package to npm + +#### Option C: Publish only the CLI package + +```bash +npm run publish:cli +``` + +This command will: +- Ensure versions are in sync +- Build the CLI package +- Publish the CLI package to npm + ### 4. Verify the packages were published successfully After publishing, you can verify that the packages were published successfully by checking the npm registry: @@ -51,15 +76,33 @@ npm view @soulcraft/brainy-cli ## How It Works -The publishing process uses the `scripts/publish-cli.js` script, which: +### Publishing Both Packages + +The `publish:both` command uses the `scripts/publish-cli.js` script, which: 1. Ensures versions are in sync by running `scripts/generate-version.js` 2. Builds the main package with `npm run build` -3. Builds the CLI with `npm run build:cli` -4. Verifies the CLI was built successfully -5. Publishes the main package with `npm publish` from the root directory +3. Publishes the main package with `npm publish` from the root directory +4. Builds the CLI package with `npm run build` in the cli-package directory +5. Verifies the CLI was built successfully 6. Publishes the CLI package with `npm publish` from the cli-package directory +### Publishing Only the Main Package + +The `publish` command: + +1. Builds the main package with `npm run build` +2. Publishes the main package with `npm publish` from the root directory + +### Publishing Only the CLI Package + +The `publish:cli` command: + +1. Ensures versions are in sync by running `scripts/generate-version.js` +2. Changes to the cli-package directory +3. Builds the CLI package with `npm run build` +4. Publishes the CLI package with `npm publish` + The version synchronization ensures that: - Both packages always have the same version number - The CLI package's dependency on the main package is exact (not using the ^ prefix) diff --git a/package-lock.json b/package-lock.json index a9dfaaea..85e17b00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@soulcraft/brainy", - "version": "0.9.29", + "version": "0.9.30", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@soulcraft/brainy", - "version": "0.9.29", + "version": "0.9.30", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 141ebd32..ea5b8ee3 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "prebuild": "node scripts/generate-version.js", "build": "BUILD_TYPE=unified rollup -c rollup.config.js", "build:browser": "BUILD_TYPE=browser rollup -c rollup.config.js", + "build:cli": "cd cli-package && npm run build", "start": "node dist/unified.js", "demo": "npm run build && npm run build:browser && npx http-server -o /index.html", "version": "node scripts/generate-version.js", @@ -44,6 +45,7 @@ "check-style": "node scripts/check-code-style.js", "prepare": "npm run build", "publish": "npm run build && npm publish", + "publish:cli": "node scripts/generate-version.js && cd cli-package && npm run build && npm publish", "publish:both": "node scripts/publish-cli.js", "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", diff --git a/src/utils/version.ts b/src/utils/version.ts index dea16cf2..c281866c 100644 --- a/src/utils/version.ts +++ b/src/utils/version.ts @@ -3,4 +3,4 @@ * Do not modify this file directly. */ -export const VERSION = '0.9.29'; +export const VERSION = '0.9.30';