@resee-movies/nuxt-ux 0.0.3 → 0.0.4
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/dist/module.json +1 -1
- package/dist/module.mjs +42 -36
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { useNuxt, addTemplate, resolvePath, logger,
|
|
1
|
+
import { useNuxt, addTemplate, resolvePath, logger, addVitePlugin, defineNuxtModule, createResolver, addComponentsDir, addImportsDir, addServerScanDir } from '@nuxt/kit';
|
|
2
2
|
import { toNonNullableArray } from '@resee-movies/utilities/arrays/to-non-nullable-array';
|
|
3
3
|
import { readFile } from 'node:fs/promises';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
6
6
|
import { createRequire } from 'node:module';
|
|
7
|
-
import NuxtFontsModule from '@nuxt/fonts';
|
|
8
|
-
import NuxtPrimevueModule from '@primevue/nuxt-module';
|
|
9
7
|
|
|
10
8
|
function resolveModuleDirectory(entry, ...packagePaths) {
|
|
11
9
|
const packageName = entry.includes("/") ? entry.startsWith("@") ? entry.split("/").slice(0, 2).join("/") : entry.split("/")[0] : entry;
|
|
@@ -107,38 +105,46 @@ async function importCSS(nuxt = useNuxt(), options) {
|
|
|
107
105
|
});
|
|
108
106
|
}
|
|
109
107
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
function importModules() {
|
|
109
|
+
const NuxtFonts = {
|
|
110
|
+
defaults: {
|
|
111
|
+
families: [
|
|
112
|
+
{
|
|
113
|
+
name: "Archivo",
|
|
114
|
+
provider: "google",
|
|
115
|
+
styles: ["normal"],
|
|
116
|
+
weights: [200, 300, 400, 500]
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const Primevue = {
|
|
122
|
+
defaults: {
|
|
123
|
+
autoImport: false,
|
|
124
|
+
loadStyles: false,
|
|
125
|
+
importPT: {
|
|
126
|
+
from: "#resee-movies-nuxt-ux-primevue-passthrough"
|
|
127
|
+
},
|
|
128
|
+
options: {
|
|
129
|
+
unstyled: true
|
|
130
|
+
},
|
|
131
|
+
composables: {
|
|
132
|
+
include: ["useToast"]
|
|
133
|
+
},
|
|
134
|
+
directives: {
|
|
135
|
+
prefix: "Prime",
|
|
136
|
+
include: ["Tooltip"]
|
|
137
|
+
},
|
|
138
|
+
components: {
|
|
139
|
+
prefix: "Prime",
|
|
140
|
+
include: ["Message", "ProgressBar", "ProgressSpinner", "Tag", "Toast"]
|
|
118
141
|
}
|
|
119
|
-
]
|
|
120
|
-
});
|
|
121
|
-
await installModule(NuxtPrimevueModule, {
|
|
122
|
-
autoImport: false,
|
|
123
|
-
loadStyles: false,
|
|
124
|
-
importPT: {
|
|
125
|
-
from: "#resee-movies-nuxt-ux-primevue-passthrough"
|
|
126
|
-
},
|
|
127
|
-
options: {
|
|
128
|
-
unstyled: true
|
|
129
|
-
},
|
|
130
|
-
composables: {
|
|
131
|
-
include: ["useToast"]
|
|
132
|
-
},
|
|
133
|
-
directives: {
|
|
134
|
-
prefix: "Prime",
|
|
135
|
-
include: ["Tooltip"]
|
|
136
|
-
},
|
|
137
|
-
components: {
|
|
138
|
-
prefix: "Prime",
|
|
139
|
-
include: ["Message", "ProgressBar", "ProgressSpinner", "Tag", "Toast"]
|
|
140
142
|
}
|
|
141
|
-
}
|
|
143
|
+
};
|
|
144
|
+
return {
|
|
145
|
+
"@nuxt/fonts": NuxtFonts,
|
|
146
|
+
"@primevue/nuxt-module": Primevue
|
|
147
|
+
};
|
|
142
148
|
}
|
|
143
149
|
|
|
144
150
|
const Builder = "@nuxt/vite-builder";
|
|
@@ -174,24 +180,24 @@ const module = defineNuxtModule({
|
|
|
174
180
|
name: "@resee-movies/nuxt-ux",
|
|
175
181
|
configKey: "ux"
|
|
176
182
|
},
|
|
183
|
+
moduleDependencies: () => importModules(),
|
|
177
184
|
async setup(options, nuxt) {
|
|
178
185
|
const resolver = createResolver(import.meta.url);
|
|
179
186
|
const components = resolver.resolve("./runtime/components/");
|
|
180
187
|
const composables = resolver.resolve("./runtime/composables/");
|
|
181
188
|
const server = resolver.resolve("./runtime/server/");
|
|
182
189
|
const stylesheet = resolver.resolve("./runtime/theme/css/styles.css");
|
|
183
|
-
nuxt.options.alias["#resee-movies-nuxt-ux-primevue-passthrough"] = resolver.
|
|
190
|
+
nuxt.options.alias["#resee-movies-nuxt-ux-primevue-passthrough"] = await resolver.resolvePath("./runtime/theme/primevue/index", { extensions: ["ts", "js"] });
|
|
184
191
|
const sources = options.tailwind?.sources?.slice() ?? [];
|
|
185
192
|
const plugins = options.tailwind?.plugins?.slice() ?? [];
|
|
186
193
|
const imports = options.tailwind?.plugins?.slice() ?? [];
|
|
187
194
|
sources.push(components);
|
|
188
|
-
plugins.push(
|
|
195
|
+
plugins.push(await resolvePath("@egoist/tailwindcss-icons"));
|
|
189
196
|
imports.push(stylesheet);
|
|
190
197
|
addComponentsDir({ path: components });
|
|
191
198
|
addImportsDir([composables]);
|
|
192
199
|
addServerScanDir([server]);
|
|
193
200
|
await importTailwind(nuxt);
|
|
194
|
-
await importModules(nuxt);
|
|
195
201
|
nuxt.hook("modules:done", async () => {
|
|
196
202
|
await importCSS(nuxt, { sources, plugins, imports });
|
|
197
203
|
});
|
package/package.json
CHANGED