@owdproject/core 3.0.0-alpha.4 → 3.0.0-alpha.6
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/index.ts +22 -24
- package/package.json +1 -1
- package/runtime/utils/utilsApp.ts +10 -0
package/index.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {defineNuxtModule, createResolver, addComponentsDir, addImportsDir, installModule} from '@nuxt/kit'
|
|
1
|
+
import {defineNuxtModule, createResolver, addComponentsDir, addImportsDir, installModule, addPlugin} from '@nuxt/kit'
|
|
2
2
|
import {useDesktopManager} from './runtime/composables/useDesktopManager'
|
|
3
3
|
import pkg from './package.json'
|
|
4
4
|
|
|
5
5
|
export default defineNuxtModule({
|
|
6
6
|
meta: {
|
|
7
7
|
name: 'owd-core',
|
|
8
|
+
priority: 9999,
|
|
8
9
|
},
|
|
9
10
|
async setup(options, nuxt) {
|
|
10
11
|
const {resolve} = createResolver(import.meta.url)
|
|
@@ -16,12 +17,6 @@ export default defineNuxtModule({
|
|
|
16
17
|
|
|
17
18
|
nuxt.options.runtimeConfig.public.coreVersion = pkg.version
|
|
18
19
|
|
|
19
|
-
// configure nuxt plugins
|
|
20
|
-
|
|
21
|
-
nuxt.options.primevue = nuxt.options.primevue || {};
|
|
22
|
-
nuxt.options.primevue.options = nuxt.options.primevue.options || {};
|
|
23
|
-
nuxt.options.primevue.options.theme = nuxt.options.primevue.options.theme || {};
|
|
24
|
-
|
|
25
20
|
{
|
|
26
21
|
|
|
27
22
|
// install open web desktop apps
|
|
@@ -36,20 +31,30 @@ export default defineNuxtModule({
|
|
|
36
31
|
|
|
37
32
|
{
|
|
38
33
|
|
|
39
|
-
// install
|
|
34
|
+
// install primevue
|
|
40
35
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
36
|
+
nuxt.options.primevue = nuxt.options.primevue || {};
|
|
37
|
+
nuxt.options.primevue.options = nuxt.options.primevue.options || {};
|
|
38
|
+
nuxt.options.primevue.options.theme = nuxt.options.primevue.options.theme || {};
|
|
39
|
+
|
|
40
|
+
await installModule("@primevue/nuxt-module")
|
|
44
41
|
|
|
45
42
|
}
|
|
46
43
|
|
|
47
44
|
{
|
|
48
45
|
|
|
49
|
-
// install
|
|
46
|
+
// install tailwind
|
|
50
47
|
|
|
51
|
-
nuxt.options.
|
|
52
|
-
|
|
48
|
+
const tailwindPaths = nuxt.options.appConfig?.owd?.tailwindPaths || []
|
|
49
|
+
tailwindPaths.push('./runtime/components/**/*.{vue,mjs,ts}') // Aggiungi sempre questo al core
|
|
50
|
+
|
|
51
|
+
nuxt.options.tailwindcss = nuxt.options.tailwindcss || {}
|
|
52
|
+
nuxt.options.tailwindcss.config = nuxt.options.tailwindcss.config || {}
|
|
53
|
+
nuxt.options.tailwindcss.config.content = tailwindPaths
|
|
54
|
+
|
|
55
|
+
await installModule('@nuxtjs/tailwindcss', {
|
|
56
|
+
viewer: false,
|
|
57
|
+
})
|
|
53
58
|
|
|
54
59
|
}
|
|
55
60
|
|
|
@@ -57,7 +62,6 @@ export default defineNuxtModule({
|
|
|
57
62
|
|
|
58
63
|
// install pinia
|
|
59
64
|
|
|
60
|
-
nuxt.options.modules.push('@pinia/nuxt')
|
|
61
65
|
await installModule("@pinia/nuxt")
|
|
62
66
|
|
|
63
67
|
}
|
|
@@ -66,7 +70,6 @@ export default defineNuxtModule({
|
|
|
66
70
|
|
|
67
71
|
// install @nuxt/fonts
|
|
68
72
|
|
|
69
|
-
nuxt.options.modules.push('@nuxt/fonts')
|
|
70
73
|
await installModule("@nuxt/fonts")
|
|
71
74
|
|
|
72
75
|
}
|
|
@@ -75,7 +78,6 @@ export default defineNuxtModule({
|
|
|
75
78
|
|
|
76
79
|
// install @nuxt/icon
|
|
77
80
|
|
|
78
|
-
nuxt.options.modules.push('@nuxt/icon')
|
|
79
81
|
await installModule("@nuxt/icon", {
|
|
80
82
|
clientBundle: {
|
|
81
83
|
scan: true,
|
|
@@ -89,7 +91,6 @@ export default defineNuxtModule({
|
|
|
89
91
|
|
|
90
92
|
// install @vueuse/nuxt
|
|
91
93
|
|
|
92
|
-
nuxt.options.modules.push('@vueuse/nuxt')
|
|
93
94
|
await installModule("@vueuse/nuxt")
|
|
94
95
|
|
|
95
96
|
}
|
|
@@ -98,7 +99,6 @@ export default defineNuxtModule({
|
|
|
98
99
|
|
|
99
100
|
// install @nuxtjs/i18n
|
|
100
101
|
|
|
101
|
-
nuxt.options.modules.push('@nuxtjs/i18n')
|
|
102
102
|
await installModule("@nuxtjs/i18n")
|
|
103
103
|
|
|
104
104
|
}
|
|
@@ -141,9 +141,9 @@ export default defineNuxtModule({
|
|
|
141
141
|
|
|
142
142
|
// install plugins
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
addPlugin(resolve('./runtime/plugins/resize.client.ts'))
|
|
145
|
+
|
|
146
|
+
// add other files
|
|
147
147
|
|
|
148
148
|
addImportsDir(resolve('./runtime/composables'))
|
|
149
149
|
addImportsDir(resolve('./runtime/core'))
|
|
@@ -154,7 +154,6 @@ export default defineNuxtModule({
|
|
|
154
154
|
}
|
|
155
155
|
})
|
|
156
156
|
|
|
157
|
-
/*
|
|
158
157
|
export * from './runtime/composables/useAppEntries'
|
|
159
158
|
export * from './runtime/composables/useApplicationManager'
|
|
160
159
|
export * from './runtime/composables/useApplicationState'
|
|
@@ -170,4 +169,3 @@ export * from './runtime/stores/storeDesktop'
|
|
|
170
169
|
export * from './runtime/stores/storeDesktopVolume'
|
|
171
170
|
export * from './runtime/stores/storeDesktopWindow'
|
|
172
171
|
export * from './runtime/stores/storeDesktopWorkspace'
|
|
173
|
-
*/
|
package/package.json
CHANGED
|
@@ -19,3 +19,13 @@ export function normalizeApplicationConfig(config: ApplicationConfig): Applicati
|
|
|
19
19
|
entries: normalizedEntries,
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
export function registerTailwindPath(nuxt, path: string) {
|
|
24
|
+
nuxt.options.appConfig = nuxt.options.appConfig || {}
|
|
25
|
+
nuxt.options.appConfig.owd = nuxt.options.appConfig.owd || {}
|
|
26
|
+
nuxt.options.appConfig.owd.tailwindPaths = nuxt.options.appConfig.owd.tailwindPaths || []
|
|
27
|
+
|
|
28
|
+
if (!nuxt.options.appConfig.owd.tailwindPaths.includes(path)) {
|
|
29
|
+
nuxt.options.appConfig.owd.tailwindPaths.push(path)
|
|
30
|
+
}
|
|
31
|
+
}
|