@unisphere/nx 4.12.6 → 4.13.1
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/4-13-0/patches/@changesets+cli+2.29.7.patch +94 -0
- package/dist/migrations/4-13-0/update-changeset-patch.d.ts +18 -0
- package/dist/migrations/4-13-0/update-changeset-patch.d.ts.map +1 -0
- package/dist/migrations/4-13-0/update-changeset-patch.js +46 -0
- package/dist/migrations/4-13-1/replace-setup-local-runtimes.d.ts +9 -0
- package/dist/migrations/4-13-1/replace-setup-local-runtimes.d.ts.map +1 -0
- package/dist/migrations/4-13-1/replace-setup-local-runtimes.js +62 -0
- package/migrations.json +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
diff --git a/node_modules/@changesets/cli/dist/changesets-cli.cjs.js b/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
|
|
2
|
+
index 53fc925..ca3c8ad 100644
|
|
3
|
+
--- a/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
|
|
4
|
+
+++ b/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
|
|
5
|
+
@@ -272,9 +272,19 @@ async function getPackagesToRelease(changedPackages, allPackages) {
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
if (allPackages.length > 1) {
|
|
9
|
+
+ // Exclude local packages and local applications entirely — they live under
|
|
10
|
+
+ // packages/local or applications/local (or use the @local/ scope), are
|
|
11
|
+
+ // bundled into the runtimes at build time, and must never be shown for
|
|
12
|
+
+ // selection or get their own version bump.
|
|
13
|
+
+ const pkgDirByName = new Map(allPackages.map(p => [p.packageJson.name, (p.dir || '').replace(/\\/g, '/')]));
|
|
14
|
+
+ const isLocalPackage = pkgName => {
|
|
15
|
+
+ const dir = pkgDirByName.get(pkgName) || '';
|
|
16
|
+
+ return pkgName.startsWith('@local/') || dir.includes('/packages/local/') || dir.includes('/applications/local/');
|
|
17
|
+
+ };
|
|
18
|
+
+ changedPackages = changedPackages.filter(name => !isLocalPackage(name));
|
|
19
|
+
const unchangedPackagesNames = allPackages.map(({
|
|
20
|
+
packageJson
|
|
21
|
+
- }) => packageJson.name).filter(name => !changedPackages.includes(name));
|
|
22
|
+
+ }) => packageJson.name).filter(name => !changedPackages.includes(name) && !isLocalPackage(name));
|
|
23
|
+
const defaultChoiceList = [{
|
|
24
|
+
name: "changed packages",
|
|
25
|
+
choices: changedPackages
|
|
26
|
+
@@ -310,9 +320,10 @@ async function createChangeset(changedPackages, allPackages) {
|
|
27
|
+
const packagesToRelease = await getPackagesToRelease(changedPackages, allPackages);
|
|
28
|
+
let pkgJsonsByName = getPkgJsonsByName(allPackages);
|
|
29
|
+
let pkgsLeftToGetBumpTypeFor = new Set(packagesToRelease);
|
|
30
|
+
- let pkgsThatShouldBeMajorBumped = (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
|
|
31
|
+
+ let nonRuntimePackages = packagesToRelease.filter(pkgName => !pkgName.includes('unisphere-runtime-'));
|
|
32
|
+
+ let pkgsThatShouldBeMajorBumped = nonRuntimePackages.length > 0 ? (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
|
|
33
|
+
name: "all packages",
|
|
34
|
+
- choices: packagesToRelease.map(pkgName => {
|
|
35
|
+
+ choices: nonRuntimePackages.map(pkgName => {
|
|
36
|
+
return {
|
|
37
|
+
name: pkgName,
|
|
38
|
+
message: formatPkgNameAndVersion(pkgName, pkgJsonsByName.get(pkgName).version)
|
|
39
|
+
@@ -325,7 +336,7 @@ async function createChangeset(changedPackages, allPackages) {
|
|
40
|
+
return x.filter(x => x !== "all packages").map(x => cyan(x)).join(", ");
|
|
41
|
+
}
|
|
42
|
+
return x;
|
|
43
|
+
- })).filter(x => x !== "all packages");
|
|
44
|
+
+ })).filter(x => x !== "all packages") : [];
|
|
45
|
+
for (const pkgName of pkgsThatShouldBeMajorBumped) {
|
|
46
|
+
// for packages that are under v1, we want to make sure major releases are intended,
|
|
47
|
+
// as some repo-wide sweeping changes have mistakenly release first majors
|
|
48
|
+
diff --git a/node_modules/@changesets/cli/dist/changesets-cli.esm.js b/node_modules/@changesets/cli/dist/changesets-cli.esm.js
|
|
49
|
+
index 6c363c0..f18a637 100644
|
|
50
|
+
--- a/node_modules/@changesets/cli/dist/changesets-cli.esm.js
|
|
51
|
+
+++ b/node_modules/@changesets/cli/dist/changesets-cli.esm.js
|
|
52
|
+
@@ -234,9 +234,19 @@ async function getPackagesToRelease(changedPackages, allPackages) {
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (allPackages.length > 1) {
|
|
56
|
+
+ // Exclude local packages and local applications entirely — they live under
|
|
57
|
+
+ // packages/local or applications/local (or use the @local/ scope), are
|
|
58
|
+
+ // bundled into the runtimes at build time, and must never be shown for
|
|
59
|
+
+ // selection or get their own version bump.
|
|
60
|
+
+ const pkgDirByName = new Map(allPackages.map(p => [p.packageJson.name, (p.dir || '').replace(/\\/g, '/')]));
|
|
61
|
+
+ const isLocalPackage = pkgName => {
|
|
62
|
+
+ const dir = pkgDirByName.get(pkgName) || '';
|
|
63
|
+
+ return pkgName.startsWith('@local/') || dir.includes('/packages/local/') || dir.includes('/applications/local/');
|
|
64
|
+
+ };
|
|
65
|
+
+ changedPackages = changedPackages.filter(name => !isLocalPackage(name));
|
|
66
|
+
const unchangedPackagesNames = allPackages.map(({
|
|
67
|
+
packageJson
|
|
68
|
+
- }) => packageJson.name).filter(name => !changedPackages.includes(name));
|
|
69
|
+
+ }) => packageJson.name).filter(name => !changedPackages.includes(name) && !isLocalPackage(name));
|
|
70
|
+
const defaultChoiceList = [{
|
|
71
|
+
name: "changed packages",
|
|
72
|
+
choices: changedPackages
|
|
73
|
+
@@ -272,9 +282,10 @@ async function createChangeset(changedPackages, allPackages) {
|
|
74
|
+
const packagesToRelease = await getPackagesToRelease(changedPackages, allPackages);
|
|
75
|
+
let pkgJsonsByName = getPkgJsonsByName(allPackages);
|
|
76
|
+
let pkgsLeftToGetBumpTypeFor = new Set(packagesToRelease);
|
|
77
|
+
- let pkgsThatShouldBeMajorBumped = (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
|
|
78
|
+
+ let nonRuntimePackages = packagesToRelease.filter(pkgName => !pkgName.includes('unisphere-runtime-'));
|
|
79
|
+
+ let pkgsThatShouldBeMajorBumped = nonRuntimePackages.length > 0 ? (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
|
|
80
|
+
name: "all packages",
|
|
81
|
+
- choices: packagesToRelease.map(pkgName => {
|
|
82
|
+
+ choices: nonRuntimePackages.map(pkgName => {
|
|
83
|
+
return {
|
|
84
|
+
name: pkgName,
|
|
85
|
+
message: formatPkgNameAndVersion(pkgName, pkgJsonsByName.get(pkgName).version)
|
|
86
|
+
@@ -287,7 +298,7 @@ async function createChangeset(changedPackages, allPackages) {
|
|
87
|
+
return x.filter(x => x !== "all packages").map(x => cyan(x)).join(", ");
|
|
88
|
+
}
|
|
89
|
+
return x;
|
|
90
|
+
- })).filter(x => x !== "all packages");
|
|
91
|
+
+ })).filter(x => x !== "all packages") : [];
|
|
92
|
+
for (const pkgName of pkgsThatShouldBeMajorBumped) {
|
|
93
|
+
// for packages that are under v1, we want to make sure major releases are intended,
|
|
94
|
+
// as some repo-wide sweeping changes have mistakenly release first majors
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
* Migration: Update @changesets/cli patch to also exclude local packages and
|
|
4
|
+
* local applications from the changeset flow.
|
|
5
|
+
*
|
|
6
|
+
* The previous patch (shipped in 3.0.0) only filtered `unisphere-runtime-*`
|
|
7
|
+
* packages out of the MAJOR bump prompt. This updated patch additionally
|
|
8
|
+
* excludes local packages and local applications (anything under
|
|
9
|
+
* `packages/local` / `applications/local`, or using the `@local/` scope) from
|
|
10
|
+
* `getPackagesToRelease` — so they never appear in the "Which packages would
|
|
11
|
+
* you like to include?" prompt and never get their own version bump. Runtimes
|
|
12
|
+
* keep their existing behavior (dropped from the major prompt only).
|
|
13
|
+
*
|
|
14
|
+
* Replaces any existing @changesets/cli patch in the consuming project's
|
|
15
|
+
* `patches/` directory with the updated one bundled alongside this migration.
|
|
16
|
+
*/
|
|
17
|
+
export default function update(tree: Tree): Promise<void>;
|
|
18
|
+
//# sourceMappingURL=update-changeset-patch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-changeset-patch.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-13-0/update-changeset-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAyB,MAAM,YAAY,CAAC;AAGzD;;;;;;;;;;;;;;GAcG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B9D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
/**
|
|
7
|
+
* Migration: Update @changesets/cli patch to also exclude local packages and
|
|
8
|
+
* local applications from the changeset flow.
|
|
9
|
+
*
|
|
10
|
+
* The previous patch (shipped in 3.0.0) only filtered `unisphere-runtime-*`
|
|
11
|
+
* packages out of the MAJOR bump prompt. This updated patch additionally
|
|
12
|
+
* excludes local packages and local applications (anything under
|
|
13
|
+
* `packages/local` / `applications/local`, or using the `@local/` scope) from
|
|
14
|
+
* `getPackagesToRelease` — so they never appear in the "Which packages would
|
|
15
|
+
* you like to include?" prompt and never get their own version bump. Runtimes
|
|
16
|
+
* keep their existing behavior (dropped from the major prompt only).
|
|
17
|
+
*
|
|
18
|
+
* Replaces any existing @changesets/cli patch in the consuming project's
|
|
19
|
+
* `patches/` directory with the updated one bundled alongside this migration.
|
|
20
|
+
*/
|
|
21
|
+
async function update(tree) {
|
|
22
|
+
devkit_1.logger.info('🔄 Updating @changesets/cli patch');
|
|
23
|
+
try {
|
|
24
|
+
const patchesPath = 'patches';
|
|
25
|
+
const patchesTemplatePath = (0, path_1.join)(__dirname, 'patches');
|
|
26
|
+
const patchFileName = '@changesets+cli+2.29.7.patch';
|
|
27
|
+
// Delete existing changeset patch if it exists
|
|
28
|
+
if (tree.exists(patchesPath)) {
|
|
29
|
+
const existingFiles = tree.children(patchesPath);
|
|
30
|
+
for (const file of existingFiles) {
|
|
31
|
+
if (file.includes('@changesets+cli')) {
|
|
32
|
+
devkit_1.logger.info(`🗑️ Removing existing patch: ${file}`);
|
|
33
|
+
tree.delete((0, path_1.join)(patchesPath, file));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// Copy the updated patch file
|
|
38
|
+
(0, devkit_1.generateFiles)(tree, patchesTemplatePath, `./${patchesPath}`, {});
|
|
39
|
+
devkit_1.logger.info(`✅ Updated patch: ${patchFileName}`);
|
|
40
|
+
devkit_1.logger.info('ℹ️ This patch hides local packages and local applications from the changeset prompt, and keeps unisphere-runtime-* packages out of the major bump selection');
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
devkit_1.logger.error(`❌ Failed to update patch: ${error?.message || 'Unknown error'}`);
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration: Replace setup-local-runtimes.ts content
|
|
3
|
+
*
|
|
4
|
+
* Finds setup-local-runtimes.ts in each application and replaces its content
|
|
5
|
+
* with the updated version that supports experience-scoped runtimes.
|
|
6
|
+
*/
|
|
7
|
+
import { Tree } from '@nx/devkit';
|
|
8
|
+
export default function update(tree: Tree): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=replace-setup-local-runtimes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-setup-local-runtimes.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-13-1/replace-setup-local-runtimes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAiC,MAAM,YAAY,CAAC;AAmCjE,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC9D"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Migration: Replace setup-local-runtimes.ts content
|
|
4
|
+
*
|
|
5
|
+
* Finds setup-local-runtimes.ts in each application and replaces its content
|
|
6
|
+
* with the updated version that supports experience-scoped runtimes.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.default = update;
|
|
10
|
+
const devkit_1 = require("@nx/devkit");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
const NEW_CONTENT = `export function setupLocalRuntimes() {
|
|
13
|
+
if (!process.env.LOCAL_RUNTIMES) return;
|
|
14
|
+
|
|
15
|
+
const runtimes: Record<string, Record<string, { token: string; baseEnvName: string }>> = {};
|
|
16
|
+
process.env.LOCAL_RUNTIMES.split(',').forEach((entry) => {
|
|
17
|
+
const [experience, name, port] = entry.split('@');
|
|
18
|
+
if (experience && name && port) {
|
|
19
|
+
if (!runtimes[experience]) {
|
|
20
|
+
runtimes[experience] = {};
|
|
21
|
+
}
|
|
22
|
+
runtimes[experience][name] = { token: port, baseEnvName: '' };
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const overrides = {
|
|
27
|
+
baseEnvName: '',
|
|
28
|
+
mode: 'integration',
|
|
29
|
+
options: { verbose: 'inherit' },
|
|
30
|
+
baseEnvScope: { core: 'inherit', presets: 'inherit' },
|
|
31
|
+
runtimes,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
(window as any).unisphereRuntimeOverrides = btoa(JSON.stringify(overrides));
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
async function update(tree) {
|
|
38
|
+
devkit_1.logger.info('🔄 Replacing setup-local-runtimes.ts content in applications...');
|
|
39
|
+
if (!tree.exists('.unisphere')) {
|
|
40
|
+
devkit_1.logger.warn('⚠️ No .unisphere file found, skipping');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const unisphereConfig = (0, devkit_1.readJson)(tree, '.unisphere');
|
|
44
|
+
const applications = unisphereConfig.elements?.applications;
|
|
45
|
+
if (!applications || Object.keys(applications).length === 0) {
|
|
46
|
+
devkit_1.logger.info('ℹ️ No applications found, skipping');
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let updatedCount = 0;
|
|
50
|
+
for (const [appName, appConfig] of Object.entries(applications)) {
|
|
51
|
+
const setupFilePath = (0, path_1.join)(appConfig.sourceRoot, 'src', 'setup-local-runtimes.ts');
|
|
52
|
+
if (!tree.exists(setupFilePath)) {
|
|
53
|
+
devkit_1.logger.info(`ℹ️ ${appName}: setup-local-runtimes.ts not found, skipping`);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
tree.write(setupFilePath, NEW_CONTENT);
|
|
57
|
+
updatedCount++;
|
|
58
|
+
devkit_1.logger.info(`✅ ${appName}: Replaced setup-local-runtimes.ts content`);
|
|
59
|
+
}
|
|
60
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
61
|
+
devkit_1.logger.info(`\n✅ Done: ${updatedCount} setup-local-runtimes.ts file(s) updated`);
|
|
62
|
+
}
|
package/migrations.json
CHANGED
|
@@ -522,6 +522,22 @@
|
|
|
522
522
|
"cli": {
|
|
523
523
|
"postUpdateMessage": "✅ Security Audit step commented out in .github/workflows/cicd.yml"
|
|
524
524
|
}
|
|
525
|
+
},
|
|
526
|
+
"4.13.0-update-changeset-patch": {
|
|
527
|
+
"version": "4.13.0",
|
|
528
|
+
"description": "Updates @changesets/cli patch to also hide local packages and local applications from the changeset prompt (runtimes stay out of the major bump selection)",
|
|
529
|
+
"factory": "./dist/migrations/4-13-0/update-changeset-patch.js",
|
|
530
|
+
"cli": {
|
|
531
|
+
"postUpdateMessage": "✅ @changesets/cli patch updated"
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
"4.13.1-replace-setup-local-runtimes": {
|
|
535
|
+
"version": "4.13.1",
|
|
536
|
+
"description": "Replaces setup-local-runtimes.ts with updated version supporting experience-scoped runtimes",
|
|
537
|
+
"factory": "./dist/migrations/4-13-1/replace-setup-local-runtimes.js",
|
|
538
|
+
"cli": {
|
|
539
|
+
"postUpdateMessage": "✅ setup-local-runtimes.ts updated with experience-scoped runtimes support"
|
|
540
|
+
}
|
|
525
541
|
}
|
|
526
542
|
},
|
|
527
543
|
"packageJsonUpdates": {
|
|
@@ -915,6 +931,17 @@
|
|
|
915
931
|
"alwaysAddToPackageJson": false
|
|
916
932
|
}
|
|
917
933
|
}
|
|
934
|
+
},
|
|
935
|
+
"4.13.1": {
|
|
936
|
+
"version": "4.13.1",
|
|
937
|
+
"cli": "nx",
|
|
938
|
+
"postUpdateMessage": "🎉 Migration to @unisphere/nx 4.13.1 completed successfully!",
|
|
939
|
+
"packages": {
|
|
940
|
+
"@unisphere/cli": {
|
|
941
|
+
"version": "5.4.1",
|
|
942
|
+
"alwaysAddToPackageJson": false
|
|
943
|
+
}
|
|
944
|
+
}
|
|
918
945
|
}
|
|
919
946
|
}
|
|
920
947
|
}
|