<!-- 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: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
116 lines
6.1 KiB
JSON
116 lines
6.1 KiB
JSON
{
|
||
"name": "application",
|
||
"factory": "./src/generators/application/application",
|
||
"schema": {
|
||
"$schema": "https://json-schema.org/schema",
|
||
"cli": "nx",
|
||
"$id": "NxNuxtApp",
|
||
"title": "Create a Nuxt Application for Nx",
|
||
"description": "Create a Nuxt Application for Nx.",
|
||
"type": "object",
|
||
"properties": {
|
||
"directory": {
|
||
"description": "The directory of the new application.",
|
||
"type": "string",
|
||
"alias": "dir",
|
||
"$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",
|
||
"pattern": "^[a-zA-Z][^:]*$",
|
||
"x-priority": "important"
|
||
},
|
||
"skipFormat": {
|
||
"description": "Skip formatting files.",
|
||
"type": "boolean",
|
||
"default": false,
|
||
"x-priority": "internal"
|
||
},
|
||
"linter": {
|
||
"description": "The tool to use for running lint checks.",
|
||
"type": "string",
|
||
"enum": ["eslint", "none"],
|
||
"default": "none",
|
||
"x-prompt": "Which linter would you like to use?",
|
||
"x-priority": "important"
|
||
},
|
||
"unitTestRunner": {
|
||
"type": "string",
|
||
"enum": ["vitest", "none"],
|
||
"description": "Test runner to use for unit tests.",
|
||
"x-prompt": "Which unit test runner would you like to use?",
|
||
"default": "none",
|
||
"x-priority": "important"
|
||
},
|
||
"e2eTestRunner": {
|
||
"type": "string",
|
||
"enum": ["playwright", "cypress", "none"],
|
||
"description": "Test runner to use for end to end (E2E) tests.",
|
||
"x-prompt": "Which E2E test runner would you like to use?",
|
||
"default": "playwright"
|
||
},
|
||
"tags": {
|
||
"type": "string",
|
||
"description": "Add tags to the application (used for linting).",
|
||
"alias": "t"
|
||
},
|
||
"js": {
|
||
"type": "boolean",
|
||
"description": "Generate JavaScript files rather than TypeScript files.",
|
||
"default": false
|
||
},
|
||
"skipPackageJson": {
|
||
"type": "boolean",
|
||
"default": false,
|
||
"description": "Do not add dependencies to `package.json`.",
|
||
"x-priority": "internal"
|
||
},
|
||
"rootProject": {
|
||
"description": "Create an application at the root of the workspace.",
|
||
"type": "boolean",
|
||
"default": false,
|
||
"hidden": true,
|
||
"x-priority": "internal"
|
||
},
|
||
"style": {
|
||
"description": "The file extension to be used for style files.",
|
||
"type": "string",
|
||
"alias": "s",
|
||
"default": "css",
|
||
"x-prompt": {
|
||
"message": "Which stylesheet format would you like to use?",
|
||
"type": "list",
|
||
"items": [
|
||
{ "value": "css", "label": "CSS" },
|
||
{
|
||
"value": "scss",
|
||
"label": "SASS(.scss) [ https://sass-lang.com ]"
|
||
},
|
||
{
|
||
"value": "less",
|
||
"label": "LESS [ https://lesscss.org ]"
|
||
},
|
||
{ "value": "none", "label": "None" }
|
||
]
|
||
}
|
||
},
|
||
"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": ["directory"],
|
||
"examplesFile": "---\ntitle: Nuxt application generator examples\ndescription: This page contains examples for the @nx/nuxt:app generator.\n---\n\nYour new Nuxt application will be generated with the following directory structure, following the suggested [directory structure](https://nuxt.com/docs/guide/directory-structure) for Nuxt applications:\n\n```text\nmy-nuxt-app\n├── nuxt.config.ts\n├── project.json\n├── src\n│ ├── app.vue\n│ ├── assets\n│ │ └── css\n│ │ └── styles.css\n│ ├── components\n│ │ └── NxWelcome.vue\n│ ├── pages\n│ │ ├── about.vue\n│ │ └── index.vue\n│ ├── public\n│ │ └── favicon.ico\n│ └── server\n│ ├── api\n│ │ └── greet.ts\n│ └── tsconfig.json\n├── tsconfig.app.json\n├── tsconfig.json\n├── tsconfig.spec.json\n└── vitest.config.ts\n```\n\nYour new app will contain the following:\n\n- Two pages (home and about) under `pages`\n- A component (`NxWelcome`) under `components`\n- A `greet` API endpoint that returns a JSON response under `/api/greet`\n- Configuration for `vitest`\n- Your app's entrypoint (`app.vue`) will contain the navigation links to the home and about pages, and the `nuxt-page` component to display the contents of your pages.\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Create app in a nested directory\" %}\n\n```shell\nnx g @nx/nuxt:app apps/nested/myapp\n```\n\n{% /tab %}\n\n{% tab label=\"Create app with vitest configured\" %}\n\n```shell\nnx g @nx/nuxt:app apps/nested/myapp --unitTestRunner=vitest\n```\n\n{% /tab %}\n\n{% tab label=\"Use plain JavaScript (not TypeScript)\" %}\n\n```shell\nnx g @nx/nuxt:app apps/myapp --js\n```\n\n{% /tab %}\n{% /tabs %}\n\n## Generate pages and components\n\nYou can use the the [`@nx/vue:component` generator](/nx-api/vue/generators/component) to generate new pages and components for your application. You can read more on the [`@nx/vue:component` generator documentation page](/nx-api/vue/generators/component), but here are some examples:\n\n{% tabs %}\n{% tab label=\"New page\" %}\n\n```shell\nnx g @nx/nuxt:component my-app/src/pages/my-page\n```\n\n{% /tab %}\n\n{% tab label=\"New component\" %}\n\n```shell\nnx g @nx/nuxt:component my-app/src/components/my-cmp\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||
"presets": []
|
||
},
|
||
"aliases": ["app"],
|
||
"description": "Create a Nuxt application.",
|
||
"implementation": "/packages/nuxt/src/generators/application/application.ts",
|
||
"hidden": false,
|
||
"path": "/packages/nuxt/src/generators/application/schema.json",
|
||
"type": "generator"
|
||
}
|