@pnpm/plugin-commands-patching 5.0.5 → 5.0.6

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/lib/patch.d.ts CHANGED
@@ -135,7 +135,7 @@ export declare const shorthands: {
135
135
  };
136
136
  export declare const commandNames: string[];
137
137
  export declare function help(): string;
138
- export type PatchCommandOptions = Pick<Config, 'dir' | 'registries' | 'tag' | 'storeDir' | 'rootProjectManifest' | 'lockfileDir' | 'modulesDir' | 'virtualStoreDir'> & CreateStoreControllerOptions & {
138
+ export type PatchCommandOptions = Pick<Config, 'dir' | 'registries' | 'tag' | 'storeDir' | 'rootProjectManifest' | 'lockfileDir' | 'modulesDir' | 'virtualStoreDir' | 'sharedWorkspaceLockfile'> & CreateStoreControllerOptions & {
139
139
  editDir?: string;
140
140
  reporter?: (logObj: LogBase) => void;
141
141
  ignoreExisting?: boolean;
package/lib/patch.js CHANGED
@@ -15,6 +15,7 @@ const tempy_1 = __importDefault(require("tempy"));
15
15
  const error_1 = require("@pnpm/error");
16
16
  const writePackage_1 = require("./writePackage");
17
17
  const getPatchedDependency_1 = require("./getPatchedDependency");
18
+ const read_project_manifest_1 = require("@pnpm/read-project-manifest");
18
19
  function rcOptionsTypes() {
19
20
  return (0, pick_1.default)([], config_1.types);
20
21
  }
@@ -63,13 +64,22 @@ async function handler(opts, params) {
63
64
  virtualStoreDir: opts.virtualStoreDir,
64
65
  });
65
66
  await (0, writePackage_1.writePackage)(patchedDep, editDir, opts);
66
- if (!opts.ignoreExisting && opts.rootProjectManifest?.pnpm?.patchedDependencies) {
67
- tryPatchWithExistingPatchFile({
68
- patchedDep,
69
- patchedDir: editDir,
70
- patchedDependencies: opts.rootProjectManifest.pnpm.patchedDependencies,
71
- lockfileDir,
72
- });
67
+ if (!opts.ignoreExisting) {
68
+ let rootProjectManifest = opts.rootProjectManifest;
69
+ if (!opts.sharedWorkspaceLockfile) {
70
+ const { manifest } = await (0, read_project_manifest_1.tryReadProjectManifest)(lockfileDir);
71
+ if (manifest) {
72
+ rootProjectManifest = manifest;
73
+ }
74
+ }
75
+ if (rootProjectManifest?.pnpm?.patchedDependencies) {
76
+ tryPatchWithExistingPatchFile({
77
+ patchedDep,
78
+ patchedDir: editDir,
79
+ patchedDependencies: rootProjectManifest.pnpm.patchedDependencies,
80
+ lockfileDir,
81
+ });
82
+ }
73
83
  }
74
84
  return `You can now edit the following folder: ${editDir}
75
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/plugin-commands-patching",
3
- "version": "5.0.5",
3
+ "version": "5.0.6",
4
4
  "description": "Commands for creating patches",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -28,10 +28,10 @@
28
28
  "@types/ramda": "0.28.20",
29
29
  "@types/semver": "7.5.3",
30
30
  "write-yaml-file": "^5.0.0",
31
- "@pnpm/filter-workspace-packages": "7.2.1",
32
- "@pnpm/plugin-commands-patching": "5.0.5",
33
- "@pnpm/prepare": "0.0.84",
34
- "@pnpm/test-fixtures": "0.1.14"
31
+ "@pnpm/filter-workspace-packages": "7.2.2",
32
+ "@pnpm/plugin-commands-patching": "5.0.6",
33
+ "@pnpm/prepare": "0.0.85",
34
+ "@pnpm/test-fixtures": "0.1.15"
35
35
  },
36
36
  "dependencies": {
37
37
  "enquirer": "^2.4.1",
@@ -44,22 +44,22 @@
44
44
  "safe-execa": "^0.1.3",
45
45
  "semver": "^7.5.4",
46
46
  "tempy": "^1.0.1",
47
+ "@pnpm/cli-utils": "2.1.2",
48
+ "@pnpm/config": "20.1.2",
47
49
  "@pnpm/constants": "7.1.1",
48
- "@pnpm/config": "20.1.1",
49
- "@pnpm/cli-utils": "2.1.1",
50
- "@pnpm/fs.packlist": "1.0.1",
51
50
  "@pnpm/error": "5.0.2",
51
+ "@pnpm/fs.packlist": "1.0.2",
52
52
  "@pnpm/lockfile-file": "8.1.4",
53
53
  "@pnpm/lockfile-utils": "9.0.0",
54
54
  "@pnpm/modules-yaml": "12.1.4",
55
- "@pnpm/patching.apply-patch": "2.0.5",
56
55
  "@pnpm/parse-wanted-dependency": "5.0.0",
56
+ "@pnpm/patching.apply-patch": "2.0.5",
57
57
  "@pnpm/pick-fetcher": "2.0.1",
58
58
  "@pnpm/pick-registry-for-package": "5.0.4",
59
- "@pnpm/plugin-commands-installation": "14.0.5",
60
- "@pnpm/read-project-manifest": "5.0.8",
59
+ "@pnpm/plugin-commands-installation": "14.0.6",
61
60
  "@pnpm/read-package-json": "8.0.5",
62
- "@pnpm/store-connection-manager": "7.0.13"
61
+ "@pnpm/read-project-manifest": "5.0.8",
62
+ "@pnpm/store-connection-manager": "7.0.14"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@pnpm/logger": "^5.0.0"