@dascompany/ui-layer-npm 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/app/components/DemoCardNpm.vue +22 -0
- package/app/plugins/vuetify.ts +19 -0
- package/nuxt.config.ts +22 -0
- package/package.json +26 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# app-npm
|
|
2
|
+
|
|
3
|
+
Aplikacja Nuxt 4 używająca `@demo/ui-layer` zainstalowanego przez **npm**.
|
|
4
|
+
|
|
5
|
+
## Uruchomienie
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install
|
|
9
|
+
npm run dev
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Aplikacja dostępna pod http://localhost:3000
|
|
13
|
+
|
|
14
|
+
## Jak to działa
|
|
15
|
+
|
|
16
|
+
Layer `@demo/ui-layer` jest zainstalowany jak zwykła paczka npm.
|
|
17
|
+
`nuxt.config.ts` rozszerza layer przez `extends: ['@demo/ui-layer']`.
|
|
18
|
+
Vuetify i plugin `vite-plugin-vuetify` są zadeklarowane w `dependencies` tej aplikacji
|
|
19
|
+
(wymagane przez npm jako peer dependencies layera).
|
|
20
|
+
|
|
21
|
+
Komponent `<DemoCard>` jest dostępny globalnie bez żadnych ręcznych importów.
|
|
22
|
+
|
|
23
|
+
## Różnica względem app-gitea
|
|
24
|
+
|
|
25
|
+
Jedyną różnicą jest sposób instalacji layera:
|
|
26
|
+
|
|
27
|
+
| app-npm | app-gitea |
|
|
28
|
+
|---------|-----------|
|
|
29
|
+
| `"@demo/ui-layer": "^1.0.0"` | `"@demo/ui-layer": "git+https://gitea.example.com/demo/ui-layer.git#v1.0.0"` |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-card class="mx-auto" max-width="400" elevation="4" color="blue-lighten-5">
|
|
3
|
+
<v-card-title>{{ title }}</v-card-title>
|
|
4
|
+
<v-card-text>{{ description }}</v-card-text>
|
|
5
|
+
<v-card-actions>
|
|
6
|
+
<v-btn color="blue-darken-2" variant="elevated" @click="$emit('click')">
|
|
7
|
+
Kliknij (npm)
|
|
8
|
+
</v-btn>
|
|
9
|
+
</v-card-actions>
|
|
10
|
+
</v-card>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
defineProps<{
|
|
15
|
+
title?: string
|
|
16
|
+
description?: string
|
|
17
|
+
}>()
|
|
18
|
+
|
|
19
|
+
defineEmits<{
|
|
20
|
+
click: []
|
|
21
|
+
}>()
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createVuetify } from 'vuetify'
|
|
2
|
+
import * as components from 'vuetify/components'
|
|
3
|
+
import * as directives from 'vuetify/directives'
|
|
4
|
+
import 'vuetify/styles'
|
|
5
|
+
|
|
6
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
7
|
+
// Guard against double-registration when multiple layers include this plugin
|
|
8
|
+
if (nuxtApp.vueApp.config.globalProperties.$vuetify) return
|
|
9
|
+
|
|
10
|
+
const vuetify = createVuetify({
|
|
11
|
+
components,
|
|
12
|
+
directives,
|
|
13
|
+
theme: {
|
|
14
|
+
defaultTheme: 'light'
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
nuxtApp.vueApp.use(vuetify)
|
|
19
|
+
})
|
package/nuxt.config.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
|
|
2
|
+
|
|
3
|
+
export default defineNuxtConfig({
|
|
4
|
+
compatibility: {
|
|
5
|
+
nuxt: '>=4.0.0'
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
build: {
|
|
9
|
+
transpile: ['vuetify']
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
vite: {
|
|
13
|
+
vue: {
|
|
14
|
+
template: {
|
|
15
|
+
transformAssetUrls
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
plugins: [
|
|
19
|
+
vuetify({ autoImport: true })
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
})
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dascompany/ui-layer-npm",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Nuxt 4 layer with Vuetify 3 — distributed via npm",
|
|
5
|
+
"main": "./nuxt.config.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"app",
|
|
8
|
+
"nuxt.config.ts"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "nuxt dev"
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"nuxt": "^4.0.0",
|
|
15
|
+
"vuetify": "^3.0.0",
|
|
16
|
+
"vite-plugin-vuetify": "^2.0.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"nuxt": "^4.0.0",
|
|
20
|
+
"vuetify": "^3.8.0",
|
|
21
|
+
"vite-plugin-vuetify": "^2.0.4"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
}
|
|
26
|
+
}
|