Skip to content

Commit

Permalink
docs(misc): update generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Sep 30, 2024
1 parent 2b7e417 commit 4468584
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
20 changes: 7 additions & 13 deletions docs/generated/packages/angular/generators/component.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,16 @@
"description": "Creates a new Angular component.",
"additionalProperties": false,
"properties": {
"name": {
"path": {
"type": "string",
"description": "The name of the component.",
"description": "The path at which to create the component file, relative to the workspace root. By default, it is set to the root of the project.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the component?"
"x-prompt": "Where to create the component?"
},
"directory": {
"type": "string",
"description": "The directory at which to create the component file. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
"aliases": ["dir", "path"],
"x-priority": "important"
},
"nameAndDirectoryFormat": {
"description": "Whether to generate the component in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
"name": {
"type": "string",
"enum": ["as-provided", "derived"]
"description": "The name of the component.",
"x-prompt": "What name would you like to use for the component?"
},
"prefix": {
"type": "string",
Expand Down Expand Up @@ -118,7 +112,7 @@
"x-priority": "internal"
}
},
"required": ["name"],
"required": ["path"],
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Component\" %}\n\nCreate a component named `my-component`:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Component\" %}\n\nCreate a component named `my-component` with inline styles and inline template:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Component with OnPush Change Detection Strategy\" %}\n\nCreate a component named `my-component` with OnPush Change Detection Strategy:\n\n```bash\nnx g @nx/angular:component apps/my-app/src/lib/my-component/my-component --changeDetection=OnPush\n```\n\n{% /tab %}\n",
"presets": []
},
Expand Down
21 changes: 8 additions & 13 deletions docs/generated/packages/next/generators/component.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@
"description": "Create a React Component for Next.",
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Path where the component will be generated.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "Where should the component be generated?",
"x-priority": "important"
},
"name": {
"type": "string",
"description": "The name of the component.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the component?",
"x-priority": "important"
},
Expand Down Expand Up @@ -56,17 +62,6 @@
"default": false,
"x-priority": "internal"
},
"directory": {
"type": "string",
"description": "The directory at which to create the component file. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the project root.",
"alias": "dir",
"x-priority": "important"
},
"nameAndDirectoryFormat": {
"description": "Whether to generate the component in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
"type": "string",
"enum": ["as-provided", "derived"]
},
"export": {
"type": "boolean",
"description": "When true, the component is exported from the project index.ts (if it exists).",
Expand All @@ -85,7 +80,7 @@
"x-priority": "internal"
}
},
"required": ["name"],
"required": ["path"],
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create an app component\" %}\n\n```shell\nnx g component apps/my-app/src/lib/my-cmp/my-cmp\n```\n\n{% /tab %}\n{% tab label=\"Create a component without its own folder\" %}\n\nRunning the following will create a component under `apps/my-app/components/my-cmp.tsx` rather than `apps/my-app/components/my-cmp/my-cmp.tsx`.\n\n```shell\nnx g component apps/my-app/src/lib/my-cmp\n```\n\n{% /tab %}\n{% tab label=\"Create component in a custom directory\" %}\n\nRunning the following will create a component under `apps/my-app/foo/my-cmp.tsx` rather than `apps/my-app/my-cmp/my-cmp.tsx`.\n\n```shell\nnx g component apps/my-app/foo/my-cmp\n```\n\n{% /tab %}\n{% /tabs %}\n",
"presets": []
},
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/packages/next/generators/page.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"x-priority": "internal"
}
},
"required": ["name"],
"required": ["path"],
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Create static page in an app\" %}\n\n```shell\nnx g page apps/my-app/pages/my-page\n```\n\n{% /tab %}\n{% tab label=\"Create dynamic page in an app\" %}\n\nThe following creates a page under `apps/my-app/pages/products/[id].tsx`.\n\n```shell\nnx g page \"apps/my-app/pages/products/[id]\"\n```\n\n{% /tab %}\n\n{% /tabs %}\n",
"presets": []
},
Expand Down

0 comments on commit 4468584

Please sign in to comment.