@unisphere/nx 2.0.0 → 2.1.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 (73) hide show
  1. package/README.md +1 -164
  2. package/dist/generators/add-application/add-application.js +1 -1
  3. package/dist/generators/add-application/templates/default/package.json.template +2 -5
  4. package/dist/generators/add-application/templates/local-dev-playground/package.json +1 -0
  5. package/dist/generators/add-package/README.md +3 -3
  6. package/dist/generators/add-package/add-package.d.ts.map +1 -1
  7. package/dist/generators/add-package/add-package.js +0 -83
  8. package/dist/generators/add-package/templates/new-package/package.json.template +1 -10
  9. package/dist/generators/add-package/templates/new-package/src/index.ts.template +0 -1
  10. package/dist/generators/add-package/templates/new-package/src/lib/.keep +0 -0
  11. package/dist/generators/add-runtime/add-runtime.d.ts.map +1 -1
  12. package/dist/generators/add-runtime/add-runtime.js +6 -16
  13. package/dist/generators/add-runtime/schema.d.ts +1 -1
  14. package/dist/generators/add-runtime/schema.json +9 -9
  15. package/dist/migrations/1-22-0/check-nx-version.js +1 -1
  16. package/dist/migrations/1-22-0/replace-patches.d.ts.map +1 -1
  17. package/dist/migrations/1-22-0/replace-patches.js +20 -0
  18. package/dist/migrations/1-22-2/add-os-and-cpu.js +1 -1
  19. package/dist/migrations/1-22-2/templates/_publish-artifacts.template +28 -12
  20. package/dist/migrations/1-22-2/templates/cicd.template +1 -1
  21. package/dist/migrations/{summaries/2-0-0-summary.d.ts → 1-22-4/summary.d.ts} +1 -1
  22. package/dist/migrations/1-22-4/summary.d.ts.map +1 -0
  23. package/dist/migrations/1-22-4/summary.js +16 -0
  24. package/dist/migrations/{2-0-0/replace-patches.d.ts → 1-22-7/remove-storybook.d.ts} +1 -1
  25. package/dist/migrations/1-22-7/remove-storybook.d.ts.map +1 -0
  26. package/dist/migrations/1-22-7/remove-storybook.js +114 -0
  27. package/dist/migrations/1-22-7/update-git-ignore.d.ts +3 -0
  28. package/dist/migrations/1-22-7/update-git-ignore.d.ts.map +1 -0
  29. package/dist/migrations/1-22-7/update-git-ignore.js +55 -0
  30. package/dist/migrations/1-22-9/fix-prerelease-deploy.d.ts +3 -0
  31. package/dist/migrations/1-22-9/fix-prerelease-deploy.d.ts.map +1 -0
  32. package/dist/migrations/1-22-9/fix-prerelease-deploy.js +27 -0
  33. package/dist/migrations/1-22-9/templates/cicd.template +79 -0
  34. package/dist/migrations/1-23-0/delete-rollup-patch.d.ts +3 -0
  35. package/dist/migrations/1-23-0/delete-rollup-patch.d.ts.map +1 -0
  36. package/dist/migrations/1-23-0/delete-rollup-patch.js +14 -0
  37. package/dist/migrations/1-23-2/update-nvmrc.d.ts.map +1 -0
  38. package/dist/migrations/1-24-2/force-always-for-applications.d.ts +3 -0
  39. package/dist/migrations/1-24-2/force-always-for-applications.d.ts.map +1 -0
  40. package/dist/migrations/1-24-2/force-always-for-applications.js +36 -0
  41. package/dist/migrations/1-24-2/templates/_publish-artifacts.template +306 -0
  42. package/dist/migrations/2-0-0/summary.d.ts +2 -0
  43. package/dist/migrations/2-0-0/summary.d.ts.map +1 -0
  44. package/dist/migrations/2-0-0/summary.js +17 -0
  45. package/dist/migrations/2-1-0/remove-react-overrides.d.ts +3 -0
  46. package/dist/migrations/2-1-0/remove-react-overrides.d.ts.map +1 -0
  47. package/dist/migrations/2-1-0/remove-react-overrides.js +59 -0
  48. package/dist/migrations/2-1-0/remove-rollup-plugin-node-builtins.d.ts +3 -0
  49. package/dist/migrations/2-1-0/remove-rollup-plugin-node-builtins.d.ts.map +1 -0
  50. package/dist/migrations/2-1-0/remove-rollup-plugin-node-builtins.js +54 -0
  51. package/dist/migrations/2-1-0/remove-storybook.d.ts +3 -0
  52. package/dist/migrations/2-1-0/remove-storybook.d.ts.map +1 -0
  53. package/dist/migrations/2-1-0/remove-storybook.js +88 -0
  54. package/dist/migrations/2-1-0/replace-readme-md.d.ts +3 -0
  55. package/dist/migrations/2-1-0/replace-readme-md.d.ts.map +1 -0
  56. package/dist/migrations/2-1-0/replace-readme-md.js +50 -0
  57. package/dist/migrations/2-1-0/templates/readme.md.template +134 -0
  58. package/dist/migrations/utils/open.d.ts +2 -0
  59. package/dist/migrations/utils/open.d.ts.map +1 -0
  60. package/dist/migrations/utils/open.js +16 -0
  61. package/migrations.json +109 -20
  62. package/package.json +2 -2
  63. package/dist/migrations/2-0-0/patches/@nx+rollup+22.1.3.patch +0 -27
  64. package/dist/migrations/2-0-0/replace-patches.d.ts.map +0 -1
  65. package/dist/migrations/2-0-0/replace-patches.js +0 -56
  66. package/dist/migrations/2-0-0/update-nvmrc.d.ts.map +0 -1
  67. package/dist/migrations/summaries/1-22-4-summary.d.ts +0 -2
  68. package/dist/migrations/summaries/1-22-4-summary.d.ts.map +0 -1
  69. package/dist/migrations/summaries/1-22-4-summary.js +0 -12
  70. package/dist/migrations/summaries/2-0-0-summary.d.ts.map +0 -1
  71. package/dist/migrations/summaries/2-0-0-summary.js +0 -12
  72. /package/dist/migrations/{2-0-0 → 1-23-2}/update-nvmrc.d.ts +0 -0
  73. /package/dist/migrations/{2-0-0 → 1-23-2}/update-nvmrc.js +0 -0
