From a84fb1c7eefde34bef383a2cf13acda4997919c8 Mon Sep 17 00:00:00 2001 From: Henry Bley-Vroman Date: Thu, 14 Nov 2024 16:54:20 -1000 Subject: [PATCH] publishing-libraries docs: Changesets configuration [#9324] (#9325) ### 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 --- .../repo-docs/guides/publishing-libraries.mdx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/repo-docs/guides/publishing-libraries.mdx b/docs/repo-docs/guides/publishing-libraries.mdx index 7e4f631dad0e0..518c013795ec1 100644 --- a/docs/repo-docs/guides/publishing-libraries.mdx +++ b/docs/repo-docs/guides/publishing-libraries.mdx @@ -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" { @@ -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", + // … +} +``` + We recommend `publish-packages` so that it doesn't conflict with npm's built-in `publish` script.