@unisphere/nx 4.11.0 ā 4.12.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.
- package/README.md +0 -1
- package/dist/generators/add-runtime/add-runtime.d.ts.map +1 -1
- package/dist/generators/add-runtime/add-runtime.js +0 -5
- package/dist/generators/add-runtime/schema.d.ts +0 -1
- package/dist/generators/add-runtime/schema.json +0 -4
- package/dist/generators/add-runtime/templates/new-runtime/src/lib/runtime.tsx.template +0 -22
- package/dist/migrations/4-12-0/ensure-env-template-in-applications.d.ts +3 -0
- package/dist/migrations/4-12-0/ensure-env-template-in-applications.d.ts.map +1 -0
- package/dist/migrations/4-12-0/ensure-env-template-in-applications.js +30 -0
- package/migrations.json +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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,
|
|
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}`);
|
|
@@ -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 @@
|
|
|
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
|
+
}
|
package/migrations.json
CHANGED
|
@@ -490,6 +490,14 @@
|
|
|
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
|
+
}
|
|
493
501
|
}
|
|
494
502
|
},
|
|
495
503
|
"packageJsonUpdates": {
|
|
@@ -846,6 +854,17 @@
|
|
|
846
854
|
"alwaysAddToPackageJson": false
|
|
847
855
|
}
|
|
848
856
|
}
|
|
857
|
+
},
|
|
858
|
+
"4.12.0": {
|
|
859
|
+
"version": "4.12.0",
|
|
860
|
+
"cli": "nx",
|
|
861
|
+
"postUpdateMessage": "š Migration to @unisphere/nx 4.12.0 completed successfully!",
|
|
862
|
+
"packages": {
|
|
863
|
+
"@unisphere/cli": {
|
|
864
|
+
"version": "5.2.1",
|
|
865
|
+
"alwaysAddToPackageJson": false
|
|
866
|
+
}
|
|
867
|
+
}
|
|
849
868
|
}
|
|
850
869
|
}
|
|
851
870
|
}
|