@unisphere/nx 3.6.3 ā 3.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.
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { Tree } from '@nx/devkit';
|
|
18
18
|
import { RenamePackageGeneratorSchema } from './schema';
|
|
19
|
-
export declare function renamePackageGenerator(tree: Tree, options: RenamePackageGeneratorSchema): Promise<
|
|
19
|
+
export declare function renamePackageGenerator(tree: Tree, options: RenamePackageGeneratorSchema): Promise<void>;
|
|
20
20
|
export default renamePackageGenerator;
|
|
21
21
|
//# sourceMappingURL=rename-package.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-package.d.ts","sourceRoot":"","sources":["../../../src/generators/rename-package/rename-package.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"rename-package.d.ts","sourceRoot":"","sources":["../../../src/generators/rename-package/rename-package.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAqaxD,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,iBA2GtC;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -19,8 +19,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.renamePackageGenerator = renamePackageGenerator;
|
|
20
20
|
const devkit_1 = require("@nx/devkit");
|
|
21
21
|
const generators_1 = require("@nx/workspace/generators");
|
|
22
|
-
const child_process_1 = require("child_process");
|
|
23
22
|
const utils_1 = require("../utils");
|
|
23
|
+
/**
|
|
24
|
+
* Reserved package names that cannot be renamed.
|
|
25
|
+
* These packages have special meaning in Unisphere and renaming them would break functionality.
|
|
26
|
+
*/
|
|
27
|
+
const RESERVED_PACKAGE_NAMES = ['types'];
|
|
28
|
+
/**
|
|
29
|
+
* Validates that the package is not a reserved package that cannot be renamed
|
|
30
|
+
*/
|
|
31
|
+
function validateNotReservedPackage(packageName) {
|
|
32
|
+
const normalizedName = (0, devkit_1.names)(packageName).fileName;
|
|
33
|
+
if (RESERVED_PACKAGE_NAMES.includes(normalizedName)) {
|
|
34
|
+
throw new Error(`Cannot rename the "${normalizedName}" package.\n\n` +
|
|
35
|
+
`The "${normalizedName}" package is a reserved Unisphere package with special functionality.\n` +
|
|
36
|
+
'Learn more: https://unisphere.kaltura.com/docs/create/packages/overview#the-types-package');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
24
39
|
/**
|
|
25
40
|
* Validates that the old package exists in .unisphere configuration
|
|
26
41
|
*/
|
|
@@ -311,6 +326,8 @@ async function renamePackageGenerator(tree, options) {
|
|
|
311
326
|
// Normalize package names
|
|
312
327
|
const normalizedOldName = (0, devkit_1.names)(options.oldPackageName).fileName;
|
|
313
328
|
const normalizedNewName = (0, devkit_1.names)(options.newPackageName).fileName;
|
|
329
|
+
// Validate the package is not reserved
|
|
330
|
+
validateNotReservedPackage(normalizedOldName);
|
|
314
331
|
// Validate old package exists
|
|
315
332
|
const packageInfo = validateOldPackageExists(tree, normalizedOldName);
|
|
316
333
|
// Validate new package doesn't exist (checks in same subdirectory)
|
|
@@ -378,16 +395,5 @@ async function renamePackageGenerator(tree, options) {
|
|
|
378
395
|
devkit_1.logger.info(' 4. Run: npm run build (to verify everything builds)');
|
|
379
396
|
devkit_1.logger.info(' 5. Commit the changes: git commit -m "Rename package..."');
|
|
380
397
|
devkit_1.logger.info('');
|
|
381
|
-
return () => {
|
|
382
|
-
// This function runs after all changes are applied
|
|
383
|
-
try {
|
|
384
|
-
// Auto-stage changes to help Git detect renames
|
|
385
|
-
(0, child_process_1.execSync)('git add -A', { stdio: 'ignore' });
|
|
386
|
-
devkit_1.logger.info('ā
Automatically staged changes to help Git detect renames');
|
|
387
|
-
}
|
|
388
|
-
catch (e) {
|
|
389
|
-
// Ignore errors if git is not available or not a git repo
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
398
|
}
|
|
393
399
|
exports.default = renamePackageGenerator;
|
package/migrations.json
CHANGED
|
@@ -491,6 +491,48 @@
|
|
|
491
491
|
"alwaysAddToPackageJson": false
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
+
},
|
|
495
|
+
"3.6.4": {
|
|
496
|
+
"version": "3.6.4",
|
|
497
|
+
"cli": "nx",
|
|
498
|
+
"postUpdateMessage": "š Migration to @unisphere/nx 3.6.4 completed successfully!",
|
|
499
|
+
"packages": {
|
|
500
|
+
"@unisphere/core": {
|
|
501
|
+
"version": "^1.91.0",
|
|
502
|
+
"alwaysAddToPackageJson": false
|
|
503
|
+
},
|
|
504
|
+
"@unisphere/notifications-core": {
|
|
505
|
+
"version": "^1.25.0",
|
|
506
|
+
"alwaysAddToPackageJson": false
|
|
507
|
+
},
|
|
508
|
+
"@unisphere/notifications-runtime-react": {
|
|
509
|
+
"version": "^1.24.0",
|
|
510
|
+
"alwaysAddToPackageJson": false
|
|
511
|
+
},
|
|
512
|
+
"@unisphere/runtime": {
|
|
513
|
+
"version": "^1.90.0",
|
|
514
|
+
"alwaysAddToPackageJson": false
|
|
515
|
+
},
|
|
516
|
+
"@unisphere/runtime-js": {
|
|
517
|
+
"version": "^1.90.0",
|
|
518
|
+
"alwaysAddToPackageJson": false
|
|
519
|
+
},
|
|
520
|
+
"@unisphere/runtime-react": {
|
|
521
|
+
"version": "^1.83.3",
|
|
522
|
+
"alwaysAddToPackageJson": false
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
"3.7.0": {
|
|
527
|
+
"version": "3.7.0",
|
|
528
|
+
"cli": "nx",
|
|
529
|
+
"postUpdateMessage": "š Migration to @unisphere/nx 3.7.0 completed successfully!\n\nā ļø Breaking change: The types package can no longer have React dependencies.\nLearn more: https://unisphere.kaltura.com/docs/create/packages/overview#the-types-package",
|
|
530
|
+
"packages": {
|
|
531
|
+
"@unisphere/cli": {
|
|
532
|
+
"version": "3.0.0",
|
|
533
|
+
"alwaysAddToPackageJson": false
|
|
534
|
+
}
|
|
535
|
+
}
|
|
494
536
|
}
|
|
495
537
|
}
|
|
496
538
|
}
|