-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parser): rewriting the library in typescript (#932)
## 🐳 Context Now that our fork of [@apidevtools/swagger-parser](https://npm.im/@apidevtools/swagger-parser) has fully deviated and was moved here from [our other repository](https://github.com/readmeio/openapi-parser) I have built off of JonLuca's[^1] starting work over in APIDevTools/swagger-parser#253 and rewritten the library in TS. This is all going to be the basis for a slew of forthcoming changes in order to support error levels. Because this is a full rewrite, and a lot of things have changed, this will incur a major version bump. ## 🧰 Changes * [x] Rewrote our OpenAPI parser in TS. * [x] Added in dual support for CJS and ESM. * [x] Resolved a number of test quirks and invalid false positive assertions. [^1]: Because I adapted heavily from his draft PR of this rewrite over in the swagger-parser repository I've credited him as a co-author of this work. --------- Co-authored-by: JonLuca De Caro <[email protected]> Co-authored-by: Kanad Gupta <[email protected]>
- Loading branch information
1 parent
f24ed0f
commit dec0e4b
Showing
82 changed files
with
3,083 additions
and
3,184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"extends": ["@readme/eslint-config", "@readme/eslint-config/typescript", "@readme/eslint-config/esm"], | ||
"root": true | ||
"root": true, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
packages/parser/test/specs/large-file-memory-leak/cloudflare-stringified.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": "explicit" | ||
}, | ||
"editor.formatOnSave": true | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,10 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"@readme/eslint-config", | ||
"@readme/eslint-config/typescript", | ||
], | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"rules": { | ||
"camelcase": ["error", { "allow": ["OpenAPIV3_1"] }], | ||
"lines-between-class-members": "off", | ||
"no-continue": "off", | ||
"no-plusplus": "off", | ||
"no-restricted-syntax": "off", | ||
"no-underscore-dangle": "off", | ||
"no-use-before-define": "off", | ||
"prefer-rest-params": "off", | ||
"prefer-spread": "off" | ||
"prefer-spread": "off", | ||
}, | ||
"overrides": [ | ||
{ | ||
// The typings in this file are pretty bad right now, when we have native types we can | ||
// remove this. | ||
"files": ["lib/index.d.ts"], | ||
"rules": { | ||
"@typescript-eslint/consistent-indexed-object-style": "off", | ||
"@typescript-eslint/consistent-type-imports": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/sort-type-constituents": "off", | ||
"eslint-comments/no-unused-disable": "off", | ||
"lines-between-class-members": "off", | ||
"max-classes-per-file": "off", | ||
"quotes": "off", | ||
"typescript-sort-keys/interface": "off" | ||
} | ||
}, | ||
{ | ||
// These can all get removed when the library is moved over to native TS. | ||
"files": ["*.js"], | ||
"rules": { | ||
"@typescript-eslint/no-this-alias": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
"eslint-comments/no-unused-disable": "off", | ||
"func-names": "off" | ||
} | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.