@packtory/cli 0.0.37 → 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 +173 -0
  2. package/command-line-interface/runner/changelog-destinations.js.map +1 -0
  3. package/command-line-interface/runner/changelog-handler.js +26 -60
  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 +41 -8
  22. package/command-line-interface/runner/runner.js.map +1 -1
  23. package/package.json +5 -3
  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 +57 -28
  28. package/packtory/packtory-changelog.js.map +1 -1
  29. package/readme.md +30 -4
  30. package/sbom.cdx.json +49 -15
@@ -1,19 +1,29 @@
1
+ import path from 'node:path';
2
+ import { compareValues } from "packtory/common/sort-values.js";
1
3
  const changelogFileName = 'CHANGELOG.md';
2
- const changelogFileSuffix = `/${changelogFileName}`;
3
- function changedPackagesFrom(packages) {
4
+ function selectChangedPackages(packages) {
4
5
  return packages.filter((packagePlan) => {
5
6
  return packagePlan.changed;
6
7
  });
7
8
  }
8
- function changelogPathsFrom(packages) {
9
- return Array.from(new Set(packages.flatMap((packagePlan) => {
10
- return packagePlan.changelogSourceFiles.filter((filePath) => {
11
- return filePath === changelogFileName || filePath.endsWith(changelogFileSuffix);
12
- });
9
+ function sortUniqueValues(values) {
10
+ return Array.from(values).toSorted(compareValues);
11
+ }
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);
13
18
  })));
14
19
  }
