nuxt-site-config 0.8.0 → 0.8.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/dist/module.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "bridge": false
6
6
  },
7
7
  "configKey": "site",
8
- "version": "0.8.0"
8
+ "version": "0.8.1"
9
9
  }
package/dist/module.mjs CHANGED
@@ -49,8 +49,6 @@ const module = defineNuxtModule({
49
49
  filePath: resolve("./runtime/component/SiteLink.vue"),
50
50
  name: "SiteLink"
51
51
  });
52
- const shared = resolve("./runtime/siteConfig");
53
- nuxt.options.build.transpile.push(shared);
54
52
  nuxt.options.nitro.imports = nuxt.options.nitro.imports || {};
55
53
  nuxt.options.nitro.imports.imports = nuxt.options.nitro.imports.imports || [];
56
54
  nuxt.options.nitro.imports.imports.push(...[
@@ -68,6 +66,16 @@ const module = defineNuxtModule({
68
66
  as: "updateSiteConfig",
69
67
  name: "updateSiteConfig",
70
68
  from: resolve("./runtime/nitro/composables/updateSiteConfig")
69
+ },
70
+ {
71
+ as: "withSiteUrl",
72
+ name: "withSiteUrl",
73
+ from: resolve("./runtime/nitro/composables/utils")
74
+ },
75
+ {
76
+ as: "withSiteTrailingSlash",
77
+ name: "withSiteTrailingSlash",
78
+ from: resolve("./runtime/nitro/composables/utils")
71
79
  }
72
80
  ]);
73
81
  nuxt.options.build.transpile.push("site-config-stack");
@@ -1,4 +1,5 @@
1
- export declare function withSiteTrailingSlash(path: string): string;
2
- export declare function withSiteUrl(path: string, options?: {
1
+ import type { H3Event } from 'h3';
2
+ export declare function withSiteTrailingSlash(e: H3Event, path: string): string;
3
+ export declare function withSiteUrl(e: H3Event, path: string, options?: {
3
4
  withBase?: boolean;
4
5
  }): string;
@@ -1,17 +1,15 @@
1
1
  import { fixSlashes, resolveSitePath } from "site-config-stack";
2
- import { useRuntimeConfig, useSiteConfig } from "#imports";
3
- export function withSiteTrailingSlash(path) {
4
- const siteConfig = useSiteConfig();
2
+ export function withSiteTrailingSlash(e, path) {
3
+ const siteConfig = e.context.siteConfig?.get();
5
4
  return fixSlashes(siteConfig.trailingSlash, path);
6
5
  }
7
- export function withSiteUrl(path, options = {}) {
8
- const siteConfig = useSiteConfig();
9
- const base = useRuntimeConfig().app.baseURL || "/";
6
+ export function withSiteUrl(e, path, options = {}) {
7
+ const siteConfig = e.context.siteConfig?.get();
10
8
  return resolveSitePath(path, {
11
9
  absolute: true,
12
- siteUrl: siteConfig.url,
10
+ siteUrl: siteConfig.url || "",
13
11
  trailingSlash: siteConfig.trailingSlash,
14
- base,
12
+ base: e.context.nitro.baseURL,
15
13
  withBase: options.withBase
16
14
  });
17
15
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-site-config",
3
3
  "type": "module",
4
- "version": "0.8.0",
4
+ "version": "0.8.1",
5
5
  "packageManager": "pnpm@8.6.5",
6
6
  "description": "Shared site configuration for Nuxt 3 modules.",
7
7
  "license": "MIT",
@@ -29,8 +29,8 @@
29
29
  "dependencies": {
30
30
  "@nuxt/kit": "3.6.1",
31
31
  "ufo": "^1.1.2",
32
- "nuxt-site-config-kit": "0.8.0",
33
- "site-config-stack": "0.8.0"
32
+ "nuxt-site-config-kit": "0.8.1",
33
+ "site-config-stack": "0.8.1"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "nuxt-module-build --stub && nuxt-module-build prepare && nuxt-module-build",