@scalar/nuxt 0.6.60 → 0.6.62

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scalar/nuxt",
3
3
  "configKey": "scalar",
4
- "version": "0.6.60",
4
+ "version": "0.6.62",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "unknown"
@@ -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("document", () => null);
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("openapi-spec", async () => {
43
- const response = await $fetch("/_openapi.json", {
44
- responseType: "text"
45
- });
46
- return response;
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.60",
23
+ "version": "0.6.62",
24
24
  "engines": {
25
25
  "node": ">=22"
26
26
  },
@@ -53,18 +53,18 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@nuxt/kit": "^4.0.0",
56
- "vue": "^3.5.30",
57
- "@scalar/api-client": "3.14.0",
58
- "@scalar/types": "0.17.0",
59
- "@scalar/api-reference": "1.64.0",
60
- "@scalar/use-hooks": "0.4.9"
56
+ "vue": "^3.5.40",
57
+ "@scalar/api-client": "3.16.0",
58
+ "@scalar/types": "0.18.0",
59
+ "@scalar/use-hooks": "0.4.9",
60
+ "@scalar/api-reference": "1.65.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@nuxt/module-builder": "^1.0.1",
64
64
  "@types/node": "^24.1.0",
65
65
  "cross-env": "10.1.0",
66
66
  "nuxt": "^4.1.0",
67
- "vitest": "4.1.0"
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",