@unisphere/nx 3.5.2 → 3.6.2
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/dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.d.ts.map +1 -1
- package/dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.js +13 -25
- package/dist/migrations/3-0-0/upgrade-schema-to-2-0-0.d.ts.map +1 -1
- package/dist/migrations/3-0-0/upgrade-schema-to-2-0-0.js +11 -1
- package/migrations.json +13 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reorganize-applications-by-distribution-channel.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/reorganize-applications-by-distribution-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;EAQE;AAEF,OAAO,EACL,IAAI,
|
|
1
|
+
{"version":3,"file":"reorganize-applications-by-distribution-channel.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/reorganize-applications-by-distribution-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;EAQE;AAEF,OAAO,EACL,IAAI,EAQL,MAAM,YAAY,CAAC;AAyuBpB;;GAEG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAqE9D"}
|
|
@@ -444,43 +444,31 @@ function updateProjectJsonAfterMove(tree, oldPath, newPath) {
|
|
|
444
444
|
(0, devkit_1.writeJson)(tree, projectJsonPath, projectJson);
|
|
445
445
|
}
|
|
446
446
|
/**
|
|
447
|
-
*
|
|
448
|
-
*
|
|
447
|
+
* Ensure project.json has the correct name and will be discovered by Nx.
|
|
448
|
+
* We don't use removeProjectConfiguration/updateProjectConfiguration because they can
|
|
449
|
+
* cause the project.json file to be deleted. Instead, we rely on Nx's auto-discovery
|
|
450
|
+
* of projects from project.json files at their new locations.
|
|
449
451
|
*/
|
|
450
452
|
function updateNxProjectRegistration(tree, oldProjectName, newProjectName, newPath) {
|
|
451
|
-
//
|
|
453
|
+
// Verify project.json exists at new location
|
|
452
454
|
const projectJsonPath = `${newPath}/project.json`;
|
|
453
455
|
if (!tree.exists(projectJsonPath)) {
|
|
454
456
|
devkit_1.logger.warn(` Cannot update Nx registration: project.json not found at ${projectJsonPath}`);
|
|
455
457
|
return;
|
|
456
458
|
}
|
|
459
|
+
// Read and update the project.json to ensure it has the correct name
|
|
457
460
|
const projectJson = (0, devkit_1.readJson)(tree, projectJsonPath);
|
|
458
|
-
//
|
|
459
|
-
|
|
460
|
-
(0, devkit_1.removeProjectConfiguration)(tree, oldProjectName);
|
|
461
|
-
devkit_1.logger.info(` Removed old Nx project registration: ${oldProjectName}`);
|
|
462
|
-
}
|
|
463
|
-
catch (e) {
|
|
464
|
-
// Project may not be registered yet (first run), ignore
|
|
465
|
-
devkit_1.logger.info(` Old Nx project registration not found (ok): ${oldProjectName}`);
|
|
466
|
-
}
|
|
467
|
-
// Build the new project configuration
|
|
468
|
-
const newConfig = {
|
|
469
|
-
...projectJson,
|
|
470
|
-
name: newProjectName,
|
|
471
|
-
root: newPath,
|
|
472
|
-
};
|
|
473
|
-
// Register at new location
|
|
474
|
-
try {
|
|
475
|
-
(0, devkit_1.updateProjectConfiguration)(tree, newProjectName, newConfig);
|
|
476
|
-
devkit_1.logger.info(` Registered Nx project at new location: ${newProjectName}`);
|
|
477
|
-
}
|
|
478
|
-
catch (e) {
|
|
479
|
-
// If updateProjectConfiguration fails (project doesn't exist yet), write project.json directly
|
|
461
|
+
// Update the name if needed
|
|
462
|
+
if (projectJson.name !== newProjectName) {
|
|
480
463
|
projectJson.name = newProjectName;
|
|
481
464
|
(0, devkit_1.writeJson)(tree, projectJsonPath, projectJson);
|
|
482
465
|
devkit_1.logger.info(` Updated project.json name to: ${newProjectName}`);
|
|
483
466
|
}
|
|
467
|
+
else {
|
|
468
|
+
devkit_1.logger.info(` Project.json name already correct: ${newProjectName}`);
|
|
469
|
+
}
|
|
470
|
+
// Nx will auto-discover the project from its project.json file at the new location
|
|
471
|
+
devkit_1.logger.info(` Project will be auto-discovered by Nx at: ${newPath}`);
|
|
484
472
|
}
|
|
485
473
|
/**
|
|
486
474
|
* Update cross-project build target references.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-schema-to-2-0-0.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/upgrade-schema-to-2-0-0.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA+B,MAAM,YAAY,CAAC;AAE/D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAA8B,yBAAyB,CAAC,IAAI,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"upgrade-schema-to-2-0-0.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/upgrade-schema-to-2-0-0.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA+B,MAAM,YAAY,CAAC;AAE/D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAA8B,yBAAyB,CAAC,IAAI,EAAE,IAAI,iBA8FjE"}
|
|
@@ -58,7 +58,7 @@ async function removeDistributionChannel(tree) {
|
|
|
58
58
|
devkit_1.logger.warn(`⚠️ Unknown schemaVersion: ${config.schemaVersion}. Expected 1.0.0 or 2.0.0`);
|
|
59
59
|
devkit_1.logger.info('');
|
|
60
60
|
}
|
|
61
|
-
// Process packages
|
|
61
|
+
// Process packages)
|
|
62
62
|
if (config.elements?.packages) {
|
|
63
63
|
for (const packageName in config.elements.packages) {
|
|
64
64
|
const packageConfig = config.elements.packages[packageName];
|
|
@@ -68,6 +68,16 @@ async function removeDistributionChannel(tree) {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
+
// Process applications
|
|
72
|
+
if (config.elements?.applications) {
|
|
73
|
+
for (const applicationName in config.elements.applications) {
|
|
74
|
+
const applicationConfig = config.elements.applications[applicationName];
|
|
75
|
+
if ('distributionChannel' in applicationConfig) {
|
|
76
|
+
delete applicationConfig.distributionChannel;
|
|
77
|
+
totalRemoved++;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
71
81
|
// Write updated configuration back
|
|
72
82
|
if (totalRemoved > 0 || schemaUpdated) {
|
|
73
83
|
try {
|
package/migrations.json
CHANGED
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
"postUpdateMessage": "✅ .github/workflows/cicd.yml updated successfully"
|
|
300
300
|
}
|
|
301
301
|
},
|
|
302
|
-
|
|
302
|
+
"3-5-0-update-publish-artifacts-workflow": {
|
|
303
303
|
"version": "3.5.0",
|
|
304
304
|
"description": "Updates .github/workflows/publish-artifacts.yml with JFrog OIDC setup and improved cache management",
|
|
305
305
|
"factory": "./dist/migrations/3-5-0/update-publish-artifacts-workflow.js",
|
|
@@ -472,6 +472,17 @@
|
|
|
472
472
|
"alwaysAddToPackageJson": false
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
+
},
|
|
476
|
+
"3.6.0": {
|
|
477
|
+
"version": "3.6.0",
|
|
478
|
+
"cli": "nx",
|
|
479
|
+
"postUpdateMessage": "🎉 Migration to @unisphere/nx 3.6.0 completed successfully!",
|
|
480
|
+
"packages": {
|
|
481
|
+
"@unisphere/cli": {
|
|
482
|
+
"version": "2.6.6",
|
|
483
|
+
"alwaysAddToPackageJson": false
|
|
484
|
+
}
|
|
485
|
+
}
|
|
475
486
|
}
|
|
476
487
|
}
|
|
477
|
-
}
|
|
488
|
+
}
|