nuxt-site-config-kit 1.1.1 → 1.1.2
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 +4 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +4 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -83,7 +83,7 @@ function useSiteConfig(context, nuxt = kit.tryUseNuxt()) {
|
|
|
83
83
|
|
|
84
84
|
function requireSiteConfig() {
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
function assertSiteConfig(context, requirements, options) {
|
|
87
87
|
const siteConfig = useSiteConfig();
|
|
88
88
|
let valid = true;
|
|
89
89
|
const messages = [];
|
|
@@ -96,10 +96,10 @@ async function assertSiteConfig(context, requirements, options) {
|
|
|
96
96
|
valid = false;
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
|
-
if (!valid
|
|
100
|
-
if (options?.logErrors
|
|
99
|
+
if (!valid) {
|
|
100
|
+
if (options?.logErrors)
|
|
101
101
|
logger.error(messages.join("\n"));
|
|
102
|
-
else
|
|
102
|
+
else if (options?.throwError)
|
|
103
103
|
throw new Error(messages.join("\n"));
|
|
104
104
|
}
|
|
105
105
|
return {
|
package/dist/index.d.cts
CHANGED
|
@@ -33,10 +33,10 @@ declare function requireSiteConfig(): void;
|
|
|
33
33
|
declare function assertSiteConfig(context: string, requirements: Partial<Record<keyof SiteConfig, string>>, options?: {
|
|
34
34
|
throwError?: boolean;
|
|
35
35
|
logErrors?: boolean;
|
|
36
|
-
}):
|
|
36
|
+
}): {
|
|
37
37
|
valid: boolean;
|
|
38
38
|
messages: string[];
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
40
|
|
|
41
41
|
declare function useNitroOrigin(): string;
|
|
42
42
|
declare function withSiteUrl(path: string, options?: {
|
package/dist/index.d.mts
CHANGED
|
@@ -33,10 +33,10 @@ declare function requireSiteConfig(): void;
|
|
|
33
33
|
declare function assertSiteConfig(context: string, requirements: Partial<Record<keyof SiteConfig, string>>, options?: {
|
|
34
34
|
throwError?: boolean;
|
|
35
35
|
logErrors?: boolean;
|
|
36
|
-
}):
|
|
36
|
+
}): {
|
|
37
37
|
valid: boolean;
|
|
38
38
|
messages: string[];
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
40
|
|
|
41
41
|
declare function useNitroOrigin(): string;
|
|
42
42
|
declare function withSiteUrl(path: string, options?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -33,10 +33,10 @@ declare function requireSiteConfig(): void;
|
|
|
33
33
|
declare function assertSiteConfig(context: string, requirements: Partial<Record<keyof SiteConfig, string>>, options?: {
|
|
34
34
|
throwError?: boolean;
|
|
35
35
|
logErrors?: boolean;
|
|
36
|
-
}):
|
|
36
|
+
}): {
|
|
37
37
|
valid: boolean;
|
|
38
38
|
messages: string[];
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
40
|
|
|
41
41
|
declare function useNitroOrigin(): string;
|
|
42
42
|
declare function withSiteUrl(path: string, options?: {
|
package/dist/index.mjs
CHANGED
|
@@ -81,7 +81,7 @@ function useSiteConfig(context, nuxt = tryUseNuxt()) {
|
|
|
81
81
|
|
|
82
82
|
function requireSiteConfig() {
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
function assertSiteConfig(context, requirements, options) {
|
|
85
85
|
const siteConfig = useSiteConfig();
|
|
86
86
|
let valid = true;
|
|
87
87
|
const messages = [];
|
|
@@ -94,10 +94,10 @@ async function assertSiteConfig(context, requirements, options) {
|
|
|
94
94
|
valid = false;
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
-
if (!valid
|
|
98
|
-
if (options?.logErrors
|
|
97
|
+
if (!valid) {
|
|
98
|
+
if (options?.logErrors)
|
|
99
99
|
logger.error(messages.join("\n"));
|
|
100
|
-
else
|
|
100
|
+
else if (options?.throwError)
|
|
101
101
|
throw new Error(messages.join("\n"));
|
|
102
102
|
}
|
|
103
103
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-site-config-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"description": "Shared site configuration build-time utilities for Nuxt 3 modules.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@nuxt/schema": "^3.7.1",
|
|
32
32
|
"pkg-types": "^1.0.3",
|
|
33
33
|
"ufo": "^1.3.0",
|
|
34
|
-
"site-config-stack": "1.1.
|
|
34
|
+
"site-config-stack": "1.1.2"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"lint": "eslint . --fix",
|