@unisphere/nx 4.4.0 → 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.
@@ -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;AAuEzD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,6BAA6B,uBA0KvC;AAED,eAAe,uBAAuB,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 the application already exists
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;AA0C3D,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,+BAA+B,qCA6IzC;AAED,eAAe,yBAAyB,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.name) {
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: use --name flag, or auto-resolve from .unisphere config
58
- const documentationName = options.name || unisphereConfig.name;
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 the documentation site already exists
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
- throw new Error(`Documentation site "${fullDocumentationName}" already exists at ${projectRoot}.\n` +
70
- 'Please choose a different name or remove the existing documentation site first.');
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);
@@ -1,6 +1,4 @@
1
1
  export interface AddDocumentationGeneratorSchema {
2
- name?: string;
3
- isExperienceLevel?: boolean;
4
2
  subName?: string;
5
3
  skipInstall?: boolean;
6
4
  }
@@ -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 (used when not experience-level)",
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;AA8GrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBAwHnC;AAED,eAAe,mBAAmB,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 the project already exists
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;AAgFrD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBA8GnC;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;AAElG,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAgErD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,uBA4GnC;AAED,eAAe,mBAAmB,CAAC"}
@@ -12,7 +12,7 @@ function validateOptions(options) {
12
12
  ` Description: The name of the runtime to create\n` +
13
13
  ` Type: string\n` +
14
14
  ` Pattern: ^[a-zA-Z][a-zA-Z0-9\\-\\s]*$\n` +
15
- ` Example: nx g @unisphere/nx:add-runtime --name=my-runtime --consumer=external`);
15
+ ` Example: nx g @unisphere/nx:add-runtime --name=my-runtime`);
16
16
  }
17
17
  const namePattern = /^[a-zA-Z][a-zA-Z0-9\-\s]*$/;
18
18
  if (!namePattern.test(options.name)) {
@@ -20,17 +20,6 @@ function validateOptions(options) {
20
20
  ` Pattern: ^[a-zA-Z][a-zA-Z0-9\\-\\s]*$\n` +
21
21
  ` Received: ${options.name}`);
22
22
  }
23
- if (!options.consumer) {
24
- throw new Error(`Missing required option: 'consumer'\n` +
25
- ` Description: Is this runtime loaded from within the same experience or by an external consumer?\n` +
26
- ` Allowed values: external, internal\n` +
27
- ` Example: nx g @unisphere/nx:add-runtime --name=my-runtime --consumer=external`);
28
- }
29
- if (!['external', 'internal'].includes(options.consumer)) {
30
- throw new Error(`Invalid value '${options.consumer}' for option 'consumer'\n` +
31
- ` Allowed values: external, internal\n` +
32
- ` Received: ${options.consumer}`);
33
- }
34
23
  }
35
24
  function updateTypesIndexExport(tree, runtimeName, basePath) {
36
25
  const indexPath = `${basePath}/src/index.ts`;
@@ -52,7 +41,6 @@ function updateTypesIndexExport(tree, runtimeName, basePath) {
52
41
  }
53
42
  async function addRuntimeGenerator(tree, options) {
54
43
  validateOptions(options);
55
- let isExternal = options?.consumer === 'external' ? true : false;
56
44
  // Validate and read .unisphere configuration
57
45
  const unisphereConfig = (0, utils_1.validateUnisphereConfig)(tree);
58
46
  // Validate dependencies
@@ -76,7 +64,9 @@ async function addRuntimeGenerator(tree, options) {
76
64
  tmpl: '',
77
65
  };
78
66
  const projectRoot = `unisphere/runtimes/${userInputRuntimeName}`;
79
- // Check if the runtime already exists
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
80
70
  if (tree.exists(projectRoot)) {
81
71
  throw new Error(`Runtime "${userInputRuntimeName}" already exists at ${projectRoot}.\n` +
82
72
  'Please choose a different runtime name or remove the existing runtime first.');
@@ -117,8 +107,6 @@ async function addRuntimeGenerator(tree, options) {
117
107
  if (analyticsAppId) {
118
108
  devkit_1.logger.info(`📊 Analytics App ID: ${analyticsAppId}`);
119
109
  }
120
- devkit_1.logger.info(`🔧 Consumer: ${isExternal ? 'External' : 'Internal'}`);
121
- devkit_1.logger.info('');
122
110
  devkit_1.logger.info('📝 Next steps:');
123
111
  devkit_1.logger.info(` 1. Add a visual: nx g @unisphere/nx:add-visual --runtimeName=${userInputRuntimeName}`);
124
112
  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
- consumer: 'external' | 'internal';
4
3
  dependencies?: string[];
5
4
  analyticsAppId?: number;
6
5
  }
@@ -9,11 +9,6 @@
9
9
  "description": "The name of the runtime to create",
10
10
  "pattern": "^[a-zA-Z][a-zA-Z0-9\\-\\s]*$"
11
11
  },
12
- "consumer": {
13
- "type": "string",
14
- "description": "Is this runtime loaded from within the same experience or by an external consumer?",
15
- "enum": ["external", "internal"]
16
- },
17
12
  "dependencies": {
18
13
  "type": "array",
19
14
  "description": "Packages to install (react, ds, or mui)",
@@ -29,7 +24,6 @@
29
24
  }
30
25
  },
31
26
  "required": [
32
- "name",
33
- "consumer"
27
+ "name"
34
28
  ]
35
29
  }
@@ -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,CAAC;KACnB,CAAC,CAAC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M,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"}
@@ -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,CAS9D"}
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.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "4.4.0",
3
+ "version": "4.4.2",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",