15
- async function baseRefFor(prLogEngine, packagePlan) {
16
- if (packagePlan.previousVersion === undefined && packagePlan.previousGitHead === undefined) {
20
+ function mergeIgnoredAttributionPaths(packages, configuredPaths) {
21
+ return sortUniqueValues(new Set([...collectChangelogPaths(packages), ...configuredPaths]));
22
+ }
23
+ async function resolveBaseRefFor(prLogEngine, packagePlan, input) {
24
+ if (input.explicitBaseRef === undefined &&
25
+ packagePlan.previousVersion === undefined &&
26
+ packagePlan.previousGitHead === undefined) {
17
27
  const baseRef = await prLogEngine.resolveLatestSemverChangelogBaseRef();
18
28
  return baseRef.ref;
19
29
  }
@@ -21,13 +31,13 @@ async function baseRefFor(prLogEngine, packagePlan) {
21
31
  packageName: packagePlan.name,
22
32
  previousVersion: packagePlan.previousVersion,
23
33
  previousGitHead: packagePlan.previousGitHead,
24
- packageTagFormat: undefined,
25
- explicitBaseRef: undefined
34
+ packageTagFormat: input.packageTagFormat,
35
+ explicitBaseRef: input.explicitBaseRef
26
36
  });
27
37
  return baseRef.ref;
28
38
  }
29
- async function targetPullRequestsFor(input, packagePlan, ignoredAttributionPaths) {
30
- const baseRef = await baseRefFor(input.prLogEngine, packagePlan);
39
+ async function collectTargetPullRequests(input, packagePlan, ignoredAttributionPaths) {
40
+ const baseRef = await resolveBaseRefFor(input.prLogEngine, packagePlan, input);
31
41
  const pullRequests = await input.prLogEngine.collectMergedPullRequests({
32
42
  githubRepo: input.githubRepo,
33
43
  baseRef
@@ -46,18 +56,19 @@ async function targetPullRequestsFor(input, packagePlan, ignoredAttributionPaths
46
56
  return input.prLogEngine.resolvePullRequestLabels({
47
57
  githubRepo: input.githubRepo,
48
58
  validLabels: input.validLabels,
59
+ ignoredLabels: [],
49
60
  pullRequests: packagePullRequests,
50
61
  targetName: packagePlan.name,
51
- targetScopedLabelPattern: undefined
62
+ targetScopedLabelPattern: input.targetScopedLabelPattern
52
63
  });
53
64
  }
54
- async function changelogTargetFor(input, packagePlan, ignoredAttributionPaths) {
65
+ async function createChangelogTarget(input, packagePlan, ignoredAttributionPaths) {
55
66
  return {
56
67
  packagePlan,
57
- pullRequests: await targetPullRequestsFor(input, packagePlan, ignoredAttributionPaths)
68
+ pullRequests: await collectTargetPullRequests(input, packagePlan, ignoredAttributionPaths)
58
69
  };
59
70
  }
60
- function targetSectionFrom(target) {
71
+ function createTargetSection(target) {
61
72
  return {
62
73
  targetName: target.packagePlan.name,
63
74
  unreleased: false,
@@ -65,18 +76,36 @@ function targetSectionFrom(target) {
65
76
  mergedPullRequests: target.pullRequests
66
77
  };
67
78
  }
68
- export async function generateChangelog(input) {
69
- const packages = changedPackagesFrom(input.packages);
70
- const ignoredAttributionPaths = changelogPathsFrom(packages);
79
+ function createPackageMarkdownByName(input, targets) {
80
+ return new Map(targets.map((target) => {
81
+ const targetSection = createTargetSection(target);
82
+ return [
83
+ target.packagePlan.name,
84
+ input.prLogEngine.renderTargetChangelog({
85
+ packageInfo: input.packageInfo,
86
+ currentDate: input.currentDate,
87
+ validLabels: input.validLabels,
88
+ githubRepo: input.githubRepo,
89
+ ...targetSection
90
+ })
91
+ ];
92
+ }));
93
+ }
94
+ export async function generateChangelogOutputs(input) {
95
+ const packages = selectChangedPackages(input.packages);
96
+ const ignoredAttributionPaths = mergeIgnoredAttributionPaths(packages, input.ignoredAttributionPaths);
71
97
  const targets = await Promise.all(packages.map(async (packagePlan) => {
72
- return changelogTargetFor(input, packagePlan, ignoredAttributionPaths);
98
+ return createChangelogTarget(input, packagePlan, ignoredAttributionPaths);
73
99
  }));
74
- return input.prLogEngine.renderGroupedTargetChangelog({
75
- packageInfo: input.packageInfo,
76
- currentDate: input.currentDate,
77
- validLabels: input.validLabels,
78
- githubRepo: input.githubRepo,
79
- targets: targets.map(targetSectionFrom)
80
- });
100
+ return {
101
+ groupedMarkdown: input.prLogEngine.renderGroupedTargetChangelog({
102
+ packageInfo: input.packageInfo,
103
+ currentDate: input.currentDate,
104
+ validLabels: input.validLabels,
105
+ githubRepo: input.githubRepo,
106
+ targets: targets.map(createTargetSection)
107
+ }),
108
+ packageMarkdownByName: createPackageMarkdownByName(input, targets)
109
+ };
81
110
  }
82
111
  //# sourceMappingURL=packtory-changelog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packtory-changelog.js","sourceRoot":"","sources":["../../../../source/packtory/packtory-changelog.ts"],"names":[],"mappings":"AA0BA,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,kBAAkB,CAAC,QAAuC;IAC/D,OAAO,KAAK,CAAC,IAAI,CACb,IAAI,GAAG,CACH,QAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;QAC7B,OAAO,WAAW,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;YACxD,OAAO,Q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f,CAAC,CAAC,CACL,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,KAA6B;IACxE,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,uBAAuB,GAAG,4BAA4B,CAAC,QAAQ,EAAE,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACtG,MAAM,OAAO,GAAG,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.
@@ -61,13 +68,32 @@ packtory <command> [options]
61
68
 
62
69
  **Changelog behavior:**
63
70
 
64
- - `packtory changelog` computes the same release plan used by Packtory's release planning API, skips unchanged packages, and prints one grouped Markdown changelog for packages that would publish a changed artifact.
65
- - Pull requests are attributed by comparing GitHub changed files against each package's attributed source files. Changelog files named `CHANGELOG.md` are ignored as attribution inputs.
71
+ - `packtory changelog` computes the same release plan used by Packtory's release planning API and skips unchanged packages.
72
+ - Without `changelog.outputs`, it prints one grouped Markdown changelog for packages that would publish a changed artifact.
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.
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.
66
78
  - The GitHub repository is read from the root `package.json` `repository` field.
67
79
  - GitHub API requests use `GH_TOKEN` when set, otherwise `GITHUB_TOKEN`.
68
- - Output is shown through `$PAGER` when possible, otherwise `less -R`, otherwise standard output.
80
+ - Pager output is shown through `$PAGER` when possible, otherwise `less -R`, otherwise standard output.
81
+ - Generated changelog files are not automatically added to package artifacts. Use `additionalFiles` when a package artifact should include a changelog.
69
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.
70
- - `changelog` is read-only: it never writes changelog files, commits, tags, releases, deployments, registry data, or packages.
83
+ - `changelog` never commits, tags, creates releases, creates deployments, writes registry data, or publishes packages.
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`.
71
97
 
72
98
  **Pack behavior:**
73
99
 
package/sbom.cdx.json CHANGED
@@ -9,31 +9,57 @@
9
9
  {
10
10
  "type": "application",
11
11
  "name": "packtory",
12
- "version": "0.0.36"
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.37",
20
- "bom-ref": "pkg:npm/@packtory/cli@0.0.37",
21
- "purl": "pkg:npm/@packtory/cli@0.0.37"
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",
28
- "version": "0.0.1",
29
- "bom-ref": "pkg:npm/@pr-log/core@0.0.1",
41
+ "version": "0.0.2",
42
+ "bom-ref": "pkg:npm/@pr-log/core@0.0.2",
43
+ "scope": "required",
44
+ "licenses": [
45
+ {
46
+ "expression": "MIT"
47
+ }
48
+ ],
49
+ "purl": "pkg:npm/@pr-log/core@0.0.2"
50
+ },
51
+ {
52
+ "type": "library",
53
+ "name": "@schema-hub/zod-error-formatter",
54
+ "version": "0.0.11",
55
+ "bom-ref": "pkg:npm/@schema-hub/zod-error-formatter@0.0.11",
30
56
  "scope": "required",
31
57
  "licenses": [
32
58
  {
33
59
  "expression": "MIT"
34
60
  }
35
61
  ],
36
- "purl": "pkg:npm/@pr-log/core@0.0.1"
62
+ "purl": "pkg:npm/@schema-hub/zod-error-formatter@0.0.11"
37
63
  },
38
64
  {
39
65
  "type": "library",
@@ -64,15 +90,15 @@
64
90
  {
65
91
  "type": "library",
66
92
  "name": "packtory",
67
- "version": "0.0.37",
68
- "bom-ref": "pkg:npm/packtory@0.0.37",
93
+ "version": "0.0.39",
94
+ "bom-ref": "pkg:npm/packtory@0.0.39",
69
95
  "scope": "required",
70
96
  "licenses": [
71
97
  {
72
98
  "expression": "MIT"
73
99
  }
74
100
  ],
75
- "purl": "pkg:npm/packtory@0.0.37"
101
+ "purl": "pkg:npm/packtory@0.0.39"
76
102
  },
77
103
  {
78
104
  "type": "library",
@@ -116,19 +142,27 @@
116
142
  ],
117
143
  "dependencies": [
118
144
  {
119
- "ref": "pkg:npm/@packtory/cli@0.0.37",
145
+ "ref": "pkg:npm/@octokit/core@7.0.6"
146
+ },
147
+ {
148
+ "ref": "pkg:npm/@packtory/cli@0.0.39",
120
149
  "dependsOn": [
121
- "pkg:npm/@pr-log/core@0.0.1",
150
+ "pkg:npm/@octokit/core@7.0.6",
151
+ "pkg:npm/@pr-log/core@0.0.2",
152
+ "pkg:npm/@schema-hub/zod-error-formatter@0.0.11",
122
153
  "pkg:npm/cmd-ts@0.15.0",
123
154
  "pkg:npm/open@11.0.0",
124
- "pkg:npm/packtory@0.0.37",
155
+ "pkg:npm/packtory@0.0.39",
125
156
  "pkg:npm/remeda@2.39.0",
126
157
  "pkg:npm/ts-pattern@5.9.0",
127
158
  "pkg:npm/yoctocolors@2.1.2"
128
159
  ]
129
160
  },
130
161
  {
131
- "ref": "pkg:npm/@pr-log/core@0.0.1"
162
+ "ref": "pkg:npm/@pr-log/core@0.0.2"
163
+ },
164
+ {
165
+ "ref": "pkg:npm/@schema-hub/zod-error-formatter@0.0.11"
132
166
  },
133
167
  {
134
168
  "ref": "pkg:npm/cmd-ts@0.15.0"
@@ -137,7 +171,7 @@
137
171
  "ref": "pkg:npm/open@11.0.0"
138
172
  },
139
173
  {
140
- "ref": "pkg:npm/packtory@0.0.37"
174
+ "ref": "pkg:npm/packtory@0.0.39"
141
175
  },
142
176
  {
143
177
  "ref": "pkg:npm/remeda@2.39.0"