Skip to content

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

Merged
Noviny merged 7 commits intomasterfrom
feat/export-write-changesets
Mar 11, 2020
Merged

feat: add new @changesets/write package to separate writing changesets#292
Noviny merged 7 commits intomasterfrom
feat/export-write-changesets

Conversation

@acheronfail
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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
@acheronfail acheronfail force-pushed the feat/export-write-changesets branch from 25c4399 to 6bae2b2 Compare March 11, 2020 01:03
@acheronfail acheronfail force-pushed the feat/export-write-changesets branch from 6bae2b2 to c752bb2 Compare March 11, 2020 01:05
@acheronfail acheronfail requested a review from ramesius March 11, 2020 01:07
@Noviny
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

Noviny commented Mar 11, 2020

PR otherwise looks fine, so happy to merge + release

@acheronfail
Copy link
Copy Markdown
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.

4 participants