@unisphere/nx 4.4.1 → 4.4.2
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/dist/generators/add-application/add-application.d.ts.map +1 -1
- package/dist/generators/add-application/add-application.js +3 -1
- package/dist/generators/add-documentation/add-documentation.d.ts.map +1 -1
- package/dist/generators/add-documentation/add-documentation.js +9 -21
- package/dist/generators/add-documentation/schema.d.ts +0 -2
- package/dist/generators/add-documentation/schema.json +1 -11
- package/dist/generators/add-package/add-package.d.ts.map +1 -1
- package/dist/generators/add-package/add-package.js +3 -1
- package/dist/generators/add-runtime/add-runtime.d.ts.map +1 -1
- package/dist/generators/add-runtime/add-runtime.js +3 -1
- package/dist/generators/utils.d.ts +1 -0
- package/dist/generators/utils.d.ts.map +1 -1
- package/dist/generators/utils.js +22 -0
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts.map +1 -1
- package/dist/migrations/3-15-0/add-experience-documentation.js +0 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-application.d.ts","sourceRoot":"","sources":["../../../src/generators/add-application/add-application.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAgD,MAAM,YAAY,CAAC;AAE5G,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"add-application.d.ts","sourceRoot":"","sources":["../../../src/generators/add-application/add-application.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAgD,MAAM,YAAY,CAAC;AAE5G,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAwEzD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,6BAA6B,uBA6KvC;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -102,7 +102,9 @@ async function addApplicationGenerator(tree, options) {
|
|
|
102
102
|
subdirectory,
|
|
103
103
|
projectRoot,
|
|
104
104
|
};
|
|
105
|
-
// Check if
|
|
105
|
+
// Check if name already exists across all element types in .unisphere
|
|
106
|
+
(0, utils_1.validateElementNameUnique)(tree, applicationNameAsLowerDashCase, 'applications');
|
|
107
|
+
// Check if the application already exists on filesystem
|
|
106
108
|
if (tree.exists(projectRoot)) {
|
|
107
109
|
throw new Error(`Application "${applicationNameAsLowerDashCase}" already exists at ${projectRoot}.\n` +
|
|
108
110
|
'Please choose a different application name or remove the existing application first.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-documentation.d.ts","sourceRoot":"","sources":["../../../src/generators/add-documentation/add-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAiB,MAAM,YAAY,CAAC;AAG7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"add-documentation.d.ts","sourceRoot":"","sources":["../../../src/generators/add-documentation/add-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAiB,MAAM,YAAY,CAAC;AAG7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAsB3D,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,+BAA+B,qCAiJzC;AAED,eAAe,yBAAyB,CAAC"}
|
|
@@ -8,15 +8,7 @@ const path = tslib_1.__importStar(require("path"));
|
|
|
8
8
|
const utils_1 = require("../utils");
|
|
9
9
|
const discover_typedoc_plugins_1 = require("./discover-typedoc-plugins");
|
|
10
10
|
function validateOptions(options) {
|
|
11
|
-
if (options.
|
|
12
|
-
const namePattern = /^[a-zA-Z][a-zA-Z0-9\-\s]*$/;
|
|
13
|
-
if (!namePattern.test(options.name)) {
|
|
14
|
-
throw new Error(`Invalid value '${options.name}' for option 'name'\n` +
|
|
15
|
-
` Pattern: ^[a-zA-Z][a-zA-Z0-9\\-\\s]*$\n` +
|
|
16
|
-
` Received: ${options.name}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
if (!options.isExperienceLevel && options.subName) {
|
|
11
|
+
if (options.subName) {
|
|
20
12
|
const subNamePattern = /^[a-zA-Z][a-zA-Z0-9\-\s]*$/;
|
|
21
13
|
if (!subNamePattern.test(options.subName)) {
|
|
22
14
|
throw new Error(`Invalid value '${options.subName}' for option 'subName'\n` +
|
|
@@ -24,13 +16,6 @@ function validateOptions(options) {
|
|
|
24
16
|
` Received: ${options.subName}`);
|
|
25
17
|
}
|
|
26
18
|
}
|
|
27
|
-
if (!options.isExperienceLevel && !options.subName) {
|
|
28
|
-
throw new Error(`Missing required option: 'subName'\n` +
|
|
29
|
-
` Description: Sub-name for the documentation site (used when not experience-level)\n` +
|
|
30
|
-
` Type: string\n` +
|
|
31
|
-
` Pattern: ^[a-zA-Z][a-zA-Z0-9\\-\\s]*$\n` +
|
|
32
|
-
` Example: nx g @unisphere/nx:add-documentation --subName=api-docs`);
|
|
33
|
-
}
|
|
34
19
|
}
|
|
35
20
|
async function addDocumentationGenerator(tree, options) {
|
|
36
21
|
// Validate options
|
|
@@ -54,8 +39,8 @@ async function addDocumentationGenerator(tree, options) {
|
|
|
54
39
|
'This will update your workspace pattern to support documentation sites.');
|
|
55
40
|
}
|
|
56
41
|
}
|
|
57
|
-
// Resolve experience name
|
|
58
|
-
const documentationName =
|
|
42
|
+
// Resolve experience name from .unisphere config
|
|
43
|
+
const documentationName = unisphereConfig.name;
|
|
59
44
|
const documentationNameAsLowerDashCase = (0, devkit_1.names)(documentationName).fileName;
|
|
60
45
|
devkit_1.logger.info(`Using experience name: ${documentationNameAsLowerDashCase}`);
|
|
61
46
|
// Build the full documentation name
|
|
@@ -64,10 +49,13 @@ async function addDocumentationGenerator(tree, options) {
|
|
|
64
49
|
? `${documentationNameAsLowerDashCase}-${subNameAsLowerDashCase}`
|
|
65
50
|
: documentationNameAsLowerDashCase;
|
|
66
51
|
const projectRoot = `unisphere/documentation/${fullDocumentationName}`;
|
|
67
|
-
// Check if
|
|
52
|
+
// Check if name already exists across all element types in .unisphere
|
|
53
|
+
(0, utils_1.validateElementNameUnique)(tree, fullDocumentationName, 'documentation');
|
|
54
|
+
// Check if documentation already exists on filesystem
|
|
68
55
|
if (tree.exists(projectRoot)) {
|
|
69
|
-
|
|
70
|
-
|
|
56
|
+
const docType = subNameAsLowerDashCase ? `sub-documentation "${subNameAsLowerDashCase}"` : 'main documentation';
|
|
57
|
+
throw new Error(`Documentation site already exists: ${docType} at ${projectRoot}.\n` +
|
|
58
|
+
'Please choose a different sub-name or remove the existing documentation site first.');
|
|
71
59
|
}
|
|
72
60
|
// Discover publishable packages for typedoc plugin auto-configuration
|
|
73
61
|
const discoveredPlugins = (0, discover_typedoc_plugins_1.discoverTypedocPlugins)(tree, projectRoot);
|
|
@@ -4,19 +4,9 @@
|
|
|
4
4
|
"title": "Add Documentation Generator",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
|
-
"name": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "Experience name. Auto-resolved from .unisphere config if not provided.",
|
|
10
|
-
"pattern": "^[a-zA-Z][a-zA-Z0-9\\-\\s]*$"
|
|
11
|
-
},
|
|
12
|
-
"isExperienceLevel": {
|
|
13
|
-
"type": "boolean",
|
|
14
|
-
"description": "Whether this is an experience-level documentation site (no sub-name needed)",
|
|
15
|
-
"default": false
|
|
16
|
-
},
|
|
17
7
|
"subName": {
|
|
18
8
|
"type": "string",
|
|
19
|
-
"description": "Sub-name for the documentation site
|
|
9
|
+
"description": "Sub-name for the documentation site. If not provided, creates the main experience-level documentation.",
|
|
20
10
|
"pattern": "^[a-zA-Z][a-zA-Z0-9\\-\\s]*$"
|
|
21
11
|
},
|
|
22
12
|
"skipInstall": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-package.d.ts","sourceRoot":"","sources":["../../../src/generators/add-package/add-package.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAgD,MAAM,YAAY,CAAC;AAE5G,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"add-package.d.ts","sourceRoot":"","sources":["../../../src/generators/add-package/add-package.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAgD,MAAM,YAAY,CAAC;AAE5G,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AA+GrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBA2HnC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -128,7 +128,9 @@ async function addPackageGenerator(tree, options) {
|
|
|
128
128
|
...transformedPackageName,
|
|
129
129
|
tmpl: '',
|
|
130
130
|
};
|
|
131
|
-
// Check if
|
|
131
|
+
// Check if name already exists across all element types in .unisphere
|
|
132
|
+
(0, utils_1.validateElementNameUnique)(tree, userInputPackageName, 'packages');
|
|
133
|
+
// Check if the project already exists on filesystem
|
|
132
134
|
if (tree.exists(projectRoot)) {
|
|
133
135
|
throw new Error(`Package "${userInputPackageName}" already exists at ${projectRoot}.\n` +
|
|
134
136
|
'Please choose a different package name or remove the existing package first.');
|
|
@@ -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;AAElG,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,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;AAElG,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAgErD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBA4GnC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -64,7 +64,9 @@ async function addRuntimeGenerator(tree, options) {
|
|
|
64
64
|
tmpl: '',
|
|
65
65
|
};
|
|
66
66
|
const projectRoot = `unisphere/runtimes/${userInputRuntimeName}`;
|
|
67
|
-
// Check if
|
|
67
|
+
// Check if name already exists across all element types in .unisphere
|
|
68
|
+
(0, utils_1.validateElementNameUnique)(tree, userInputRuntimeName, 'runtimes');
|
|
69
|
+
// Check if the runtime already exists on filesystem
|
|
68
70
|
if (tree.exists(projectRoot)) {
|
|
69
71
|
throw new Error(`Runtime "${userInputRuntimeName}" already exists at ${projectRoot}.\n` +
|
|
70
72
|
'Please choose a different runtime name or remove the existing runtime first.');
|
|
@@ -9,6 +9,7 @@ export interface UnisphereConfig {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function validateUnisphereConfig(tree: Tree): UnisphereConfig;
|
|
11
11
|
export declare function updateTsConfigPaths(tree: Tree, pathKey: string, pathValue: string): void;
|
|
12
|
+
export declare function validateElementNameUnique(tree: Tree, elementName: string, targetType: 'packages' | 'runtimes' | 'applications' | 'documentation'): void;
|
|
12
13
|
export declare function updateUnisphereConfig(tree: Tree, elementType: 'packages' | 'runtimes' | 'applications' | 'documentation', elementName: string, elementConfig: Record<string, any>): void;
|
|
13
14
|
export declare function validateRuntimeExists(tree: Tree, runtimeName: string): string;
|
|
14
15
|
export declare function findCorePackageAlias(tree: Tree): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/generators/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAKL,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE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AE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAwBlF;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAgB7E;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,WAAW,GAAG,cAAc,GAAG,OAAO,GAAG,YAAY,GAAG,cAAc,GAAG,aAAa,GAAG,MAAM,CAE9I;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWnF;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI3E;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACpB,IAAI,CAyBN"}
|
package/dist/generators/utils.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateUnisphereConfig = validateUnisphereConfig;
|
|
4
4
|
exports.updateTsConfigPaths = updateTsConfigPaths;
|
|
5
|
+
exports.validateElementNameUnique = validateElementNameUnique;
|
|
5
6
|
exports.updateUnisphereConfig = updateUnisphereConfig;
|
|
6
7
|
exports.validateRuntimeExists = validateRuntimeExists;
|
|
7
8
|
exports.findCorePackageAlias = findCorePackageAlias;
|
|
@@ -171,6 +172,27 @@ function updateTsConfigPaths(tree, pathKey, pathValue) {
|
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
174
|
}
|
|
175
|
+
function validateElementNameUnique(tree, elementName, targetType) {
|
|
176
|
+
if (!tree.exists('.unisphere')) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const config = (0, devkit_1.readJson)(tree, '.unisphere');
|
|
180
|
+
const elements = config.elements || {};
|
|
181
|
+
const allTypes = ['packages', 'runtimes', 'applications', 'documentation'];
|
|
182
|
+
for (const type of allTypes) {
|
|
183
|
+
if (elements[type] && elements[type][elementName]) {
|
|
184
|
+
if (type === targetType) {
|
|
185
|
+
throw new Error(`A ${type.slice(0, -1)} named "${elementName}" already exists.\n` +
|
|
186
|
+
` Registered in .unisphere under elements.${type}.`);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
throw new Error(`The name "${elementName}" is already used by a ${type.slice(0, -1)}.\n` +
|
|
190
|
+
` Registered in .unisphere under elements.${type}.\n` +
|
|
191
|
+
` Names must be unique across all element types (packages, runtimes, applications, documentation).`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
174
196
|
function updateUnisphereConfig(tree, elementType, elementName, elementConfig) {
|
|
175
197
|
const existingConfig = (0, devkit_1.readJson)(tree, '.unisphere');
|
|
176
198
|
// Ensure elements structure exists
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-experience-documentation.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-15-0/add-experience-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAG1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"add-experience-documentation.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-15-0/add-experience-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAG1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ9D"}
|
|
@@ -13,7 +13,6 @@ const add_documentation_1 = require("../../generators/add-documentation/add-docu
|
|
|
13
13
|
async function update(tree) {
|
|
14
14
|
devkit_1.logger.info('📖 Creating experience-level documentation site...');
|
|
15
15
|
await (0, add_documentation_1.addDocumentationGenerator)(tree, {
|
|
16
|
-
isExperienceLevel: true,
|
|
17
16
|
skipInstall: true,
|
|
18
17
|
});
|
|
19
18
|
devkit_1.logger.info('✅ Documentation site created successfully.');
|