@unisphere/nx 2.2.2 → 3.2.4

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 (133) hide show
  1. package/dist/generators/add-application/add-application.d.ts.map +1 -1
  2. package/dist/generators/add-application/add-application.js +186 -63
  3. package/dist/generators/add-application/schema.d.ts +3 -1
  4. package/dist/generators/add-application/schema.json +8 -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 +47 -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/3-1-0/fix-workspaces-pattern.d.ts +23 -0
  100. package/dist/migrations/3-1-0/fix-workspaces-pattern.d.ts.map +1 -0
  101. package/dist/migrations/3-1-0/fix-workspaces-pattern.js +72 -0
  102. package/dist/migrations/utils/has-react-dependency.d.ts +14 -0
  103. package/dist/migrations/utils/has-react-dependency.d.ts.map +1 -0
  104. package/dist/migrations/utils/has-react-dependency.js +72 -0
  105. package/dist/shared.d.ts +6 -0
  106. package/dist/shared.d.ts.map +1 -0
  107. package/dist/shared.js +9 -0
  108. package/generators.json +12 -1
  109. package/migrations.json +125 -0
  110. package/package.json +3 -2
  111. package/dist/generators/add-application/templates/local-dev-playground/.babelrc +0 -11
  112. package/dist/generators/add-application/templates/local-dev-playground/.eslintrc.json +0 -22
  113. package/dist/generators/add-application/templates/local-dev-playground/jest.config.ts +0 -11
  114. package/dist/generators/add-application/templates/local-dev-playground/package.json +0 -6
  115. package/dist/generators/add-application/templates/local-dev-playground/project.json +0 -9
  116. package/dist/generators/add-application/templates/local-dev-playground/src/app/app.tsx.template +0 -212
  117. package/dist/generators/add-application/templates/local-dev-playground/src/app/components/header.tsx.template +0 -123
  118. package/dist/generators/add-application/templates/local-dev-playground/src/app/components/settings-buttons.tsx +0 -57
  119. package/dist/generators/add-application/templates/local-dev-playground/src/app/components/settings-form.tsx +0 -108
  120. package/dist/generators/add-application/templates/local-dev-playground/src/app/components/settings.tsx +0 -74
  121. package/dist/generators/add-application/templates/local-dev-playground/src/app/configuration-provider.tsx +0 -163
  122. package/dist/generators/add-application/templates/local-dev-playground/src/app/definitions.ts +0 -25
  123. package/dist/generators/add-application/templates/local-dev-playground/src/app/utils/merge-deep.ts +0 -31
  124. package/dist/generators/add-application/templates/local-dev-playground/src/favicon.ico +0 -0
  125. package/dist/generators/add-application/templates/local-dev-playground/src/index.html +0 -17
  126. package/dist/generators/add-application/templates/local-dev-playground/src/main.tsx +0 -13
  127. package/dist/generators/add-application/templates/local-dev-playground/src/styles.css +0 -0
  128. package/dist/generators/add-application/templates/local-dev-playground/tsconfig.app.json +0 -24
  129. package/dist/generators/add-application/templates/local-dev-playground/tsconfig.json +0 -20
  130. package/dist/generators/add-application/templates/local-dev-playground/tsconfig.spec.json +0 -25
  131. package/dist/generators/add-application/templates/local-dev-playground/webpack.config.js +0 -33
  132. /package/dist/generators/add-runtime/templates/{core-templates → types-templates}/__runtimeName__-runtime/index.ts.template +0 -0
  133. /package/dist/generators/add-runtime/templates/{core-templates → types-templates}/__runtimeName__-runtime/runtime-types.ts.template +0 -0
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = update;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const fs_1 = require("fs");
6
+ const path_1 = require("path");
7
+ async function update(tree) {
8
+ devkit_1.logger.info('🔄 Updating GitHub workflows for v3.0.0');
9
+ // Ensure .github/workflows directory exists
10
+ if (!tree.exists('.github')) {
11
+ tree.write('.github/.gitkeep', '');
12
+ devkit_1.logger.info('✅ Created .github directory');
13
+ }
14
+ if (!tree.exists('.github/workflows')) {
15
+ tree.write('.github/workflows/.gitkeep', '');
16
+ devkit_1.logger.info('✅ Created .github/workflows directory');
17
+ }
18
+ try {
19
+ // Update cicd.yml
20
+ const cicdWorkflowPath = '.github/workflows/cicd.yml';
21
+ const cicdTemplatePath = (0, path_1.join)(__dirname, 'templates', 'cicd.template');
22
+ const cicdTemplateContent = (0, fs_1.readFileSync)(cicdTemplatePath, 'utf-8');
23
+ const cicdExists = tree.exists(cicdWorkflowPath);
24
+ tree.write(cicdWorkflowPath, cicdTemplateContent);
25
+ if (cicdExists) {
26
+ devkit_1.logger.info(`✅ Updated ${cicdWorkflowPath}`);
27
+ }
28
+ else {
29
+ devkit_1.logger.info(`✅ Created ${cicdWorkflowPath}`);
30
+ }
31
+ // Update _publish-artifacts.yml
32
+ const publishArtifactsWorkflowPath = '.github/workflows/_publish-artifacts.yml';
33
+ const publishArtifactsTemplatePath = (0, path_1.join)(__dirname, 'templates', '_publish-artifacts.template');
34
+ const publishArtifactsTemplateContent = (0, fs_1.readFileSync)(publishArtifactsTemplatePath, 'utf-8');
35
+ const publishArtifactsExists = tree.exists(publishArtifactsWorkflowPath);
36
+ tree.write(publishArtifactsWorkflowPath, publishArtifactsTemplateContent);
37
+ if (publishArtifactsExists) {
38
+ devkit_1.logger.info(`✅ Updated ${publishArtifactsWorkflowPath}`);
39
+ }
40
+ else {
41
+ devkit_1.logger.info(`✅ Created ${publishArtifactsWorkflowPath}`);
42
+ }
43
+ }
44
+ catch (error) {
45
+ devkit_1.logger.error(`❌ Failed to update GitHub workflows: ${error?.message || 'Unknown error'}`);
46
+ throw error;
47
+ }
48
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Migration: Sync package-lock.json
3
+ *
4
+ * Runs npm install after all migrations are complete to ensure
5
+ * the lockfile is in sync with any package reorganization changes.
6
+ * This must be the last migration in the 3.0.0 sequence.
7
+ */
8
+ import { Tree } from '@nx/devkit';
9
+ export default function update(tree: Tree): Promise<() => void>;
10
+ //# sourceMappingURL=sync-package-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-package-lock.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/sync-package-lock.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAG1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAYpE"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /**
3
+ * Migration: Sync package-lock.json
4
+ *
5
+ * Runs npm install after all migrations are complete to ensure
6
+ * the lockfile is in sync with any package reorganization changes.
7
+ * This must be the last migration in the 3.0.0 sequence.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.default = update;
11
+ const devkit_1 = require("@nx/devkit");
12
+ const child_process_1 = require("child_process");
13
+ async function update(tree) {
14
+ return () => {
15
+ devkit_1.logger.info('');
16
+ devkit_1.logger.info('Syncing package-lock.json...');
17
+ try {
18
+ (0, child_process_1.execSync)('npm install', { stdio: 'inherit' });
19
+ devkit_1.logger.info('package-lock.json synced successfully');
20
+ }
21
+ catch (error) {
22
+ devkit_1.logger.error(`Failed to sync package-lock.json: ${error}`);
23
+ throw error;
24
+ }
25
+ };
26
+ }
@@ -0,0 +1,363 @@
1
+ name: Shared Deployment Jobs
2
+
3
+ on:
4
+ workflow_call:
5
+
6
+ jobs:
7
+ check-elements:
8
+ runs-on:
9
+ - codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
10
+ - instance-size:small
11
+ outputs:
12
+ has_packages: ${{ steps.check.outputs.has_packages }}
13
+ has_runtimes: ${{ steps.check.outputs.has_runtimes }}
14
+ has_applications: ${{ steps.check.outputs.has_applications }}
15
+ steps:
16
+
17
+ - name: Checkout Repo
18
+ uses: actions/checkout@v4
19
+ with:
20
+ ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
21
+ fetch-tags: true
22
+
23
+ - name: Check elements in .unisphere
24
+ id: check
25
+ run: |
26
+ if [ -f .unisphere ]; then
27
+ PACKAGES=$(jq -r '.elements.packages // {} | length' .unisphere)
28
+ RUNTIMES=$(jq -r '(.elements.runtimes // {} | length) + (.elements.workspace // {} | length) + (.elements.loader // {} | length)' .unisphere)
29
+ APPLICATIONS=$(jq -r '.elements.applications // {} | length' .unisphere)
30
+
31
+ if [ "$PACKAGES" -gt 0 ]; then
32
+ echo "has_packages=true" >> $GITHUB_OUTPUT
33
+ else
34
+ echo "has_packages=false" >> $GITHUB_OUTPUT
35
+ fi
36
+
37
+ if [ "$RUNTIMES" -gt 0 ]; then
38
+ echo "has_runtimes=true" >> $GITHUB_OUTPUT
39
+ else
40
+ echo "has_runtimes=false" >> $GITHUB_OUTPUT
41
+ fi
42
+
43
+ if [ "$APPLICATIONS" -gt 0 ]; then
44
+ echo "has_applications=true" >> $GITHUB_OUTPUT
45
+ else
46
+ echo "has_applications=false" >> $GITHUB_OUTPUT
47
+ fi
48
+ else
49
+ echo "has_packages=false" >> $GITHUB_OUTPUT
50
+ echo "has_runtimes=false" >> $GITHUB_OUTPUT
51
+ echo "has_applications=false" >> $GITHUB_OUTPUT
52
+ fi
53
+
54
+ prepare-runtimes:
55
+ runs-on:
56
+ - codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
57
+ - instance-size:medium
58
+
59
+ if: needs.check-elements.outputs.has_runtimes == 'true'
60
+ needs: check-elements
61
+ outputs:
62
+ unisphereElementsArtifactsFolder: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
63
+ hasArtifacts: ${{ steps.prepare-runtimes.outputs.hasArtifacts }}
64
+ commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
65
+ steps:
66
+ - name: Cache npm
67
+ uses: actions/cache@v3
68
+ with:
69
+ path: ~/.npm
70
+ key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
71
+ restore-keys: |
72
+ dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
73
+
74
+ - name: Checkout Repo
75
+ uses: actions/checkout@v4
76
+ with:
77
+ ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
78
+ fetch-tags: true
79
+ - name: Setup Node.js
80
+ uses: actions/setup-node@v4
81
+ with:
82
+ node-version-file: '.nvmrc'
83
+ - name: Clean workspace
84
+ run: git reset --hard HEAD
85
+ - name: Clean npm cache
86
+ run: npm cache clean --force
87
+
88
+ - name: Setup JFrog
89
+
90
+ uses: jfrog/setup-jfrog-cli@v4
91
+ id: setup-jfrog
92
+ env:
93
+ JF_URL: https://kalturaa.jfrog.io
94
+ with:
95
+ oidc-provider-name: ovp-github-oidc
96
+ - name: Install dependencies
97
+ run: npm ci --prefer-offline --include=optional --no-fund --verbose
98
+ env:
99
+ GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100
+ KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
101
+
102
+ - name: Prepare Unisphere Elements
103
+ id: prepare-runtimes
104
+ run: npx unisphere runtime publish prepare --verbose
105
+ - name: Capture Commit SHA
106
+ id: capture_commit_sha
107
+ run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
108
+ - name: Set commit_sha as output
109
+ id: set_commit_sha
110
+ run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
111
+ - uses: actions/upload-artifact@v4
112
+ id: upload-unisphere-elements-artifacts
113
+ with:
114
+ name: unisphere-elements
115
+ path: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
116
+ retention-days: 1
117
+
118
+ deploy-packages:
119
+ if: needs.check-elements.outputs.has_packages == 'true'
120
+ needs: check-elements
121
+ runs-on:
122
+ - codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
123
+ - instance-size:medium
124
+ steps:
125
+ - name: Cache npm
126
+ uses: actions/cache@v3
127
+ with:
128
+ path: ~/.npm
129
+ key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
130
+ restore-keys: |
131
+ dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
132
+
133
+ - name: Checkout Repo
134
+ uses: actions/checkout@v4
135
+ with:
136
+ ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
137
+ fetch-tags: true
138
+ - name: Setup Node.js
139
+ uses: actions/setup-node@v4
140
+ with:
141
+ node-version-file: '.nvmrc'
142
+
143
+ - name: Setup JFrog
144
+
145
+ uses: jfrog/setup-jfrog-cli@v4
146
+ id: setup-jfrog
147
+ env:
148
+ JF_URL: https://kalturaa.jfrog.io
149
+ with:
150
+ oidc-provider-name: ovp-github-oidc
151
+
152
+ - name: Install dependencies
153
+
154
+ run: |
155
+ npm ci --prefer-offline --include=optional --no-fund --verbose
156
+
157
+ env:
158
+ GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
159
+ KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
160
+
161
+ - name: Get NPM Token from AWS Secrets Manager
162
+ id: get-npm-token
163
+ run: |
164
+ NPM_TOKEN=$(aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:eu-central-1:785328604905:secret:unisphere-secrets-um86Cs --query SecretString --output text | jq -r '."NPM_UNISPHERE_TOKEN"')
165
+ echo "NPM_TOKEN=$NPM_TOKEN" >> $GITHUB_ENV
166
+ # Debug token existence (safely)
167
+ echo "::debug::Token exists: $([ ! -z "$NPM_TOKEN" ] && echo 'true' || echo 'false')"
168
+ - name: Deploy to registry
169
+ run: npx unisphere package publish --verbose --jfrogToken ${{ steps.setup-jfrog.outputs.oidc-token }} --npmToken ${{ env.NPM_TOKEN }} --branch "${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}"
170
+
171
+ deploy-runtimes:
172
+ if: needs.prepare-runtimes.outputs.hasArtifacts == 'true'
173
+ needs: prepare-runtimes
174
+ runs-on:
175
+ - codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
176
+ - instance-size:medium
177
+ strategy:
178
+ matrix:
179
+ envs_regions:
180
+ - { env: 'nvp1', region: 'us-east-1', accountid: '583352821080' }
181
+ - { env: 'frp2', region: 'eu-central-1', accountid: '082111255551' }
182
+ - { env: 'irp2', region: 'eu-west-1', accountid: '137576761235' }
183
+ - { env: 'nvq2', region: 'us-east-1', accountid: '383697330906' }
184
+ - { env: 'sgp2', region: 'ap-southeast-1', accountid: '882351240370' }
185
+ - { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
186
+ - { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
187
+ fail-fast: false
188
+
189
+ steps:
190
+ - name: Cache npm
191
+ uses: actions/cache@v3
192
+ with:
193
+ path: ~/.npm
194
+ key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
195
+ restore-keys: |
196
+ dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
197
+
198
+ - name: Check available disk space
199
+ run: df -h
200
+ - name: Checkout Repo at specific commit
201
+ uses: actions/checkout@v4
202
+ with:
203
+ ref: ${{ needs.prepare-runtimes.outputs.commit_sha }}
204
+ fetch-tags: true
205
+ - name: Setup Node.js
206
+ uses: actions/setup-node@v4
207
+ with:
208
+ node-version-file: '.nvmrc'
209
+
210
+ - name: Setup JFrog
211
+
212
+ uses: jfrog/setup-jfrog-cli@v4
213
+ id: setup-jfrog
214
+ env:
215
+ JF_URL: https://kalturaa.jfrog.io
216
+ with:
217
+ oidc-provider-name: ovp-github-oidc
218
+
219
+ - name: Install dependencies
220
+
221
+ run: npm ci --prefer-offline --include=optional --no-fund --verbose
222
+ env:
223
+ GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
224
+ KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
225
+
226
+ - name: Download artifacts folder
227
+ uses: actions/download-artifact@v4
228
+ with:
229
+ name: unisphere-elements
230
+ path: ${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}
231
+ - name: Sync S3 bucket
232
+ run: |
233
+ npx unisphere runtime publish execute \
234
+ --env ${{ matrix.envs_regions.env }} \
235
+ --aws-region '${{ matrix.envs_regions.region }}' \
236
+ --aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
237
+ --artifacts-folder '${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}' \
238
+ --verbose
239
+
240
+ prepare-applications:
241
+ if: always() && needs.check-elements.outputs.has_applications == 'true'
242
+ needs: [deploy-runtimes, check-elements]
243
+ runs-on:
244
+ - codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
245
+ - instance-size:medium
246
+ outputs:
247
+ unisphereApplicationsArtifactsFolder: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
248
+ hasArtifacts: ${{ steps.prepare-applications.outputs.hasArtifacts }}
249
+ commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
250
+ steps:
251
+ - name: Cache npm
252
+ uses: actions/cache@v3
253
+ with:
254
+ path: ~/.npm
255
+ key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
256
+ restore-keys: |
257
+ dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
258
+
259
+ - name: Checkout Repo
260
+ uses: actions/checkout@v4
261
+ with:
262
+ ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
263
+ fetch-tags: true
264
+ - name: Setup Node.js
265
+ uses: actions/setup-node@v4
266
+ with:
267
+ node-version-file: '.nvmrc'
268
+ - name: Clean workspace
269
+ run: git reset --hard HEAD
270
+ - name: Clean npm cache
271
+ run: npm cache clean --force
272
+ - name: Setup JFrog
273
+
274
+ uses: jfrog/setup-jfrog-cli@v4
275
+ id: setup-jfrog
276
+ env:
277
+ JF_URL: https://kalturaa.jfrog.io
278
+ with:
279
+ oidc-provider-name: ovp-github-oidc
280
+ - name: Install dependencies
281
+
282
+ run: npm ci --prefer-offline --include=optional --no-fund --verbose
283
+ env:
284
+ GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
285
+ KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
286
+ - name: Prepare Unisphere Applications
287
+ id: prepare-applications
288
+ run: npx unisphere application publish prepare --verbose
289
+ - name: Capture Commit SHA
290
+ id: capture_commit_sha
291
+ run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
292
+ - name: Set commit_sha as output
293
+ id: set_commit_sha
294
+ run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
295
+ - uses: actions/upload-artifact@v4
296
+ id: upload-unisphere-applications-artifacts
297
+ with:
298
+ name: unisphere-applications
299
+ path: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
300
+ retention-days: 1
301
+
302
+ deploy-applications:
303
+ if: always() && needs.prepare-applications.outputs.hasArtifacts == 'true'
304
+ needs: [prepare-applications]
305
+ runs-on:
306
+ - codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.run_attempt }}
307
+ - instance-size:medium
308
+ strategy:
309
+ matrix:
310
+ envs_regions:
311
+ - { env: 'nvp1', region: 'us-east-1', accountid: '583352821080' }
312
+ - { env: 'frp2', region: 'eu-central-1', accountid: '082111255551' }
313
+ - { env: 'irp2', region: 'eu-west-1', accountid: '137576761235' }
314
+ - { env: 'nvq2', region: 'us-east-1', accountid: '383697330906' }
315
+ - { env: 'sgp2', region: 'ap-southeast-1', accountid: '882351240370' }
316
+ - { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
317
+ - { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
318
+ fail-fast: false
319
+ steps:
320
+ - name: Cache npm
321
+ uses: actions/cache@v3
322
+ with:
323
+ path: ~/.npm
324
+ key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
325
+ restore-keys: |
326
+ dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
327
+
328
+ - name: Checkout Repo at specific commit
329
+ uses: actions/checkout@v4
330
+ with:
331
+ ref: ${{ needs.prepare-applications.outputs.commit_sha }}
332
+ fetch-tags: true
333
+ - name: Setup Node.js
334
+ uses: actions/setup-node@v4
335
+ with:
336
+ node-version-file: '.nvmrc'
337
+ - name: Setup JFrog
338
+
339
+ uses: jfrog/setup-jfrog-cli@v4
340
+ id: setup-jfrog
341
+ env:
342
+ JF_URL: https://kalturaa.jfrog.io
343
+ with:
344
+ oidc-provider-name: ovp-github-oidc
345
+ - name: Install dependencies
346
+
347
+ run: npm ci --prefer-offline --include=optional --no-fund --verbose
348
+ env:
349
+ GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
350
+ KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
351
+ - name: Download artifacts folder
352
+ uses: actions/download-artifact@v4
353
+ with:
354
+ name: unisphere-applications
355
+ path: ${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}
356
+ - name: Sync S3 bucket
357
+ run: |
358
+ npx unisphere application publish execute \
359
+ --env ${{ matrix.envs_regions.env }} \
360
+ --aws-region '${{ matrix.envs_regions.region }}' \
361
+ --aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
362
+ --artifacts-folder '${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}' \
363
+ --verbose
@@ -0,0 +1,89 @@
1
+ name: CI/CD
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - 'prerelease/**'
8
+
9
+ permissions:
10
+ id-token: write
11
+ contents: write
12
+ packages: write
13
+
14
+ jobs:
15
+ release:
16
+ name: Release
17
+ runs-on:
18
+ - codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
19
+ - instance-size:medium
20
+ outputs:
21
+ hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
22
+ steps:
23
+
24
+ - name: Cache npm
25
+ uses: actions/cache@v3
26
+ with:
27
+ path: ~/.npm
28
+ key: dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('package-lock.json') }}
29
+ restore-keys: |
30
+ dependencies-${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-
31
+
32
+ - name: Checkout Repo
33
+ uses: actions/checkout@v4
34
+
35
+ - name: Check if part of prerelease or official release
36
+ id: check
37
+ run: |
38
+ if [ "${{ github.ref }}" = "refs/heads/main" ] && [ -f ".changeset/pre.json" ]; then
39
+ echo "main branch should not have pre.json file, skipping job"
40
+ exit 1
41
+ elif [[ "${{ github.ref }}" == "refs/heads/prerelease/"* ]] && [ ! -f ".changeset/pre.json" ]; then
42
+ echo "prerelease branch must have pre.json file, skipping job"
43
+ exit 1
44
+ elif [ "${{ github.ref }}" != "refs/heads/main" ] && [[ "${{ github.ref }}" != "refs/heads/prerelease/"* ]]; then
45
+ echo "not part of prerelease or official release, skipping job"
46
+ exit 1
47
+ fi
48
+
49
+ - name: Setup Node.js
50
+ uses: actions/setup-node@v4
51
+ with:
52
+ node-version-file: '.nvmrc'
53
+
54
+ - name: Run Kaltura Tools Check
55
+ uses: kaltura/kaltura-tools@unisphere
56
+ with:
57
+ repo-path: '${{ github.workspace }}'
58
+
59
+ - name: Setup JFrog
60
+
61
+ uses: jfrog/setup-jfrog-cli@v4
62
+ id: setup-jfrog
63
+ env:
64
+ JF_URL: https://kalturaa.jfrog.io
65
+ with:
66
+ oidc-provider-name: ovp-github-oidc
67
+
68
+ - name: Install Dependencies
69
+ run: npm ci --prefer-offline --include=optional --no-fund
70
+ env:
71
+ GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72
+ KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
73
+
74
+ - name: Create Release Pull Request or Publish to npm
75
+ id: changesets
76
+ uses: changesets/action@v1
77
+ env:
78
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79
+
80
+ - name: Create release tags
81
+ if: steps.changesets.outputs.hasChangesets == 'false'
82
+ run: |
83
+ npx changeset tag
84
+ git push --follow-tags
85
+
86
+ publish-artifacts:
87
+ needs: release
88
+ if: needs.release.outputs.hasChangesets == 'false'
89
+ uses: ./.github/workflows/_publish-artifacts.yml
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=update-changeset-patch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-changeset-patch.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/update-changeset-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAyB,MAAM,YAAY,CAAC;AAGzD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B9D"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = update;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const path_1 = require("path");
6
+ async function update(tree) {
7
+ devkit_1.logger.info('🔄 Updating @changesets/cli patch');
8
+ try {
9
+ const patchesPath = 'patches';
10
+ const patchesTemplatePath = (0, path_1.join)(__dirname, 'patches');
11
+ const patchFileName = '@changesets+cli+2.29.7.patch';
12
+ // Delete existing changeset patch if it exists
13
+ if (tree.exists(patchesPath)) {
14
+ const existingFiles = tree.children(patchesPath);
15
+ for (const file of existingFiles) {
16
+ if (file.includes('@changesets+cli')) {
17
+ devkit_1.logger.info(`đŸ—‘ī¸ Removing existing patch: ${file}`);
18
+ tree.delete((0, path_1.join)(patchesPath, file));
19
+ }
20
+ }
21
+ }
22
+ // Copy the updated patch file
23
+ (0, devkit_1.generateFiles)(tree, patchesTemplatePath, `./${patchesPath}`, {});
24
+ devkit_1.logger.info(`✅ Updated patch: ${patchFileName}`);
25
+ devkit_1.logger.info('â„šī¸ This patch filters out unisphere-runtime-* packages from the major bump selection');
26
+ }
27
+ catch (error) {
28
+ devkit_1.logger.error(`❌ Failed to update patch: ${error?.message || 'Unknown error'}`);
29
+ throw error;
30
+ }
31
+ }
@@ -0,0 +1,21 @@
1
+ import { Tree } from '@nx/devkit';
2
+ /**
3
+ * Migration: Remove distributionChannel property from packages and update schema version
4
+ *
5
+ * After the reorganize-packages-by-distribution-channel migration, the distributionChannel
6
+ * property for packages is redundant and can be inferred from the folder path:
7
+ *
8
+ * Packages:
9
+ * - unisphere/packages/private/* → distributionChannel: "none"
10
+ * - unisphere/packages/corp/* → distributionChannel: "github"
11
+ * - unisphere/packages/public/* → distributionChannel: "npm"
12
+ *
13
+ * Runtimes & Applications:
14
+ * - Keep distributionChannel property (cannot be inferred from path)
15
+ *
16
+ * This migration:
17
+ * 1. Removes the distributionChannel property only from packages in .unisphere
18
+ * 2. Updates schemaVersion from "1.0.0" to "2.0.0"
19
+ */
20
+ export default function removeDistributionChannel(tree: Tree): Promise<void>;
21
+ //# sourceMappingURL=upgrade-schema-to-2-0-0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade-schema-to-2-0-0.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-0-0/upgrade-schema-to-2-0-0.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA+B,MAAM,YAAY,CAAC;AAE/D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAA8B,yBAAyB,CAAC,IAAI,EAAE,IAAI,iBAoFjE"}