site-config-stack 1.1.3 → 1.2.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
@@ -19,11 +19,11 @@ function createSiteConfigStack() {
19
19
  const siteConfig = {
20
20
  _context: {}
21
21
  };
22
- for (const o in stack) {
22
+ for (const o in stack.sort((a, b) => (a._priority || 0) - (b._priority || 0))) {
23
23
  for (const k in stack[o]) {
24
24
  const key = k;
25
25
  const val = stack[o][k];
26
- if (!k.endsWith("context") && typeof val !== "undefined") {
26
+ if (!k.startsWith("_") && typeof val !== "undefined") {
27
27
  siteConfig[k] = val;
28
28
  siteConfig._context[key] = stack[o]._context?.[key] || stack[o]._context || "anonymous";
29
29
  }
package/dist/index.d.cts CHANGED
@@ -27,7 +27,7 @@ interface SiteConfig {
27
27
  */
28
28
  trailingSlash: boolean;
29
29
  /**
30
- * Current locale, set with @nuxt/i18n.
30
+ * Current locale, set with `@nuxt/i18n`.
31
31
  *
32
32
  * Falls back to the defaultLocale.
33
33
  */
@@ -57,19 +57,21 @@ interface SiteConfig {
57
57
  /**
58
58
  * Twitter (X) profile ID.
59
59
  *
60
- * Used for Schema.org sameAs and <meta profile>.
60
+ * Used for Schema.org sameAs and `<meta profile>`.
61
61
  *
62
- * @example @harlan_zw
62
+ * @example `@harlan_zw`
63
63
  */
64
64
  twitter?: string;
65
65
  /**
66
66
  * The mapping of the context of each site config value being set.
67
67
  */
68
68
  _context: Partial<Record<Exclude<keyof SiteConfig, '_meta'>, string>>;
69
- [key: string]: any;
69
+ [key: (string & Record<never, never>)]: any;
70
70
  }
71
- type SiteConfigInput = Partial<Omit<SiteConfig, '_context'>> & {
71
+ type SiteConfigInput = Partial<Omit<SiteConfig, '_context' | 'indexable'>> & {
72
72
  _context?: string;
73
+ _priority?: number;
74
+ indexable?: string | boolean;
73
75
  };
74
76
  interface SiteConfigStack {
75
77
  stack: Partial<SiteConfigInput>[];
package/dist/index.d.mts CHANGED
@@ -27,7 +27,7 @@ interface SiteConfig {
27
27
  */
28
28
  trailingSlash: boolean;
29
29
  /**
30
- * Current locale, set with @nuxt/i18n.
30
+ * Current locale, set with `@nuxt/i18n`.
31
31
  *
32
32
  * Falls back to the defaultLocale.
33
33
  */
@@ -57,19 +57,21 @@ interface SiteConfig {
57
57
  /**
58
58
  * Twitter (X) profile ID.
59
59
  *
60
- * Used for Schema.org sameAs and <meta profile>.
60
+ * Used for Schema.org sameAs and `<meta profile>`.
61
61
  *
62
- * @example @harlan_zw
62
+ * @example `@harlan_zw`
63
63
  */
64
64
  twitter?: string;
65
65
  /**
66
66
  * The mapping of the context of each site config value being set.
67
67
  */
68
68
  _context: Partial<Record<Exclude<keyof SiteConfig, '_meta'>, string>>;
69
- [key: string]: any;
69
+ [key: (string & Record<never, never>)]: any;
70
70
  }
71
- type SiteConfigInput = Partial<Omit<SiteConfig, '_context'>> & {
71
+ type SiteConfigInput = Partial<Omit<SiteConfig, '_context' | 'indexable'>> & {
72
72
  _context?: string;
73
+ _priority?: number;
74
+ indexable?: string | boolean;
73
75
  };
74
76
  interface SiteConfigStack {
75
77
  stack: Partial<SiteConfigInput>[];
package/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ interface SiteConfig {
27
27
  */
28
28
  trailingSlash: boolean;
29
29
  /**
30
- * Current locale, set with @nuxt/i18n.
30
+ * Current locale, set with `@nuxt/i18n`.
31
31
  *
32
32
  * Falls back to the defaultLocale.
33
33
  */
@@ -57,19 +57,21 @@ interface SiteConfig {
57
57
  /**
58
58
  * Twitter (X) profile ID.
59
59
  *
60
- * Used for Schema.org sameAs and <meta profile>.
60
+ * Used for Schema.org sameAs and `<meta profile>`.
61
61
  *
62
- * @example @harlan_zw
62
+ * @example `@harlan_zw`
63
63
  */
64
64
  twitter?: string;
65
65
  /**
66
66
  * The mapping of the context of each site config value being set.
67
67
  */
68
68
  _context: Partial<Record<Exclude<keyof SiteConfig, '_meta'>, string>>;
69
- [key: string]: any;
69
+ [key: (string & Record<never, never>)]: any;
70
70
  }
71
- type SiteConfigInput = Partial<Omit<SiteConfig, '_context'>> & {
71
+ type SiteConfigInput = Partial<Omit<SiteConfig, '_context' | 'indexable'>> & {
72
72
  _context?: string;
73
+ _priority?: number;
74
+ indexable?: string | boolean;
73
75
  };
74
76
  interface SiteConfigStack {
75
77
  stack: Partial<SiteConfigInput>[];
package/dist/index.mjs CHANGED
@@ -17,11 +17,11 @@ function createSiteConfigStack() {
17
17
  const siteConfig = {
18
18
  _context: {}
19
19
  };
20
- for (const o in stack) {
20
+ for (const o in stack.sort((a, b) => (a._priority || 0) - (b._priority || 0))) {
21
21
  for (const k in stack[o]) {
22
22
  const key = k;
23
23
  const val = stack[o][k];
24
- if (!k.endsWith("context") && typeof val !== "undefined") {
24
+ if (!k.startsWith("_") && typeof val !== "undefined") {
25
25
  siteConfig[k] = val;
26
26
  siteConfig._context[key] = stack[o]._context?.[key] || stack[o]._context || "anonymous";
27
27
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "site-config-stack",
3
3
  "type": "module",
4
- "version": "1.1.3",
4
+ "version": "1.2.1",
5
5
  "description": "Shared site configuration utilities.",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",