site-config-stack 4.2.3 → 5.0.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/index.cjs CHANGED
@@ -41,7 +41,9 @@ function envSiteConfig(env = {}) {
41
41
  function normalizeSiteConfig(config) {
42
42
  if (typeof config.indexable !== "undefined")
43
43
  config.indexable = String(config.indexable) !== "false";
44
- if (typeof config.trailingSlash !== "undefined" && !config.trailingSlash)
44
+ else if (typeof config.env !== "undefined")
45
+ config.indexable = config.env === "production";
46
+ if (typeof config.trailingSlash !== "undefined")
45
47
  config.trailingSlash = String(config.trailingSlash) !== "false";
46
48
  if (config.url && !ufo.hasProtocol(String(config.url), { acceptRelative: true, strict: false }))
47
49
  config.url = ufo.withHttps(String(config.url));
@@ -72,6 +74,8 @@ function validateSiteConfigStack(stack, options) {
72
74
  errors.push(`url "${val}" from ${context} should not contain a query`);
73
75
  else if (hostname === "localhost" && !options?.dev && resolved.env !== "development")
74
76
  errors.push(`url "${val}" from ${context} should not be localhost`);
77
+ } else if (options?.prerender) {
78
+ errors.push("url is not set, so prerendered pages render absolute URLs as relative paths. Set site.url or NUXT_SITE_URL");
75
79
  }
76
80
  return errors;
77
81
  }
package/dist/index.d.cts CHANGED
@@ -87,6 +87,7 @@ interface SiteConfigStack {
87
87
  declare function normalizeSiteConfig(config: SiteConfigResolved): SiteConfigResolved;
88
88
  declare function validateSiteConfigStack(stack: SiteConfigStack, options?: {
89
89
  dev?: boolean;
90
+ prerender?: boolean;
90
91
  }): string[];
91
92
  declare function createSiteConfigStack(options?: {
92
93
  debug: boolean;
package/dist/index.d.mts CHANGED
@@ -87,6 +87,7 @@ interface SiteConfigStack {
87
87
  declare function normalizeSiteConfig(config: SiteConfigResolved): SiteConfigResolved;
88
88
  declare function validateSiteConfigStack(stack: SiteConfigStack, options?: {
89
89
  dev?: boolean;
90
+ prerender?: boolean;
90
91
  }): string[];
91
92
  declare function createSiteConfigStack(options?: {
92
93
  debug: boolean;
package/dist/index.d.ts CHANGED
@@ -87,6 +87,7 @@ interface SiteConfigStack {
87
87
  declare function normalizeSiteConfig(config: SiteConfigResolved): SiteConfigResolved;
88
88
  declare function validateSiteConfigStack(stack: SiteConfigStack, options?: {
89
89
  dev?: boolean;
90
+ prerender?: boolean;
90
91
  }): string[];
91
92
  declare function createSiteConfigStack(options?: {
92
93
  debug: boolean;
package/dist/index.mjs CHANGED
@@ -39,7 +39,9 @@ function envSiteConfig(env = {}) {
39
39
  function normalizeSiteConfig(config) {
40
40
  if (typeof config.indexable !== "undefined")
41
41
  config.indexable = String(config.indexable) !== "false";
42
- if (typeof config.trailingSlash !== "undefined" && !config.trailingSlash)
42
+ else if (typeof config.env !== "undefined")
43
+ config.indexable = config.env === "production";
44
+ if (typeof config.trailingSlash !== "undefined")
43
45
  config.trailingSlash = String(config.trailingSlash) !== "false";
44
46
  if (config.url && !hasProtocol(String(config.url), { acceptRelative: true, strict: false }))
45
47
  config.url = withHttps(String(config.url));
@@ -70,6 +72,8 @@ function validateSiteConfigStack(stack, options) {
70
72
  errors.push(`url "${val}" from ${context} should not contain a query`);
71
73
  else if (hostname === "localhost" && !options?.dev && resolved.env !== "development")
72
74
  errors.push(`url "${val}" from ${context} should not be localhost`);
75
+ } else if (options?.prerender) {
76
+ errors.push("url is not set, so prerendered pages render absolute URLs as relative paths. Set site.url or NUXT_SITE_URL");
73
77
  }
74
78
  return errors;
75
79
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "site-config-stack",
3
3
  "type": "module",
4
- "version": "4.2.3",
4
+ "version": "5.0.1",
5
5
  "description": "Shared site configuration utilities.",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -36,15 +36,18 @@
36
36
  "dist",
37
37
  "urls.d.ts"
38
38
  ],
39
+ "engines": {
40
+ "node": "^22.22.3 || ^24.15.0 || >=26.0.0"
41
+ },
39
42
  "peerDependencies": {
40
- "vue": "^3.5.30"
43
+ "vue": "^3.5.43"
41
44
  },
42
45
  "dependencies": {
43
46
  "ufo": "^1.6.4"
44
47
  },
45
48
  "devDependencies": {
46
49
  "unbuild": "^3.6.1",
47
- "vue": "^3.5.41"
50
+ "vue": "^3.5.43"
48
51
  },
49
52
  "scripts": {
50
53
  "lint": "eslint . --fix",