-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
2,315 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
title: Overview of the Nx Vue Plugin | ||
description: The Nx Plugin for Vue contains generators for managing Vue applications and libraries within an Nx workspace. This page also explains how to configure Vue on your Nx workspace. | ||
--- | ||
|
||
{% callout type="caution" title="`@nx/vue` is not available yet" %} | ||
The `@nx/vue` plugin is not available yet. It will be released soon. | ||
{% /callout %} | ||
|
||
The Nx plugin for [Vue](https://vuejs.org/). | ||
|
||
## Setting up a new Nx workspace with Vue | ||
|
||
You can create a new workspace that uses Vue with one of the following commands: | ||
|
||
- Generate a new monorepo with a Vue app set up with Vue | ||
|
||
```shell | ||
npx create-nx-workspace@latest --preset=vue | ||
``` | ||
|
||
## Add Vue to an existing workspace | ||
|
||
There is a number of ways to use Vue in your existing workspace. | ||
|
||
### Install the `@nx/vue` plugin | ||
|
||
{% tabs %} | ||
{% tab label="npm" %} | ||
|
||
```shell | ||
npm install -D @nx/vue | ||
``` | ||
|
||
{% /tab %} | ||
{% tab label="yarn" %} | ||
|
||
```shell | ||
yarn add -D @nx/vue | ||
``` | ||
|
||
{% /tab %} | ||
{% tab label="pnpm" %} | ||
|
||
```shell | ||
pnpm install -D @nx/vue | ||
``` | ||
|
||
{% /tab %} | ||
{% /tabs %} | ||
|
||
### Generate a new project using Vue | ||
|
||
To generate a Vue application, run the following: | ||
|
||
```bash | ||
nx g @nx/vue:app my-app | ||
``` | ||
|
||
To generate a Vue library, run the following: | ||
|
||
```bash | ||
nx g @nx/vue:lib my-lib | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
{ | ||
"name": "Nx Vue", | ||
"version": "0.1", | ||
"generators": {} | ||
"generators": { | ||
"init": { | ||
"factory": "./src/generators/init/init#vueInitSchematic", | ||
"schema": "./src/generators/init/schema.json", | ||
"description": "Initialize the `@nrwl/vue` plugin.", | ||
"aliases": ["ng-add"], | ||
"hidden": true | ||
}, | ||
|
||
"library": { | ||
"factory": "./src/generators/library/library", | ||
"schema": "./src/generators/library/schema.json", | ||
"aliases": ["lib"], | ||
"x-type": "library", | ||
"description": "Create a Vue library." | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from './src/utils/versions'; | ||
export { libraryGenerator } from './src/generators/library/library'; | ||
export { componentGenerator } from './src/generators/component/component'; | ||
export { type InitSchema } from './src/generators/init/schema'; | ||
export { vueInitGenerator } from './src/generators/init/init'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
40 changes: 40 additions & 0 deletions
40
packages/vue/src/generators/component/__snapshots__/component.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`component --export should add to index.ts barrel 1`] = ` | ||
"export * from './lib/hello/hello'; | ||
" | ||
`; | ||
|
||
exports[`component should generate files 1`] = ` | ||
"<script setup lang="ts"> | ||
defineProps<{}>(); | ||
</script> | ||
<template> | ||
<div> | ||
<p>Welcome to Hello!</p> | ||
</div> | ||
</template> | ||
<style scoped> | ||
div { | ||
color: pink; | ||
} | ||
</style> | ||
" | ||
`; | ||
|
||
exports[`component should generate files 2`] = ` | ||
"import { describe, it, expect } from 'vitest'; | ||
import { mount } from '@vue/test-utils'; | ||
import Hello from '../hello'; | ||
describe('Hello', () => { | ||
it('renders properly', () => { | ||
const wrapper = mount(Hello, { props: {} }); | ||
expect(wrapper.text()).toContain('Welcome to Hello'); | ||
}); | ||
}); | ||
" | ||
`; |
Oops, something went wrong.