Skip to content

Commit

Permalink
feat(misc): make directory a required option for generators (#28093)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
  • Loading branch information
3 people authored Oct 1, 2024
1 parent e0f2f02 commit 27edf71
Show file tree
Hide file tree
Showing 387 changed files with 2,488 additions and 4,087 deletions.
19 changes: 7 additions & 12 deletions docs/generated/packages/angular/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,17 @@
"type": "object",
"cli": "nx",
"properties": {
"name": {
"description": "The name of the application.",
"type": "string",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the application?",
"pattern": "^[a-zA-Z][^:]*$"
},
"directory": {
"description": "The directory of the new application.",
"type": "string",
"x-priority": "important"
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "Which directory do you want to create the application in?"
},
"projectNameAndRootFormat": {
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
"name": {
"description": "The name of the application.",
"type": "string",
"enum": ["as-provided", "derived"]
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"style": {
"description": "The file extension to be used for style files.",
Expand Down Expand Up @@ -184,7 +179,7 @@
}
},
"additionalProperties": false,
"required": ["name"],
"required": ["directory"],
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Application\" %}\n\nCreate an application named `my-app`:\n\n```bash\nnx g @nx/angular:application apps/my-app\n```\n\n{% /tab %}\n\n{% tab label=\"Specify directory and style extension\" %}\n\nCreate an application named `my-app` in the `my-dir` directory and use `scss` for styles:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=my-dir`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/angular:app my-dir/my-app --style=scss\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Components application\" %}\n\nCreate an application with Single File Components (inline styles and inline templates):\n\n```bash\nnx g @nx/angular:app apps/my-app --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Set custom prefix and tags\" %}\n\nSet the prefix to apply to generated selectors and add tags to the application (used for linting).\n\n```bash\nnx g @nx/angular:app apps/my-app --prefix=admin --tags=scope:admin,type:ui\n```\n\n{% /tab %}\n{% /tabs %}\n",
"presets": []
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
"description": "The directory of the new remote application if one needs to be created.",
"type": "string"
},
"projectNameAndRootFormat": {
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
},
"style": {
"description": "The file extension to be used for style files for the remote if one needs to be created.",
"type": "string",
Expand Down
21 changes: 9 additions & 12 deletions docs/generated/packages/angular/generators/host.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
}
],
"properties": {
"directory": {
"description": "The directory of the new application.",
"type": "string",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "Which directory do you want to create the application in?"
},
"name": {
"type": "string",
"description": "The name to give to the host Angular application.",
"$default": { "$source": "argv", "index": 0 },
"pattern": "^[a-zA-Z][^:]*$"
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"remotes": {
"type": "array",
Expand All @@ -31,15 +37,6 @@
"description": "Should the host application use dynamic federation?",
"default": false
},
"directory": {
"description": "The directory of the new application.",
"type": "string"
},
"projectNameAndRootFormat": {
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
},
"style": {
"description": "The file extension to be used for style files.",
"type": "string",
Expand Down Expand Up @@ -178,7 +175,7 @@
}
},
"additionalProperties": false,
"required": ["name"],
"required": ["directory"],
"presets": []
},
"x-type": "application",
Expand Down
14 changes: 4 additions & 10 deletions docs/generated/packages/angular/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@
"name": {
"type": "string",
"description": "The name of the library.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the library?",
"pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$"
"x-priority": "important"
},
"directory": {
"type": "string",
"description": "A directory where the library is placed.",
"x-priority": "important"
},
"projectNameAndRootFormat": {
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "Which directory do you want to create the library in?"
},
"publishable": {
"type": "boolean",
Expand Down Expand Up @@ -203,7 +197,7 @@
}
},
"additionalProperties": false,
"required": ["name"],
"required": ["directory"],
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Library\" %}\n\nCreates the `my-ui-lib` library with an `ui` tag:\n\n```bash\nnx g @nx/angular:library libs/my-ui-lib --tags=ui\n```\n\n{% /tab %}\n\n{% tab label=\"Publishable Library\" %}\n\nCreates the `my-lib` library that can be built producing an output following the Angular Package Format (APF) to be distributed as an NPM package:\n\n```bash\nnx g @nx/angular:library libs/my-lib --publishable --import-path=@my-org/my-lib\n```\n\n{% /tab %}\n\n{% tab label=\"Buildable Library\" %}\n\nCreates the `my-lib` library with support for incremental builds:\n\n```bash\nnx g @nx/angular:library libs/my-lib --buildable\n```\n\n{% /tab %}\n\n{% tab label=\"Nested Folder & Import\"%}\nCreates the `my-lib` library in the `nested` directory and sets the import path to `@myorg/nested/my-lib`:\n\n{% callout type=\"note\" title=\"Directory Flag Behavior Changes\" %}\nThe command below uses the `as-provided` directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the `derived` option, use `--directory=nested`. See the [as-provided vs. derived documentation](/deprecated/as-provided-vs-derived) for more details.\n{% /callout %}\n\n```bash\nnx g @nx/angular:library libs/nested/my-lib --importPath=@myorg/nested/my-lib\n```\n\n{% /tab %}\n",
"presets": []
},
Expand Down
5 changes: 0 additions & 5 deletions docs/generated/packages/angular/generators/move.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
"$default": { "$source": "argv", "index": 0 },
"x-priority": "important"
},
"projectNameAndRootFormat": {
"description": "Whether to generate the new project name and destination as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
},
"importPath": {
"type": "string",
"description": "The new import path to use in the `tsconfig.base.json`."
Expand Down
21 changes: 9 additions & 12 deletions docs/generated/packages/angular/generators/remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
}
],
"properties": {
"directory": {
"description": "The directory of the new application.",
"type": "string",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "Which directory do you want to create the application in?"
},
"name": {
"type": "string",
"description": "The name to give to the remote Angular app.",
"$default": { "$source": "argv", "index": 0 },
"pattern": "^[a-zA-Z][^:]*$"
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"host": {
"type": "string",
Expand All @@ -31,15 +37,6 @@
"type": "number",
"description": "The port on which this app should be served."
},
"directory": {
"description": "The directory of the new application.",
"type": "string"
},
"projectNameAndRootFormat": {
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
},
"style": {
"description": "The file extension to be used for style files.",
"type": "string",
Expand Down Expand Up @@ -171,7 +168,7 @@
}
},
"additionalProperties": false,
"required": ["name"],
"required": ["directory"],
"presets": []
},
"x-type": "application",
Expand Down
22 changes: 8 additions & 14 deletions docs/generated/packages/detox/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
"$default": { "$source": "projectName" },
"x-prompt": "What is the name of the frontend project to test?"
},
"e2eName": {
"e2eDirectory": {
"type": "string",
"description": "Name of the E2E Project.",
"description": "A directory where the project is placed relative current working directory (CWD).",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the E2E project?",
"pattern": "^[a-zA-Z][^:]*$"
"x-prompt": "Which directory do you want to create the E2E project in?"
},
"e2eName": {
"type": "string",
"description": "Name of the E2E Project."
},
"appName": {
"type": "string",
Expand All @@ -34,15 +37,6 @@
"enum": ["react-native", "expo"],
"x-prompt": "What app framework should detox test?"
},
"e2eDirectory": {
"type": "string",
"description": "A directory where the project is placed relative to apps directory."
},
"projectNameAndRootFormat": {
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
Expand All @@ -66,7 +60,7 @@
"default": false
}
},
"required": ["e2eName", "appProject", "framework"],
"required": ["e2eDirectory", "appProject", "framework"],
"presets": []
},
"aliases": ["app"],
Expand Down
23 changes: 9 additions & 14 deletions docs/generated/packages/expo/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,22 @@
],
"type": "object",
"properties": {
"directory": {
"description": "The directory of the new application.",
"type": "string",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "Which directory do you want to create the application in?"
},
"name": {
"description": "The name of the application.",
"type": "string",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the application?",
"pattern": "^[a-zA-Z][^:]*$"
"pattern": "^[a-zA-Z][^:]*$",
"x-priority": "important"
},
"displayName": {
"description": "The display name to show in the application. Defaults to name.",
"type": "string"
},
"directory": {
"description": "The directory of the new application.",
"type": "string",
"x-priority": "important"
},
"projectNameAndRootFormat": {
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
},
"skipFormat": {
"description": "Skip formatting files",
"type": "boolean",
Expand Down Expand Up @@ -90,7 +85,7 @@
"default": false
}
},
"required": ["name"],
"required": ["directory"],
"presets": []
},
"aliases": ["app"],
Expand Down
18 changes: 6 additions & 12 deletions docs/generated/packages/expo/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,16 @@
}
],
"properties": {
"name": {
"type": "string",
"description": "Library name",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the library?",
"pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$"
},
"directory": {
"type": "string",
"description": "A directory where the lib is placed.",
"x-priority": "important"
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "Which directory do you want to create the library in?"
},
"projectNameAndRootFormat": {
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
"name": {
"type": "string",
"enum": ["as-provided", "derived"]
"description": "Library name",
"x-priority": "important"
},
"linter": {
"description": "The tool to use for running lint checks.",
Expand Down Expand Up @@ -94,7 +88,7 @@
"default": false
}
},
"required": ["name"],
"required": ["directory"],
"presets": []
},
"aliases": ["lib"],
Expand Down
25 changes: 7 additions & 18 deletions docs/generated/packages/express/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,17 @@
"description": "Nx Application Options Schema.",
"type": "object",
"properties": {
"name": {
"description": "The name of the application.",
"directory": {
"description": "The directory of the new application.",
"type": "string",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the node application?",
"pattern": "^[a-zA-Z][^:]*$"
"x-prompt": "Which directory do you want to create the application in?"
},
"directory": {
"description": "The directory of the new application.",
"name": {
"description": "The name of the application.",
"pattern": "^[a-zA-Z][^:]*$",
"type": "string"
},
"projectNameAndRootFormat": {
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
Expand Down Expand Up @@ -71,19 +66,13 @@
"description": "Generate JavaScript files rather than TypeScript files.",
"default": false
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"setParserOptionsProject": {
"type": "boolean",
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
"default": false
}
},
"required": [],
"required": ["directory"],
"presets": []
},
"aliases": ["app"],
Expand Down
Loading

0 comments on commit 27edf71

Please sign in to comment.