@unisphere/nx 1.22.1 → 1.22.2

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.
@@ -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. Current version: ${nxVersion}\n\nPlease upgrade Nx first by running:\n npx nx migrate nx@22\n npm install\n npx nx migrate --run-migrations`;
15
+ const errorMessage = `❌ This migration requires Nx 22 or higher. read https://unisphere.kaltura.com/docs/create/changelog/1-22-2-changelog`;
16
16
  devkit_1.logger.error(errorMessage);
17
17
  throw new Error(errorMessage);
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"add-kaltura-tools-to-pre-install.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-1/add-kaltura-tools-to-pre-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAEtD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB9D"}
1
+ {"version":3,"file":"add-kaltura-tools-to-pre-install.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-2/add-kaltura-tools-to-pre-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAEtD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB9D"}
@@ -10,7 +10,7 @@ async function update(tree) {
10
10
  json.scripts = {};
11
11
  }
12
12
  json.scripts.preinstall =
13
- 'npx --yes --prefer-online --registry=https://npm.pkg.github.com --package @kaltura/kaltura-tools@latest kaltura-tools check --root=.';
13
+ 'npx --yes --prefer-online --registry=https://npm.pkg.github.com --package @kaltura/kaltura-tools@unisphere kaltura-tools check --root=.';
14
14
  return json;
15
15
  });
16
16
  devkit_1.logger.info('✅ Successfully added kaltura-tools preinstall script');
@@ -1,3 +1,3 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  export default function update(tree: Tree): Promise<void>;
3
- //# sourceMappingURL=update-github-workflow.d.ts.map
3
+ //# sourceMappingURL=add-os-and-cpu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-os-and-cpu.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-2/add-os-and-cpu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAEtD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB9D"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = update;
4
+ const devkit_1 = require("@nx/devkit");
5
+ async function update(tree) {
6
+ devkit_1.logger.info('🔄 updating os and cpu in package.json...');
7
+ try {
8
+ (0, devkit_1.updateJson)(tree, 'package.json', (json) => {
9
+ json.os = [
10
+ "darwin",
11
+ "linux",
12
+ "windows"
13
+ ];
14
+ json.cpu = [
15
+ "x64",
16
+ "arm64"
17
+ ];
18
+ return json;
19
+ });
20
+ devkit_1.logger.info('✅ Successfully added os and cpu to package.json');
21
+ }
22
+ catch (error) {
23
+ devkit_1.logger.error(`❌ Failed to add os and cpu to package.json: ${error?.message || 'Unknown error'}`);
24
+ throw error;
25
+ }
26
+ }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=replace-github-workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-github-workflow.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-2/replace-github-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA8C9D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-2/summary.ts"],"names":[],"mappings":"AAEA,0CAOC"}
@@ -4,9 +4,9 @@ exports.default = default_1;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  async function default_1() {
6
6
  devkit_1.logger.info('');
7
- devkit_1.logger.info('🎉 Migration to @unisphere/nx 1.22.0 finished successfully!');
7
+ devkit_1.logger.info('🎉 Migration to @unisphere/nx 1.22.2 finished successfully!');
8
8
  devkit_1.logger.info('');
9
9
  devkit_1.logger.info('📋 Full details:');
10
- devkit_1.logger.info('https://unisphere.kaltura.com/docs/create/changelog/1-22-0-changelog');
10
+ devkit_1.logger.info('https://unisphere.kaltura.com/docs/create/changelog/1-22-2-changelog');
11
11
  devkit_1.logger.info('');
12
12
  }
@@ -4,9 +4,54 @@ on:
4
4
  workflow_call:
5
5
 
6
6
  jobs:
7
- prepare-runtimes:
7
+ check-elements:
8
8
  runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
