@unisphere/nx 2.2.2 → 3.2.3

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.
Files changed (130) hide show
  1. package/dist/generators/add-application/add-application.d.ts.map +1 -1
  2. package/dist/generators/add-application/add-application.js +76 -59
  3. package/dist/generators/add-application/schema.d.ts +3 -1
  4. package/dist/generators/add-application/schema.json +4 -8
  5. package/dist/generators/add-application/templates/default/.env-template +6 -0
  6. package/dist/generators/add-application/templates/default/.eslintrc.json +1 -1
  7. package/dist/generators/add-application/templates/default/jest.config.ts +3 -3
  8. package/dist/generators/add-application/templates/default/project.json.template +2 -2
  9. package/dist/generators/add-application/templates/default/readme.md.template +11 -0
  10. package/dist/generators/add-application/templates/default/src/app/app.tsx.template +77 -77
  11. package/dist/generators/add-application/templates/default/tsconfig.json +1 -1
  12. package/dist/generators/add-application/templates/default/webpack.config.js.template +6 -1
  13. package/dist/generators/add-package/README.md +2 -2
  14. package/dist/generators/add-package/add-package.d.ts.map +1 -1
  15. package/dist/generators/add-package/add-package.js +11 -23
  16. package/dist/generators/add-package/schema.d.ts +1 -1
  17. package/dist/generators/add-package/schema.json +27 -19
  18. package/dist/generators/add-package/templates/new-package/.eslintrc.json +1 -1
  19. package/dist/generators/add-package/templates/new-package/package.json.template +0 -1
  20. package/dist/generators/add-package/templates/new-package/project.json.template +4 -4
  21. package/dist/generators/add-package/templates/new-package/rollup.config.js +1 -1
  22. package/dist/generators/add-package/templates/new-package/tsconfig.json +1 -1
  23. package/dist/generators/add-package/templates/new-package/tsconfig.lib.json.template +1 -1
  24. package/dist/generators/add-package/templates/new-package/tsconfig.spec.json +1 -1
  25. package/dist/generators/add-runtime/add-runtime.d.ts.map +1 -1
  26. package/dist/generators/add-runtime/add-runtime.js +62 -9
  27. package/dist/generators/add-runtime/schema.d.ts +1 -0
  28. package/dist/generators/add-runtime/schema.json +1 -9
  29. package/dist/generators/add-runtime/templates/new-runtime/src/lib/create-factory.tsx.template +4 -4
  30. package/dist/generators/add-runtime/templates/new-runtime/src/lib/runtime.tsx.template +26 -2
  31. package/dist/generators/add-visual/add-visual.d.ts +1 -1
  32. package/dist/generators/add-visual/add-visual.d.ts.map +1 -1
  33. package/dist/generators/add-visual/add-visual.js +108 -15
  34. package/dist/generators/add-visual/schema.d.ts +3 -3
  35. package/dist/generators/add-visual/schema.json +2 -24
  36. package/dist/generators/dependency-config.d.ts.map +1 -1
  37. package/dist/generators/dependency-config.js +1 -0
  38. package/dist/generators/internal-dev-runner/generator.d.ts +3 -0
  39. package/dist/generators/internal-dev-runner/generator.d.ts.map +1 -0
  40. package/dist/generators/internal-dev-runner/generator.js +45 -0
  41. package/dist/generators/internal-dev-runner/schema.json +9 -0
  42. package/dist/generators/remove/remove.d.ts +19 -0
  43. package/dist/generators/remove/remove.d.ts.map +1 -0
  44. package/dist/generators/remove/remove.js +270 -0
  45. package/dist/generators/remove/schema.d.ts +4 -0
  46. package/dist/generators/remove/schema.json +38 -0
  47. package/dist/generators/rename-package/rename-package.d.ts +3 -0
  48. package/dist/generators/rename-package/rename-package.d.ts.map +1 -1
  49. package/dist/generators/rename-package/rename-package.js +139 -20
  50. package/dist/generators/utils.d.ts +30 -1
  51. package/dist/generators/utils.d.ts.map +1 -1
  52. package/dist/generators/utils.js +258 -7
  53. package/dist/migrations/1-22-0/patches/@changesets+cli+2.29.7.patch +36 -4
  54. package/dist/migrations/3-0-0/add-define-plugin-to-webpack.d.ts +3 -0
  55. package/dist/migrations/3-0-0/add-define-plugin-to-webpack.d.ts.map +1 -0
  56. package/dist/migrations/3-0-0/add-define-plugin-to-webpack.js +233 -0
  57. package/dist/migrations/3-0-0/add-env-to-application-gitignore.d.ts +3 -0
  58. package/dist/migrations/3-0-0/add-env-to-application-gitignore.d.ts.map +1 -0
  59. package/dist/migrations/3-0-0/add-env-to-application-gitignore.js +117 -0
  60. package/dist/migrations/3-0-0/fix-vite-config-cache-paths.d.ts +10 -0
  61. package/dist/migrations/3-0-0/fix-vite-config-cache-paths.d.ts.map +1 -0
  62. package/dist/migrations/3-0-0/fix-vite-config-cache-paths.js +66 -0
  63. package/dist/migrations/3-0-0/patches/@changesets+cli+2.29.7.patch +88 -0
  64. package/dist/migrations/3-0-0/post-cleanup-empty-directories.d.ts +12 -0
  65. package/dist/migrations/3-0-0/post-cleanup-empty-directories.d.ts.map +1 -0
  66. package/dist/migrations/3-0-0/post-cleanup-empty-directories.js +62 -0
  67. package/dist/migrations/3-0-0/pre-cleanup-empty-directories.d.ts +14 -0
  68. package/dist/migrations/3-0-0/pre-cleanup-empty-directories.d.ts.map +1 -0
  69. package/dist/migrations/3-0-0/pre-cleanup-empty-directories.js +105 -0
  70. package/dist/migrations/3-0-0/remove-kaltura-tools-to-pre-install.d.ts +3 -0
  71. package/dist/migrations/3-0-0/remove-kaltura-tools-to-pre-install.d.ts.map +1 -0
  72. package/dist/migrations/3-0-0/remove-kaltura-tools-to-pre-install.js +21 -0
  73. package/dist/migrations/3-0-0/remove-private-from-applications-and-runtimes.d.ts +9 -0
  74. package/dist/migrations/3-0-0/remove-private-from-applications-and-runtimes.d.ts.map +1 -0
  75. package/dist/migrations/3-0-0/remove-private-from-applications-and-runtimes.js +88 -0
  76. package/dist/migrations/3-0-0/remove-publish-config-from-packages.d.ts +9 -0
  77. package/dist/migrations/3-0-0/remove-publish-config-from-packages.d.ts.map +1 -0
  78. package/dist/migrations/3-0-0/remove-publish-config-from-packages.js +45 -0
  79. package/dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.d.ts +15 -0
  80. package/dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.d.ts.map +1 -0
  81. package/dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.js +563 -0
  82. package/dist/migrations/3-0-0/reorganize-packages-by-distribution-channel.d.ts +23 -0
  83. package/dist/migrations/3-0-0/reorganize-packages-by-distribution-channel.d.ts.map +1 -0
  84. package/dist/migrations/3-0-0/reorganize-packages-by-distribution-channel.js +645 -0
  85. package/dist/migrations/3-0-0/replace-github-workflow.d.ts +3 -0
  86. package/dist/migrations/3-0-0/replace-github-workflow.d.ts.map +1 -0
  87. package/dist/migrations/3-0-0/replace-github-workflow.js +48 -0
  88. package/dist/migrations/3-0-0/sync-package-lock.d.ts +10 -0
  89. package/dist/migrations/3-0-0/sync-package-lock.d.ts.map +1 -0
  90. package/dist/migrations/3-0-0/sync-package-lock.js +26 -0
  91. package/dist/migrations/3-0-0/templates/_publish-artifacts.template +363 -0
  92. package/dist/migrations/3-0-0/templates/cicd.template +89 -0
  93. package/dist/migrations/3-0-0/update-changeset-patch.d.ts +3 -0
  94. package/dist/migrations/3-0-0/update-changeset-patch.d.ts.map +1 -0
  95. package/dist/migrations/3-0-0/update-changeset-patch.js +31 -0
  96. package/dist/migrations/3-0-0/upgrade-schema-to-2-0-0.d.ts +21 -0
  97. package/dist/migrations/3-0-0/upgrade-schema-to-2-0-0.d.ts.map +1 -0
  98. package/dist/migrations/3-0-0/upgrade-schema-to-2-0-0.js +105 -0
  99. package/dist/migrations/utils/has-react-dependency.d.ts +14 -0
  100. package/dist/migrations/utils/has-react-dependency.d.ts.map +1 -0
  101. package/dist/migrations/utils/has-react-dependency.js +72 -0
  102. package/dist/shared.d.ts +6 -0
  103. package/dist/shared.d.ts.map +1 -0
  104. package/dist/shared.js +9 -0
  105. package/generators.json +12 -1
  106. package/migrations.json +117 -0
  107. package/package.json +3 -2
  108. package/dist/generators/add-application/templates/local-dev-playground/.babelrc +0 -11
  109. package/dist/generators/add-application/templates/local-dev-playground/.eslintrc.json +0 -22
  110. package/dist/generators/add-application/templates/local-dev-playground/jest.config.ts +0 -11
  111. package/dist/generators/add-application/templates/local-dev-playground/package.json +0 -6
  112. package/dist/generators/add-application/templates/local-dev-playground/project.json +0 -9
  113. package/dist/generators/add-application/templates/local-dev-playground/src/app/app.tsx.template +0 -212
  114. package/dist/generators/add-application/templates/local-dev-playground/src/app/components/header.tsx.template +0 -123
  115. package/dist/generators/add-application/templates/local-dev-playground/src/app/components/settings-buttons.tsx +0 -57
  116. package/dist/generators/add-application/templates/local-dev-playground/src/app/components/settings-form.tsx +0 -108
  117. package/dist/generators/add-application/templates/local-dev-playground/src/app/components/settings.tsx +0 -74
  118. package/dist/generators/add-application/templates/local-dev-playground/src/app/configuration-provider.tsx +0 -163
  119. package/dist/generators/add-application/templates/local-dev-playground/src/app/definitions.ts +0 -25
  120. package/dist/generators/add-application/templates/local-dev-playground/src/app/utils/merge-deep.ts +0 -31
  121. package/dist/generators/add-application/templates/local-dev-playground/src/favicon.ico +0 -0
  122. package/dist/generators/add-application/templates/local-dev-playground/src/index.html +0 -17
  123. package/dist/generators/add-application/templates/local-dev-playground/src/main.tsx +0 -13
  124. package/dist/generators/add-application/templates/local-dev-playground/src/styles.css +0 -0
  125. package/dist/generators/add-application/templates/local-dev-playground/tsconfig.app.json +0 -24
  126. package/dist/generators/add-application/templates/local-dev-playground/tsconfig.json +0 -20
  127. package/dist/generators/add-application/templates/local-dev-playground/tsconfig.spec.json +0 -25
  128. package/dist/generators/add-application/templates/local-dev-playground/webpack.config.js +0 -33
  129. /package/dist/generators/add-runtime/templates/{core-templates → types-templates}/__runtimeName__-runtime/index.ts.template +0 -0
  130. /package/dist/generators/add-runtime/templates/{core-templates → types-templates}/__runtimeName__-runtime/runtime-types.ts.template +0 -0
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = removeDistributionChannel;
4
+ const devkit_1 = require("@nx/devkit");
5
+ /**
6
+ * Migration: Remove distributionChannel property from packages and update schema version
7
+ *
8
+ * After the reorganize-packages-by-distribution-channel migration, the distributionChannel
9
+ * property for packages is redundant and can be inferred from the folder path:
10
+ *
11
+ * Packages:
12
+ * - unisphere/packages/private/* → distributionChannel: "none"
13
+ * - unisphere/packages/corp/* → distributionChannel: "github"
14
+ * - unisphere/packages/public/* → distributionChannel: "npm"
15
+ *
16
+ * Runtimes & Applications:
17
+ * - Keep distributionChannel property (cannot be inferred from path)
18
+ *
19
+ * This migration:
20
+ * 1. Removes the distributionChannel property only from packages in .unisphere
21
+ * 2. Updates schemaVersion from "1.0.0" to "2.0.0"
22
+ */
23
+ async function removeDistributionChannel(tree) {
24
+ devkit_1.logger.info('');
25
+ devkit_1.logger.info('========================================');
26
+ devkit_1.logger.info('Upgrading .unisphere to schema version 2.0.0');
27
+ devkit_1.logger.info('========================================');
28
+ devkit_1.logger.info('');
29
+ // Check if .unisphere file exists
30
+ if (!tree.exists('.unisphere')) {
31
+ devkit_1.logger.warn('⚠️ .unisphere file not found. Skipping migration.');
32
+ return;
33
+ }
34
+ // Read current configuration
35
+ let config;
36
+ try {
37
+ config = (0, devkit_1.readJson)(tree, '.unisphere');
38
+ }
39
+ catch (error) {
40
+ devkit_1.logger.error(`❌ Failed to read .unisphere: ${error instanceof Error ? error.message : 'Unknown error'}`);
41
+ throw error;
42
+ }
43
+ // Track changes
44
+ let totalRemoved = 0;
45
+ let schemaUpdated = false;
46
+ // Update schema version from 1.0.0 to 2.0.0
47
+ if (config.schemaVersion === '1.0.0') {
48
+ config.schemaVersion = '2.0.0';
49
+ schemaUpdated = true;
50
+ devkit_1.logger.info('✅ Updated schemaVersion: 1.0.0 → 2.0.0');
51
+ devkit_1.logger.info('');
52
+ }
53
+ else if (config.schemaVersion === '2.0.0') {
54
+ devkit_1.logger.info('ℹ️ Schema already at version 2.0.0');
55
+ devkit_1.logger.info('');
56
+ }
57
+ else {
58
+ devkit_1.logger.warn(`⚠️ Unknown schemaVersion: ${config.schemaVersion}. Expected 1.0.0 or 2.0.0`);
59
+ devkit_1.logger.info('');
60
+ }
61
+ // Process packages only (not runtimes or applications)
62
+ if (config.elements?.packages) {
63
+ for (const packageName in config.elements.packages) {
64
+ const packageConfig = config.elements.packages[packageName];
65
+ if ('distributionChannel' in packageConfig) {
66
+ delete packageConfig.distributionChannel;
67
+ totalRemoved++;
68
+ }
69
+ }
70
+ }
71
+ // Write updated configuration back
72
+ if (totalRemoved > 0 || schemaUpdated) {
73
+ try {
74
+ (0, devkit_1.writeJson)(tree, '.unisphere', config);
75
+ if (totalRemoved > 0) {
76
+ devkit_1.logger.info('✅ Successfully removed distributionChannel property from packages');
77
+ devkit_1.logger.info('');
78
+ devkit_1.logger.info(`Removed distributionChannel from ${totalRemoved} package(s)`);
79
+ devkit_1.logger.info('');
80
+ devkit_1.logger.info('ℹ️ Distribution channel for packages can now be inferred from folder paths:');
81
+ devkit_1.logger.info(' - packages/private/* → "none"');
82
+ devkit_1.logger.info(' - packages/corp/* → "github"');
83
+ devkit_1.logger.info(' - packages/public/* → "npm"');
84
+ devkit_1.logger.info('');
85
+ devkit_1.logger.info('ℹ️ Runtimes and applications still have distributionChannel property');
86
+ }
87
+ else if (schemaUpdated) {
88
+ devkit_1.logger.info('ℹ️ No distributionChannel properties found in packages.');
89
+ devkit_1.logger.info('ℹ️ Only schema version was updated.');
90
+ }
91
+ }
92
+ catch (error) {
93
+ devkit_1.logger.error(`❌ Failed to write .unisphere: ${error instanceof Error ? error.message : 'Unknown error'}`);
94
+ throw error;
95
+ }
96
+ }
97
+ else {
98
+ devkit_1.logger.info('ℹ️ No changes needed. Schema already at 2.0.0 and no distributionChannel properties found.');
99
+ }
100
+ devkit_1.logger.info('');
101
+ devkit_1.logger.info('========================================');
102
+ devkit_1.logger.info('Migration complete');
103
+ devkit_1.logger.info('========================================');
104
+ devkit_1.logger.info('');
105
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Check if a project has React dependencies, including transitive dependencies
3
+ * through workspace projects only.
4
+ *
5
+ * Uses Nx's project graph to traverse dependencies. Only traverses into
6
+ * workspace projects' transitive dependencies, not external npm packages.
7
+ * This prevents false positives from build tools (like @vitejs/plugin-react)
8
+ * that have transitive dependencies on react-refresh, react-is, etc.
9
+ *
10
+ * @param projectName - The Nx project name to check
11
+ * @returns true if the project or any transitive workspace dependency depends on React
12
+ */
13
+ export declare function hasReactDependency(projectName: string): Promise<boolean>;
14
+ //# sourceMappingURL=has-react-dependency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"has-react-dependency.d.ts","sourceRoot":"","sources":["../../../src/migrations/utils/has-react-dependency.ts"],"names":[],"mappings":"AAmCA;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiC9E"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasReactDependency = hasReactDependency;
4
+ const devkit_1 = require("@nx/devkit");
5
+ /**
6
+ * React-related dependency patterns.
7
+ * Matches actual React ecosystem packages, not workspace projects
8
+ * that happen to have "react" in their name.
9
+ */
10
+ function isReactRelatedDependency(dep) {
11
+ return (
12
+ // Exact match for "react" package
13
+ dep === 'react' ||
14
+ // react-* packages (react-dom, react-is, react-refresh, etc.)
15
+ dep.startsWith('react-') ||
16
+ // @types/react packages
17
+ dep.startsWith('@types/react') ||
18
+ // @mui/* pattern
19
+ dep.startsWith('@mui/') ||
20
+ // @kaltura/ds* pattern
21
+ dep.startsWith('@kaltura/ds'));
22
+ }
23
+ /**
24
+ * Extract package name from Nx dependency target.
25
+ * Handles both workspace projects and npm packages (npm:package-name format).
26
+ */
27
+ function getPackageName(target, graph) {
28
+ // Check if it's an external npm package
29
+ const externalNode = graph.externalNodes?.[target];
30
+ if (externalNode) {
31
+ return externalNode.data?.packageName || target.replace(/^npm:/, '');
32
+ }
33
+ return target;
34
+ }
35
+ /**
36
+ * Check if a project has React dependencies, including transitive dependencies
37
+ * through workspace projects only.
38
+ *
39
+ * Uses Nx's project graph to traverse dependencies. Only traverses into
40
+ * workspace projects' transitive dependencies, not external npm packages.
41
+ * This prevents false positives from build tools (like @vitejs/plugin-react)
42
+ * that have transitive dependencies on react-refresh, react-is, etc.
43
+ *
44
+ * @param projectName - The Nx project name to check
45
+ * @returns true if the project or any transitive workspace dependency depends on React
46
+ */
47
+ async function hasReactDependency(projectName) {
48
+ const graph = await (0, devkit_1.createProjectGraphAsync)();
49
+ const visited = new Set();
50
+ function traverse(current) {
51
+ if (visited.has(current)) {
52
+ return false;
53
+ }
54
+ visited.add(current);
55
+ const deps = graph.dependencies[current] || [];
56
+ for (const dep of deps) {
57
+ const packageName = getPackageName(dep.target, graph);
58
+ if (isReactRelatedDependency(packageName)) {
59
+ return true;
60
+ }
61
+ // Only recursively check dependencies for workspace projects, not external npm packages.
62
+ // External npm packages (like @vitejs/plugin-react, vitest) have their own transitive deps
63
+ // (like react-refresh, react-is) which are build tools, not actual runtime dependencies.
64
+ const isDepExternal = !!graph.externalNodes?.[dep.target];
65
+ if (!isDepExternal && traverse(dep.target)) {
66
+ return true;
67
+ }
68
+ }
69
+ return false;
70
+ }
71
+ return traverse(projectName);
72
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum PackagesScopes {
2
+ 'unisphere' = "unisphere",
3
+ 'kaltura-ai' = "kaltura-ai",
4
+ 'kaltura-corp' = "kaltura-corp"
5
+ }
6
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACtB,WAAW,cAAc;IACzB,YAAY,eAAe;IAC3B,cAAc,iBAAiB;CAClC"}
package/dist/shared.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PackagesScopes = void 0;
4
+ var PackagesScopes;
5
+ (function (PackagesScopes) {
6
+ PackagesScopes["unisphere"] = "unisphere";
7
+ PackagesScopes["kaltura-ai"] = "kaltura-ai";
8
+ PackagesScopes["kaltura-corp"] = "kaltura-corp";
9
+ })(PackagesScopes || (exports.PackagesScopes = PackagesScopes = {}));
package/generators.json CHANGED
@@ -24,6 +24,17 @@
24
24
  "factory": "./dist/generators/rename-package/rename-package",
25
25
  "schema": "./dist/generators/rename-package/schema.json",
26
26
  "description": "Rename a unisphere package and update all references"
27
+ },
28
+ "remove": {
29
+ "factory": "./dist/generators/remove/remove",
30
+ "schema": "./dist/generators/remove/schema.json",
31
+ "aliases": ["rm"],
32
+ "description": "Remove a unisphere element (package, runtime, or application)"
33
+ },
34
+ "internal-dev-runner": {
35
+ "factory": "./dist/generators/internal-dev-runner/generator",
36
+ "schema": "./dist/generators/internal-dev-runner/schema.json",
37
+ "description": "Internal-dev-runner - Run a migration for testing purposes (dev only)"
27
38
  }
28
39
  }
