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

feat: add new @changesets/write package to separate writing changesets #292

Merged
merged 7 commits into from
Mar 11, 2020

Conversation

acheronfail
Copy link
Contributor

This PR adds a new package @changesets/write which does the inverse of @changesets/parse.

It basically just extracts the writeChangesets function used in @changesets/cli so it can be re-used.

@changeset-bot
Copy link

changeset-bot bot commented Mar 11, 2020

🦋 Changeset is good to go

Latest commit: dcb09e6

We got this.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Mar 11, 2020

Codecov Report

Merging #292 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #292   +/-   ##
=====================================
  Coverage      80%    80%           
=====================================
  Files          45     45           
  Lines        1220   1220           
  Branches      280    284    +4     
=====================================
  Hits          976    976           
  Misses        233    233           
  Partials       11     11
Impacted Files Coverage Δ
packages/cli/src/commands/add/index.ts 79.31% <ø> (ø) ⬆️
packages/write/src/index.ts 100% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2363366...dcb09e6. Read the comment docs.

@acheronfail acheronfail requested a review from Noviny March 11, 2020 00:59
@Noviny
Copy link
Collaborator

Noviny commented Mar 11, 2020

Hey! Thanks for this.

We initially didn't do this because writing a changeset is simple enough that reimplementing it isn't really a cost, and having it as a library implies it's doing something fancier than it is.

What's the reason for wanting this as a package as opposed to just using the code yourself?

@Noviny
Copy link
Collaborator

Noviny commented Mar 11, 2020

PR otherwise looks fine, so happy to merge + release

@acheronfail
Copy link
Contributor Author

We initially didn't do this because writing a changeset is simple enough that reimplementing it isn't really a cost, and having it as a library implies it's doing something fancier than it is.

Makes sense. I guess since we already have the @changesets/parse we've abstracted reading the changesets, why not abstract writing them too?

What's the reason for wanting this as a package as opposed to just using the code yourself?

We need a way to programmatically create a changeset (our use case is to integrate the renovate bot into our monorepo, and there needs to be a way to generate a changeset for the diff that the renovate bot creates).

It seemed odd that we had to duplicate the same logic that @changesets/cli itself was doing. Plus we wanted to have the nice things that it already does automatically, like human-id, integration with prettier, etc.

@Noviny Noviny merged commit 41e2e3d into master Mar 11, 2020
@Noviny Noviny deleted the feat/export-write-changesets branch March 11, 2020 09:38
@github-actions github-actions bot mentioned this pull request Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants