@unisphere/nx 4.11.0 → 4.12.1

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.
package/README.md CHANGED
@@ -33,7 +33,6 @@ Creates a new Unisphere runtime package.
33
33
 
34
34
  **Optional flags:**
35
35
  - `--dependencies`: Packages to install (comma-separated: `react`, `ds`, `mui`)
36
- - `--analyticsAppId`: Analytics app ID (number)
37
36
 
38
37
  **Example:**
39
38
  ```bash
@@ -1 +1 @@
1
- {"version":3,"file":"add-runtime.d.ts","sourceRoot":"","sources":["../../../src/generators/add-runtime/add-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAsC,MAAM,YAAY,CAAC;AAUlG,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AA0SrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,gBAgHnC;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"add-runtime.d.ts","sourceRoot":"","sources":["../../../src/generators/add-runtime/add-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAsC,MAAM,YAAY,CAAC;AAUlG,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AA0SrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,gBA0GnC;AAED,eAAe,mBAAmB,CAAC"}
@@ -201,11 +201,9 @@ async function addRuntimeGenerator(tree, options) {
201
201
  let userInputRuntimeName = (0, devkit_1.names)(options.name).fileName;
202
202
  // Find types package (or fallback to core)
203
203
  const typesPackageInfo = (0, utils_1.findTypesOrCorePackageInfo)(tree);
204
- const analyticsAppId = options.analyticsAppId;
205
204
  // Prepare template variables
206
205
  const templateVariables = {
207
206
  companyName,
208
- analyticsAppId,
209
207
  typesAlias: typesPackageInfo.alias,
210
208
  // Add all name transformations
211
209
  ...(0, utils_1.createNameTransforms)(userInputRuntimeName, 'runtimeName'),
@@ -253,9 +251,6 @@ async function addRuntimeGenerator(tree, options) {
253
251
  devkit_1.logger.info('');
254
252
  devkit_1.logger.info(`šŸš€ Runtime Name: ${userInputRuntimeName}`);
255
253
  devkit_1.logger.info(`šŸ“ Location: ${projectRoot}`);
256
- if (analyticsAppId) {
257
- devkit_1.logger.info(`šŸ“Š Analytics App ID: ${analyticsAppId}`);
258
- }
259
254
  devkit_1.logger.info('šŸ“ Next steps:');
260
255
  devkit_1.logger.info(` 1. Add a visual: nx g @unisphere/nx:add-visual --runtimeName=${userInputRuntimeName}`);
261
256
  devkit_1.logger.info(` 2. Add a dev app: nx g @unisphere/nx:add-application --name=${userInputRuntimeName}-dev --runtimeName=${userInputRuntimeName}`);
@@ -1,6 +1,5 @@
1
1
  export interface AddRuntimeGeneratorSchema {
2
2
  name: string;
3
3
  dependencies?: string[];
4
- analyticsAppId?: number;
5
4
  flavor?: string;
6
5
  }
@@ -18,10 +18,6 @@
18
18
  },
19
19
  "default": []
20
20
  },
21
- "analyticsAppId": {
22
- "type": "number",
23
- "description": "Analytics app ID (optional, can be set later in runtime constructor)"
24
- },
25
21
  "flavor": {
26
22
  "type": "string",
27
23
  "description": "Name of the flavor to add to an existing runtime (e.g. 'player-plugin')",
@@ -42,28 +42,6 @@ export class Runtime
42
42
  runtimeName: this.runtimeName,
43
43
  },
44
44
  });
45
-
46
-
47
- const analyticsAppId: null | number = <%= analyticsAppId ? analyticsAppId : 'null' %>;
48
- if (!analyticsAppId) {
49
- this._logger.log(`missing kaltura analytics app id, skip application registration to analytics service`)
50
- } else {
51
- const service = this._options
52
- .getWorkspace()
53
- .getService<KalturaAnalyticsServiceType>(
54
- 'unisphere.service.kaltura-analytics'
55
- );
56
-
57
- if (service) {
58
- service.registerUnisphereApp({
59
- analyticsAppId,
60
- appVersion: this._options.runtimeVersion,
61
- mode: process.env.NODE_ENV === 'production' ? undefined : 'dryRun',
62
- });
63
- } else {
64
- this._logger.warn('missing kaltura analytics service, cannot register analytics application id <%= analyticsAppId %>')
65
- }
66
- }
67
45
  }
68
46
 
69
47
  override _createVisualContainer(htmlElement: HTMLElement): Root {
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=ensure-env-template-in-applications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensure-env-template-in-applications.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-12-0/ensure-env-template-in-applications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AASpD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC9D"}
@@ -0,0 +1,30 @@
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
+ async function update(tree) {
7
+ devkit_1.logger.info('šŸ”„ Ensuring .env-template exists in all applications...');
8
+ if (!tree.exists('.unisphere')) {
9
+ devkit_1.logger.warn('āš ļø No .unisphere file found, skipping');
10
+ return;
11
+ }
12
+ const unisphereConfig = (0, devkit_1.readJson)(tree, '.unisphere');
13
+ const applications = unisphereConfig.elements?.applications;
14
+ if (!applications || Object.keys(applications).length === 0) {
15
+ devkit_1.logger.info('ā„¹ļø No applications found, skipping');
16
+ return;
17
+ }
18
+ let createdCount = 0;
19
+ for (const [appName, appConfig] of Object.entries(applications)) {
20
+ const envTemplatePath = (0, path_1.join)(appConfig.sourceRoot, '.env-template');
21
+ if (tree.exists(envTemplatePath)) {
22
+ devkit_1.logger.info(`ā„¹ļø ${appName}: .env-template already exists`);
23
+ continue;
24
+ }
25
+ tree.write(envTemplatePath, '');
26
+ createdCount++;
27
+ devkit_1.logger.info(`āœ… ${appName}: Created empty .env-template`);
28
+ }
29
+ devkit_1.logger.info(`\nāœ… Done: ${createdCount} .env-template file(s) created`);
30
+ }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=add-migrations-json-to-root-gitignore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-migrations-json-to-root-gitignore.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-12-1/add-migrations-json-to-root-gitignore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAE1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAmC9D"}
@@ -0,0 +1,36 @@
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 root .gitignore to add migrations-*.json...');
7
+ const gitignorePath = '.gitignore';
8
+ if (!tree.exists(gitignorePath)) {
9
+ devkit_1.logger.warn('āš ļø .gitignore file not found, creating one');
10
+ tree.write(gitignorePath, '');
11
+ }
12
+ try {
13
+ const currentContent = tree.read(gitignorePath, 'utf-8') || '';
14
+ let updatedContent = currentContent;
15
+ const entryRegex = /^migrations-\*\.json\s*$/gm;
16
+ if (!entryRegex.test(updatedContent)) {
17
+ if (!updatedContent.includes('# Nx migrations')) {
18
+ updatedContent = updatedContent.trim() + '\n\n# Nx migrations\n';
19
+ }
20
+ if (!updatedContent.includes('migrations-*.json')) {
21
+ updatedContent += 'migrations-*.json\n';
22
+ devkit_1.logger.info('šŸ“ Added migrations-*.json to .gitignore');
23
+ }
24
+ tree.write(gitignorePath, updatedContent);
25
+ devkit_1.logger.info('āœ… Successfully updated .gitignore');
26
+ }
27
+ else {
28
+ devkit_1.logger.info('ā„¹ļø migrations-*.json already exists in .gitignore');
29
+ }
30
+ }
31
+ catch (error) {
32
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
33
+ devkit_1.logger.error(`āŒ Failed to update .gitignore: ${errorMessage}`);
34
+ throw new Error(`Failed to update .gitignore: ${errorMessage}`);
35
+ }
36
+ }
package/migrations.json CHANGED
@@ -490,6 +490,22 @@
490
490
  "cli": {
491
491
  "postUpdateMessage": "āœ… Analytics types migrated to Application Events bucket pattern"
492
492
  }
493
+ },
494
+ "4.12.0-ensure-env-template-in-applications": {
495
+ "version": "4.12.0",
496
+ "description": "Ensures all applications have a .env-template file, creating an empty one if missing",
497
+ "factory": "./dist/migrations/4-12-0/ensure-env-template-in-applications.js",
498
+ "cli": {
499
+ "postUpdateMessage": "āœ… All applications now have a .env-template file"
500
+ }
501
+ },
502
+ "4.12.1-add-migrations-json-to-root-gitignore": {
503
+ "version": "4.12.1",
504
+ "description": "Adds migrations-*.json to root .gitignore",
505
+ "factory": "./dist/migrations/4-12-1/add-migrations-json-to-root-gitignore.js",
506
+ "cli": {
507
+ "postUpdateMessage": "āœ… .gitignore updated to exclude migrations-*.json"
508
+ }
493
509
  }
494
510
  },
495
511
  "packageJsonUpdates": {
@@ -846,6 +862,17 @@
846
862
  "alwaysAddToPackageJson": false
847
863
  }
848
864
  }
865
+ },
866
+ "4.12.0": {
867
+ "version": "4.12.0",
868
+ "cli": "nx",
869
+ "postUpdateMessage": "šŸŽ‰ Migration to @unisphere/nx 4.12.0 completed successfully!",
870
+ "packages": {
871
+ "@unisphere/cli": {
872
+ "version": "5.2.1",
873
+ "alwaysAddToPackageJson": false
874
+ }
875
+ }
849
876
  }
850
877
  }
851
878
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "4.11.0",
3
+ "version": "4.12.1",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",