29
- }
40
+ }
package/migrations.json CHANGED
@@ -169,6 +169,112 @@
169
169
  "postUpdateMessage": "✅ GitHub workflow updated with some changes."
170
170
  }
171
171
  },
172
+ "3-0-0-pre-cleanup-empty-directories": {
173
+ "version": "3.0.0",
174
+ "description": "Cleans up empty directories before reorganization migrations",
175
+ "factory": "./dist/migrations/3-0-0/pre-cleanup-empty-directories.js"
176
+ },
177
+ "3-0-0-reorganize-packages-by-distribution-channel": {
178
+ "version": "3.0.0",
179
+ "description": "Reorganizes packages into private/, corp/, and public/ subdirectories based on distributionChannel. Also renames 'core' package to 'types' if it exists.",
180
+ "factory": "./dist/migrations/3-0-0/reorganize-packages-by-distribution-channel.js",
181
+ "cli": {
182
+ "postUpdateMessage": "✅ Packages reorganized by distribution channel. 'core' renamed to 'types' if present. Run npm install."
183
+ }
184
+ },
185
+ "3-0-0-reorganize-applications-by-distribution-channel": {
186
+ "version": "3.0.0",
187
+ "description": "Reorganizes applications into local/ and server/ subdirectories based on distributionChannel.",
188
+ "factory": "./dist/migrations/3-0-0/reorganize-applications-by-distribution-channel.js",
189
+ "cli": {
190
+ "postUpdateMessage": "✅ Applications reorganized by distribution channel into local/ and server/ subdirectories. Run npm install."
191
+ }
192
+ },
193
+ "3-0-0-upgrade-schema-to-2-0-0": {
194
+ "version": "3.0.0",
195
+ "description": "Upgrades .unisphere schema to 2.0.0 and removes distributionChannel from packages",
196
+ "factory": "./dist/migrations/3-0-0/upgrade-schema-to-2-0-0.js",
197
+ "cli": {
198
+ "postUpdateMessage": "✅ .unisphere upgraded to schema 2.0.0"
199
+ }
200
+ },
201
+ "3-0-0-update-changeset-patch": {
202
+ "version": "3.0.0",
203
+ "description": "Updates @changesets/cli patch to filter runtime packages from major bump selection",
204
+ "factory": "./dist/migrations/3-0-0/update-changeset-patch.js",
205
+ "cli": {
206
+ "postUpdateMessage": "✅ @changesets/cli patch updated"
207
+ }
208
+ },
209
+ "3-0-0-add-env-to-application-gitignore": {
210
+ "version": "3.0.0",
211
+ "description": "Adds .env to .gitignore files for all elements (applications, packages, runtimes, etc.)",
212
+ "factory": "./dist/migrations/3-0-0/add-env-to-application-gitignore.js",
213
+ "cli": {
214
+ "postUpdateMessage": "✅ .env added to .gitignore files for all elements"
215
+ }
216
+ },
217
+ "3-0-0-add-define-plugin-to-webpack": {
218
+ "version": "3.0.0",
219
+ "description": "Adds DefinePlugin to application webpack configs and creates .env-template",
220
+ "factory": "./dist/migrations/3-0-0/add-define-plugin-to-webpack.js",
221
+ "cli": {
222
+ "postUpdateMessage": "✅ DefinePlugin added to webpack configs and .env-template files created"
223
+ }
224
+ },
225
+ "3-0-0-replace-github-workflow": {
226
+ "version": "3.0.0",
227
+ "description": "Updates GitHub workflow files (cicd.yml and _publish-artifacts.yml)",
228
+ "factory": "./dist/migrations/3-0-0/replace-github-workflow.js",
229
+ "cli": {
230
+ "postUpdateMessage": "✅ GitHub workflow files updated"
231
+ }
232
+ },
233
+ "3-0-0-remove-publish-config-from-packages": {
234
+ "version": "3.0.0",
235
+ "description": "Removes publishConfig from package.json files in packages",
236
+ "factory": "./dist/migrations/3-0-0/remove-publish-config-from-packages.js",
237
+ "cli": {
238
+ "postUpdateMessage": "✅ publishConfig removed from package.json files"
239
+ }
240
+ },
241
+ "3-0-0-remove-private-from-applications-and-runtimes": {
242
+ "version": "3.0.0",
243
+ "description": "Removes private field from package.json files in applications, runtimes, and packages",
244
+ "factory": "./dist/migrations/3-0-0/remove-private-from-applications-and-runtimes.js",
245
+ "cli": {
246
+ "postUpdateMessage": "✅ private field removed from applications, runtimes, and packages package.json files"
247
+ }
248
+ },
249
+ "3-0-0-fix-vite-config-cache-paths": {
250
+ "version": "3.0.0",
251
+ "description": "Fixes vite.config.ts cache directory paths to match package names",
252
+ "factory": "./dist/migrations/3-0-0/fix-vite-config-cache-paths.js",
253
+ "cli": {
254
+ "postUpdateMessage": "✅ vite.config.ts cache paths fixed"
255
+ }
256
+ },
257
+ "3-0-0-post-cleanup-empty-directories": {
258
+ "version": "3.0.0",
259
+ "description": "Cleans up empty directories after all reorganization migrations",
260
+ "factory": "./dist/migrations/3-0-0/post-cleanup-empty-directories.js",
261
+ "cli": {
262
+ "postUpdateMessage": "✅ Empty directories cleaned up"
263
+ }
264
+ },
265
+ "3-0-0-sync-package-lock": {
266
+ "version": "3.0.0",
267
+ "description": "Runs npm install to sync package-lock.json after all migrations",
268
+ "factory": "./dist/migrations/3-0-0/sync-package-lock.js",
269
+ "cli": {
270
+ "postUpdateMessage": "✅ package-lock.json synced"
271
+ }
272
+ },
273
+ "3-0-0-remove-pre-install": {
274
+ "version": "3.0.0",
275
+ "description": "Removes kaltura-tools preinstall script from package.json",
276
+ "factory": "./dist/migrations/3-0-0/remove-kaltura-tools-to-pre-install.js",
277
+ }
172
278
  },
