@scalar/openapi-parser 0.15.0 → 0.16.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scalar/openapi-parser
2
2
 
3
+ ## 0.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 11fabae: fix(openapi-parser): webpack bundle errors because of the barrel files
8
+
3
9
  ## 0.15.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -61,12 +61,14 @@ The OpenAPI specification allows to point to external files (URLs or files). But
61
61
 
62
62
  #### Plugins
63
63
 
64
+ If you are on a browser environment import plugins from `@scalar/openapi-parser/plugins-browser` while if you are on a node environment you can import from `@scalar/openapi-parser/plugins`
65
+
64
66
  ##### fetchUrls
65
67
  This plugins handles all external urls. It works for both node.js and browser environment
66
68
 
67
69
  ```ts
68
70
  import { bundle } from '@scalar/openapi-parser'
69
- import { fetchUrls } from '@scalar/openapi-parser/utils/bundle/plugins/fetch-urls'
71
+ import { fetchUrls } from '@scalar/openapi-parser/plugins-browser'
70
72
 
71
73
  const document = {
72
74
  openapi: '3.1.0',
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export { upgrade } from './utils/upgrade.js';
14
14
  export { upgradeFromThreeToThreeOne } from './utils/upgrade-from-three-to-three-one.js';
15
15
  export { upgradeFromTwoToThree } from './utils/upgrade-from-two-to-three.js';
16
16
  export { validate } from './utils/validate.js';
17
- export { bundle } from './utils/bundle/index.js';
17
+ export { bundle } from './utils/bundle/bundle.js';
18
18
  export type { LoadResult, Filesystem, AnyObject, ErrorObject } from './types/index.js';
19
19
  export { openapi } from './utils/openapi/openapi.js';
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD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C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAA;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA"}
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { upgrade } from "./utils/upgrade.js";
14
14
  import { upgradeFromThreeToThreeOne } from "./utils/upgrade-from-three-to-three-one.js";
15
15
  import { upgradeFromTwoToThree } from "./utils/upgrade-from-two-to-three.js";
16
16
  import { validate } from "./utils/validate.js";
17
- import { bundle } from "./utils/bundle/index.js";
17
+ import { bundle } from "./utils/bundle/bundle.js";
18
18
  import { openapi } from "./utils/openapi/openapi.js";
19
19
  export {
20
20
  bundle,
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export { dereference } from './utils/dereference'\nexport { escapeJsonPointer } from './utils/escape-json-pointer'\nexport { filter } from './utils/filter'\nexport { isJson } from './utils/is-json'\nexport { isYaml } from './utils/is-yaml'\nexport { load } from './utils/load'\nexport { normalize } from './utils/normalize'\nexport { sanitize } from './utils/transform/sanitize'\nexport { toJson } from './utils/to-json'\nexport { toYaml } from './utils/to-yaml'\nexport { traverse } from './utils/traverse'\nexport { unescapeJsonPointer } from './utils/unescape-json-pointer'\nexport { upgrade } from './utils/upgrade'\nexport { upgradeFromThreeToThreeOne } from './utils/upgrade-from-three-to-three-one'\nexport { upgradeFromTwoToThree } from './utils/upgrade-from-two-to-three'\nexport { validate } from './utils/validate'\nexport { bundle } from './utils/bundle'\nexport type { LoadResult, Filesystem, AnyObject, ErrorObject } from './types'\nexport { openapi } from './utils/openapi/openapi'\n"],
4
+ "sourcesContent": ["export { dereference } from './utils/dereference'\nexport { escapeJsonPointer } from './utils/escape-json-pointer'\nexport { filter } from './utils/filter'\nexport { isJson } from './utils/is-json'\nexport { isYaml } from './utils/is-yaml'\nexport { load } from './utils/load'\nexport { normalize } from './utils/normalize'\nexport { sanitize } from './utils/transform/sanitize'\nexport { toJson } from './utils/to-json'\nexport { toYaml } from './utils/to-yaml'\nexport { traverse } from './utils/traverse'\nexport { unescapeJsonPointer } from './utils/unescape-json-pointer'\nexport { upgrade } from './utils/upgrade'\nexport { upgradeFromThreeToThreeOne } from './utils/upgrade-from-three-to-three-one'\nexport { upgradeFromTwoToThree } from './utils/upgrade-from-two-to-three'\nexport { validate } from './utils/validate'\nexport { bundle } from './utils/bundle/bundle'\nexport type { LoadResult, Filesystem, AnyObject, ErrorObject } from './types'\nexport { openapi } from './utils/openapi/openapi'\n"],
5
5
  "mappings": "AAAA,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AACpC,SAAS,eAAe;AACxB,SAAS,kCAAkC;AAC3C,SAAS,6BAA6B;AACtC,SAAS,gBAAgB;AACzB,SAAS,cAAc;AAEvB,SAAS,eAAe;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,2 @@
1
+ export { fetchUrls } from './utils/bundle/plugins/fetch-urls/index.js';
2
+ //# sourceMappingURL=plugins-browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins-browser.d.ts","sourceRoot":"","sources":["../src/plugins-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { fetchUrls } from "./utils/bundle/plugins/fetch-urls/index.js";
2
+ export {
3
+ fetchUrls
4
+ };
5
+ //# sourceMappingURL=plugins-browser.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/plugins-browser.ts"],
4
+ "sourcesContent": ["export { fetchUrls } from './utils/bundle/plugins/fetch-urls'\n"],
5
+ "mappings": "AAAA,SAAS,iBAAiB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ export { fetchUrls } from './utils/bundle/plugins/fetch-urls/index.js';
2
+ export { readFiles } from './utils/bundle/plugins/read-files/index.js';
3
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { fetchUrls } from "./utils/bundle/plugins/fetch-urls/index.js";
2
+ import { readFiles } from "./utils/bundle/plugins/read-files/index.js";
3
+ export {
4
+ fetchUrls,
5
+ readFiles
6
+ };
7
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/plugins.ts"],
4
+ "sourcesContent": ["export { fetchUrls } from './utils/bundle/plugins/fetch-urls'\nexport { readFiles } from './utils/bundle/plugins/read-files'\n"],
5
+ "mappings": "AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "parser",
18
18
  "typescript"
19
19
  ],
20
- "version": "0.15.0",
20
+ "version": "0.16.0",
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
@@ -30,6 +30,16 @@
30
30
  "types": "./dist/index.d.ts",
31
31
  "default": "./dist/index.js"
32
32
  },
33
+ "./plugins": {
34
+ "import": "./dist/plugins.js",
35
+ "types": "./dist/plugins.d.ts",
36
+ "default": "./dist/plugins.js"
37
+ },
38
+ "./plugins-browser": {
39
+ "import": "./dist/plugins-browser.js",
40
+ "types": "./dist/plugins-browser.d.ts",
41
+ "default": "./dist/plugins-browser.js"
42
+ },
33
43
  "./plugins/fetch-urls": {
34
44
  "import": "./dist/plugins/fetch-urls/index.js",
35
45
  "types": "./dist/plugins/fetch-urls/index.d.ts",
@@ -39,16 +49,6 @@
39
49
  "import": "./dist/plugins/read-files/index.js",
40
50
  "types": "./dist/plugins/read-files/index.d.ts",
41
51
  "default": "./dist/plugins/read-files/index.js"
42
- },
43
- "./utils/bundle/plugins/fetch-urls": {
44
- "import": "./dist/utils/bundle/plugins/fetch-urls/index.js",
45
- "types": "./dist/utils/bundle/plugins/fetch-urls/index.d.ts",
46
- "default": "./dist/utils/bundle/plugins/fetch-urls/index.js"
47
- },
48
- "./utils/bundle/plugins/read-files": {
49
- "import": "./dist/utils/bundle/plugins/read-files/index.js",
50
- "types": "./dist/utils/bundle/plugins/read-files/index.d.ts",
51
- "default": "./dist/utils/bundle/plugins/read-files/index.js"
52
52
  }
53
53
  },
54
54
  "files": [
@@ -73,8 +73,8 @@
73
73
  "just-diff": "^6.0.2",
74
74
  "tinybench": "^2.8.0",
75
75
  "vite": "5.4.19",
76
- "@scalar/build-tooling": "0.2.2",
77
76
  "@scalar/types": "0.2.2",
77
+ "@scalar/build-tooling": "0.2.2",
78
78
  "@scalar/openapi-types": "0.3.2"
79
79
  },
80
80
  "scripts": {
@@ -84,7 +84,6 @@
84
84
  "lint:fix": "eslint . --fix",
85
85
  "test": "NODE_OPTIONS=--max_old_space_size=8192 vitest",
86
86
  "test:prepare": "vite-node scripts/load-files.ts",
87
- "test:unit": "vitest",
88
87
  "types:build": "scalar-types-build",
89
88
  "types:check": "scalar-types-check"
90
89
  }
@@ -1,4 +0,0 @@
1
- export { bundle } from './bundle.js';
2
- export { fetchUrls } from './plugins/fetch-urls/index.js';
3
- export { readFiles } from './plugins/read-files/index.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/bundle/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA"}
@@ -1,9 +0,0 @@
1
- import { bundle } from "./bundle.js";
2
- import { fetchUrls } from "./plugins/fetch-urls/index.js";
3
- import { readFiles } from "./plugins/read-files/index.js";
4
- export {
5
- bundle,
6
- fetchUrls,
7
- readFiles
8
- };
9
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/utils/bundle/index.ts"],
4
- "sourcesContent": ["// biome-ignore lint/performance/noBarrelFile: This is the interface we expose for the bundler\nexport { bundle } from './bundle'\nexport { fetchUrls } from './plugins/fetch-urls'\nexport { readFiles } from './plugins/read-files'\n"],
5
- "mappings": "AACA,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;",
6
- "names": []
7
- }