@packtory/cli 0.0.38 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/command-line-interface/runner/changelog-destinations.js +84 -34
  2. package/command-line-interface/runner/changelog-destinations.js.map +1 -1
  3. package/command-line-interface/runner/changelog-handler.js +15 -56
  4. package/command-line-interface/runner/changelog-handler.js.map +1 -1
  5. package/command-line-interface/runner/failure-printing.js +9 -9
  6. package/command-line-interface/runner/failure-printing.js.map +1 -1
  7. package/command-line-interface/runner/github-api-request.js +37 -0
  8. package/command-line-interface/runner/github-api-request.js.map +1 -0
  9. package/command-line-interface/runner/github-release-client.js +37 -0
  10. package/command-line-interface/runner/github-release-client.js.map +1 -0
  11. package/command-line-interface/runner/github-repository.js +15 -0
  12. package/command-line-interface/runner/github-repository.js.map +1 -0
  13. package/command-line-interface/runner/publish-handler.js +1 -1
  14. package/command-line-interface/runner/publish-handler.js.map +1 -1
  15. package/command-line-interface/runner/release-git-client.js +53 -0
  16. package/command-line-interface/runner/release-git-client.js.map +1 -0
  17. package/command-line-interface/runner/release-handler.js +324 -0
  18. package/command-line-interface/runner/release-handler.js.map +1 -0
  19. package/command-line-interface/runner/release-plan-result-printing.js +26 -0
  20. package/command-line-interface/runner/release-plan-result-printing.js.map +1 -0
  21. package/command-line-interface/runner/runner.js +40 -8
  22. package/command-line-interface/runner/runner.js.map +1 -1
  23. package/package.json +3 -2
  24. package/packages/command-line-interface/command-line-interface.entry-point.d.ts.map +1 -1
  25. package/packages/command-line-interface/command-line-interface.entry-point.js +22 -3
  26. package/packages/command-line-interface/command-line-interface.entry-point.js.map +1 -1
  27. package/packtory/packtory-changelog.js +30 -27
  28. package/packtory/packtory-changelog.js.map +1 -1
  29. package/readme.md +24 -1
  30. package/sbom.cdx.json +27 -10
@@ -1,26 +1,29 @@
1
+ import path from 'node:path';
1
2
  import { compareValues } from "packtory/common/sort-values.js";
2
3
  const changelogFileName = 'CHANGELOG.md';
