@pnpm/releasing.commands 1100.5.5 → 1100.6.1
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.
- package/CHANGELOG.md +73 -0
- package/lib/index.js +2 -0
- package/package.json +34 -29
- package/lib/deploy/createDeployFiles.d.ts +0 -23
- package/lib/deploy/createDeployFiles.js +0 -218
- package/lib/deploy/deploy.d.ts +0 -12
- package/lib/deploy/deploy.js +0 -393
- package/lib/deploy/deployHook.d.ts +0 -2
- package/lib/deploy/deployHook.js +0 -15
- package/lib/deploy/index.d.ts +0 -2
- package/lib/deploy/index.js +0 -3
- package/lib/index.d.ts +0 -5
- package/lib/pack-app/index.d.ts +0 -2
- package/lib/pack-app/index.js +0 -3
- package/lib/pack-app/packApp.d.ts +0 -22
- package/lib/pack-app/packApp.js +0 -558
- package/lib/publish/FailedToPublishError.d.ts +0 -22
- package/lib/publish/FailedToPublishError.js +0 -40
- package/lib/publish/batchPublish.d.ts +0 -20
- package/lib/publish/batchPublish.js +0 -201
- package/lib/publish/displayError.d.ts +0 -1
- package/lib/publish/displayError.js +0 -23
- package/lib/publish/executeTokenHelper.d.ts +0 -4
- package/lib/publish/executeTokenHelper.js +0 -17
- package/lib/publish/extractManifestFromPacked.d.ts +0 -12
- package/lib/publish/extractManifestFromPacked.js +0 -71
- package/lib/publish/index.d.ts +0 -3
- package/lib/publish/index.js +0 -4
- package/lib/publish/oidc/authToken.d.ts +0 -73
- package/lib/publish/oidc/authToken.js +0 -97
- package/lib/publish/oidc/idToken.d.ts +0 -76
- package/lib/publish/oidc/idToken.js +0 -90
- package/lib/publish/oidc/provenance.d.ts +0 -73
- package/lib/publish/oidc/provenance.js +0 -91
- package/lib/publish/otp.d.ts +0 -38
- package/lib/publish/otp.js +0 -38
- package/lib/publish/otpEnv.d.ts +0 -7
- package/lib/publish/otpEnv.js +0 -5
- package/lib/publish/pack.d.ts +0 -34
- package/lib/publish/pack.js +0 -354
- package/lib/publish/publish.d.ts +0 -40
- package/lib/publish/publish.js +0 -256
- package/lib/publish/publishPackedPkg.d.ts +0 -79
- package/lib/publish/publishPackedPkg.js +0 -298
- package/lib/publish/recursivePublish.d.ts +0 -18
- package/lib/publish/recursivePublish.js +0 -132
- package/lib/publish/registryConfigKeys.d.ts +0 -30
- package/lib/publish/registryConfigKeys.js +0 -50
- package/lib/publish/utils/shared-context.d.ts +0 -7
- package/lib/publish/utils/shared-context.js +0 -20
- package/lib/stage/approve.d.ts +0 -2
- package/lib/stage/approve.js +0 -14
- package/lib/stage/context.d.ts +0 -14
- package/lib/stage/context.js +0 -25
- package/lib/stage/download.d.ts +0 -2
- package/lib/stage/download.js +0 -32
- package/lib/stage/errors.d.ts +0 -15
- package/lib/stage/errors.js +0 -17
- package/lib/stage/help.d.ts +0 -1
- package/lib/stage/help.js +0 -84
- package/lib/stage/index.d.ts +0 -13
- package/lib/stage/index.js +0 -57
- package/lib/stage/list.d.ts +0 -2
- package/lib/stage/list.js +0 -49
- package/lib/stage/parsing.d.ts +0 -6
- package/lib/stage/parsing.js +0 -27
- package/lib/stage/publish.d.ts +0 -7
- package/lib/stage/publish.js +0 -38
- package/lib/stage/reject.d.ts +0 -2
- package/lib/stage/reject.js +0 -16
- package/lib/stage/rendering.d.ts +0 -11
- package/lib/stage/rendering.js +0 -50
- package/lib/stage/request.d.ts +0 -29
- package/lib/stage/request.js +0 -110
- package/lib/stage/types.d.ts +0 -38
- package/lib/stage/types.js +0 -3
- package/lib/stage/view.d.ts +0 -2
- package/lib/stage/view.js +0 -14
- package/lib/tarball/index.d.ts +0 -2
- package/lib/tarball/index.js +0 -3
- package/lib/tarball/publishSummary.d.ts +0 -47
- package/lib/tarball/publishSummary.js +0 -36
- package/lib/tarball/safeTarballFilename.d.ts +0 -8
- package/lib/tarball/safeTarballFilename.js +0 -21
- package/lib/tarball/summarizeTarball.d.ts +0 -12
- package/lib/tarball/summarizeTarball.js +0 -84
- package/lib/version/index.d.ts +0 -31
- package/lib/version/index.js +0 -248
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# @pnpm/releasing.commands
|
|
2
2
|
|
|
3
|
+
## 1100.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed `pnpm pack` applying workspace-root ignore rules when a workspace package has its own `.npmignore` file.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies:
|
|
10
|
+
- @pnpm/cli.utils@1101.0.15
|
|
11
|
+
- @pnpm/config.reader@1101.12.1
|
|
12
|
+
- @pnpm/engine.runtime.commands@1100.1.12
|
|
13
|
+
- @pnpm/engine.runtime.node-resolver@1101.1.14
|
|
14
|
+
- @pnpm/exec.lifecycle@1100.1.4
|
|
15
|
+
- @pnpm/fetching.directory-fetcher@1100.0.21
|
|
16
|
+
- @pnpm/fs.indexed-pkg-importer@1100.0.19
|
|
17
|
+
- @pnpm/fs.packlist@1100.0.3
|
|
18
|
+
- @pnpm/installing.client@1100.2.15
|
|
19
|
+
- @pnpm/installing.commands@1100.10.6
|
|
20
|
+
- @pnpm/network.fetch@1100.1.6
|
|
21
|
+
- @pnpm/releasing.exportable-manifest@1100.1.11
|
|
22
|
+
- @pnpm/releasing.versioning@1100.1.1
|
|
23
|
+
- @pnpm/resolving.npm-resolver@1102.1.4
|
|
24
|
+
- @pnpm/workspace.projects-filter@1100.0.28
|
|
25
|
+
|
|
26
|
+
## 1100.6.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- Added native workspace release management [#12952](https://github.com/pnpm/pnpm/issues/12952): the new `pnpm change` command records change intents as changesets-compatible `.changeset/*.md` files (`pnpm change status` shows the pending release plan), and the bare `pnpm version -r` consumes them — bumping versions across the workspace with dependent propagation through `workspace:` ranges, fixed groups, a `maxBump` cap, `--filter` narrowing, and `--dry-run` — writing changelogs, and recording consumed intents in a committed ledger that keeps cherry-picks and merge-backs between release branches safe. Packages can be moved onto per-package release lanes with the new `pnpm lane <name> --filter <pkg>` command and back with `pnpm lane main --filter <pkg>` (`pnpm lane` shows the membership), releasing `X.Y.Z-lane.N` prereleases from the same runs that release stable versions of the packages on the main lane. Configuration lives under the new `versioning` key of `pnpm-workspace.yaml` (`fixed`, `ignore`, `maxBump`, `lanes`, `changelog`). When two workspace projects publish the same name, intent files, `versioning.lanes`, and `versioning.fixed`/`ignore` may reference a project by its workspace-relative directory path (e.g. `"./pnpm/npm/pnpm"`) — the one additive extension to the changesets format, applied automatically by `pnpm change`.
|
|
31
|
+
|
|
32
|
+
Release changelogs default to `registry` storage (`versioning.changelog.storage`): no `CHANGELOG.md` is committed. Each release's section is composed at publish time and packed into the published tarball on top of the previously published version's changelog, and the consumed change intents are garbage-collected by a later `pnpm version -r` only once the registry confirms the version is published with its section. Set `versioning.changelog.storage: repository` to keep committed `CHANGELOG.md` files instead.
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- `pnpm deploy` now supports workspaces that use catalogs.
|
|
37
|
+
|
|
38
|
+
- Fixed `pnpm deploy` with a shared lockfile so local `file:` tarball dependencies keep their package name in the generated deploy lockfile. This prevents warm-store deploys from failing with `ERR_PNPM_UNEXPECTED_PKG_CONTENT_IN_STORE` when the tarball filename includes the version.
|
|
39
|
+
|
|
40
|
+
- Fixed `pnpm publish --otp` and `pnpm publish --batch --otp` to send the configured OTP to the registry.
|
|
41
|
+
|
|
42
|
+
- `pnpm publish` again sends the package's README to the registry as metadata, so registries can render it on the package page. The readme is always included in the published metadata (matching the npm CLI), while the `embed-readme` setting continues to control only whether the readme is written into the `package.json` inside the tarball. This restores the behavior that was lost when publishing became fully native. Closes pnpm/pnpm#12966.
|
|
43
|
+
|
|
44
|
+
- Limit modern deploy lockfiles and localized virtual stores to dependencies reachable from the selected dependency groups.
|
|
45
|
+
|
|
46
|
+
- `pnpm pack` now respects workspace-root `.npmignore` and `.gitignore` files when packing workspace packages.
|
|
47
|
+
|
|
48
|
+
- Updated dependencies:
|
|
49
|
+
- @pnpm/bins.resolver@1100.0.9
|
|
50
|
+
- @pnpm/cli.utils@1101.0.14
|
|
51
|
+
- @pnpm/config.pick-registry-for-package@1100.0.10
|
|
52
|
+
- @pnpm/config.reader@1101.12.0
|
|
53
|
+
- @pnpm/deps.path@1100.0.9
|
|
54
|
+
- @pnpm/engine.runtime.commands@1100.1.11
|
|
55
|
+
- @pnpm/engine.runtime.node-resolver@1101.1.13
|
|
56
|
+
- @pnpm/exec.lifecycle@1100.1.3
|
|
57
|
+
- @pnpm/fetching.directory-fetcher@1100.0.20
|
|
58
|
+
- @pnpm/fs.indexed-pkg-importer@1100.0.18
|
|
59
|
+
- @pnpm/fs.packlist@1100.0.2
|
|
60
|
+
- @pnpm/installing.client@1100.2.14
|
|
61
|
+
- @pnpm/installing.commands@1100.10.5
|
|
62
|
+
- @pnpm/lockfile.fs@1100.1.11
|
|
63
|
+
- @pnpm/lockfile.types@1100.0.14
|
|
64
|
+
- @pnpm/network.auth-header@1101.1.4
|
|
65
|
+
- @pnpm/network.fetch@1100.1.5
|
|
66
|
+
- @pnpm/releasing.exportable-manifest@1100.1.10
|
|
67
|
+
- @pnpm/releasing.versioning@1100.1.0
|
|
68
|
+
- @pnpm/resolving.npm-resolver@1102.1.3
|
|
69
|
+
- @pnpm/resolving.registry.types@1100.1.4
|
|
70
|
+
- @pnpm/resolving.resolver-base@1100.5.2
|
|
71
|
+
- @pnpm/types@1101.4.0
|
|
72
|
+
- @pnpm/workspace.projects-filter@1100.0.27
|
|
73
|
+
- @pnpm/workspace.projects-sorter@1100.0.9
|
|
74
|
+
- @pnpm/workspace.workspace-manifest-writer@1100.0.16
|
|
75
|
+
|
|
3
76
|
## 1100.5.5
|
|
4
77
|
|
|
5
78
|
### Patch Changes
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export { change } from './change/index.js';
|
|
1
2
|
export { deploy } from './deploy/index.js';
|
|
3
|
+
export { lane } from './lane/index.js';
|
|
2
4
|
export { packApp } from './pack-app/index.js';
|
|
3
5
|
export { pack, publish } from './publish/index.js';
|
|
4
6
|
export * as stage from './stage/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/releasing.commands",
|
|
3
|
-
"version": "1100.
|
|
3
|
+
"version": "1100.6.1",
|
|
4
4
|
"description": "Commands for deploy, pack, and publish",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -28,36 +28,42 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@inquirer/prompts": "^8.4.3",
|
|
31
|
-
"@pnpm/bins.resolver": "1100.0.
|
|
31
|
+
"@pnpm/bins.resolver": "1100.0.9",
|
|
32
32
|
"@pnpm/catalogs.types": "1100.0.0",
|
|
33
33
|
"@pnpm/cli.common-cli-options-help": "1100.0.2",
|
|
34
|
-
"@pnpm/cli.utils": "1101.0.
|
|
35
|
-
"@pnpm/config.pick-registry-for-package": "1100.0.
|
|
36
|
-
"@pnpm/config.reader": "1101.
|
|
34
|
+
"@pnpm/cli.utils": "1101.0.15",
|
|
35
|
+
"@pnpm/config.pick-registry-for-package": "1100.0.10",
|
|
36
|
+
"@pnpm/config.reader": "1101.12.1",
|
|
37
37
|
"@pnpm/constants": "1100.0.0",
|
|
38
|
-
"@pnpm/deps.path": "1100.0.
|
|
39
|
-
"@pnpm/engine.runtime.commands": "1100.1.
|
|
40
|
-
"@pnpm/engine.runtime.node-resolver": "1101.1.
|
|
38
|
+
"@pnpm/deps.path": "1100.0.9",
|
|
39
|
+
"@pnpm/engine.runtime.commands": "1100.1.12",
|
|
40
|
+
"@pnpm/engine.runtime.node-resolver": "1101.1.14",
|
|
41
41
|
"@pnpm/error": "1100.0.1",
|
|
42
|
-
"@pnpm/exec.lifecycle": "1100.1.
|
|
42
|
+
"@pnpm/exec.lifecycle": "1100.1.4",
|
|
43
43
|
"@pnpm/exec.pnpm-cli-runner": "1100.0.1",
|
|
44
|
-
"@pnpm/fetching.directory-fetcher": "1100.0.
|
|
45
|
-
"@pnpm/
|
|
44
|
+
"@pnpm/fetching.directory-fetcher": "1100.0.21",
|
|
45
|
+
"@pnpm/fetching.types": "1100.0.2",
|
|
46
|
+
"@pnpm/fs.indexed-pkg-importer": "1100.0.19",
|
|
46
47
|
"@pnpm/fs.is-empty-dir-or-nothing": "1100.0.0",
|
|
47
|
-
"@pnpm/fs.packlist": "1100.0.
|
|
48
|
-
"@pnpm/installing.client": "1100.2.
|
|
49
|
-
"@pnpm/installing.commands": "1100.10.
|
|
50
|
-
"@pnpm/lockfile.fs": "1100.1.
|
|
51
|
-
"@pnpm/lockfile.types": "1100.0.
|
|
52
|
-
"@pnpm/network.auth-header": "1101.1.
|
|
53
|
-
"@pnpm/network.fetch": "1100.1.
|
|
48
|
+
"@pnpm/fs.packlist": "1100.0.3",
|
|
49
|
+
"@pnpm/installing.client": "1100.2.15",
|
|
50
|
+
"@pnpm/installing.commands": "1100.10.6",
|
|
51
|
+
"@pnpm/lockfile.fs": "1100.1.11",
|
|
52
|
+
"@pnpm/lockfile.types": "1100.0.14",
|
|
53
|
+
"@pnpm/network.auth-header": "1101.1.4",
|
|
54
|
+
"@pnpm/network.fetch": "1100.1.6",
|
|
54
55
|
"@pnpm/network.git-utils": "1100.0.2",
|
|
55
56
|
"@pnpm/network.web-auth": "1101.2.0",
|
|
56
57
|
"@pnpm/npm-package-arg": "^2.0.0",
|
|
57
|
-
"@pnpm/releasing.exportable-manifest": "1100.1.
|
|
58
|
-
"@pnpm/
|
|
59
|
-
"@pnpm/
|
|
60
|
-
"@pnpm/
|
|
58
|
+
"@pnpm/releasing.exportable-manifest": "1100.1.11",
|
|
59
|
+
"@pnpm/releasing.versioning": "1100.1.1",
|
|
60
|
+
"@pnpm/resolving.npm-resolver": "1102.1.4",
|
|
61
|
+
"@pnpm/resolving.registry.types": "1100.1.4",
|
|
62
|
+
"@pnpm/resolving.resolver-base": "1100.5.2",
|
|
63
|
+
"@pnpm/types": "1101.4.0",
|
|
64
|
+
"@pnpm/workspace.projects-filter": "1100.0.28",
|
|
65
|
+
"@pnpm/workspace.projects-sorter": "1100.0.9",
|
|
66
|
+
"@pnpm/workspace.workspace-manifest-writer": "1100.0.16",
|
|
61
67
|
"@types/normalize-path": "^3.0.2",
|
|
62
68
|
"@zkochan/rimraf": "^4.0.0",
|
|
63
69
|
"chalk": "^5.6.2",
|
|
@@ -87,17 +93,16 @@
|
|
|
87
93
|
},
|
|
88
94
|
"devDependencies": {
|
|
89
95
|
"@jest/globals": "30.4.1",
|
|
90
|
-
"@pnpm/assert-project": "1100.0.
|
|
96
|
+
"@pnpm/assert-project": "1100.0.20",
|
|
91
97
|
"@pnpm/catalogs.config": "1100.0.2",
|
|
92
|
-
"@pnpm/hooks.pnpmfile": "1100.0.
|
|
98
|
+
"@pnpm/hooks.pnpmfile": "1100.0.20",
|
|
93
99
|
"@pnpm/logger": "1100.0.0",
|
|
94
|
-
"@pnpm/prepare": "1100.0.
|
|
95
|
-
"@pnpm/releasing.commands": "1100.
|
|
100
|
+
"@pnpm/prepare": "1100.0.20",
|
|
101
|
+
"@pnpm/releasing.commands": "1100.6.1",
|
|
96
102
|
"@pnpm/test-fixtures": "1100.0.0",
|
|
97
103
|
"@pnpm/test-ipc-server": "1100.0.0",
|
|
98
|
-
"@pnpm/testing.command-defaults": "1100.0.
|
|
99
|
-
"@pnpm/testing.registry-mock": "1100.0.
|
|
100
|
-
"@pnpm/workspace.projects-filter": "1100.0.26",
|
|
104
|
+
"@pnpm/testing.command-defaults": "1100.0.10",
|
|
105
|
+
"@pnpm/testing.registry-mock": "1100.0.10",
|
|
101
106
|
"@types/cross-spawn": "^6.0.6",
|
|
102
107
|
"@types/is-windows": "^1.0.2",
|
|
103
108
|
"@types/libnpmpublish": "^11.2.0",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { LockfileObject } from '@pnpm/lockfile.types';
|
|
2
|
-
import type { PnpmSettings, Project, ProjectId, ProjectManifest } from '@pnpm/types';
|
|
3
|
-
export interface CreateDeployFilesOptions {
|
|
4
|
-
allProjects: Array<Pick<Project, 'manifest' | 'rootDirRealPath'>>;
|
|
5
|
-
deployDir: string;
|
|
6
|
-
lockfile: LockfileObject;
|
|
7
|
-
lockfileDir: string;
|
|
8
|
-
patchedDependencies?: PnpmSettings['patchedDependencies'];
|
|
9
|
-
selectedProjectManifest: ProjectManifest;
|
|
10
|
-
projectId: ProjectId;
|
|
11
|
-
rootProjectManifestDir: string;
|
|
12
|
-
allowBuilds?: Record<string, boolean | string>;
|
|
13
|
-
}
|
|
14
|
-
export interface DeployWorkspaceManifest {
|
|
15
|
-
allowBuilds?: Record<string, boolean | string>;
|
|
16
|
-
patchedDependencies?: Record<string, string>;
|
|
17
|
-
}
|
|
18
|
-
export interface DeployFiles {
|
|
19
|
-
lockfile: LockfileObject;
|
|
20
|
-
manifest: ProjectManifest;
|
|
21
|
-
workspaceManifest?: DeployWorkspaceManifest;
|
|
22
|
-
}
|
|
23
|
-
export declare function createDeployFiles({ allProjects, deployDir, lockfile, lockfileDir, patchedDependencies, selectedProjectManifest, projectId, rootProjectManifestDir, allowBuilds, }: CreateDeployFilesOptions): DeployFiles;
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import url from 'node:url';
|
|
3
|
-
import * as dp from '@pnpm/deps.path';
|
|
4
|
-
import normalizePath from 'normalize-path';
|
|
5
|
-
const DEPENDENCIES_FIELD = ['dependencies', 'devDependencies', 'optionalDependencies'];
|
|
6
|
-
export function createDeployFiles({ allProjects, deployDir, lockfile, lockfileDir, patchedDependencies, selectedProjectManifest, projectId, rootProjectManifestDir, allowBuilds, }) {
|
|
7
|
-
const deployedProjectRealPath = path.resolve(lockfileDir, projectId);
|
|
8
|
-
const inputSnapshot = lockfile.importers[projectId];
|
|
9
|
-
const targetSnapshot = {
|
|
10
|
-
...inputSnapshot,
|
|
11
|
-
specifiers: {},
|
|
12
|
-
dependencies: {},
|
|
13
|
-
devDependencies: {},
|
|
14
|
-
optionalDependencies: {},
|
|
15
|
-
};
|
|
16
|
-
const targetPackageSnapshots = {};
|
|
17
|
-
for (const name in lockfile.packages) {
|
|
18
|
-
const inputDepPath = name;
|
|
19
|
-
const inputSnapshot = lockfile.packages[inputDepPath];
|
|
20
|
-
const resolveResult = resolveLinkOrFile(inputDepPath, {
|
|
21
|
-
lockfileDir,
|
|
22
|
-
projectRootDirRealPath: rootProjectManifestDir,
|
|
23
|
-
});
|
|
24
|
-
const outputDepPath = resolveResult
|
|
25
|
-
? createFileUrlDepPath(resolveResult, allProjects)
|
|
26
|
-
: inputDepPath;
|
|
27
|
-
targetPackageSnapshots[outputDepPath] = convertPackageSnapshot(inputSnapshot, {
|
|
28
|
-
allProjects,
|
|
29
|
-
deployDir,
|
|
30
|
-
deployedProjectRealPath,
|
|
31
|
-
lockfileDir,
|
|
32
|
-
projectRootDirRealPath: rootProjectManifestDir,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
for (const importerPath in lockfile.importers) {
|
|
36
|
-
if (importerPath === projectId)
|
|
37
|
-
continue;
|
|
38
|
-
const projectSnapshot = lockfile.importers[importerPath];
|
|
39
|
-
const projectRootDirRealPath = path.resolve(lockfileDir, importerPath);
|
|
40
|
-
const packageSnapshot = convertProjectSnapshotToPackageSnapshot(projectSnapshot, {
|
|
41
|
-
allProjects,
|
|
42
|
-
deployDir,
|
|
43
|
-
lockfileDir,
|
|
44
|
-
deployedProjectRealPath,
|
|
45
|
-
projectRootDirRealPath,
|
|
46
|
-
});
|
|
47
|
-
const depPath = createFileUrlDepPath({ resolvedPath: projectRootDirRealPath }, allProjects);
|
|
48
|
-
targetPackageSnapshots[depPath] = packageSnapshot;
|
|
49
|
-
}
|
|
50
|
-
for (const field of DEPENDENCIES_FIELD) {
|
|
51
|
-
const targetDependencies = targetSnapshot[field] ?? {};
|
|
52
|
-
const targetSpecifiers = targetSnapshot.specifiers;
|
|
53
|
-
const inputDependencies = inputSnapshot[field] ?? {};
|
|
54
|
-
for (const name in inputDependencies) {
|
|
55
|
-
const version = inputDependencies[name];
|
|
56
|
-
const resolveResult = resolveLinkOrFile(version, {
|
|
57
|
-
lockfileDir,
|
|
58
|
-
projectRootDirRealPath: path.resolve(lockfileDir, projectId),
|
|
59
|
-
});
|
|
60
|
-
if (!resolveResult) {
|
|
61
|
-
targetSpecifiers[name] = targetDependencies[name] = version;
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
targetSpecifiers[name] = targetDependencies[name] =
|
|
65
|
-
resolveResult.resolvedPath === deployedProjectRealPath ? 'link:.' : createFileUrlDepPath(resolveResult, allProjects);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const result = {
|
|
69
|
-
lockfile: {
|
|
70
|
-
...lockfile,
|
|
71
|
-
patchedDependencies: undefined,
|
|
72
|
-
overrides: undefined, // the effects of the overrides should already be part of the package snapshots
|
|
73
|
-
packageExtensionsChecksum: undefined, // the effects of the package extensions should already be part of the package snapshots
|
|
74
|
-
pnpmfileChecksum: undefined, // the effects of the pnpmfile should already be part of the package snapshots
|
|
75
|
-
settings: {
|
|
76
|
-
...lockfile.settings,
|
|
77
|
-
injectWorkspacePackages: undefined, // the effects of injecting workspace packages should already be part of the lockfile
|
|
78
|
-
},
|
|
79
|
-
importers: {
|
|
80
|
-
['.']: targetSnapshot,
|
|
81
|
-
},
|
|
82
|
-
packages: targetPackageSnapshots,
|
|
83
|
-
},
|
|
84
|
-
manifest: {
|
|
85
|
-
...selectedProjectManifest,
|
|
86
|
-
dependencies: targetSnapshot.dependencies,
|
|
87
|
-
devDependencies: targetSnapshot.devDependencies,
|
|
88
|
-
optionalDependencies: targetSnapshot.optionalDependencies,
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
if (lockfile.patchedDependencies && patchedDependencies) {
|
|
92
|
-
result.lockfile.patchedDependencies = { ...lockfile.patchedDependencies };
|
|
93
|
-
const deployManifestPatchedDeps = {};
|
|
94
|
-
for (const name in patchedDependencies) {
|
|
95
|
-
const absolutePath = patchedDependencies[name];
|
|
96
|
-
const relativePath = normalizePath(path.relative(deployDir, absolutePath));
|
|
97
|
-
deployManifestPatchedDeps[name] = relativePath;
|
|
98
|
-
}
|
|
99
|
-
result.workspaceManifest = {
|
|
100
|
-
...result.workspaceManifest,
|
|
101
|
-
patchedDependencies: deployManifestPatchedDeps,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
if (allowBuilds) {
|
|
105
|
-
result.workspaceManifest = {
|
|
106
|
-
...result.workspaceManifest,
|
|
107
|
-
allowBuilds,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return result;
|
|
111
|
-
}
|
|
112
|
-
function convertPackageSnapshot(inputSnapshot, opts) {
|
|
113
|
-
const inputResolution = inputSnapshot.resolution;
|
|
114
|
-
let outputResolution;
|
|
115
|
-
if ('integrity' in inputResolution) {
|
|
116
|
-
outputResolution = inputResolution;
|
|
117
|
-
}
|
|
118
|
-
else if ('tarball' in inputResolution && typeof inputResolution.tarball === 'string') {
|
|
119
|
-
outputResolution = { ...inputResolution };
|
|
120
|
-
if (inputResolution.tarball.startsWith('file:')) {
|
|
121
|
-
const inputPath = inputResolution.tarball.slice('file:'.length);
|
|
122
|
-
const resolvedPath = path.resolve(opts.lockfileDir, inputPath);
|
|
123
|
-
const outputPath = normalizePath(path.relative(opts.deployDir, resolvedPath));
|
|
124
|
-
outputResolution.tarball = `file:${outputPath}`;
|
|
125
|
-
if ('path' in inputResolution && typeof inputResolution.path === 'string') {
|
|
126
|
-
outputResolution.path = outputPath;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
else if (inputResolution.type === 'directory') {
|
|
131
|
-
const dirResolution = inputResolution;
|
|
132
|
-
const resolvedPath = path.resolve(opts.lockfileDir, dirResolution.directory);
|
|
133
|
-
const directory = normalizePath(path.relative(opts.deployDir, resolvedPath));
|
|
134
|
-
outputResolution = { ...dirResolution, directory };
|
|
135
|
-
}
|
|
136
|
-
else if (inputResolution.type === 'git' || inputResolution.type === 'variations') {
|
|
137
|
-
outputResolution = inputResolution;
|
|
138
|
-
}
|
|
139
|
-
else if (inputResolution.type && typeof inputResolution.type === 'string') {
|
|
140
|
-
// Custom resolution type - pass through as-is
|
|
141
|
-
outputResolution = inputResolution;
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
throw new Error(`Unknown resolution type: ${JSON.stringify(inputResolution)}`);
|
|
145
|
-
}
|
|
146
|
-
return {
|
|
147
|
-
...inputSnapshot,
|
|
148
|
-
resolution: outputResolution,
|
|
149
|
-
dependencies: convertResolvedDependencies(inputSnapshot.dependencies, opts),
|
|
150
|
-
optionalDependencies: convertResolvedDependencies(inputSnapshot.optionalDependencies, opts),
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
function convertProjectSnapshotToPackageSnapshot(projectSnapshot, opts) {
|
|
154
|
-
const resolution = {
|
|
155
|
-
type: 'directory',
|
|
156
|
-
directory: normalizePath(path.relative(opts.deployDir, opts.projectRootDirRealPath)),
|
|
157
|
-
};
|
|
158
|
-
const dependencies = convertResolvedDependencies(projectSnapshot.dependencies, opts);
|
|
159
|
-
const optionalDependencies = convertResolvedDependencies(projectSnapshot.optionalDependencies, opts);
|
|
160
|
-
return {
|
|
161
|
-
dependencies,
|
|
162
|
-
optionalDependencies,
|
|
163
|
-
resolution,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
function convertResolvedDependencies(input, opts) {
|
|
167
|
-
if (!input)
|
|
168
|
-
return undefined;
|
|
169
|
-
const output = {};
|
|
170
|
-
for (const key in input) {
|
|
171
|
-
const version = input[key];
|
|
172
|
-
const resolveResult = resolveLinkOrFile(version, opts);
|
|
173
|
-
if (!resolveResult) {
|
|
174
|
-
output[key] = version;
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
if (resolveResult.resolvedPath === opts.deployedProjectRealPath) {
|
|
178
|
-
output[key] = 'link:.'; // the path is relative to the lockfile dir, which means '.' would reference the deploy dir
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
output[key] = createFileUrlDepPath(resolveResult, opts.allProjects);
|
|
182
|
-
}
|
|
183
|
-
return output;
|
|
184
|
-
}
|
|
185
|
-
function resolveLinkOrFile(pkgVer, opts) {
|
|
186
|
-
const { lockfileDir, projectRootDirRealPath } = opts;
|
|
187
|
-
function resolveScheme(scheme, base) {
|
|
188
|
-
if (!pkgVer.startsWith(scheme))
|
|
189
|
-
return undefined;
|
|
190
|
-
const { id, peerDepGraphHash: suffix } = dp.parseDepPath(pkgVer.slice(scheme.length));
|
|
191
|
-
const resolvedPath = path.resolve(base, id);
|
|
192
|
-
return { scheme, resolvedPath, suffix };
|
|
193
|
-
}
|
|
194
|
-
const resolveSchemeResult = resolveScheme('file:', lockfileDir) ?? resolveScheme('link:', projectRootDirRealPath);
|
|
195
|
-
if (resolveSchemeResult)
|
|
196
|
-
return resolveSchemeResult;
|
|
197
|
-
const { nonSemverVersion, patchHash, peerDepGraphHash, version } = dp.parse(pkgVer);
|
|
198
|
-
if (!nonSemverVersion)
|
|
199
|
-
return undefined;
|
|
200
|
-
if (version) {
|
|
201
|
-
throw new Error(`Something goes wrong, version should be undefined but isn't: ${version}`);
|
|
202
|
-
}
|
|
203
|
-
const parseResult = resolveLinkOrFile(nonSemverVersion, opts);
|
|
204
|
-
if (!parseResult)
|
|
205
|
-
return undefined;
|
|
206
|
-
if (parseResult.suffix) {
|
|
207
|
-
throw new Error(`Something goes wrong, suffix should be undefined but isn't: ${parseResult.suffix}`);
|
|
208
|
-
}
|
|
209
|
-
parseResult.suffix = `${patchHash ?? ''}${peerDepGraphHash ?? ''}`;
|
|
210
|
-
return parseResult;
|
|
211
|
-
}
|
|
212
|
-
function createFileUrlDepPath({ resolvedPath, suffix }, allProjects) {
|
|
213
|
-
const depFileUrl = url.pathToFileURL(resolvedPath).toString();
|
|
214
|
-
const project = allProjects.find(project => project.rootDirRealPath === resolvedPath);
|
|
215
|
-
const name = project?.manifest.name ?? path.basename(resolvedPath);
|
|
216
|
-
return `${name}@${depFileUrl}${suffix ?? ''}`;
|
|
217
|
-
}
|
|
218
|
-
//# sourceMappingURL=createDeployFiles.js.map
|
package/lib/deploy/deploy.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Config } from '@pnpm/config.reader';
|
|
2
|
-
import { install } from '@pnpm/installing.commands';
|
|
3
|
-
export declare const shorthands: {
|
|
4
|
-
legacy: string[];
|
|
5
|
-
};
|
|
6
|
-
export declare function rcOptionsTypes(): Record<string, unknown>;
|
|
7
|
-
export declare function cliOptionsTypes(): Record<string, unknown>;
|
|
8
|
-
export declare const commandNames: string[];
|
|
9
|
-
export declare const overridableByScript = true;
|
|
10
|
-
export declare function help(): string;
|
|
11
|
-
export type DeployOptions = Omit<install.InstallCommandOptions, 'useLockfile'> & Pick<Config, 'allowBuilds' | 'forceLegacyDeploy'>;
|
|
12
|
-
export declare function handler(opts: DeployOptions, params: string[]): Promise<void>;
|