From b80ced5b23d3a37642b685f5493b5420f23f1d3d Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 11:55:29 -0800 Subject: [PATCH 01/13] testing changelogs --- .chronus/changes/test.md | 8 ++++++++ .chronus/changes/test2.md | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 .chronus/changes/test.md create mode 100644 .chronus/changes/test2.md diff --git a/.chronus/changes/test.md b/.chronus/changes/test.md new file mode 100644 index 0000000..0037c5e --- /dev/null +++ b/.chronus/changes/test.md @@ -0,0 +1,8 @@ +--- +changeKind: feature +packages: + - "@chronus/chronus" + - "@chronus/github-pr-commenter" +--- + +FOR TESTING both diff --git a/.chronus/changes/test2.md b/.chronus/changes/test2.md new file mode 100644 index 0000000..bcee136 --- /dev/null +++ b/.chronus/changes/test2.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@chronus/github-pr-commenter" +--- + +FOR TESTING only gh commenter From b4cfaeeb883c0619d77b8b8e16dc1801d16290af Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 12:05:31 -0800 Subject: [PATCH 02/13] Only options --- packages/chronus/src/cli/cli.ts | 36 ++++++++++++------- .../src/cli/commands/apply-changesets.ts | 4 ++- .../chronus/src/cli/commands/show-status.ts | 1 + .../src/release-plan/assemble-release-plan.ts | 14 ++++++-- .../src/release-plan/determine-dependents.ts | 3 ++ 5 files changed, 42 insertions(+), 16 deletions(-) diff --git a/packages/chronus/src/cli/cli.ts b/packages/chronus/src/cli/cli.ts index 6c02fdf..1b33c20 100644 --- a/packages/chronus/src/cli/cli.ts +++ b/packages/chronus/src/cli/cli.ts @@ -27,23 +27,35 @@ async function main() { "version", "Apply change changeset and bump the versions", (cmd) => - cmd.option("ignore-policies", { - type: "boolean", - description: "Ignore versioning policies and bump each package independently", - default: false, - }), - (args) => applyChangesets(process.cwd(), { ignorePolicies: args.ignorePolicies }), + cmd + .option("ignore-policies", { + type: "boolean", + description: "Ignore versioning policies and bump each package independently", + default: false, + }) + .option("only", { + type: "string", + array: true, + description: "Only bump the specified package(s)", + }), + (args) => applyChangesets(process.cwd(), { ignorePolicies: args.ignorePolicies, only: args.only }), ) .command( "status", "Display the status of changes. What will happen during the next release", (cmd) => - cmd.option("ignore-policies", { - type: "boolean", - description: "Ignore versioning policies and bump each package independently", - default: false, - }), - (args) => showStatus(process.cwd(), { ignorePolicies: args.ignorePolicies }), + cmd + .option("ignore-policies", { + type: "boolean", + description: "Ignore versioning policies and bump each package independently", + default: false, + }) + .option("only", { + type: "string", + array: true, + description: "Only bump the specified package(s)", + }), + (args) => showStatus(process.cwd(), { ignorePolicies: args.ignorePolicies, only: args.only }), ) .parse(); } diff --git a/packages/chronus/src/cli/commands/apply-changesets.ts b/packages/chronus/src/cli/commands/apply-changesets.ts index bdc6980..ce71fb4 100644 --- a/packages/chronus/src/cli/commands/apply-changesets.ts +++ b/packages/chronus/src/cli/commands/apply-changesets.ts @@ -8,8 +8,10 @@ import { loadChronusWorkspace } from "../../workspace/load.js"; import type { ChronusWorkspace } from "../../workspace/types.js"; export interface ApplyChangesetsOptions { - ignorePolicies?: boolean; + readonly ignorePolicies?: boolean; + readonly only?: string[]; } + export async function applyChangesets(cwd: string, options?: ApplyChangesetsOptions): Promise { const host = NodeChronusHost; const workspace = await loadChronusWorkspace(host, cwd); diff --git a/packages/chronus/src/cli/commands/show-status.ts b/packages/chronus/src/cli/commands/show-status.ts index 5225676..40642c1 100644 --- a/packages/chronus/src/cli/commands/show-status.ts +++ b/packages/chronus/src/cli/commands/show-status.ts @@ -7,6 +7,7 @@ import { resolveReleasePlan, type ApplyChangesetsOptions } from "./apply-changes export interface ShowStatusOptions { readonly ignorePolicies?: boolean; + readonly only?: string[]; } function log(...args: any[]) { diff --git a/packages/chronus/src/release-plan/assemble-release-plan.ts b/packages/chronus/src/release-plan/assemble-release-plan.ts index 09962d1..79a15b9 100644 --- a/packages/chronus/src/release-plan/assemble-release-plan.ts +++ b/packages/chronus/src/release-plan/assemble-release-plan.ts @@ -7,7 +7,8 @@ import type { InternalReleaseAction } from "./types.internal.js"; import type { ReleaseAction, ReleasePlan } from "./types.js"; export interface ApplyChangesetsOptions { - ignorePolicies?: boolean; + readonly ignorePolicies?: boolean; + readonly only?: string[]; } export function assembleReleasePlan( @@ -16,7 +17,7 @@ export function assembleReleasePlan( options?: ApplyChangesetsOptions, ): ReleasePlan { const packagesByName = new Map(workspace.allPackages.map((pkg) => [pkg.name, pkg])); - const requested = reduceChanges(changes, workspace); + const requested = reduceChanges(changes, workspace, options?.only); const dependentsGraph = getDependentsGraph(workspace.allPackages); const internalActions = new Map(); @@ -24,6 +25,7 @@ export function assembleReleasePlan( for (const policy of workspace.config.versionPolicies) { if (policy.type === "lockstep") { for (const pkgName of policy.packages) { + if (options?.only && !options.only.includes(pkgName)) continue; const pkg = packagesByName.get(pkgName); if (!pkg) throw new Error(`Could not find package ${pkgName}`); internalActions.set(pkgName, { @@ -49,6 +51,7 @@ export function assembleReleasePlan( actions: internalActions, workspace, dependentsGraph, + only: options?.only, }); const actions = [...internalActions.values()].map((incompleteRelease): ReleaseAction => { @@ -65,7 +68,11 @@ export function assembleReleasePlan( }; } -function reduceChanges(changes: ChangeDescription[], workspace: ChronusWorkspace): Map { +function reduceChanges( + changes: ChangeDescription[], + workspace: ChronusWorkspace, + only?: string[], +): Map { const releases: Map = new Map(); changes.forEach((change) => { @@ -74,6 +81,7 @@ function reduceChanges(changes: ChangeDescription[], workspace: ChronusWorkspace // Filter out ignored packages because they should not trigger a release // If their dependencies need updates, they will be added to releases by `determineDependents()` with release type `none` .filter((name) => !workspace.getPackage(name).ignored) + .filter((name) => !only || only.includes(name)) .forEach((name) => { let release: InternalReleaseAction | undefined = releases.get(name); const pkg = workspace.allPackages.find((x) => x.name === name); diff --git a/packages/chronus/src/release-plan/determine-dependents.ts b/packages/chronus/src/release-plan/determine-dependents.ts index 4b5d623..e235385 100644 --- a/packages/chronus/src/release-plan/determine-dependents.ts +++ b/packages/chronus/src/release-plan/determine-dependents.ts @@ -21,10 +21,12 @@ export function applyDependents({ actions, workspace, dependentsGraph, + only, }: { actions: Map; workspace: ChronusWorkspace; dependentsGraph: Map; + only?: string[]; }): boolean { let updated = false; // NOTE this is intended to be called recursively @@ -40,6 +42,7 @@ export function applyDependents({ continue; } pkgDependents + .filter((x) => !only || only.includes(x)) .map((x) => workspace.getPackage(x)) .map((dependentPackage) => { let type: VersionType | undefined; From 336c968169e515a454225d2f6f0c552dcc17260c Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:28:19 -0800 Subject: [PATCH 03/13] only delete the right changelogs --- .../apply-release-plan/apply-release-plan.ts | 32 +++++++- .../assemble-release-plan.test.ts | 27 +++++- .../src/release-plan/assemble-release-plan.ts | 82 ++++++++++--------- packages/chronus/src/release-plan/types.ts | 16 +++- 4 files changed, 115 insertions(+), 42 deletions(-) diff --git a/packages/chronus/src/apply-release-plan/apply-release-plan.ts b/packages/chronus/src/apply-release-plan/apply-release-plan.ts index 4db3a70..70bc70e 100644 --- a/packages/chronus/src/apply-release-plan/apply-release-plan.ts +++ b/packages/chronus/src/apply-release-plan/apply-release-plan.ts @@ -1,6 +1,7 @@ -import { deleteChangeDescription } from "../change/write.js"; +import type { ChangeDescription } from "../change/types.js"; +import { deleteChangeDescription, writeChangeDescription } from "../change/write.js"; import { updateChangelog } from "../changelog/generate.js"; -import type { ReleaseAction, ReleasePlan } from "../release-plan/types.js"; +import type { ReleaseAction, ReleasePlan, ReleasePlanChangeApplication } from "../release-plan/types.js"; import type { ChronusHost } from "../utils/host.js"; import type { ChronusWorkspace } from "../workspace/types.js"; import { updatePackageJson } from "./update-package-json.js"; @@ -20,6 +21,31 @@ export async function applyReleasePlan( } for (const change of releasePlan.changes) { - deleteChangeDescription(host, workspace, change); + await cleanChangeApplication(host, workspace, change); } } + +async function cleanChangeApplication( + host: ChronusHost, + workspace: ChronusWorkspace, + application: ReleasePlanChangeApplication, +) { + switch (application.usage) { + case "used": + return await deleteChangeDescription(host, workspace, application.change); + case "partial": + return await patchChangeDescription(host, workspace, application.change, application.packages); + } +} +async function patchChangeDescription( + host: ChronusHost, + workspace: ChronusWorkspace, + change: ChangeDescription, + exclude: string[], +) { + const newChange = { + ...change, + packages: change.packages.filter((x) => !exclude.includes(x)), + }; + writeChangeDescription(host, workspace, newChange); +} diff --git a/packages/chronus/src/release-plan/assemble-release-plan.test.ts b/packages/chronus/src/release-plan/assemble-release-plan.test.ts index eb71acf..e695b4d 100644 --- a/packages/chronus/src/release-plan/assemble-release-plan.test.ts +++ b/packages/chronus/src/release-plan/assemble-release-plan.test.ts @@ -33,7 +33,7 @@ describe("Assemble Release Plan", () => { const baseConfig: ChronusResolvedConfig = { workspaceRoot: "proj", baseBranch: "main", changeKinds }; describe("bumps package independently", () => { - it("only packages with changeset ", () => { + it("only packages with changeset", () => { const plan = assembleReleasePlan([mkChange("pkg-a", "minor")], createChronusWorkspace(workspace, baseConfig)); expect(plan.actions).toHaveLength(1); expect(plan.actions[0]).toMatchObject({ packageName: "pkg-a", oldVersion: "1.0.0", newVersion: "1.1.0" }); @@ -162,4 +162,29 @@ describe("Assemble Release Plan", () => { expect(plan.actions[0]).toMatchObject({ packageName: "pkg-a", oldVersion: "1.0.0", newVersion: "1.1.0" }); }); }); + + describe.only("partial release plan using only option", () => { + it("ignore other packages with changes", () => { + const workspace: Workspace = mkWorkspace([mkPkg("pkg-a", {}), mkPkg("pkg-b", {})]); + const plan = assembleReleasePlan( + [mkChange("pkg-a", "minor"), mkChange("pkg-b", "minor")], + createChronusWorkspace(workspace, baseConfig), + { only: ["pkg-a"] }, + ); + expect(plan.actions).toHaveLength(1); + expect(plan.actions[0]).toMatchObject({ packageName: "pkg-a", oldVersion: "1.0.0", newVersion: "1.1.0" }); + }); + + it("ignore packages that would need to be bumped as dependent", () => { + const workspace: Workspace = mkWorkspace([ + mkPkg("pkg-a", {}), + mkPkg("pkg-b", { dependencies: { "pkg-a": "1.0.0" } }), + ]); + const plan = assembleReleasePlan([mkChange("pkg-a", "minor")], createChronusWorkspace(workspace, baseConfig), { + only: ["pkg-a"], + }); + expect(plan.actions).toHaveLength(1); + expect(plan.actions[0]).toMatchObject({ packageName: "pkg-a", oldVersion: "1.0.0", newVersion: "1.1.0" }); + }); + }); }); diff --git a/packages/chronus/src/release-plan/assemble-release-plan.ts b/packages/chronus/src/release-plan/assemble-release-plan.ts index 79a15b9..f9c1233 100644 --- a/packages/chronus/src/release-plan/assemble-release-plan.ts +++ b/packages/chronus/src/release-plan/assemble-release-plan.ts @@ -4,7 +4,7 @@ import type { ChronusWorkspace } from "../workspace/types.js"; import { applyDependents } from "./determine-dependents.js"; import { incrementVersion } from "./increment-version.js"; import type { InternalReleaseAction } from "./types.internal.js"; -import type { ReleaseAction, ReleasePlan } from "./types.js"; +import type { ReleaseAction, ReleasePlan, ReleasePlanChangeApplication } from "./types.js"; export interface ApplyChangesetsOptions { readonly ignorePolicies?: boolean; @@ -17,7 +17,7 @@ export function assembleReleasePlan( options?: ApplyChangesetsOptions, ): ReleasePlan { const packagesByName = new Map(workspace.allPackages.map((pkg) => [pkg.name, pkg])); - const requested = reduceChanges(changes, workspace, options?.only); + const { changeApplications, actions: requested } = reduceChanges(changes, workspace, options?.only); const dependentsGraph = getDependentsGraph(workspace.allPackages); const internalActions = new Map(); @@ -63,7 +63,7 @@ export function assembleReleasePlan( }); return { - changes, + changes: changeApplications, actions, }; } @@ -72,45 +72,53 @@ function reduceChanges( changes: ChangeDescription[], workspace: ChronusWorkspace, only?: string[], -): Map { - const releases: Map = new Map(); - - changes.forEach((change) => { +): { changeApplications: ReleasePlanChangeApplication[]; actions: Map } { + const actions: Map = new Map(); + const changeApplications: ReleasePlanChangeApplication[] = []; + for (const change of changes) { const type = change.changeKind.versionType; - change.packages - // Filter out ignored packages because they should not trigger a release - // If their dependencies need updates, they will be added to releases by `determineDependents()` with release type `none` - .filter((name) => !workspace.getPackage(name).ignored) + // Filter out ignored packages because they should not trigger a release + // If their dependencies need updates, they will be added to releases by `determineDependents()` with release type `none` + const packages = change.packages .filter((name) => !only || only.includes(name)) - .forEach((name) => { - let release: InternalReleaseAction | undefined = releases.get(name); - const pkg = workspace.allPackages.find((x) => x.name === name); - if (!pkg) { - throw new Error( - `"${change}" changeset mentions a release for a package "${name}" but such a package could not be found.`, - ); - } - if (!release) { - release = { - packageName: name, - type, - oldVersion: pkg.version, - policy: { name: "", type: "independent", packages: [name] }, - }; - } else { - if ( - type === "major" || - ((release.type === "patch" || release.type === "none") && (type === "minor" || type === "patch")) - ) { - release.type = type; - } + .map((name) => workspace.getPackage(name)) + .filter((pkg) => !pkg.ignored); + + changeApplications.push({ + usage: change.packages.length === packages.length ? "used" : packages.length === 0 ? "unused" : "partial", + packages: packages.map((pkg) => pkg.name), + change, + }); + + packages.forEach((pkg) => { + const name = pkg.name; + let release: InternalReleaseAction | undefined = actions.get(name); + if (!pkg) { + throw new Error( + `"${change}" changeset mentions a release for a package "${name}" but such a package could not be found.`, + ); + } + if (!release) { + release = { + packageName: name, + type, + oldVersion: pkg.version, + policy: { name: "", type: "independent", packages: [name] }, + }; + } else { + if ( + type === "major" || + ((release.type === "patch" || release.type === "none") && (type === "minor" || type === "patch")) + ) { + release.type = type; } + } - releases.set(name, release); - }); - }); + actions.set(name, release); + }); + } - return releases; + return { actions, changeApplications }; } function getNewVersion(release: InternalReleaseAction): string { diff --git a/packages/chronus/src/release-plan/types.ts b/packages/chronus/src/release-plan/types.ts index ac414b9..226a875 100644 --- a/packages/chronus/src/release-plan/types.ts +++ b/packages/chronus/src/release-plan/types.ts @@ -10,6 +10,20 @@ export interface ReleaseAction { } export interface ReleasePlan { - readonly changes: ChangeDescription[]; + readonly changes: ReleasePlanChangeApplication[]; readonly actions: ReleaseAction[]; } + +export type ReleasePlanChangeUsage = "unused" | "used" | "partial"; + +export interface ReleasePlanChangeApplication { + readonly usage: "unused" | "used" | "partial"; + /** + * Name of the packages this change description was used to bump. + * In the case of `used` it should match the `change.packages` + * In the case of `partial` it should be a subset of `change.packages` + * In the case of `unused` it should be an empty array + */ + readonly packages: string[]; + readonly change: ChangeDescription; +} From cd900d8417e9d76c5af06ff0c35d28d9449f760d Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:34:01 -0800 Subject: [PATCH 04/13] Add more tests --- .../assemble-release-plan.test.ts | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/packages/chronus/src/release-plan/assemble-release-plan.test.ts b/packages/chronus/src/release-plan/assemble-release-plan.test.ts index e695b4d..9c73168 100644 --- a/packages/chronus/src/release-plan/assemble-release-plan.test.ts +++ b/packages/chronus/src/release-plan/assemble-release-plan.test.ts @@ -10,9 +10,14 @@ import { assembleReleasePlan } from "./assemble-release-plan.js"; describe("Assemble Release Plan", () => { let idCounter = 0; const changeKinds = addNameToChangeKinds(defaultChangeKinds); - function mkChange(pkg: string, type: VersionType): ChangeDescription { + function mkChange(pkg: string | string[], type: VersionType): ChangeDescription { const id = String(idCounter++); - return { id, content: `Changeset ${id}`, changeKind: changeKinds[type], packages: [pkg] }; + return { + id, + content: `Changeset ${id}`, + changeKind: changeKinds[type], + packages: Array.isArray(pkg) ? pkg : [pkg], + }; } function mkWorkspace(packages: Package[]): Workspace { @@ -163,7 +168,7 @@ describe("Assemble Release Plan", () => { }); }); - describe.only("partial release plan using only option", () => { + describe("partial release plan using only option", () => { it("ignore other packages with changes", () => { const workspace: Workspace = mkWorkspace([mkPkg("pkg-a", {}), mkPkg("pkg-b", {})]); const plan = assembleReleasePlan( @@ -186,5 +191,30 @@ describe("Assemble Release Plan", () => { expect(plan.actions).toHaveLength(1); expect(plan.actions[0]).toMatchObject({ packageName: "pkg-a", oldVersion: "1.0.0", newVersion: "1.1.0" }); }); + + it("report changes as fully used if bumping all packages tagged in it", () => { + const workspace: Workspace = mkWorkspace([mkPkg("pkg-a", {}), mkPkg("pkg-b", {}), mkPkg("pkg-c", {})]); + const plan = assembleReleasePlan( + [mkChange(["pkg-a", "pkg-b"], "minor")], + createChronusWorkspace(workspace, baseConfig), + { + only: ["pkg-a", "pkg-b"], + }, + ); + expect(plan.changes).toHaveLength(1); + expect(plan.changes[0]).toMatchObject({ usage: "used", packages: ["pkg-a", "pkg-b"] }); + }); + it("report changes as partially used if only bumping some packages tagged in it", () => { + const workspace: Workspace = mkWorkspace([mkPkg("pkg-a", {}), mkPkg("pkg-b", {})]); + const plan = assembleReleasePlan( + [mkChange(["pkg-a", "pkg-b"], "minor")], + createChronusWorkspace(workspace, baseConfig), + { + only: ["pkg-a"], + }, + ); + expect(plan.changes).toHaveLength(1); + expect(plan.changes[0]).toMatchObject({ usage: "partial", packages: ["pkg-a"] }); + }); }); }); From db72009503c015bc43519ca260ae21e43df75e4b Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:34:27 -0800 Subject: [PATCH 05/13] remove test --- .chronus/changes/test.md | 8 -------- .chronus/changes/test2.md | 7 ------- 2 files changed, 15 deletions(-) delete mode 100644 .chronus/changes/test.md delete mode 100644 .chronus/changes/test2.md diff --git a/.chronus/changes/test.md b/.chronus/changes/test.md deleted file mode 100644 index 0037c5e..0000000 --- a/.chronus/changes/test.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: feature -packages: - - "@chronus/chronus" - - "@chronus/github-pr-commenter" ---- - -FOR TESTING both diff --git a/.chronus/changes/test2.md b/.chronus/changes/test2.md deleted file mode 100644 index bcee136..0000000 --- a/.chronus/changes/test2.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@chronus/github-pr-commenter" ---- - -FOR TESTING only gh commenter From 0a4ca3dfd24492521f887f160e8ad46b83be9f45 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:46:34 -0800 Subject: [PATCH 06/13] docs --- README.md | 20 +++++++++++++++++--- docs/cli.md | 33 +++++++++++++++++++++++++++++++++ docs/readme.md | 7 +++++++ docs/version-policies.md | 5 +++++ 4 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 docs/cli.md create mode 100644 docs/readme.md create mode 100644 docs/version-policies.md diff --git a/README.md b/README.md index ee4a5f1..a41d23e 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,27 @@ chronus goal is to provide changelog management. It was heavily inspired by [cha - Design to be able to plug in different monorepo(changesets also does that), source control system as a plugin system(only git added but left room for more). - Change can be defined in custom categories that allow more meaningful grouping of changes in the changelog. See [Change kinds doc](./docs/change-kinds.md) -## Requirements +## Documentation -- Node 16+ -- pnpm 7.5.2+ +- [CLI](cli.md) + +Chronus functionalities: + +- [Configure change kinds](change-kinds.md) _Use a different set of change kinds from `major`, `minor`, `patch`_ ## Develop +- [CLI](cli.md) + +Chronus functionalities: + +- [Configure change kinds](change-kinds.md) _Use a different set of change kinds from `major`, `minor`, `patch`_ + +### Requirements + +- Node LTS +- `pnpm` + [Click here to release current changes](https://github.com/timotheeguerin/chronus/pull/new/publish/auto-release) This project uses [pnpm workspaces](https://pnpm.io/workspaces) to manage multiple packages. diff --git a/docs/cli.md b/docs/cli.md new file mode 100644 index 0000000..f95c6c8 --- /dev/null +++ b/docs/cli.md @@ -0,0 +1,33 @@ +# Chronus CLI + +## `chronus add` + +Add a new change description + +## `chronus verify` + +Verify that the packages with changes from the `baseBranch` have all been described. + +## `chronus status` + +This command will show the current status of the changes in the workspace. This is basically a summary of what `chronus version` will do if run. + +This command takes the same options as [`chronus version`](#chronus-version). + +## `chronus version` + +Apply the change description and bump version of packages. By default this will respect the version policies configured(see [version policies](version-policies.md)). + +### Options + +#### `--ignore-policies` + +This allows to ignore the [version policies](version-policies.md) and bump the packages independently. This can be useful in the `lockStep` policies when doing a hotfix. + +#### `--only` + +Only bumps the packages specified. This can be useful if wanting to only release certain packages. This command will extract the change descriptions for the specified packages and bump the version of those packages. If a change applied to a package is not specified in the `--only` option it will be ignored. If a change is specified in both it will be applied and the packages included in the `only` array will be removed from the change description file. + +```bash +chronus version --only @my-scope/my-package1 --only @my-scope/my-package2 +``` diff --git a/docs/readme.md b/docs/readme.md new file mode 100644 index 0000000..6f54a13 --- /dev/null +++ b/docs/readme.md @@ -0,0 +1,7 @@ +# Chronus Documentation + +- [CLI](cli.md) + +Chronus functionalities: + +- [Configure change kinds](change-kinds.md) _Use a different set of change kinds from `major`, `minor`, `patch`_ diff --git a/docs/version-policies.md b/docs/version-policies.md new file mode 100644 index 0000000..b60929c --- /dev/null +++ b/docs/version-policies.md @@ -0,0 +1,5 @@ +# Chronus Version Policies + +By default each package is versioned independentely. This means if you describe a change for package `a` it will only bump the version of `a` and any package depending on `a` that would need a release to include the new version of `a`. + +TODO From 5126bf407c86d05870b79ebfd360144be4862f28 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:48:13 -0800 Subject: [PATCH 07/13] Create feature-partial-release-2024-1-24-21-34-56.md --- .../changes/feature-partial-release-2024-1-24-21-34-56.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .chronus/changes/feature-partial-release-2024-1-24-21-34-56.md diff --git a/.chronus/changes/feature-partial-release-2024-1-24-21-34-56.md b/.chronus/changes/feature-partial-release-2024-1-24-21-34-56.md new file mode 100644 index 0000000..432b1ce --- /dev/null +++ b/.chronus/changes/feature-partial-release-2024-1-24-21-34-56.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: breaking, feature, fix, internal +changeKind: fix +packages: + - "@chronus/chronus" +--- + +Partial Release using `--only` to bump version of select packages From f3435df94165319b2436dcc14ce78e8c5a5825cd Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:51:04 -0800 Subject: [PATCH 08/13] Create _test_feature-partial-release-2024-1-24-21-34-56.md --- .../_test_feature-partial-release-2024-1-24-21-34-56.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .chronus/changes/_test_feature-partial-release-2024-1-24-21-34-56.md diff --git a/.chronus/changes/_test_feature-partial-release-2024-1-24-21-34-56.md b/.chronus/changes/_test_feature-partial-release-2024-1-24-21-34-56.md new file mode 100644 index 0000000..2d90cd2 --- /dev/null +++ b/.chronus/changes/_test_feature-partial-release-2024-1-24-21-34-56.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: breaking, feature, fix, internal +changeKind: fix +packages: + - "@chronus/chronus" +--- + +Feature: Partial Release using `--only` to bump version of select packages From c30092f778de0af0946e7f1f7214f620decbb33d Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:51:27 -0800 Subject: [PATCH 09/13] Delete .chronus/changes/_test_feature-partial-release-2024-1-24-21-34-56.md --- .../_test_feature-partial-release-2024-1-24-21-34-56.md | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .chronus/changes/_test_feature-partial-release-2024-1-24-21-34-56.md diff --git a/.chronus/changes/_test_feature-partial-release-2024-1-24-21-34-56.md b/.chronus/changes/_test_feature-partial-release-2024-1-24-21-34-56.md deleted file mode 100644 index 2d90cd2..0000000 --- a/.chronus/changes/_test_feature-partial-release-2024-1-24-21-34-56.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: breaking, feature, fix, internal -changeKind: fix -packages: - - "@chronus/chronus" ---- - -Feature: Partial Release using `--only` to bump version of select packages From 68d15617658d32491e08de59ccaf53b8e5db2c8a Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:52:45 -0800 Subject: [PATCH 10/13] Create testfeature-partial-release-2024-1-24-21-34-56.md --- .../testfeature-partial-release-2024-1-24-21-34-56.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md diff --git a/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md b/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md new file mode 100644 index 0000000..2d90cd2 --- /dev/null +++ b/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: breaking, feature, fix, internal +changeKind: fix +packages: + - "@chronus/chronus" +--- + +Feature: Partial Release using `--only` to bump version of select packages From 7cc02838f56b368647888ec529cd83a821090c3f Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:53:12 -0800 Subject: [PATCH 11/13] Delete .chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md --- .../testfeature-partial-release-2024-1-24-21-34-56.md | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md diff --git a/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md b/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md deleted file mode 100644 index 2d90cd2..0000000 --- a/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: breaking, feature, fix, internal -changeKind: fix -packages: - - "@chronus/chronus" ---- - -Feature: Partial Release using `--only` to bump version of select packages From d6c175d41c9cefdc878303ad14a641048a84de3e Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:54:41 -0800 Subject: [PATCH 12/13] Create testfeature-partial-release-2024-1-24-21-34-56.md --- .../testfeature-partial-release-2024-1-24-21-34-56.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md diff --git a/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md b/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md new file mode 100644 index 0000000..c138eb1 --- /dev/null +++ b/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: breaking, feature, fix, internal +changeKind: fix +packages: + - "@chronus/chronus" +--- + +Feature: Partial Release using `--only` to bump version of select packages From f6e2c90db36e4ddb5c86fe72ba9ab1cc7a498433 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 24 Feb 2024 13:55:32 -0800 Subject: [PATCH 13/13] Delete .chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md --- .../testfeature-partial-release-2024-1-24-21-34-56.md | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md diff --git a/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md b/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md deleted file mode 100644 index c138eb1..0000000 --- a/.chronus/changes/testfeature-partial-release-2024-1-24-21-34-56.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: breaking, feature, fix, internal -changeKind: fix -packages: - - "@chronus/chronus" ---- - -Feature: Partial Release using `--only` to bump version of select packages