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(nuxt): make nuxt public #20656

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions docs/generated/manifests/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -8062,6 +8062,65 @@
"isExternal": false,
"disableCollapsible": false
},
{
"id": "nuxt",
"path": "/nx-api/nuxt",
"name": "nuxt",
"children": [
{
"id": "documents",
"path": "/nx-api/nuxt/documents",
"name": "documents",
"children": [
{
"name": "Overview of the Nx Nuxt Plugin",
"path": "/nx-api/nuxt/documents/overview",
"id": "overview",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "generators",
"path": "/nx-api/nuxt/generators",
"name": "generators",
"children": [
{
"id": "init",
"path": "/nx-api/nuxt/generators/init",
"name": "init",
"children": [],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "application",
"path": "/nx-api/nuxt/generators/application",
"name": "application",
"children": [],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "storybook-configuration",
"path": "/nx-api/nuxt/generators/storybook-configuration",
"name": "storybook-configuration",
"children": [],
"isExternal": false,
"disableCollapsible": false
}
],
"isExternal": false,
"disableCollapsible": false
}
],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "nx",
"path": "/nx-api/nx",
Expand Down
52 changes: 52 additions & 0 deletions docs/generated/manifests/nx-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,58 @@
},
"path": "/nx-api/node"
},
"nuxt": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "nuxt",
"packageName": "@nx/nuxt",
"description": "The Nuxt plugin for Nx contains executors and generators for managing Nuxt applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Cypress, and Storybook.\n\n- Generators for applications, libraries, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
"documents": {
"/nx-api/nuxt/documents/overview": {
"id": "overview",
"name": "Overview of the Nx Nuxt Plugin",
"description": "The Nx Plugin for Nuxt contains generators for managing Nuxt applications within a Nx workspace. This page also explains how to configure Nuxt on your Nx workspace.",
"file": "generated/packages/nuxt/documents/overview",
"itemList": [],
"isExternal": false,
"path": "/nx-api/nuxt/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/nuxt/nuxt-plugin"
}
},
"root": "/packages/nuxt",
"source": "/packages/nuxt/src",
"executors": {},
"generators": {
"/nx-api/nuxt/generators/init": {
"description": "Initialize the `@nx/nuxt` plugin.",
"file": "generated/packages/nuxt/generators/init.json",
"hidden": true,
"name": "init",
"originalFilePath": "/packages/nuxt/src/generators/init/schema.json",
"path": "/nx-api/nuxt/generators/init",
"type": "generator"
},
"/nx-api/nuxt/generators/application": {
"description": "Create a Nuxt application.",
"file": "generated/packages/nuxt/generators/application.json",
"hidden": false,
"name": "application",
"originalFilePath": "/packages/nuxt/src/generators/application/schema.json",
"path": "/nx-api/nuxt/generators/application",
"type": "generator"
},
"/nx-api/nuxt/generators/storybook-configuration": {
"description": "Set up storybook for a Nuxt app.",
"file": "generated/packages/nuxt/generators/storybook-configuration.json",
"hidden": false,
"name": "storybook-configuration",
"originalFilePath": "/packages/nuxt/src/generators/storybook-configuration/schema.json",
"path": "/nx-api/nuxt/generators/storybook-configuration",
"type": "generator"
}
},
"path": "/nx-api/nuxt"
},
"nx": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "nx",
Expand Down
51 changes: 51 additions & 0 deletions docs/generated/packages-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,57 @@
"root": "/packages/node",
"source": "/packages/node/src"
},
{
"description": "The Nuxt plugin for Nx contains executors and generators for managing Nuxt applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Cypress, and Storybook.\n\n- Generators for applications, libraries, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
"documents": [
{
"id": "overview",
"name": "Overview of the Nx Nuxt Plugin",
"description": "The Nx Plugin for Nuxt contains generators for managing Nuxt applications within a Nx workspace. This page also explains how to configure Nuxt on your Nx workspace.",
"file": "generated/packages/nuxt/documents/overview",
"itemList": [],
"isExternal": false,
"path": "nuxt/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/nuxt/nuxt-plugin"
}
],
"executors": [],
"generators": [
{
"description": "Initialize the `@nx/nuxt` plugin.",
"file": "generated/packages/nuxt/generators/init.json",
"hidden": true,
"name": "init",
"originalFilePath": "/packages/nuxt/src/generators/init/schema.json",
"path": "nuxt/generators/init",
"type": "generator"
},
{
"description": "Create a Nuxt application.",
"file": "generated/packages/nuxt/generators/application.json",
"hidden": false,
"name": "application",
"originalFilePath": "/packages/nuxt/src/generators/application/schema.json",
"path": "nuxt/generators/application",
"type": "generator"
},
{
"description": "Set up storybook for a Nuxt app.",
"file": "generated/packages/nuxt/generators/storybook-configuration.json",
"hidden": false,
"name": "storybook-configuration",
"originalFilePath": "/packages/nuxt/src/generators/storybook-configuration/schema.json",
"path": "nuxt/generators/storybook-configuration",
"type": "generator"
}
],
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "nuxt",
"packageName": "@nx/nuxt",
"root": "/packages/nuxt",
"source": "/packages/nuxt/src"
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"documents": [
Expand Down
52 changes: 52 additions & 0 deletions docs/generated/packages/nuxt/documents/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Overview of the Nx Nuxt Plugin
description: The Nx Plugin for Nuxt contains generators for managing Nuxt applications within a Nx workspace. This page also explains how to configure Nuxt on your Nx workspace.
---

The Nx plugin for [Nuxt](https://nuxt.com/).

## Setting up a new Nx workspace with Nuxt

You can create a new workspace that uses Nuxt with one of the following commands:

- Generate a new monorepo with a Nuxt app

```shell
npx create-nx-workspace@latest --preset=nuxt
```

## Add Nuxt to an existing workspace

There are a number of ways to use Nuxt in your existing workspace.

### Install the `@nx/nuxt` plugin

{% tabs %}
{% tab label="npm" %}

```shell
npm install -D @nx/nuxt
```

{% /tab %}
{% tab label="yarn" %}

```shell
yarn add -D @nx/nuxt
```

{% /tab %}
{% tab label="pnpm" %}

```shell
pnpm install -D @nx/nuxt
```

{% /tab %}
{% /tabs %}

### Generate a new Nuxt app

```shell
nx g @nx/nuxt:app my-app
```
118 changes: 118 additions & 0 deletions docs/generated/packages/nuxt/generators/application.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"name": "application",
"factory": "./src/generators/application/application",
"schema": {
"$schema": "http://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": {
"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][^:]*$",
"x-priority": "important"
},
"directory": {
"description": "The directory of the new application.",
"type": "string",
"alias": "dir",
"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"]
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint"],
"default": "eslint"
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false,
"x-priority": "internal"
},
"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"
},
"e2eTestRunner": {
"type": "string",
"enum": ["cypress", "playwright", "none"],
"description": "Test runner to use for end to end (E2E) tests.",
"x-prompt": "Which E2E test runner would you like to use?",
"default": "cypress"
},
"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) [ http://sass-lang.com ]"
},
{
"value": "less",
"label": "LESS [ http://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": [],
"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 directory\" %}\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```shell\nnx g @nx/nuxt:app myapp --directory=apps/nested/myapp\n```\n\n{% /tab %}\n\n{% tab label=\"Create app with vitest configured\" %}\n\n```shell\nnx g @nx/nuxt:app myapp --directory=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 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 --directory=my-app/src/pages --name=my-page\n```\n\n{% /tab %}\n\n{% tab label=\"New component\" %}\n\n```shell\nnx g @nx/nuxt:component --directory=my-app/src/components/my-cmp --name=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"
}
42 changes: 42 additions & 0 deletions docs/generated/packages/nuxt/generators/init.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "init",
"factory": "./src/generators/init/init",
"schema": {
"$schema": "http://json-schema.org/schema",
"$id": "NxNuxtInit",
"title": "Init Nuxt Plugin",
"description": "Initialize a Nuxt Plugin.",
"cli": "nx",
"type": "object",
"properties": {
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false
},
"rootProject": {
"description": "Create a project at the root of the workspace",
"type": "boolean",
"default": false
},
"skipPackageJson": {
"description": "Do not add dependencies to `package.json`.",
"type": "boolean",
"default": false
},
"style": {
"description": "The file extension to be used for style files.",
"type": "string",
"default": "css"
}
},
"required": [],
"presets": []
},
"description": "Initialize the `@nx/nuxt` plugin.",
"aliases": ["ng-add"],
"hidden": true,
"implementation": "/packages/nuxt/src/generators/init/init.ts",
"path": "/packages/nuxt/src/generators/init/schema.json",
"type": "generator"
}
Loading
Loading