@vueless/nuxt 0.0.9-beta.16 → 0.0.9-beta.18

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.13.0"
6
6
  },
7
- "version": "0.0.9-beta.16",
7
+ "version": "0.0.9-beta.18",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -1,10 +1,8 @@
1
- import { existsSync, copyFileSync } from 'node:fs';
2
1
  import { defineNuxtModule, createResolver, addPlugin, addComponent, addImportsDir } from '@nuxt/kit';
3
- import TailwindCSS from '@tailwindcss/vite';
4
- import { Vueless } from 'vueless/plugin-vite.js';
2
+ import { TailwindCSS, Vueless } from 'vueless/plugin-vite.js';
5
3
  import { getNuxtDirs } from 'vueless/utils/node/helper.js';
6
4
  import { createTailwindSafelist } from 'vueless/utils/node/tailwindSafelist.js';
7
- import { VUELESS_CACHE_DIR, VUELESS_CONFIG_FILE_NAME, COMPONENTS } from 'vueless/constants.js';
5
+ import { COMPONENTS } from 'vueless/constants.js';
8
6
 
9
7
  const module = defineNuxtModule({
10
8
  meta: {
@@ -22,37 +20,30 @@ const module = defineNuxtModule({
22
20
  const { resolve } = createResolver(import.meta.url);
23
21
  const { mirrorCacheDir, debug } = _options;
24
22
  _nuxt.options.build.transpile.push("vueless");
25
- _nuxt.hook("vite:extendConfig", (config) => {
23
+ _nuxt.hook("vite:extendConfig", async (config) => {
26
24
  config.plugins = config.plugins || [];
27
25
  config.plugins.push(
28
26
  TailwindCSS(),
29
27
  Vueless({ mode: "nuxt-module", mirrorCacheDir, debug })
30
28
  );
31
29
  });
32
- _nuxt.hook("nitro:build:public-assets", () => {
33
- const source = resolve(process.cwd(), `${VUELESS_CACHE_DIR}/${VUELESS_CONFIG_FILE_NAME}.mjs`);
34
- const destination = resolve(process.cwd(), `.output/${VUELESS_CONFIG_FILE_NAME}.mjs`);
35
- const destination2 = resolve(process.cwd(), `dist/${VUELESS_CONFIG_FILE_NAME}.mjs`);
36
- const destination3 = resolve(process.cwd(), `netlify/${VUELESS_CONFIG_FILE_NAME}.mjs`);
37
- const outputDir = resolve(process.cwd(), `.output`);
38
- const distDir = resolve(process.cwd(), `dist`);
39
- const netlifyDir = resolve(process.cwd(), `netlify`);
40
- console.log("source", source);
41
- console.log("destination", destination);
42
- console.log("existsSync(source)", existsSync(source));
43
- console.log("existsSync(.output)", existsSync(outputDir));
44
- console.log("existsSync(dist)", existsSync(distDir));
45
- console.log("existsSync(netlifyDir)", existsSync(netlifyDir));
46
- if (existsSync(source) && existsSync(outputDir)) {
47
- copyFileSync(source, destination);
30
+ let vuelessConfig = {};
31
+ try {
32
+ vuelessConfig = (await import(
33
+ /* @vite-ignore */
34
+ `${process.cwd()}/vueless.config.js`
35
+ )).default;
36
+ if (!vuelessConfig) {
37
+ vuelessConfig = (await import(
38
+ /* @vite-ignore */
39
+ `${process.cwd()}/vueless.config.ts`
40
+ )).default;
48
41
  }
49
- if (existsSync(source) && existsSync(distDir)) {
50
- copyFileSync(source, destination2);
51
- }
52
- if (existsSync(source) && existsSync(netlifyDir)) {
53
- copyFileSync(source, destination3);
54
- }
55
- });
42
+ } catch {
43
+ vuelessConfig = {};
44
+ }
45
+ console.log("vuelessConfig", vuelessConfig);
46
+ _nuxt.options.runtimeConfig.public.vueless = vuelessConfig;
56
47
  await createTailwindSafelist({
57
48
  targetFiles: getNuxtDirs()
58
49
  });
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueless/nuxt",
3
- "version": "0.0.9-beta.16",
3
+ "version": "0.0.9-beta.18",
4
4
  "license": "MIT",
5
5
  "description": "Nuxt Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -58,7 +58,7 @@
58
58
  "@nuxt/kit": "^3.13.1",
59
59
  "@tailwindcss/vite": "^4.0.14",
60
60
  "tailwindcss": "^4.0.14",
61
- "vueless": "^0.0.825-beta.58"
61
+ "vueless": "^0.0.825-beta.59"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@material-symbols/svg-500": "^0.29.1",
@@ -13,7 +13,9 @@ function parseCookies(cookieHeader) {
13
13
  }, {});
14
14
  }
15
15
  export default defineNuxtPlugin((_nuxtApp) => {
16
- const vueless = createVueless();
16
+ const config = useRuntimeConfig().public.vueless;
17
+ console.log("config", config);
18
+ const vueless = createVueless({ config });
17
19
  _nuxtApp.vueApp.use(vueless, []);
18
20
  _nuxtApp.vueApp.directive("clickOutside", vClickOutside);
19
21
  _nuxtApp.vueApp.directive("tooltip", vTooltip);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueless/nuxt",
3
- "version": "0.0.9-beta.16",
3
+ "version": "0.0.9-beta.18",
4
4
  "license": "MIT",
5
5
  "description": "Nuxt Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -58,7 +58,7 @@
58
58
  "@nuxt/kit": "^3.13.1",
59
59
  "@tailwindcss/vite": "^4.0.14",
60
60
  "tailwindcss": "^4.0.14",
61
- "vueless": "^0.0.825-beta.58"
61
+ "vueless": "^0.0.825-beta.59"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@material-symbols/svg-500": "^0.29.1",