@pinegrow/nuxt-module 3.0.28 → 3.0.30

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,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.1.0"
6
6
  },
7
- "version": "3.0.28"
7
+ "version": "3.0.30"
8
8
  }
package/dist/module.mjs CHANGED
@@ -5,19 +5,66 @@ const module = defineNuxtModule({
5
5
  if (moduleOptions.liveDesigner) {
6
6
  const nuxtInstance = nuxt;
7
7
  let pluginInstance;
8
+ let customOptions;
9
+ const components = [];
8
10
  const { resolve } = createResolver(import.meta.url);
9
11
  addServerPlugin(resolve("./runtime/nitro-plugin.mjs"));
10
12
  nuxt.hook("listen", async (listenerServer, listener) => {
11
13
  try {
12
14
  const { liveDesigner } = await import('./chunks/live-designer.mjs');
13
15
  const nitroApp = useNitro();
14
- pluginInstance = liveDesigner({
16
+ const filterConfig = (config) => {
17
+ const {
18
+ dir,
19
+ components: components2,
20
+ rootDir,
21
+ srcDir,
22
+ css,
23
+ appDir,
24
+ analyzeDir,
25
+ serverDir,
26
+ modulesDir,
27
+ workspaceDir,
28
+ buildDir,
29
+ ignore,
30
+ ignorePrefix
31
+ } = config;
32
+ return {
33
+ dir,
34
+ components: components2,
35
+ rootDir,
36
+ srcDir,
37
+ css,
38
+ appDir,
39
+ analyzeDir,
40
+ serverDir,
41
+ modulesDir,
42
+ workspaceDir,
43
+ buildDir,
44
+ ignore,
45
+ ignorePrefix
46
+ };
47
+ };
48
+ customOptions = {
15
49
  ...moduleOptions.liveDesigner,
16
50
  listenerServer,
17
51
  nuxtInstance,
18
52
  nitroApp,
19
- listener
20
- });
53
+ listener,
54
+ additionalConfig: {
55
+ ...filterConfig(nuxtInstance.options),
56
+ layers: nuxtInstance.options._layers.map((layer) => {
57
+ const { config, cwd, configFile } = layer;
58
+ return {
59
+ cwd,
60
+ configFile,
61
+ //@ts-ignore
62
+ config: filterConfig(config)
63
+ };
64
+ })
65
+ }
66
+ };
67
+ pluginInstance = liveDesigner(customOptions);
21
68
  addVitePlugin(pluginInstance);
22
69
  } catch (err) {
23
70
  console.log(err);
@@ -26,6 +73,19 @@ const module = defineNuxtModule({
26
73
  );
27
74
  }
28
75
  });
76
+ nuxt.hook("components:extend", (v) => {
77
+ components.length = 0;
78
+ components.push(...v);
79
+ components.sort((a, b) => a.pascalName.localeCompare(b.pascalName));
80
+ try {
81
+ customOptions.additionalConfig.components.list = components;
82
+ } catch (err) {
83
+ console.log(err);
84
+ console.log(
85
+ "Pinegrow: @pinegrow/nuxt-module was unable to load @pinegrow/vite-plugin live-designer!"
86
+ );
87
+ }
88
+ });
29
89
  }
30
90
  },
31
91
  meta: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinegrow/nuxt-module",
3
- "version": "3.0.28",
3
+ "version": "3.0.30",
4
4
  "description": "Pinegrow Nuxt Module",
5
5
  "author": "Pinegrow (http://pinegrow.com/)",
6
6
  "license": "MIT",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@nuxt/kit": "latest",
45
- "@pinegrow/vite-plugin": "3.0.28"
45
+ "@pinegrow/vite-plugin": "3.0.30"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@nuxt/module-builder": "latest",