pnpm-settings-migrator 0.6.0 → 0.7.0
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/README.md +34 -3
- package/dist/cli.mjs +350 -168
- package/dist/index.d.mts +74 -7
- package/dist/index.mjs +341 -159
- package/package.json +27 -28
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { PnpmSettings } from "@pnpm/types";
|
|
2
|
-
|
|
3
2
|
//#region src/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Compatibility target used by the migrator.
|
|
6
5
|
*/
|
|
7
|
-
type CompatibilityTarget = 'auto' | 'v10' | 'v11';
|
|
6
|
+
type CompatibilityTarget = 'auto' | 'v10' | 'v11' | 'v12';
|
|
8
7
|
/**
|
|
9
8
|
* Merge strategy for combining pnpm settings.
|
|
10
9
|
*/
|
|
@@ -30,6 +29,7 @@ interface Options {
|
|
|
30
29
|
* - `auto`: detect from `packageManager` (fallback to `v10`)
|
|
31
30
|
* - `v10`: keep legacy v10 settings
|
|
32
31
|
* - `v11`: normalize to v11-compatible settings
|
|
32
|
+
* - `v12`: apply the v11 settings migration for pnpm v12
|
|
33
33
|
*
|
|
34
34
|
* @default 'auto'
|
|
35
35
|
*/
|
|
@@ -71,16 +71,24 @@ interface Options {
|
|
|
71
71
|
/**
|
|
72
72
|
* legacy `pnpm-workspace` types
|
|
73
73
|
*/
|
|
74
|
-
|
|
74
|
+
interface PnpmWorkspaceLegacy {
|
|
75
75
|
catalog?: Record<string, string>;
|
|
76
76
|
catalogs?: Record<string, Record<string, string>>;
|
|
77
77
|
packages?: string[];
|
|
78
|
-
}
|
|
78
|
+
}
|
|
79
79
|
/**
|
|
80
80
|
* `package-json` types
|
|
81
81
|
* @pg
|
|
82
82
|
*/
|
|
83
83
|
interface PackageJson {
|
|
84
|
+
/**
|
|
85
|
+
* Development tool declarations.
|
|
86
|
+
*/
|
|
87
|
+
devEngines?: {
|
|
88
|
+
packageManager?: PackageManagerEngine;
|
|
89
|
+
runtime?: RuntimeEngine | RuntimeEngine[];
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
};
|
|
84
92
|
/**
|
|
85
93
|
* same as `pnpm.overrides`
|
|
86
94
|
*
|
|
@@ -94,7 +102,7 @@ interface PackageJson {
|
|
|
94
102
|
/**
|
|
95
103
|
* pnpm settings
|
|
96
104
|
*/
|
|
97
|
-
pnpm?:
|
|
105
|
+
pnpm?: PnpmWorkspace;
|
|
98
106
|
/**
|
|
99
107
|
* same as `pnpm.overrides`
|
|
100
108
|
*
|
|
@@ -107,11 +115,35 @@ interface PackageJson {
|
|
|
107
115
|
* @pg
|
|
108
116
|
*/
|
|
109
117
|
type NpmRC = Record<string, any>;
|
|
118
|
+
/**
|
|
119
|
+
* Package manager declaration stored in
|
|
120
|
+
* `package.json#devEngines.packageManager`.
|
|
121
|
+
*/
|
|
122
|
+
interface PackageManagerEngine {
|
|
123
|
+
name: string;
|
|
124
|
+
onFail?: 'download' | 'error' | 'ignore' | 'warn';
|
|
125
|
+
version: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Runtime declaration stored in `package.json#devEngines.runtime`.
|
|
129
|
+
*/
|
|
130
|
+
interface RuntimeEngine {
|
|
131
|
+
name: string;
|
|
132
|
+
onFail?: 'download' | 'error' | 'ignore' | 'warn';
|
|
133
|
+
version: string;
|
|
134
|
+
}
|
|
110
135
|
/**
|
|
111
136
|
* Deprecated `pnpm` settings in `package.json`
|
|
112
137
|
* @see {@link https://github.com/pnpm/pnpm/blob/main/core/types/CHANGELOG.md#major-changes}
|
|
113
138
|
*/
|
|
114
139
|
interface PnpmSettingsDeprecated {
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated
|
|
142
|
+
*/
|
|
143
|
+
auditConfig?: {
|
|
144
|
+
ignoreCves?: string[];
|
|
145
|
+
ignoreGhsas?: string[];
|
|
146
|
+
};
|
|
115
147
|
/**
|
|
116
148
|
* @deprecated
|
|
117
149
|
*/
|
|
@@ -120,10 +152,18 @@ interface PnpmSettingsDeprecated {
|
|
|
120
152
|
* @deprecated
|
|
121
153
|
*/
|
|
122
154
|
ignoredBuiltDependencies?: string[];
|
|
155
|
+
/**
|
|
156
|
+
* @deprecated
|
|
157
|
+
*/
|
|
158
|
+
ignoreDepScripts?: boolean;
|
|
123
159
|
/**
|
|
124
160
|
* @deprecated
|
|
125
161
|
*/
|
|
126
162
|
ignorePatchFailures?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated
|
|
165
|
+
*/
|
|
166
|
+
managePackageManagerVersions?: boolean;
|
|
127
167
|
/**
|
|
128
168
|
* @deprecated
|
|
129
169
|
*/
|
|
@@ -136,12 +176,38 @@ interface PnpmSettingsDeprecated {
|
|
|
136
176
|
* @deprecated
|
|
137
177
|
*/
|
|
138
178
|
onlyBuiltDependenciesFile?: string;
|
|
179
|
+
/**
|
|
180
|
+
* @deprecated
|
|
181
|
+
*/
|
|
182
|
+
packageManagerStrict?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* @deprecated
|
|
185
|
+
*/
|
|
186
|
+
packageManagerStrictVersion?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* @deprecated
|
|
189
|
+
*/
|
|
190
|
+
useNodeVersion?: string;
|
|
191
|
+
/**
|
|
192
|
+
* @deprecated
|
|
193
|
+
*/
|
|
194
|
+
executionEnv?: {
|
|
195
|
+
nodeVersion?: string;
|
|
196
|
+
[key: string]: unknown;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Settings introduced in pnpm v11.
|
|
201
|
+
*/
|
|
202
|
+
interface PnpmSettingsV11 {
|
|
203
|
+
packageConfigs?: Record<string, Record<string, unknown>>;
|
|
204
|
+
pmOnFail?: 'download' | 'error' | 'ignore' | 'warn';
|
|
139
205
|
}
|
|
140
206
|
/**
|
|
141
207
|
* `pnpm-workspace` types
|
|
142
208
|
* @pg
|
|
143
209
|
*/
|
|
144
|
-
type PnpmWorkspace = PnpmSettings & PnpmSettingsDeprecated & PnpmWorkspaceLegacy;
|
|
210
|
+
type PnpmWorkspace = PnpmSettings & PnpmSettingsDeprecated & PnpmSettingsV11 & PnpmWorkspaceLegacy;
|
|
145
211
|
//#endregion
|
|
146
212
|
//#region src/core.d.ts
|
|
147
213
|
/**
|
|
@@ -152,6 +218,7 @@ type PnpmWorkspace = PnpmSettings & PnpmSettingsDeprecated & PnpmWorkspaceLegacy
|
|
|
152
218
|
* - `package.json` pnpm field
|
|
153
219
|
* - `.npmrc` pnpm-related settings
|
|
154
220
|
* - `package.json` resolutions (optional, converts to pnpm overrides)
|
|
221
|
+
* - deprecated settings already present in `pnpm-workspace.yaml`
|
|
155
222
|
*
|
|
156
223
|
* @param rawOptions - Migration options
|
|
157
224
|
* @param rawOptions.cwd - Current working directory (default: process.cwd())
|
|
@@ -204,4 +271,4 @@ declare function migratePnpmSettings(rawOptions?: Options): Promise<void>;
|
|
|
204
271
|
*/
|
|
205
272
|
declare function resolveOptions(options?: Options): Required<Options>;
|
|
206
273
|
//#endregion
|
|
207
|
-
export { CompatibilityTarget, MergeStrategy, NpmRC, Options, PackageJson, PnpmSettingsDeprecated, PnpmWorkspace, PnpmWorkspaceLegacy, migratePnpmSettings, resolveOptions };
|
|
274
|
+
export { CompatibilityTarget, MergeStrategy, NpmRC, Options, PackageJson, PackageManagerEngine, PnpmSettingsDeprecated, PnpmSettingsV11, PnpmWorkspace, PnpmWorkspaceLegacy, RuntimeEngine, migratePnpmSettings, resolveOptions };
|