9
+ outputs:
10
+ has_packages: ${{ steps.check.outputs.has_packages }}
11
+ has_runtimes: ${{ steps.check.outputs.has_runtimes }}
12
+ has_applications: ${{ steps.check.outputs.has_applications }}
13
+ steps:
14
+ - name: Checkout Repo
15
+ uses: actions/checkout@v3
16
+ with:
17
+ ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
18
+ fetch-tags: true
19
+
20
+ - name: Check elements in .unisphere
21
+ id: check
22
+ run: |
23
+ if [ -f .unisphere ]; then
24
+ PACKAGES=$(jq -r '.elements.packages // {} | length' .unisphere)
25
+ RUNTIMES=$(jq -r '(.elements.runtimes // {} | length) + (.elements.workspace // {} | length) + (.elements.loader // {} | length)' .unisphere)
26
+ APPLICATIONS=$(jq -r '.elements.applications // {} | length' .unisphere)
27
+
28
+ if [ "$PACKAGES" -gt 0 ]; then
29
+ echo "has_packages=true" >> $GITHUB_OUTPUT
30
+ else
31
+ echo "has_packages=false" >> $GITHUB_OUTPUT
32
+ fi
33
+
34
+ if [ "$RUNTIMES" -gt 0 ]; then
35
+ echo "has_runtimes=true" >> $GITHUB_OUTPUT
36
+ else
37
+ echo "has_runtimes=false" >> $GITHUB_OUTPUT
38
+ fi
39
+
40
+ if [ "$APPLICATIONS" -gt 0 ]; then
41
+ echo "has_applications=true" >> $GITHUB_OUTPUT
42
+ else
43
+ echo "has_applications=false" >> $GITHUB_OUTPUT
44
+ fi
45
+ else
46
+ echo "has_packages=false" >> $GITHUB_OUTPUT
47
+ echo "has_runtimes=false" >> $GITHUB_OUTPUT
48
+ echo "has_applications=false" >> $GITHUB_OUTPUT
49
+ fi
9
50
 
51
+ prepare-runtimes:
52
+ runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
53
+ if: needs.check-elements.outputs.has_runtimes == 'true'
54
+ needs: check-elements
10
55
  outputs:
11
56
  unisphereElementsArtifactsFolder: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
12
57
  hasArtifacts: ${{ steps.prepare-runtimes.outputs.hasArtifacts }}
@@ -35,7 +80,7 @@ jobs:
35
80
  oidc-provider-name: ovp-github-oidc
36
81
 
37
82
  - name: Install dependencies
38
- run: npm ci --include=optional
83
+ run: npm ci --ignore-scripts
39
84
  env:
40
85
  GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41
86
  KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
@@ -57,6 +102,8 @@ jobs:
57
102
  retention-days: 1
58
103
 
59
104
  deploy-packages:
105
+ if: needs.check-elements.outputs.has_packages == 'true'
106
+ needs: check-elements
60
107
  runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
61
108
  steps:
62
109
  - name: Checkout Repo
@@ -79,7 +126,7 @@ jobs:
79
126
 
80
127
  - name: Install dependencies
81
128
  run: |
82
- npm ci --include=optional
129
+ npm ci --ignore-scripts
83
130
 
84
131
  env:
85
132
  GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -134,7 +181,7 @@ jobs:
134
181
 
135
182
  - name: Install dependencies
136
183
  run: |
137
- npm ci --include=optional
184
+ npm ci --ignore-scripts
138
185
  env:
139
186
  GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140
187
  KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
@@ -153,8 +200,9 @@ jobs:
153
200
  --artifacts-folder '${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}' \
154
201
  --verbose
155
202
 
156
- prepare-applications:
157
- needs: [deploy-runtimes]
203
+ prepare-applications:
204
+ if: needs.check-elements.outputs.has_applications == 'true'
205
+ needs: [deploy-runtimes, check-elements]
158
206
  runs-on:
159
207
  - codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
160
208
  - instance-size:medium
@@ -177,7 +225,7 @@ jobs:
177
225
  - name: Clean npm cache
178
226
  run: npm cache clean --force
179
227
  - name: Install dependencies
180
- run: npm ci --include=optional
228
+ run: npm ci --ignore-scripts
181
229
  env:
182
230
  GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183
231
  - name: Prepare Unisphere Applications
@@ -224,7 +272,7 @@ jobs:
224
272
  with:
225
273
  node-version: 20
226
274
  - name: Install dependencies
227
- run: npm ci --include=optional
275
+ run: npm ci --ignore-scripts
228
276
  env:
229
277
  GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
230
278
  - name: Download artifacts folder
@@ -43,7 +43,7 @@ jobs:
43
43
  node-version-file: '.nvmrc'
44
44
 
45
45
  - name: Run Kaltura Tools Check
46
- uses: kaltura/kaltura-tools@main
46
+ uses: kaltura/kaltura-tools@unisphere
47
47
  with:
48
48
  repo-path: '${{ github.workspace }}'
49
49
 
@@ -56,7 +56,7 @@ jobs:
56
56
  oidc-provider-name: ovp-github-oidc
57
57
 
58
58
  - name: Install Dependencies
59
- run: npm ci --include=optional
59
+ run: npm ci --include=optional
60
60
  env:
