site-config-stack 3.2.10 → 3.2.11

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
@@ -16,7 +16,7 @@ function normalizeSiteConfig(config) {
16
16
  newConfig[k] = config[k];
17
17
  return newConfig;
18
18
  }
19
- function validateSiteConfigStack(stack) {
19
+ function validateSiteConfigStack(stack, options) {
20
20
  const resolved = normalizeSiteConfig(stack.get({
21
21
  // we need the context
22
22
  debug: true
@@ -35,7 +35,7 @@ function validateSiteConfigStack(stack) {
35
35
  errors.push(`url "${val}" from ${context} should not contain a hash`);
36
36
  else if (Object.keys(ufo.getQuery(val)).length > 0)
37
37
  errors.push(`url "${val}" from ${context} should not contain a query`);
38
- else if (hostname === "localhost" && resolved.env !== "development")
38
+ else if (hostname === "localhost" && !options?.dev && resolved.env !== "development")
39
39
  errors.push(`url "${val}" from ${context} should not be localhost`);
40
40
  }
41
41
  return errors;
package/dist/index.d.cts CHANGED
@@ -68,7 +68,9 @@ interface SiteConfigStack {
68
68
  }
69
69
 
70
70
  declare function normalizeSiteConfig(config: SiteConfigResolved): SiteConfigResolved;
71
- declare function validateSiteConfigStack(stack: SiteConfigStack): string[];
71
+ declare function validateSiteConfigStack(stack: SiteConfigStack, options?: {
72
+ dev?: boolean;
73
+ }): string[];
72
74
  declare function createSiteConfigStack(options?: {
73
75
  debug: boolean;
74
76
  }): SiteConfigStack;
package/dist/index.d.mts CHANGED
@@ -68,7 +68,9 @@ interface SiteConfigStack {
68
68
  }
69
69
 
70
70
  declare function normalizeSiteConfig(config: SiteConfigResolved): SiteConfigResolved;
71
- declare function validateSiteConfigStack(stack: SiteConfigStack): string[];
71
+ declare function validateSiteConfigStack(stack: SiteConfigStack, options?: {
72
+ dev?: boolean;
73
+ }): string[];
72
74
  declare function createSiteConfigStack(options?: {
73
75
  debug: boolean;
74
76
  }): SiteConfigStack;
package/dist/index.d.ts CHANGED
@@ -68,7 +68,9 @@ interface SiteConfigStack {
68
68
  }
69
69
 
70
70
  declare function normalizeSiteConfig(config: SiteConfigResolved): SiteConfigResolved;
71
- declare function validateSiteConfigStack(stack: SiteConfigStack): string[];
71
+ declare function validateSiteConfigStack(stack: SiteConfigStack, options?: {
72
+ dev?: boolean;
73
+ }): string[];
72
74
  declare function createSiteConfigStack(options?: {
73
75
  debug: boolean;
74
76
  }): SiteConfigStack;
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ function normalizeSiteConfig(config) {
14
14
  newConfig[k] = config[k];
15
15
  return newConfig;
16
16
  }
17
- function validateSiteConfigStack(stack) {
17
+ function validateSiteConfigStack(stack, options) {
18
18
  const resolved = normalizeSiteConfig(stack.get({
19
19
  // we need the context
20
20
  debug: true
@@ -33,7 +33,7 @@ function validateSiteConfigStack(stack) {
33
33
  errors.push(`url "${val}" from ${context} should not contain a hash`);
34
34
  else if (Object.keys(getQuery(val)).length > 0)
35
35
  errors.push(`url "${val}" from ${context} should not contain a query`);
36
- else if (hostname === "localhost" && resolved.env !== "development")
36
+ else if (hostname === "localhost" && !options?.dev && resolved.env !== "development")
37
37
  errors.push(`url "${val}" from ${context} should not be localhost`);
38
38
  }
39
39
  return errors;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "site-config-stack",
3
3
  "type": "module",
4
- "version": "3.2.10",
4
+ "version": "3.2.11",
5
5
  "description": "Shared site configuration utilities.",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",