@nx/devkit 22.0.0-beta.8 → 22.0.0-beta.9
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/devkit",
|
|
3
|
-
"version": "22.0.0-beta.
|
|
3
|
+
"version": "22.0.0-beta.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more. Learn more about [extending Nx by leveraging the Nx Devkit](https://nx.dev/extending-nx/intro/getting-started) on our docs.",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"jest": "^29.4.1",
|
|
41
|
-
"nx": "22.0.0-beta.
|
|
41
|
+
"nx": "22.0.0-beta.9"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"nx": ">= 21 <= 23 || ^22.0.0-0"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor-to-plugin-migrator.d.ts","sourceRoot":"","sources":["../../../../../../packages/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAKL,KAAK,aAAa,EAGlB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,IAAI,EACV,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"executor-to-plugin-migrator.d.ts","sourceRoot":"","sources":["../../../../../../packages/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAKL,KAA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C,EAAE,MAAM,EACjC,MAAM,CAAC,EAAE,OAAO,YAAY,GAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAc9C;AAED,wBAAsB,iCAAiC,CAAC,CAAC,EACvD,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,EAC7B,oBAAoB,EAAE,CAAC,EACvB,UAAU,EAAE,KAAK,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,wBAAwB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7D,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,CAAC,EACF,wBAAwB,CAAC,EAAE,MAAM,GAChC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAa9C"}
|
|
@@ -213,6 +213,7 @@ async function migrateProjectExecutorsToPluginV1(tree, projectGraph, pluginPath,
|
|
|
213
213
|
}
|
|
214
214
|
async function migrateProjects(tree, projectGraph, pluginPath, createNodes, createNodesV2, defaultPluginOptions, migrations, specificProjectToMigrate, logger) {
|
|
215
215
|
const projects = new Map();
|
|
216
|
+
const spinner = devkit_internals_1.globalSpinner.start(`Calculating migration scope...`, pluginPath);
|
|
216
217
|
for (const migration of migrations) {
|
|
217
218
|
for (const executor of migration.executors) {
|
|
218
219
|
const migrator = new ExecutorToPluginMigrator(tree, projectGraph, executor, pluginPath, migration.targetPluginOptionMapper, migration.postTargetTransformer, createNodes, createNodesV2, specificProjectToMigrate, {
|
|
@@ -241,16 +242,20 @@ async function migrateProjects(tree, projectGraph, pluginPath, createNodes, crea
|
|
|
241
242
|
...pluginOptions,
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
|
-
await addPluginRegistrations(tree, projects, pluginPath, createNodes, createNodesV2, defaultPluginOptions, projectGraph);
|
|
245
|
+
await addPluginRegistrations(tree, projects, pluginPath, createNodes, createNodesV2, defaultPluginOptions, projectGraph, spinner);
|
|
246
|
+
spinner.succeed(`Migrated configuration for ${projects.size} project(s).\n`);
|
|
245
247
|
return projects;
|
|
246
248
|
}
|
|
247
|
-
async function addPluginRegistrations(tree, projects, pluginPath, createNodes, createNodesV2, defaultPluginOptions, projectGraph) {
|
|
249
|
+
async function addPluginRegistrations(tree, projects, pluginPath, createNodes, createNodesV2, defaultPluginOptions, projectGraph, spinner) {
|
|
248
250
|
const nxJson = (0, devkit_exports_1.readNxJson)(tree);
|
|
249
251
|
// collect createNodes results for each project before adding the plugins
|
|
250
252
|
const createNodesResults = new Map();
|
|
251
253
|
global.NX_GRAPH_CREATION = true;
|
|
252
254
|
try {
|
|
255
|
+
let index = 0;
|
|
253
256
|
for (const [project, options] of projects.entries()) {
|
|
257
|
+
index++;
|
|
258
|
+
spinner.updateText(`${index}/${projects.size} - Parsing "${project}" configuration...`);
|
|
254
259
|
const projectConfigs = await getCreateNodesResultsForPlugin(tree, { plugin: pluginPath, options }, pluginPath, createNodes, createNodesV2, nxJson);
|
|
255
260
|
createNodesResults.set(project, projectConfigs);
|
|
256
261
|
}
|
|
@@ -270,7 +275,10 @@ async function addPluginRegistrations(tree, projects, pluginPath, createNodes, c
|
|
|
270
275
|
const originalResults = createNodesResults.get(project);
|
|
271
276
|
return !deepEqual(originalResults, result);
|
|
272
277
|
};
|
|
278
|
+
let index = 0;
|
|
273
279
|
for (const [project, options] of projects.entries()) {
|
|
280
|
+
index++;
|
|
281
|
+
spinner.updateText(`${index}/${projects.size} - Applying "${project}" configuration...`);
|
|
274
282
|
const existingPlugin = nxJson.plugins?.find((plugin) => typeof plugin !== 'string' &&
|
|
275
283
|
plugin.plugin === pluginPath &&
|
|
276
284
|
Object.keys(options).every((key) => plugin.options[key] === options[key] ||
|
|
@@ -300,6 +308,7 @@ async function addPluginRegistrations(tree, projects, pluginPath, createNodes, c
|
|
|
300
308
|
}
|
|
301
309
|
}
|
|
302
310
|
}
|
|
311
|
+
spinner.updateText(`Migrations done`);
|
|
303
312
|
(0, devkit_exports_1.updateNxJson)(tree, nxJson);
|
|
304
313
|
}
|
|
305
314
|
async function getCreateNodesResultsForPlugin(tree, pluginConfiguration, pluginPath, createNodes, createNodesV2, nxJson) {
|