61
61
  GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62
62
  KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
package/migrations.json CHANGED
@@ -8,14 +8,6 @@
8
8
  "postUpdateMessage": "✅ .npmrc has been replaced with updated version."
9
9
  }
10
10
  },
11
- "1-22-0-update-github-workflow": {
12
- "version": "1.22.0",
13
- "description": "Updates .github/workflows/cicd.yml from template",
14
- "factory": "./dist/migrations/1-22-0/update-github-workflow.js",
15
- "cli": {
16
- "postUpdateMessage": "✅ GitHub workflow updated to use jsfrog. Review .github/workflows/cicd.yml if you have custom changes."
17
- }
18
- },
19
11
  "1-22-0-check-nx-version": {
20
12
  "version": "1.22.0",
21
13
  "description": "Checks that Nx version is 22 or higher",
@@ -32,21 +24,11 @@
32
24
  "postUpdateMessage": "✅ Patches have been replaced with updated version for Nx 22.1.3."
33
25
  }
34
26
  },
35
- "1-22-0-000-summary": {
36
- "version": "1.22.0",
37
- "description": "Prints migration completion summary",
38
- "factory": "./dist/migrations/1-22-0/summary.js"
39
- },
40
27
  "1-22-1-sync-inner-package-json-dependencies": {
41
28
  "version": "1.22.1",
42
29
  "description": "Syncs inner package.json dependencies with root package.json",
43
30
  "factory": "./dist/migrations/1-22-1/sync-package-json-files.js"
44
31
  },
45
- "1-22-1-add-kaltura-tools-to-pre-install": {
46
- "version": "1.22.1",
47
- "description": "Adds kaltura-tools to preinstall script",
48
- "factory": "./dist/migrations/1-22-1/add-kaltura-tools-to-pre-install.js"
49
- },
50
32
  "1-22-1-fix-dependency-versions": {
51
33
  "version": "1.22.1",
52
34
  "description": "Removes ^ from @changesets/cli version in package.json",
@@ -55,6 +37,32 @@
55
37
  "postUpdateMessage": "✅ @changesets/cli version has been pinned to exact version (^ removed)."
56
38
  }
57
39
  },
40
+ "1-22-2-add-os-and-cpu": {
41
+ "version": "1.22.2",
42
+ "description": "Adds os and cpu to package.json",
43
+ "factory": "./dist/migrations/1-22-2/add-os-and-cpu.js",
44
+ "cli": {
45
+ "postUpdateMessage": "✅ os and cpu have been added to package.json."
46
+ }
47
+ },
48
+ "1-22-2-add-kaltura-tools-to-pre-install": {
49
+ "version": "1.22.2",
50
+ "description": "Adds kaltura-tools to preinstall script",
51
+ "factory": "./dist/migrations/1-22-2/add-kaltura-tools-to-pre-install.js"
52
+ },
53
+ "1-22-2-replace-github-workflow": {
54
+ "version": "1.22.2",
55
+ "description": "Updates .github/workflows/cicd.yml from template",
56
+ "factory": "./dist/migrations/1-22-2/replace-github-workflow.js",
57
+ "cli": {
58
+ "postUpdateMessage": "✅ GitHub workflow updated with some changes."
59
+ }
60
+ },
61
+ "1-22-2-000-summary": {
62
+ "version": "1.22.2",
63
+ "description": "Prints migration completion summary",
64
+ "factory": "./dist/migrations/1-22-2/summary.js"
65
+ }
58
66
  },
