@unisphere/nx 4.13.0 → 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.
@@ -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
@@ -530,6 +530,14 @@
530
530
  "cli": {
531
531
  "postUpdateMessage": "āœ… @changesets/cli patch updated"
532
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
+ }
533
541
  }
534
542
  },
535
543
  "packageJsonUpdates": {
@@ -923,6 +931,17 @@
923
931
  "alwaysAddToPackageJson": false
924
932
  }
925
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
+ }
926
945
  }
927
946
  }
928
947
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",