@scayle/storefront-nuxt 8.9.2 → 8.10.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 8.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Added dependency `@vercel/nft@0.29.1`
8
+ - Add necessary runtime dependencies to nitro's external.inline config
9
+
10
+ ## 8.10.0
11
+
12
+ ### Minor Changes
13
+
14
+ - Remove explicit inline external for runtime helpers
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependency `@vueuse/core@12.6.1` to `@vueuse/core@12.7.0`
19
+
3
20
  ## 8.9.2
4
21
 
5
22
  ### Patch Changes
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "8.9.2",
3
+ "version": "8.10.1",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -5,6 +5,7 @@ import { defu } from 'defu';
5
5
  import { genImport, genSafeVariableName, genExport } from 'knitwork';
6
6
  import { builtinDrivers } from 'unstorage';
7
7
  import { createConsola } from 'consola';
8
+ import { nodeFileTrace } from '@vercel/nft';
8
9
  import { getApiBasePath } from '../dist/runtime/server/middleware/bootstrap-utils.js';
9
10
 
10
11
  function stringToBoolean(value, defaultValue = false) {
@@ -45,7 +46,7 @@ export default {
45
46
  }`;
46
47
  }
47
48
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
48
- const PACKAGE_VERSION = "8.9.2";
49
+ const PACKAGE_VERSION = "8.10.1";
49
50
  const logger = createConsola({
50
51
  fancy: true,
51
52
  formatOptions: {
@@ -80,37 +81,9 @@ function createRpcMethodTypeDeclaration(customRpcImports) {
80
81
  }
81
82
  export {}`;
82
83
  }
83
- function nitroSetup(nitroConfig, config) {
84
- const { resolve } = createResolver(import.meta.url);
84
+ async function nitroSetup(nitroConfig, config) {
85
+ const { resolve, resolvePath } = createResolver(import.meta.url);
85
86
  const { apiBasePath, customRpcImports, coreMethodNames, usedDrivers } = config;
86
- nitroConfig.externals = nitroConfig.externals || {};
87
- nitroConfig.externals.inline = nitroConfig.externals.inline || [];
88
- const runtimePaths = [
89
- "handler",
90
- "error/handler",
91
- "campaignKey",
92
- "cached",
93
- "context",
94
- "createLog",
95
- "log",
96
- "api/cacheAuth",
97
- "rpc/rpcCall",
98
- "rpc/rpcRequest",
99
- "server/middleware/oauth",
100
- "server/middleware/redirects",
101
- "server/middleware/cache",
102
- "server/utils/cacheStorage",
103
- "utils/zodSchema",
104
- "nitro/plugins/cacheRuntimeConfig",
105
- "nitro/plugins/nitroLogger",
106
- "nitro/plugins/nitroRuntimeStorageConfig",
107
- "nitro/plugins/nitroSetXPoweredByHeader",
108
- "nitro/plugins/configValidation"
109
- ];
110
- runtimePaths.forEach((path) => {
111
- const file = resolve(`./runtime/${path}`);
112
- nitroConfig.externals?.inline?.push(file);
113
- });
114
87
  nitroConfig.replace = nitroConfig.replace || {};
115
88
  nitroConfig.replace["process.env.SFC_OMIT_MD5"] = stringToBoolean(
116
89
  process.env.SFC_OMIT_MD5
@@ -178,6 +151,21 @@ function nitroSetup(nitroConfig, config) {
178
151
  resolve("./runtime/nitro/plugins/cacheRuntimeConfig")
179
152
  );
180
153
  }
154
+ const base = resolve(`./`);
155
+ const handlerPaths = nitroConfig.handlers.filter(
156
+ (h) => h?.handler && h?.handler.startsWith(base)
157
+ ).map((h) => h?.handler);
158
+ const pluginPaths = nitroConfig.plugins.filter(
159
+ (p) => p && p?.startsWith(base)
160
+ );
161
+ const runtimeEntries = await Promise.all(
162
+ [...handlerPaths, ...pluginPaths].map((p) => resolvePath(p))
163
+ );
164
+ const trace = await nodeFileTrace(runtimeEntries, { base });
165
+ const tracedImports = [...trace.fileList].map((p) => resolve(p));
166
+ nitroConfig.externals = nitroConfig.externals ?? {};
167
+ nitroConfig.externals.inline = nitroConfig.externals.inline ?? [];
168
+ nitroConfig.externals.inline.push(...tracedImports);
181
169
  }
182
170
  function validateRpcMethodOverrides(rpcMethodOverrides, customRpcNames, coreRpcNames) {
183
171
  const overriddenRPCMethodNames = new Set(rpcMethodOverrides);
@@ -327,8 +315,8 @@ const module = defineNuxtModule({
327
315
  }
328
316
  export {}`
329
317
  });
330
- nuxt.hooks.hook("nitro:config", (nitroConfig) => {
331
- nitroSetup(nitroConfig, {
318
+ nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
319
+ await nitroSetup(nitroConfig, {
332
320
  apiBasePath,
333
321
  customRpcImports,
334
322
  coreMethodNames: [...rpcMethodNames],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "8.9.2",
4
+ "version": "8.10.1",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -74,7 +74,8 @@
74
74
  "@scayle/h3-session": "0.6.0",
75
75
  "@scayle/storefront-core": "8.7.0",
76
76
  "@scayle/unstorage-compression-driver": "^0.2.3",
77
- "@vueuse/core": "12.6.1",
77
+ "@vercel/nft": "0.29.1",
78
+ "@vueuse/core": "12.7.0",
78
79
  "consola": "^3.2.3",
79
80
  "core-js": "^3.37.1",
80
81
  "defu": "^6.1.4",
@@ -109,7 +110,7 @@
109
110
  "nuxt": "3.14.1592",
110
111
  "publint": "0.2.12",
111
112
  "typescript": "5.7.3",
112
- "vue-tsc": "2.2.0",
113
+ "vue-tsc": "2.2.2",
113
114
  "vitest": "2.1.9"
114
115
  },
115
116
  "peerDependencies": {
@@ -128,6 +129,6 @@
128
129
  "@nuxt/schema": "3.14.1592"
129
130
  },
130
131
  "volta": {
131
- "node": "22.13.1"
132
+ "node": "22.14.0"
132
133
  }
133
134
  }