Skip to content

Commit

Permalink
feat(nuxt): add first alpha version plugin for nuxt
Browse files Browse the repository at this point in the history
  • Loading branch information
gionkunz authored and DominikPieper committed Aug 23, 2023
1 parent af90183 commit 94136e0
Show file tree
Hide file tree
Showing 85 changed files with 4,465 additions and 120 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ npm-debug.log
yarn-error.log
testem.log
/typings
/.yarn
/.yarnrc

# System Files
.DS_Store
Expand Down
25 changes: 25 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ function nav() {
text: 'Discord Chat',
link: 'https://discord.gg/Hqjp9NrZQ7',
},
{
text: 'Github',
link: 'https://github.com/nxext/nx-extensions',
},
],
},
];
Expand Down Expand Up @@ -296,6 +300,27 @@ function sideNavDocs() {
},
],
},
{
text: 'Nuxt',
items: [
{
text: 'Overview',
link: '/docs/nuxt/overview',
},
{
text: 'Installation',
link: '/docs/nuxt/installation',
},
{
text: 'Generators',
link: '/docs/nuxt/generators',
},
{
text: 'Executors',
link: '/docs/nuxt/executors',
},
],
},
],
},
{
Expand Down
81 changes: 81 additions & 0 deletions docs/docs/nuxt/executors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
## @nxext/nuxt:build

Nuxt build

Options can be configured in the 'project.json' when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets.

### Options

#### debug

Default: `false`

Type: `boolean`

At the moment, it prints out hook names and timings on the server, and logs hook arguments as well in the browser.

#### dev

Default: `false`

Type: `boolean`

Whether Nuxt is running in development mode.

#### outputPath

Type: `string`

The output path of the generated files.

#### ssr

Type: `boolean`

Whether to enable rendering of HTML - either dynamically (in server mode) or at generate time. If set to false generated pages will have no content.

## @nxext/nuxt:serve

Nuxt dev server

Options can be configured in the 'project.json' when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets.

### Options

#### debug

Default: `false`

Type: `boolean`

At the moment, it prints out hook names and timings on the server, and logs hook arguments as well in the browser.

#### dev

Default: `true`

Type: `boolean`

Whether Nuxt is running in development mode.

#### host

Type: `string`

Dev server listening host.

#### port

Default: `3000`

Type: `number`

Dev server listening port

#### ssr

Default: `true`

Type: `boolean`

Whether to enable rendering of HTML - either dynamically (in server mode) or at generate time. If set to false generated pages will have no content.
109 changes: 109 additions & 0 deletions docs/docs/nuxt/generators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
## @nxext/nuxt:application

Create a Nuxt application.

### Usage

```bash
nx generate application ...
```

```bash
nx g app ... # same
```

By default, Nx will search for `application` in the default collection provisioned in nx.json.

You can specify the collection explicitly as follows:

```bash
nx g @nxext/nuxt:application ...
```

Show what will be generated without writing to disk:

```bash
nx g application ... --dry-run
```

### Options

#### name (_**required**_)

Type: `string`

#### directory

Type: `string`

A directory where the project is placed

#### e2eTestRunner

Default: `cypress`

Type: `string`

Possible values: `cypress`, `playwright`, `none`

Test runner to use for end to end (E2E) tests.

#### inSourceTests

Default: `false`

Type: `boolean`

When using Vitest, separate spec files will not be generated and instead will be included within the source files. Read more on the Vitest docs site: https://vitest.dev/guide/in-source.html

#### linter

Default: `eslint`

Type: `string`

Possible values: `eslint`, `none`

The tool to use for running lint checks.

#### rootProject (**hidden**)

Default: `false`

Type: `boolean`

Create a application at the root of the workspace

#### skipFormat

Default: `false`

Type: `boolean`

Skip formatting files.

#### skipNxJson

Default: `false`

Type: `boolean`

Skip updating `nx.json` with default options based on values provided to this app.

#### tags

Alias(es): t

Type: `string`

Add tags to the application (used for linting).

#### unitTestRunner

Default: `none`

Type: `string`

Possible values: `vitest`, `none`

Test runner to use for unit tests.
11 changes: 11 additions & 0 deletions docs/docs/nuxt/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Add this plugin to an Nx workspace:

```bash
#yarn
yarn add -D @nxext/nuxt
```

```bash
#npm
npm install -D @nxext/nuxt
```
21 changes: 21 additions & 0 deletions docs/docs/nuxt/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Overview of the Nuxt plugin

::: warning
This plugin is in alpha state. It is not feature complete yet and not ready for production.
:::

[@nxext/nuxt](https://github.com/nxext/nx-extensions/tree/main/packages/nuxt) is a Nx plugin to bring [Nuxt3](https://nuxt.com/) to [Nx](https://nx.dev/).

## Adding the Nuxt plugin

Adding the Nuxt plugin to a workspace can be done with the following:

```bash
#yarn
yarn add -D @nxext/nuxt
```

```bash
#npm
npm install -D @nxext/nuxt
```
4 changes: 3 additions & 1 deletion docs/docs/nxext/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ technologies. [Nxext](https://github.com/nxext/nx-extensions) is a collection of
| [`@nxext/vitest`](../vitest/overview) | An Nx plugin for development with [Vitest](https://vitest.dev/). |
| [`@nxext/react`](../react/overview) | An Nx plugin for development with [React](https://reactjs.org/). |
| [`@nxext/preact`](../preact/overview) | An Nx plugin for development with [Preact](https://reactjs.org/). |
| [`@nxext/sveltekit`](../sveltekit/overview) | (Beta) An NX plugin for development with [SvelteKit](https://kit.svelte.dev/) applications. |
| [`@nxext/ionic-angular`](../ionic-angular/overview.md) | An Nx plugin for developing [Ionic](https://ionicframework.com/docs) Angular applications and libraries. |
| [`@nxext/ionic-react`](../ionic-react/overview.md) | An Nx plugin for developing [Ionic](https://ionicframework.com/docs) React applications and libraries. |
| [`@nxext/capacitor`](../capacitor/overview.md) | An Nx plugin for developing cross-platform applications using [Capacitor](https://capacitorjs.com/docs). |
| [`@nxext/sveltekit`](../sveltekit/overview) | (Alpha) An NX plugin for development with [SvelteKit](https://kit.svelte.dev/) applications. |
| [`@nxext/vue`](../vue/overview) | (Alpha) An NX plugin for development with [Vue](https://kit.svelte.dev/) applications. |
| [`@nxext/nuxt`](../nuxt/overview) | (Alpha) An NX plugin for development with [Nuxt3](https://nuxt.com/) applications. |
4 changes: 4 additions & 0 deletions docs/docs/sveltekit/overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Introduction to Nxext Sveltekit

::: warning
This plugin is in alpha state. It is not feature complete yet and not ready for production.
:::

[@nxext/sveltekit](https://github.com/nxext/nx-extensions/tree/main/packages/sveltekit) is a nx plugin to bring [Sveltekit](https://kit.svelte.dev) to [Nx](https://nx.dev/).
17 changes: 17 additions & 0 deletions docs/docs/vue/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

[@nxext/vue](https://github.com/nxext/nx-extensions/tree/main/packages/vue) is a Nx plugin to bring [VueJs](https://vuejs.org/) to [Nx](https://nx.dev/).

The @nxext/vue package also includes a dependency graph plugin for Nx, in order to support Vues single file components (SFCs) in the dependency graph.
When using @nxext/vue or @nxext/nuxt, @nxext/vue is automatically added to the Nx plugins section within the nx.json file in your workspace root. The dependency graph will show the dependencies between any Vue SFCs within your workspace.

## Adding the Vue plugin

Adding the Vue plugin to a workspace can be done with the following:

```bash
#yarn
yarn add -D @nxext/vue
```

```bash
#npm
npm install -D @nxext/vue
```

## Executors / Builders

Our Vue applications are built using the executors from the [@nx/vite](https://nx.dev/packages/vite) plugin.
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ features:
details: Next Generation Frontend Tooling
- title: React
details: A JavaScript library for building user interfaces.
- title: Vue
details: An approachable, performant and versatile framework for building web user interfaces.
- title: Nuxt (Alpha)
details: The Intuitive Web Framework
---
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@
"packageManager": "[email protected]",
"dependencies": {},
"devDependencies": {
"@nuxt/kit": "^3.6.5",
"@nx/angular": "16.7.1",
"@nx/cypress": "16.7.1",
"@nx/playwright": "16.7.1",
"@nx/devkit": "16.7.1",
"@nx/eslint-plugin": "16.7.1",
"@nx/jest": "16.7.1",
"@nx/js": "16.7.1",
"@nx/linter": "16.7.1",
"@nx/node": "16.7.1",
"@nx/playwright": "16.7.1",
"@nx/plugin": "16.7.1",
"@nx/react": "16.7.1",
"@nx/storybook": "16.7.1",
Expand Down Expand Up @@ -100,10 +102,12 @@
"is-ci": "^3.0.1",
"jest": "29.4.3",
"jest-environment-jsdom": "29.5.0",
"jest-environment-node": "^29.4.1",
"jsonc-eslint-parser": "^2.3.0",
"jsonc-parser": "^3.2.0",
"kill-port": "^2.0.1",
"lint-staged": "13.2.3",
"nuxt": "^3.6.5",
"nx": "16.7.1",
"nx-cloud": "16.4.0-beta.1",
"prettier": "2.7.1",
Expand All @@ -119,6 +123,7 @@
"verdaccio": "5.18.0",
"verdaccio-auth-memory": "^10.2.2",
"vite-plugin-solid": "^2.7.0",
"vite-tsconfig-paths": "^4.2.0",
"vitepress": "^1.0.0-rc.4",
"vue-component-meta": "^1.8.8",
"yargs": "^17.7.2",
Expand Down
25 changes: 25 additions & 0 deletions packages/core/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
Loading

0 comments on commit 94136e0

Please sign in to comment.