@unisphere/nx 4.13.0 → 4.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Migration: Replace setup-local-runtimes.ts content
3
+ *
4
+ * Finds setup-local-runtimes.ts in each application and replaces its content
5
+ * with the updated version that supports experience-scoped runtimes.
6
+ */
7
+ import { Tree } from '@nx/devkit';
8
+ export default function update(tree: Tree): Promise<void>;
9
+ //# sourceMappingURL=replace-setup-local-runtimes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-setup-local-runtimes.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-13-1/replace-setup-local-runtimes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAiC,MAAM,YAAY,CAAC;AAmCjE,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC9D"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /**
3
+ * Migration: Replace setup-local-runtimes.ts content
4
+ *
5
+ * Finds setup-local-runtimes.ts in each application and replaces its content
6
+ * with the updated version that supports experience-scoped runtimes.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.default = update;
10
+ const devkit_1 = require("@nx/devkit");
11
+ const path_1 = require("path");
12
+ const NEW_CONTENT = `export function setupLocalRuntimes() {
13
+ if (!process.env.LOCAL_RUNTIMES) return;
14
+
15
+ const runtimes: Record<string, Record<string, { token: string; baseEnvName: string }>> = {};
16
+ process.env.LOCAL_RUNTIMES.split(',').forEach((entry) => {
17
+ const [experience, name, port] = entry.split('@');
18
+ if (experience && name && port) {
19
+ if (!runtimes[experience]) {
20
+ runtimes[experience] = {};
21
+ }
22
+ runtimes[experience][name] = { token: port, baseEnvName: '' };
23
+ }
24
+ });
25
+
26
+ const overrides = {
27
+ baseEnvName: '',
28
+ mode: 'integration',
29
+ options: { verbose: 'inherit' },
30
+ baseEnvScope: { core: 'inherit', presets: 'inherit' },
31
+ runtimes,
32
+ };
33
+
34
+ (window as any).unisphereRuntimeOverrides = btoa(JSON.stringify(overrides));
35
+ }
36
+ `;
37
+ async function update(tree) {
38
+ devkit_1.logger.info('šŸ”„ Replacing setup-local-runtimes.ts content in applications...');
39
+ if (!tree.exists('.unisphere')) {
40
+ devkit_1.logger.warn('āš ļø No .unisphere file found, skipping');
41
+ return;
42
+ }
43
+ const unisphereConfig = (0, devkit_1.readJson)(tree, '.unisphere');
44
+ const applications = unisphereConfig.elements?.applications;
45
+ if (!applications || Object.keys(applications).length === 0) {
46
+ devkit_1.logger.info('ā„¹ļø No applications found, skipping');
47
+ return;
48
+ }
49
+ let updatedCount = 0;
50
+ for (const [appName, appConfig] of Object.entries(applications)) {
51
+ const setupFilePath = (0, path_1.join)(appConfig.sourceRoot, 'src', 'setup-local-runtimes.ts');
52
+ if (!tree.exists(setupFilePath)) {
53
+ devkit_1.logger.info(`ā„¹ļø ${appName}: setup-local-runtimes.ts not found, skipping`);
54
+ continue;
55
+ }
56
+ tree.write(setupFilePath, NEW_CONTENT);
57
+ updatedCount++;
58
+ devkit_1.logger.info(`āœ… ${appName}: Replaced setup-local-runtimes.ts content`);
59
+ }
60
+ await (0, devkit_1.formatFiles)(tree);
61
+ devkit_1.logger.info(`\nāœ… Done: ${updatedCount} setup-local-runtimes.ts file(s) updated`);
62
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Migration: Add security overrides
3
+ *
4
+ * Adds npm overrides for high/critical transitive dependency vulnerabilities
5
+ * that can be resolved without breaking changes:
6
+ * - shell-quote (critical): unescaped newlines in .op values
7
+ * - undici (high): TLS bypass, header injection, DoS, etc.
8
+ * - ws (high): memory disclosure + exhaustion DoS
9
+ * - qs (high): prototype pollution
10
+ * - axios (high): update existing override from vulnerable ^1.15.1 to ^1.16.0
11
+ */
12
+ import { Tree } from '@nx/devkit';
13
+ export default function update(tree: Tree): Promise<void>;
14
+ //# sourceMappingURL=add-security-overrides.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-security-overrides.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-13-2/add-security-overrides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAUtD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA2C9D"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /**
3
+ * Migration: Add security overrides
4
+ *
5
+ * Adds npm overrides for high/critical transitive dependency vulnerabilities
6
+ * that can be resolved without breaking changes:
7
+ * - shell-quote (critical): unescaped newlines in .op values
8
+ * - undici (high): TLS bypass, header injection, DoS, etc.
9
+ * - ws (high): memory disclosure + exhaustion DoS
10
+ * - qs (high): prototype pollution
11
+ * - axios (high): update existing override from vulnerable ^1.15.1 to ^1.16.0
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.default = update;
15
+ const devkit_1 = require("@nx/devkit");
16
+ const SECURITY_OVERRIDES = {
17
+ 'shell-quote': '>=1.9.0',
18
+ undici: '>=7.28.0',
19
+ ws: '>=8.21.0',
20
+ qs: '>=6.14.0',
21
+ axios: '^1.16.0',
22
+ };
23
+ async function update(tree) {
24
+ devkit_1.logger.info('šŸ”„ Adding security overrides for high/critical vulnerabilities...');
25
+ const packageJsonPath = 'package.json';
26
+ if (!tree.exists(packageJsonPath)) {
27
+ devkit_1.logger.warn('āš ļø No package.json found, skipping');
28
+ return;
29
+ }
30
+ const added = [];
31
+ const updated = [];
32
+ (0, devkit_1.updateJson)(tree, packageJsonPath, (packageJson) => {
33
+ if (!packageJson.overrides) {
34
+ packageJson.overrides = {};
35
+ }
36
+ for (const [pkg, version] of Object.entries(SECURITY_OVERRIDES)) {
37
+ if (packageJson.overrides[pkg]) {
38
+ if (packageJson.overrides[pkg] !== version) {
39
+ packageJson.overrides[pkg] = version;
40
+ updated.push(`${pkg}@${version}`);
41
+ }
42
+ }
43
+ else {
44
+ packageJson.overrides[pkg] = version;
45
+ added.push(`${pkg}@${version}`);
46
+ }
47
+ }
48
+ return packageJson;
49
+ });
50
+ if (added.length > 0) {
51
+ devkit_1.logger.info(`šŸ“¦ Added overrides: ${added.join(', ')}`);
52
+ }
53
+ if (updated.length > 0) {
54
+ devkit_1.logger.info(`šŸ“¦ Updated overrides: ${updated.join(', ')}`);
55
+ }
56
+ if (added.length === 0 && updated.length === 0) {
57
+ devkit_1.logger.info('ā„¹ļø All security overrides already present');
58
+ }
59
+ devkit_1.logger.info('āœ… Security overrides applied');
60
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Migration: Remove @swc/cli
3
+ *
4
+ * Removes @swc/cli from package.json (all dependency sections)
5
+ * and removes it from package-lock.json if present.
6
+ */
7
+ import { Tree } from '@nx/devkit';
8
+ export default function update(tree: Tree): Promise<void>;
9
+ //# sourceMappingURL=remove-swc-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-swc-cli.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-13-2/remove-swc-cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAEtD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAyC9D"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ /**
3
+ * Migration: Remove @swc/cli
4
+ *
5
+ * Removes @swc/cli from package.json (all dependency sections)
6
+ * and removes it from package-lock.json if present.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.default = update;
10
+ const devkit_1 = require("@nx/devkit");
11
+ async function update(tree) {
12
+ devkit_1.logger.info('šŸ”„ Removing @swc/cli from package.json and package-lock.json...');
13
+ const targetPackage = '@swc/cli';
14
+ let removedFromPackageJson = false;
15
+ // Remove from package.json
16
+ const packageJsonPath = 'package.json';
17
+ if (!tree.exists(packageJsonPath)) {
18
+ devkit_1.logger.warn('āš ļø No package.json found, skipping');
19
+ return;
20
+ }
21
+ (0, devkit_1.updateJson)(tree, packageJsonPath, (packageJson) => {
22
+ if (packageJson.dependencies?.[targetPackage]) {
23
+ delete packageJson.dependencies[targetPackage];
24
+ removedFromPackageJson = true;
25
+ devkit_1.logger.info(`šŸ“¦ Removed ${targetPackage} from dependencies`);
26
+ }
27
+ if (packageJson.devDependencies?.[targetPackage]) {
28
+ delete packageJson.devDependencies[targetPackage];
29
+ removedFromPackageJson = true;
30
+ devkit_1.logger.info(`šŸ“¦ Removed ${targetPackage} from devDependencies`);
31
+ }
32
+ if (packageJson.optionalDependencies?.[targetPackage]) {
33
+ delete packageJson.optionalDependencies[targetPackage];
34
+ removedFromPackageJson = true;
35
+ devkit_1.logger.info(`šŸ“¦ Removed ${targetPackage} from optionalDependencies`);
36
+ }
37
+ return packageJson;
38
+ });
39
+ if (removedFromPackageJson) {
40
+ devkit_1.logger.info('āœ… Successfully removed @swc/cli');
41
+ }
42
+ else {
43
+ devkit_1.logger.info('ā„¹ļø @swc/cli not found in package.json, skipping');
44
+ }
45
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Migration: Replace cicd.yml workflow
3
+ *
4
+ * Replaces .github/workflows/cicd.yml with updated version:
5
+ * - Adds pull-requests: write permission
6
+ * - Removes legacy Cache npm step (uses actions/setup-node cache instead)
7
+ * - Adds cache: npm and cache-dependency-path to Setup Node.js step
8
+ */
9
+ import { Tree } from '@nx/devkit';
10
+ export default function update(tree: Tree): Promise<void>;
11
+ //# sourceMappingURL=replace-cicd-workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-cicd-workflow.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-14-0/replace-cicd-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B9D"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /**
3
+ * Migration: Replace cicd.yml workflow
4
+ *
5
+ * Replaces .github/workflows/cicd.yml with updated version:
6
+ * - Adds pull-requests: write permission
7
+ * - Removes legacy Cache npm step (uses actions/setup-node cache instead)
8
+ * - Adds cache: npm and cache-dependency-path to Setup Node.js step
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.default = update;
12
+ const devkit_1 = require("@nx/devkit");
13
+ const fs_1 = require("fs");
14
+ const path_1 = require("path");
15
+ async function update(tree) {
16
+ devkit_1.logger.info('šŸ”„ Updating GitHub CICD workflow for v4.14.0');
17
+ // Ensure .github/workflows directory exists
18
+ if (!tree.exists('.github')) {
19
+ tree.write('.github/.gitkeep', '');
20
+ devkit_1.logger.info('āœ… Created .github directory');
21
+ }
22
+ if (!tree.exists('.github/workflows')) {
23
+ tree.write('.github/workflows/.gitkeep', '');
24
+ devkit_1.logger.info('āœ… Created .github/workflows directory');
25
+ }
26
+ try {
27
+ const workflowPath = '.github/workflows/cicd.yml';
28
+ const templatePath = (0, path_1.join)(__dirname, 'templates', 'cicd.template');
29
+ const templateContent = (0, fs_1.readFileSync)(templatePath, 'utf-8');
30
+ const workflowExists = tree.exists(workflowPath);
31
+ tree.write(workflowPath, templateContent);
32
+ if (workflowExists) {
33
+ devkit_1.logger.info(`āœ… Updated ${workflowPath}`);
34
+ }
35
+ else {
36
+ devkit_1.logger.info(`āœ… Created ${workflowPath}`);
37
+ }
38
+ }
39
+ catch (error) {
40
+ devkit_1.logger.error(`āŒ Failed to update GitHub CICD workflow: ${error?.message || 'Unknown error'}`);
41
+ throw error;
42
+ }
43
+ }
@@ -0,0 +1,90 @@
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
+ pull-requests: write
14
+
15
+ jobs:
16
+ release:
17
+ name: Release
18
+ runs-on:
19
+ - codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
20
+ - instance-size:medium
21
+ outputs:
22
+ hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
23
+ steps:
24
+
25
+ - name: Checkout Repo
26
+ uses: actions/checkout@v4
27
+
28
+ - name: Check if part of prerelease or official release
29
+ id: check
30
+ run: |
31
+ if [ "${{ github.ref }}" = "refs/heads/main" ] && [ -f ".changeset/pre.json" ]; then
32
+ echo "main branch should not have pre.json file, skipping job"
33
+ exit 1
34
+ elif [[ "${{ github.ref }}" == "refs/heads/prerelease/"* ]] && [ ! -f ".changeset/pre.json" ]; then
35
+ echo "prerelease branch must have pre.json file, skipping job"
36
+ exit 1
37
+ elif [ "${{ github.ref }}" != "refs/heads/main" ] && [[ "${{ github.ref }}" != "refs/heads/prerelease/"* ]]; then
38
+ echo "not part of prerelease or official release, skipping job"
39
+ exit 1
40
+ fi
41
+
42
+ - name: Setup Node.js
43
+ uses: actions/setup-node@v4
44
+ with:
45
+ node-version-file: '.nvmrc'
46
+ cache: npm
47
+ cache-dependency-path: package-lock.json
48
+
49
+ - name: Pre-CICD Checks
50
+ uses: kaltura/unisphere-core/.github/actions/pre-cicd@main
51
+ with:
52
+ repo-path: '${{ github.workspace }}'
53
+
54
+ - name: Setup JFrog
55
+
56
+ uses: jfrog/setup-jfrog-cli@v4
57
+ id: setup-jfrog
58
+ env:
59
+ JF_URL: https://kalturaa.jfrog.io
60
+ with:
61
+ oidc-provider-name: ovp-github-oidc
62
+
63
+ - name: Install Dependencies
64
+ run: npm ci --prefer-offline --include=optional --no-fund
65
+ env:
66
+ GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67
+ KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
68
+
69
+
70
+ # - name: Security Audit
71
+ # run: npx unisphere tools audit
72
+ # env:
73
+ # KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
74
+
75
+ - name: Create Release Pull Request or Publish to npm
76
+ id: changesets
77
+ uses: changesets/action@v1
78
+ env:
79
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80
+
81
+ - name: Create release tags
82
+ if: steps.changesets.outputs.hasChangesets == 'false'
83
+ run: |
84
+ npx changeset tag
85
+ git push --follow-tags
86
+
87
+ publish-artifacts:
88
+ needs: release
89
+ if: needs.release.outputs.hasChangesets == 'false'
90
+ uses: ./.github/workflows/_publish-artifacts.yml
package/migrations.json CHANGED
@@ -530,6 +530,38 @@
530
530
  "cli": {
531
531
  "postUpdateMessage": "āœ… @changesets/cli patch updated"
532
532
  }
533
+ },
534
+ "4.13.1-replace-setup-local-runtimes": {
535
+ "version": "4.13.1",
536
+ "description": "Replaces setup-local-runtimes.ts with updated version supporting experience-scoped runtimes",
537
+ "factory": "./dist/migrations/4-13-1/replace-setup-local-runtimes.js",
538
+ "cli": {
539
+ "postUpdateMessage": "āœ… setup-local-runtimes.ts updated with experience-scoped runtimes support"
540
+ }
541
+ },
542
+ "4.13.2-remove-swc-cli": {
543
+ "version": "4.13.2",
544
+ "description": "Removes @swc/cli from package.json and package-lock.json",
545
+ "factory": "./dist/migrations/4-13-2/remove-swc-cli.js",
546
+ "cli": {
547
+ "postUpdateMessage": "āœ… @swc/cli removed from package.json and package-lock.json"
548
+ }
549
+ },
550
+ "4.13.2-add-security-overrides": {
551
+ "version": "4.13.2",
552
+ "description": "Adds npm overrides for high/critical transitive dependency vulnerabilities (shell-quote, undici, ws, qs, axios)",
553
+ "factory": "./dist/migrations/4-13-2/add-security-overrides.js",
554
+ "cli": {
555
+ "postUpdateMessage": "āœ… Security overrides added for high/critical vulnerabilities"
556
+ }
557
+ },
558
+ "4.14.0-replace-cicd-workflow": {
559
+ "version": "4.14.0",
560
+ "description": "Replaces cicd.yml with updated workflow (pull-requests permission, improved npm caching)",
561
+ "factory": "./dist/migrations/4-14-0/replace-cicd-workflow.js",
562
+ "cli": {
563
+ "postUpdateMessage": "āœ… .github/workflows/cicd.yml updated"
564
+ }
533
565
  }
534
566
  },
535
567
  "packageJsonUpdates": {
@@ -923,6 +955,48 @@
923
955
  "alwaysAddToPackageJson": false
924
956
  }
925
957
  }
