Skip to content

Commit

Permalink
publishing-libraries docs: Changesets configuration [#9324] (#9325)
Browse files Browse the repository at this point in the history
### Description

- Fixes #9324 
    
The minimum changed need to make the recommended publishing script work
is to set Changesets' `commit` option[^1] to true.


- Also adds a note about how to publish public packages. Changesets'
default configuration is for private packages.

### Testing Instructions

1. Follow https://turbo.build/repo/docs/guides/publishing-libraries.
2. Confirm that the `publish-packages` script does not work to publish
packages.
3. Make this PR's changes.
4. Confirm that the script now works.

[^1]:
https://github.com/changesets/changesets/blob/7323704dff6e76f488370db384579b86c95c866f/docs/config-file-options.md?plain=1#L19

---------

Co-authored-by: Anthony Shew <[email protected]>
  • Loading branch information
olets and anthonyshew authored Nov 15, 2024
1 parent ab1596c commit a84fb1c
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/repo-docs/guides/publishing-libraries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,17 @@ changeset publish

Linking your publishing flow into Turborepo can make organizing your deploy a lot simpler and faster.

Our recommendation is to add a `publish-packages` script into your root `package.json`:
Our recommendation is to configure Changesets to automatically commit `changeset version`'s changes

```json title="./changeset/config.json"
{
// …
"commit": true,
// …
}
```

and add a `publish-packages` script into your root `package.json`:

```json title="./package.json"
{
Expand All @@ -168,6 +178,16 @@ Our recommendation is to add a `publish-packages` script into your root `package
}
```

If your packages are public, set Changeset's `access` to `public`:

```json title="./changeset/config.json"
{
// …
"access": "public",
// …
}
```

<Callout>
We recommend `publish-packages` so that it doesn't conflict with npm's
built-in `publish` script.
Expand Down

0 comments on commit a84fb1c

Please sign in to comment.