Skip to content

Commit 63b98d1

Browse files
authored
Merge pull request #848 from patrickcate/feature/000/nuxt-playground
test: add Nuxt playground for testing
2 parents aad6f96 + 77a76bf commit 63b98d1

12 files changed

+18853
-0
lines changed

playground/nuxt/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
8+
9+
# Node dependencies
10+
node_modules
11+
12+
# Logs
13+
logs
14+
*.log
15+
16+
# Misc
17+
.DS_Store
18+
.fleet
19+
.idea
20+
21+
# Local env files
22+
.env
23+
.env.*
24+
!.env.example

playground/nuxt/README.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Nuxt 3 Minimal Starter
2+
3+
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
4+
5+
## Setup
6+
7+
Make sure to install the dependencies:
8+
9+
```bash
10+
# npm
11+
npm install
12+
13+
# pnpm
14+
pnpm install
15+
16+
# yarn
17+
yarn install
18+
19+
# bun
20+
bun install
21+
```
22+
23+
## Development Server
24+
25+
Start the development server on `http://localhost:3000`:
26+
27+
```bash
28+
# npm
29+
npm run dev
30+
31+
# pnpm
32+
pnpm run dev
33+
34+
# yarn
35+
yarn dev
36+
37+
# bun
38+
bun run dev
39+
```
40+
41+
## Production
42+
43+
Build the application for production:
44+
45+
```bash
46+
# npm
47+
npm run build
48+
49+
# pnpm
50+
pnpm run build
51+
52+
# yarn
53+
yarn build
54+
55+
# bun
56+
bun run build
57+
```
58+
59+
Locally preview production build:
60+
61+
```bash
62+
# npm
63+
npm run preview
64+
65+
# pnpm
66+
pnpm run preview
67+
68+
# yarn
69+
yarn preview
70+
71+
# bun
72+
bun run preview
73+
```
74+
75+
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

playground/nuxt/app.vue

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div>
3+
<NuxtWelcome />
4+
</div>
5+
</template>

playground/nuxt/global.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare module 'vue-uswds/core'
2+
declare module 'vue-uswds/components'

playground/nuxt/modules/vue-uswds.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { addComponent, defineNuxtModule } from '@nuxt/kit'
2+
import * as components from 'vue-uswds/components'
3+
4+
export default defineNuxtModule({
5+
setup() {
6+
const componentNames = Object.keys(components)
7+
8+
componentNames.forEach(componentName => {
9+
addComponent({
10+
name: componentName,
11+
export: componentName,
12+
filePath: 'vue-uswds/components',
13+
})
14+
})
15+
},
16+
})

playground/nuxt/nuxt.config.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// https://nuxt.com/docs/api/configuration/nuxt-config
2+
export default defineNuxtConfig({
3+
devtools: { enabled: true },
4+
app: {
5+
head: {
6+
link: [
7+
{
8+
rel: 'stylesheet',
9+
href: 'https://cdn.jsdelivr.net/npm/@uswds/[email protected]/dist/css/uswds.min.css',
10+
},
11+
],
12+
},
13+
},
14+
modules: ['./modules/vue-uswds'],
15+
})

0 commit comments

Comments
 (0)