We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccc0975 commit 360aa1cCopy full SHA for 360aa1c
.changeset/healthy-masks-live.md
@@ -0,0 +1,5 @@
1
+---
2
+"@gitbook/openapi-parser": patch
3
4
+
5
+Upgrade Scalar dependencies
bun.lock
packages/openapi-parser/package.json
@@ -12,8 +12,9 @@
12
"version": "3.0.1",
13
"sideEffects": false,
14
"dependencies": {
15
- "@scalar/openapi-parser": "^0.18.0",
16
- "@scalar/openapi-types": "^0.1.9"
+ "@scalar/json-magic": "^0.3.1",
+ "@scalar/openapi-parser": "^0.20.1",
17
+ "@scalar/openapi-types": "^0.3.7"
18
},
19
"devDependencies": {
20
"@tsconfig/strictest": "^2.0.5",
packages/openapi-parser/src/filesystem.ts
@@ -1,5 +1,5 @@
-import { bundle } from '@scalar/openapi-parser';
-import { parseJson, parseYaml } from '@scalar/openapi-parser/plugins-browser';
+import { bundle } from '@scalar/json-magic/bundle';
+import { parseJson, parseYaml } from '@scalar/json-magic/bundle/plugins/browser';
import type { ParseOpenAPIInput } from './parse';
import { fetchURL } from './scalar-plugins/fetchURL';
import { fetchURLs } from './scalar-plugins/fetchURLs';
packages/openapi-parser/src/parse.ts
@@ -1,11 +1,10 @@
-import type { AnyObject, ErrorObject, bundle } from '@scalar/openapi-parser';
+import type { Plugin } from '@scalar/json-magic/bundle';
+import type { AnyObject, ErrorObject } from '@scalar/openapi-parser';
import { OpenAPIParseError } from './error';
import type { Filesystem, OpenAPIV3xDocument } from './types';
import { convertOpenAPIV2ToOpenAPIV3 } from './v2';
6
import { parseOpenAPIV3 } from './v3';
7
-export type ParsePlugin = Parameters<typeof bundle>[1]['plugins'][number];
8
-
9
export interface ParseOpenAPIInput {
10
/**
11
* The API definition to parse.
@@ -19,7 +18,7 @@ export interface ParseOpenAPIInput {
* Options for the parser.
*/
21
options?: {
22
- plugins?: ParsePlugin[];
+ plugins?: Plugin[];
23
};
24
}
25
packages/openapi-parser/src/scalar-plugins/fetchURL.ts
@@ -1,11 +1,12 @@
import { normalize } from '@scalar/openapi-parser';
-import type { ParsePlugin } from '../parse';
export const fetchUrlsDefaultConfiguration = {
limit: 40,
-export const fetchURL = (): ParsePlugin => ({
+export const fetchURL = (): Plugin => ({
+ type: 'loader',
validate(value) {
return URL.canParse(value);
packages/openapi-parser/src/scalar-plugins/fetchURLs.ts
@@ -15,7 +15,7 @@ export const fetchURLs = (customConfiguration: {
* Limit the number of requests. Set to `false` to disable the limit.
limit?: number | false;
-}): ParsePlugin => {
+}): Plugin => {
// State
let numberOfRequests = 0;
@@ -26,6 +26,7 @@ export const fetchURLs = (customConfiguration: {
26
27
28
return {
29
30
31
// Not a string
32
if (typeof value !== 'string') {
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments