Skip to content

Commit 3cb981f

Browse files
authored
feat: add NuxtUI (including TailwindCSS) (#161)
1 parent 1022efd commit 3cb981f

File tree

9 files changed

+2949
-1603
lines changed

9 files changed

+2949
-1603
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ coverage
2222

2323
*.tsbuildinfo
2424

25+
# Auto-generated type declarations from NuxtUI
26+
auto-imports.d.ts
27+
components.d.ts
28+
2529
# Generated glTF model files (from dependency `@todde.tv/gltf-type-toolkit`)
2630
*.gltf.d.ts
2731
*.gltf.js

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
1010
"editor.formatOnSave": false,
1111
"editor.linkedEditing": true,
12+
"editor.quickSuggestions": {
13+
"strings": "on"
14+
},
1215
"editor.rulers": [120],
1316
"eslint.rules.customizations": [
1417
{ "rule": "style/*", "severity": "off" },
@@ -62,6 +65,16 @@
6265
"pnpm-lock.yaml": true
6366
},
6467
"search.useIgnoreFiles": false,
68+
"tailwindCSS.classAttributes": [
69+
"class",
70+
"ui"
71+
],
72+
"tailwindCSS.experimental.classRegex": [
73+
[
74+
"ui:\\s*{([^)]*)\\s*}",
75+
"(?:'|\"|`)([^']*)(?:'|\"|`)"
76+
]
77+
],
6578
"typescript.enablePromptUseWorkspaceTsdk": true,
6679
"typescript.preferences.importModuleSpecifier": "non-relative",
6780
"typescript.preferences.importModuleSpecifierEnding": "js",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"build": "vite build",
5353
"preview": "vite preview",
5454
"test": "run-p \"lint\" \"test:types\" --",
55-
"test:types": "vue-tsc --build --force",
55+
"test:types": "vue-tsc --project ./tsconfig.app.json",
5656
"postinstall": "run-s \"generate:gltf-models\"",
5757
"generate:gltf-models": "gltf-codegen",
5858
"lint": "eslint .",
@@ -66,10 +66,11 @@
6666
"@antfu/eslint-config": "~3.5.1",
6767
"@iconify-json/ph": "~1.2.1",
6868
"@iconify/tailwind4": "~1.0.6",
69+
"@nuxt/ui": "~3.0.2",
6970
"@rushstack/eslint-patch": "~1.10.4",
7071
"@tailwindcss/vite": "~4.1.3",
7172
"@todde.tv/gltf-type-toolkit": "~1.1.0",
72-
"@tresjs/cientos": "~4.0.2",
73+
"@tresjs/cientos": "~4.3.0",
7374
"@tresjs/core": "~4.2.10",
7475
"@tresjs/post-processing": "~2.1.0",
7576
"@tsconfig/node20": "~20.1.4",
@@ -88,7 +89,6 @@
8889
"npm-run-all2": "~6.2.2",
8990
"pinia": "~2.2.2",
9091
"postprocessing": "~6.36.7",
91-
"tailwindcss": "~4.1.3",
9292
"three": "~0.168.0",
9393
"tsx": "~4.19.1",
9494
"typescript": "~5.5.4",

pnpm-lock.yaml

Lines changed: 2906 additions & 1576 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { RouterView } from 'vue-router'
33
</script>
44

55
<template>
6-
<RouterView />
6+
<UApp>
7+
<RouterView />
8+
</UApp>
79
</template>
810

911
<style scoped>

src/assets/main.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@import 'tailwindcss';
2-
3-
@config '../../tailwind.config.js';
2+
@import '@nuxt/ui';
43

54
@plugin "@iconify/tailwind4" {
65
prefix: 'icon';

src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import router from '@/router/index.js'
2+
// eslint-disable-next-line import/extensions
3+
import ui from '@nuxt/ui/vue-plugin'
24
import { createPinia } from 'pinia'
35
import { createApp } from 'vue'
46
import App from './App.vue'
@@ -8,5 +10,6 @@ const app = createApp(App)
810

911
app.use(createPinia())
1012
app.use(router)
13+
app.use(ui)
1114

1215
app.mount('#app')

tailwind.config.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

vite.config.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { fileURLToPath, URL } from 'node:url'
2-
import tailwindcss from '@tailwindcss/vite'
2+
// eslint-disable-next-line import/extensions
3+
import ui from '@nuxt/ui/vite'
34
// eslint-disable-next-line import/extensions
45
import gltf from '@todde.tv/gltf-type-toolkit/vite'
56
import { templateCompilerOptions } from '@tresjs/core'
@@ -10,15 +11,25 @@ import vueDevTools from 'vite-plugin-vue-devtools'
1011
// https://vitejs.dev/config/
1112
export default defineConfig({
1213
plugins: [
13-
vue({
14+
vue({ // from `vue`
1415
...templateCompilerOptions,
1516
}),
16-
vueDevTools(),
17-
tailwindcss(),
18-
gltf({
17+
vueDevTools(), // from `vite-plugin-vue-devtools`
18+
gltf({ // from `@todde.tv/gltf-type-toolkit`
1919
customGltfLoaderModule: '@/utils/gltfLoader.ts',
2020
verbose: true,
2121
}),
22+
ui({ // from `@nuxt/ui` (including `unplugin-vue-components` & `tailwindcss`)
23+
colorMode: false,
24+
components: { // from `unplugin-vue-components`
25+
},
26+
ui: {
27+
colors: {
28+
// neutral: 'slate',
29+
// primary: 'green',
30+
},
31+
},
32+
}),
2233
],
2334
resolve: {
2435
alias: {

0 commit comments

Comments
 (0)