173
279
  "packageJsonUpdates": {
174
280
  "1.22.0": {
@@ -312,6 +418,17 @@
312
418
  "alwaysAddToPackageJson": false
313
419
  }
314
420
  }
421
+ },
422
+ "3.0.0": {
423
+ "version": "3.0.0",
424
+ "cli": "nx",
425
+ "postUpdateMessage": "🎉 Migration to @unisphere/nx 3.0.0 finished!\n\nPackages reorganized by distribution channel:\n- private/ for distributionChannel: none (@local/)\n- corp/ for distributionChannel: github (@unisphere-corp/)\n- public/ for distributionChannel: npm (@unisphere/)",
426
+ "packages": {
427
+ "@unisphere/cli": {
428
+ "version": "2.4.2",
429
+ "alwaysAddToPackageJson": false
430
+ }
431
+ }
315
432
  }
316
433
  }
317
434
  }
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "2.2.2",
3
+ "version": "3.2.3",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "publishConfig": {
9
- "access": "public"
9
+ "access": "public",
10
+ "registry": "https://registry.npmjs.org/"
10
11
  },
11
12
  "repository": {
12
13
  "type": "git",
@@ -1,11 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@nx/react/babel",
5
- {
6
- "runtime": "automatic"
7
- }
8
- ]
9
- ],
10
- "plugins": []
11
- }
@@ -1,22 +0,0 @@
1
- {
2
- "extends": ["plugin:@nx/react", "../../../.eslintrc.json"],
3
- "ignorePatterns": [
4
- "!**/*",
5
- "**/vite.config.*.timestamp*",
6
- "**/vitest.config.*.timestamp*"
7
- ],
8
- "overrides": [
9
- {
10
- "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
11
- "rules": {}
12
- },
13
- {
14
- "files": ["*.ts", "*.tsx"],
15
- "rules": {}
16
- },
17
- {
18
- "files": ["*.js", "*.jsx"],
19
- "rules": {}
20
- }
21
- ]
22
- }
@@ -1,11 +0,0 @@
1
- /* eslint-disable */
2
- export default {
3
- displayName: 'admin',
4
- preset: '../../../jest.preset.js',
5
- transform: {
6
- '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
7
- '^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
8
- },
9
- moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
10
- coverageDirectory: '../../../coverage/unisphere/applications/admin',
11
- };
@@ -1,6 +0,0 @@
1
- {
2
- "name": "unisphere-application-<%= applicationName__lowerDashCase %>",
3
- "version": "1.0.0",
4
- "private": true,
5
- "dependencies": {}
6
- }
@@ -1,9 +0,0 @@
1
- {
2
- "name": "unisphere-application-<%= applicationName__lowerDashCase %>",
3
- "$schema": "../../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "unisphere/applications/<%= applicationName__lowerDashCase %>/src",
5
- "projectType": "application",
6
- "tags": [],
7
- "// targets": "to see all targets run: nx show project unisphere-application-<%= applicationName__lowerDashCase %> --web",
8
- "targets": {}
9
- }
@@ -1,212 +0,0 @@
1
- import { useContext, useState } from 'react';
2
- import { HostThemeProvider } from '@kaltura/ds-react-theme';
3
- import { Box } from '@mui/material';
4
- import { ConfigurationContext } from './configuration-provider';
5
- import { isConfigurationValid } from './definitions';
6
- import { Header } from './components/header';
7
- import { ConfigurationProvider } from './configuration-provider';
8
- import { UnisphereProvider, UnisphereRuntimeVisual } from '@unisphere/runtime-react';
9
- import { UnisphereWorkspaceConfig } from '@unisphere/runtime';
10
- import { UnisphereWorkspaceType } from '@unisphere/runtime';
11
- import { <%= runtimeName__pascalCase %>Runtime } from '<%= typesAlias %>';
12
-
13
-
14
- const Hihi: React.FC = () => {
15
- return (
16
- <div
17
- style={{
18
- display: 'flex',
19
- flexDirection: 'column',
20
- alignItems: 'center',
21
- justifyContent: 'center',
22
- height: '100vh',
23
- padding: '2rem',
24
- backgroundColor: '#f9f9f9',
25
- color: '#333',
26
- fontFamily: 'sans-serif',
27
- textAlign: 'center',
28
- }}
29
- >
30
- <h1
31
- style={{
32
- fontSize: '1.5rem',
33
- }}
34
- >
35
- Hihi :)
36
- </h1>
37
-
38
- <h2
39
- style={{
40
- fontSize: '1.0rem',
41
- marginBottom: '1rem',
42
- }}
43
- >
44
- No visuals are mounted yet
45
- </h2>
46
-
47
- <p
48
- style={{
49
- fontSize: '1rem',
50
- maxWidth: '400px',
51
- lineHeight: 1.4,
52
- marginBottom: '2rem',
53
- }}
54
- >
55
- You haven’t created a runtime visual or just didn't mount it in the Dev
56
- application. Once you add one, open{' '}
57
- <span
58
- style={{
59
- backgroundColor: '#eaeaea',
60
- padding: '0.2rem 0.4rem',
61
- borderRadius: '4px',
62
- fontFamily: 'monospace',
63
- }}
64
- >
65
- app.tsx
66
- </span>{' '}
67
- and uncomment the{' '}
68
- <span
69
- style={{
70
- backgroundColor: '#eaeaea',
71
- padding: '0.2rem 0.4rem',
72
- borderRadius: '4px',
73
- fontFamily: 'monospace',
74
- }}
75
- >
76
- &lt;UnisphereRuntimeVisual /&gt;
77
- </span>{' '}
78
- component to see it render here.
79
- </p>
80
-
81
- <pre
82
- style={{
83
- backgroundColor: '#fff',
84
- padding: '1rem',
85
- border: '1px solid #ddd',
86
- borderRadius: '4px',
87
- overflowX: 'auto',
88
- fontFamily: 'monospace',
89
- textAlign: 'left',
90
- }}
91
- >
92
- {`<UnisphereRuntimeVisual
93
- widgetName="unisphere.widget.<%= widgetName__lowerDashCase %>"
94
- runtimeName="<%= runtimeName__lowerDashCase %>"
95
- visualType="-- provide here the visual name --"
96
- visualSettings={{ }}
97
- />`}
98
- </pre>
99
- </div>
100
- );
101
- };
102
-
103
- export function AppContent() {
104
- const { configuration } = useContext(ConfigurationContext);
105
-
106
- const [workspace, setWorkspace] = useState<UnisphereWorkspaceType | null>(
107
- null
108
- );
109
- const [runtime, setRuntime] = useState<<%= runtimeName__pascalCase %>Runtime | null>(null);
110
-
111
- const [initialConfiguration] = useState<UnisphereWorkspaceConfig | null>(
112
- () => {
113
- /*
114
- Developer Note:
115
- The Dev app lets you provide runtime configuration as a JSON object that matches the same schema used in your production or staging environments.
116
-
117
- • If the runtime is already active in production or staging:
118
- 1. Open Unisphere (Cmd + K) and choose Manage Workspace Runtimes.
119
- 2. Locate your runtime, click the ••• (Actions) menu, and select Copy Settings.
120
- 3. Open the Dev app in the browser, in the header click on the settings icon and paste the JSON into the settings field.
121
- 4. Use the Save button to persist your settings. They’ll be stored in local storage and automatically loaded the next time the app runs.
122
-
123
- • If the runtime isn’t yet in use:
124
- 1. Manually create a JSON payload that conforms to your runtime’s schema.
125
- 2. Open the Dev app in the browser, in the header click on the settings icon and paste the JSON into the settings field.
126
- 3. Use the Save button to persist your settings. They’ll be stored in local storage and automatically loaded the next time the app runs.
127
- */
128
-
129
- try {
130
- if (!isConfigurationValid(configuration)) {
131
- return null;
132
- }
133
-
134
- return {
135
- appId: '<%= runtimeName__lowerDashCase %>',
136
- appVersion: '1.0.0',
137
- serverUrl: configuration.unisphereServerUrl,
138
- ui: {
139
- theme: configuration.theme,
140
- language: configuration.language,
141
- },
142
- runtimes: [
143
- {
144
- widgetName: 'unisphere.widget.<%= widgetName__lowerDashCase %>',
145
- runtimeName: '<%= runtimeName__lowerDashCase %>',
146
- settings: JSON.parse(configuration.settings),
147
- visuals: [],
148
- },
149
- ],
150
- };
151
- } catch (e) {
152
- console.error('Failed to parse settings', e);
153
- return null;
154
- }
155
- }
156
- );
157
-
158
- const onWorkspaceLoaded = (workspace: UnisphereWorkspaceType) => {
159
- setWorkspace(workspace);
160
- const runtime = workspace.getRuntime<<%= runtimeName__pascalCase %>Runtime>(
161
- 'unisphere.widget.<%= widgetName__lowerDashCase %>',
162
- '<%= runtimeName__lowerDashCase %>'
163
- );
164
- setRuntime(runtime);
165
- };
166
-
167
- return (
168
- <Box
169
- sx={{
170
- width: '100vw',
171
- height: '100vh',
172
- overflow: 'hidden',
173
- padding: '12px 24px',
174
- }}
175
- >
176
- <HostThemeProvider
177
- overrides={{
178
- mode: configuration.theme,
179
- }}
180
- >
181
- <Box sx={{ height: '100vh', width: '100vw', pt: '64px' }}>
182
- <Header />
183
- {initialConfiguration && (
184
- <UnisphereProvider
185
- onWorkspaceLoaded={onWorkspaceLoaded}
186
- initialConfiguration={initialConfiguration}
187
- >
188
- <Hihi />
189
-
190
- {/* <UnisphereRuntimeVisual
191
- widgetName="unisphere.widget.<%= widgetName__lowerDashCase %>"
192
- runtimeName="<%= runtimeName__lowerDashCase %>"
193
- visualType="-- provide here the visual name --"
194
- visualSettings={{ }}
195
- /> */}
196
- </UnisphereProvider>
197
- )}
198
- </Box>
199
- </HostThemeProvider>
200
- </Box>
201
- );
202
- }
203
-
204
- const App = () => {
205
- return (
206
- <ConfigurationProvider configurationKey="unisphere-<%= widgetName__lowerDashCase %>-<%= runtimeName__lowerDashCase %>-dev">
207
- <AppContent />
208
- </ConfigurationProvider>
209
- );
210
- };
211
-
212
- export default App;