@unisphere/nx 4.12.5 → 4.12.6

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
+ }
package/migrations.json CHANGED
@@ -514,6 +514,14 @@
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
+ }
517
525
  }
518
526
  },
519
527
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "4.12.5",
3
+ "version": "4.12.6",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",