@pnpm/releasing.commands 1100.2.10 → 1100.2.11

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 (2) hide show
  1. package/lib/publish/pack.js +21 -10
  2. package/package.json +20 -20
@@ -171,6 +171,21 @@ export async function api(opts) {
171
171
  if (!manifest.version) {
172
172
  throw new PnpmError('PACKAGE_VERSION_NOT_FOUND', `Package version is not defined in the ${manifestFileName}.`);
173
173
  }
174
+ const publishManifest = await createPublishManifest({
175
+ projectDir: dir,
176
+ modulesDir: path.join(opts.dir, 'node_modules'),
177
+ manifest,
178
+ embedReadme: opts.embedReadme,
179
+ catalogs: opts.catalogs ?? {},
180
+ hooks: opts.hooks,
181
+ });
182
+ // Strip semver build metadata (the `+<build>` segment) from the published version so that
183
+ // the tarball, the manifest packed inside it, and the metadata sent to the registry all agree.
184
+ // libnpmpublish runs `semver.clean()` on `manifest.version` before computing the provenance
185
+ // subject, which removes build metadata. Leaving it in here would mismatch the version embedded
186
+ // in the tarball's package.json and cause the registry to reject the publish with a 422 when
187
+ // verifying the sigstore provenance bundle. See https://github.com/pnpm/pnpm/issues/11518.
188
+ publishManifest.version = stripBuildMetadata(publishManifest.version);
174
189
  let tarballName;
175
190
  let packDestination;
176
191
  const normalizedName = manifest.name.replace('@', '').replace('/', '-');
@@ -178,23 +193,15 @@ export async function api(opts) {
178
193
  if (opts.packDestination) {
179
194
  throw new PnpmError('INVALID_OPTION', 'Cannot use --pack-destination and --out together');
180
195
  }
181
- const preparedOut = opts.out.replaceAll('%s', normalizedName).replaceAll('%v', manifest.version);
196
+ const preparedOut = opts.out.replaceAll('%s', normalizedName).replaceAll('%v', publishManifest.version);
182
197
  const parsedOut = path.parse(preparedOut);
183
198
  packDestination = parsedOut.dir ? parsedOut.dir : opts.packDestination;
184
199
  tarballName = parsedOut.base;
185
200
  }
186
201
  else {
187
- tarballName = `${normalizedName}-${manifest.version}.tgz`;
202
+ tarballName = `${normalizedName}-${publishManifest.version}.tgz`;
188
203
  packDestination = opts.packDestination;
189
204
  }
190
- const publishManifest = await createPublishManifest({
191
- projectDir: dir,
192
- modulesDir: path.join(opts.dir, 'node_modules'),
193
- manifest,
194
- embedReadme: opts.embedReadme,
195
- catalogs: opts.catalogs ?? {},
196
- hooks: opts.hooks,
197
- });
198
205
  const files = await packlist(dir, {
199
206
  manifest: publishManifest,
200
207
  });
@@ -257,6 +264,10 @@ export async function api(opts) {
257
264
  unpackedSize,
258
265
  };
259
266
  }