59
67
  "packageJsonUpdates": {
60
68
  "1.22.0": {
@@ -63,7 +71,7 @@
63
71
  "postUpdateMessage": "🎉 Migration to @unisphere/nx 1.22.0 finished successfully!\n\n📋 Full details: https://unisphere.kaltura.com/docs/create/changelog/1-22-0-changelog",
64
72
  "packages": {
65
73
  "@unisphere/cli": {
66
- "version": "1.56.2",
74
+ "version": "^1.56.2",
67
75
  "alwaysAddToPackageJson": true
68
76
  },
69
77
  "@unisphere/core": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "1.22.1",
3
+ "version": "1.22.2",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -69,11 +69,6 @@
69
69
  "input": "./packages/nx/src/generators",
70
70
  "glob": "**/templates/**/*",
71
71
  "output": "./generators"
72
- },
73
- {
74
- "input": "./packages/nx",
75
- "glob": "migrations.json",
76
- "output": "."
77
72
  }
78
73
  ]
79
74
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-0/summary.ts"],"names":[],"mappings":"AAEA,0CAOC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-github-workflow.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-0/update-github-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA8C9D"}
@@ -1,97 +0,0 @@
1
- {
2
- "generators": {
3
- "1-22-0-replace-npmrc": {
4
- "version": "1.22.0",
5
- "description": "Replaces .npmrc with updated version",
6
- "factory": "./dist/migrations/1-22-0/replace-npmrc.js",
7
- "cli": {
8
- "postUpdateMessage": "✅ .npmrc has been replaced with updated version."
9
- }
10
- },
11
- "1-22-0-update-github-workflow": {
12
- "version": "1.22.0",
13
- "description": "Updates .github/workflows/cicd.yml from template",
14
- "factory": "./dist/migrations/1-22-0/update-github-workflow.js",
15
- "cli": {
16
- "postUpdateMessage": "✅ GitHub workflow updated to use jsfrog. Review .github/workflows/cicd.yml if you have custom changes."
17
- }
18
- },
19
- "1-22-0-check-nx-version": {
20
- "version": "1.22.0",
21
- "description": "Checks that Nx version is 22 or higher",
22
- "factory": "./dist/migrations/1-22-0/check-nx-version.js",
23
- "cli": {
24
- "postUpdateMessage": "✅ Nx version check completed. Your project is using Nx 22 or higher."
25
- }
26
- },
27
- "1-22-0-replace-patches": {
28
- "version": "1.22.0",
29
- "description": "Replaces patches with updated version for Nx 22.1.3",
30
- "factory": "./dist/migrations/1-22-0/replace-patches.js",
31
- "cli": {
32
- "postUpdateMessage": "✅ Patches have been replaced with updated version for Nx 22.1.3."
33
- }
34
- },
35
- "1-22-0-000-summary": {
36
- "version": "1.22.0",
37
- "description": "Prints migration completion summary",
38
- "factory": "./dist/migrations/1-22-0/summary.js"
39
- },
40
- "1-22-1-sync-inner-package-json-dependencies": {
41
- "version": "1.22.1",
42
- "description": "Syncs inner package.json dependencies with root package.json",
43
- "factory": "./dist/migrations/1-22-1/sync-package-json-files.js"
44
- },
45
- "1-22-1-add-kaltura-tools-to-pre-install": {
46
- "version": "1.22.1",
47
- "description": "Adds kaltura-tools to preinstall script",
48
- "factory": "./dist/migrations/1-22-1/add-kaltura-tools-to-pre-install.js"
49
- },
50
- "1-22-1-fix-dependency-versions": {
51
- "version": "1.22.1",
52
- "description": "Removes ^ from @changesets/cli version in package.json",
53
- "factory": "./dist/migrations/1-22-1/fix-dependency-versions.js",
54
- "cli": {
55
- "postUpdateMessage": "✅ @changesets/cli version has been pinned to exact version (^ removed)."
56
- }
57
- },
58
- },
59
- "packageJsonUpdates": {
60
- "1.22.0": {
61
- "version": "1.22.0",
62
- "cli": "nx",
63
- "postUpdateMessage": "🎉 Migration to @unisphere/nx 1.22.0 finished successfully!\n\n📋 Full details: https://unisphere.kaltura.com/docs/create/changelog/1-22-0-changelog",
64
- "packages": {
65
- "@unisphere/cli": {
66
- "version": "1.56.2",
67
- "alwaysAddToPackageJson": true
68
- },
69
- "@unisphere/core": {
70
- "version": "^1.86.2",
71
- "alwaysAddToPackageJson": false
72
- },
73
- "@unisphere/runtime": {
74
- "version": "^1.85.2",
75
- "alwaysAddToPackageJson": false
76
- },
77
- "@unisphere/runtime-js": {
78
- "version": "^1.84.2",
79
- "alwaysAddToPackageJson": false
80
- },
81
- "@unisphere/runtime-react": {
82
- "version": "1.72.0",
83
- "alwaysAddToPackageJson": false
84
- },
85
- "@nx/nx-linux-x64-gnu": {
86
- "version": "^22.0.1",
87
- "addToPackageJson": "optionalDependencies",
88
- "alwaysAddToPackageJson": false
89
- },
90
- "@changesets/cli": {
91
- "version": "2.29.7",
92
- "alwaysAddToPackageJson": true
93
- }
94
- }
95
- }
96
- }
97
- }
File without changes