diff --git a/docs/generated/devkit/nx_devkit.md b/docs/generated/devkit/nx_devkit.md index bb34792585efdb..701054a8d1e6a0 100644 --- a/docs/generated/devkit/nx_devkit.md +++ b/docs/generated/devkit/nx_devkit.md @@ -992,9 +992,9 @@ Use this to expose a compatible Angular Builder #### Parameters -| Name | Type | -| :--------- | :-------------------------------------------------------------- | -| `executor` | [`Executor`](../../devkit/documents/nx_devkit#executor)<`any`\> | +| Name | Type | +| :--------- | :------------------------------------------------------ | +| `executor` | [`Executor`](../../devkit/documents/nx_devkit#executor) | #### Returns diff --git a/docs/generated/packages/devkit/documents/nx_devkit.md b/docs/generated/packages/devkit/documents/nx_devkit.md index bb34792585efdb..701054a8d1e6a0 100644 --- a/docs/generated/packages/devkit/documents/nx_devkit.md +++ b/docs/generated/packages/devkit/documents/nx_devkit.md @@ -992,9 +992,9 @@ Use this to expose a compatible Angular Builder #### Parameters -| Name | Type | -| :--------- | :-------------------------------------------------------------- | -| `executor` | [`Executor`](../../devkit/documents/nx_devkit#executor)<`any`\> | +| Name | Type | +| :--------- | :------------------------------------------------------ | +| `executor` | [`Executor`](../../devkit/documents/nx_devkit#executor) | #### Returns diff --git a/packages/workspace/src/generators/new/new.ts b/packages/workspace/src/generators/new/new.ts index 9c83395d3a5e7b..76e2877cdf109a 100644 --- a/packages/workspace/src/generators/new/new.ts +++ b/packages/workspace/src/generators/new/new.ts @@ -118,11 +118,19 @@ function normalizeOptions(options: Schema): NormalizedSchema { ...options, }; - normalized.name = names(options.name).fileName; if (!options.directory) { normalized.directory = options.name; } + // Repository name is the filename, but removes segments with numbers. + // This prevents errors where the path becomes the npm scope which is + // used as things like the selector for angular components, which are + // only allowed to start with a letter. + normalized.name = names(options.name) + .fileName.split('-') + .filter((segment) => /^[A-z]+$/.test(segment)) + .join('-'); + const parsed = parsePresetName(options.preset); normalized.preset = parsed.package;