3
- const changelogFileSuffix = `/${changelogFileName}`;
4
- function changedPackagesFrom(packages) {
4
+ function selectChangedPackages(packages) {
5
5
  return packages.filter((packagePlan) => {
6
6
  return packagePlan.changed;
7
7
  });
8
8
  }
9
- function sortedUnique(values) {
9
+ function sortUniqueValues(values) {
10
10
  return Array.from(values).toSorted(compareValues);
11
11
  }
12
- function changelogPathsFrom(packages) {
13
- return sortedUnique(new Set(packages.flatMap((packagePlan) => {
14
- return packagePlan.changelogSourceFiles.filter((filePath) => {
15
- return filePath === changelogFileName || filePath.endsWith(changelogFileSuffix);
16
- });
12
+ function isChangelogFilePath(filePath) {
13
+ return path.posix.basename(filePath) === changelogFileName;
14
+ }
15
+ function collectChangelogPaths(packages) {
16
+ return sortUniqueValues(new Set(packages.flatMap((packagePlan) => {
17
+ return packagePlan.changelogSourceFiles.filter(isChangelogFilePath);
17
18
  })));
18
19
  }
19
- function mergedIgnoredAttributionPaths(packages, configuredPaths) {
20
- return sortedUnique(new Set([...changelogPathsFrom(packages), ...configuredPaths]));
20
+ function mergeIgnoredAttributionPaths(packages, configuredPaths) {
21
+ return sortUniqueValues(new Set([...collectChangelogPaths(packages), ...configuredPaths]));
21
22
  }
22
- async function baseRefFor(prLogEngine, packagePlan) {
23
- if (packagePlan.previousVersion === undefined && packagePlan.previousGitHead === undefined) {
23
+ async function resolveBaseRefFor(prLogEngine, packagePlan, input) {
24
+ if (input.explicitBaseRef === undefined &&
25
+ packagePlan.previousVersion === undefined &&
26
+ packagePlan.previousGitHead === undefined) {
24
27
  const baseRef = await prLogEngine.resolveLatestSemverChangelogBaseRef();
25
28
  return baseRef.ref;
26
29
  }
@@ -28,13 +31,13 @@ async function baseRefFor(prLogEngine, packagePlan) {
28
31
  packageName: packagePlan.name,
29
32
  previousVersion: packagePlan.previousVersion,
30
33
  previousGitHead: packagePlan.previousGitHead,
31
- packageTagFormat: undefined,
32
- explicitBaseRef: undefined
34
+ packageTagFormat: input.packageTagFormat,
35
+ explicitBaseRef: input.explicitBaseRef
33
36
  });
34
37
  return baseRef.ref;
35
38
  }
36
- async function targetPullRequestsFor(input, packagePlan, ignoredAttributionPaths) {
37
- const baseRef = await baseRefFor(input.prLogEngine, packagePlan);
39
+ async function collectTargetPullRequests(input, packagePlan, ignoredAttributionPaths) {
40
+ const baseRef = await resolveBaseRefFor(input.prLogEngine, packagePlan, input);
38
41
  const pullRequests = await input.prLogEngine.collectMergedPullRequests({
39
42
  githubRepo: input.githubRepo,
40
43
  baseRef
@@ -56,16 +59,16 @@ async function targetPullRequestsFor(input, packagePlan, ignoredAttributionPaths
56
59
  ignoredLabels: [],
57
60
  pullRequests: packagePullRequests,
58
61
  targetName: packagePlan.name,
59
- targetScopedLabelPattern: undefined
62
+ targetScopedLabelPattern: input.targetScopedLabelPattern
60
63
  });
61
64
  }
62
- async function changelogTargetFor(input, packagePlan, ignoredAttributionPaths) {
65
+ async function createChangelogTarget(input, packagePlan, ignoredAttributionPaths) {
63
66
  return {
64
67
  packagePlan,
65
- pullRequests: await targetPullRequestsFor(input, packagePlan, ignoredAttributionPaths)
68
+ pullRequests: await collectTargetPullRequests(input, packagePlan, ignoredAttributionPaths)
66
69
  };
67
70
  }
68
- function targetSectionFrom(target) {
71
+ function createTargetSection(target) {
69
72
  return {
70
73
  targetName: target.packagePlan.name,
71
74
  unreleased: false,
@@ -73,9 +76,9 @@ function targetSectionFrom(target) {
73
76
  mergedPullRequests: target.pullRequests
74
77
  };
75
78
  }
76
- function packageMarkdownByNameFrom(input, targets) {
79
+ function createPackageMarkdownByName(input, targets) {
77
80
  return new Map(targets.map((target) => {
78
- const targetSection = targetSectionFrom(target);
81
+ const targetSection = createTargetSection(target);
79
82
  return [
80
83
  target.packagePlan.name,
81
84
  input.prLogEngine.renderTargetChangelog({
@@ -89,10 +92,10 @@ function packageMarkdownByNameFrom(input, targets) {
89
92
  }));
90
93
  }
91
94
  export async function generateChangelogOutputs(input) {
92
- const packages = changedPackagesFrom(input.packages);
93
- const ignoredAttributionPaths = mergedIgnoredAttributionPaths(packages, input.ignoredAttributionPaths);
95
+ const packages = selectChangedPackages(input.packages);
96
+ const ignoredAttributionPaths = mergeIgnoredAttributionPaths(packages, input.ignoredAttributionPaths);
94
97
  const targets = await Promise.all(packages.map(async (packagePlan) => {
95
- return changelogTargetFor(input, packagePlan, ignoredAttributionPaths);
98
+ return createChangelogTarget(input, packagePlan, ignoredAttributionPaths);
96
99
  }));
97
100
  return {
98
101
  groupedMarkdown: input.prLogEngine.renderGroupedTargetChangelog({
@@ -100,9 +103,9 @@ export async function generateChangelogOutputs(input) {
100
103
  currentDate: input.currentDate,
101
104
  validLabels: input.validLabels,
102
105
  githubRepo: input.githubRepo,
103
- targets: targets.map(targetSectionFrom)
106
+ targets: targets.map(createTargetSection)
104
107
  }),
105
- packageMarkdownByName: packageMarkdownByNameFrom(input, targets)
108
+ packageMarkdownByName: createPackageMarkdownByName(input, targets)
106
109
  };
107
110
  }
108
111
  //# sourceMappingURL=packtory-changelog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packtory-changelog.js","sourceRoot":"","sources":["../../../../source/packtory/packtory-changelog.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAiCzD,MAAM,iBAAiB,GAAG,cAAc,CAAC;AACzC,MAAM,mBAAmB,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAEpD,SAAS,mBAAmB,CAAC,QAAuC;IAChE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE;QACnC,OAAO,WAAW,CAAC,OAAO,CAAC;IAC/B,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,YAAY,CAAC,MAA2B;IAC7C,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAuC;IAC/D,OAAO,YAAY,CACf,IAAI,GAAG,C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,MAAM,OAAO,CAAC,GAAG,CAC7B,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;QAC/B,OAAO,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,uBAAuB,CAAC,CAAC;IAC9E,CAAC,CAAC,CACL,CAAC;IAEF,OAAO;QACH,eAAe,EAAE,KAAK,CAAC,WAAW,CAAC,4BAA4B,CAAC;YAC5D,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;SAC5C,CAAC;QACF,qBAAqB,EAAE,2BAA2B,CAAC,KAAK,EAAE,OAAO,CAAC;KACrE,CAAC;AACN,CAAC"}
package/readme.md CHANGED
@@ -21,6 +21,7 @@ packtory <command> [options]
21
21
  - **preview:** Runs a fresh dry-run build with report collection enabled and shows a human-oriented preview of the emitted package contents, file statuses, and changed-file diffs.
22
22
  - **release-diff:** Runs the same dry-run build as `preview` and shows, per package, the changes between the latest version currently published on the configured registry and the bundle the next run would publish.
23
23
  - **changelog:** Builds the next release plan, attributes merged GitHub pull requests to changed packages, and prints grouped Markdown changelog output.
24
+ - **release:** Prints the next release plan by default, or runs one explicit release workflow when action flags and `--no-dry-run` are set.
24
25
  - **publish:** Bundles and publishes npm packages based on the configuration in `packtory.config.js`.
25
26
  - **pack:** Builds a single configured package and writes it to disk as a zip archive, tarball, or expanded folder. Intended for ad-hoc artifact use cases such as AWS Lambda deployments, container builds, or local inspection — `pack` never talks to a registry.
26
27
 
@@ -31,6 +32,12 @@ packtory <command> [options]
31
32
  - **publish --report-json:** Writes `packtory-report.json`, the machine-readable `BuildReport`.
32
33
  - **publish --report-html:** Writes `packtory-report.html`, the rich HTML report used by `packtory preview --open`.
33
34
  - **publish --stage:** Uses npm staged publishing instead of a direct publish. Successful runs print the npm `stageId` per package. Approval still happens later via `npm stage approve <stage-id>` or npmjs.com. Stage mode is npm-only, and the package must already exist on npm.
35
+ - **release --write-changelog:** Writes configured changelog file outputs for packages in the release plan.
36
+ - **release --commit:** Commits written changelog files. Requires `--write-changelog`.
37
+ - **release --publish:** Publishes changed packages directly to npm. Staged publishing is not used by `release`.
38
+ - **release --tag:** Creates one annotated tag per released package, named `{packageName}@{version}`.
39
+ - **release --push:** Runs `git push --follow-tags`. Requires `--commit` or `--tag`.
40
+ - **release --github-release:** Creates one GitHub Release per package tag. Requires `--tag --push`.
34
41
  - **pack &lt;package&gt; --format &lt;zip|tar|folder&gt; --out &lt;path&gt;:** Selects which package from the configuration to build and where to write it. `--format` and `--out` are required.
35
42
  - **pack --version &lt;version&gt;:** Stamps the produced manifest with the given version. Defaults to `0.0.0` when omitted, since `pack` is decoupled from the registry-driven automatic versioning used by `publish`.
36
43
  - **pack --vendor-dependencies:** Resolves every external (and bundle) dependency from the local `node_modules` and materializes them next to the package files inside the artifact. Use this for self-contained deployments where the runtime cannot run `npm install` (e.g. AWS Lambda zips). Without the flag, dependencies are recorded in the generated `package.json` only.
@@ -63,8 +70,11 @@ packtory <command> [options]
63
70
 
64
71
  - `packtory changelog` computes the same release plan used by Packtory's release planning API and skips unchanged packages.
65
72
  - Without `changelog.outputs`, it prints one grouped Markdown changelog for packages that would publish a changed artifact.
66
- - `changelog.outputs` can write a grouped repository file with `{ kind: 'repository-file', path }`, write package-specific files below each changed package's effective `sourcesFolder` with `{ kind: 'package-file', path }`, and print grouped release-body Markdown with `{ kind: 'github-release' }`.
73
+ - `changelog.outputs` can write a grouped repository file with `{ kind: 'repository-file', path }`, write package-specific files below each changed package's effective `sourcesFolder` with `{ kind: 'package-file', path }`, write package-specific files to explicit repository-relative paths with `{ kind: 'package-file', paths }`, and print grouped release-body Markdown with `{ kind: 'github-release' }`.
74
+ - `changelog.labels` extends or overrides the default pull request label mapping. `changelog.targetScopedLabelPattern` customizes package-specific labels and must contain `{targetName}` and `{label}`.
75
+ - `changelog.packageTagFormat` customizes package tag lookup for changelog base refs. `changelog.explicitBaseRef` uses one fixed base ref instead.
67
76
  - Pull requests are attributed by comparing GitHub changed files against each package's attributed source files. Changelog files named `CHANGELOG.md` and configured generated changelog output paths are ignored as attribution inputs.
77
+ - JavaScript files are attributed through referenced source maps when they have a `sourceMappingURL`. Without that reference, the JavaScript file itself is attributed.
68
78
  - The GitHub repository is read from the root `package.json` `repository` field.
69
79
  - GitHub API requests use `GH_TOKEN` when set, otherwise `GITHUB_TOKEN`.
70
80
  - Pager output is shown through `$PAGER` when possible, otherwise `less -R`, otherwise standard output.
@@ -72,6 +82,19 @@ packtory <command> [options]
72
82
  - `packtory changelog` exits with code `0` on a clean run and `1` on config, release-plan, Git, GitHub, or changelog generation failures. Partial release-plan failures still render succeeded changed packages when changelog generation succeeds.
73
83
  - `changelog` never commits, tags, creates releases, creates deployments, writes registry data, or publishes packages.
74
84
 
85
+ **Release behavior:**
86
+
87
+ - `packtory release` prints the computed release plan and exits without writing.
88
+ - Any action flag requires `--no-dry-run`.
89
+ - Invalid combinations fail before writing: `--commit` requires `--write-changelog`; `--write-changelog --publish` requires `--commit`; `--push` requires `--commit` or `--tag`; `--github-release` requires `--tag --push`.
90
+ - `--tag` requires `--publish` in the same run unless the registry latest `gitHead` already matches the current Git head. This allows retrying tag and GitHub Release creation after a publish succeeded.
91
+ - Non-dry-run release writes require a clean Git index and worktree before the first write.
92
+ - The write order is changelog files, commit, final release-plan recomputation, direct npm publish, annotated tags, `git push --follow-tags`, then GitHub Releases.
93
+ - Existing package tags at the current head are accepted. Existing tags at another head fail.
94
+ - Existing GitHub Releases for verified package tags are accepted and their notes are not rewritten.
95
+ - Packtory uses inherited Git configuration, environment, and credentials. In CI, configure commit identity with standard variables such as `GIT_AUTHOR_NAME`, `GIT_AUTHOR_EMAIL`, `GIT_COMMITTER_NAME`, and `GIT_COMMITTER_EMAIL`, and configure push credentials outside Packtory.
96
+ - GitHub Release creation reads `GH_TOKEN` first, then `GITHUB_TOKEN`.
97
+
75
98
  **Pack behavior:**
76
99
 
77
100
  - `packtory pack` runs the same validate → resolve → link → checks pipeline as the other commands, then emits the selected package's bundle to the path given by `--out`. It never reads from or writes to the configured registry.
package/sbom.cdx.json CHANGED
@@ -9,19 +9,32 @@
9
9
  {
10
10
  "type": "application",
11
11
  "name": "packtory",
12
- "version": "0.0.37"
12
+ "version": "0.0.38"
13
13
  }
14
14
  ]
15
15
  },
16
16
  "component": {
17
17
  "type": "library",
18
18
  "name": "@packtory/cli",
19
- "version": "0.0.38",
20
- "bom-ref": "pkg:npm/@packtory/cli@0.0.38",
21
- "purl": "pkg:npm/@packtory/cli@0.0.38"
19
+ "version": "0.0.39",
20
+ "bom-ref": "pkg:npm/@packtory/cli@0.0.39",
21
+ "purl": "pkg:npm/@packtory/cli@0.0.39"
22
22
  }
23
23
  },
24
24
  "components": [
25
+ {
26
+ "type": "library",
27
+ "name": "@octokit/core",
28
+ "version": "7.0.6",
29
+ "bom-ref": "pkg:npm/@octokit/core@7.0.6",
30
+ "scope": "required",
31
+ "licenses": [
32
+ {
33
+ "expression": "MIT"
34
+ }
35
+ ],
36
+ "purl": "pkg:npm/@octokit/core@7.0.6"
37
+ },
25
38
  {
26
39
  "type": "library",
27
40
  "name": "@pr-log/core",
@@ -77,15 +90,15 @@
77
90
  {
78
91
  "type": "library",
79
92
  "name": "packtory",
80
- "version": "0.0.38",
81
- "bom-ref": "pkg:npm/packtory@0.0.38",
93
+ "version": "0.0.39",
94
+ "bom-ref": "pkg:npm/packtory@0.0.39",
82
95
  "scope": "required",
83
96
  "licenses": [
84
97
  {
85
98
  "expression": "MIT"
86
99
  }
87
100
  ],
88
- "purl": "pkg:npm/packtory@0.0.38"
101
+ "purl": "pkg:npm/packtory@0.0.39"
89
102
  },
90
103
  {
91
104
  "type": "library",
@@ -129,13 +142,17 @@
129
142
  ],
130
143
  "dependencies": [
131
144
  {
132
- "ref": "pkg:npm/@packtory/cli@0.0.38",
145
+ "ref": "pkg:npm/@octokit/core@7.0.6"
146
+ },
147
+ {
148
+ "ref": "pkg:npm/@packtory/cli@0.0.39",
133
149
  "dependsOn": [
150
+ "pkg:npm/@octokit/core@7.0.6",
134
151
  "pkg:npm/@pr-log/core@0.0.2",
135
152
  "pkg:npm/@schema-hub/zod-error-formatter@0.0.11",
136
153
  "pkg:npm/cmd-ts@0.15.0",
137
154
  "pkg:npm/open@11.0.0",
138
- "pkg:npm/packtory@0.0.38",
155
+ "pkg:npm/packtory@0.0.39",
139
156
  "pkg:npm/remeda@2.39.0",
140
157
  "pkg:npm/ts-pattern@5.9.0",
141
158
  "pkg:npm/yoctocolors@2.1.2"
@@ -154,7 +171,7 @@
154
171
  "ref": "pkg:npm/open@11.0.0"
155
172
  },
156
173
  {
157
- "ref": "pkg:npm/packtory@0.0.38"
174
+ "ref": "pkg:npm/packtory@0.0.39"
158
175
  },
159
176
  {
160
177
  "ref": "pkg:npm/remeda@2.39.0"