@unisphere/nx 4.1.0 → 4.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-4/summary.ts"],"names":[],"mappings":"AAIA,0CAUC"}
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-4/summary.ts"],"names":[],"mappings":"AAGA,0CAQC"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = default_1;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const open_1 = require("../utils/open");
6
5
  const url = 'https://unisphere.kaltura.com/docs/create/changelog/v1-x-major-release';
7
6
  async function default_1() {
8
7
  devkit_1.logger.info('');
@@ -11,6 +10,5 @@ async function default_1() {
11
10
  devkit_1.logger.info('📋 Full details:');
12
11
  devkit_1.logger.info(url);
13
12
  devkit_1.logger.info('');
14
- (0, open_1.openBrowser)(url);
15
13
  devkit_1.logger.info('Opening changelog in browser...');
16
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-0-0/summary.ts"],"names":[],"mappings":"AAMA,0CAUC"}
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-0-0/summary.ts"],"names":[],"mappings":"AAKA,0CASC"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = default_1;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const open_1 = require("../utils/open");
6
5
  const url = 'https://unisphere.kaltura.com/docs/create/changelog/v2-x-major-release';
7
6
  const version = 'Major 2';
8
7
  async function default_1() {
@@ -12,6 +11,5 @@ async function default_1() {
12
11
  devkit_1.logger.info('📋 Full details:');
13
12
  devkit_1.logger.info(url);
14
13
  devkit_1.logger.info('');
15
- (0, open_1.openBrowser)(url);
16
14
  devkit_1.logger.info('Opening changelog in browser...');
17
15
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Migration: Add .gitignore to Documentation Sites
3
+ *
4
+ * Adds a standard .gitignore file to all documentation sites under unisphere/documentation/*.
5
+ * This ensures documentation sites have proper ignore patterns for dependencies, build artifacts,
6
+ * and generated files.
7
+ */
8
+ import { Tree } from '@nx/devkit';
9
+ export default function update(tree: Tree): Promise<void>;
10
+ //# sourceMappingURL=add-gitignore-to-documentation-sites.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-gitignore-to-documentation-sites.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-1-3/add-gitignore-to-documentation-sites.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAuB,MAAM,YAAY,CAAC;AAEvD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAwD9D"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /**
3
+ * Migration: Add .gitignore to Documentation Sites
4
+ *
5
+ * Adds a standard .gitignore file to all documentation sites under unisphere/documentation/*.
6
+ * This ensures documentation sites have proper ignore patterns for dependencies, build artifacts,
7
+ * and generated files.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.default = update;
11
+ const devkit_1 = require("@nx/devkit");
12
+ async function update(tree) {
13
+ devkit_1.logger.info('🔄 Adding .gitignore to documentation sites...');
14
+ // Content specified by user
15
+ const content = `# Dependencies
16
+ node_modules
17
+
18
+ # Production
19
+ build
20
+
21
+ # Generated files
22
+ .docusaurus
23
+ .cache-loader
24
+ `;
25
+ const docsBasePath = 'unisphere/documentation';
26
+ if (!tree.exists(docsBasePath)) {
27
+ devkit_1.logger.info('â„šī¸ No documentation sites found, skipping');
28
+ return;
29
+ }
30
+ const docsSites = tree.children(docsBasePath);
31
+ if (docsSites.length === 0) {
32
+ devkit_1.logger.info('â„šī¸ No documentation sites found, skipping');
33
+ return;
34
+ }
35
+ let updatedCount = 0;
36
+ let createdCount = 0;
37
+ for (const site of docsSites) {
38
+ const sitePath = `${docsBasePath}/${site}`;
39
+ const filePath = `${sitePath}/.gitignore`;
40
+ try {
41
+ const exists = tree.exists(filePath);
42
+ tree.write(filePath, content);
43
+ if (exists) {
44
+ devkit_1.logger.info(`✅ Updated ${filePath}`);
45
+ updatedCount++;
46
+ }
47
+ else {
48
+ devkit_1.logger.info(`✅ Created ${filePath}`);
49
+ createdCount++;
50
+ }
51
+ }
52
+ catch (error) {
53
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
54
+ devkit_1.logger.warn(`âš ī¸ Failed to update ${filePath}: ${errorMessage}`);
55
+ }
56
+ }
57
+ devkit_1.logger.info(`✅ Processed ${docsSites.length} documentation site(s): ${createdCount} created, ${updatedCount} updated`);
58
+ await (0, devkit_1.formatFiles)(tree);
59
+ }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=add-security-audit-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-security-audit-gate.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-2-0/add-security-audit-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AActD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAK9D"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = update;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const AUDIT_ALLOWLIST = [
6
+ 'minimatch',
7
+ 'picomatch',
8
+ 'koa',
9
+ 'serialize-javascript',
10
+ 'esbuild',
11
+ ];
12
+ const AUDIT_STEP = `
13
+ - name: Security Audit
14
+ run: npx unisphere tools audit`;
15
+ async function update(tree) {
16
+ devkit_1.logger.info('🔄 Adding security audit gate...');
17
+ seedAllowlist(tree);
18
+ addCicdStep(tree);
19
+ }
20
+ function seedAllowlist(tree) {
21
+ const packageJsonPath = 'package.json';
22
+ if (!tree.exists(packageJsonPath)) {
23
+ devkit_1.logger.warn('âš ī¸ No package.json found, skipping allowlist seed');
24
+ return;
25
+ }
26
+ (0, devkit_1.updateJson)(tree, packageJsonPath, (packageJson) => {
27
+ if (!packageJson.unisphere) {
28
+ packageJson.unisphere = {};
29
+ }
30
+ if (!packageJson.unisphere.audit) {
31
+ packageJson.unisphere.audit = {};
32
+ }
33
+ packageJson.unisphere.audit.allowlist = [...AUDIT_ALLOWLIST];
34
+ return packageJson;
35
+ });
36
+ devkit_1.logger.info('✅ Seeded audit allowlist in package.json');
37
+ }
38
+ function addCicdStep(tree) {
39
+ const cicdPath = '.github/workflows/cicd.yml';
40
+ if (!tree.exists(cicdPath)) {
41
+ devkit_1.logger.warn('âš ī¸ No cicd.yml found');
42
+ throw new Error('No cicd.yml found');
43
+ }
44
+ let content = tree.read(cicdPath, 'utf-8');
45
+ if (!content) {
46
+ devkit_1.logger.warn('âš ī¸ Could not read cicd.yml');
47
+ throw new Error('Could not read cicd.yml');
48
+ }
49
+ if (content.includes('Security Audit')) {
50
+ devkit_1.logger.info('â„šī¸ Security Audit step already exists in cicd.yml, skipping');
51
+ return;
52
+ }
53
+ const installDepsMatch = content.match(/( *- name: Install Dependencies\n(?:.*\n)*?)( - name: )/);
54
+ if (!installDepsMatch) {
55
+ devkit_1.logger.warn('âš ī¸ Could not find Install Dependencies step in cicd.yml');
56
+ throw new Error('Could not find Install Dependencies step in cicd.yml');
57
+ }
58
+ const insertIndex = installDepsMatch.index + installDepsMatch[1].length;
59
+ content =
60
+ content.slice(0, insertIndex) +
61
+ AUDIT_STEP +
62
+ '\n\n' +
63
+ content.slice(insertIndex);
64
+ tree.write(cicdPath, content);
65
+ devkit_1.logger.info('✅ Added Security Audit step to cicd.yml');
66
+ }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=remove-ts-jest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-ts-jest.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-2-0/remove-ts-jest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAEtD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB9D"}
@@ -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('🔄 Removing ts-jest from devDependencies...');
7
+ const packageJsonPath = 'package.json';
8
+ if (!tree.exists(packageJsonPath)) {
9
+ devkit_1.logger.warn('âš ī¸ No package.json found, skipping');
10
+ return;
11
+ }
12
+ let removed = false;
13
+ (0, devkit_1.updateJson)(tree, packageJsonPath, (packageJson) => {
14
+ if (packageJson.devDependencies?.['ts-jest']) {
15
+ delete packageJson.devDependencies['ts-jest'];
16
+ removed = true;
17
+ }
18
+ return packageJson;
19
+ });
20
+ if (removed) {
21
+ devkit_1.logger.info('✅ Removed ts-jest from devDependencies');
22
+ }
23
+ else {
24
+ devkit_1.logger.info('â„šī¸ ts-jest not found in devDependencies, skipping');
25
+ }
26
+ }
package/migrations.json CHANGED
@@ -405,11 +405,35 @@
405
405
  },
406
406
  "3-24-0-update-runtime-logger-call": {
407
407
  "version": "3.24.0",
408
- "description": "Updates runtime logger call from warn to log for missing analytics app id",
408
+ "description": "Updates runtime logger call to log for missing analytics app id",
409
409
  "factory": "./dist/migrations/3-24-0/update-runtime-logger-call.js",
410
410
  "cli": {
411
411
  "postUpdateMessage": "✅ Runtime logger calls updated"
412
412
  }
413
+ },
414
+ "4-1-3-add-gitignore-to-documentation-sites": {
415
+ "version": "4.1.3",
416
+ "description": "Adds .gitignore files to all documentation sites",
417
+ "factory": "./dist/migrations/4-1-3/add-gitignore-to-documentation-sites.js",
418
+ "cli": {
419
+ "postUpdateMessage": "✅ .gitignore files added to documentation sites"
420
+ }
421
+ },
422
+ "4-2-0-remove-ts-jest": {
423
+ "version": "4.2.0",
424
+ "description": "Removes unused ts-jest dependency (source of critical handlebars vulnerability)",
425
+ "factory": "./dist/migrations/4-2-0/remove-ts-jest.js",
426
+ "cli": {
427
+ "postUpdateMessage": "✅ ts-jest removed from devDependencies"
428
+ }
429
+ },
430
+ "4-2-0-add-security-audit-gate": {
431
+ "version": "4.2.0",
432
+ "description": "Adds security audit gate: seeds allowlist in package.json and adds Security Audit CI step",
433
+ "factory": "./dist/migrations/4-2-0/add-security-audit-gate.js",
434
+ "cli": {
435
+ "postUpdateMessage": "✅ Security audit gate configured: allowlist seeded and CI step added"
436
+ }
413
437
  }
414
438
  },
415
439
  "packageJsonUpdates": {
@@ -640,6 +664,17 @@
640
664
  "alwaysAddToPackageJson": false
641
665
  }
642
666
  }
667
+ },
668
+ "4.1.3": {
669
+ "version": "4.1.3",
670
+ "cli": "nx",
671
+ "postUpdateMessage": "🎉 Migration to @unisphere/nx 4.1.3 completed successfully!",
672
+ "packages": {
673
+ "@unisphere/cli": {
674
+ "version": "4.1.0",
675
+ "alwaysAddToPackageJson": false
676
+ }
677
+ }
643
678
  }
644
679
  }
645
- }
680
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "4.1.0",
3
+ "version": "4.3.0",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",