DerekStride / tree-sitter-sql

SQL grammar for tree-sitter
http://derek.stride.host/tree-sitter-sql/
MIT License
147 stars 47 forks source link

publish @derekstride/tree-sitter-sql npm package #223

Closed DerekStride closed 9 months ago

DerekStride commented 10 months ago

fixes #195

This sets up a workflow to publish to npm when PRs are merged into main.

I have a few open questions that anyone who has experience publishing to npm can help with:

  1. Will we need to continually bump the version number in order to publish?
  2. Should we instead use git tags to publish dedicated versions instead on every change?

cc// @rien

dmfay commented 10 months ago
  1. Will we need to continually bump the version number in order to publish?

yes, you can't republish the same version number

  1. Should we instead use git tags to publish dedicated versions instead on every change?

I think this is a good idea! Especially because we don't have a way to control semver (there are things like conventional commit with npm plugins but they do require some discipline to use)

DerekStride commented 9 months ago

I've updated the PR to publish to npm on publish instead of during push to main. This will mean we need to publish an new release on Github before it get's pushed to NPM.

@dmfay @matthias-Q I'm all for adopting conventional commits & semantic versioning and starting to track breaking changes to the schema if both of you are on board as well. We can unofficially start now but should start ourselves & asking other contributors to follow the guidelines after this PR lands and we publish our first release.

I've also added a CONTRIBUTING.md file & included a section on commit messages to encourage the use of conventional commits as suggested. The file also explains how to run tests, run the github pages server, and prepare a release. I'd appreciate feedback & suggestions on the document as I want it to reflect a consensus on our thoughts for the project.

DerekStride commented 9 months ago

Any final comment or should I ship 🚢 this PR and publish our first release! 🎉

matthias-Q commented 9 months ago

I say go for it. (Tip: I have set up a pre-commit hook in my machine to check for conventional commits)

DerekStride commented 9 months ago

Published 🎉 https://www.npmjs.com/package/@derekstride/tree-sitter-sql