@scalar/nuxt 0.0.30 → 0.0.34
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/README.md +34 -0
- package/dist/module.d.mts +8 -2
- package/dist/module.d.ts +8 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +27 -10
- package/dist/runtime/plugins/hydrateClient.d.mts +2 -0
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -73,3 +73,37 @@ export default defineNuxtConfig({
|
|
|
73
73
|
},
|
|
74
74
|
})
|
|
75
75
|
```
|
|
76
|
+
|
|
77
|
+
For multiple references, pass in an array of configuration objects which extend on top of the base
|
|
78
|
+
config.
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
export default defineNuxtConfig({
|
|
82
|
+
modules: ['@scalar/nuxt'],
|
|
83
|
+
scalar: {
|
|
84
|
+
darkMode: true,
|
|
85
|
+
metaData: {
|
|
86
|
+
title: 'API Documentation by Scalar',
|
|
87
|
+
},
|
|
88
|
+
proxy: 'https://api.scalar.com/request-proxy',
|
|
89
|
+
configurations: [
|
|
90
|
+
{
|
|
91
|
+
spec: {
|
|
92
|
+
url: 'https://cdn.scalar.com/spec/openapi_petstore.json',
|
|
93
|
+
},
|
|
94
|
+
pathRouting: {
|
|
95
|
+
basePath: '/petstore',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
spec: {
|
|
100
|
+
url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json',
|
|
101
|
+
},
|
|
102
|
+
pathRouting: {
|
|
103
|
+
basePath: '/galaxy',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
})
|
|
109
|
+
```
|
package/dist/module.d.mts
CHANGED
|
@@ -10,7 +10,13 @@ type Configuration = Omit<ReferenceConfiguration, 'layout' | 'isEditable' | 'onS
|
|
|
10
10
|
devtools: boolean;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
type ModuleOptions =
|
|
14
|
-
|
|
13
|
+
type ModuleOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* For multiple references, pass an array of config objects into
|
|
16
|
+
* configurations. These configurations will extend over the base config
|
|
17
|
+
*/
|
|
18
|
+
configurations: Configuration[];
|
|
19
|
+
} & Configuration;
|
|
20
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
15
21
|
|
|
16
22
|
export { type ModuleOptions, _default as default };
|
package/dist/module.d.ts
CHANGED
|
@@ -10,7 +10,13 @@ type Configuration = Omit<ReferenceConfiguration, 'layout' | 'isEditable' | 'onS
|
|
|
10
10
|
devtools: boolean;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
type ModuleOptions =
|
|
14
|
-
|
|
13
|
+
type ModuleOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* For multiple references, pass an array of config objects into
|
|
16
|
+
* configurations. These configurations will extend over the base config
|
|
17
|
+
*/
|
|
18
|
+
configurations: Configuration[];
|
|
19
|
+
} & Configuration;
|
|
20
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
15
21
|
|
|
16
22
|
export { type ModuleOptions, _default as default };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -15,7 +15,8 @@ const module = defineNuxtModule({
|
|
|
15
15
|
basePath: "/docs"
|
|
16
16
|
},
|
|
17
17
|
showSidebar: true,
|
|
18
|
-
devtools: true
|
|
18
|
+
devtools: true,
|
|
19
|
+
configurations: []
|
|
19
20
|
},
|
|
20
21
|
setup(_options, _nuxt) {
|
|
21
22
|
const resolver = createResolver(import.meta.url);
|
|
@@ -39,15 +40,31 @@ const module = defineNuxtModule({
|
|
|
39
40
|
filePath: resolver.resolve("./runtime/components/ScalarApiReference.vue")
|
|
40
41
|
});
|
|
41
42
|
extendPages((pages) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
if (_options.configurations.length) {
|
|
44
|
+
const { configurations, ...baseConfig } = _options;
|
|
45
|
+
configurations.forEach((_config, index) => {
|
|
46
|
+
const configuration = { ...baseConfig, ..._config };
|
|
47
|
+
pages.push({
|
|
48
|
+
name: "scalar-" + index,
|
|
49
|
+
path: configuration.pathRouting?.basePath + ":pathMatch(.*)*",
|
|
50
|
+
meta: {
|
|
51
|
+
configuration,
|
|
52
|
+
isOpenApiEnabled
|
|
53
|
+
},
|
|
54
|
+
file: resolver.resolve("./runtime/pages/ScalarPage.vue")
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
} else {
|
|
58
|
+
pages.push({
|
|
59
|
+
name: "scalar",
|
|
60
|
+
path: _options.pathRouting?.basePath + ":pathMatch(.*)*",
|
|
61
|
+
meta: {
|
|
62
|
+
configuration: _options,
|
|
63
|
+
isOpenApiEnabled
|
|
64
|
+
},
|
|
65
|
+
file: resolver.resolve("./runtime/pages/ScalarPage.vue")
|
|
66
|
+
});
|
|
67
|
+
}
|
|
51
68
|
});
|
|
52
69
|
if (_nuxt.options.dev && _options.devtools) {
|
|
53
70
|
_nuxt.hook("devtools:customTabs", (tabs) => {
|
package/package.json
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
"author": "Scalar (https://github.com/scalar)",
|
|
6
6
|
"homepage": "https://github.com/scalar/scalar",
|
|
7
7
|
"bugs": "https://github.com/scalar/scalar/issues/new/choose",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/scalar/scalar.git",
|
|
11
|
+
"directory": "packages/nuxt"
|
|
12
|
+
},
|
|
8
13
|
"keywords": [
|
|
9
14
|
"api",
|
|
10
15
|
"references",
|
|
@@ -15,7 +20,7 @@
|
|
|
15
20
|
"testing",
|
|
16
21
|
"vue"
|
|
17
22
|
],
|
|
18
|
-
"version": "0.0.
|
|
23
|
+
"version": "0.0.34",
|
|
19
24
|
"engines": {
|
|
20
25
|
"node": ">=18"
|
|
21
26
|
},
|
|
@@ -34,7 +39,7 @@
|
|
|
34
39
|
],
|
|
35
40
|
"dependencies": {
|
|
36
41
|
"@nuxt/kit": "^3.11.2",
|
|
37
|
-
"@scalar/api-reference": "1.22.
|
|
42
|
+
"@scalar/api-reference": "1.22.24"
|
|
38
43
|
},
|
|
39
44
|
"devDependencies": {
|
|
40
45
|
"@nuxt/devtools": "^1.1.5",
|