@scalar/nuxt 0.6.60 → 0.6.61
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
|
@@ -24,7 +24,10 @@ const content = props.configuration.spec?.content ?? props.configuration.content
|
|
|
24
24
|
const url = props.configuration.spec?.url ?? props.configuration.url;
|
|
25
25
|
const currentRoute = useRoute();
|
|
26
26
|
const meta = currentRoute.meta;
|
|
27
|
-
const document = useState(
|
|
27
|
+
const document = useState(
|
|
28
|
+
`scalar-document:${String(currentRoute.name)}`,
|
|
29
|
+
() => null
|
|
30
|
+
);
|
|
28
31
|
if (!document.value) {
|
|
29
32
|
if (typeof content === "function") {
|
|
30
33
|
document.value = content();
|
|
@@ -39,19 +42,22 @@ if (!document.value) {
|
|
|
39
42
|
}
|
|
40
43
|
} else if (meta.isOpenApiEnabled) {
|
|
41
44
|
try {
|
|
42
|
-
const { data } = await useAsyncData(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const { data } = await useAsyncData(
|
|
46
|
+
`scalar-openapi-spec:${String(currentRoute.name)}`,
|
|
47
|
+
async () => {
|
|
48
|
+
const response = await $fetch("/_openapi.json", {
|
|
49
|
+
responseType: "text"
|
|
50
|
+
});
|
|
51
|
+
return response;
|
|
52
|
+
}
|
|
53
|
+
);
|
|
48
54
|
document.value = data.value || null;
|
|
49
55
|
} catch (error) {
|
|
50
56
|
console.error("Failed to fetch OpenAPI spec from /_openapi.json:", error);
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
|
-
if (!document) {
|
|
60
|
+
if (!document.value) {
|
|
55
61
|
throw new Error(
|
|
56
62
|
"You must provide a document for Scalar API References. Either provide a spec URL/content, or enable experimental openAPI in the Nitro config."
|
|
57
63
|
);
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"testing",
|
|
21
21
|
"vue"
|
|
22
22
|
],
|
|
23
|
-
"version": "0.6.
|
|
23
|
+
"version": "0.6.61",
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=22"
|
|
26
26
|
},
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@nuxt/kit": "^4.0.0",
|
|
56
|
-
"vue": "^3.5.
|
|
57
|
-
"@scalar/api-client": "3.
|
|
58
|
-
"@scalar/
|
|
59
|
-
"@scalar/
|
|
56
|
+
"vue": "^3.5.40",
|
|
57
|
+
"@scalar/api-client": "3.15.0",
|
|
58
|
+
"@scalar/api-reference": "1.64.1",
|
|
59
|
+
"@scalar/types": "0.17.1",
|
|
60
60
|
"@scalar/use-hooks": "0.4.9"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@types/node": "^24.1.0",
|
|
65
65
|
"cross-env": "10.1.0",
|
|
66
66
|
"nuxt": "^4.1.0",
|
|
67
|
-
"vitest": "4.1.
|
|
67
|
+
"vitest": "4.1.10"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "cross-env NUXT_TELEMETRY_DISABLED=false pnpm dev:prepare && nuxt-module-build build",
|