@frontic/nuxt 0.1.8 → 0.1.10

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.
Files changed (2) hide show
  1. package/dist/module.mjs +11 -1
  2. package/package.json +5 -3
package/dist/module.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readdirSync } from 'node:fs';
2
2
  import { dirname, join } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
- import { defineNuxtModule, createResolver, addServerHandler, addImports, addComponentsDir, addComponentExports } from '@nuxt/kit';
4
+ import { defineNuxtModule, createResolver, addServerHandler, hasNuxtModule, installModule, addImports, addComponentsDir, addComponentExports } from '@nuxt/kit';
5
5
 
6
6
  const _dirname = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
7
7
  const ALL_COMPOSABLES = ["block", "listing", "search", "page", "context", "client"];
@@ -100,6 +100,16 @@ frontic: { composables: false }
100
100
  tsConfig.compilerOptions.paths ||= {};
101
101
  tsConfig.compilerOptions.paths["@frontic/stack/*"] = [`../${clientDirName}/*`];
102
102
  });
103
+ if (anyComposableEnabled) {
104
+ if (!hasNuxtModule("@pinia/nuxt", nuxt)) {
105
+ const piniaModule = await import('@pinia/nuxt').then((m) => m.default);
106
+ await installModule(piniaModule, {}, nuxt);
107
+ }
108
+ if (!hasNuxtModule("@pinia/colada-nuxt", nuxt)) {
109
+ const coladaModule = await import('@pinia/colada-nuxt').then((m) => m.default);
110
+ await installModule(coladaModule, {}, nuxt);
111
+ }
112
+ }
103
113
  if (anyComposableEnabled) {
104
114
  const composablesDir = resolve(runtimeDir, "composables");
105
115
  const utilsDir = resolve(runtimeDir, "utils");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontic/nuxt",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Nuxt module for Frontstack headless commerce - zero config data fetching composables with smart caching, page routing, and context management",
5
5
  "license": "MIT",
6
6
  "author": "Frontic",
@@ -41,9 +41,11 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@nuxt/kit": "^3.17.0",
44
- "@pinia/colada": "^0.14.0",
44
+ "@pinia/colada": "^0.21.0",
45
+ "@pinia/colada-nuxt": "^0.3.0",
46
+ "@pinia/nuxt": "^0.11.0",
45
47
  "@vueuse/core": "^12.0.0",
46
- "pinia": "^2.2.6"
48
+ "pinia": "^3.0.0"
47
49
  },
48
50
  "devDependencies": {
49
51
  "@nuxt/module-builder": "^1.0.2",