267
+ function stripBuildMetadata(version) {
268
+ const plusIndex = version.indexOf('+');
269
+ return plusIndex === -1 ? version : version.slice(0, plusIndex);
270
+ }
260
271
  function preventBundledDependenciesWithoutHoistedNodeLinker(nodeLinker, manifest) {
261
272
  if (nodeLinker === 'hoisted')
262
273
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/releasing.commands",
3
- "version": "1100.2.10",
3
+ "version": "1100.2.11",
4
4
  "description": "Commands for deploy, pack, and publish",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -47,35 +47,35 @@
47
47
  "validate-npm-package-name": "7.0.2",
48
48
  "write-json-file": "^7.0.0",
49
49
  "write-yaml-file": "^6.0.0",
50
- "@pnpm/bins.resolver": "1100.0.2",
51
50
  "@pnpm/catalogs.types": "1100.0.0",
52
- "@pnpm/cli.common-cli-options-help": "1100.0.1",
53
- "@pnpm/cli.utils": "1101.0.2",
54
- "@pnpm/config.reader": "1101.2.1",
55
51
  "@pnpm/config.pick-registry-for-package": "1100.0.2",
56
- "@pnpm/constants": "1100.0.0",
52
+ "@pnpm/cli.utils": "1101.0.2",
53
+ "@pnpm/config.reader": "1101.2.2",
57
54
  "@pnpm/deps.path": "1100.0.2",
58
- "@pnpm/engine.runtime.commands": "1100.0.11",
59
- "@pnpm/engine.runtime.node-resolver": "1101.0.5",
55
+ "@pnpm/constants": "1100.0.0",
56
+ "@pnpm/engine.runtime.commands": "1100.0.12",
57
+ "@pnpm/engine.runtime.node-resolver": "1101.0.6",
58
+ "@pnpm/exec.lifecycle": "1100.0.7",
60
59
  "@pnpm/error": "1100.0.0",
61
- "@pnpm/exec.lifecycle": "1100.0.6",
60
+ "@pnpm/fetching.directory-fetcher": "1100.0.7",
62
61
  "@pnpm/exec.pnpm-cli-runner": "1100.0.0",
63
- "@pnpm/fetching.directory-fetcher": "1100.0.6",
64
62
  "@pnpm/fs.indexed-pkg-importer": "1100.0.5",
63
+ "@pnpm/fs.packlist": "1100.0.1",
65
64
  "@pnpm/fs.is-empty-dir-or-nothing": "1100.0.0",
66
- "@pnpm/fs.packlist": "1100.0.0",
67
- "@pnpm/installing.client": "1100.0.11",
68
- "@pnpm/installing.commands": "1100.1.11",
65
+ "@pnpm/installing.client": "1100.0.12",
66
+ "@pnpm/installing.commands": "1100.1.12",
69
67
  "@pnpm/lockfile.fs": "1100.0.6",
70
68
  "@pnpm/lockfile.types": "1100.0.4",
71
69
  "@pnpm/network.fetch": "1100.0.2",
72
70
  "@pnpm/network.git-utils": "1100.0.1",
73
- "@pnpm/network.web-auth": "1101.0.0",
74
71
  "@pnpm/releasing.exportable-manifest": "1100.0.3",
72
+ "@pnpm/network.web-auth": "1101.0.0",
75
73
  "@pnpm/resolving.resolver-base": "1100.1.2",
74
+ "@pnpm/workspace.projects-filter": "1100.0.9",
75
+ "@pnpm/workspace.projects-sorter": "1100.0.1",
76
76
  "@pnpm/types": "1101.0.0",
77
- "@pnpm/workspace.projects-filter": "1100.0.8",
78
- "@pnpm/workspace.projects-sorter": "1100.0.1"
77
+ "@pnpm/cli.common-cli-options-help": "1100.0.1",
78
+ "@pnpm/bins.resolver": "1100.0.2"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "@pnpm/logger": "^1001.0.1"
@@ -99,12 +99,12 @@
99
99
  "tar": "^7.5.13",
100
100
  "undici": "^7.25.0",
101
101
  "write-yaml-file": "^6.0.0",
102
- "@pnpm/assert-project": "1100.0.5",
103
- "@pnpm/catalogs.config": "1100.0.0",
102
+ "@pnpm/assert-project": "1100.0.6",
104
103
  "@pnpm/hooks.pnpmfile": "1100.0.6",
104
+ "@pnpm/catalogs.config": "1100.0.0",
105
105
  "@pnpm/logger": "1100.0.0",
106
- "@pnpm/prepare": "1100.0.5",
107
- "@pnpm/releasing.commands": "1100.2.10",
106
+ "@pnpm/releasing.commands": "1100.2.11",
107
+ "@pnpm/prepare": "1100.0.6",
108
108
  "@pnpm/test-fixtures": "1100.0.0",
109
109
  "@pnpm/test-ipc-server": "1100.0.0",
110
110
  "@pnpm/testing.command-defaults": "1100.0.1"