958
+ },
959
+ "4.13.1": {
960
+ "version": "4.13.1",
961
+ "cli": "nx",
962
+ "postUpdateMessage": "šŸŽ‰ Migration to @unisphere/nx 4.13.1 completed successfully!",
963
+ "packages": {
964
+ "@unisphere/cli": {
965
+ "version": "5.4.1",
966
+ "alwaysAddToPackageJson": false
967
+ }
968
+ }
969
+ },
970
+ "4.13.2": {
971
+ "version": "4.13.2",
972
+ "cli": "nx",
973
+ "postUpdateMessage": "šŸŽ‰ Migration to @unisphere/nx 4.13.2 completed successfully!",
974
+ "packages": {
975
+ "@unisphere/cli": {
976
+ "version": "5.4.3",
977
+ "alwaysAddToPackageJson": false
978
+ },
979
+ "@kaltura/ds-react-bits": {
980
+ "version": "^12.21.10",
981
+ "alwaysAddToPackageJson": false
982
+ },
983
+ "@kaltura/ds-react-components": {
984
+ "version": "^12.21.10",
985
+ "alwaysAddToPackageJson": false
986
+ },
987
+ "@kaltura/ds-react-icons": {
988
+ "version": "^12.21.10",
989
+ "alwaysAddToPackageJson": false
990
+ },
991
+ "@kaltura/ds-react-theme": {
992
+ "version": "^12.21.10",
993
+ "alwaysAddToPackageJson": false
994
+ },
995
+ "@kaltura/ds-react-utils": {
996
+ "version": "^12.21.10",
997
+ "alwaysAddToPackageJson": false
998
+ }
999
+ }
926
1000
  }
927
1001
  }
928
1002
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "4.13.0",
3
+ "version": "4.14.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",