package/README.md CHANGED
@@ -1,167 +1,4 @@
1
- # Getting Started with Unisphere Project
1
+ # Unisphere Workspace NX Plugin
2
2
 
3
- > This is a temporary documentation to the @unisphere/nx plugin until the official documentation is available.
4
3
 
5
- > ⚠️ **This generator is currently available only to Kaltura developers.**
6
- > It depends on internal resources such as CI/CD templates, design systems, and private NPM packages. External support for Kaltura customers is on our roadmap.
7
4
 
8
- Unisphere is Kaltura’s frontend framework for building dynamic, composable experiences. A **Unisphere project** is a structured repository that allows developers to create and organize **applications**, **runtimes**, and **packages** under a single cohesive experience. This setup encourages healthy module separation, runtime decoupling, reusability, and clean ownership boundaries — all key ingredients for scaling product development in a multi-team environment.
9
-
10
- Whether you're building a full application like _Content Lab_ or a lightweight widget like _Chat_, Unisphere gives you the tooling and conventions to do it the right way from the start.
11
-
12
- ## Step 1 - Create a New Unisphere Project
13
-
14
- Before creating a new Unisphere project, make sure you have a valid `GITHUB_TOKEN` exported in your environment. This is required for GitHub operations during setup.
15
-
16
- To scaffold a new project you can use [create-unisphere-project](https://www.npmjs.com/package/create-unisphere-project) npm package with all necessary tooling and structure, run:
17
-
18
- ```bash
19
- npm create unisphere-project@latest
20
- ```
21
-
22
- ### Set Up the GitHub Repository
23
-
24
- Once the project is generated locally, you’ll need to create a new GitHub repository so that CI/CD can operate correctly and your team has proper access.
25
-
26
- Please contact **Eran Sakal** or **Omri Ceisler** to provision the repository. The following steps will be completed as part of this process:
27
-
28
- 1. **Repository Creation**
29
- The new repo will be created with **internal scope** and named according to this convention:
30
-
31
- ```
32
- unisphere-{friendly-experience-name}
33
- ```
34
-
35
- The friendly name is derived from your declared experience name (e.g., `unisphere.widget.reactions` → `reactions` → `unisphere-reactions` as the repository name).
36
-
37
- 2. **Team Access Configuration**
38
- The appropriate GitHub teams will be granted access to the repository to match the experience's ownership and collaboration needs.
39
-
40
- 3. **CI/CD Enablement**
41
- These steps are required to ensure that CI/CD workflows are automatically triggered for builds, deployments, versioning, and testing.
42
-
43
- Once created, you can push your local project into the new repository and begin active development.
44
-
45
- ---
46
-
47
- ## Step 2 - Use the `@unisphere/nx` Plugin
48
-
49
- After your project is set up, you’ll use the `@unisphere/nx` plugin to generate and manage your project’s core elements. All generators are interactive and designed to enforce Unisphere best practices and conventions.
50
-
51
- All generators support interactive usage through `nx g` and prompt you for the correct configuration.
52
-
53
- ### 🧹 `add-runtime`
54
-
55
- Creates a new **runtime**, one of the possible entry points into an experience. Runtimes define **where** and **how** a specific part of the experience is used.
56
-
57
- For example, in the **Genie experience**, there's a runtime called **page** used when the host injects the experience into the main body of a site, and another called **player-plugin** for injecting it into a player drawer. We have additional runtimes, one for each tool that is used by the experience, e.g **flashcards-tool**, **source-tool**, **follow-up-tool** etc.
58
-
59
- Naming your runtime based on its integration point helps communicate its purpose and role clearly.
60
-
61
- ```bash
62
- npx nx g @unisphere/nx:add-runtime
63
- ```
64
-
65
- #### Prompts
66
-
67
- - **Runtime name** – e.g., `page`, `player-plugin`, `flashcards-tool`, `source-tool`, `follow-up-tool`, `content-lab-drawer`.
68
-
69
- - **How will this runtime be used?**
70
-
71
- - **Loaded by External Host**u
72
-
73
- - Deployed independently and loaded at runtime
74
-
75
- - **Embedded in Widget Playground**
76
- - Composed by other runtimes, no standalone deployment
77
-
78
- - **How will this runtime be used?**
79
-
80
- - **Independent experience used as an entry point (loaded by host or another experience)**
81
-
82
- - Includes an Dev playground application for developing and simulating a host environment
83
-
84
- - **Composed into another runtime of this experience (not used as an entry point)**
85
-
86
- - Composed by another runtime within the same experience
87
-
88
- - Assume it is developed using a playground dev application of another runtime in the project
89
-
90
- ### 🎨 `add-visual`
91
-
92
- Creates a **visual component** within a runtime — the building blocks of your UI.
93
-
94
- ```bash
95
- npx nx g @unisphere/nx:add-visual
96
- ```
97
-
98
- #### Prompts
99
-
100
- - **Runtime name** – Where this visual belongs
101
- - **Visual name** – e.g., `card`, `toolbar`, `timeline-visual`
102
- - **Is this visual limited to a single occurrence?**
103
- Choose `Yes` for singleton visuals (e.g., when the visual represent a container that can only have one instance), otherwise `No`.
104
-
105
- ### 📱 `add-application`
106
-
107
- Creates an **application** that acts as a host for your runtime(s). These apps can be used for development, standalone deployments, or iframe integrations. The application can be used as a playground for developing and simulating a host environment without the need to deploy the experience to a customer, or it can be an additional entry point for the experience and use the Unisphere ci/cd to be publically available in multi region environments.
108
-
109
- ```bash
110
- npx nx g @unisphere/nx:add-application
111
- ```
112
-
113
- #### Prompts
114
-
115
- - **Application name**
116
-
117
- - **Serving type**
118
-
119
- - **Local Dev Playground** – Local development playground (for development and testing)
120
- - **Self-Hosted** – Standalone deployment with routing/auth (used for publically available applications)
121
- - **Iframe + Query Params** – Embedded apps with config in URL (used for embedding into other applications like Kaltura Admin or KMC)
122
- - **Iframe + Post Messages** – Embedded apps using `postMessage` API (used for embedding into other applications like Kaltura Admin or KMC) - this will replace eventually the query param method to be more secure and reliable but is not yet available.
123
-
124
- - **Runtime to load in playground** (if Playground selected)
125
-
126
- - **HTML page title** (if not using Playground)
127
-
128
- ### 📦 `add-package`
129
-
130
- Creates a shared **package** for separating concerns within an experience. Most of the actual code in a Unisphere project lives in packages — not in runtimes — making it easier to reuse components, services, and logic across multiple entry points. These packages are usually not distributed externally but serve as internal modules consumed by runtimes.
131
-
132
- By using packages this way, you can introduce multiple runtimes (e.g., page, player-plugin, admin-panel) that share the same functionality while remaining decoupled.
133
-
134
- Some packages, however, are designed for external consumption. For example:
135
-
136
- - Each experience has a `Core` package expose the types needed for runtime integration.
137
- - Differetn `kit` packages act as extendable, design-system-driven building blocks that allow other teams to plug into your experience in a consistent and styled way.
138
-
139
- Packages can be published to GitHub or npm, but in most cases, they serve as a clean internal abstraction layer inside the experience repository without being deployed.
140
-
141
- ```bash
142
- npx nx g @unisphere/nx:add-package
143
- ```
144
-
145
- #### Prompts
146
-
147
- - **Package name**
148
- - **Package scope**
149
-
150
- - **None (no scope)** - Used only internally by the experience runtimes.
151
- - **Internal** - Published to GitHub packages (`@kaltura/unisphere-<experience-name>-<package-name>`)
152
- - **Public** - Published to npm (`@unisphere/<experience-name>-<package-name>`)
153
-
154
- ## Best Practices
155
-
156
- 🧠 Use descriptive names that reflect the purpose of the runtime or visual. For example, use `player-plugin` for a runtime that integrates into a video player, or `container` for visual that represent a container that can only have one instance, or `drawer` if it is a drawer runtime.
157
-
158
- 🎯 Select the correct runtime type depending on the deployment context. Choose "Independent experience" if the runtime will be loaded by a host or standalone app, and "Composed into another runtime" if it will only exist as part of a larger experience.
159
-
160
- ♻️ Share logic and components using packages. Most Unisphere code lives in packages rather than runtimes. This promotes reusability and modularity — for instance, content-lab-drawer and content-lab-modal runtimes may reuse the same internal package. Use the non scoped package if you are not sure what to choose.
161
-
162
- 🔍 Use the interactive CLI mode to generate all project elements. This ensures naming consistency, correct scaffolding, and alignment with Unisphere conventions.
163
-
164
- ## What’s Next?
165
-
166
- Stay tuned for full documentation on each concept and tool at
167
- **[unisphere.kaltura.com](https://unisphere.kaltura.com)** _(coming soon)_
@@ -113,7 +113,7 @@ async function addApplicationGenerator(tree, options) {
113
113
  (0, devkit_1.generateFiles)(tree, path.join(__dirname, templatePath), projectRoot, templateVariables);
114
114
  // Install selected dependencies
115
115
  (0, dependency_config_1.installSelectedDependencies)(tree, selectedDependencies);
116
- const distributionChannel = options.servingType !== 'local-dev-playground' ? 'none' : 'unisphere';
116
+ const distributionChannel = options.servingType === 'local-dev-playground' ? 'none' : 'unisphere';
117
117
  // Update .unisphere configuration
118
118
  (0, utils_1.updateUnisphereConfig)(tree, 'applications', userInputApplicationName, {
119
119
  sourceRoot: `unisphere/applications/${userInputApplicationName}`,
@@ -1,8 +1,5 @@
1
1
  {
2
2
  "name": "unisphere-application-<%= applicationName__lowerDashCase %>",
3
- "version": "1.0.0",
4
- "private": true,
5
- "dependencies": {
6
-
7
- }
3
+ "version": "1.0.0",
4
+ "dependencies": {}
8
5
  }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "unisphere-application-<%= applicationName__lowerDashCase %>",
3
3
  "version": "1.0.0",
4
+ "private": true,
4
5
  "dependencies": {}
5
6
  }
@@ -50,7 +50,7 @@ After packaging, install in your target repository:
50
50
 
51
51
  ```bash
52
52
  # Install the generated package
53
- npm install --save-dev path/to/unisphere-nx-workspace-plugin-unisphere-generator-0.0.1.tgz
53
+ npm install --save-dev path/to/unisphere-nx-unisphere-generator-0.0.1.tgz
54
54
 
55
55
  # Use the generator
56
56
  npx nx g @unisphere/nx:add-package
@@ -61,10 +61,10 @@ npx nx g @unisphere/nx:add-package
61
61
  1. **Direct file path** (for development):
62
62
 
63
63
  ```bash
64
- npm install --save-dev file:../path/to/unisphere-nx-workspace-plugin/unisphere-generator
64
+ npm install --save-dev file:../path/to/unisphere-nx/unisphere-generator
65
65
  ```
66
66
 
67
67
  2. **Using npx directly**:
68
68
  ```bash
69
- npx --package file:../unisphere-nx-workspace-plugin/unisphere-generator nx g @unisphere/nx:add-package
69
+ npx --package file:../unisphere-nx/unisphere-generator nx g @unisphere/nx:add-package
70
70
  ```
@@ -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,EAA2B,MAAM,YAAY,CAAC;AAEvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAyJrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBAgInC;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;AA6DrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBA8HnC;AAED,eAAe,mBAAmB,CAAC"}
@@ -36,88 +36,6 @@ function resolveUnisphereRuntimeVersion(tree) {
36
36
  return defaultVersion;
37
37
  }
38
38
  }
39
- function generateDemoComponent(tree, projectRoot, vars) {
40
- // path: packages/<pkg>/src/lib/panel-demo.tsx
41
- const targetPath = `${projectRoot}/src/lib/${vars['packageName__lowerDashCase']}-demo.tsx`;
42
- // component and logger names
43
- const loggerName = `${vars['packageName__lowerDashCase']}-demo`;
44
- const demoName = `${vars['packageName__pascalCase']}Demo`;
45
- let content;
46
- if (demoName.includes('react')) {
47
- content = `import { useContext, useEffect } from 'react';
48
- import {
49
- ScopedUnisphereWorkspaceContext,
50
- useGetScopedWorkspaceLogger,
51
- } from '@unisphere/runtime-react';
52
-
53
- const Hihi = () => {
54
- return (
55
- <div
56
- style={{
57
- border: '2px dashed #888',
58
- borderRadius: '8px',
59
- padding: '2rem',
60
- margin: '2rem auto',
61
- maxWidth: '500px',
62
- textAlign: 'center',
63
- fontFamily: 'sans-serif',
64
- color: '#444',
65
- backgroundColor: '#fcfcfc',
66
- }}
67
- >
68
- <h2
69
- style={{
70
- marginBottom: '1rem',
71
- fontSize: '1.25rem',
72
- fontWeight: 500,
73
- }}
74
- >
75
- Hihi :)
76
- </h2>
77
- <p
78
- style={{
79
- lineHeight: 1.5,
80
- marginBottom: '1.5rem',
81
- fontSize: '1rem',
82
- }}
83
- >
84
- This '${demoName}' component shows you how to connect with the Unisphere workspace and set up a scoped logger.
85
- </p>
86
- </div>
87
- );
88
- };
89
-
90
- export const ${demoName} = () => {
91
- const { unisphereWorkspace } = useContext(ScopedUnisphereWorkspaceContext);
92
- const logger = useGetScopedWorkspaceLogger({
93
- type: 'react',
94
- name: '${loggerName}',
95
- });
96
-
97
- useEffect(() => {
98
- // example only - feel free to remove
99
- logger?.log('${loggerName} mounted');
100
- return () => {
101
- logger?.log('${loggerName} unmounted');
102
- };
103
- }, []);
104
-
105
- useEffect(() => {
106
- if (!unisphereWorkspace) return;
107
-
108
- // you can access the unisphere workspace that renders the runtime this component is mounted in
109
- }, [unisphereWorkspace]);
110
-
111
- // render your visual
112
- return <Hihi />;
113
- };
114
- `;
115
- }
116
- else {
117
- content = `export const ${demoName} = {}`;
118
- }
119
- tree.write(targetPath, content);
120
- }
121
39
  async function addPackageGenerator(tree, options) {
122
40
  // Validate and read .unisphere configuration
123
41
  const unisphereConfig = (0, utils_1.validateUnisphereConfig)(tree);
@@ -194,7 +112,6 @@ async function addPackageGenerator(tree, options) {
194
112
  });
195
113
  // Update tsconfig.base.json with path mapping
196
114
  (0, utils_1.updateTsConfigPaths)(tree, packageJsonName, `unisphere/packages/${userInputPackageName}/src/index.ts`);
197
- generateDemoComponent(tree, projectRoot, templateVariables);
198
115
  // Install selected dependencies
199
116
  (0, dependency_config_1.installSelectedDependencies)(tree, selectedDependencies);
200
117
  await (0, devkit_1.formatFiles)(tree);
@@ -9,14 +9,5 @@
9
9
  "url": "<%= githubUrl %>"
10
10
  },
11
11
  "types": "./index.esm.d.ts",
12
- "dependencies": {
13
- "@unisphere/runtime": "<%= unisphereRuntimeVersion %>"
14
- },
15
- "publishConfig": {
16
- <% if (distributionChannel === 'github') { %>
17
- "registry": "https://npm.pkg.github.com"
18
- <% } else if (distributionChannel === 'npm') { %>
19
- "registry": "https://registry.npmjs.org"
20
- <% } %>
21
- }
12
+ "dependencies": {}
22
13
  }
@@ -1 +0,0 @@
1
- export * from './lib/<%= packageName__lowerDashCase %>-demo';
@@ -1 +1 @@
1
- {"version":3,"file":"add-runtime.d.ts","sourceRoot":"","sources":["../../../src/generators/add-runtime/add-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAiB,MAAM,YAAY,CAAC;AAE7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AA6CrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBAwInC;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"add-runtime.d.ts","sourceRoot":"","sources":["../../../src/generators/add-runtime/add-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAiB,MAAM,YAAY,CAAC;AAE7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AA4CrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBAyHnC;AAED,eAAe,mBAAmB,CAAC"}
@@ -26,8 +26,8 @@ function updateTypesIndexExport(tree, runtimeName, basePath) {
26
26
  tree.write(indexPath, updatedContent);
27
27
  }
28
28
  async function addRuntimeGenerator(tree, options) {
29
- // Normalize standalone option - Nx list prompts may return string labels instead of boolean values
30
- let isStandalone = options?.standalone === 'yes' ? true : false;
29
+ // Normalize consumer option - Nx list prompts may return string labels instead of boolean values
30
+ let isExternal = options?.consumer === 'external' ? true : false;
31
31
  // Validate and read .unisphere configuration
32
32
  const unisphereConfig = (0, utils_1.validateUnisphereConfig)(tree);
33
33
  // Validate dependencies
@@ -38,7 +38,6 @@ async function addRuntimeGenerator(tree, options) {
38
38
  const widgetName = unisphereConfig.name;
39
39
  // Validate and correct runtime naming for React/DS dependencies
40
40
  let userInputRuntimeName = (0, devkit_1.names)(options.name).fileName;
41
- userInputRuntimeName = (0, dependency_config_1.validateReactNaming)(userInputRuntimeName, selectedDependencies);
42
41
  // Find types package (or fallback to core)
43
42
  const typesPackageInfo = (0, utils_1.findTypesOrCorePackageInfo)(tree);
44
43
  // Prepare template variables
@@ -78,17 +77,8 @@ async function addRuntimeGenerator(tree, options) {
78
77
  const runtimePathKey = `unisphere-runtime-${userInputRuntimeName}`;
79
78
  const runtimePathValue = `unisphere/runtimes/${userInputRuntimeName}/src/index.ts`;
80
79
  (0, utils_1.updateTsConfigPaths)(tree, runtimePathKey, runtimePathValue);
81
- // // Create a package with the same name as the runtime and distribution set to none
82
- // const packageResult = await addPackageGenerator(tree, {
83
- // packageName: userInputRuntimeName,
84
- // scope: 'none',
85
- // });
86
- // // Execute the package generation callback if it exists
87
- // if (packageResult && typeof packageResult === 'function') {
88
- // packageResult();
89
- // }
90
- // Handle standalone usage - create dev application
91
- if (isStandalone === true) {
80
+ // Handle internal usage - create dev application
81
+ if (!!isExternal) {
92
82
  // Create a dev application without prompts
93
83
  const applicationResult = await (0, add_application_1.addApplicationGenerator)(tree, {
94
84
  name: `${userInputRuntimeName}-dev`,
@@ -111,8 +101,8 @@ async function addRuntimeGenerator(tree, options) {
111
101
  devkit_1.logger.info('');
112
102
  devkit_1.logger.info(`🚀 Runtime Name: ${userInputRuntimeName}`);
113
103
  devkit_1.logger.info(`📁 Location: ${projectRoot}`);
114
- devkit_1.logger.info(`🔧 Standalone: ${isStandalone ? 'Yes' : 'No'}`);
115
- if (isStandalone === true) {
104
+ devkit_1.logger.info(`🔧 Consumer: ${isExternal ? 'External' : 'Internal'}`);
105
+ if (isExternal === true) {
116
106
  devkit_1.logger.info('');
117
107
  devkit_1.logger.info('📦 Additional components created:');
118
108
  devkit_1.logger.info(` • Dev Application: ${userInputRuntimeName}-dev`);
@@ -1,5 +1,5 @@
1
1
  export interface AddRuntimeGeneratorSchema {
2
2
  name: string;
3
- standalone: string;
3
+ consumer: string;
4
4
  dependencies?: string[];
5
5
  }
@@ -10,20 +10,20 @@
10
10
  "pattern": "^[a-zA-Z][a-zA-Z0-9\\-\\s]*$",
11
11
  "x-prompt": "What's the runtime name? (letters, numbers, dashes and spaces allowed)"
12
12
  },
13
- "standalone": {
13
+ "consumer": {
14
14
  "type": "string",
15
- "description": "Is this experience being loaded by the host application, or by another experience (not this one)?",
15
+ "description": "Is this runtime loaded from within the same experience or by an external consumer?",
16
16
  "x-prompt": {
17
- "message": "Is this experience being loaded by the host application, or by another experience (not this one)?",
17
+ "message": "Is this runtime loaded from within the same experience or by an external consumer?",
18
18
  "type": "list",
19
19
  "items": [
20
20
  {
21
- "value": "yes",
22
- "label": "Yes -loaded by host application"
21
+ "value": "external",
22
+ "label": "Loaded by an external consumer"
23
23
  },
24
24
  {
25
- "value": "no",
26
- "label": "No - loaded by another experience"
25
+ "value": "internal",
26
+ "label": "Loaded by another runtime or application within this experience"
27
27
  }
28
28
  ]
29
29
  }
@@ -63,6 +63,6 @@
63
63
  },
64
64
  "required": [
65
65
  "name",
66
- "standalone"
66
+ "consumer"
67
67
  ]
68
- }
68
+ }
@@ -12,7 +12,7 @@ function checkNxVersion(tree) {
12
12
  }
13
13
  const majorVersion = parseInt(nxVersion.match(/\d+/)?.[0] ?? '0');
14
14
  if (majorVersion < 22) {
15
- const errorMessage = `❌ This migration requires Nx 22 or higher. read https://unisphere.kaltura.com/docs/create/changelog/1-22-4-changelog`;
15
+ const errorMessage = `❌ This migration requires Nx 22 or higher. read https://unisphere.kaltura.com/docs/create/changelog/1-22-7-changelog`;
16
16
  devkit_1.logger.error(errorMessage);
17
17
  throw new Error(errorMessage);
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"replace-patches.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-0/replace-patches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAyB,MAAM,YAAY,CAAC;AAKzD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC9D"}
1
+ {"version":3,"file":"replace-patches.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-0/replace-patches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmC,MAAM,YAAY,CAAC;AAQnE,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAwD9D"}
@@ -4,9 +4,24 @@ exports.default = update;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const path_1 = require("path");
6
6
  const removePatchList = ['@changesets+cli'];
7
+ const forcePatchVersions = {
8
+ '@changesets/cli': '2.29.7'
9
+ };
7
10
  async function update(tree) {
8
11
  devkit_1.logger.info('🔄 Creating patches');
9
12
  try {
13
+ // Check @nx/rollup version
14
+ if (Object.keys(forcePatchVersions).length !== 0) {
15
+ devkit_1.logger.info('removing patches of older versions');
16
+ const pkg = (0, devkit_1.readJson)(tree, 'package.json');
17
+ Object.keys(forcePatchVersions).forEach(key => {
18
+ const version = pkg.devDependencies?.[key] || pkg.dependencies?.[key];
19
+ if (version !== forcePatchVersions[key]) {
20
+ devkit_1.logger.error(`❌ ${key} version must be exactly ${forcePatchVersions[key]}`);
21
+ throw new Error(`${key} version must be exactly ${forcePatchVersions[key]}. did you migrate nx to other version?`);
22
+ }
23
+ });
24
+ }
10
25
  // Create patches
11
26
  const patchesPath = 'patches';
12
27
  const patchesTemplatePath = (0, path_1.join)(__dirname, 'patches');
@@ -26,6 +41,11 @@ async function update(tree) {
26
41
  }
27
42
  // Copy all patch files using generateFiles
28
43
  (0, devkit_1.generateFiles)(tree, patchesTemplatePath, `./${patchesPath}`, {});
44
+ // Log created patches
45
+ const createdPatches = tree.children(patchesPath);
46
+ for (const patchFile of createdPatches) {
47
+ devkit_1.logger.info(`✅ Created patch: ${patchFile}`);
48
+ }
29
49
  // Always log that patches were created
30
50
  devkit_1.logger.info(`✅ All patches created successfully`);
31
51
  }
@@ -9,7 +9,7 @@ async function update(tree) {
9
9
  json.os = [
10
10
  "darwin",
11
11
  "linux",
12
- "windows"
12
+ "win32"
13
13
  ];
14
14
  json.cpu = [
15
15
  "x64",
@@ -12,7 +12,7 @@ jobs:
12
12
  has_applications: ${{ steps.check.outputs.has_applications }}
13
13
  steps:
14
14
  - name: Checkout Repo
15
- uses: actions/checkout@v3
15
+ uses: actions/checkout@v4
16
16
  with:
17
17
  ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
18
18
  fetch-tags: true
@@ -58,7 +58,7 @@ jobs:
58
58
  commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
59
59
  steps:
60
60
  - name: Checkout Repo
61
- uses: actions/checkout@v3
61
+ uses: actions/checkout@v4
62
62
  with:
63
63
  ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
64
64
  fetch-tags: true
@@ -107,14 +107,14 @@ jobs:
107
107
  runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
108
108
  steps:
109
109
  - name: Checkout Repo
110
- uses: actions/checkout@v3
110
+ uses: actions/checkout@v4
111
111
  with:
112
112
  ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
113
113
  fetch-tags: true
114
114
  - name: Setup Node.js
115
115
  uses: actions/setup-node@v4
116
116
  with:
117
- node-version: 20
117
+ node-version-file: '.nvmrc'
118
118
 
119
119
  - name: Setup JFrog
120
120
  uses: jfrog/setup-jfrog-cli@v4
@@ -140,7 +140,7 @@ jobs:
140
140
  # Debug token existence (safely)
141
141
  echo "::debug::Token exists: $([ ! -z "$NPM_TOKEN" ] && echo 'true' || echo 'false')"
142
142
  - name: Deploy to registry
143
- run: npx unisphere package publish --verbose --githubToken ${{ secrets.GITHUB_TOKEN }} --jfrogToken ${{ steps.setup-jfrog.outputs.oidc-token }} --npmToken ${{ env.NPM_TOKEN }} --branch "${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}"
143
+ run: npx unisphere package publish --verbose --githubToken ${{ secrets.GITHUB_TOKEN }} --npmToken ${{ env.NPM_TOKEN }} --branch "${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}"
144
144
 
145
145
  deploy-runtimes:
146
146
  if: needs.prepare-runtimes.outputs.hasArtifacts == 'true'
@@ -162,14 +162,14 @@ jobs:
162
162
  - name: Check available disk space
163
163
  run: df -h
164
164
  - name: Checkout Repo at specific commit
165
- uses: actions/checkout@v3
165
+ uses: actions/checkout@v4
166
166
  with:
167
167
  ref: ${{ needs.prepare-runtimes.outputs.commit_sha }}
168
168
  fetch-tags: true
169
169
  - name: Setup Node.js
170
170
  uses: actions/setup-node@v4
171
171
  with:
172
- node-version: 20
172
+ node-version-file: '.nvmrc'
173
173
 
174
174
  - name: Setup JFrog
175
175
  uses: jfrog/setup-jfrog-cli@v4
@@ -212,7 +212,7 @@ jobs:
212
212
  commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
213
213
  steps:
214
214
  - name: Checkout Repo
215
- uses: actions/checkout@v3
215
+ uses: actions/checkout@v4
216
216
  with:
217
217
  ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
218
218
  fetch-tags: true
@@ -224,10 +224,18 @@ jobs:
224
224
  run: git reset --hard HEAD
225
225
  - name: Clean npm cache
226
226
  run: npm cache clean --force
227
+ - name: Setup JFrog
228
+ uses: jfrog/setup-jfrog-cli@v4
229
+ id: setup-jfrog
230
+ env:
231
+ JF_URL: https://kalturaa.jfrog.io
232
+ with:
233
+ oidc-provider-name: ovp-github-oidc
227
234
  - name: Install dependencies
228
- run: npm ci --ignore-scripts
235
+ run: npm ci --ignore-scripts
229
236
  env:
230
237
  GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
238
+ KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
231
239
  - name: Prepare Unisphere Applications
232
240
  id: prepare-applications
233
241
  run: npx unisphere application publish prepare --verbose
@@ -263,18 +271,26 @@ jobs:
263
271
  fail-fast: false
264
272
  steps:
265
273
  - name: Checkout Repo at specific commit
266
- uses: actions/checkout@v3
274
+ uses: actions/checkout@v4
267
275
  with:
268
276
  ref: ${{ needs.prepare-applications.outputs.commit_sha }}
269
277
  fetch-tags: true
270
278
  - name: Setup Node.js
271
279
  uses: actions/setup-node@v4
272
280
  with:
273
- node-version: 20
281
+ node-version-file: '.nvmrc'
282
+ - name: Setup JFrog
283
+ uses: jfrog/setup-jfrog-cli@v4
284
+ id: setup-jfrog
285
+ env:
286
+ JF_URL: https://kalturaa.jfrog.io
287
+ with:
288
+ oidc-provider-name: ovp-github-oidc
274
289
  - name: Install dependencies
275
- run: npm ci --ignore-scripts
290
+ run: npm ci --ignore-scripts
276
291
  env:
277
292
  GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
293
+ KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
278
294
  - name: Download artifacts folder
279
295
  uses: actions/download-artifact@v4
280
296
  with:
@@ -9,7 +9,7 @@ on:
9
9
  permissions:
10
10
  id-token: write
11
11
  contents: write
12
- packages: read
12
+ packages: write
13
13
 
14
14
  jobs:
15
15
  release:
@@ -1,2 +1,2 @@
1
1
  export default function (): Promise<void>;
2
- //# sourceMappingURL=2-0-0-summary.d.ts.map
2
+ //# sourceMappingURL=summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-4/summary.ts"],"names":[],"mappings":"AAIA,0CAUC"}