@unisphere/nx 1.11.0 → 1.12.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.
@@ -1 +1 @@
1
- {"version":3,"file":"add-package.d.ts","sourceRoot":"","sources":["../../../src/generators/add-package/add-package.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAiB,MAAM,YAAY,CAAC;AAE7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AA+GrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBAyGnC;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"add-package.d.ts","sourceRoot":"","sources":["../../../src/generators/add-package/add-package.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAA2B,MAAM,YAAY,CAAC;AAEvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAoJrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBA6GnC;AAED,eAAe,mBAAmB,CAAC"}
@@ -5,6 +5,36 @@ const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const path = tslib_1.__importStar(require("path"));
7
7
  const utils_1 = require("../utils");
8
+ /**
9
+ * Resolves the @unisphere/runtime version from the workspace's root package.json
10
+ * Falls back to a default version if not found
11
+ */
12
+ function resolveUnisphereRuntimeVersion(tree) {
13
+ const defaultVersion = '^1.54.1';
14
+ try {
15
+ // Try to read the workspace root package.json
16
+ const packageJsonPath = 'package.json';
17
+ if (!tree.exists(packageJsonPath)) {
18
+ devkit_1.logger.warn(`Could not find package.json at workspace root. Using default @unisphere/runtime version: ${defaultVersion}`);
19
+ return defaultVersion;
20
+ }
21
+ const packageJson = (0, devkit_1.readJson)(tree, packageJsonPath);
22
+ // Check in dependencies
23
+ if (packageJson.dependencies?.['@unisphere/runtime']) {
24
+ return packageJson.dependencies['@unisphere/runtime'];
25
+ }
26
+ // Check in devDependencies
27
+ if (packageJson.devDependencies?.['@unisphere/runtime']) {
28
+ return packageJson.devDependencies['@unisphere/runtime'];
29
+ }
30
+ devkit_1.logger.warn(`@unisphere/runtime not found in workspace package.json. Using default version: ${defaultVersion}`);
31
+ return defaultVersion;
32
+ }
33
+ catch (error) {
34
+ devkit_1.logger.warn(`Error reading package.json: ${error}. Using default @unisphere/runtime version: ${defaultVersion}`);
35
+ return defaultVersion;
36
+ }
37
+ }
8
38
  function generateDemoComponent(tree, projectRoot, vars) {
9
39
  // path: packages/<pkg>/src/lib/panel-demo.tsx
10
40
  const targetPath = `${projectRoot}/src/lib/${vars['packageName__lowerDashCase']}-demo.tsx`;
@@ -121,6 +151,8 @@ async function addPackageGenerator(tree, options) {
121
151
  }
122
152
  const transformedPackageName = (0, devkit_1.names)(userInputPackageName);
123
153
  const githubUrl = `https://github.com/${companyName}/${experienceName}`;
154
+ // Resolve @unisphere/runtime version from workspace package.json
155
+ const unisphereRuntimeVersion = resolveUnisphereRuntimeVersion(tree);
124
156
  // Prepare template variables
125
157
  const templateVariables = {
126
158
  scope: options.scope,
@@ -128,6 +160,7 @@ async function addPackageGenerator(tree, options) {
128
160
  distributionChannel,
129
161
  githubUrl,
130
162
  companyName,
163
+ unisphereRuntimeVersion,
131
164
  ...(0, utils_1.createNameTransforms)(userInputPackageName, 'packageName'),
132
165
  ...(0, utils_1.createNameTransforms)(experienceName, 'experienceName'),
133
166
  ...(0, utils_1.createNameTransforms)(packageJsonName, 'packageJsonName'),
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "types": "./index.esm.d.ts",
12
12
  "dependencies": {
13
- "@unisphere/runtime": "^1.54.1"
13
+ "@unisphere/runtime": "<%= unisphereRuntimeVersion %>"
14
14
  },
15
15
  "publishConfig": {
16
16
  <% if (distributionChannel === 'github') { %>
@@ -0,0 +1,92 @@
1
+ # Unisphere Nx Workspace Upgrade Guide
2
+
3
+ This guide walks you through upgrading your Unisphere workspace to the latest version with Nx 22, React 19, MUI v7, and Node.js 24.
4
+
5
+ ## Prerequisites
6
+
7
+ ### Upgrade to Nx 22 First
8
+
9
+ Before running Unisphere migrations, upgrade your workspace to Nx 22:
10
+
11
+ ```bash
12
+ npx nx migrate latest
13
+ npx nx migrate --run-migrations
14
+ npm install
15
+ ```
16
+
17
+ Verify the upgrade works:
18
+ ```bash
19
+ npm run check
20
+ ```
21
+
22
+ For detailed Nx upgrade instructions, see the [official Nx migration guide](https://nx.dev/recipes/tips-n-tricks/advanced-update).
23
+
24
+ ### Other Prerequisites
25
+
26
+ - Ensure you have Node.js 24.x installed (check with `nvm list` or install via `nvm install 24`)
27
+ - Ensure your workspace is committed to git before starting
28
+
29
+ ## Upgrade Steps
30
+
31
+ ### Step 1: Install latest @unisphere/nx
32
+
33
+ ```bash
34
+ npm i @unisphere/nx@latest
35
+ ```
36
+
37
+ ### Step 2: Run all migrations
38
+
39
+ This will upgrade MUI to v7, update configurations, fix dependencies, and apply all necessary changes:
40
+
41
+ ```bash
42
+ npx nx g @unisphere/nx:unisphere-migrate
43
+ ```
44
+
45
+ ### Step 3: Clean node_modules
46
+
47
+ ```bash
48
+ rm -rf node_modules
49
+ ```
50
+
51
+ ### Step 4: Verify Node.js 24 is installed
52
+
53
+ ```bash
54
+ node -v # Should show v24.x.x
55
+ ```
56
+
57
+ If not installed, run:
58
+ ```bash
59
+ nvm install 24
60
+ ```
61
+
62
+ ### Step 5: Switch to Node.js 24
63
+
64
+ ```bash
65
+ nvm use
66
+ ```
67
+
68
+ ### Step 6: Fresh install with Node.js 24
69
+
70
+ ```bash
71
+ npm i
72
+ ```
73
+
74
+ ### Step 7: Fix React-related issues (if any)
75
+
76
+ If you encounter React 19 compatibility issues, you may need to:
77
+ - Run `react-codemod` for automatic fixes
78
+ - Fix TypeScript type issues manually
79
+ - Update component patterns that changed in React 19
80
+
81
+ ### Step 8: Verify everything builds
82
+
83
+ ```bash
84
+ npm run check
85
+ ```
86
+
87
+ ## What Changed
88
+
89
+ - **React**: Upgraded to v19
90
+ - **MUI**: Upgraded to v7
91
+ - **Node.js**: Updated to v24
92
+ - **All @unisphere and @kaltura packages**: Updated to latest versions
@@ -60,11 +60,11 @@
60
60
  "postUpdateMessage": "\nšŸŽ‰ Migration to @unisphere/nx 1.9.0 completed successfully!\n\nšŸ“‹ Summary of changes:\n • Upgraded MUI to v7\n • Updated Node.js to version 24 (.nvmrc)\n • Updated all @unisphere and @kaltura packages\n • Upgraded to React 19\n\nāš ļø Important next steps:\n 1. Ensure you have Node.js 24.x and run nvm use\n 2. Remove node_modules and Install dependencies: npm install\n 3. Review and test your application\n 4. Commit the changes\n",
61
61
  "packages": {
62
62
  "@mui/material": {
63
- "version": "^7.3.1",
63
+ "version": "^7.3.4",
64
64
  "alwaysAddToPackageJson": false
65
65
  },
66
66
  "@mui/icons-material": {
67
- "version": "^7.3.1",
67
+ "version": "^7.3.4",
68
68
  "alwaysAddToPackageJson": false
69
69
  },
70
70
  "@kaltura/ds-react-bits": {
@@ -84,7 +84,7 @@
84
84
  "alwaysAddToPackageJson": false
85
85
  },
86
86
  "@unisphere/cli": {
87
- "version": "^1.54.0",
87
+ "version": "latest",
88
88
  "alwaysAddToPackageJson": false
89
89
  },
90
90
  "@unisphere/core": {
@@ -128,7 +128,7 @@
128
128
  "alwaysAddToPackageJson": false
129
129
  },
130
130
  "@types/node": {
131
- "version": "^20.19.1",
131
+ "@types/node": "24.3.2",
132
132
  "alwaysAddToPackageJson": false
133
133
  },
134
134
  "@types/react": {
package/migrations.json CHANGED
@@ -60,11 +60,11 @@
60
60
  "postUpdateMessage": "\nšŸŽ‰ Migration to @unisphere/nx 1.9.0 completed successfully!\n\nšŸ“‹ Summary of changes:\n • Upgraded MUI to v7\n • Updated Node.js to version 24 (.nvmrc)\n • Updated all @unisphere and @kaltura packages\n • Upgraded to React 19\n\nāš ļø Important next steps:\n 1. Ensure you have Node.js 24.x and run nvm use\n 2. Remove node_modules and Install dependencies: npm install\n 3. Review and test your application\n 4. Commit the changes\n",
61
61
  "packages": {
62
62
  "@mui/material": {
63
- "version": "^7.3.1",
63
+ "version": "^7.3.4",
64
64
  "alwaysAddToPackageJson": false
65
65
  },
66
66
  "@mui/icons-material": {
67
- "version": "^7.3.1",
67
+ "version": "^7.3.4",
68
68
  "alwaysAddToPackageJson": false
69
69
  },
70
70
  "@kaltura/ds-react-bits": {
@@ -84,7 +84,7 @@
84
84
  "alwaysAddToPackageJson": false
85
85
  },
86
86
  "@unisphere/cli": {
87
- "version": "^1.54.0",
87
+ "version": "latest",
88
88
  "alwaysAddToPackageJson": false
89
89
  },
90
90
  "@unisphere/core": {
@@ -128,7 +128,7 @@
128
128
  "alwaysAddToPackageJson": false
129
129
  },
130
130
  "@types/node": {
131
- "version": "^20.19.1",
131
+ "@types/node": "24.3.2",
132
132
  "alwaysAddToPackageJson": false
133
133
  },
134
134
  "@types/react": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",