@unisphere/nx 4.15.5 → 4.15.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"add-application.d.ts","sourceRoot":"","sources":["../../../src/generators/add-application/add-application.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAgD,MAAM,YAAY,CAAC;AAE5G,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAwEzD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,6BAA6B,uBA6KvC;AAED,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"add-application.d.ts","sourceRoot":"","sources":["../../../src/generators/add-application/add-application.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAsC,MAAM,YAAY,CAAC;AAElG,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAwEzD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,6BAA6B,uBA4KvC;AAED,eAAe,uBAAuB,CAAC"}
@@ -115,16 +115,17 @@ async function addApplicationGenerator(tree, options) {
115
115
  (0, devkit_1.generateFiles)(tree, path.join(__dirname, templatePath), projectRoot, templateVariables);
116
116
  // For local-dev-playground apps, generate setup-local-runtimes.ts
117
117
  if (isPlayground) {
118
- const rawConfig = (0, devkit_1.readJson)(tree, '.unisphere');
119
- const experienceName = `unisphere.${rawConfig.type}.${rawConfig.name}`;
120
118
  const setupLocalRuntimesContent = `export function setupLocalRuntimes() {
121
119
  if (!process.env.LOCAL_RUNTIMES) return;
122
120
 
123
- const runtimes: Record<string, { token: string; baseEnvName: string }> = {};
121
+ const runtimes: Record<string, Record<string, { token: string; baseEnvName: string }>> = {};
124
122
  process.env.LOCAL_RUNTIMES.split(',').forEach((entry) => {
125
- const [name, port] = entry.split('@');
126
- if (name && port) {
127
- runtimes[name] = { token: port, baseEnvName: '' };
123
+ const [experience, name, port] = entry.split('@');
124
+ if (experience && name && port) {
125
+ if (!runtimes[experience]) {
126
+ runtimes[experience] = {};
127
+ }
128
+ runtimes[experience][name] = { token: port, baseEnvName: '' };
128
129
  }
129
130
  });
130
131
 
@@ -133,9 +134,7 @@ async function addApplicationGenerator(tree, options) {
133
134
  mode: 'integration',
134
135
  options: { verbose: 'inherit' },
135
136
  baseEnvScope: { core: 'inherit', presets: 'inherit' },
136
- runtimes: {
137
- '${experienceName}': runtimes,
138
- },
137
+ runtimes,
139
138
  };
140
139
 
141
140
  (window as any).unisphereRuntimeOverrides = btoa(JSON.stringify(overrides));
@@ -66,7 +66,7 @@ export function App() {
66
66
  visuals: [
67
67
  <% if (!visualName) { %>/*<% } %>{
68
68
  type: '<%= visualName ? visualName__camelCase : "~~provide-the-visual-name-to-mount-here~~" %>',
69
- target: 'mainContainer',
69
+ target: { type: 'element', elementId: 'mainContainer' },
70
70
  settings: {}<% if (visualName) { %> as <%= runtimeName__pascalCase %>Runtime<%= visualName__pascalCase %>VisualSettings<% } %>
71
71
  }<% if (!visualName) { %>*/<% } %>
72
72
  ],
@@ -18,7 +18,10 @@ export const HelloWorldExperience = ({ preload }: { preload?: boolean }) => {
18
18
  if (runtime) {
19
19
  const { unsubscribe } = runtime.mountVisual({
20
20
  type: 'docs',
21
- target: 'hello-world-experience-container',
21
+ target: {
22
+ type: 'element',
23
+ elementId: 'hello-world-experience-container',
24
+ },
22
25
  settings: {}
23
26
  });
24
27
 
@@ -22,6 +22,22 @@ languages/
22
22
  - **`files/`** — Contains translated JSON files for each supported language (excluding en-US). These are generated via the Unisphere CLI export/import workflow.
23
23
  - **`_db/`** — Used internally by the CLI to track translation changes between exports. Do not commit.
24
24
 
25
+ ## Adding a New Language
26
+
27
+ To add support for a new language, run:
28
+
29
+ ```bash
30
+ npx unisphere language add <language-COUNTRY>
31
+ ```
32
+
33
+ For example, to add Hebrew:
34
+
35
+ ```bash
36
+ npx unisphere language add he-IL
37
+ ```
38
+
39
+ This will set up the language files and update `supported-languages.ts` automatically.
40
+
25
41
  ## Adding Translations
26
42
 
27
43
  1. Add your translation keys to `en-US.json`
@@ -22,6 +22,22 @@ languages/
22
22
  - **`files/`** — Contains translated JSON files for each supported language (excluding en-US). These are generated via the Unisphere CLI export/import workflow.
23
23
  - **`_db/`** — Used internally by the CLI to track translation changes between exports. Do not commit.
24
24
 
25
+ ## Adding a New Language
26
+
27
+ To add support for a new language, run:
28
+
29
+ ```bash
30
+ npx unisphere language add <language-COUNTRY>
31
+ ```
32
+
33
+ For example, to add Hebrew:
34
+
35
+ ```bash
36
+ npx unisphere language add he-IL
37
+ ```
38
+
39
+ This will set up the language files and update `supported-languages.ts` automatically.
40
+
25
41
  ## CLI Commands
26
42
 
27
43
  ```bash
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Migration: Move @unisphere/nx to devDependencies
3
+ *
4
+ * @unisphere/nx is a build/development tool (Nx plugin with generators and
5
+ * migrations) and should not be in production dependencies. This migration
6
+ * moves it from dependencies to devDependencies, preserving the existing version.
7
+ */
8
+ import { Tree } from '@nx/devkit';
9
+ export default function update(tree: Tree): Promise<void>;
10
+ //# sourceMappingURL=move-nx-to-dev-dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-nx-to-dev-dependencies.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-15-6/move-nx-to-dev-dependencies.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAItD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAqC9D"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /**
3
+ * Migration: Move @unisphere/nx to devDependencies
4
+ *
5
+ * @unisphere/nx is a build/development tool (Nx plugin with generators and
6
+ * migrations) and should not be in production dependencies. This migration
7
+ * moves it from dependencies to devDependencies, preserving the existing version.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.default = update;
11
+ const devkit_1 = require("@nx/devkit");
12
+ const TARGET_PACKAGE = '@unisphere/nx';
13
+ async function update(tree) {
14
+ devkit_1.logger.info('🔄 Moving @unisphere/nx to devDependencies...');
15
+ const packageJsonPath = 'package.json';
16
+ if (!tree.exists(packageJsonPath)) {
17
+ devkit_1.logger.warn('⚠️ No package.json found, skipping');
18
+ return;
19
+ }
20
+ let moved = false;
21
+ (0, devkit_1.updateJson)(tree, packageJsonPath, (packageJson) => {
22
+ // If it's in dependencies, move it to devDependencies
23
+ if (packageJson.dependencies?.[TARGET_PACKAGE]) {
24
+ const version = packageJson.dependencies[TARGET_PACKAGE];
25
+ // Ensure devDependencies exists
26
+ if (!packageJson.devDependencies) {
27
+ packageJson.devDependencies = {};
28
+ }
29
+ // Move to devDependencies (preserve version)
30
+ packageJson.devDependencies[TARGET_PACKAGE] = version;
31
+ delete packageJson.dependencies[TARGET_PACKAGE];
32
+ moved = true;
33
+ devkit_1.logger.info(`📦 Moved ${TARGET_PACKAGE}@${version} from dependencies to devDependencies`);
34
+ }
35
+ return packageJson;
36
+ });
37
+ if (!moved) {
38
+ devkit_1.logger.info(`ℹ️ ${TARGET_PACKAGE} is not in dependencies (already in devDependencies or not present)`);
39
+ }
40
+ devkit_1.logger.info('✅ @unisphere/nx placement verified');
41
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Migration: Update languages README with "Adding a New Language" section
3
+ *
4
+ * Adds instructions for `npx unisphere language add <language-COUNTRY>`
5
+ * to all existing languages/README.md files.
6
+ */
7
+ import { Tree } from '@nx/devkit';
8
+ export default function update(tree: Tree): Promise<void>;
9
+ //# sourceMappingURL=update-languages-readme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-languages-readme.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-15-6/update-languages-readme.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AA2BpD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAwD9D"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ /**
3
+ * Migration: Update languages README with "Adding a New Language" section
4
+ *
5
+ * Adds instructions for `npx unisphere language add <language-COUNTRY>`
6
+ * to all existing languages/README.md files.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.default = update;
10
+ const devkit_1 = require("@nx/devkit");
11
+ const NEW_SECTION = `## Adding a New Language
12
+
13
+ To add support for a new language, run:
14
+
15
+ \`\`\`bash
16
+ npx unisphere language add <language-COUNTRY>
17
+ \`\`\`
18
+
19
+ For example, to add Hebrew:
20
+
21
+ \`\`\`bash
22
+ npx unisphere language add he-IL
23
+ \`\`\`
24
+
25
+ This will set up the language files and update \`supported-languages.ts\` automatically.
26
+
27
+ `;
28
+ async function update(tree) {
29
+ devkit_1.logger.info('🔄 Updating languages README files...');
30
+ if (!tree.exists('.unisphere')) {
31
+ devkit_1.logger.info('ℹ️ No .unisphere config found, skipping');
32
+ return;
33
+ }
34
+ const config = (0, devkit_1.readJson)(tree, '.unisphere');
35
+ const packages = config.elements?.packages || {};
36
+ const runtimes = config.elements?.runtimes || {};
37
+ let updatedCount = 0;
38
+ const allElements = [
39
+ ...Object.entries(packages).map(([name, cfg]) => ({ name, sourceRoot: cfg.sourceRoot })),
40
+ ...Object.entries(runtimes).map(([name, cfg]) => ({ name, sourceRoot: cfg.sourceRoot })),
41
+ ];
42
+ for (const element of allElements) {
43
+ const readmePath = `${element.sourceRoot}/src/languages/README.md`;
44
+ if (!tree.exists(readmePath)) {
45
+ continue;
46
+ }
47
+ const content = tree.read(readmePath, 'utf-8');
48
+ if (!content) {
49
+ continue;
50
+ }
51
+ // Skip if already has the section
52
+ if (content.includes('npx unisphere language add')) {
53
+ continue;
54
+ }
55
+ // Insert before "## CLI Commands" or "## Adding Translations"
56
+ let updatedContent;
57
+ if (content.includes('## Adding Translations')) {
58
+ updatedContent = content.replace('## Adding Translations', NEW_SECTION + '## Adding Translations');
59
+ }
60
+ else if (content.includes('## CLI Commands')) {
61
+ updatedContent = content.replace('## CLI Commands', NEW_SECTION + '## CLI Commands');
62
+ }
63
+ else {
64
+ // Append at the end
65
+ updatedContent = content + '\n' + NEW_SECTION;
66
+ }
67
+ tree.write(readmePath, updatedContent);
68
+ updatedCount++;
69
+ }
70
+ if (updatedCount > 0) {
71
+ devkit_1.logger.info(`✅ Updated ${updatedCount} languages README file(s)`);
72
+ }
73
+ else {
74
+ devkit_1.logger.info('ℹ️ No README files needed updating');
75
+ }
76
+ }
package/migrations.json CHANGED
@@ -602,6 +602,22 @@
602
602
  "cli": {
603
603
  "postUpdateMessage": "✅ Fixed supported-languges.ts typo (renamed to supported-languages.ts)"
604
604
  }
605
+ },
606
+ "4.15.6-move-nx-to-dev-dependencies": {
607
+ "version": "4.15.6",
608
+ "description": "Moves @unisphere/nx from dependencies to devDependencies (build tool, not production dependency)",
609
+ "factory": "./dist/migrations/4-15-6/move-nx-to-dev-dependencies.js",
610
+ "cli": {
611
+ "postUpdateMessage": "✅ @unisphere/nx moved to devDependencies"
612
+ }
613
+ },
614
+ "4.15.6-update-languages-readme": {
615
+ "version": "4.15.6",
616
+ "description": "Adds 'Adding a New Language' instructions to languages README files",
617
+ "factory": "./dist/migrations/4-15-6/update-languages-readme.js",
618
+ "cli": {
619
+ "postUpdateMessage": "✅ Languages README files updated with 'npx unisphere language add' instructions"
620
+ }
605
621
  }
606
622
  },
607
623
  "packageJsonUpdates": {
@@ -1138,16 +1154,27 @@
1138
1154
  }
1139
1155
  }
1140
1156
  },
1141
- "4.15.4": {
1142
- "version": "4.15.4",
1157
+ "4.15.6": {
1158
+ "version": "4.15.6",
1143
1159
  "cli": "nx",
1144
- "postUpdateMessage": "🎉 Migration to @unisphere/nx 4.15.4 completed successfully!",
1160
+ "postUpdateMessage": "🎉 Migration to @unisphere/nx 4.15.6 completed successfully!",
1145
1161
  "packages": {
1146
1162
  "@unisphere/cli": {
1147
1163
  "version": "6.1.1",
1148
1164
  "alwaysAddToPackageJson": false
1149
1165
  }
1150
1166
  }
1167
+ },
1168
+ "4.15.7": {
1169
+ "version": "4.15.7",
1170
+ "cli": "nx",
1171
+ "postUpdateMessage": "🎉 Migration to @unisphere/nx 4.15.7 completed successfully!",
1172
+ "packages": {
1173
+ "@unisphere/cli": {
1174
+ "version": "6.1.2",
1175
+ "alwaysAddToPackageJson": false
1176
+ }
1177
+ }
1151
1178
  }
1152
1179
  }
1153
1180
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "4.15.5",
3
+ "version": "4.15.7",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",