From 3028c9870c84878fb6ce259132156bc1bdcbc147 Mon Sep 17 00:00:00 2001 From: Dominic Griesel Date: Wed, 15 Sep 2021 14:07:51 +0200 Subject: [PATCH] chore: release v3.0.0 * Split into plugins * Interactive version chooser * Simplified `monorepo` configuration with `lerna` * BREAKING: Removed native `yarn v2+` workspaces support. Use `lerna` for now. * BREAKING: Some configuration/CLI options changed. --- CHANGELOG.md | 2 +- README.md | 4 +- lerna.json | 2 +- packages/core/package.json | 2 +- packages/plugin-changelog/package.json | 6 +-- packages/plugin-exec/package.json | 6 +-- packages/plugin-git/package.json | 6 +-- packages/plugin-git/src/index.ts | 2 +- packages/plugin-iobroker/package.json | 6 +-- packages/plugin-lerna/package.json | 6 +-- packages/plugin-lerna/src/index.ts | 23 ++++++++++ packages/plugin-package/package.json | 6 +-- packages/plugin-template/package.json | 6 +-- packages/plugin-version/package.json | 6 +-- packages/release-script/package.json | 16 +++---- packages/release-script/src/index.ts | 2 +- packages/testing/package.json | 4 +- yarn.lock | 62 +++++++++++++------------- 18 files changed, 96 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05c0873..8fbf4a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Placeholder for the next version (at the beginning of the line): ## **WORK IN PROGRESS** --> -## 3.0.0-alpha.7 (2021-09-15) +## 3.0.0 (2021-09-15) * Split into plugins * Interactive version chooser * Simplified `monorepo` configuration with `lerna` diff --git a/README.md b/README.md index cd70f7f..dfbe4c0 100644 --- a/README.md +++ b/README.md @@ -307,7 +307,9 @@ npm run release -- -x.commit "echo Hello" -x.after_push "echo 1" "echo 2" "echo ### `lerna` plugin options -_none_ +#### Publish all packages (`--publishAll`) + +By default, `lerna` only bumps and publishes changed packages. With this flag, all non-private packages are re-published under a new version, even if they had no changes. ### `ioBroker` plugin options diff --git a/lerna.json b/lerna.json index 8579a6b..cfa9221 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "useWorkspaces": true, "npmClient": "yarn", - "version": "3.0.0-alpha.7", + "version": "3.0.0", "command": { "run": { "stream": true diff --git a/packages/core/package.json b/packages/core/package.json index 49d1c16..69c6a89 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Al Calzone's release script: Core components", "keywords": [], "license": "MIT", diff --git a/packages/plugin-changelog/package.json b/packages/plugin-changelog/package.json index ebd82ca..2affa6b 100644 --- a/packages/plugin-changelog/package.json +++ b/packages/plugin-changelog/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Plugin for Al Calzone's release script: changelog", "keywords": [], "license": "MIT", @@ -37,11 +37,11 @@ "node": ">=12.20" }, "dependencies": { - "@alcalzone/release-script-core": "3.0.0-alpha.7", + "@alcalzone/release-script-core": "3.0.0", "alcalzone-shared": "^4.0.0" }, "devDependencies": { - "@alcalzone/release-script-testing": "3.0.0-alpha.7", + "@alcalzone/release-script-testing": "3.0.0", "jest-extended": "^0.11.5", "typescript": "*" }, diff --git a/packages/plugin-exec/package.json b/packages/plugin-exec/package.json index 0289d1b..cb7d593 100644 --- a/packages/plugin-exec/package.json +++ b/packages/plugin-exec/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Plugin for Al Calzone's release script: execute user scripts", "keywords": [], "license": "MIT", @@ -37,11 +37,11 @@ "node": ">=12.20" }, "dependencies": { - "@alcalzone/release-script-core": "3.0.0-alpha.7", + "@alcalzone/release-script-core": "3.0.0", "alcalzone-shared": "^4.0.0" }, "devDependencies": { - "@alcalzone/release-script-testing": "3.0.0-alpha.7", + "@alcalzone/release-script-testing": "3.0.0", "jest-extended": "^0.11.5", "typescript": "*" }, diff --git a/packages/plugin-git/package.json b/packages/plugin-git/package.json index 054a54b..7d64edf 100644 --- a/packages/plugin-git/package.json +++ b/packages/plugin-git/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Plugin for Al Calzone's release script: git", "keywords": [], "license": "MIT", @@ -37,11 +37,11 @@ "node": ">=12.20" }, "dependencies": { - "@alcalzone/release-script-core": "3.0.0-alpha.7", + "@alcalzone/release-script-core": "3.0.0", "fs-extra": "^10.0.0" }, "devDependencies": { - "@alcalzone/release-script-testing": "3.0.0-alpha.7", + "@alcalzone/release-script-testing": "3.0.0", "jest-extended": "^0.11.5", "typescript": "*" }, diff --git a/packages/plugin-git/src/index.ts b/packages/plugin-git/src/index.ts index 0a7b572..b8ef3d8 100644 --- a/packages/plugin-git/src/index.ts +++ b/packages/plugin-git/src/index.ts @@ -88,7 +88,7 @@ class GitPlugin implements Plugin { defaultDescription: "The remote the current branch is tracking", }, includeUnstaged: { - alias: "all", + alias: ["all", "A"], type: "boolean", description: "Whether unstaged changes should be allowed", default: false, diff --git a/packages/plugin-iobroker/package.json b/packages/plugin-iobroker/package.json index 9938080..370df27 100644 --- a/packages/plugin-iobroker/package.json +++ b/packages/plugin-iobroker/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Plugin for Al Calzone's release script: ioBroker", "keywords": [], "license": "MIT", @@ -37,12 +37,12 @@ "node": ">=12.20" }, "dependencies": { - "@alcalzone/release-script-core": "3.0.0-alpha.7", + "@alcalzone/release-script-core": "3.0.0", "alcalzone-shared": "^4.0.0", "axios": "^0.21.4" }, "devDependencies": { - "@alcalzone/release-script-testing": "3.0.0-alpha.7", + "@alcalzone/release-script-testing": "3.0.0", "jest-extended": "^0.11.5", "typescript": "*" }, diff --git a/packages/plugin-lerna/package.json b/packages/plugin-lerna/package.json index 7eacc98..0589401 100644 --- a/packages/plugin-lerna/package.json +++ b/packages/plugin-lerna/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Plugin for Al Calzone's release script: lerna", "keywords": [], "license": "MIT", @@ -37,10 +37,10 @@ "node": ">=12.20" }, "dependencies": { - "@alcalzone/release-script-core": "3.0.0-alpha.7" + "@alcalzone/release-script-core": "3.0.0" }, "devDependencies": { - "@alcalzone/release-script-testing": "3.0.0-alpha.7", + "@alcalzone/release-script-testing": "3.0.0", "jest-extended": "^0.11.5", "typescript": "*" }, diff --git a/packages/plugin-lerna/src/index.ts b/packages/plugin-lerna/src/index.ts index 46715e0..a6e3259 100644 --- a/packages/plugin-lerna/src/index.ts +++ b/packages/plugin-lerna/src/index.ts @@ -3,6 +3,7 @@ import type { Context, Plugin, Stage } from "@alcalzone/release-script-core/type import fs from "fs-extra"; import path from "path"; import semver from "semver"; +import type { Argv } from "yargs"; class LernaPlugin implements Plugin { public readonly id = "lerna"; @@ -15,6 +16,27 @@ class LernaPlugin implements Plugin { commit: ["git"], }; + public defineCLIOptions(yargs: Argv): Argv { + return yargs.options({ + publishAll: { + type: "boolean", + description: `Bump and publish all non-private packages, even if they didn't change`, + default: false, + }, + noWorkflowCheck: { + description: "Disable checking the test-and-release.yml workflow", + type: "boolean", + default: false, + }, + numNews: { + alias: ["nn"], + type: "number", + description: `How many news entries should be kept in io-package.json`, + default: 7, + }, + }); + } + private async executeCheckStage(context: Context): Promise { // ensure that lerna.json exists and has a version (unless in lerna mode) const jsonPath = path.join(context.cwd, "lerna.json"); @@ -56,6 +78,7 @@ class LernaPlugin implements Plugin { context.getData("version_new"), "--no-push", "--no-git-tag-version", + ...(context.argv.publishAll ? ["--force-publish"] : []), "--yes", ], ["git", "stash", "pop"], diff --git a/packages/plugin-package/package.json b/packages/plugin-package/package.json index 75b3c3c..04b7f88 100644 --- a/packages/plugin-package/package.json +++ b/packages/plugin-package/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Plugin for Al Calzone's release script: npm package files", "keywords": [], "license": "MIT", @@ -38,12 +38,12 @@ }, "dependencies": { "@alcalzone/pak": "^0.7.0", - "@alcalzone/release-script-core": "3.0.0-alpha.7", + "@alcalzone/release-script-core": "3.0.0", "alcalzone-shared": "^4.0.0", "semver": "^7.3.5" }, "devDependencies": { - "@alcalzone/release-script-testing": "3.0.0-alpha.7", + "@alcalzone/release-script-testing": "3.0.0", "jest-extended": "^0.11.5", "typescript": "*" }, diff --git a/packages/plugin-template/package.json b/packages/plugin-template/package.json index a467c0c..aa75e65 100644 --- a/packages/plugin-template/package.json +++ b/packages/plugin-template/package.json @@ -4,7 +4,7 @@ "publishConfig": { "access": "public" }, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Plugin for Al Calzone's release script: template", "keywords": [], "license": "MIT", @@ -38,10 +38,10 @@ "node": ">=12.20" }, "dependencies": { - "@alcalzone/release-script-core": "3.0.0-alpha.7" + "@alcalzone/release-script-core": "3.0.0" }, "devDependencies": { - "@alcalzone/release-script-testing": "3.0.0-alpha.7", + "@alcalzone/release-script-testing": "3.0.0", "jest-extended": "^0.11.5", "typescript": "*" }, diff --git a/packages/plugin-version/package.json b/packages/plugin-version/package.json index 66cef8d..215501a 100644 --- a/packages/plugin-version/package.json +++ b/packages/plugin-version/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Plugin for Al Calzone's release script: Versioning", "keywords": [], "license": "MIT", @@ -37,11 +37,11 @@ "node": ">=12.20" }, "dependencies": { - "@alcalzone/release-script-core": "3.0.0-alpha.7", + "@alcalzone/release-script-core": "3.0.0", "semver": "^7.3.5" }, "devDependencies": { - "@alcalzone/release-script-testing": "3.0.0-alpha.7", + "@alcalzone/release-script-testing": "3.0.0", "jest-extended": "^0.11.5", "typescript": "*" }, diff --git a/packages/release-script/package.json b/packages/release-script/package.json index cef4749..4312324 100644 --- a/packages/release-script/package.json +++ b/packages/release-script/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Release script to automatically increment version numbers and push git tags of Node.js projects", "keywords": [], "license": "MIT", @@ -39,12 +39,12 @@ "node": ">=12.20" }, "dependencies": { - "@alcalzone/release-script-core": "3.0.0-alpha.7", - "@alcalzone/release-script-plugin-changelog": "3.0.0-alpha.7", - "@alcalzone/release-script-plugin-exec": "3.0.0-alpha.7", - "@alcalzone/release-script-plugin-git": "3.0.0-alpha.7", - "@alcalzone/release-script-plugin-package": "3.0.0-alpha.7", - "@alcalzone/release-script-plugin-version": "3.0.0-alpha.7", + "@alcalzone/release-script-core": "3.0.0", + "@alcalzone/release-script-plugin-changelog": "3.0.0", + "@alcalzone/release-script-plugin-exec": "3.0.0", + "@alcalzone/release-script-plugin-git": "3.0.0", + "@alcalzone/release-script-plugin-package": "3.0.0", + "@alcalzone/release-script-plugin-version": "3.0.0", "alcalzone-shared": "^4.0.0", "axios": "^0.21.4", "colors": "^1.4.0", @@ -55,7 +55,7 @@ "yargs": "^17.1.1" }, "devDependencies": { - "@alcalzone/release-script-testing": "3.0.0-alpha.7", + "@alcalzone/release-script-testing": "3.0.0", "@types/yargs": "^17.0.2", "typescript": "*" }, diff --git a/packages/release-script/src/index.ts b/packages/release-script/src/index.ts index 9effa23..e40b4d5 100644 --- a/packages/release-script/src/index.ts +++ b/packages/release-script/src/index.ts @@ -152,7 +152,7 @@ export async function main(): Promise { required: false, }) .positional("preid", { - describe: "The prerelease identifier. Only for pre... bumps.", + describe: "The prerelease identifier. Only for pre* bumps.", required: false, default: "alpha", }), diff --git a/packages/testing/package.json b/packages/testing/package.json index 11e503b..f00f5d5 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@alcalzone/release-script-testing", "private": true, - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Al Calzone's release script: testing tools", "keywords": [], "license": "MIT", @@ -35,7 +35,7 @@ "node": ">=12.20" }, "devDependencies": { - "@alcalzone/release-script-core": "3.0.0-alpha.7", + "@alcalzone/release-script-core": "3.0.0", "colors": "^1.4.0", "execa": "*", "typescript": "*" diff --git a/yarn.lock b/yarn.lock index 91396ba..184caf1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,7 +16,7 @@ __metadata: languageName: node linkType: hard -"@alcalzone/release-script-core@3.0.0-alpha.7, @alcalzone/release-script-core@workspace:packages/core": +"@alcalzone/release-script-core@3.0.0, @alcalzone/release-script-core@workspace:packages/core": version: 0.0.0-use.local resolution: "@alcalzone/release-script-core@workspace:packages/core" dependencies: @@ -28,36 +28,36 @@ __metadata: languageName: unknown linkType: soft -"@alcalzone/release-script-plugin-changelog@3.0.0-alpha.7, @alcalzone/release-script-plugin-changelog@workspace:packages/plugin-changelog": +"@alcalzone/release-script-plugin-changelog@3.0.0, @alcalzone/release-script-plugin-changelog@workspace:packages/plugin-changelog": version: 0.0.0-use.local resolution: "@alcalzone/release-script-plugin-changelog@workspace:packages/plugin-changelog" dependencies: - "@alcalzone/release-script-core": 3.0.0-alpha.7 - "@alcalzone/release-script-testing": 3.0.0-alpha.7 + "@alcalzone/release-script-core": 3.0.0 + "@alcalzone/release-script-testing": 3.0.0 alcalzone-shared: ^4.0.0 jest-extended: ^0.11.5 typescript: "*" languageName: unknown linkType: soft -"@alcalzone/release-script-plugin-exec@3.0.0-alpha.7, @alcalzone/release-script-plugin-exec@workspace:packages/plugin-exec": +"@alcalzone/release-script-plugin-exec@3.0.0, @alcalzone/release-script-plugin-exec@workspace:packages/plugin-exec": version: 0.0.0-use.local resolution: "@alcalzone/release-script-plugin-exec@workspace:packages/plugin-exec" dependencies: - "@alcalzone/release-script-core": 3.0.0-alpha.7 - "@alcalzone/release-script-testing": 3.0.0-alpha.7 + "@alcalzone/release-script-core": 3.0.0 + "@alcalzone/release-script-testing": 3.0.0 alcalzone-shared: ^4.0.0 jest-extended: ^0.11.5 typescript: "*" languageName: unknown linkType: soft -"@alcalzone/release-script-plugin-git@3.0.0-alpha.7, @alcalzone/release-script-plugin-git@workspace:packages/plugin-git": +"@alcalzone/release-script-plugin-git@3.0.0, @alcalzone/release-script-plugin-git@workspace:packages/plugin-git": version: 0.0.0-use.local resolution: "@alcalzone/release-script-plugin-git@workspace:packages/plugin-git" dependencies: - "@alcalzone/release-script-core": 3.0.0-alpha.7 - "@alcalzone/release-script-testing": 3.0.0-alpha.7 + "@alcalzone/release-script-core": 3.0.0 + "@alcalzone/release-script-testing": 3.0.0 fs-extra: ^10.0.0 jest-extended: ^0.11.5 typescript: "*" @@ -68,8 +68,8 @@ __metadata: version: 0.0.0-use.local resolution: "@alcalzone/release-script-plugin-iobroker@workspace:packages/plugin-iobroker" dependencies: - "@alcalzone/release-script-core": 3.0.0-alpha.7 - "@alcalzone/release-script-testing": 3.0.0-alpha.7 + "@alcalzone/release-script-core": 3.0.0 + "@alcalzone/release-script-testing": 3.0.0 alcalzone-shared: ^4.0.0 axios: ^0.21.4 jest-extended: ^0.11.5 @@ -81,20 +81,20 @@ __metadata: version: 0.0.0-use.local resolution: "@alcalzone/release-script-plugin-lerna@workspace:packages/plugin-lerna" dependencies: - "@alcalzone/release-script-core": 3.0.0-alpha.7 - "@alcalzone/release-script-testing": 3.0.0-alpha.7 + "@alcalzone/release-script-core": 3.0.0 + "@alcalzone/release-script-testing": 3.0.0 jest-extended: ^0.11.5 typescript: "*" languageName: unknown linkType: soft -"@alcalzone/release-script-plugin-package@3.0.0-alpha.7, @alcalzone/release-script-plugin-package@workspace:packages/plugin-package": +"@alcalzone/release-script-plugin-package@3.0.0, @alcalzone/release-script-plugin-package@workspace:packages/plugin-package": version: 0.0.0-use.local resolution: "@alcalzone/release-script-plugin-package@workspace:packages/plugin-package" dependencies: "@alcalzone/pak": ^0.7.0 - "@alcalzone/release-script-core": 3.0.0-alpha.7 - "@alcalzone/release-script-testing": 3.0.0-alpha.7 + "@alcalzone/release-script-core": 3.0.0 + "@alcalzone/release-script-testing": 3.0.0 alcalzone-shared: ^4.0.0 jest-extended: ^0.11.5 semver: ^7.3.5 @@ -106,19 +106,19 @@ __metadata: version: 0.0.0-use.local resolution: "@alcalzone/release-script-plugin-template@workspace:packages/plugin-template" dependencies: - "@alcalzone/release-script-core": 3.0.0-alpha.7 - "@alcalzone/release-script-testing": 3.0.0-alpha.7 + "@alcalzone/release-script-core": 3.0.0 + "@alcalzone/release-script-testing": 3.0.0 jest-extended: ^0.11.5 typescript: "*" languageName: unknown linkType: soft -"@alcalzone/release-script-plugin-version@3.0.0-alpha.7, @alcalzone/release-script-plugin-version@workspace:packages/plugin-version": +"@alcalzone/release-script-plugin-version@3.0.0, @alcalzone/release-script-plugin-version@workspace:packages/plugin-version": version: 0.0.0-use.local resolution: "@alcalzone/release-script-plugin-version@workspace:packages/plugin-version" dependencies: - "@alcalzone/release-script-core": 3.0.0-alpha.7 - "@alcalzone/release-script-testing": 3.0.0-alpha.7 + "@alcalzone/release-script-core": 3.0.0 + "@alcalzone/release-script-testing": 3.0.0 jest-extended: ^0.11.5 semver: ^7.3.5 typescript: "*" @@ -157,11 +157,11 @@ __metadata: languageName: unknown linkType: soft -"@alcalzone/release-script-testing@3.0.0-alpha.7, @alcalzone/release-script-testing@workspace:packages/testing": +"@alcalzone/release-script-testing@3.0.0, @alcalzone/release-script-testing@workspace:packages/testing": version: 0.0.0-use.local resolution: "@alcalzone/release-script-testing@workspace:packages/testing" dependencies: - "@alcalzone/release-script-core": 3.0.0-alpha.7 + "@alcalzone/release-script-core": 3.0.0 colors: ^1.4.0 execa: "*" typescript: "*" @@ -174,13 +174,13 @@ __metadata: version: 0.0.0-use.local resolution: "@alcalzone/release-script@workspace:packages/release-script" dependencies: - "@alcalzone/release-script-core": 3.0.0-alpha.7 - "@alcalzone/release-script-plugin-changelog": 3.0.0-alpha.7 - "@alcalzone/release-script-plugin-exec": 3.0.0-alpha.7 - "@alcalzone/release-script-plugin-git": 3.0.0-alpha.7 - "@alcalzone/release-script-plugin-package": 3.0.0-alpha.7 - "@alcalzone/release-script-plugin-version": 3.0.0-alpha.7 - "@alcalzone/release-script-testing": 3.0.0-alpha.7 + "@alcalzone/release-script-core": 3.0.0 + "@alcalzone/release-script-plugin-changelog": 3.0.0 + "@alcalzone/release-script-plugin-exec": 3.0.0 + "@alcalzone/release-script-plugin-git": 3.0.0 + "@alcalzone/release-script-plugin-package": 3.0.0 + "@alcalzone/release-script-plugin-version": 3.0.0 + "@alcalzone/release-script-testing": 3.0.0 "@types/yargs": ^17.0.2 alcalzone-shared: ^4.0.0 axios: ^0.21.4