Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Major Refactor] Native typescript support, circular references fix, vitest #29

Merged
merged 7 commits into from
Aug 2, 2022

Conversation

jonluca
Copy link
Member

@jonluca jonluca commented Aug 1, 2022

This diff:

  • Rewrites the core logic in typescript
  • Creates separate CJS and ESM exports
  • Brings in the cloudflare/json-schema-tools because that library seems to have become abandonware, and has some small bugs in it that haven't been fixed
  • Changes the JSON dereferencer to use the more actively maintained json-schema-ref-parser
  • Adds a new option to prevent cyclic referenes
  • Changes the tests to use vitest
  • Adds a new test for circular references

Fixes

…ixed circular references, added tests, changed test suite to vitest
package.json Outdated
Comment on lines 2 to 3
"name": "browser-json-schema-to-openapi-schema",
"version": "0.1.4",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this back so autorelease will work.

Suggested change
"name": "browser-json-schema-to-openapi-schema",
"version": "0.1.4",
"name": "@openapi-contrib/json-schema-to-openapi-schema",
"version": "0.0.0-development",

@philsturgeon
Copy link
Member

philsturgeon commented Aug 2, 2022

Hey @jonluca, thank you so much for this, it's looking great.

When you say "Brings in the cloudflare/json-schema-tools because that library seems to have become abandonware" what do you mean?

I see "@cloudflare/json-schema-walker": "^0.1.1", is removed from package.json, but "json-schema-walker": "^0.0.4", is added and I cannot find that on npmjs.org.

@philsturgeon
Copy link
Member

I see https://github.com/jonluca/json-schema-walker/ over here but how is that ending up in NPM.

@jonluca
Copy link
Member Author

jonluca commented Aug 2, 2022

Thanks!

Yeah let me change the name and version.

and I cannot find that on npmjs.org.

Is https://www.npmjs.com/package/json-schema-walker not visible? I didn't think it was private - I'm using it in this package and it seems to be working

how is that ending up in NPM.

I manually published it

@philsturgeon philsturgeon merged commit 18393ac into openapi-contrib:main Aug 2, 2022
@philsturgeon
Copy link
Member

Amazing, thank you. If you ever have a bit of time in your hands, the sister package could do with Similar love as the testing and JavaScript is all super old school.

https://github.com/openapi-contrib/openapi-schema-to-json-schema

Understandable if not, I’ll have a go sometime but I’m spending the next few weeks watering saplings so our freshly planted woodlands don’t die and that means less time for code.

@jonluca
Copy link
Member Author

jonluca commented Aug 2, 2022

@github-actions
Copy link

github-actions bot commented Aug 3, 2022

🎉 This PR is included in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants