Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(misc): make directory a required option for generators #28093

Merged
merged 39 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
303788f
feat(misc): generators require directory option rather than name
jaysoo Sep 24, 2024
a3be77d
feat(misc): remove references to projectNameAndRootFormat
jaysoo Sep 25, 2024
ce5804b
chore(js): fix unit teests
Coly010 Sep 25, 2024
70097e7
feat(devkit): move ensureProjectName util to devkit
Coly010 Sep 25, 2024
3090556
chore(angular): fix unit tests
Coly010 Sep 25, 2024
3f6dc57
fix(angular): revert schema change for component
Coly010 Sep 25, 2024
cec123e
chore(angular): fix unit tests for project generators
Coly010 Sep 25, 2024
ecae7e1
chore(detox): fix unit tests for project generators
Coly010 Sep 25, 2024
5f32f45
chore(expo): fix unit tests for project generators
Coly010 Sep 25, 2024
f3a012c
chore(express): fix unit tests for project generators
Coly010 Sep 25, 2024
a553d51
chore(js): fix unit tests for project generators
Coly010 Sep 25, 2024
d26c320
chore(nest): fix unit tests for project generators
Coly010 Sep 25, 2024
49ba7fd
chore(next): fix unit tests for project generators
Coly010 Sep 25, 2024
202138d
chore(node): fix unit tests for project generators
Coly010 Sep 25, 2024
ae14c8b
chore(nuxt): fix unit tests for project generators
Coly010 Sep 25, 2024
0279939
chore(nx-plugin): fix unit tests for project generators
Coly010 Sep 25, 2024
8f2095e
chore(react-native): fix unit tests for project generators
Coly010 Sep 25, 2024
25aa25d
chore(react): fix unit tests for project generators
Coly010 Sep 25, 2024
6d9deae
chore(remix): fix unit tests for project generators
Coly010 Sep 25, 2024
5270348
chore(storybook): fix unit tests for project generators
Coly010 Sep 25, 2024
123d922
chore(vite): fix unit tests for project generators
Coly010 Sep 25, 2024
d0e312c
chore(vue): fix unit tests for project generators
Coly010 Sep 25, 2024
59f7d31
chore(web): fix unit tests for project generators
Coly010 Sep 25, 2024
521e967
chore(core): fix unit tests for project generators
Coly010 Sep 25, 2024
e2ac75d
chore(repo): fix failing units
Coly010 Sep 25, 2024
b0c9706
fix(angular): make directory required for application
Coly010 Sep 26, 2024
207b357
chore(react): fix e2es
Coly010 Sep 26, 2024
409b105
chore(core): fix e2es
Coly010 Sep 26, 2024
c21fe89
chore(nx-plugin): fix e2es
Coly010 Sep 26, 2024
77b6023
chore(core): fix e2es
Coly010 Sep 26, 2024
9a83867
chore(eslint): fix e2es
Coly010 Sep 26, 2024
f1bb0cb
chore(node): fix e2es
Coly010 Sep 26, 2024
3281b90
chore(testing): fix e2es
Coly010 Sep 26, 2024
8b60923
fix(repo): update patterns for directory options
Coly010 Sep 26, 2024
836c806
chore(nx-plugin): fix e2e
Coly010 Sep 26, 2024
dcbf1bd
chore(js): fix unit test
Coly010 Sep 30, 2024
8859c1e
fix(rspack): make directory required
Coly010 Sep 30, 2024
f760023
fix(core): update generated docs
ndcunningham Sep 30, 2024
200a766
Merge branch 'master' into feat/make-directory-required
jaysoo Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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