Skip to content

Commit

Permalink
Add .md files to prettier tasks (#486)
Browse files Browse the repository at this point in the history
* lint: markdown using prettier

* fix: npm scripts
  • Loading branch information
maddhruv committed Nov 13, 2020
1 parent 4da42eb commit 57da996
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 25 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
@@ -1 +1,2 @@
dist
dist
__fixtures__
23 changes: 12 additions & 11 deletions docs/automating-changesets.md
Expand Up @@ -5,7 +5,7 @@ While changesets is designed to work with a fully manual process, it also provid
1. How do I want to ensure pull requests have changesets?
2. How do I run the version and publish commands?

Here we have a quick-start recommended workflow, with more
Here we have a quick-start recommended workflow, with more

## Recommended Automation Flow

Expand All @@ -26,29 +26,30 @@ In this approach, a pull request may be merged if no changeset is present, and a

In some cases, you may want to make CI fail if not changeset is present, to ensure no PR can be merged without a changeset. To do this:

In your CI process add a step that runs:
In your CI process add a step that runs:

```bash
changeset status --sinceMaster
```

This will exit with the exit code 1 if there have been no new changesets since master.

In some cases, you may *want* to merge a change without doing any releases (such as when you only change tests or build tools). In this case, you can run `changeset --empty`. This will add a special changeset that does not release anything.
In some cases, you may _want_ to merge a change without doing any releases (such as when you only change tests or build tools). In this case, you can run `changeset --empty`. This will add a special changeset that does not release anything.

## How do I run the version and publish commands?

We have a [github action](https://github.com/changesets/action) that

* creates a `version` PR, then keeps it up to date, recreating it when merged. This PR always has an up-to-date run of `changeset version`
* Optionally allows you to do releases when changes are merged to master.
- creates a `version` PR, then keeps it up to date, recreating it when merged. This PR always has an up-to-date run of `changeset version`
- Optionally allows you to do releases when changes are merged to master.

If you don't want to use this action, the manual workflow we recommend for running the `version` and `publish` commands is:

* A release coordinator (RC) calls to stop any merging to master
* The RC pull down `master`, runs `changeset version`, then make a new PR with the versioning changes
* The versioning changes are merged back into master
* The RC pulls `master` again and runs `changeset publish`
* The RC runs `git push --follow-tags` to push the release tags back
* The RC unblocks merging to master
- A release coordinator (RC) calls to stop any merging to master
- The RC pull down `master`, runs `changeset version`, then make a new PR with the versioning changes
- The versioning changes are merged back into master
- The RC pulls `master` again and runs `changeset publish`
- The RC runs `git push --follow-tags` to push the release tags back
- The RC unblocks merging to master

This is a lot of steps, and is quite finnicky (we have to pull from master twice). Feel free to finesse it to your own circumstances.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -10,9 +10,9 @@
"postinstall": "preconstruct dev && manypkg check",
"lint": "yarn lint:eslint && yarn lint:prettier",
"lint:eslint": "yarn eslint . --ext .ts,.tsx,.js",
"lint:prettier": "prettier --list-different \"**/*.{js,ts,tsx}\"",
"lint:prettier": "prettier --list-different \"**/*.{js,ts,tsx,md}\"",
"types:check": "tsc",
"prettier": "prettier --write \"**/*.{js,ts,tsx}\"",
"prettier": "prettier --write \"**/*.{js,ts,tsx,md}\"",
"changeset": "packages/cli/bin.js",
"check-all": "yarn test && yarn lint && yarn types:check",
"release": "yarn build && changeset publish"
Expand Down
1 change: 0 additions & 1 deletion packages/config/README.md
Expand Up @@ -4,7 +4,6 @@
[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/@changesets/config)


```tsx
import { parse, read, ValidationError } from "@changesets/config";

Expand Down
1 change: 0 additions & 1 deletion packages/get-github-info/README.md
Expand Up @@ -2,7 +2,6 @@

[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/@changesets/get-github-info)


> Get the GitHub username and PR number from a commit. Intended for use with changesets.
## Getting Started
Expand Down
1 change: 0 additions & 1 deletion packages/get-release-plan/README.md
Expand Up @@ -2,7 +2,6 @@

[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/@changesets/get-release-plan)


A function that reads information about the current repository

```js
Expand Down
1 change: 0 additions & 1 deletion packages/get-version-range-type/README.md
Expand Up @@ -2,7 +2,6 @@

[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/@changesets/get-version-range-type)


Simple function that takes in a string which is a version range (ie `^1.0.0`, `~3.5.1`, `2.0.0`)
and returns the range definition.

Expand Down
1 change: 0 additions & 1 deletion packages/git/README.md
Expand Up @@ -2,7 +2,6 @@

[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/@changesets/git)


A collection of helper functions used internally in changesets to
make git operations easier.

Expand Down
2 changes: 1 addition & 1 deletion packages/logger/README.md
Expand Up @@ -14,7 +14,7 @@ error('message part 1', 'message part 2');
**error**: Use `error` to print error messages upon which users which immediately action to complete the task.
**info**: Use `info` to print informational messages to user.
**info**: Use `info` to print informational messages to user.
**log**: Use `log` to print messages don't fall in anyother specific category. For example, message to show title of the step being performed by the changesets tool.

Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/README.md
Expand Up @@ -2,7 +2,7 @@

[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/@changesets/test-utils)

> Utilities for testing @changesets/* packages
> Utilities for testing @changesets/\* packages
### Utilities

Expand Down
8 changes: 4 additions & 4 deletions packages/write/README.md
Expand Up @@ -6,10 +6,10 @@ Writes a changeset to a file.
import write from "@changesets/write";

const changeset = {
"summary": "A description of a minor change",
"releases": [
{ "name": "@changesets/something", "type": "minor" },
{ "name": "@changesets/something-else", "type": "patch" }
summary: "A description of a minor change",
releases: [
{ name: "@changesets/something", type: "minor" },
{ name: "@changesets/something-else", type: "patch" }
]
};

Expand Down

0 comments on commit 57da996

Please sign in to comment.