@vueless/nuxt 1.2.11-beta.3 → 1.2.11-beta.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 +19 -16
- package/dist/package.json +2 -1
- package/package.json +2 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineNuxtModule, createResolver, hasNuxtModule, addPlugin, addComponent, addImportsDir } from '@nuxt/kit';
|
|
2
|
+
import { dirname, relative } from 'pathe';
|
|
2
3
|
import { TailwindCSS, Vueless } from 'vueless/plugin-vite';
|
|
3
4
|
import { autoImportUserConfigs, cacheMergedConfigs } from 'vueless/utils/node/helper.js';
|
|
4
|
-
import {
|
|
5
|
+
import { VUELESS_LIBRARY, NUXT_MODULE_ENV, COMPONENTS } from 'vueless/constants.js';
|
|
5
6
|
|
|
6
7
|
const module = defineNuxtModule({
|
|
7
8
|
meta: {
|
|
@@ -19,36 +20,38 @@ const module = defineNuxtModule({
|
|
|
19
20
|
},
|
|
20
21
|
async setup(_options, _nuxt) {
|
|
21
22
|
if (_nuxt.options._prepare) return;
|
|
22
|
-
const { resolve } = createResolver(import.meta.url);
|
|
23
|
+
const { resolve, resolvePath } = createResolver(import.meta.url);
|
|
23
24
|
const { include, debug, postcss, basePath } = _options;
|
|
25
|
+
const vuelessPath = await resolvePath(VUELESS_LIBRARY);
|
|
26
|
+
const vuelessDir = dirname(vuelessPath);
|
|
27
|
+
_nuxt.hook("vite:extendConfig", async (config) => {
|
|
28
|
+
config.plugins = config.plugins || [];
|
|
29
|
+
config.plugins.push(
|
|
30
|
+
TailwindCSS({ postcss }),
|
|
31
|
+
Vueless({ env: NUXT_MODULE_ENV, basePath, debug, include })
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
await autoImportUserConfigs(basePath);
|
|
35
|
+
await cacheMergedConfigs({ vuelessSrcDir: relative(process.cwd(), vuelessDir), basePath });
|
|
24
36
|
if (hasNuxtModule("@nuxtjs/i18n")) {
|
|
25
37
|
_nuxt.hook("i18n:registerModule", (register) => {
|
|
26
38
|
register({
|
|
27
|
-
langDir: resolve(
|
|
39
|
+
langDir: resolve(`${vuelessDir}/locales`),
|
|
28
40
|
locales: [
|
|
29
41
|
{ code: "en", name: "English", file: "en.json" }
|
|
30
42
|
]
|
|
31
43
|
});
|
|
32
44
|
});
|
|
33
45
|
}
|
|
34
|
-
_nuxt.hook("vite:extendConfig", async (config) => {
|
|
35
|
-
config.plugins = config.plugins || [];
|
|
36
|
-
config.plugins.push(
|
|
37
|
-
TailwindCSS({ postcss }),
|
|
38
|
-
Vueless({ env: NUXT_MODULE_ENV, basePath, debug, include })
|
|
39
|
-
);
|
|
40
|
-
});
|
|
41
|
-
await autoImportUserConfigs(basePath);
|
|
42
|
-
await cacheMergedConfigs({ vuelessSrcDir: VUELESS_PACKAGE_DIR, basePath });
|
|
43
46
|
addPlugin(resolve("./runtime/plugin"));
|
|
44
|
-
for (const [componentName,
|
|
47
|
+
for (const [componentName, componentDir] of Object.entries(COMPONENTS)) {
|
|
45
48
|
addComponent({
|
|
46
49
|
name: componentName,
|
|
47
|
-
filePath:
|
|
50
|
+
filePath: `${vuelessDir}/${componentDir}/${componentName}.vue`
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
|
-
addImportsDir(
|
|
51
|
-
addImportsDir(
|
|
53
|
+
addImportsDir(`${vuelessDir}/composables`);
|
|
54
|
+
addImportsDir(`${vuelessDir}/utils`);
|
|
52
55
|
}
|
|
53
56
|
});
|
|
54
57
|
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueless/nuxt",
|
|
3
|
-
"version": "1.2.11-beta.
|
|
3
|
+
"version": "1.2.11-beta.4",
|
|
4
4
|
"description": "Nuxt Styleless UI Component Library, powered by Tailwind CSS.",
|
|
5
5
|
"author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
|
|
6
6
|
"homepage": "https://vueless.com",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"sb:preview": "vite preview --host --outDir=storybook-static"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"pathe": "^2.0.3",
|
|
33
34
|
"vueless": "^1.3.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueless/nuxt",
|
|
3
|
-
"version": "1.2.11-beta.
|
|
3
|
+
"version": "1.2.11-beta.4",
|
|
4
4
|
"description": "Nuxt Styleless UI Component Library, powered by Tailwind CSS.",
|
|
5
5
|
"author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
|
|
6
6
|
"homepage": "https://vueless.com",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"sb:preview": "vite preview --host --outDir=storybook-static"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"pathe": "^2.0.3",
|
|
33
34
|
"vueless": "^1.3.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|