@unisphere/nx 4.12.5 → 4.13.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,22 @@
1
+ /**
2
+ * Migration: Comment out the "Security Audit" step in cicd.yml
3
+ *
4
+ * The `Security Audit` step (`npx unisphere tools audit`) is temporarily
5
+ * disabled across projects. This migration comments out the step's lines in
6
+ * .github/workflows/cicd.yml by prefixing each with `#`:
7
+ *
8
+ * # - name: Security Audit
9
+ * # run: npx unisphere tools audit
10
+ * # env:
11
+ * # KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
12
+ *
13
+ * The step's block is matched by its `- name: Security Audit` anchor and the
14
+ * following contiguous body lines (stopping at the first blank line or the next
15
+ * `- name:` step), so it is resilient to indentation differences between repos.
16
+ *
17
+ * Idempotent: if the step is already commented out (or absent), re-running
18
+ * makes no further changes.
19
+ */
20
+ import { Tree } from '@nx/devkit';
21
+ export default function update(tree: Tree): Promise<void>;
22
+ //# sourceMappingURL=comment-out-security-audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-out-security-audit.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-12-6/comment-out-security-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAK1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAkD9D"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ /**
3
+ * Migration: Comment out the "Security Audit" step in cicd.yml
4
+ *
5
+ * The `Security Audit` step (`npx unisphere tools audit`) is temporarily
6
+ * disabled across projects. This migration comments out the step's lines in
7
+ * .github/workflows/cicd.yml by prefixing each with `#`:
8
+ *
9
+ * # - name: Security Audit
10
+ * # run: npx unisphere tools audit
11
+ * # env:
12
+ * # KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
13
+ *
14
+ * The step's block is matched by its `- name: Security Audit` anchor and the
15
+ * following contiguous body lines (stopping at the first blank line or the next
16
+ * `- name:` step), so it is resilient to indentation differences between repos.
17
+ *
18
+ * Idempotent: if the step is already commented out (or absent), re-running
19
+ * makes no further changes.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.default = update;
23
+ const devkit_1 = require("@nx/devkit");
24
+ const CICD_PATH = '.github/workflows/cicd.yml';
25
+ const STEP_ANCHOR = '- name: Security Audit';
26
+ async function update(tree) {
27
+ devkit_1.logger.info(`🔄 Commenting out the Security Audit step in ${CICD_PATH}...`);
28
+ if (!tree.exists(CICD_PATH)) {
29
+ devkit_1.logger.info(`â„šī¸ No ${CICD_PATH} found, skipping migration`);
30
+ return;
31
+ }
32
+ const content = tree.read(CICD_PATH, 'utf-8') ?? '';
33
+ const lines = content.split('\n');
34
+ // Match the anchor whether or not it is already commented out, so re-running
35
+ // recognises the existing state instead of treating it as "not found".
36
+ const stripComment = (line) => line.replace(/^\s*#/, '').trim();
37
+ const anchorIndex = lines.findIndex((line) => stripComment(line) === STEP_ANCHOR);
38
+ if (anchorIndex === -1) {
39
+ devkit_1.logger.info(`â„šī¸ Security Audit step not found in ${CICD_PATH}, skipping migration`);
40
+ return;
41
+ }
42
+ // Already commented? (anchor line begins with #) — don't add a second #.
43
+ if (lines[anchorIndex].trimStart().startsWith('#')) {
44
+ devkit_1.logger.info('✅ Security Audit step already commented out, skipping');
45
+ return;
46
+ }
47
+ // Comment the step's contiguous block: the anchor line plus the following
48
+ // body lines, stopping at the first blank line or the next `- name:` step.
49
+ let commented = 0;
50
+ for (let i = anchorIndex; i < lines.length; i++) {
51
+ const line = lines[i];
52
+ if (i > anchorIndex &&
53
+ (line.trim() === '' || stripComment(line).startsWith('- name:'))) {
54
+ break;
55
+ }
56
+ // Per-line guard: never prefix a line that is already commented.
57
+ if (!line.trimStart().startsWith('#')) {
58
+ lines[i] = `#${line}`;
59
+ commented++;
60
+ }
61
+ }
62
+ tree.write(CICD_PATH, lines.join('\n'));
63
+ devkit_1.logger.info(`✅ Commented out ${commented} lines of the Security Audit step`);
64
+ }
@@ -0,0 +1,94 @@
1
+ diff --git a/node_modules/@changesets/cli/dist/changesets-cli.cjs.js b/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
2
+ index 53fc925..ca3c8ad 100644
3
+ --- a/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
4
+ +++ b/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
5
+ @@ -272,9 +272,19 @@ async function getPackagesToRelease(changedPackages, allPackages) {
6
+ });
7
+ }
8
+ if (allPackages.length > 1) {
9
+ + // Exclude local packages and local applications entirely — they live under
10
+ + // packages/local or applications/local (or use the @local/ scope), are
11
+ + // bundled into the runtimes at build time, and must never be shown for
12
+ + // selection or get their own version bump.
13
+ + const pkgDirByName = new Map(allPackages.map(p => [p.packageJson.name, (p.dir || '').replace(/\\/g, '/')]));
14
+ + const isLocalPackage = pkgName => {
15
+ + const dir = pkgDirByName.get(pkgName) || '';
16
+ + return pkgName.startsWith('@local/') || dir.includes('/packages/local/') || dir.includes('/applications/local/');
17
+ + };
18
+ + changedPackages = changedPackages.filter(name => !isLocalPackage(name));
19
+ const unchangedPackagesNames = allPackages.map(({
20
+ packageJson
21
+ - }) => packageJson.name).filter(name => !changedPackages.includes(name));
22
+ + }) => packageJson.name).filter(name => !changedPackages.includes(name) && !isLocalPackage(name));
23
+ const defaultChoiceList = [{
24
+ name: "changed packages",
25
+ choices: changedPackages
26
+ @@ -310,9 +320,10 @@ async function createChangeset(changedPackages, allPackages) {
27
+ const packagesToRelease = await getPackagesToRelease(changedPackages, allPackages);
28
+ let pkgJsonsByName = getPkgJsonsByName(allPackages);
29
+ let pkgsLeftToGetBumpTypeFor = new Set(packagesToRelease);
30
+ - let pkgsThatShouldBeMajorBumped = (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
31
+ + let nonRuntimePackages = packagesToRelease.filter(pkgName => !pkgName.includes('unisphere-runtime-'));
32
+ + let pkgsThatShouldBeMajorBumped = nonRuntimePackages.length > 0 ? (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
33
+ name: "all packages",
34
+ - choices: packagesToRelease.map(pkgName => {
35
+ + choices: nonRuntimePackages.map(pkgName => {
36
+ return {
37
+ name: pkgName,
38
+ message: formatPkgNameAndVersion(pkgName, pkgJsonsByName.get(pkgName).version)
39
+ @@ -325,7 +336,7 @@ async function createChangeset(changedPackages, allPackages) {
40
+ return x.filter(x => x !== "all packages").map(x => cyan(x)).join(", ");
41
+ }
42
+ return x;
43
+ - })).filter(x => x !== "all packages");
44
+ + })).filter(x => x !== "all packages") : [];
45
+ for (const pkgName of pkgsThatShouldBeMajorBumped) {
46
+ // for packages that are under v1, we want to make sure major releases are intended,
47
+ // as some repo-wide sweeping changes have mistakenly release first majors
48
+ diff --git a/node_modules/@changesets/cli/dist/changesets-cli.esm.js b/node_modules/@changesets/cli/dist/changesets-cli.esm.js
49
+ index 6c363c0..f18a637 100644
50
+ --- a/node_modules/@changesets/cli/dist/changesets-cli.esm.js
51
+ +++ b/node_modules/@changesets/cli/dist/changesets-cli.esm.js
52
+ @@ -234,9 +234,19 @@ async function getPackagesToRelease(changedPackages, allPackages) {
53
+ });
54
+ }
55
+ if (allPackages.length > 1) {
56
+ + // Exclude local packages and local applications entirely — they live under
57
+ + // packages/local or applications/local (or use the @local/ scope), are
58
+ + // bundled into the runtimes at build time, and must never be shown for
59
+ + // selection or get their own version bump.
60
+ + const pkgDirByName = new Map(allPackages.map(p => [p.packageJson.name, (p.dir || '').replace(/\\/g, '/')]));
61
+ + const isLocalPackage = pkgName => {
62
+ + const dir = pkgDirByName.get(pkgName) || '';
63
+ + return pkgName.startsWith('@local/') || dir.includes('/packages/local/') || dir.includes('/applications/local/');
64
+ + };
65
+ + changedPackages = changedPackages.filter(name => !isLocalPackage(name));
66
+ const unchangedPackagesNames = allPackages.map(({
67
+ packageJson
68
+ - }) => packageJson.name).filter(name => !changedPackages.includes(name));
69
+ + }) => packageJson.name).filter(name => !changedPackages.includes(name) && !isLocalPackage(name));
70
+ const defaultChoiceList = [{
71
+ name: "changed packages",
72
+ choices: changedPackages
73
+ @@ -272,9 +282,10 @@ async function createChangeset(changedPackages, allPackages) {
74
+ const packagesToRelease = await getPackagesToRelease(changedPackages, allPackages);
75
+ let pkgJsonsByName = getPkgJsonsByName(allPackages);
76
+ let pkgsLeftToGetBumpTypeFor = new Set(packagesToRelease);
77
+ - let pkgsThatShouldBeMajorBumped = (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
78
+ + let nonRuntimePackages = packagesToRelease.filter(pkgName => !pkgName.includes('unisphere-runtime-'));
79
+ + let pkgsThatShouldBeMajorBumped = nonRuntimePackages.length > 0 ? (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
80
+ name: "all packages",
81
+ - choices: packagesToRelease.map(pkgName => {
82
+ + choices: nonRuntimePackages.map(pkgName => {
83
+ return {
84
+ name: pkgName,
85
+ message: formatPkgNameAndVersion(pkgName, pkgJsonsByName.get(pkgName).version)
86
+ @@ -287,7 +298,7 @@ async function createChangeset(changedPackages, allPackages) {
87
+ return x.filter(x => x !== "all packages").map(x => cyan(x)).join(", ");
88
+ }
89
+ return x;
90
+ - })).filter(x => x !== "all packages");
91
+ + })).filter(x => x !== "all packages") : [];
92
+ for (const pkgName of pkgsThatShouldBeMajorBumped) {
93
+ // for packages that are under v1, we want to make sure major releases are intended,
94
+ // as some repo-wide sweeping changes have mistakenly release first majors
@@ -0,0 +1,18 @@
1
+ import { Tree } from '@nx/devkit';
2
+ /**
3
+ * Migration: Update @changesets/cli patch to also exclude local packages and
4
+ * local applications from the changeset flow.
5
+ *
6
+ * The previous patch (shipped in 3.0.0) only filtered `unisphere-runtime-*`
7
+ * packages out of the MAJOR bump prompt. This updated patch additionally
8
+ * excludes local packages and local applications (anything under
9
+ * `packages/local` / `applications/local`, or using the `@local/` scope) from
10
+ * `getPackagesToRelease` — so they never appear in the "Which packages would
11
+ * you like to include?" prompt and never get their own version bump. Runtimes
12
+ * keep their existing behavior (dropped from the major prompt only).
13
+ *
14
+ * Replaces any existing @changesets/cli patch in the consuming project's
15
+ * `patches/` directory with the updated one bundled alongside this migration.
16
+ */
17
+ export default function update(tree: Tree): Promise<void>;
18
+ //# sourceMappingURL=update-changeset-patch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-changeset-patch.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-13-0/update-changeset-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAyB,MAAM,YAAY,CAAC;AAGzD;;;;;;;;;;;;;;GAcG;AACH,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B9D"}
@@ -0,0 +1,46 @@
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
+ /**
7
+ * Migration: Update @changesets/cli patch to also exclude local packages and
8
+ * local applications from the changeset flow.
9
+ *
10
+ * The previous patch (shipped in 3.0.0) only filtered `unisphere-runtime-*`
11
+ * packages out of the MAJOR bump prompt. This updated patch additionally
12
+ * excludes local packages and local applications (anything under
13
+ * `packages/local` / `applications/local`, or using the `@local/` scope) from
14
+ * `getPackagesToRelease` — so they never appear in the "Which packages would
15
+ * you like to include?" prompt and never get their own version bump. Runtimes
16
+ * keep their existing behavior (dropped from the major prompt only).
17
+ *
18
+ * Replaces any existing @changesets/cli patch in the consuming project's
19
+ * `patches/` directory with the updated one bundled alongside this migration.
20
+ */
21
+ async function update(tree) {
22
+ devkit_1.logger.info('🔄 Updating @changesets/cli patch');
23
+ try {
24
+ const patchesPath = 'patches';
25
+ const patchesTemplatePath = (0, path_1.join)(__dirname, 'patches');
26
+ const patchFileName = '@changesets+cli+2.29.7.patch';
27
+ // Delete existing changeset patch if it exists
28
+ if (tree.exists(patchesPath)) {
29
+ const existingFiles = tree.children(patchesPath);
30
+ for (const file of existingFiles) {
31
+ if (file.includes('@changesets+cli')) {
32
+ devkit_1.logger.info(`đŸ—‘ī¸ Removing existing patch: ${file}`);
33
+ tree.delete((0, path_1.join)(patchesPath, file));
34
+ }
35
+ }
36
+ }
37
+ // Copy the updated patch file
38
+ (0, devkit_1.generateFiles)(tree, patchesTemplatePath, `./${patchesPath}`, {});
39
+ devkit_1.logger.info(`✅ Updated patch: ${patchFileName}`);
40
+ devkit_1.logger.info('â„šī¸ This patch hides local packages and local applications from the changeset prompt, and keeps unisphere-runtime-* packages out of the major bump selection');
41
+ }
42
+ catch (error) {
43
+ devkit_1.logger.error(`❌ Failed to update patch: ${error?.message || 'Unknown error'}`);
44
+ throw error;
45
+ }
46
+ }
package/migrations.json CHANGED
@@ -514,6 +514,22 @@
514
514
  "cli": {
515
515
  "postUpdateMessage": "✅ ESLint: @nx/enforce-module-boundaries disabled for rollup.config.{js,mjs}"
516
516
  }
517
+ },
518
+ "4.12.6-comment-out-security-audit": {
519
+ "version": "4.12.6",
520
+ "description": "Comments out the Security Audit step (npx unisphere tools audit) in .github/workflows/cicd.yml",
521
+ "factory": "./dist/migrations/4-12-6/comment-out-security-audit.js",
522
+ "cli": {
523
+ "postUpdateMessage": "✅ Security Audit step commented out in .github/workflows/cicd.yml"
524
+ }
525
+ },
526
+ "4.13.0-update-changeset-patch": {
527
+ "version": "4.13.0",
528
+ "description": "Updates @changesets/cli patch to also hide local packages and local applications from the changeset prompt (runtimes stay out of the major bump selection)",
529
+ "factory": "./dist/migrations/4-13-0/update-changeset-patch.js",
530
+ "cli": {
531
+ "postUpdateMessage": "✅ @changesets/cli patch updated"
532
+ }
517
533
  }
518
534
  },
519
535
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "4.12.5",
3
+ "version": "4.13.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",