Full Code of changesets/changesets for AI

main 3ab4d8928ce3 cached
214 files
1.1 MB
309.6k tokens
239 symbols
1 requests
Download .txt
Showing preview only (1,144K chars total). Download the full file or copy to clipboard to get everything.
Repository: changesets/changesets
Branch: main
Commit: 3ab4d8928ce3
Files: 214
Total size: 1.1 MB

Directory structure:
gitextract_zdwe5kv4/

├── .changeset/
│   ├── README.md
│   └── config.json
├── .eslintignore
├── .eslintrc
├── .github/
│   ├── ISSUE_TEMPLATE.md
│   ├── actions/
│   │   └── ci-setup/
│   │       └── action.yml
│   ├── dependabot.yml
│   └── workflows/
│       ├── ci.yml
│       └── publish.yml
├── .gitignore
├── .prettierignore
├── .vscode/
│   ├── launch.json
│   └── settings.json
├── FUNDING.json
├── LICENSE
├── README.md
├── SECURITY.md
├── assets/
│   ├── README.md
│   └── images/
│       └── README.md
├── babel.config.js
├── docs/
│   ├── adding-a-changeset.md
│   ├── automating-changesets.md
│   ├── checking-for-changesets.md
│   ├── command-line-options.md
│   ├── common-questions.md
│   ├── config-file-options.md
│   ├── decisions.md
│   ├── detailed-explanation.md
│   ├── dictionary.md
│   ├── experimental-options.md
│   ├── fixed-packages.md
│   ├── intro-to-using-changesets.md
│   ├── linked-packages.md
│   ├── modifying-changelog-format.md
│   ├── prereleases.md
│   ├── problems-publishing-in-monorepos.md
│   ├── snapshot-releases.md
│   └── versioning-apps.md
├── jest.config.js
├── package.json
├── packages/
│   ├── apply-release-plan/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── get-changelog-entry.ts
│   │       ├── index.test.ts
│   │       ├── index.ts
│   │       ├── test-utils/
│   │       │   ├── failing-functions.ts
│   │       │   ├── get-changelog-dep-updated.ts
│   │       │   ├── get-changelog-entry-with-git-hash.ts
│   │       │   ├── simple-get-changelog-entry.ts
│   │       │   └── simple-get-commit-entry.ts
│   │       ├── types.ts
│   │       ├── utils.ts
│   │       └── version-package.ts
│   ├── assemble-release-plan/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── README.md
│   │       ├── apply-links.ts
│   │       ├── determine-dependents.ts
│   │       ├── flatten-releases.ts
│   │       ├── increment.test.ts
│   │       ├── increment.ts
│   │       ├── index.test.ts
│   │       ├── index.ts
│   │       ├── match-fixed-constraint.ts
│   │       ├── test-utils.ts
│   │       ├── types.ts
│   │       └── utils.ts
│   ├── changelog-git/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   └── src/
│   │       └── index.ts
│   ├── changelog-github/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── cli/
│   │   ├── CHANGELOG.md
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── bin.js
│   │   ├── changelog/
│   │   │   └── package.json
│   │   ├── commit/
│   │   │   └── package.json
│   │   ├── default-files/
│   │   │   └── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── changelog.ts
│   │       ├── commands/
│   │       │   ├── add/
│   │       │   │   ├── __tests__/
│   │       │   │   │   └── add.ts
│   │       │   │   ├── createChangeset.ts
│   │       │   │   ├── index.ts
│   │       │   │   └── messages.ts
│   │       │   ├── init/
│   │       │   │   ├── __tests__/
│   │       │   │   │   └── command.ts
│   │       │   │   └── index.ts
│   │       │   ├── pre/
│   │       │   │   ├── index.test.ts
│   │       │   │   └── index.ts
│   │       │   ├── publish/
│   │       │   │   ├── __tests__/
│   │       │   │   │   ├── index.test.ts
│   │       │   │   │   ├── publishPackages.test.ts
│   │       │   │   │   └── releaseCommand.test.ts
│   │       │   │   ├── index.ts
│   │       │   │   ├── npm-utils.ts
│   │       │   │   └── publishPackages.ts
│   │       │   ├── status/
│   │       │   │   ├── __tests__/
│   │       │   │   │   └── status.ts
│   │       │   │   └── index.ts
│   │       │   ├── tag/
│   │       │   │   ├── __tests__/
│   │       │   │   │   └── index.test.ts
│   │       │   │   └── index.ts
│   │       │   └── version/
│   │       │       ├── index.ts
│   │       │       └── version.test.ts
│   │       ├── commit/
│   │       │   ├── commit.test.ts
│   │       │   ├── getCommitFunctions.ts
│   │       │   └── index.ts
│   │       ├── index.ts
│   │       ├── run.test.ts
│   │       ├── run.ts
│   │       ├── types.ts
│   │       └── utils/
│   │           ├── cli-utilities.ts
│   │           ├── createPromiseQueue.test.ts
│   │           ├── createPromiseQueue.ts
│   │           ├── getLastJsonObjectFromString.test.ts
│   │           ├── getLastJsonObjectFromString.ts
│   │           ├── getUntaggedPackages.ts
│   │           ├── types.ts
│   │           ├── v1-legacy/
│   │           │   ├── README.md
│   │           │   └── removeFolders.ts
│   │           └── versionablePackages.ts
│   ├── config/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   ├── schema.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── errors/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── get-dependents-graph/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── get-dependency-graph.test.ts
│   │       ├── get-dependency-graph.ts
│   │       └── index.ts
│   ├── get-github-info/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── get-release-plan/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       └── index.ts
│   ├── get-version-range-type/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── git/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── logger/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── parse/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── pre/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── read/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       ├── index.ts
│   │       └── legacy.ts
│   ├── release-utils/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── __snapshots__/
│   │       │   └── utils.test.ts.snap
│   │       ├── fake-publish-script-multi-package.js
│   │       ├── fake-publish-script-single-package.js
│   │       ├── gitUtils.ts
│   │       ├── index.ts
│   │       ├── readChangesetState.ts
│   │       ├── run.test.ts
│   │       ├── run.ts
│   │       ├── utils.test.ts
│   │       └── utils.ts
│   ├── should-skip-package/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   └── src/
│   │       └── index.ts
│   ├── types/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       └── index.ts
│   └── write/
│       ├── CHANGELOG.md
│       ├── README.md
│       ├── package.json
│       └── src/
│           ├── index.test.ts
│           └── index.ts
├── scripts/
│   └── test-utils/
│       ├── CHANGELOG.md
│       ├── README.md
│       ├── package.json
│       └── src/
│           ├── index.test.ts
│           └── index.ts
├── tsconfig.json
└── types/
    ├── boxen.d.ts
    ├── fixturez.d.ts
    ├── human-id.d.ts
    ├── lodash.d.ts
    └── spawndamnit.d.ts

================================================
FILE CONTENTS
================================================

================================================
FILE: .changeset/README.md
================================================
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with mono-repos or single package repos to help you version and release your code. You can find the full documentation for it [in our repository](https://github.com/changesets/changesets).

We have a quick list of common questions to get you started engaging with this project in [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).


================================================
FILE: .changeset/config.json
================================================
{
  "changelog": [
    "@changesets/changelog-github",
    { "repo": "changesets/changesets" }
  ],
  "baseBranch": "main",
  "commit": false,
  "access": "public",
  "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
    "updateInternalDependents": "always"
  }
}


================================================
FILE: .eslintignore
================================================
dist
__fixtures__
node_modules
scratchings.js

================================================
FILE: .eslintrc
================================================
{
  "extends": [
    "plugin:@typescript-eslint/eslint-recommended",
    "standard",
    "prettier"
  ],
  "plugins": ["@typescript-eslint"],
  "parser": "@typescript-eslint/parser",
  "rules": {
    "standard/computed-property-even-spacing": "off",
    "lines-between-class-members": "off",
    "no-template-curly-in-string": "off",
    "camelcase": "off",
    "import/no-duplicates": "off",
    "no-unusued-vars": "off",
    "no-use-before-define": "off",
    "no-useless-constructor": "off",
    "@typescript-eslint/no-unused-vars": [
      "error",
      { "argsIgnorePattern": "^_", "ignoreRestSiblings": true }
    ],
    "import/no-extraneous-dependencies": [
      "error",
      {
        "devDependencies": [
          "**/__tests__/**/*.{ts,js}",
          "**/*.test.{ts,js}",
          "**/test.{ts,js}"
        ]
      }
    ]
  },
  "overrides": [
    {
      "files": [
        "*.test.js",
        "**/__tests__/**",
        "*.test.ts",
        "**/test.ts",
        "**/test-utils/**/*"
      ],
      "env": {
        "jest": true
      }
    },
    {
      "files": ["**/packages/*/src/*", "**/packages/*/src/**/*"],
      "rules": {
        "import/no-commonjs": "error"
      }
    },
    {
      "files": ["**/__fixtures__/*"],
      "rules": {
        "no-unused-vars": "off"
      },
      "env": {
        "jest": false
      }
    },
    {
      "files": ["*.ts"],
      "rules": {
        "prefer-const": "off"
      }
    }
  ]
}


================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
## Affected Packages

<!-- Because monorepos, it's super helpful if you tell us which packages are affected, so it's easy to find the change points. Adding a tag pf `pkg:package-name` would be the best 🙏 -->

## Problem

<!-- Write the problem you are encountering here. If it is a bug, or process problem, please provide reproduction steps. If you have a repository we can look at that would be great. 😁 -->

## Proposed solution

<!-- If you have an idea of how to solve it, otherwise that's fine as well. We may edit this description to add details later -->


================================================
FILE: .github/actions/ci-setup/action.yml
================================================
name: Setup CI

inputs:
  node-version:
    description: "Node.js version"
    required: false
    default: 20

runs:
  using: composite
  steps:
    - name: Setup Node.js ${{ inputs.node-version }}
      uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
      with:
        node-version: ${{ inputs.node-version }}
        cache: yarn

    - name: Install dependencies
      shell: bash
      run: yarn install --frozen-lockfile


================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
  - package-ecosystem: "npm" # See documentation for possible values
    directory: "/" # Location of package manifests
    schedule:
      interval: "weekly"


================================================
FILE: .github/workflows/ci.yml
================================================
name: CI

on:
  pull_request:
  push:
    branches: [main]
  merge_group:
    branches: [main]

permissions:
  contents: read

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/ci-setup

      - name: Check Git version
        run: git --version

      - name: Setup mock Git user
        run: git config --global user.email "you@example.com" && git config --global user.name "Your Name"

      - name: Jest tests
        run: yarn jest --ci --color --runInBand --coverage --reporters=default --reporters=jest-junit

      - name: Upload coverage
        uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}

  typecheck:
    name: Typecheck
    runs-on: ubuntu-latest
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/ci-setup

      - name: Typecheck
        run: yarn types:check

  lint:
    name: Lint
    runs-on: ubuntu-latest
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/ci-setup

      - name: Lint
        run: yarn lint

      - name: Format
        run: yarn format

  ci-ok:
    name: CI OK
    runs-on: ubuntu-latest
    if: always()
    needs: [test, typecheck, lint]
    steps:
      - name: Exit with error if some jobs are not successful
        run: exit 1
        if: ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')) }}


================================================
FILE: .github/workflows/publish.yml
================================================
name: Publish

on:
  push:
    branches:
      - main
      - next
  issue_comment:
    types: [created]

concurrency: ${{ github.workflow }}-${{ github.event_name == 'issue_comment' && github.event.issue.number || github.ref }}

permissions: {} # each job should define its own permission explicitly

jobs:
  publish:
    name: Publish
    if: github.repository == 'changesets/changesets' && github.event_name == 'push'
    runs-on: ubuntu-latest
    timeout-minutes: 20
    permissions:
      contents: write # to create release (changesets/action)
      issues: write # to post issue comments (changesets/action)
      pull-requests: write # to create pull request (changesets/action)
      id-token: write # to use OpenID Connect token for trusted publishing (changesets/action)
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/ci-setup
        with:
          node-version: 24

      - name: Create Release Pull Request or Publish to npm
        # https://github.com/changesets/action
        uses: changesets/action@v1
        with:
          # this expects you to have a script called release which does a build for your packages and calls changeset publish
          publish: yarn release
          version: yarn version-packages

  publish_pr:
    if: github.repository == 'changesets/changesets' && github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/publish-pr')
    timeout-minutes: 20
    runs-on: ubuntu-latest
    permissions:
      contents: read # to checkout the pull request
      id-token: write # to use OpenID Connect token for trusted publishing
      issues: write # to post comments and reactions
      pull-requests: write # to post reactions on PR comments
    steps:
      - name: Report in-progress reaction
        id: report_in_progress
        run: |
          REACTION_ID=$(gh api /repos/${{github.repository}}/issues/comments/${{github.event.comment.id}}/reactions -f content='eyes' --jq '.id')
          echo "in_progress_reaction_id=$REACTION_ID" >> "$GITHUB_OUTPUT"
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Check if user is authorized to publish
        id: check_authorization
        run: |
          if [[ $AUTHOR_ASSOCIATION == 'MEMBER' || $AUTHOR_ASSOCIATION == 'OWNER' || $AUTHOR_ASSOCIATION == 'COLLABORATOR' ]]
          then
            echo "User is authorized to publish"
          else
            echo "User is not authorized to publish"
            exit 1
          fi
        env:
          AUTHOR_ASSOCIATION: ${{ github.event.comment.author_association }}

      - uses: actions/checkout@v4

      - name: Checkout pull request
        run: gh pr checkout ${{ github.event.issue.number }}
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Check if Version Packages PR
        id: check_version_packages
        run: |
          IS_VERSION_PACKAGES_PR=$(gh pr view ${{ github.event.issue.number }} --json headRefName --jq '.headRefName|startswith("changeset-release/")')
          echo "is_version_packages_pr=$IS_VERSION_PACKAGES_PR" >> "$GITHUB_OUTPUT"
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      # for Version Packages PR we want to publish the state from before the Version Packages commit
      - name: Reset Version Packages PR
        if: steps.check_version_packages.outputs.is_version_packages_pr == 'true'
        run: git reset --hard HEAD~1

      - uses: ./.github/actions/ci-setup
        with:
          node-version: 24

      - name: Compute snapshot version
        id: snapshot_version
        run: |
          PUBLISH_TAG="pr${{ github.event.issue.number }}"
          SNAPSHOT_TAG="${PUBLISH_TAG}.$(git rev-parse --short HEAD)"

          echo "publish_tag=$PUBLISH_TAG" >> "$GITHUB_OUTPUT"
          echo "snapshot_tag=$SNAPSHOT_TAG" >> "$GITHUB_OUTPUT"
          echo "version=0.0.0-$SNAPSHOT_TAG" >> "$GITHUB_OUTPUT"

      - run: yarn changeset version --snapshot "${{ steps.snapshot_version.outputs.snapshot_tag }}" --snapshot-prerelease-template "{tag}"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - run: yarn build

      - name: Publish snapshot versions
        run: yarn changeset publish --tag "${{ steps.snapshot_version.outputs.publish_tag }}"

      - name: Post comment with published version
        run: |
          cat <<'BODY' > /tmp/comment-body.md
          Published snapshot version `${{ steps.snapshot_version.outputs.version }}` in response to [this comment](${{ github.event.comment.html_url }}).
          BODY
          gh issue comment "${{ github.event.issue.number }}" --body-file /tmp/comment-body.md
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Post failure comment
        if: failure()
        run: |
          FAILED_JOB_ID=$(gh api "/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" --jq ".jobs[] | select(.name == \"$GITHUB_JOB\") | .id")
          LINK="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${FAILED_JOB_ID}"

          cat <<BODY > /tmp/comment-body.md
          Snapshot publish triggered by [this comment](${{ github.event.comment.html_url }}) failed. [See the failed job](${LINK}).
          BODY
          gh issue comment "${{ github.event.issue.number }}" --body-file /tmp/comment-body.md
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Add result reaction
        if: always() && steps.report_in_progress.outcome == 'success'
        run: |
          gh api /repos/${{github.repository}}/issues/comments/${{github.event.comment.id}}/reactions \
            -f content="${{ job.status == 'success' && 'rocket' || '-1' }}"
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Remove in-progress reaction
        if: always() && steps.report_in_progress.outcome == 'success'
        run: gh api -X DELETE /repos/${{github.repository}}/issues/comments/${{github.event.comment.id}}/reactions/${{steps.report_in_progress.outputs.in_progress_reaction_id}}
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


================================================
FILE: .gitignore
================================================
node_modules/
*error.log
scratchings.js
dist/
.env
coverage/


================================================
FILE: .prettierignore
================================================
dist
__fixtures__

================================================
FILE: .vscode/launch.json
================================================
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Jest Current File",
      "program": "${workspaceFolder}/node_modules/.bin/jest",
      "args": ["${relativeFile}", "--config", "jest.config.js", "--no-cache"],
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "disableOptimisticBPs": true,
      "windows": {
        "program": "${workspaceFolder}/node_modules/jest/bin/jest"
      },
      "smartStep": false
    }
  ]
}


================================================
FILE: .vscode/settings.json
================================================
{
  "typescript.tsdk": "node_modules/typescript/lib",
  "grammarly.selectors": [
    {
      "language": "markdown",
      "scheme": "file"
    }
  ]
}


================================================
FILE: FUNDING.json
================================================
{
  "drips": {
    "ethereum": {
      "ownedBy": "0x334C0464Ec1e9B32835B18465250c95aCa86FaF9"
    }
  }
}


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2019 Ben Conolly

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
<p align="center">
  <img src="./assets/images/changesets-banner-light.png" />
</p>

<p align="center">
  A tool to manage versioning and changelogs <br/>
  with a focus on multi-package repositories
</p>
<br/>

[![npm package](https://img.shields.io/npm/v/@changesets/cli?label=%40changesets%2Fcli)](https://npmjs.com/package/@changesets/cli)
[![View changelog](https://img.shields.io/badge/Explore%20Changelog-brightgreen)](./packages/cli/CHANGELOG.md)

The `changesets` workflow is designed to help when people are making changes, all the way through to publishing. It lets contributors declare how their changes should be released, then we automate updating package versions, and changelogs, and publishing new versions of packages based on the provided information.

Changesets has a focus on solving these problems for multi-package repositories, and keeps packages that rely on each other within the multi-package repository up-to-date, as well as making it easy to make changes to groups of packages.

## How do we do that?

A `changeset` is an intent to release a set of packages at particular [semver bump types](https://semver.org/) with a summary of the changes made.

The **@changesets/cli** package allows you to write `changeset` files as you make changes, then combine any number of changesets into a release, that flattens the bump-types into a single release per package, handles internal dependencies in a multi-package-repository, and updates changelogs, as well as release all updated packages from a mono-repository with one command.

## How do I get started?

If you just want to jump in to using changesets, the [Intro to using changesets](./docs/intro-to-using-changesets.md) and [@changesets/cli](./packages/cli/README.md) docs are where you should head.

If you want a detailed explanation of the concepts behind changesets, or to understand how you would build on top
of changesets, check out our [detailed-explanation](./docs/detailed-explanation.md).

We also have a [dictionary](./docs/dictionary.md).

## Integrating with CI

While changesets can be an entirely manual process, we recommend integrating it with how your CI works.

To check that PRs contain a changeset, we recommend using [the changeset bot](https://github.com/apps/changeset-bot), or if you want to fail builds on a changesets failure, run `yarn changeset status` in CI.

To make releasing easier, you can use [this changesets github action](https://github.com/changesets/action) to automate creating versioning pull requests, and optionally publishing packages.

## Documentation

- [Intro to using changesets](./docs/intro-to-using-changesets.md)
- [Detailed explanation](./docs/detailed-explanation.md)
- [Common questions](./docs/common-questions.md)
- [Adding a changeset](./docs/adding-a-changeset.md)
- [Automating changesets](./docs/automating-changesets.md)
- [Checking for changesets](./docs/checking-for-changesets.md)
- [Command line options](./docs/command-line-options.md)
- [Config file options](./docs/config-file-options.md)
- [Decisions](./docs/decisions.md)
- [Dictionary](./docs/dictionary.md)
- [Fixed packages](./docs/fixed-packages.md)
- [Linked packages](./docs/linked-packages.md)
- [Modifying changelog format](./docs/modifying-changelog-format.md)
- [Prereleases](./docs/prereleases.md)
- [Problems publishing in monorepos](./docs/problems-publishing-in-monorepos.md)
- [Snapshot releases](./docs/snapshot-releases.md)
- [Versioning applications and other non-npm packages](./docs/versioning-apps.md)
- [Experimental Options](./docs/experimental-options.md)

## Cool Projects already using Changesets for versioning and changelogs

- [atlaskit](https://atlaskit.atlassian.com)
- [emotion](https://emotion.sh/docs/introduction)
- [keystone](https://keystonejs.com)
- [react-select](https://react-select.com/home)
- [XState](https://xstate.js.org)
- [pnpm](https://pnpm.io)
- [tinyhttp](https://github.com/talentlessguy/tinyhttp)
- [Firebase Javascript SDK](https://github.com/firebase/firebase-js-sdk)
- [Formik](https://github.com/jaredpalmer/formik)
- [MobX](https://github.com/mobxjs/mobx)
- [Nhost](https://github.com/nhost/nhost)
- [verdaccio](https://verdaccio.org)
- [Chakra UI](https://chakra-ui.com)
- [Astro](https://astro.build)
- [Biome](https://biomejs.dev)
- [SvelteKit](https://kit.svelte.dev)
- [Hydrogen](https://hydrogen.shopify.dev)
- [react-pdf](https://github.com/diegomura/react-pdf)
- [GraphQL Code Generator](https://github.com/dotansimha/graphql-code-generator)
- [GraphQL Yoga](https://github.com/dotansimha/graphql-yoga)
- [GraphQL-Mesh](https://github.com/Urigo/graphql-mesh)
- [GraphiQL](https://github.com/graphql/graphiql)
- [wagmi](https://github.com/wagmi-dev/wagmi)
- [refine](https://github.com/pankod/refine)
- [Modern Web](https://modern-web.dev)
- [Atomizer](https://github.com/acss-io/atomizer)
- [Medusa](https://github.com/medusajs/medusa)
- [OpenZeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts)
- [Block Protocol](https://github.com/blockprotocol/blockprotocol)
- [Remix](https://remix.run/)
- [Clerk](https://github.com/clerk/javascript)
- [Hey API](https://github.com/hey-api/openapi-ts)
- [neverthrow](https://github.com/supermacro/neverthrow)
- [Apollo Client](https://github.com/apollographql/apollo-client)
- [Adobe Spectrum CSS](https://github.com/adobe/spectrum-css)
- [Adobe Spectrum Web Components](https://github.com/adobe/spectrum-web-components)
- [React Email](https://react.email)

<!-- NOTE: we currently only accept new entries with at least 1000 GitHub stars -->

# Thanks/Inspiration

- [bolt](https://github.com/boltpkg/bolt) - Brought us a strong concept of how packages in a mono-repo should be able to interconnect, and provided the initial infrastructure to get inter-package information.
- [Atlassian](https://www.atlassian.com/) - The original idea/sponsor of the changesets code, and where many of the ideas and processes were fermented. It was originally implemented by the team behind [atlaskit](https://atlaskit.atlassian.com).
- [lerna-semantic-release](https://github.com/atlassian/lerna-semantic-release) - put down many of the initial patterns around updating packages within a multi-package-repository, and started us thinking about how to manage dependent packages.
- [Thinkmill](https://www.thinkmill.com.au) - For sponsoring the focused open sourcing of this project, and the version two rearchitecture.


================================================
FILE: SECURITY.md
================================================
# Security policy

## Supported versions

The latest version of the project is currently supported with security updates.

## Reporting a vulnerability

You can report a vulnerability by contacting maintainers via email.


================================================
FILE: assets/README.md
================================================
<p align="center">
  <a href="https://github.com/changesets/changesets">
    <img
      alt="The Changesets logo concept, in light."
      src="./images/changesets-banner-light.png"
    />
  </a>
</p>
<p align="center">
  <a href="https://github.com/changesets/changesets">
    <img
      alt="The Changesets logo concept, in dark."
      src="./images/changesets-banner-dark.png"
    />
  </a>
</p>


================================================
FILE: assets/images/README.md
================================================
<p align="center">
  <img src="./key.png" />
</p>
<p align="center">
  <a href="https://www.figma.com/file/VaT6Eii1qcSI8MdNILDrwL/Changesets-Logo?node-id=6%3A16">View on Figma<a/>
</p>


================================================
FILE: babel.config.js
================================================
module.exports = {
  presets: [
    [
      "@babel/preset-env",
      {
        targets: { node: 8 },
      },
    ],
  ],
  overrides: [{ test: "**/*.ts", presets: ["@babel/preset-typescript"] }],
};


================================================
FILE: docs/adding-a-changeset.md
================================================
# Adding a changeset

Hi! You might be here because a person or a bot has asked you to 'add a changeset' to a project. Let's walk through adding a changeset. But first, what is a changeset?

## What is a changeset?

A changeset is a piece of information about changes made in a branch or commit. It holds three bits of information:

- What we need to release
- What version we are releasing packages at (using a [semver bump type](https://semver.org/))
- A changelog entry for the released packages

## I am in a multi-package repository (a mono-repo)

1. Run the command line script `yarn changeset` or `pnpm changeset` or `npx @changesets/cli`.
2. Select the packages you want to include in the changeset using <kbd>↑</kbd> and <kbd>↓</kbd> to navigate to packages, and <kbd>space</kbd> to select a package. Hit enter when all desired packages are selected.
3. You will be prompted to select a bump type for each selected package. Select an appropriate bump type for the changes made. See [here](https://semver.org/) for information on semver versioning
4. Your final prompt will be to provide a message to go alongside the changeset. This will be written into the changelog when the next release occurs.

After this, a new changeset will be added which is a markdown file with YAML front matter.

```
-| .changeset/
-|-| UNIQUE_ID.md
```

The message you typed can be found in the markdown file. If you want to expand on it, you can write as much markdown as you want, which will all be added to the changelog on publish. If you want to add more packages or change the bump types of any packages, that's also fine.

While not every changeset is going to need a huge amount of detail, a good idea of what should be in a changeset is:

- WHAT the change is
- WHY the change was made
- HOW a consumer should update their code

5. Once you are happy with the changeset, commit the file to your branch.

## I am in a single-package repository

1. Run the command line script `yarn changeset` or `pnpm changeset` or `npx @changesets/cli`.
2. Select an appropriate bump type for the changes made. See [here](https://semver.org/) for information on semver versioning.
3. Your final prompt will be to provide a message to go alongside the changeset. This will be written into the changelog when the next release occurs.

After this, a new changeset will be added which is a markdown file with YAML front matter.

```
-| .changeset/
-|-| UNIQUE_ID.md
```

The message you typed can be found in the markdown file. If you want to expand on it, you can write as much markdown as you want, which will all be added to the changelog on publish. If you want to change the bump type for the changeset, that's also fine.

While not every changeset is going to need a huge amount of detail, a good idea of what should be in a changeset is:

- WHAT the change is
- WHY the change was made
- HOW a consumer should update their code

4. Once you are happy with the changeset, commit the file to your branch.

## Tips on adding changesets

### You can add more than one changeset to a pull request

Changesets are designed to stack, so there's no problem with adding multiple. You might want to add more than one changeset when:

- You want to release multiple packages with different changelog entries
- You have made multiple changes to a package that should each be called out separately

## I want to know more about changesets

[here is a more in-depth explanation](./detailed-explanation.md)


================================================
FILE: docs/automating-changesets.md
================================================
# Automating Changesets

While changesets are designed to work with a fully manual process, it also provides tools to help automate these releases. These can be broken into two major decisions:

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

## Recommended Automation Flow

1. Install our [changeset bot](https://github.com/apps/changeset-bot) into your repository.
2. Add the [github action](https://github.com/changesets/action) to your repository.

## How do I want to ensure pull requests have changesets?

Changesets are committed to files, so a diligent reviewer can always technically tell if a changeset is absent and request one be added. As humans though, a file not being there is easy to miss. We recommend adding some way to detect the presence or absence of changesets on a pull request so you don't have to, as well as highlight it to pull-request makers so you don't have to.

This has two main approaches.

### Non-blocking

In this approach, a pull request may be merged if no changeset is present, and a missing changeset does not create a red build. Our [github changeset bot](https://github.com/apps/changeset-bot) is the best way to prompt for changesets without making them blocking. As a handy extra feature, they give you a link to add your own changeset as a maintainer to smooth over merging pull requests without waiting for the contributor to add a changeset.

### Blocking

Sometimes, you may want to make CI fail if no 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:

```bash
changeset status --since=main
```

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

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 the base branch.

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 the base branch
- The RC pulls down the base branch, runs `changeset version`, then makes a new PR with the versioning changes
- The versioning changes are merged back into the base branch
- The RC pulls the base branch again and runs `changeset publish`
- The RC runs `git push --follow-tags` to push the release tags back
- The RC unblocks merging to the base branch

This is a lot of steps and is quite finicky (we have to pull from the base branch twice). Feel free to finesse it to your own circumstances.


================================================
FILE: docs/checking-for-changesets.md
================================================
# Checking for changesets

Using `@changesets/cli`, there is a `status` command. See the docs for it in the
[@changesets/cli readme](../packages/cli/README.md#status)

We have a [github bot](https://github.com/apps/changeset-bot) and a
[bitbucket addon](https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/build/bitbucket-release-addon/) that
alert users of missing changesets.

If you want to cause a failure in CI on missing changesets (not recommended), you can run `changeset status --since=main`,
which will exit with a status code of 1 if there are no new changesets.


================================================
FILE: docs/command-line-options.md
================================================
# Command line options

The command line for changesets is the main way of interacting with it. There are 4 main commands. If you are looking for how we recommend you setup and manage changesets with the commands, check out our [intro to using changesets](./intro-to-using-changesets.md)

- init
- add [--empty] [--open] [--since <ref>] [--message <text>]
- version [--ignore, --snapshot]
- publish [--otp=code, --tag]
- status [--since=master --verbose --output=JSON_FILE.json]
- pre [exit|enter {tag}]
- tag

The most important commands are `add`, which is used by contributors to add information about their changes, `version` - which is responsible for using the changesets generated by `add` to update package versions and changelogs, and then `publish` which publishes changes to npm.

## `init`

```
changeset init
```

This command sets up the `.changeset` folder. It generates a readme and a config file. The config file includes the default options and comments on what these options represent. You should run this command once when you are setting up changesets.

## `add`

```
changeset add
```

or just

```
changeset
```

This is the main command people use to interact with the changesets.

This command will ask you a series of questions, first about what packages you want to release, then what semver bump type for each package, then it will ask for a summary of the entire changeset. The final step will show the changeset it will generate and confirm that you want to add it.

Once confirmed, the changeset will be written as a Markdown file that contains the summary and YAML front matter which stores the packages that will be released and the semver bump types for them.

A changeset that major bumps `@changesets/cli` would look like this:

```
---
"@changesets/cli": major
---

A description of the major changes.
If you want to modify this file after it's generated, that's completely fine or if you want to write changeset files yourself, that's also fine.
```

- `--empty` - allows you to create an empty changeset if no packages are being bumped, usually only required if you have CI that blocks merges without a changeset.

```
changeset --empty
```

A changeset created with the empty flag would look like this:

```
---
---
```

If you set the commit option in the config, the command will add the updated changeset files and then commit them.

- `--open` - opens the created changeset in an external editor
- `--message` (or `-m`) - provides the changeset summary from the command line instead of prompting for it.

- `--since` - uses the provided branch, tag, or git ref (such as `main` or a git commit hash) to detect which packages have changed when populating the list of changed packages in the CLI. This is useful in gitflow workflows where you have multiple target branches and `baseBranch` in the config doesn't cover all use cases. If not provided, the command falls back to the `baseBranch` value in your `.changeset/config.json`.

```
changeset add --since=develop
```

## version

```
changeset version
```

This is one of two commands responsible for releasing packages. The version command takes changesets that have been made and updates versions and dependencies of packages, as well as writing changelogs. It is responsible for all file changes to versions before publishing to npm.

> We recommend making sure changes made from this command are merged back into the base branch before you run publish.

Version has two options, `ignore` and `snapshot`:

```
changeset version --ignore PACKAGE_NAME
```

This command is used to allow you to skip packages from being published. This allows you to run partial publishes of the repository. Using ignore has some safety rails:

1. If the package is mentioned in a changeset that also includes a package that is not ignored, publishing will fail.
2. If the package requires one of its dependencies to be updated as part of a publish.

These restrictions exist to ensure your repository or published code does not end up in a broken state. For additional information on the intricacies of publishing, check out our guide on [problems publishing in monorepos](./problems-publishing-in-monorepos.md).

```
changeset version --snapshot
```

Snapshot is used for a special kind of publishing for testing - it creates temporary versions with a tag, instead of updating versions from the current semver ranges. You should not use this without [reading the documentation on snapshot releases](./snapshot-releases.md)

## publish

```
changeset publish [--otp={token}]
```

This publishes changes to npm, and creates git tags. This works by going into each package, checking if the version it has in its `package.json` is published on npm, and if it is not, running the `npm publish`. If you are using `pnpm` as a package manager, this automatically detects it and uses `pnpm publish` instead.

Because this command assumes that the last commit is the release commit, you should not commit any changes between calling version and publish. These commands are separate to enable you to check if the release changes are accurate.

`--otp={token}` - allows you to provide an npm one-time password if you have auth and writes enabled on npm. The CLI also prompts for the OTP if it's not provided with the --otp option.

`--tag TAGNAME` - for packages that are published, the chosen tag will be used instead of `latest`, allowing you to publish changes intended for testing and validation, not main consumption. This will most likely be used with [snapshot releases](./snapshot-releases.md).

### Git Tags

It is useful to have git tags of a publish, to allow people looking for the code at that time to find them. We generate tags in git during publish, but you will need to push them back up if you want to make them available. We recommend after publish you run:

```
git push --follow-tags
```

## status

```
changeset status [--verbose] [--output={filePath}] [--since={gitTag}]
```

The status command provides information about the changesets that currently exist. If there are no changesets present, it exits with an error status code.

- `--verbose` - use if you want to know the new versions, and get a link to the relevant changeset summary.

- `--output` - allows you to write the JSON object of the status output for consumption by other tools, such as CI.

- `--since` - to only display information about changesets since a specific branch or git tag (such as `main`, or the git hash of latest). While this can be used to add a CI check for changesets, we recommend not doing this. We instead recommend using the [changeset bot](https://github.com/apps/changeset-bot) to detect pull requests missing changesets, as not all pull requests need one if you are on GitHub.

> NOTE: `status` will fail if you are in the middle of running `version` or `publish`. If you want to get changeset status at the time of a version increase and publish, you need to run it immediately before running `version`.

## pre

```
changeset pre [exit|enter {tag}]
```

The pre command enters and exits pre mode. The command does not do any actual versioning, when doing a pre-release, you should run changeset pre enter next(or a different tag, the tag is what is in versions and is the npm dist tag) and then do the normal release process with changeset version and changeset publish. For more information about the pre command, see the prereleases [the prereleases documentation](https://github.com/changesets/changesets/blob/master/docs/prereleases.md).

> NOTE: pre-releases are a very complicated feature. Many of the safety rails that changesets helps you with will be taken off. We recommend that you read both [problems publishing in monorepos](./problems-publishing-in-monorepos.md) and be clear on both exiting and entering pre-releases before using it. You may also prefer using [snapshot releases](./snapshot-releases.md) for a slightly less involved process.

## tag

```
changeset tag
```

The tag command creates git tags for the current version of all packages. The tags created are equivalent to those created by [`changeset publish`](#publish), but the `tag` command does not publish anything to npm.

This is helpful in situations where a different tool, such as `pnpm publish -r`, is used to publish packages instead of changeset. For situations where `changeset publish` is executed, running `changeset tag` is not needed.

The git tags in monorepos are created in the format `pkg-name@version-number` and are based on the current version number of the `package.json` for each package. Note that in single-package repositories, the git tag will include `v` before the version number, for example, `v1.0.0`. It is expected that [`changeset version`](#version) is run before `changeset tag`, so the `package.json` versions are updated before the git tags are created.


================================================
FILE: docs/common-questions.md
================================================
# Common Questions

A quick list of common questions you might want answered to understand what changesets is doing, without going into minutiae or workflow.

## Changesets are automatically generated

Changesets are generated by the `yarn changeset` or `npx @changesets/cli` command. As long as you are following a changeset release flow, you shouldn't have any problems.

## Each changeset is its own file

We use random human readable names by default for these files to avoid collisions when generating them, but there's no harm that will come from renaming them.

## Changesets are automatically removed

When `changeset version` or equivalent command is run, all the changeset files are removed. This is so we only ever use a changeset once. This makes the `.changeset` folder a very bad place to store any other information.

## Changesets are markdown files with YAML front matter

The two parts of the file are for different purposes. You should feel free to edit both parts as much as you want.

- The markdown text is a summary of the changes that will be prepended to your changelog when you next run your version command.
- The YAML front matter describes what should be versioned by the version command

## I want to edit the summary or package bump types - is it safe to do that?

Editing the summary or package bump types is completely safe. You can even write changesets without the command if you want.

## Can I manually delete changesets?

You can, but you should be aware this will remove the intent to release communicated by the changeset, and should be done with caution.


================================================
FILE: docs/config-file-options.md
================================================
# Configuring Changesets

Changesets has a minimal amount of configuration options. Mostly these are for when you need to change the default workflows. These are stored in `.changeset/config.json`. Our default config is:

```json
{
  "changelog": "@changesets/cli/changelog",
  "commit": false,
  "fixed": [],
  "linked": [],
  "access": "restricted",
  "baseBranch": "main",
  "updateInternalDependencies": "patch",
  "ignore": []
}
```

> NOTE: the `linked`, `fixed`, `updateInternalDependencies`, `bumpVersionsWithWorkspaceProtocolOnly`, and `ignore` options are only for behaviour in monorepos.

## `commit` (`boolean`, or module path as a `string`, or a tuple like `[modulePath: string, options: any]`)

This option is for setting if the `changeset add` command and the `changeset version` commands will also add and commit the changed files using git, and how the commit messages should be generated for them.

By default, we do not commit the files, and leave it to the user to commit the files. If it is `true`, we use the default commit message generator (`["@changesets/cli/commit", { "skipCI": "version" }]`). Setting it to a string and options tuple specifies a path from where we will load the commit message generation functions. It expects to be a file that exports one or both of the following:

```
{
  getAddMessage,
  getVersionMessage
}
```

If one of the methods is not present then we will not commit the files changed for that command.

You would specify a custom commit message generator with:

```json
{
  "commit": ["../scripts/commit.js", { "customOption": true }]
}
```

This is similar to how the [changelog generator functions work](#changelog-false-or-a-path).

## `access` (`restricted` | `public`)

This sets how packages are published - if `access: "restricted"`, packages will be published as private, requiring log in to an npm account with access to install. If `access: "public"`, the packages will be made available on the public registry.

By default, npm publishes scoped npm packages as `restricted` - so to ensure you do not accidentally publish code publicly, we default to `restricted`. For most cases you will want to set this to `public`.

This can be overridden in specific packages by setting the `access` in a package's `package.json`.

If you want to prevent a package from being published to npm, set `private: true` in that package's `package.json`

## `baseBranch` (git branch name)

The branch to which changesets will make comparisons to detect what has changed since the last commit of the base branch. This should generally be set to the default branch you merge changes into, e.g. `main` or `master`.

Commands that use this information accept a `--since` option which can be used to override this.

Locally, make sure the base branch exists and is up to date so changesets can make accurate comparisons.

## `ignore` (array of packages)

This option allows you to specify some packages that will not be published, even if they are referenced in changesets. Instead, those changesets will be skipped until they are removed from this array.

> THIS FEATURE IS DESIGNED FOR TEMPORARY USE TO ALLOW CHANGES TO BE MERGED WITHOUT PUBLISHING THEM - If you want to stop a package from being published at all, set `private: true` in its `package.json`.

There are two caveats to this.

1. If the package is mentioned in a changeset that also includes a package that is not ignored, publishing will fail.
2. If the package requires one of its dependencies to be updated as part of a publish.

These restrictions exist to ensure your repository or published code do not end up in a broken state. For a more detailed intricacies of publishing, check out our guide on [problems publishing in monorepos](./problems-publishing-in-monorepos.md).

> NOTE: you can also provide glob expressions to match the packages, according to the [micromatch](https://www.npmjs.com/package/micromatch) format.

## `fixed` (array of arrays of package names)

This option can be used to declare that packages should be version-bumped and published together. As an example, if you have a `@changesets/button` component and a `@changesets/theme` component and you want to make sure that when one gets bumped to `1.1.0`, the other is also bumped to `1.1.0` regardless if it has any change or not. To achieve this you would have the config:

```json
{
  "fixed": [["@changesets/button", "@changesets/theme"]]
}
```

If you want to use this option, you should read the documentation on [fixed packages](./fixed-packages.md) to fully understand the implementation and implications.

## `linked` (array of arrays of package names)

This option can be used to declare that packages should 'share' a version, instead of being versioned completely independently. As an example, if you have a `@changesets/button` component and a `@changesets/theme` component and you want to make sure that when one gets bumped to `2.0.0`, the other is also bumped to `2.0.0`. To achieve this you would have the config:

```json
{
  "linked": [["@changesets/button", "@changesets/theme"]]
}
```

If you want to use this option, you should read the documentation on [linked packages](./linked-packages.md) to fully understand the implementation and implications.

> NOTE: This does not do what some other tools do, which is make sure when any package is published, all other packages are also published with the same version.

## `updateInternalDependencies`

This option sets whether, when a package that is being depended upon changes, whether you should update what version it depends on. To make this more understandable, here is an example:

Say we have two packages, one depending on the other:

```
pkg-a @ version 1.0.0
pkg-b @ version 1.0.0
  depends on pkg-a at range `^1.0.0
```

Say we are publishing a patch of both `pkg-a` and `pkg-b` - this flag is for determining whether we update how `pkg-b` depends on `pkg-a`.

If the option is set to `patch`, we will update the dependency so we will now have:

```
pkg-a @ version 1.0.1
pkg-b @ version 1.0.1
  depends on pkg-a at range `^1.0.1
```

If however the option is set to `minor`, what it depends on will only be updated when there is a minor change, so the state would be:

```
pkg-a @ version 1.0.1
pkg-b @ version 1.0.1
  depends on pkg-a at range `^1.0.0
```

Using `minor` allows consumers to more actively control their own deduplication of packages, and will allow them to install fewer versions if you have many interconnected packages. Using `patch` will mean consumers will more often be using more updated code, but may cause problems with deduplication.

Changesets will always update the dependency if it would leave the old semver range.

> ⚠ Note: this is only applied for packages which are already released in the current release. If A depends on B and we only release B then A won't be bumped.

## `changelog` (false or a path)

This option is for setting how the changelog for packages should be generated. If it is `false`, no changelogs will be generated. Setting it to a string specifies a path from where we will load the changelog generation functions. It expects a file that exports the following:

```
{
  getReleaseLine,
  getDependencyReleaseLine
}
```

As well as the default one, you can use `@changesets/changelog-git`, which adds links to commits into changelogs, or `@changesets/changelog-github`, which requires github authentication, and includes a thankyou message to the person who added the changeset as well as a link to the relevant PR.

You would specify our github changelog generator with:

```json
{
  "changelog": ["@changesets/changelog-github", { "repo": "<org>/<repo>" }]
}
```

For more details on these functions and information on how to write your own see [changelog-functions](./modifying-changelog-format.md)

## `bumpVersionsWithWorkspaceProtocolOnly` (optional boolean)

Default value: `false`

Determines whether Changesets should only bump dependency ranges that use workspace protocol of packages that are part of the workspace.

## `snapshot` (object or undefined)

Default value: `undefined`

### `useCalculatedVersion` (optional boolean)

Default value: `false`

When `changesets version --snapshot` is used, the default behavior is to use `0.0.0` as the base version for the snapshot release.

Setting `useCalculatedVersion: true` will change the default behavior and will use the calculated version, based on the changeset files.

### `prereleaseTemplate` (optional string)

Default value: `undefined` (see note below)

Configures the suffix for the snapshot releases, using a template with placeholders.

**Available placeholders:**

You can use the following placeholders for customizing the snapshot release version:

- `{tag}` - the name of the snapshot tag, as specified in `--snapshot something`
- `{commit}` - the Git commit ID
- `{timestamp}` - Unix timestamp of the time of the release
- `{datetime}` - date and time of the release (14 characters, for example, `20211213000730`)

> Note: if you are using `--snapshot` with empty tag name, you cannot use `{tag}` as placeholder - this will result in error.

**Default behavior**

If you are not specifying `prereleaseTemplate`, the default behavior will fall back to using the following template: `{tag}-{datetime}`, and in cases where the tag is empty (`--snapshot` with no tag name), it will use `{datetime}` only.

## `privatePackages` (object or false)

This option is for setting how private packages should be handled. By default, Changesets will update the changelog for private packages and update their version, but will not create a tag. You can configure this option to change the default behavior.

### `version` (optional boolean)

Default value: `true`

When `version` is set to `true`, Changesets will update the version for private packages. If set to `false`, Changesets will not update the version for private packages.

### `tag` (optional boolean)

Default value: `false`

When `tag` is set to `true`, Changesets will create a tag for private packages. If set to `false`, Changesets will not create a tag for private packages.

### Example

```json
{
  "privatePackages": {
    "version": true,
    "tag": false
  }
}
```


================================================
FILE: docs/decisions.md
================================================
# Decisions

This file is a discussion of some of the rules and design decisions that have gone into making changesets. The goal of all of these has been to make the experience of using changesets easy, while still providing the maximum value possible.

## How changesets are combined

Changesets are designed to be as easy to accumulate as possible. As such, when changesets are consumed with `version`, we flatten the version bumps into one single bump at the highest semver range specified.

For example: if you run `version`, and we have `packageA` at `1.1.1`, which has two `minor` changesets, and one `patch` changeset, we will bump `packageA` to `1.2.0`.

This allows changesets to be added and accumulated safely, with the knowledge that packages will only be released once at an appropriate version for the combined set of changesets, while still ensuring each change is captured in the changelog, with an indication of what kind of change it is.

## How dependencies are bumped

> NOTE: This refers specifically to a feature of changesets used in mono-repos

When changesets are generated, we check to see if the selected packages will leave semver for any other packages within the mono-repo.

For example, if I have two packages:

`packageA` at `1.1.1`

and `packageB` at `1.1.0` that depends on `packageA` at `^1.1.0`.

If I add `packageA` to a changeset with a `major` change, the version of `packageB` within the mono-repo should also be updated. If it is not, either `packageB` in the mono-repo will not use `packageA` in development, or `packageB` in development will not match an installation of `packageB` in production.

As such we end up with a changeset that includes `packageA` as `major` and `packageB` as `patch`.

All updating of dependencies is done as a patch bump. If you want to indicate a more significant change to `packageB` from consuming a new version of `packageA`, we recommend adding a second changeset specifically for `packageB`.

## Why do we write files to disc

There are two reasons we chose to do this. The first is so the changeset descriptions are editable after creation, and a user can go in and change this as they desire. The second is that it means we are unopinionated about your git workflows, with squashing and modifying commits being completely safe, without fear of breaking a release.

## What distinguishes this from Semantic Release

If you have been looking at automating versioning previously, you may have come across [semantic release](https://github.com/semantic-release/semantic-release), or its mono-repo equivalent [lerna semantic release](https://github.com/atlassian/lerna-semantic-release). It's good to understand how changesets operate differently.

1. Changesets are designed for mono-repos first.

This means we manage dependencies within the repository, which other tools do not do.

2. We commit our change information to the file system, instead of storing it in git.

See the above section on why we write files to disc.

3. We use semver for specifying the change.

When selecting the kind of change your package is, we do not specify any change types beyond `major`, `minor`, or `patch`. The semantic release allows you to specify a range of fields (bug-fix, feature) that it converts to an appropriate semver type. This is a design decision on our part to push adding this information into the changeset description itself.

## The versioning of peer dependencies

Currently, if you list a package as a `peerDependency` of another package, this causes the package with the `peerDependency` to
be released as a `major` change. This is because `peerDependency` changes will not be caught by a package installation.

This decision is open for discussion.

## How Changesets interacts with Git

Changesets core flow of adding changesets, versioning packages/writing changelogs, and publishing packages should work without Git. Using Git in a way where the user doesn't explicitly ask to do something that involves Git such as showing changed packages in the add command shouldn't show an error if Git fails for any reason. Using Git in a way where the user explicitly chooses to use Git such as using the commit option or `status --since main`, Changesets should log an error and fail with a non-zero exit code.


================================================
FILE: docs/detailed-explanation.md
================================================
# A Detailed Explanation of Changesets

Below, you will find a detailed explanation of what changesets are, and how they are being thought about.

## The problem:

When organising the release of packages, you may end up wanting to group several changes together written by different people and/or over a relatively large period of time. The best time to capture this information is when submitting a PR (when it is fresh in your mind), not when you eventually go to batch and release these changes.

Git is a bad place to store this information, as it discourages writing detailed change descriptions - you want to allow people to provide as much documentation for the change as they want.

## The solution, Changesets:

The best way to think about a changeset as separate to either a changelog or a version bump is that a changeset is an 'intent to change'. The intent to change carries with it two key bits of information:

- versioning
- changelogs

As it is an intent to change, the relevant versioning information is:

- 'major' | 'minor' | 'patch'

In addition, within a mono-repository, we can encode information about any other packages in the mono-repository that should be re-released to consume this change. This ensures that if you upgrade latest of all the packages, they are all compatible. The current implementation is heavily informed by [bolt's](https://github.com/boltpkg/bolt) opinion on version compatibility.

- changelog information can be stored as a markdown snippet.

As storing this information directly in git is problematic, we store it in the file system using the following structure:

```
-| .changeset/
-|-| UNIQUE_ID.md
```

A changeset is a Markdown file with YAML front matter. The contents of the Markdown is the change summary which will be written to the changelog and the YAML front matter describes what packages have changed and what semver bump types they should be

```md
---
"@myproject/cli": major
"@myproject/core": minor
---

Change all the things
```

This is useful because it breaks versioning into two steps:

1. Adding a changeset - can be done in a PR, by a contributor, while the change is fresh in their mind.
2. Versioning - combines all changesets, creates one version bump for each package based on the maximum version bump of each package, updates dependencies where needed, and writes changelogs. Can then be reviewed as an aggregate.

## The tooling that makes this worthwhile

1. CLI generation of new changesets.
2. Automated consumption of changesets to do versioning.
3. Detection + surfacing of changesets in PRs.

A tool to publish multiple packages from a mono-repo is also important, however does not need to be linked to this.

## Benefits to single-package repos

Changesets are designed first and foremost to handle versioning in multi-package repos, where interdependencies flowing through the system are important to understand and capture.

Conceptually though, the benefits of changesets are detachable from this. I think this process overall leads to an improvement in Pull Requests that helps increase confidence in versioning decisions and changelog entries.


================================================
FILE: docs/dictionary.md
================================================
# Changesets Dictionary

This is a list of some words and phrases that are used in changesets which are helpful to know so that contributors to changesets have a shared understanding of various concepts in the project.

Several of these have associated type definitions, which you can find in [our types package](../packages/types).

- **changeset** - an intent to release a set of packages at particular bump types with a summary of the changes made. Changesets are stackable, that is running `bump` will apply any number of changesets correctly. Changesets are used to generate further information, such as the `release information`, and the `release plan`.
- **summary** - Information about the changes the changeset represents - this is written out to the `CHANGELOG.md` file of every package mentioned in the changeset.
- **changeset folder** - A `./changeset` folder - this is where we store written versions of changesets. Currently we assume all changesets are written to this.
- **workspace** - a local package in a multi-package repo
- **bump-type** - The type of change expected. Of type `major | minor | patch | none`, based on the change types of [semver](https://semver.org/)
- **range-type** - The type of range a package depends on, such as `1.0.0`, `~1.0.0`, or `^1.0.0`. This is a subset of valid semver ranges as [defined by node](https://github.com/npm/node-semver#ranges), narrowing to ranges we can update programmatically.
- **bump**
  - (1) The command to apply all current changesets and update all package versions and changelogs.
  - (2) The act of updating a package version to a new version.
- **single-package repo** - A repository which only contains a single package which is at the root of the repo
- **multi-package repo/monorepo** - A repository which contains multiple packages, generally managed by [Bolt](https://github.com/boltpkg/bolt) or [Yarn Workspaces](https://yarnpkg.com/lang/en/docs/workspaces/).
- **release line generators** - The `getReleaseLine` and `getDependencyReleaseLine` functions which are responsible for creating the lines inserted into changelog. A changelog entry for a particular release can be thought of as `releaseLineGenerators(changesets)`
- **fixed packages** - Fixed packages share a semver categorisation, such that all fixed packages have the same semver version and are always published together. The logistics of this are best left to our [fixed-packages](./fixed-packages.md) documentation.
- **linked packages** - Linked packages share a semver categorisation, such that all published linked packages have consistent new semver ranges. The logistics of this are best left to our [linked-packages](./linked-packages.md) documentation.
- **release instruction** An object containing an intent to release a single package, consisting of the package name and a bump type
- **release plan** - A calculated object that shows everything a collection of changesets will release, and at what version, and how. This object includes a calculation of dependencies, and considerations for `linked` packages.
- **absolutely correct semver** - making semver versioning decisions to ensure nothing less than major is capable of breaking a consumer's code. Because literally any change is technically capable of breaking a user's code, absolutely correct semver requires that all changes are major changes.
- **pragmatically correct semver** - Making semver decisions that you believe to be correct, but may be in error. A pragmatic assessment is likely to change with the number of users of a project, and the API surface area of the project. Whenever we talk about 'correct semver', we are referring to 'pragmatically correct semver'
- **dependency** - A package that is depended upon by another given package.
- **dependent** - A package which depends on another given package. This is frequently used in the context of getting the dependents of a package so they can be released.
- **release** - The combination of versioning and publishing a package or packages which may include a build process before publishing
- **prereleases** - A pre-release is a release that uses a tag, and is not published as `latest` on npm. This is designed for when you want to share code, but are not yet ready for it to be the main package used by everyone. Pre-releases for packages are common, but pre-releases within a monorepo presents unique problems. You can see our exhaustive pre-release documentation [in our prereleases documentation](./prereleases.md). In addition, there are two different approaches to pre-releases which are defined for use separately.
- **Release Candidate (RC) prerelease** - An RC prerelease is done before an intended important release, likely a major release. It includes semver information about what the next intended release version is, a tag, and an iterated number for the prerelease. The output of this is intended to be committed, and then further work done on the branch. An example would be if I am on `1.0.0` of a package, and I want to do an RC for the next `major` version we would have: `package-one@2.0.0-my-tag.0`, and then the next publish is `package-one@2.0.0-my-tag.1`.
- **snapshot prerelease** - A snapshot pre-release is intended to make it easy to test all changes at a particular git commit. It is published at `0.0.0` and uses the git hash as the tag. This should be used as a less formal method than a release candidate to make it easy to install and test changes. An example, if we have a package at `1.0.0`, and have a changeset for it to be `major` bumped, a snapshot release will be at `0.0.0-ABCDEFGH` (the last github hash). If we add more commits, the next snapshot would be `0.0.0-HIJKLMNOP`.

## Things that we haven't figured out how to explain well yet

- The fact that a package is depending on a package and what the range of the dependency is specified in the list of the package's dependencies. This is specifically not about the dependency but about the relationship between the dependent and the dependency.


================================================
FILE: docs/experimental-options.md
================================================
# Experimental Options

All experimental options are configured in `config.json` under `___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH` flag.

> Please use these experimental flags with caution, and please pay attention to release notes - these config flags might change in patch versions.

## `updateInternalDependents` (type: `'out-of-range' | 'always'`)

Default value: `out-of-range`.

The config flag can be used to add dependent packages to the release (if they are not already a part of it) with patch bumps.

## `onlyUpdatePeerDependentsWhenOutOfRange` (type: `boolean`)

Default value: `false`

When set to `true`, Changesets will only bump peer dependents when `peerDependencies` are leaving the range.


================================================
FILE: docs/fixed-packages.md
================================================
# Fixed Packages

Fixed packages allow you to specify a group or groups of packages that should be versioned and published together.

> Unlike `linked packages`, all packages in the group of fixed packages will be version-bumped and published together even when there are no changes done to some of the the member packages.

## Examples

I have three packages, `pkg-a`, `pkg-b` and `pkg-c`. `pkg-a` and `pkg-b` are fixed but `pkg-c` is not so the config looks like this.

```json
{
  "fixed": [["pkg-a", "pkg-b"]]
}
```

- `pkg-a` is at `1.0.0`
- `pkg-b` is at `1.0.0`
- `pkg-c` is at `1.0.0`

I have a changeset with a patch for `pkg-a`, minor for `pkg-b` and major for `pkg-c` and I do a release, the resulting versions will be:

- `pkg-a` is at `1.1.0`
- `pkg-b` is at `1.1.0`
- `pkg-c` is at `2.0.0`

I now have another changeset with a minor for `pkg-a` and I do a release, the resulting versions will be:

- `pkg-a` is at `1.2.0`
- `pkg-b` is at `1.2.0`
- `pkg-c` is at `2.0.0`

## Using glob expressions

Sometimes you want to fix many or all packages within your project (for example in a monorepo setup), in which case you would need to keep the list of fixed packages up-to-date.

To make it simpler to maintain that list, you can provide glob expressions in the list that would match and resolve to all the packages that you wish to include.

For example:

```json
{
  "fixed": [["pkg-*"]]
}
```

It will match all packages starting with `pkg-`.

**The glob expressions must be defined according to the [micromatch](https://www.npmjs.com/package/micromatch) format.**


================================================
FILE: docs/intro-to-using-changesets.md
================================================
# Using Changesets

Changesets are designed to make your workflows easier, by allowing the person making contributions to make key decisions when they are making their contribution. Changesets hold two key bits of information: a version type (following [semver](https://semver.org/)), and change information to be added to a changelog.

In addition, changesets were originally designed for implementation in [bolt monorepos](https://github.com/boltpkg/bolt). As such, in a monorepo context, changesets will handle bumping dependencies of changed packages, if that is required.

This guide is aimed at package maintainers adding changesets as a tool. For the information relevant to contributors, see [adding a changeset](./adding-a-changeset.md).

The overall tool after initialization should lead to a loop that looks like:

1. Changesets added along with each change
2. The version command is run when a release is ready, and the changes are verified
3. The publish command is run afterwards.

The second two steps can be made part of a CI process.

## Add the changeset tool

```shell
yarn add -D @changesets/cli && yarn changeset init
```

or

```shell
npx @changesets/cli init
```

## Adding changesets

```shell
yarn changeset
```

or

```shell
npx @changesets/cli
```

> Note: You can run `changeset add` to add a changeset if you want to, but running Changesets without any command works as well.

## Versioning and publishing

Once you decide you want to do a release, you can run

```shell
yarn changeset version
```

or

```shell
npx @changesets/cli version
```

This consumes all changesets, and updates to the most appropriate semver version based on those changesets. It also writes changelog entries for each consumed changeset.

We recommend at this step reviewing both the changelog entries and the version changes for packages. Once you are confident that these are correct, and have made any necessary tweaks to changelogs, you can publish your packages:

```shell
yarn changeset publish
```

or

```shell
npx @changesets/cli publish
```

This will run npm publish in each package that is of a later version than the one currently listed on npm.

## Some handy advice

### Not every change requires a changeset

Since changesets are focused on releases and changelogs, changes to your repository that don't require these won't need a changeset. As such, we recommend not adding a blocking element to contributions in the absence of a changeset.


================================================
FILE: docs/linked-packages.md
================================================
# Linked Packages

Linked packages allow you to specify a group or groups of packages that should be versioned together. There are some complex cases, so some examples are shown below to demonstrate various cases.

- Linked packages will still only be bumped when there is a changeset for them (this can mean because you explicitly choose to add a changeset for it or because it's a dependent of something being released)
- Packages that have changesets and are in a set of linked packages will **always** be versioned to the highest current version in the set of linked packages + the highest bump type from changesets in the set of linked packages

> Unlike `fixed packages`, there is no guarantee that all packages in the group of linked packages will be version-bumped and published, only those with changeset(s) will be.

## Examples

### General example

I have three packages, `pkg-a`, `pkg-b` and `pkg-c`. `pkg-a` and `pkg-b` are linked but `pkg-c` is not so the config looks like this.

```json
{
  "linked": [["pkg-a", "pkg-b"]]
}
```

- `pkg-a` is at `1.0.0`
- `pkg-b` is at `1.0.0`
- `pkg-c` is at `1.0.0`

I have a changeset with a patch for `pkg-a`, minor for `pkg-b` and major for `pkg-c` and I do a release, the resulting versions will be:

- `pkg-a` is at `1.1.0`
- `pkg-b` is at `1.1.0`
- `pkg-c` is at `2.0.0`

I now have another changeset with a minor for `pkg-a` and I do a release, the resulting versions will be:

- `pkg-a` is at `1.2.0`
- `pkg-b` is at `1.1.0`
- `pkg-c` is at `2.0.0`

I now have another changeset with a minor for `pkg-b` and I do a release, the resulting versions will be:

- `pkg-a` is at `1.2.0`
- `pkg-b` is at `1.3.0`
- `pkg-c` is at `2.0.0`

I now have another changeset with patches for all three packages and I do a release, the resulting versions will be:

- `pkg-a` is at `1.3.1`
- `pkg-b` is at `1.3.1`
- `pkg-c` is at `2.0.1`

### Example with dependants

I have two packages, `pkg-a`, `pkg-b` which are linked. `pkg-a` has a dependency on `pkg-b`.

```json
{
  "linked": [["pkg-a", "pkg-b"]]
}
```

- `pkg-a` is at `1.0.0`
- `pkg-b` is at `1.0.0`

I have a changeset with a major for `pkg-b` and I do a release, the resulting versions will be:

- `pkg-a` is at `2.0.0`
- `pkg-b` is at `2.0.0`

I now have another changeset with a major for `pkg-a` and I do a release, the resulting versions will be:

- `pkg-a` is at `3.0.0`
- `pkg-b` is at `2.0.0`

## Using glob expressions

Sometimes you want to link many or all packages within your project (for example in a monorepo setup), in which case you would need to keep the list of linked packages up-to-date.

To make it simpler to maintain that list, you can provide glob expressions in the linked list that would match and resolve all the packages you wish to include.

For example:

```json
{
  "linked": [["pkg-*"]]
}
```

It will match all packages starting with `pkg-`.

**The glob expressions must be defined according to the [micromatch](https://www.npmjs.com/package/micromatch) format.**


================================================
FILE: docs/modifying-changelog-format.md
================================================
# Modifying The Changelog Formats

Changesets comes with a default format for the changelogs for packages which is relatively basic in what information it displays, however this is customisable. Here we will talk about how to modify the changelog, so that it contains extra meta-information.

## Setting What Formatting Functions to Use

To change how the changelog is generated, you use the `changelog` setting in the `./changeset/config.json`. This setting accepts a string, which points to a module. You can reference an npm package that you have installed, or a local file where you have written your own functions.

For example, `changesets` has a package, `@changesets/changelog-git`. To use it, you would first need to install the package.

```
yarn add @changesets/changelog-git
```

Next, change your `.changeset/config.json` to point to the new package:

```
"changelog": "@changesets/changelog-git"
```

If you want to write your own, you can reference a file path. For example, you can create a new file `.changeset/my-changelog-config.js`, then you can reference it in the `.changeset/config.json` file as:

```
"changelog": "./my-changelog-config.js"
```

## Writing Changelog Formatting Functions

The changelog formatting is done by two different functions. `getReleaseLine` and `getDependencyReleaseLine`. These must be provided in an object as the export of your generation file. A basic file setup for the changelog generation functions would be:

```js
async function getReleaseLine() {}

async function getDependencyReleaseLine() {}

module.exports = {
  getReleaseLine,
  getDependencyReleaseLine,
};
```

These functions are run during the `changeset version` and are expected to return a string (or a promise with a string).

If you are using typescript to write your changelog functions, you can use the type. First install `@changesets/types`, and then:

```ts
import { ChangelogFunctions } from "@changesets/types";

async function getReleaseLine() {}

async function getDependencyReleaseLine() {}

const defaultChangelogFunctions: ChangelogFunctions = {
  getReleaseLine,
  getDependencyReleaseLine,
};

export default defaultChangelogFunctions;
```

```ts
type getReleaseLine(
    changeset: {
        // This is the string of the summary from the changeset markdown file
        summary: string
        // This is an array of information about what is going to be released. each is an object with name: the name of the package, and type, which is "major", "minor", or "patch"
        releases
        // the hash for the commit that introduced the changeset
        commit
    },
    // the type of the change this changeset refers to, as "major", "minor", or "patch"
    type
    // This needs to be explained - see @changesets/changelog-github's code for how this works
    changelogOpts
) => string
```

TODO - this guide is incomplete. Until it is completed, you may need to dig into the code for some of our existing

## Adding Options to Changelog Functions

TODO


================================================
FILE: docs/prereleases.md
================================================
# Prereleases

> Warning! Prereleases are very complicated! Using them requires a thorough understanding of all parts of npm publishes. Mistakes can lead to repository and publish states that are very hard to fix.

> Warning: If you decide to do prereleases from the default branch of your repository, without having a branch for your last stable release without the prerelease changes, you will block other changes until you are ready to exit prerelease mode. We thoroughly recommend only running prereleases from a branch other than the default branch.

You might want to release a version of your packages before you do an actual release, Changesets lets you do this but there are some caveats because of the complexity that monorepos add that are important to understand.

When you want to do a prerelease, you need to enter prerelease mode. You can do that with the `pre enter <tag>`. The tag that you need to pass is used in versions(e.g. `1.0.0-beta.0`) and for the npm dist tag.

A prerelease workflow might look something like this:

```bash
yarn changeset pre enter next
yarn changeset version
git add .
git commit -m "Enter prerelease mode and version packages"
yarn changeset publish
git push --follow-tags
```

Let's go through what's happening here. For this example, let's say you have a repo that looks like this:

```
packages/
  pkg-a@1.0.0 has dep on pkg-b@^2.0.0
  pkg-b@2.0.0 has no deps
  pkg-c@3.0.0 has no deps
.changeset/
  pkg-b@minor
```

```
yarn changeset pre enter next
```

This command changes Changesets into prerelease mode which creates a `pre.json` file in the `.changeset` directory which stores information about the state the prerelease is in. For the specific data stored in the `pre.json` file, see the type definition of `PreState` in [`@changesets/types`](../packages/types).

```
yarn changeset version
```

This command will version packages as you would normally expect but append `-next.0`. An important note is that this will bump dependent packages that wouldn't be bumped in normal releases because prerelease versions are not satisfied by most semver ranges.(e.g. `^5.0.0` is not satisfied by `5.1.0-next.0`)

The repo would now look like this:

```
packages/
  pkg-a@1.0.1-next.0 has dep on pkg-b@^2.1.0-next.0
  pkg-b@2.1.0-next.0 has no deps
  pkg-c@3.0.0 has no deps
.changeset/
```

```
yarn changeset publish
```

This command will publish to npm as the publish command normally does though it will set the dist tag to the tag you specified when running the prerelease command.

When you want to do another prerelease, your workflow would look something like this:

```bash
yarn changeset version
git add .
git commit -m "Version packages"
yarn changeset publish
git push --follow-tags
```

Let's say we add some changesets and a new package so our repo looks like this

```
packages/
  pkg-a@1.0.1-next.0 has dep on pkg-b@^2.1.0-next.0
  pkg-b@2.1.0-next.0 has no deps
  pkg-c@3.0.0 has no deps
  pkg-d@0.0.0 has no deps

.changeset/
  pkg-a@minor
  pkg-c@patch
  pkg-d@major
```

```
yarn changeset version
```

The version command will behave just like it does for the first versioning of a prerelease except the number at the end will be updated. The repo would now look like this:

```
packages/
  pkg-a@1.1.0-next.1 has dep on pkg-b@^2.1.0-next.0
  pkg-b@2.1.0-next.0 has no deps
  pkg-c@3.0.1-next.0 has no deps
  pkg-d@1.0.0-next.0 has no deps
```

```
yarn changeset publish
```

This command will publish to npm just like it does for the first prerelease except because we're adding a new package(we need to define this, is it new to the repo or new to npm? I'm thinking new to npm), the new package will be published with the `latest` dist tag rather than the `next` tag because it's the first time it's being published which means it will be on `latest` anyway. For future publishes until pkg-d is out of prerelease, it will also be published to `latest`.

When you're ready to do the final release, your workflow would look something like this:

```bash
yarn changeset pre exit
yarn changeset version
git add .
git commit -m "Exit prerelease mode and version packages"
yarn changeset publish
git push --follow-tags
```

```
yarn changeset pre exit
```

This command will set an intent to exit prerelease mode in the `pre.json` file though it won't do any actual versioning.

```
yarn changeset version
```

The version command will apply any changesets currently in the repo and then remove the prerelease tag from the versions. The repo would now look like this:

```
packages/
  pkg-a@1.1.0 has dep on pkg-b@^2.1.0
  pkg-b@2.1.0 has no deps
  pkg-c@3.0.1 has no deps
  pkg-d@1.0.0 has no deps
```

```
yarn changeset publish
```

The publish command will publish everything to the `latest` dist tag as normal.


================================================
FILE: docs/problems-publishing-in-monorepos.md
================================================
# Problems Publishing in Monorepos

Monorepos have a heap of complexity around how publishing to npm works. Changesets helps most repository users avoid ever having to think about these problems, however repository maintainers, especially those who want to customise how their releases work (for example those not using our [github action](https://github.com/changesets/action/)), may want to understand what it is solving for you.

TODO: flesh this out (sorry it's not done yet)


================================================
FILE: docs/snapshot-releases.md
================================================
# Snapshot Releases

Snapshot releases are a way to release your changes for testing without updating the versions. Both a modified `version` and a modified `publish` command are used to do accomplish a snapshot release. After both processes run, you will have a published version of packages in changesets with a version of `0.0.0-{tag}-DATETIMESTAMP`.

## Starting Off

Create changesets as normal, as described in [adding a changeset](./adding-a-changeset.md). When you are ready to release a snapshot, you should make a dedicated branch for doing so.

## Versioning your packages

```
yarn changeset version --snapshot
```

This will apply the changesets, but instead of using the next version, all versions will be set to `0.0.0-THE_TIME_YOU_DID_THIS`.

If you want to add a personalised part to this version number, such as `bulbasaur`, you can run

```
yarn changeset version --snapshot bulbasaur
```

This will instead update versions to `0.0.0-bulbasaur-THE_TIME_YOU_DID_THIS`

## Publishing your packages

After running the `yarn changeset version` command, you can use the `changeset publish --tag bulbasaur` command to release the packages. By using the `--tag` flag, you will not add it to the `latest` flag on npm. This is REALLY IMPORTANT because if you do not include a tag, people installing your package using `yarn add your-package-name` will install the snapshot version.

## Using the `--no-git-tag` flag

You can use the `--no-git-tag` CLI flag when running `changeset publish` if you plan to publish snapshot releases locally or you are pushing [git tags](http://npm.github.io/publishing-pkgs-docs/updating/using-tags.html) to a remote from your CI environment.

When you run `changeset publish --no-git-tag`, changesets will skip creating git tags for published snapshot packages. That means that git tags can still be created whenever pushing stable versions (with a regular `changeset publish`), and you can safely publish snapshot releases locally, without creating unnecessary tags.

## Using a snapshot version

When you want to get people to test your snapshots, they can either update their package.json to your newly published version and run an install, or use `yarn add your-package-name@YOUR_TAG_OR_VERSIONS`

For our above example, you could run

```
yarn add your-package-name@0.0.0-bulbasaur-THE_TIME_YOU_DID_THIS
```

or the tag:

```
yarn add your-package-name@bulbasaur
```

## What to do with the snapshot branch

In almost all circumstances, we recommend that the changes after you have run `version` get merged back into your main branch. With snapshots, this is not the case. We recommend that you do not push the changes from this running of `version` to any branch. This is because the snapshot is intended for installation only, not to represent the correct published state of the repo. Save the generated version, and the tag you used, but do not push this to a branch you are planning to merge into the main branch, or merge it into the main branch.


================================================
FILE: docs/versioning-apps.md
================================================
# Managing applications or non-npm packages

Changesets can also be used to manage application versions or non-npm packages (ie dotnet NuGet packages, ruby gems, docker images etc).

The only requirement is that the project has a package.json file to manage the versions and dependencies within the repo.

To enable this feature set `privatePackages` to `{ version: true, tag: true }` in your `.changesets/config.json` file. By default changesets will only update the changelog and version (ie `{ version: true, tag: false }`).

> **Note**
> Changesets only versions NPM package.json files, you can trigger releases for other package formats by creating workflows which trigger on tags/releases being created by changesets.

## Setting up a package

To enable a project to be tracked by changesets, it needs a minimal package.json with at least `name`, `private` and `version`.

```json
{
  "name": "my-project",
  "private": true,
  "version": "0.0.1"
}
```

## Private dependencies

When a versioned private package (app) depends on another private package that is skipped (either via the `ignore` option or `privatePackages.version: false`), changesets will not require the app to also be skipped. Since private packages are not published to npm, it is safe for them to depend on skipped packages.

For example, if you have an app `A` that depends on a private library `B`, you can ignore `B` while still versioning `A`:

```json
{
  "ignore": ["B"]
}
```

This works because `A` is private and will never be published to npm with a stale reference to `B`.


================================================
FILE: jest.config.js
================================================
module.exports = {
  clearMocks: true,
  watchPlugins: [
    "jest-watch-typeahead/filename",
    "jest-watch-typeahead/testname",
  ],
};


================================================
FILE: package.json
================================================
{
  "name": "@changesets/repository",
  "version": "1.0.0",
  "private": true,
  "description": "A tool to help manage the versioning and changelogs for open source packages",
  "scripts": {
    "test": "jest",
    "build": "preconstruct build",
    "watch": "preconstruct watch",
    "postinstall": "preconstruct dev && manypkg check",
    "lint": "yarn eslint . --ext .ts,.tsx,.js",
    "types:check": "tsc",
    "format": "prettier --list-different \"**/*.{js,ts,tsx,md}\"",
    "format:fix": "prettier --write \"**/*.{js,ts,tsx,md}\"",
    "changeset": "packages/cli/bin.js",
    "check-all": "yarn test && yarn types:check && yarn lint && yarn format",
    "version-packages": "changeset version && yarn format:fix",
    "release": "yarn build && changeset publish"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/changesets/changesets.git"
  },
  "packageManager": "yarn@1.22.22",
  "workspaces": [
    "packages/*",
    "scripts/*"
  ],
  "author": "Changesets Contributors",
  "contributors": [
    "Ben Conolly",
    "Mitchell Hamilton",
    "Mateusz Burzyński <mateuszburzynski@gmail.com> (https://github.com/Andarist)"
  ],
  "license": "MIT",
  "devDependencies": {
    "@babel/cli": "^7.27.0",
    "@babel/core": "^7.28.5",
    "@babel/preset-env": "^7.28.5",
    "@babel/preset-typescript": "^7.27.0",
    "@manypkg/cli": "^0.25.1",
    "@preconstruct/cli": "^2.8.12",
    "@types/fs-extra": "^5.1.0",
    "@types/jest": "^24.0.12",
    "@types/jest-in-case": "^1.0.6",
    "@types/lodash": "^4.17.13",
    "@types/node": "^24.10.1",
    "@types/node-fetch": "^2.6.13",
    "@types/prettier": "^2.7.1",
    "@types/semver": "^7.7.1",
    "@typescript-eslint/eslint-plugin": "^5.43.0",
    "@typescript-eslint/parser": "^5.62.0",
    "eslint": "^8.28.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-config-standard": "^17.1.0",
    "eslint-plugin-import": "^2.31.0",
    "eslint-plugin-n": "^15.5.1",
    "eslint-plugin-promise": "^6.1.1",
    "eslint-plugin-standard": "^5.0.0",
    "jest": "^29.3.1",
    "jest-junit": "^16.0.0",
    "jest-watch-typeahead": "^2.2.2",
    "prettier": "^2.7.1",
    "typescript": "^5.8.3"
  },
  "preconstruct": {
    "packages": [
      "packages/*",
      "scripts/*"
    ],
    "exports": {
      "importConditionDefaultExport": "default"
    },
    "___experimentalFlags_WILL_CHANGE_IN_PATCH": {
      "importsConditions": true
    }
  },
  "prettier": {}
}


================================================
FILE: packages/apply-release-plan/CHANGELOG.md
================================================
# @changesets/apply-release-plan

## 7.1.0

### Minor Changes

- [#1774](https://github.com/changesets/changesets/pull/1774) [`667fe5a`](https://github.com/changesets/changesets/commit/667fe5aacf04dbefcf2532584ff2753b8417855a) Thanks [@bluwy](https://github.com/bluwy)! - Support importing custom `changelog` option ES module. Previously, it used `require()` which only worked for CJS modules, however now it uses `import()` which supports both CJS and ES modules.

### Patch Changes

- [#1859](https://github.com/changesets/changesets/pull/1859) [`1772598`](https://github.com/changesets/changesets/commit/1772598270a59ba1fa7b0ef7e675fce6a575f850) Thanks [@mixelburg](https://github.com/mixelburg)! - Fix changelog entry insertion when no package title is present in the `CHANGELOG.md` file.

- [#1810](https://github.com/changesets/changesets/pull/1810) [`27fd8f4`](https://github.com/changesets/changesets/commit/27fd8f41dddafcc2e96e7df39dca04d92f916a0a) Thanks [@hirasso](https://github.com/hirasso)! - Replace deprecated `String.prototype.trimRight` with [`String.prototype.trimEnd`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd)

- Updated dependencies [[`b6f4c74`](https://github.com/changesets/changesets/commit/b6f4c748c4ba50b5ac608f3ce41229526d1bfe94), [`6df3a5e`](https://github.com/changesets/changesets/commit/6df3a5e95522a0210cb2b5619588a75f32b502c6), [`6df3a5e`](https://github.com/changesets/changesets/commit/6df3a5e95522a0210cb2b5619588a75f32b502c6)]:
  - @changesets/config@3.1.3

## 7.0.14

### Patch Changes

- [#610](https://github.com/changesets/changesets/pull/610) [`e520bf5`](https://github.com/changesets/changesets/commit/e520bf5d4dbfe96f59ca28008e87bffaf3c9dfea) Thanks [@bencergazda](https://github.com/bencergazda)! - Add `pre.json` to the version commit

- Updated dependencies [[`cc28222`](https://github.com/changesets/changesets/commit/cc28222ee892b3a078fa02ee26e1cef98c171532), [`13dace8`](https://github.com/changesets/changesets/commit/13dace895017fa351014bc9e13b544d33f8b4bbe)]:
  - @changesets/config@3.1.2

## 7.0.13

### Patch Changes

- [#1725](https://github.com/changesets/changesets/pull/1725) [`957f24e`](https://github.com/changesets/changesets/commit/957f24ed0446494c5709189ae57583f72c716d43) Thanks [@colinaaa](https://github.com/colinaaa)! - Fix an issue that caused an incorrect `CHANGELOG` to be generated when a changeset contained a special string replacement pattern.

## 7.0.12

### Patch Changes

- Updated dependencies [[`f73f84a`](https://github.com/changesets/changesets/commit/f73f84ac2d84d3ccf5ff55c0fc78aaaf3f3da20d)]:
  - @changesets/git@3.0.4

## 7.0.11

### Patch Changes

- Updated dependencies [[`b15e629`](https://github.com/changesets/changesets/commit/b15e6291c3e7e780ee9e58101d3069f2382569ae)]:
  - @changesets/git@3.0.3

## 7.0.10

### Patch Changes

- Updated dependencies [[`b9df596`](https://github.com/changesets/changesets/commit/b9df59627623bcf211ddbdab4df7cc07028d4998)]:
  - @changesets/config@3.1.1

## 7.0.9

### Patch Changes

- Updated dependencies [[`84a4a1b`](https://github.com/changesets/changesets/commit/84a4a1b1d399bfd0a58677b0182b9c053194febf)]:
  - @changesets/types@6.1.0
  - @changesets/config@3.1.0
  - @changesets/should-skip-package@0.1.2

## 7.0.8

### Patch Changes

- [#1562](https://github.com/changesets/changesets/pull/1562) [`a0f87f1`](https://github.com/changesets/changesets/commit/a0f87f1ce596e7c5c316edc24d5d4571e6acd4d7) Thanks [@Netail](https://github.com/Netail), [@cefn](https://github.com/cefn)! - Add an ability to pass in `contextDir` of the running script (like the `@changesets/cli`) so the changelog modules can be alternatively resolved using it

## 7.0.7

### Patch Changes

- Updated dependencies [[`f0270f6`](https://github.com/changesets/changesets/commit/f0270f69793ddb6865f2510d334864b093cb10e3)]:
  - @changesets/config@3.0.5

## 7.0.6

### Patch Changes

- [#1514](https://github.com/changesets/changesets/pull/1514) [`962ab91`](https://github.com/changesets/changesets/commit/962ab918bc2deb89012a0cefce10387997cc54ed) Thanks [@nicoalonsop](https://github.com/nicoalonsop)! - Update spawndamnit to fix [cross-spawn vulnerability](https://security.snyk.io/vuln/SNYK-JS-CROSSSPAWN-8303230)

- Updated dependencies [[`7323704`](https://github.com/changesets/changesets/commit/7323704dff6e76f488370db384579b86c95c866f), [`962ab91`](https://github.com/changesets/changesets/commit/962ab918bc2deb89012a0cefce10387997cc54ed)]:
  - @changesets/config@3.0.4
  - @changesets/git@3.0.2

## 7.0.5

### Patch Changes

- [#1445](https://github.com/changesets/changesets/pull/1445) [`52c302a`](https://github.com/changesets/changesets/commit/52c302a48a662f71585f18f91dad3cbe49d75890) Thanks [@bluwy](https://github.com/bluwy)! - Remove unused `@babel/runtime` dependency

- Updated dependencies [[`52c302a`](https://github.com/changesets/changesets/commit/52c302a48a662f71585f18f91dad3cbe49d75890)]:
  - @changesets/should-skip-package@0.1.1
  - @changesets/git@3.0.1
  - @changesets/config@3.0.3

## 7.0.4

### Patch Changes

- [#1047](https://github.com/changesets/changesets/pull/1047) [`d108fa6`](https://github.com/changesets/changesets/commit/d108fa66e63c3000f42db7580a862b737e241c4d) Thanks [@patzick](https://github.com/patzick)! - Fixed a crash that could occur when depending on a tagged version of another workspace package.

- Updated dependencies [[`dd6e5bb`](https://github.com/changesets/changesets/commit/dd6e5bbf74e246d7a742aa50424989462679b0ca)]:
  - @changesets/config@3.0.2

## 7.0.3

### Patch Changes

- Updated dependencies []:
  - @changesets/config@3.0.1

## 7.0.2

### Patch Changes

- [#1361](https://github.com/changesets/changesets/pull/1361) [`954a16a`](https://github.com/changesets/changesets/commit/954a16aa1d118a0f7fa745ffe0d19b304f685d4c) Thanks [@jakebailey](https://github.com/jakebailey)! - Version 2.25.0 introduced the `privatePackage` configuration option with default `{ version: false, tag: false }`; due to a bug, these options were not respected in all commands, leading to commands like `changeset tag` still tagging private packages. This has been fixed, and all packages now respect this option.

## 7.0.1

### Patch Changes

- [#1351](https://github.com/changesets/changesets/pull/1351) [`c6da182`](https://github.com/changesets/changesets/commit/c6da182ece2ec40974f15f3efcf9d9ba20cf122b) Thanks [@TheHolyWaffle](https://github.com/TheHolyWaffle)! - Fix an issue with not applying a custom `.prettierrc` configuration with `prettier@>= 3.1.1`

## 7.0.0

### Major Changes

- [#1185](https://github.com/changesets/changesets/pull/1185) [`a971652`](https://github.com/changesets/changesets/commit/a971652ec1403aab3fb89eb2f1640bd5012b895a) Thanks [@Andarist](https://github.com/Andarist)! - `package.json#exports` have been added to limit what (and how) code might be imported from the package.

### Minor Changes

- [#1236](https://github.com/changesets/changesets/pull/1236) [`dfd4cca`](https://github.com/changesets/changesets/commit/dfd4cca84118df913feedfeac37a4939566ae447) Thanks [@camertron](https://github.com/camertron)! - Avoid using short commit IDs

### Patch Changes

- Updated dependencies [[`a971652`](https://github.com/changesets/changesets/commit/a971652ec1403aab3fb89eb2f1640bd5012b895a)]:
  - @changesets/get-version-range-type@0.4.0
  - @changesets/config@3.0.0
  - @changesets/types@6.0.0
  - @changesets/git@3.0.0

## 6.1.4

### Patch Changes

- [#1176](https://github.com/changesets/changesets/pull/1176) [`41988ce`](https://github.com/changesets/changesets/commit/41988ceb8c1cedd3857c939448bf3965494ff0a4) Thanks [@joshwooding](https://github.com/joshwooding)! - Bump [`semver`](https://github.com/npm/node-semver) dependency to v7.5.3

- Updated dependencies []:
  - @changesets/config@2.3.1

## 6.1.3

### Patch Changes

- Updated dependencies [[`598136a`](https://github.com/changesets/changesets/commit/598136a32a00b620c9521d7a7151fbbc721c17d7), [`521205d`](https://github.com/changesets/changesets/commit/521205dc8c70fe71b181bd3c4bb7c9c6d2e721d2), [`521205d`](https://github.com/changesets/changesets/commit/521205dc8c70fe71b181bd3c4bb7c9c6d2e721d2), [`598136a`](https://github.com/changesets/changesets/commit/598136a32a00b620c9521d7a7151fbbc721c17d7), [`598136a`](https://github.com/changesets/changesets/commit/598136a32a00b620c9521d7a7151fbbc721c17d7), [`521205d`](https://github.com/changesets/changesets/commit/521205dc8c70fe71b181bd3c4bb7c9c6d2e721d2)]:
  - @changesets/git@2.0.0
  - @changesets/config@2.3.0
  - @changesets/types@5.2.1

## 6.1.2

### Patch Changes

- [#983](https://github.com/changesets/changesets/pull/983) [`6cc4300`](https://github.com/changesets/changesets/commit/6cc430013a052dc2488b9e6700a1e4bd8c8e0680) Thanks [@Andarist](https://github.com/Andarist)! - Improved compatibility with the alpha releases of Prettier v3 by awaiting the `.format` result since it's a promise in that version.

## 6.1.1

### Patch Changes

- Updated dependencies [[`8c08469`](https://github.com/changesets/changesets/commit/8c0846977597ddaf51aaeb35f1f0f9428bf8ba14), [`8c08469`](https://github.com/changesets/changesets/commit/8c0846977597ddaf51aaeb35f1f0f9428bf8ba14)]:
  - @changesets/git@1.5.0
  - @changesets/config@2.2.0
  - @changesets/types@5.2.0

## 6.1.0

### Minor Changes

- [#905](https://github.com/changesets/changesets/pull/905) [`c140171`](https://github.com/changesets/changesets/commit/c1401716cf5ee839aaa02ea7ff8f23f8af8bf5b0) Thanks [@Andarist](https://github.com/Andarist)! - The local version of Prettier is going to be preferred from now on when writing formatted `.md` files back to disk. At the same time the version of Prettier that we depend on has been upgraded.

## 6.0.4

### Patch Changes

- [#900](https://github.com/changesets/changesets/pull/900) [`7d998ee`](https://github.com/changesets/changesets/commit/7d998eeb16064b5442ebc49ad31dec7b841d504e) Thanks [@sdirosa](https://github.com/sdirosa)! - Fixed an issue with generating changelogs not being skipped when the `changelog` config option was set to `false`.

- Updated dependencies [[`7d998ee`](https://github.com/changesets/changesets/commit/7d998eeb16064b5442ebc49ad31dec7b841d504e)]:
  - @changesets/config@2.1.1

## 6.0.3

### Patch Changes

- Updated dependencies [[`f64bc1b`](https://github.com/changesets/changesets/commit/f64bc1bb33457918eae34b22f214174ba3cf4504)]:
  - @changesets/git@1.4.1

## 6.0.2

### Patch Changes

- Updated dependencies [[`dd9b76f`](https://github.com/changesets/changesets/commit/dd9b76f162a546ae8b412e0cb10277f971f3585e), [`dd9b76f`](https://github.com/changesets/changesets/commit/dd9b76f162a546ae8b412e0cb10277f971f3585e), [`dd9b76f`](https://github.com/changesets/changesets/commit/dd9b76f162a546ae8b412e0cb10277f971f3585e)]:
  - @changesets/config@2.1.0
  - @changesets/git@1.4.0
  - @changesets/types@5.1.0

## 6.0.1

### Patch Changes

- [#857](https://github.com/changesets/changesets/pull/857) [`7febb59`](https://github.com/changesets/changesets/commit/7febb599167234ae071b5d223b80cbc8a9375709) Thanks [@dotansimha](https://github.com/dotansimha)! - Fixed an issue with dependency ranges still using pre-existing range modifiers instead of fixed package versions when performing a snapshot release. This ensures that installs of snapshot versions are always reproducible.

- Updated dependencies [[`2827c7a`](https://github.com/changesets/changesets/commit/2827c7ab33af30065fafe72ede1a2a6ac88d5276), [`7b1c0c1`](https://github.com/changesets/changesets/commit/7b1c0c1b73a19b50fe3a104acb440c604eab108f)]:
  - @changesets/config@2.0.1

## 6.0.0

### Major Changes

- [#768](https://github.com/changesets/changesets/pull/768) [`c87eba6`](https://github.com/changesets/changesets/commit/c87eba6f80a34563b7382f87472c29f6dafb546c) Thanks [@rohit-gohri](https://github.com/rohit-gohri)! - This module is no longer responsible for commiting files - this responsibility has been moved entirely to `@changesets/cli`.

### Patch Changes

- Updated dependencies [[`c87eba6`](https://github.com/changesets/changesets/commit/c87eba6f80a34563b7382f87472c29f6dafb546c), [`eb86652`](https://github.com/changesets/changesets/commit/eb86652cbd21c49f90d2a03caa9a578593c4d102), [`c87eba6`](https://github.com/changesets/changesets/commit/c87eba6f80a34563b7382f87472c29f6dafb546c)]:
  - @changesets/types@5.0.0
  - @changesets/git@1.3.2
  - @changesets/config@2.0.0

## 5.0.5

### Patch Changes

- [#703](https://github.com/changesets/changesets/pull/703) [`15c461d`](https://github.com/changesets/changesets/commit/15c461d5de94a274ccc8b33755a133a513339b0a) Thanks [@Andarist](https://github.com/Andarist)! - Fixed an issue with `*` dependency ranges not being replaced in premode. Those have to replaced with exact versions because prereleases don't satisfy wildcard ranges. A published prerelease package with such dependency range left untouched won't install correct prerelease dependency version.

- [#749](https://github.com/changesets/changesets/pull/749) [`d14cf79`](https://github.com/changesets/changesets/commit/d14cf79fd323529c6fe6ca956d9a7fda93bb425b) Thanks [@Andarist](https://github.com/Andarist)! - Fixed an issue that caused **created** CHANGELOG files not being formatted in the same way as the **updated** ones (this could happen when calling `changeset version` for the very first time for a package).

- Updated dependencies [[`27a5a82`](https://github.com/changesets/changesets/commit/27a5a82188914570d192162f9d045dfd082a3c15), [`27a5a82`](https://github.com/changesets/changesets/commit/27a5a82188914570d192162f9d045dfd082a3c15)]:
  - @changesets/types@4.1.0
  - @changesets/config@1.7.0
  - @changesets/git@1.3.1

## 5.0.4

### Patch Changes

- Updated dependencies [[`77c1cef`](https://github.com/changesets/changesets/commit/77c1ceff402f390c1ededec358d914ba68a31d0d)]:
  - @changesets/git@1.3.0
  - @changesets/config@1.6.4

## 5.0.3

### Patch Changes

- [#667](https://github.com/changesets/changesets/pull/667) [`fe8db75`](https://github.com/changesets/changesets/commit/fe8db7500f81caea9064f8bec02bcb77e0fd8fce) Thanks [@fz6m](https://github.com/fz6m)! - Upgraded `@manypkg/get-packages` dependency to fix getting correct packages in pnpm workspaces with exclude rules.

- Updated dependencies [[`fe8db75`](https://github.com/changesets/changesets/commit/fe8db7500f81caea9064f8bec02bcb77e0fd8fce), [`9a993ba`](https://github.com/changesets/changesets/commit/9a993ba09629c1620d749432520470cec49d3a96)]:
  - @changesets/config@1.6.3
  - @changesets/git@1.2.1
  - @changesets/types@4.0.2

## 5.0.2

### Patch Changes

- [#585](https://github.com/changesets/changesets/pull/585) [`74dda8c`](https://github.com/changesets/changesets/commit/74dda8c0d8bd1741ca7b19f0ccb37b2330dc9549) Thanks [@javier-garcia-meteologica](https://github.com/javier-garcia-meteologica)! - Add support for `workspace:^` and `workspace:~` dependency ranges.

- Updated dependencies [[`2b49c39`](https://github.com/changesets/changesets/commit/2b49c390a7cf24ce859ac932b432eb6d8f55c98b)]:
  - @changesets/git@1.2.0
  - @changesets/config@1.6.2

## 5.0.1

### Patch Changes

- Updated dependencies [[`e89e28a`](https://github.com/changesets/changesets/commit/e89e28a05f5fa43307db73812a6bcd269b62ddee)]:
  - @changesets/types@4.0.1
  - @changesets/config@1.6.1
  - @changesets/git@1.1.2

## 5.0.0

### Major Changes

- [#542](https://github.com/changesets/changesets/pull/542) [`de2b4a5`](https://github.com/changesets/changesets/commit/de2b4a5a7b244a37d94625bcb70ecde9dde5b612) Thanks [@Andarist](https://github.com/Andarist)! - The accepted `Config` type has been changed - a new experimental option (`updateInternalDependents`) was added to it.

### Patch Changes

- Updated dependencies [[`de2b4a5`](https://github.com/changesets/changesets/commit/de2b4a5a7b244a37d94625bcb70ecde9dde5b612)]:
  - @changesets/config@1.6.0
  - @changesets/types@4.0.0
  - @changesets/git@1.1.1

## 4.2.0

### Minor Changes

- [`12f9a43`](https://github.com/changesets/changesets/commit/12f9a433a6c3ac38f9405fcd77c9108c423d7101) [#507](https://github.com/changesets/changesets/pull/507) Thanks [@zkochan](https://github.com/zkochan)! - New setting added: bumpVersionsWithWorkspaceProtocolOnly. When it is set to `true`, versions are bumped in `dependencies`, only if those versions are prefixed by the workspace protocol. For instance, `"foo": "workspace:^1.0.0"`.

### Patch Changes

- Updated dependencies [[`12f9a43`](https://github.com/changesets/changesets/commit/12f9a433a6c3ac38f9405fcd77c9108c423d7101)]:
  - @changesets/config@1.5.0
  - @changesets/types@3.3.0

## 4.1.0

### Minor Changes

- [`fd53ca2`](https://github.com/changesets/changesets/commit/fd53ca2acb0a955bc87af090daba5aa41c2bab69) [#395](https://github.com/changesets/changesets/pull/395) Thanks [@jonathanmorley](https://github.com/jonathanmorley)! - Use `JSON.stringify` to update package.jsons without including modifications from prettier.

## 4.0.0

### Major Changes

- [`addd725`](https://github.com/changesets/changesets/commit/addd7256d9251d999251a7c16c0a0b068d557b5d) [#383](https://github.com/changesets/changesets/pull/383) Thanks [@Feiyang1](https://github.com/Feiyang1)! - Added an experimental flag `onlyUpdatePeerDependentsWhenOutOfRange`. When set to `true`, we only bump peer dependents when peerDependencies are leaving range.

### Minor Changes

- [`9dcc364`](https://github.com/changesets/changesets/commit/9dcc364bf19e48f8f2824ebaf967d9ef41b6fc04) [#371](https://github.com/changesets/changesets/pull/371) Thanks [@Feiyang1](https://github.com/Feiyang1)! - Added support for ignoring packages in the `version` command. The version of ignored packages will not be bumped, but their dependencies will still be bumped normally. This is useful when you have private packages, e.g. packages under development. It allows you to make releases for the public packages without changing the version of your private packages. To use the feature, you can define the `ignore` array in the config file with the name of the packages:

  ```
  {
    ...
    "ignore": ["pkg-a", "pkg-b"]
    ...
  }
  ```

  or you can pass the package names to the `--ignore` flag when using cli:

  ```
  yarn changeset version --ignore pkg-a --ignore --pkg-b
  ```

### Patch Changes

- Updated dependencies [[`addd725`](https://github.com/changesets/changesets/commit/addd7256d9251d999251a7c16c0a0b068d557b5d), [`9dcc364`](https://github.com/changesets/changesets/commit/9dcc364bf19e48f8f2824ebaf967d9ef41b6fc04)]:
  - @changesets/config@1.2.0
  - @changesets/types@3.1.0

## 3.1.0

### Minor Changes

- [`6d0790a`](https://github.com/changesets/changesets/commit/6d0790a7aa9f00e350e9394f419e4b3c7ee7ca6a) [#359](https://github.com/changesets/changesets/pull/359) Thanks [@ajaymathur](https://github.com/ajaymathur)! - Add support for snapshot flag to version command. Usage: `changeset version --snapshot [tag]`. The updated version of the packages looks like `0.0.0[-tag]-YYYYMMDDHHMMSS` where YYYY, MM, DD, HH, MM, and SS is the date and time of when the snapshot version is created. You can use this feature with the tag option in the publish command to publish packages under experimental tags from feature branches. To publish a snapshot version of a package under an experimental tag you can do:

  ```
  # Version packages to snapshot version
  changeset version --snapshot
  # Publish packages under experimental tag, keeping next and latest tag clean
  changeset publish --tag experimental
  ```

## 3.0.3

### Patch Changes

- [`90f3b65`](https://github.com/changesets/changesets/commit/90f3b651f9c0403920b17801b84a2fbe6f190e2a) [#373](https://github.com/changesets/changesets/pull/373) Thanks [@Blasz](https://github.com/Blasz)! - Fix patch bumped dependencies not being updated in dependents package.json when leaving semver range with `updateInternalDependencies` set to minor.

## 3.0.2

### Patch Changes

- [`8fe77b6`](https://github.com/changesets/changesets/commit/8fe77b614b726b861900e69c015c8876f64ed04f) [#366](https://github.com/changesets/changesets/pull/366) Thanks [@Blasz](https://github.com/Blasz)! - Fix release version commit including dev dependent packages with release type 'none'

## 3.0.1

### Patch Changes

- [`52a88ce`](https://github.com/changesets/changesets/commit/52a88ce816692f6b18fa8f3f67d707b78b0b8210) [#361](https://github.com/changesets/changesets/pull/361) Thanks [@Blasz](https://github.com/Blasz)! - Fix dependency release lines being output when they were skipped via the updateInternalDependencies config option

## 3.0.0

### Major Changes

- [`2b49d66`](https://github.com/changesets/changesets/commit/2b49d668ecaa1333bc5c7c5be4648dda1b11528d) [#358](https://github.com/changesets/changesets/pull/358) Thanks [@Blasz](https://github.com/Blasz)! - Add new updateInternalDependencies config option to disable auto bumping of internal dependencies in the same release if the dependency was only patch bumped

### Patch Changes

- Updated dependencies [[`89f0c49`](https://github.com/changesets/changesets/commit/89f0c497ac21b8d008da67caff8032947836c7b1), [`2b49d66`](https://github.com/changesets/changesets/commit/2b49d668ecaa1333bc5c7c5be4648dda1b11528d), [`09f62f9`](https://github.com/changesets/changesets/commit/09f62f9c822f31899a48cbd93c7801d72a80b97e)]:
  - @changesets/git@1.0.5
  - @changesets/types@3.0.0
  - @changesets/config@1.1.0

## 2.0.2

### Patch Changes

- [`3dbab2e`](https://github.com/changesets/changesets/commit/3dbab2e80d9a8a0cccc02d74c6d8150f603219e6) [#343](https://github.com/changesets/changesets/pull/343) Thanks [@zkochan](https://github.com/zkochan)! - Self-references should be skipped when bumping versions. A self-reference is a dev dep that has the same name as the package. Some projects use self-references as a convenient way to require files using relative paths from the root directory.

## 2.0.1

### Patch Changes

- [`1706fb7`](https://github.com/changesets/changesets/commit/1706fb751ecc2f5a792c42f467b2063078d58716) [#321](https://github.com/changesets/changesets/pull/321) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Fix TypeScript declarations

- Updated dependencies [[`1706fb7`](https://github.com/changesets/changesets/commit/1706fb751ecc2f5a792c42f467b2063078d58716)]:
  - @changesets/config@1.0.3
  - @changesets/get-version-range-type@0.3.2
  - @changesets/git@1.0.3
  - @changesets/types@2.0.1

## 2.0.0

### Major Changes

- [`011d57f`](https://github.com/changesets/changesets/commit/011d57f1edf9e37f75a8bef4f918e72166af096e) [#313](https://github.com/changesets/changesets/pull/313) Thanks [@zkochan](https://github.com/zkochan)! - Bumping `devDependencies` no longer bumps the packages that they depend on.

  This is a pretty big "quality of life" update, which means we will do fewer releases of packages overall, as there is no change of installed packages.

  This has been made a breaking change as it changes the behavior of what will be published. It should only be for the better, but we didn't want to surprise you with it.

- [`011d57f`](https://github.com/changesets/changesets/commit/011d57f1edf9e37f75a8bef4f918e72166af096e) [#313](https://github.com/changesets/changesets/pull/313) Thanks [@zkochan](https://github.com/zkochan)! - Updates to devDependencies are not affecting the end users of a package. So we are not listing these changes in the changelog file.

### Minor Changes

- [`c3cc232`](https://github.com/changesets/changesets/commit/c3cc23204c6cb80487aced1b37ebe8ffde0e2111) [#311](https://github.com/changesets/changesets/pull/311) Thanks [@zkochan](https://github.com/zkochan)! - Added support for workspace ranges. They are now correctly kept and updated when applying a release plan.

### Patch Changes

- [`44555b4`](https://github.com/changesets/changesets/commit/44555b44cac843d973d31adbfc7703f45117d204) [#315](https://github.com/changesets/changesets/pull/315) Thanks [@maraisr](https://github.com/maraisr)! - Allows prettier to know about filepaths so it can apply file overrides

- Updated dependencies [[`011d57f`](https://github.com/changesets/changesets/commit/011d57f1edf9e37f75a8bef4f918e72166af096e)]:
  - @changesets/types@2.0.0
  - @changesets/config@1.0.2
  - @changesets/git@1.0.2

## 1.0.1

### Patch Changes

- [`04ddfd7`](https://github.com/changesets/changesets/commit/04ddfd7c3acbfb84ef9c92873fe7f9dea1f5145c) [#305](https://github.com/changesets/changesets/pull/305) Thanks [@Noviny](https://github.com/Noviny)! - Add link to changelog in readme

- [`b49e1cf`](https://github.com/changesets/changesets/commit/b49e1cff65dca7fe9e341a35aa91704aa0e51cb3) [#306](https://github.com/changesets/changesets/pull/306) Thanks [@Andarist](https://github.com/Andarist)! - Ignore `node_modules` when glob searching for packages. This fixes an issue with package cycles.

- Updated dependencies [[`04ddfd7`](https://github.com/changesets/changesets/commit/04ddfd7c3acbfb84ef9c92873fe7f9dea1f5145c), [`e56928b`](https://github.com/changesets/changesets/commit/e56928bbd6f9096def06ac37487bdbf28efec9d1), [`b49e1cf`](https://github.com/changesets/changesets/commit/b49e1cff65dca7fe9e341a35aa91704aa0e51cb3)]:
  - @changesets/config@1.0.1
  - @changesets/get-version-range-type@0.3.1
  - @changesets/git@1.0.1
  - @changesets/types@1.0.1

## 1.0.0

### Major Changes

- [`cc8c921`](https://github.com/changesets/changesets/commit/cc8c92143d4c4b7cca8b9917dfc830a40b5cda20) [#290](https://github.com/changesets/changesets/pull/290) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Accept `Packages` object from `@manypkg/get-packages` instead of `cwd`

### Patch Changes

- Updated dependencies [[`41e2e3d`](https://github.com/changesets/changesets/commit/41e2e3dd1053ff2f35a1a07e60793c9099f26997), [`cc8c921`](https://github.com/changesets/changesets/commit/cc8c92143d4c4b7cca8b9917dfc830a40b5cda20), [`cc8c921`](https://github.com/changesets/changesets/commit/cc8c92143d4c4b7cca8b9917dfc830a40b5cda20), [`cc8c921`](https://github.com/changesets/changesets/commit/cc8c92143d4c4b7cca8b9917dfc830a40b5cda20), [`2363366`](https://github.com/changesets/changesets/commit/2363366756d1b15bddf6d803911baccfca03cbdf), [`cc8c921`](https://github.com/changesets/changesets/commit/cc8c92143d4c4b7cca8b9917dfc830a40b5cda20)]:
  - @changesets/types@1.0.0
  - @changesets/git@1.0.0
  - @changesets/config@1.0.0

## 0.4.2

### Patch Changes

- Updated dependencies [[`d08c3b3`](https://github.com/changesets/changesets/commit/d08c3b309d38090ce4f1b8f62cc6b78a5a04efcf)]:
  - @changesets/get-version-range-type@0.3.0

## 0.4.1

### Patch Changes

- Updated dependencies [[`1282ef6`](https://github.com/changesets/changesets/commit/1282ef698761c1f634fb409842cc7de6b4d03da4)]:
  - @changesets/get-version-range-type@0.2.0

## 0.4.0

### Minor Changes

- [`fe0d9192`](https://github.com/changesets/changesets/commit/fe0d9192544646e1a755202b87dfe850c1c200a3) [#236](https://github.com/changesets/changesets/pull/236) Thanks [@Andarist](https://github.com/Andarist)! - Read also pnpm workspace packages when searching for packages.

### Patch Changes

- [`ef6402c9`](https://github.com/changesets/changesets/commit/ef6402c9d8dc1832126732dbbafb015b71f57f83) [#252](https://github.com/changesets/changesets/pull/252) Thanks [@Andarist](https://github.com/Andarist)! - Ensure there is a newline between release lines so the final markdown preserves correct formatting.

- [`503154db`](https://github.com/changesets/changesets/commit/503154db39fe8ab88a1176e4569c48078bcf5569) [#257](https://github.com/changesets/changesets/pull/257) Thanks [@Noviny](https://github.com/Noviny)! - Move catch statement so errors are less spammy

- Updated dependencies [[`fe0d9192`](https://github.com/changesets/changesets/commit/fe0d9192544646e1a755202b87dfe850c1c200a3), [`fe0d9192`](https://github.com/changesets/changesets/commit/fe0d9192544646e1a755202b87dfe850c1c200a3)]:
  - get-workspaces@0.6.0
  - @changesets/git@0.4.0

## 0.3.1

### Patch Changes

- Updated dependencies [[`bca8865`](https://github.com/changesets/changesets/commit/bca88652d38caa31e789c4564230ba0b49562ad2), [`bca8865`](https://github.com/changesets/changesets/commit/bca88652d38caa31e789c4564230ba0b49562ad2)]:
  - @changesets/config@0.3.0
  - @changesets/git@0.3.0

## 0.3.0

### Minor Changes

- [`8f0a1ef`](https://github.com/changesets/changesets/commit/8f0a1ef327563512f471677ef0ca99d30da009c0) [#183](https://github.com/changesets/changesets/pull/183) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Add support for prereleases. For more information, see [the docs on prereleases](https://github.com/changesets/changesets/blob/main/docs/prereleases.md).

### Patch Changes

- Updated dependencies [[`8f0a1ef`](https://github.com/changesets/changesets/commit/8f0a1ef327563512f471677ef0ca99d30da009c0)]:
  - @changesets/types@0.4.0
  - @changesets/config@0.2.3
  - get-workspaces@0.5.2
  - @changesets/git@0.2.4

## 0.2.3

### Patch Changes

- [`a679b1d`](https://github.com/changesets/changesets/commit/a679b1dcdcb56652d31536e2d6326ba02a9dfe62) [#204](https://github.com/changesets/changesets/pull/204) Thanks [@Andarist](https://github.com/Andarist)! - Correctly handle the 'access' flag for packages

  Previously, we had access as "public" or "private", access "private" isn't valid. This was a confusing because there are three states for publishing a package:

  - `private: true` - the package will not be published to npm (worked)
  - `access: public` - the package will be publicly published to npm (even if it uses a scope) (worked)
  - `access: restricted` - the package will be published to npm, but only visible/accessible by those who are part of the scope. This technically worked, but we were passing the wrong bit of information in.

  Now, we pass the correct access options `public` or `restricted`.

- [`da11ab8`](https://github.com/changesets/changesets/commit/da11ab8a4e4324a7023d12f990beec8c3b6ae35f) [#205](https://github.com/changesets/changesets/pull/205) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Don't update ranges set to \*/x/X when versioning

- Updated dependencies [[`5ababa0`](https://github.com/changesets/changesets/commit/5ababa08c8ea5ee3b4ff92253e2e752a5976cd27), [`a679b1d`](https://github.com/changesets/changesets/commit/a679b1dcdcb56652d31536e2d6326ba02a9dfe62)]:
  - @changesets/config@0.2.2
  - get-workspaces@0.5.1
  - @changesets/types@0.3.1

## 0.2.2

### Patch Changes

- [`72babcb`](https://github.com/changesets/changesets/commit/72babcbccbdd41618d9cb90b2a8871fe63643601) [#178](https://github.com/changesets/changesets/pull/178) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Fix changelog generator options not being provided

- Updated dependencies []:
  - @changesets/git@0.2.3

## 0.2.1

### Patch Changes

- [1ff73b7](https://github.com/changesets/changesets/commit/1ff73b74f414031e49c6fd5a0f68e9974900d381) [#156](https://github.com/changesets/changesets/pull/156) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Fix commits not being obtained for old changesets

- [8c43fa0](https://github.com/changesets/changesets/commit/8c43fa061e2a5a01e4f32504ed351d261761c8dc) [#155](https://github.com/changesets/changesets/pull/155) Thanks [@Noviny](https://github.com/Noviny)! - Add Readme

- [0320391](https://github.com/changesets/changesets/commit/0320391699a73621d0e51ce031062a06cbdefadc) [#163](https://github.com/changesets/changesets/pull/163) Thanks [@Noviny](https://github.com/Noviny)! - Reordered dependencies in the package json (this should have no impact)

- Updated dependencies [8c43fa0, 0320391, 1ff73b7]:
  - @changesets/get-version-range-type@0.1.1
  - @changesets/git@0.2.1
  - @changesets/types@0.3.0
  - @changesets/config@0.2.1

## 0.2.0

### Minor Changes

- [296a6731](https://github.com/changesets/changesets/commit/296a6731) - Safety bump: Towards the end of preparing changesets v2, there was a lot of chaos - this bump is to ensure every package on npm matches what is found in the repository.

### Patch Changes

- Updated dependencies [296a6731]:
  - @changesets/config@0.2.0
  - @changesets/get-version-range-type@0.1.0
  - get-workspaces@0.5.0
  - @changesets/git@0.2.0
  - @changesets/types@0.2.0

## 0.1.2

### Patch Changes

- [a15abbf9](https://github.com/changesets/changesets/commit/a15abbf9) - Previous release shipped unbuilt code - fixing that

## 0.1.0

### Minor Changes

- [fded7cce](https://github.com/changesets/changesets/commit/fded7cce) - Initial release


================================================
FILE: packages/apply-release-plan/README.md
================================================
# Apply Release Plan

[![npm package](https://img.shields.io/npm/v/@changesets/apply-release-plan)](https://npmjs.com/package/@changesets/apply-release-plan)
[![View changelog](https://img.shields.io/badge/Explore%20Changelog-brightgreen)](./CHANGELOG.md)

This takes a `releasePlan` object for changesets and applies the expected changes from that
release. This includes updating package versions, and updating changelogs.

```ts
import applyReleasePlan from "@changesets/apply-release-plan";
import { ReleasePlan, Config } from "@changesets/types";
import { Packages } from '@manypkg/get-packages'

await applyReleasePlan(
    // The release plan to be applied - see @changesets/types for information about its shape
    aReleasePlan: ReleasePlan,
    // The packages that applyReleasePlan should be run for from @manypkg/get-packages
    packages: Packages,
    // A valid @changesets/config config - see @changesets/types for information about its shape
    config: Config
);
```

Note that `apply-release-plan` does not validate the release plan's accuracy.

To generate a release plan from written changesets use `@changesets/get-release-plan`


================================================
FILE: packages/apply-release-plan/package.json
================================================
{
  "name": "@changesets/apply-release-plan",
  "version": "7.1.0",
  "description": "Takes a release plan and applies it to packages",
  "main": "dist/changesets-apply-release-plan.cjs.js",
  "module": "dist/changesets-apply-release-plan.esm.js",
  "exports": {
    ".": {
      "types": {
        "import": "./dist/changesets-apply-release-plan.cjs.mjs",
        "default": "./dist/changesets-apply-release-plan.cjs.js"
      },
      "module": "./dist/changesets-apply-release-plan.esm.js",
      "import": "./dist/changesets-apply-release-plan.cjs.mjs",
      "default": "./dist/changesets-apply-release-plan.cjs.js"
    },
    "./package.json": "./package.json"
  },
  "license": "MIT",
  "repository": "https://github.com/changesets/changesets/tree/main/packages/apply-release-plan",
  "dependencies": {
    "@changesets/config": "^3.1.3",
    "@changesets/get-version-range-type": "^0.4.0",
    "@changesets/git": "^3.0.4",
    "@changesets/should-skip-package": "^0.1.2",
    "@changesets/types": "^6.1.0",
    "@manypkg/get-packages": "^1.1.3",
    "detect-indent": "^6.0.0",
    "fs-extra": "^7.0.1",
    "lodash.startcase": "^4.4.0",
    "outdent": "^0.5.0",
    "prettier": "^2.7.1",
    "resolve-from": "^5.0.0",
    "semver": "^7.5.3"
  },
  "devDependencies": {
    "@changesets/test-utils": "*",
    "spawndamnit": "^3.0.1"
  }
}


================================================
FILE: packages/apply-release-plan/src/get-changelog-entry.ts
================================================
import { ChangelogFunctions, NewChangesetWithCommit } from "@changesets/types";

import { ModCompWithPackage } from "@changesets/types";
import startCase from "lodash.startcase";
import { shouldUpdateDependencyBasedOnConfig } from "./utils";
import validRange from "semver/ranges/valid";

type ChangelogLines = {
  major: Array<Promise<string>>;
  minor: Array<Promise<string>>;
  patch: Array<Promise<string>>;
};

async function generateChangesForVersionTypeMarkdown(
  obj: ChangelogLines,
  type: keyof ChangelogLines
) {
  let releaseLines = await Promise.all(obj[type]);
  releaseLines = releaseLines.filter((x) => x);
  if (releaseLines.length) {
    return `### ${startCase(type)} Changes\n\n${releaseLines.join("\n")}\n`;
  }
}

// release is the package and version we are releasing
export default async function getChangelogEntry(
  release: ModCompWithPackage,
  releases: ModCompWithPackage[],
  changesets: NewChangesetWithCommit[],
  changelogFuncs: ChangelogFunctions,
  changelogOpts: any,
  {
    updateInternalDependencies,
    onlyUpdatePeerDependentsWhenOutOfRange,
  }: {
    updateInternalDependencies: "patch" | "minor";
    onlyUpdatePeerDependentsWhenOutOfRange: boolean;
  }
) {
  if (release.type === "none") return null;

  const changelogLines: ChangelogLines = {
    major: [],
    minor: [],
    patch: [],
  };

  // I sort of feel we can do better, as ComprehensiveReleases have an array
  // of the relevant changesets but since we need the version type for the
  // release in the changeset, I don't know if we can
  // We can filter here, but that just adds another iteration over this list
  changesets.forEach((cs) => {
    const rls = cs.releases.find((r) => r.name === release.name);
    if (rls && rls.type !== "none") {
      changelogLines[rls.type].push(
        changelogFuncs.getReleaseLine(cs, rls.type, changelogOpts)
      );
    }
  });
  let dependentReleases = releases.filter((rel) => {
    const dependencyVersionRange = release.packageJson.dependencies?.[rel.name];
    const peerDependencyVersionRange =
      release.packageJson.peerDependencies?.[rel.name];

    const versionRange = dependencyVersionRange || peerDependencyVersionRange;
    const usesWorkspaceRange = versionRange?.startsWith("workspace:");
    return (
      versionRange &&
      (usesWorkspaceRange || validRange(versionRange) !== null) &&
      shouldUpdateDependencyBasedOnConfig(
        { type: rel.type, version: rel.newVersion },
        {
          depVersionRange: versionRange,
          depType: dependencyVersionRange ? "dependencies" : "peerDependencies",
        },
        {
          minReleaseType: updateInternalDependencies,
          onlyUpdatePeerDependentsWhenOutOfRange,
        }
      )
    );
  });

  let relevantChangesetIds: Set<string> = new Set();

  dependentReleases.forEach((rel) => {
    rel.changesets.forEach((cs) => {
      relevantChangesetIds.add(cs);
    });
  });

  let relevantChangesets = changesets.filter((cs) =>
    relevantChangesetIds.has(cs.id)
  );

  changelogLines.patch.push(
    changelogFuncs.getDependencyReleaseLine(
      relevantChangesets,
      dependentReleases,
      changelogOpts
    )
  );

  return [
    `## ${release.newVersion}`,
    await generateChangesForVersionTypeMarkdown(changelogLines, "major"),
    await generateChangesForVersionTypeMarkdown(changelogLines, "minor"),
    await generateChangesForVersionTypeMarkdown(changelogLines, "patch"),
  ]
    .filter((line) => line)
    .join("\n");
}


================================================
FILE: packages/apply-release-plan/src/index.test.ts
================================================
import {
  ReleasePlan,
  Config,
  NewChangeset,
  ComprehensiveRelease,
  PreState,
} from "@changesets/types";
import * as git from "@changesets/git";
import fs from "fs-extra";
import path from "path";
import outdent from "outdent";
import spawn from "spawndamnit";
import { defaultConfig } from "@changesets/config";

import applyReleasePlan from "./";
import { getPackages } from "@manypkg/get-packages";
import {
  temporarilySilenceLogs,
  testdir,
  Fixture,
} from "@changesets/test-utils";

class FakeReleasePlan {
  changesets: NewChangeset[];
  releases: ComprehensiveRelease[];
  config: Config;

  constructor(
    changesets: NewChangeset[] = [],
    releases: ComprehensiveRelease[] = [],
    config: Partial<Config> = {}
  ) {
    const baseChangeset: NewChangeset = {
      id: "quick-lions-devour",
      summary: "Hey, let's have fun with testing!",
      releases: [{ name: "pkg-a", type: "minor" }],
    };
    const baseRelease: ComprehensiveRelease = {
      name: "pkg-a",
      type: "minor",
      oldVersion: "1.0.0",
      newVersion: "1.1.0",
      changesets: ["quick-lions-devour"],
    };
    this.config = {
      changelog: false,
      commit: false,
      fixed: [],
      linked: [],
      access: "restricted",
      changedFilePatterns: ["**"],
      baseBranch: "main",
      updateInternalDependencies: "patch",
      ignore: [],
      prettier: true,
      privatePackages: { version: true, tag: false },
      ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
        onlyUpdatePeerDependentsWhenOutOfRange: false,
        updateInternalDependents: "out-of-range",
      },
      snapshot: {
        useCalculatedVersion: false,
        prereleaseTemplate: null,
      },
      ...config,
    };

    this.changesets = [baseChangeset, ...changesets];
    this.releases = [baseRelease, ...releases];
  }

  getReleasePlan(): ReleasePlan {
    return {
      changesets: this.changesets,
      releases: this.releases,
      preState: undefined,
    };
  }
}

async function testSetup(
  fixture: Fixture,
  releasePlan: ReleasePlan,
  config?: Config,
  snapshot?: string | undefined,
  setupFunc?: (tempDir: string) => Promise<unknown>
) {
  if (!config) {
    config = {
      changelog: false,
      commit: false,
      fixed: [],
      linked: [],
      access: "restricted",
      changedFilePatterns: ["**"],
      baseBranch: "main",
      updateInternalDependencies: "patch",
      ignore: [],
      prettier: true,
      privatePackages: { version: true, tag: false },
      snapshot: {
        useCalculatedVersion: false,
        prereleaseTemplate: null,
      },
      ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
        onlyUpdatePeerDependentsWhenOutOfRange: false,
        updateInternalDependents: "out-of-range",
      },
    };
  }
  let tempDir = await testdir(fixture);

  if (setupFunc) {
    await setupFunc(tempDir);
  }

  if (config.commit) {
    await spawn("git", ["init"], { cwd: tempDir });
    await git.add(".", tempDir);
    await git.commit("first commit", tempDir);
  }

  return {
    changedFiles: await applyReleasePlan(
      releasePlan,
      await getPackages(tempDir),
      config,
      snapshot
    ),
    tempDir,
  };
}

describe("apply release plan", () => {
  describe("versioning", () => {
    describe("formatting", () => {
      it("should not reformat a small array in a package.json", async () => {
        const releasePlan = new FakeReleasePlan();
        let { changedFiles } = await testSetup(
          {
            "package.json": `{
  "name": "pkg-a",
  "version": "1.0.0",
  "files": [
    "lib"
  ]
}`,
          },
          releasePlan.getReleasePlan(),
          releasePlan.config
        );
        let pkgPath = changedFiles.find((a) => a.endsWith(`package.json`));

        if (!pkgPath) throw new Error(`could not find an updated package json`);
        let pkgJSON = await fs.readFile(pkgPath, { encoding: "utf-8" });

        expect(pkgJSON).toStrictEqual(`{
  "name": "pkg-a",
  "version": "1.1.0",
  "files": [
    "lib"
  ]
}`);
      });
      it("should not change tab indentation in a package.json", async () => {
        const releasePlan = new FakeReleasePlan();
        let { changedFiles } = await testSetup(
          {
            "package.json": JSON.stringify(
              {
                name: "pkg-a",
                version: "1.0.0",
              },
              null,
              "\t"
            ),
          },
          releasePlan.getReleasePlan(),
          releasePlan.config
        );
        let pkgPath = changedFiles.find((a) => a.endsWith(`package.json`));

        if (!pkgPath) throw new Error(`could not find an updated package json`);
        let pkgJSON = await fs.readFile(pkgPath, { encoding: "utf-8" });

        expect(pkgJSON).toStrictEqual(`{
\t"name": "pkg-a",
\t"version": "1.1.0"
}`);
      });
      it("should not add trailing newlines in a package.json if they don't exist", async () => {
        const releasePlan = new FakeReleasePlan();
        let { changedFiles } = await testSetup(
          {
            "package.json": JSON.stringify({
              name: "pkg-a",
              version: "1.0.0",
            }),
          },
          releasePlan.getReleasePlan(),
          releasePlan.config
        );
        let pkgPath = changedFiles.find((a) => a.endsWith(`package.json`));

        if (!pkgPath) throw new Error(`could not find an updated package json`);
        let pkgJSON = await fs.readFile(pkgPath, { encoding: "utf-8" });

        expect(pkgJSON).toStrictEqual(`{
  "name": "pkg-a",
  "version": "1.1.0"
}`);
      });
      it("should not remove trailing newlines in a package.json if they exist", async () => {
        const releasePlan = new FakeReleasePlan();
        let { changedFiles } = await testSetup(
          {
            "package.json":
              JSON.stringify({
                name: "pkg-a",
                version: "1.0.0",
              }) + "\n",
          },
          releasePlan.getReleasePlan(),
          releasePlan.config
        );
        let pkgPath = changedFiles.find((a) => a.endsWith(`package.json`));

        if (!pkgPath) throw new Error(`could not find an updated package json`);
        let pkgJSON = await fs.readFile(pkgPath, { encoding: "utf-8" });

        expect(pkgJSON).toStrictEqual(`{
  "name": "pkg-a",
  "version": "1.1.0"
}\n`);
      });
    });

    it("should update a version for one package", async () => {
      const releasePlan = new FakeReleasePlan();
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
          }),
        },
        releasePlan.getReleasePlan(),
        releasePlan.config
      );
      let pkgPath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}package.json`)
      );

      if (!pkgPath) throw new Error(`could not find an updated package json`);
      let pkgJSON = await fs.readJSON(pkgPath);

      expect(pkgJSON).toMatchObject({
        name: "pkg-a",
        version: "1.1.0",
      });
    });

    it("should not update ranges set to *", async () => {
      const releasePlan = new FakeReleasePlan(
        [
          {
            id: "some-id",
            releases: [{ name: "pkg-b", type: "minor" }],
            summary: "a very useful summary",
          },
        ],
        [
          {
            changesets: ["some-id"],
            name: "pkg-b",
            newVersion: "1.1.0",
            oldVersion: "1.0.0",
            type: "minor",
          },
        ]
      );
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            dependencies: {
              "pkg-b": "*",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
        },
        releasePlan.getReleasePlan(),
        releasePlan.config
      );
      let pkgPath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}package.json`)
      );

      if (!pkgPath) throw new Error(`could not find an updated package json`);
      let pkgJSON = await fs.readJSON(pkgPath);

      expect(pkgJSON).toEqual({
        name: "pkg-a",
        version: "1.1.0",
        dependencies: {
          "pkg-b": "*",
        },
      });
    });

    it("should update workspace ranges", async () => {
      const releasePlan = new FakeReleasePlan(
        [
          {
            id: "some-id",
            releases: [{ name: "pkg-b", type: "minor" }],
            summary: "a very useful summary",
          },
        ],
        [
          {
            changesets: ["some-id"],
            name: "pkg-b",
            newVersion: "1.1.0",
            oldVersion: "1.0.0",
            type: "minor",
          },
        ]
      );
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            dependencies: {
              "pkg-b": "workspace:1.0.0",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
        },
        releasePlan.getReleasePlan(),
        releasePlan.config
      );
      let pkgPath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}package.json`)
      );

      if (!pkgPath) throw new Error(`could not find an updated package json`);
      let pkgJSON = await fs.readJSON(pkgPath);

      expect(pkgJSON).toEqual({
        name: "pkg-a",
        version: "1.1.0",
        dependencies: {
          "pkg-b": "workspace:1.1.0",
        },
      });
    });

    it("should not update workspace version aliases", async () => {
      const releasePlan = new FakeReleasePlan(
        [
          {
            id: "some-id",
            releases: [{ name: "pkg-b", type: "minor" }],
            summary: "a very useful summary",
          },
          {
            id: "some-id",
            releases: [{ name: "pkg-c", type: "minor" }],
            summary: "a very useful summary",
          },
          {
            id: "some-id",
            releases: [{ name: "pkg-d", type: "minor" }],
            summary: "a very useful summary",
          },
        ],
        [
          {
            changesets: ["some-id"],
            name: "pkg-b",
            newVersion: "1.1.0",
            oldVersion: "1.0.0",
            type: "minor",
          },
          {
            changesets: ["some-id"],
            name: "pkg-c",
            newVersion: "1.1.0",
            oldVersion: "1.0.0",
            type: "minor",
          },
          {
            changesets: ["some-id"],
            name: "pkg-d",
            newVersion: "1.1.0",
            oldVersion: "1.0.0",
            type: "minor",
          },
        ]
      );
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            dependencies: {
              "pkg-b": "workspace:*",
              "pkg-c": "workspace:^",
              "pkg-d": "workspace:~",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
          "packages/pkg-c/package.json": JSON.stringify({
            name: "pkg-c",
            version: "1.0.0",
          }),
          "packages/pkg-d/package.json": JSON.stringify({
            name: "pkg-d",
            version: "1.0.0",
          }),
        },
        releasePlan.getReleasePlan(),
        releasePlan.config
      );
      let pkgPath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}package.json`)
      );

      if (!pkgPath) throw new Error(`could not find an updated package json`);
      let pkgJSON = await fs.readJSON(pkgPath);

      expect(pkgJSON).toEqual({
        name: "pkg-a",
        version: "1.1.0",
        dependencies: {
          "pkg-b": "workspace:*",
          "pkg-c": "workspace:^",
          "pkg-d": "workspace:~",
        },
      });
    });

    it("should update workspace ranges only with bumpVersionsWithWorkspaceProtocolOnly", async () => {
      const releasePlan = new FakeReleasePlan(
        [
          {
            id: "some-id",
            releases: [
              { name: "pkg-b", type: "minor" },
              { name: "pkg-c", type: "minor" },
            ],
            summary: "a very useful summary",
          },
        ],
        [
          {
            changesets: ["some-id"],
            name: "pkg-b",
            newVersion: "1.1.0",
            oldVersion: "1.0.0",
            type: "minor",
          },
          {
            changesets: ["some-id"],
            name: "pkg-c",
            newVersion: "1.1.0",
            oldVersion: "1.0.0",
            type: "minor",
          },
        ],
        {
          bumpVersionsWithWorkspaceProtocolOnly: true,
        }
      );
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            dependencies: {
              "pkg-b": "workspace:1.0.0",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
          "packages/pkg-c/package.json": JSON.stringify({
            name: "pkg-c",
            version: "1.0.0",
            dependencies: {
              "pkg-b": "1.0.0",
            },
          }),
        },
        releasePlan.getReleasePlan(),
        releasePlan.config
      );
      let pkgAPath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}package.json`)
      );

      if (!pkgAPath) throw new Error(`could not find an updated package json`);
      let pkgAJSON = await fs.readJSON(pkgAPath);

      expect(pkgAJSON).toEqual({
        name: "pkg-a",
        version: "1.1.0",
        dependencies: {
          "pkg-b": "workspace:1.1.0",
        },
      });

      let pkgCPath = changedFiles.find((a) =>
        a.endsWith(`pkg-c${path.sep}package.json`)
      );

      if (!pkgCPath) throw new Error(`could not find an updated package json`);
      let pkgCJSON = await fs.readJSON(pkgCPath);

      expect(pkgCJSON).toEqual({
        name: "pkg-c",
        version: "1.1.0",
        dependencies: {
          "pkg-b": "1.0.0",
        },
      });
    });

    it("should update a version for two packages with different new versions", async () => {
      const releasePlan = new FakeReleasePlan(
        [],
        [
          {
            name: "pkg-b",
            type: "major",
            oldVersion: "1.0.0",
            newVersion: "2.0.0",
            changesets: [],
          },
        ]
      );

      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            dependencies: {
              "pkg-b": "1.0.0",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
        },
        releasePlan.getReleasePlan(),
        releasePlan.config
      );
      let pkgPathA = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}package.json`)
      );
      let pkgPathB = changedFiles.find((b) =>
        b.endsWith(`pkg-b${path.sep}package.json`)
      );

      if (!pkgPathA || !pkgPathB) {
        throw new Error(`could not find an updated package json`);
      }
      let pkgJSONA = await fs.readJSON(pkgPathA);
      let pkgJSONB = await fs.readJSON(pkgPathB);

      expect(pkgJSONA).toMatchObject({
        name: "pkg-a",
        version: "1.1.0",
      });
      expect(pkgJSONB).toMatchObject({
        name: "pkg-b",
        version: "2.0.0",
      });
    });

    it("should not update the version of the dependent package if the released dep is a dev dep", async () => {
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            devDependencies: {
              "pkg-b": "1.0.0",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
        },
        {
          changesets: [
            {
              id: "quick-lions-devour",
              summary: "Hey, let's have fun with testing!",
              releases: [
                { name: "pkg-a", type: "none" },
                { name: "pkg-b", type: "minor" },
              ],
            },
          ],
          releases: [
            {
              name: "pkg-a",
              type: "none",
              oldVersion: "1.0.0",
              newVersion: "1.0.0",
              changesets: ["quick-lions-devour"],
            },
            {
              name: "pkg-b",
              type: "minor",
              oldVersion: "1.0.0",
              newVersion: "1.1.0",
              changesets: ["quick-lions-devour"],
            },
          ],
          preState: undefined,
        },
        {
          changelog: false,
          commit: false,
          fixed: [],
          linked: [],
          access: "restricted",
          baseBranch: "main",
          changedFilePatterns: ["**"],
          updateInternalDependencies: "patch",
          prettier: true,
          privatePackages: { version: true, tag: false },
          ignore: [],
          ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
            onlyUpdatePeerDependentsWhenOutOfRange: false,
            updateInternalDependents: "out-of-range",
          },
          snapshot: {
            useCalculatedVersion: false,
            prereleaseTemplate: null,
          },
        }
      );
      let pkgPathA = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}package.json`)
      );
      let pkgPathB = changedFiles.find((b) =>
        b.endsWith(`pkg-b${path.sep}package.json`)
      );

      if (!pkgPathA || !pkgPathB) {
        throw new Error(`could not find an updated package json`);
      }
      let pkgJSONA = await fs.readJSON(pkgPathA);
      let pkgJSONB = await fs.readJSON(pkgPathB);

      expect(pkgJSONA).toMatchObject({
        name: "pkg-a",
        version: "1.0.0",
        devDependencies: {
          "pkg-b": "1.1.0",
        },
      });
      expect(pkgJSONB).toMatchObject({
        name: "pkg-b",
        version: "1.1.0",
      });
    });

    it("should skip dependencies that have the same name as the package", async () => {
      let { tempDir } = await testSetup(
        {
          "package.json": JSON.stringify({
            name: "self-referenced",
            version: "1.0.0",
            devDependencies: {
              "self-referenced": "file:",
            },
          }),
        },
        {
          changesets: [
            {
              id: "quick-lions-devour",
              summary: "Hey, let's have fun with testing!",
              releases: [{ name: "self-referenced", type: "minor" }],
            },
          ],
          releases: [
            {
              name: "self-referenced",
              type: "minor",
              oldVersion: "1.0.0",
              newVersion: "1.1.0",
              changesets: ["quick-lions-devour"],
            },
          ],
          preState: undefined,
        },
        {
          changelog: false,
          commit: false,
          fixed: [],
          linked: [],
          access: "restricted",
          baseBranch: "main",
          changedFilePatterns: ["**"],
          updateInternalDependencies: "patch",
          prettier: true,
          privatePackages: { version: true, tag: false },
          ignore: [],
          ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
            onlyUpdatePeerDependentsWhenOutOfRange: false,
            updateInternalDependents: "out-of-range",
          },
          snapshot: {
            useCalculatedVersion: false,
            prereleaseTemplate: null,
          },
        }
      );

      let pkgJSON = await fs.readJSON(path.join(tempDir, "package.json"));

      expect(pkgJSON).toMatchObject({
        name: "self-referenced",
        version: "1.1.0",
        devDependencies: {
          "self-referenced": "file:",
        },
      });
    });

    it("should not update dependent versions when a package has a changeset type of none", async () => {
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            dependencies: {
              "pkg-b": "^1.0.0",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
        },
        {
          changesets: [
            {
              id: "quick-lions-devour",
              summary: "Hey, let's have fun with testing!",
              releases: [{ name: "pkg-b", type: "none" }],
            },
          ],
          releases: [
            {
              name: "pkg-b",
              type: "none",
              oldVersion: "1.0.0",
              newVersion: "1.0.0",
              changesets: ["quick-lions-devour"],
            },
          ],
          preState: undefined,
        },
        { ...defaultConfig, changelog: false }
      );
      let pkgPathA = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}package.json`)
      );
      let pkgPathB = changedFiles.find((b) =>
        b.endsWith(`pkg-b${path.sep}package.json`)
      );

      expect(pkgPathA).toBeUndefined();
      if (!pkgPathB) throw new Error(`could not find an updated package json`);

      let pkgJSONB = await fs.readJSON(pkgPathB);

      expect(pkgJSONB).toMatchObject({
        name: "pkg-b",
        version: "1.0.0",
      });
    });

    it("should not update workspace dependent versions when a package has a changeset type of none", async () => {
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            dependencies: {
              "pkg-b": "workspace:1.0.0",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
        },
        {
          changesets: [
            {
              id: "quick-lions-devour",
              summary: "Hey, let's have fun with testing!",
              releases: [{ name: "pkg-b", type: "none" }],
            },
          ],
          releases: [
            {
              name: "pkg-b",
              type: "none",
              oldVersion: "1.0.0",
              newVersion: "1.0.0",
              changesets: ["quick-lions-devour"],
            },
          ],
          preState: undefined,
        },
        { ...defaultConfig, changelog: false }
      );
      let pkgPathA = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}package.json`)
      );
      let pkgPathB = changedFiles.find((b) =>
        b.endsWith(`pkg-b${path.sep}package.json`)
      );

      expect(pkgPathA).toBeUndefined();
      if (!pkgPathB) throw new Error(`could not find an updated package json`);

      let pkgJSONB = await fs.readJSON(pkgPathB);

      expect(pkgJSONB).toMatchObject({
        name: "pkg-b",
        version: "1.0.0",
      });
    });

    it("should use exact versioning when snapshot release is applied, and ignore any range modifiers", async () => {
      const releasePlan = new FakeReleasePlan(
        [
          {
            id: "some-id",
            releases: [{ name: "pkg-b", type: "minor" }],
            summary: "a very useful summary",
          },
        ],
        [
          {
            changesets: ["some-id"],
            name: "pkg-b",
            newVersion: "1.1.0",
            oldVersion: "1.0.0",
            type: "minor",
          },
        ]
      );
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            dependencies: {
              "pkg-b": "^1.0.0",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
        },
        releasePlan.getReleasePlan(),
        releasePlan.config,
        "canary"
      );

      let pkgPath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}package.json`)
      );

      if (!pkgPath) throw new Error(`could not find an updated package json`);
      let pkgJSON = await fs.readJSON(pkgPath);

      expect(pkgJSON).toMatchObject({
        name: "pkg-a",
        version: "1.1.0",
        dependencies: {
          "pkg-b": "1.1.0",
        },
      });
    });

    describe("internal dependency bumping", () => {
      describe("updateInternalDependencies set to patch", () => {
        const updateInternalDependencies = "patch";
        it("should update min version ranges of patch bumped internal dependencies", async () => {
          let { changedFiles } = await testSetup(
            {
              "package.json": JSON.stringify({
                private: true,
                workspaces: ["packages/*"],
              }),
              "packages/pkg-a/package.json": JSON.stringify({
                name: "pkg-a",
                version: "1.0.3",
                dependencies: {
                  "pkg-b": "~1.2.0",
                },
              }),
              "packages/pkg-b/package.json": JSON.stringify({
                name: "pkg-b",
                version: "1.2.0",
                dependencies: {
                  "pkg-a": "^1.0.3",
                },
              }),
            },
            {
              changesets: [
                {
                  id: "quick-lions-devour",
                  summary: "Hey, let's have fun with testing!",
                  releases: [
                    { name: "pkg-a", type: "patch" },
                    { name: "pkg-b", type: "patch" },
                  ],
                },
              ],
              releases: [
                {
                  name: "pkg-a",
                  type: "patch",
                  oldVersion: "1.0.3",
                  newVersion: "1.0.4",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-b",
                  type: "patch",
                  oldVersion: "1.2.0",
                  newVersion: "1.2.1",
                  changesets: ["quick-lions-devour"],
                },
              ],
              preState: undefined,
            },
            {
              changelog: false,
              commit: false,
              fixed: [],
              linked: [],
              access: "restricted",
              changedFilePatterns: ["**"],
              baseBranch: "main",
              updateInternalDependencies,
              ignore: [],
              prettier: true,
              privatePackages: { version: true, tag: false },
              ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
                onlyUpdatePeerDependentsWhenOutOfRange: false,
                updateInternalDependents: "out-of-range",
              },
              snapshot: {
                useCalculatedVersion: false,
                prereleaseTemplate: null,
              },
            }
          );
          let pkgPathA = changedFiles.find((a) =>
            a.endsWith(`pkg-a${path.sep}package.json`)
          );
          let pkgPathB = changedFiles.find((b) =>
            b.endsWith(`pkg-b${path.sep}package.json`)
          );

          if (!pkgPathA || !pkgPathB) {
            throw new Error(`could not find an updated package json`);
          }
          let pkgJSONA = await fs.readJSON(pkgPathA);
          let pkgJSONB = await fs.readJSON(pkgPathB);

          expect(pkgJSONA).toMatchObject({
            name: "pkg-a",
            version: "1.0.4",
            dependencies: {
              "pkg-b": "~1.2.1",
            },
          });
          expect(pkgJSONB).toMatchObject({
            name: "pkg-b",
            version: "1.2.1",
            dependencies: {
              "pkg-a": "^1.0.4",
            },
          });
        });
        it("should still update min version ranges of patch bumped internal dependencies that have left semver range", async () => {
          let { changedFiles } = await testSetup(
            {
              "package.json": JSON.stringify({
                private: true,
                workspaces: ["packages/*"],
              }),
              "packages/pkg-a/package.json": JSON.stringify({
                name: "pkg-a",
                version: "1.0.3",
                dependencies: {
                  "pkg-b": "~1.2.0",
                },
              }),
              "packages/pkg-b/package.json": JSON.stringify({
                name: "pkg-b",
                version: "1.2.0",
                dependencies: {
                  "pkg-c": "2.0.0",
                  "pkg-a": "^1.0.3",
                },
              }),
              "packages/pkg-c/package.json": JSON.stringify({
                name: "pkg-c",
                version: "2.0.0",
                dependencies: {
                  "pkg-a": "^1.0.3",
                },
              }),
            },
            {
              changesets: [
                {
                  id: "quick-lions-devour",
                  summary: "Hey, let's have fun with testing!",
                  releases: [
                    { name: "pkg-a", type: "patch" },
                    { name: "pkg-b", type: "patch" },
                    { name: "pkg-c", type: "patch" },
                  ],
                },
              ],
              releases: [
                {
                  name: "pkg-a",
                  type: "patch",
                  oldVersion: "1.0.3",
                  newVersion: "1.0.4",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-b",
                  type: "none",
                  oldVersion: "1.2.0",
                  newVersion: "1.2.0",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-c",
                  type: "patch",
                  oldVersion: "2.0.0",
                  newVersion: "2.0.1",
                  changesets: ["quick-lions-devour"],
                },
              ],
              preState: undefined,
            },
            {
              changelog: false,
              commit: false,
              fixed: [],
              linked: [],
              access: "restricted",
              changedFilePatterns: ["**"],
              baseBranch: "main",
              updateInternalDependencies,
              ignore: [],
              prettier: true,
              privatePackages: { version: true, tag: false },
              ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
                onlyUpdatePeerDependentsWhenOutOfRange: false,
                updateInternalDependents: "out-of-range",
              },
              snapshot: {
                useCalculatedVersion: false,
                prereleaseTemplate: null,
              },
            }
          );
          let pkgPathA = changedFiles.find((a) =>
            a.endsWith(`pkg-a${path.sep}package.json`)
          );
          let pkgPathB = changedFiles.find((b) =>
            b.endsWith(`pkg-b${path.sep}package.json`)
          );

          if (!pkgPathA || !pkgPathB) {
            throw new Error(`could not find an updated package json`);
          }
          let pkgJSONA = await fs.readJSON(pkgPathA);
          let pkgJSONB = await fs.readJSON(pkgPathB);

          expect(pkgJSONA).toMatchObject({
            name: "pkg-a",
            version: "1.0.4",
            dependencies: {
              "pkg-b": "~1.2.0",
            },
          });
          expect(pkgJSONB).toMatchObject({
            name: "pkg-b",
            version: "1.2.0",
            dependencies: {
              "pkg-c": "2.0.1",
              "pkg-a": "^1.0.4",
            },
          });
        });
        it("should update min version ranges of minor bumped internal dependencies", async () => {
          let { changedFiles } = await testSetup(
            {
              "package.json": JSON.stringify({
                private: true,
                workspaces: ["packages/*"],
              }),
              "packages/pkg-a/package.json": JSON.stringify({
                name: "pkg-a",
                version: "1.0.3",
                dependencies: {
                  "pkg-b": "~1.2.0",
                },
              }),
              "packages/pkg-b/package.json": JSON.stringify({
                name: "pkg-b",
                version: "1.2.0",
                dependencies: {
                  "pkg-a": "^1.0.3",
                },
              }),
            },
            {
              changesets: [
                {
                  id: "quick-lions-devour",
                  summary: "Hey, let's have fun with testing!",
                  releases: [
                    { name: "pkg-a", type: "minor" },
                    { name: "pkg-b", type: "patch" },
                  ],
                },
              ],
              releases: [
                {
                  name: "pkg-a",
                  type: "minor",
                  oldVersion: "1.0.3",
                  newVersion: "1.1.0",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-b",
                  type: "patch",
                  oldVersion: "1.2.0",
                  newVersion: "1.2.1",
                  changesets: ["quick-lions-devour"],
                },
              ],
              preState: undefined,
            },
            {
              changelog: false,
              commit: false,
              fixed: [],
              linked: [],
              access: "restricted",
              changedFilePatterns: ["**"],
              baseBranch: "main",
              updateInternalDependencies,
              ignore: [],
              prettier: true,
              privatePackages: { version: true, tag: false },
              ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
                onlyUpdatePeerDependentsWhenOutOfRange: false,
                updateInternalDependents: "out-of-range",
              },
              snapshot: {
                useCalculatedVersion: false,
                prereleaseTemplate: null,
              },
            }
          );
          let pkgPathA = changedFiles.find((a) =>
            a.endsWith(`pkg-a${path.sep}package.json`)
          );
          let pkgPathB = changedFiles.find((b) =>
            b.endsWith(`pkg-b${path.sep}package.json`)
          );

          if (!pkgPathA || !pkgPathB) {
            throw new Error(`could not find an updated package json`);
          }
          let pkgJSONA = await fs.readJSON(pkgPathA);
          let pkgJSONB = await fs.readJSON(pkgPathB);

          expect(pkgJSONA).toMatchObject({
            name: "pkg-a",
            version: "1.1.0",
            dependencies: {
              "pkg-b": "~1.2.1",
            },
          });
          expect(pkgJSONB).toMatchObject({
            name: "pkg-b",
            version: "1.2.1",
            dependencies: {
              "pkg-a": "^1.1.0",
            },
          });
        });
        it("should update min version ranges of major bumped internal dependencies", async () => {
          let { changedFiles } = await testSetup(
            {
              "package.json": JSON.stringify({
                private: true,
                workspaces: ["packages/*"],
              }),
              "packages/pkg-a/package.json": JSON.stringify({
                name: "pkg-a",
                version: "1.0.3",
                dependencies: {
                  "pkg-b": "~1.2.0",
                },
              }),
              "packages/pkg-b/package.json": JSON.stringify({
                name: "pkg-b",
                version: "1.2.0",
                dependencies: {
                  "pkg-a": "^1.0.3",
                },
              }),
            },
            {
              changesets: [
                {
                  id: "quick-lions-devour",
                  summary: "Hey, let's have fun with testing!",
                  releases: [
                    { name: "pkg-a", type: "major" },
                    { name: "pkg-b", type: "patch" },
                  ],
                },
              ],
              releases: [
                {
                  name: "pkg-a",
                  type: "major",
                  oldVersion: "1.0.3",
                  newVersion: "2.0.0",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-b",
                  type: "patch",
                  oldVersion: "1.2.0",
                  newVersion: "1.2.1",
                  changesets: ["quick-lions-devour"],
                },
              ],
              preState: undefined,
            },
            {
              changelog: false,
              commit: false,
              fixed: [],
              linked: [],
              access: "restricted",
              changedFilePatterns: ["**"],
              baseBranch: "main",
              updateInternalDependencies,
              ignore: [],
              prettier: true,
              privatePackages: { version: true, tag: false },
              ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
                onlyUpdatePeerDependentsWhenOutOfRange: false,
                updateInternalDependents: "out-of-range",
              },
              snapshot: {
                useCalculatedVersion: false,
                prereleaseTemplate: null,
              },
            }
          );
          let pkgPathA = changedFiles.find((a) =>
            a.endsWith(`pkg-a${path.sep}package.json`)
          );
          let pkgPathB = changedFiles.find((b) =>
            b.endsWith(`pkg-b${path.sep}package.json`)
          );

          if (!pkgPathA || !pkgPathB) {
            throw new Error(`could not find an updated package json`);
          }
          let pkgJSONA = await fs.readJSON(pkgPathA);
          let pkgJSONB = await fs.readJSON(pkgPathB);

          expect(pkgJSONA).toMatchObject({
            name: "pkg-a",
            version: "2.0.0",
            dependencies: {
              "pkg-b": "~1.2.1",
            },
          });
          expect(pkgJSONB).toMatchObject({
            name: "pkg-b",
            version: "1.2.1",
            dependencies: {
              "pkg-a": "^2.0.0",
            },
          });
        });
        it("should not update dependant's dependency range when it depends on a tag of a bumped dependency", async () => {
          let { changedFiles } = await testSetup(
            {
              "package.json": JSON.stringify({
                private: true,
                workspaces: ["packages/*"],
              }),
              "packages/pkg-a/package.json": JSON.stringify({
                name: "pkg-a",
                version: "1.0.3",
                dependencies: {
                  "pkg-b": "latest",
                },
              }),
              "packages/pkg-b/package.json": JSON.stringify({
                name: "pkg-b",
                version: "1.2.0",
                dependencies: {
                  "pkg-a": "bulbasaur",
                },
              }),
            },
            {
              changesets: [
                {
                  id: "quick-lions-devour",
                  summary: "Hey, let's have fun with testing!",
                  releases: [
                    { name: "pkg-a", type: "patch" },
                    { name: "pkg-b", type: "patch" },
                  ],
                },
              ],
              releases: [
                {
                  name: "pkg-a",
                  type: "patch",
                  oldVersion: "1.0.3",
                  newVersion: "1.0.4",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-b",
                  type: "patch",
                  oldVersion: "1.2.0",
                  newVersion: "1.2.1",
                  changesets: ["quick-lions-devour"],
                },
              ],
              preState: undefined,
            },
            {
              changelog: false,
              commit: false,
              fixed: [],
              linked: [],
              access: "restricted",
              changedFilePatterns: ["**"],
              baseBranch: "main",
              updateInternalDependencies,
              ignore: [],
              prettier: true,
              privatePackages: { version: true, tag: false },
              ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
                onlyUpdatePeerDependentsWhenOutOfRange: false,
                updateInternalDependents: "out-of-range",
              },
              snapshot: {
                useCalculatedVersion: false,
                prereleaseTemplate: null,
              },
            }
          );
          let pkgPathA = changedFiles.find((a) =>
            a.endsWith(`pkg-a${path.sep}package.json`)
          );
          let pkgPathB = changedFiles.find((b) =>
            b.endsWith(`pkg-b${path.sep}package.json`)
          );

          if (!pkgPathA || !pkgPathB) {
            throw new Error(`could not find an updated package json`);
          }
          let pkgJSONA = await fs.readJSON(pkgPathA);
          let pkgJSONB = await fs.readJSON(pkgPathB);

          expect(pkgJSONA).toMatchObject({
            name: "pkg-a",
            version: "1.0.4",
            dependencies: {
              "pkg-b": "latest",
            },
          });
          expect(pkgJSONB).toMatchObject({
            name: "pkg-b",
            version: "1.2.1",
            dependencies: {
              "pkg-a": "bulbasaur",
            },
          });
        });
      });
      describe("updateInternalDependencies set to minor", () => {
        const updateInternalDependencies = "minor";
        it("should NOT update min version ranges of patch bumped internal dependencies", async () => {
          let { changedFiles } = await testSetup(
            {
              "package.json": JSON.stringify({
                private: true,
                workspaces: ["packages/*"],
              }),
              "packages/pkg-a/package.json": JSON.stringify({
                name: "pkg-a",
                version: "1.0.3",
                dependencies: {
                  "pkg-b": "~1.2.0",
                },
              }),
              "packages/pkg-b/package.json": JSON.stringify({
                name: "pkg-b",
                version: "1.2.0",
                dependencies: {
                  "pkg-a": "^1.0.3",
                },
              }),
            },
            {
              changesets: [
                {
                  id: "quick-lions-devour",
                  summary: "Hey, let's have fun with testing!",
                  releases: [
                    { name: "pkg-a", type: "patch" },
                    { name: "pkg-b", type: "patch" },
                  ],
                },
              ],
              releases: [
                {
                  name: "pkg-a",
                  type: "patch",
                  oldVersion: "1.0.3",
                  newVersion: "1.0.4",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-b",
                  type: "patch",
                  oldVersion: "1.2.0",
                  newVersion: "1.2.1",
                  changesets: ["quick-lions-devour"],
                },
              ],
              preState: undefined,
            },
            {
              changelog: false,
              commit: false,
              fixed: [],
              linked: [],
              access: "restricted",
              changedFilePatterns: ["**"],
              baseBranch: "main",
              updateInternalDependencies,
              ignore: [],
              prettier: true,
              privatePackages: { version: true, tag: false },
              ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
                onlyUpdatePeerDependentsWhenOutOfRange: false,
                updateInternalDependents: "out-of-range",
              },
              snapshot: {
                useCalculatedVersion: false,
                prereleaseTemplate: null,
              },
            }
          );
          let pkgPathA = changedFiles.find((a) =>
            a.endsWith(`pkg-a${path.sep}package.json`)
          );
          let pkgPathB = changedFiles.find((b) =>
            b.endsWith(`pkg-b${path.sep}package.json`)
          );

          if (!pkgPathA || !pkgPathB) {
            throw new Error(`could not find an updated package json`);
          }
          let pkgJSONA = await fs.readJSON(pkgPathA);
          let pkgJSONB = await fs.readJSON(pkgPathB);

          expect(pkgJSONA).toMatchObject({
            name: "pkg-a",
            version: "1.0.4",
            dependencies: {
              "pkg-b": "~1.2.0",
            },
          });
          expect(pkgJSONB).toMatchObject({
            name: "pkg-b",
            version: "1.2.1",
            dependencies: {
              "pkg-a": "^1.0.3",
            },
          });
        });
        it("should still update min version ranges of patch bumped internal dependencies that have left semver range", async () => {
          let { changedFiles } = await testSetup(
            {
              "package.json": JSON.stringify({
                private: true,
                workspaces: ["packages/*"],
              }),
              "packages/pkg-a/package.json": JSON.stringify({
                name: "pkg-a",
                version: "1.0.3",
                dependencies: {
                  "pkg-b": "~1.2.0",
                },
              }),
              "packages/pkg-b/package.json": JSON.stringify({
                name: "pkg-b",
                version: "1.2.0",
                dependencies: {
                  "pkg-c": "2.0.0",
                  "pkg-a": "^1.0.3",
                },
              }),
              "packages/pkg-c/package.json": JSON.stringify({
                name: "pkg-c",
                version: "2.0.0",
                dependencies: {
                  "pkg-a": "^1.0.3",
                },
              }),
            },
            {
              changesets: [
                {
                  id: "quick-lions-devour",
                  summary: "Hey, let's have fun with testing!",
                  releases: [
                    { name: "pkg-a", type: "patch" },
                    { name: "pkg-b", type: "patch" },
                    { name: "pkg-c", type: "patch" },
                  ],
                },
              ],
              releases: [
                {
                  name: "pkg-a",
                  type: "patch",
                  oldVersion: "1.0.3",
                  newVersion: "1.0.4",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-b",
                  type: "patch",
                  oldVersion: "1.2.0",
                  newVersion: "1.2.1",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-c",
                  type: "patch",
                  oldVersion: "2.0.0",
                  newVersion: "2.0.1",
                  changesets: ["quick-lions-devour"],
                },
              ],
              preState: undefined,
            },
            {
              changelog: false,
              commit: false,
              fixed: [],
              linked: [],
              access: "restricted",
              changedFilePatterns: ["**"],
              baseBranch: "main",
              updateInternalDependencies,
              ignore: [],
              prettier: true,
              privatePackages: { version: true, tag: false },
              ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
                onlyUpdatePeerDependentsWhenOutOfRange: false,
                updateInternalDependents: "out-of-range",
              },
              snapshot: {
                useCalculatedVersion: false,
                prereleaseTemplate: null,
              },
            }
          );
          let pkgPathA = changedFiles.find((a) =>
            a.endsWith(`pkg-a${path.sep}package.json`)
          );
          let pkgPathB = changedFiles.find((b) =>
            b.endsWith(`pkg-b${path.sep}package.json`)
          );

          if (!pkgPathA || !pkgPathB) {
            throw new Error(`could not find an updated package json`);
          }
          let pkgJSONA = await fs.readJSON(pkgPathA);
          let pkgJSONB = await fs.readJSON(pkgPathB);

          expect(pkgJSONA).toMatchObject({
            name: "pkg-a",
            version: "1.0.4",
            dependencies: {
              "pkg-b": "~1.2.0",
            },
          });
          expect(pkgJSONB).toMatchObject({
            name: "pkg-b",
            version: "1.2.1",
            dependencies: {
              "pkg-c": "2.0.1",
              "pkg-a": "^1.0.3",
            },
          });
        });
        it("should update min version ranges of minor bumped internal dependencies", async () => {
          let { changedFiles } = await testSetup(
            {
              "package.json": JSON.stringify({
                private: true,
                workspaces: ["packages/*"],
              }),
              "packages/pkg-a/package.json": JSON.stringify({
                name: "pkg-a",
                version: "1.0.3",
                dependencies: {
                  "pkg-b": "~1.2.0",
                },
              }),
              "packages/pkg-b/package.json": JSON.stringify({
                name: "pkg-b",
                version: "1.2.0",
                dependencies: {
                  "pkg-c": "2.0.0",
                  "pkg-a": "^1.0.3",
                },
              }),
              "packages/pkg-c/package.json": JSON.stringify({
                name: "pkg-c",
                version: "2.0.0",
                dependencies: {
                  "pkg-a": "^1.0.3",
                },
              }),
            },
            {
              changesets: [
                {
                  id: "quick-lions-devour",
                  summary: "Hey, let's have fun with testing!",
                  releases: [
                    { name: "pkg-a", type: "minor" },
                    { name: "pkg-b", type: "patch" },
                  ],
                },
              ],
              releases: [
                {
                  name: "pkg-a",
                  type: "minor",
                  oldVersion: "1.0.3",
                  newVersion: "1.1.0",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-b",
                  type: "patch",
                  oldVersion: "1.2.0",
                  newVersion: "1.2.1",
                  changesets: ["quick-lions-devour"],
                },
              ],
              preState: undefined,
            },
            {
              changelog: false,
              commit: false,
              fixed: [],
              linked: [],
              access: "restricted",
              changedFilePatterns: ["**"],
              baseBranch: "main",
              updateInternalDependencies,
              ignore: [],
              prettier: true,
              privatePackages: { version: true, tag: false },
              ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
                onlyUpdatePeerDependentsWhenOutOfRange: false,
                updateInternalDependents: "out-of-range",
              },
              snapshot: {
                useCalculatedVersion: false,
                prereleaseTemplate: null,
              },
            }
          );
          let pkgPathA = changedFiles.find((a) =>
            a.endsWith(`pkg-a${path.sep}package.json`)
          );
          let pkgPathB = changedFiles.find((b) =>
            b.endsWith(`pkg-b${path.sep}package.json`)
          );

          if (!pkgPathA || !pkgPathB) {
            throw new Error(`could not find an updated package json`);
          }
          let pkgJSONA = await fs.readJSON(pkgPathA);
          let pkgJSONB = await fs.readJSON(pkgPathB);

          expect(pkgJSONA).toMatchObject({
            name: "pkg-a",
            version: "1.1.0",
            dependencies: {
              "pkg-b": "~1.2.0",
            },
          });
          expect(pkgJSONB).toMatchObject({
            name: "pkg-b",
            version: "1.2.1",
            dependencies: {
              "pkg-a": "^1.1.0",
            },
          });
        });
        it("should update min version ranges of major bumped internal dependencies", async () => {
          let { changedFiles } = await testSetup(
            {
              "package.json": JSON.stringify({
                private: true,
                workspaces: ["packages/*"],
              }),
              "packages/pkg-a/package.json": JSON.stringify({
                name: "pkg-a",
                version: "1.0.3",
                dependencies: {
                  "pkg-b": "~1.2.0",
                },
              }),
              "packages/pkg-b/package.json": JSON.stringify({
                name: "pkg-b",
                version: "1.2.0",
                dependencies: {
                  "pkg-a": "^1.0.3",
                },
              }),
            },
            {
              changesets: [
                {
                  id: "quick-lions-devour",
                  summary: "Hey, let's have fun with testing!",
                  releases: [
                    { name: "pkg-a", type: "major" },
                    { name: "pkg-b", type: "patch" },
                  ],
                },
              ],
              releases: [
                {
                  name: "pkg-a",
                  type: "major",
                  oldVersion: "1.0.3",
                  newVersion: "2.0.0",
                  changesets: ["quick-lions-devour"],
                },
                {
                  name: "pkg-b",
                  type: "patch",
                  oldVersion: "1.2.0",
                  newVersion: "1.2.1",
                  changesets: ["quick-lions-devour"],
                },
              ],
              preState: undefined,
            },
            {
              changelog: false,
              commit: false,
              fixed: [],
              linked: [],
              access: "restricted",
              changedFilePatterns: ["**"],
              baseBranch: "main",
              updateInternalDependencies,
              ignore: [],
              prettier: true,
              privatePackages: { version: true, tag: false },
              ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
                onlyUpdatePeerDependentsWhenOutOfRange: false,
                updateInternalDependents: "out-of-range",
              },
              snapshot: {
                useCalculatedVersion: false,
                prereleaseTemplate: null,
              },
            }
          );
          let pkgPathA = changedFiles.find((a) =>
            a.endsWith(`pkg-a${path.sep}package.json`)
          );
          let pkgPathB = changedFiles.find((b) =>
            b.endsWith(`pkg-b${path.sep}package.json`)
          );

          if (!pkgPathA || !pkgPathB) {
            throw new Error(`could not find an updated package json`);
          }
          let pkgJSONA = await fs.readJSON(pkgPathA);
          let pkgJSONB = await fs.readJSON(pkgPathB);

          expect(pkgJSONA).toMatchObject({
            name: "pkg-a",
            version: "2.0.0",
            dependencies: {
              "pkg-b": "~1.2.0",
            },
          });
          expect(pkgJSONB).toMatchObject({
            name: "pkg-b",
            version: "1.2.1",
            dependencies: {
              "pkg-a": "^2.0.0",
            },
          });
        });
      });
    });

    describe("onlyUpdatePeerDependentsWhenOutOfRange set to true", () => {
      it("should not bump peerDependencies if they are still in range", async () => {
        let { changedFiles } = await testSetup(
          {
            "package.json": JSON.stringify({
              private: true,
              workspaces: ["packages/*"],
            }),
            "packages/depended-upon/package.json": JSON.stringify({
              name: "depended-upon",
              version: "1.0.0",
            }),
            "packages/has-peer-dep/package.json": JSON.stringify({
              name: "has-peer-dep",
              version: "1.0.0",
              peerDependencies: {
                "depended-upon": "^1.0.0",
              },
            }),
          },
          {
            changesets: [
              {
                id: "quick-lions-devour",
                summary: "Hey, let's have fun with testing!",
                releases: [
                  { name: "depended-upon", type: "patch" },
                  { name: "has-peer-dep", type: "patch" },
                ],
              },
            ],
            releases: [
              {
                name: "has-peer-dep",
                type: "patch",
                oldVersion: "1.0.0",
                newVersion: "1.0.1",
                changesets: ["quick-lions-devour"],
              },
              {
                name: "depended-upon",
                type: "patch",
                oldVersion: "1.0.0",
                newVersion: "1.0.1",
                changesets: ["quick-lions-devour"],
              },
            ],
            preState: undefined,
          },
          {
            changelog: false,
            commit: false,
            fixed: [],
            linked: [],
            access: "restricted",
            changedFilePatterns: ["**"],
            baseBranch: "main",
            updateInternalDependencies: "patch",
            ignore: [],
            prettier: true,
            privatePackages: { version: true, tag: false },
            ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
              onlyUpdatePeerDependentsWhenOutOfRange: true,
              updateInternalDependents: "out-of-range",
            },
            snapshot: {
              useCalculatedVersion: false,
              prereleaseTemplate: null,
            },
          }
        );
        let pkgPathDependent = changedFiles.find((a) =>
          a.endsWith(`has-peer-dep${path.sep}package.json`)
        );
        let pkgPathDepended = changedFiles.find((b) =>
          b.endsWith(`depended-upon${path.sep}package.json`)
        );

        if (!pkgPathDependent || !pkgPathDepended) {
          throw new Error(`could not find an updated package json`);
        }
        let pkgJSONDependent = await fs.readJSON(pkgPathDependent);
        let pkgJSONDepended = await fs.readJSON(pkgPathDepended);

        expect(pkgJSONDependent).toMatchObject({
          name: "has-peer-dep",
          version: "1.0.1",
          peerDependencies: {
            "depended-upon": "^1.0.0",
          },
        });
        expect(pkgJSONDepended).toMatchObject({
          name: "depended-upon",
          version: "1.0.1",
        });
      });
    });
  });

  describe("changelogs", () => {
    it("should not generate any changelogs", async () => {
      const releasePlan = new FakeReleasePlan();
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
          }),
        },
        releasePlan.getReleasePlan(),
        {
          ...releasePlan.config,
          changelog: false,
        }
      );

      expect(
        changedFiles.find((a) => a.endsWith(`pkg-a${path.sep}CHANGELOG.md`))
      ).toBeUndefined();
    });

    it("should update a changelog for one package", async () => {
      const releasePlan = new FakeReleasePlan();
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
          }),
        },
        releasePlan.getReleasePlan(),
        {
          ...releasePlan.config,
          changelog: [
            path.resolve(__dirname, "test-utils/simple-get-changelog-entry"),
            null,
          ],
        }
      );

      let readmePath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}CHANGELOG.md`)
      );

      if (!readmePath) throw new Error(`could not find an updated changelog`);
      let readme = await fs.readFile(readmePath, "utf-8");

      expect(readme.trim()).toEqual(outdent`# pkg-a

      ## 1.1.0

      ### Minor Changes

      - Hey, let's have fun with testing!`);
    });

    it("should insert new entry before existing version heading when no package title is present", async () => {
      const releasePlan = new FakeReleasePlan();
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
          }),
          "packages/pkg-a/CHANGELOG.md":
            "## 1.0.0\n\n### Minor Changes\n\n- Initial release\n",
        },
        releasePlan.getReleasePlan(),
        {
          ...releasePlan.config,
          changelog: [
            path.resolve(__dirname, "test-utils/simple-get-changelog-entry"),
            null,
          ],
        }
      );

      let readmePath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}CHANGELOG.md`)
      );

      if (!readmePath) throw new Error(`could not find an updated changelog`);
      let readme = await fs.readFile(readmePath, "utf-8");

      expect(readme).toMatchInlineSnapshot(`
        "## 1.1.0

        ### Minor Changes

        - Hey, let's have fun with testing!

        ## 1.0.0

        ### Minor Changes

        - Initial release
        "
      `);
    });

    it("should update a changelog for two packages", async () => {
      const releasePlan = new FakeReleasePlan(
        [],
        [
          {
            name: "pkg-b",
            type: "major",
            oldVersion: "1.0.0",
            newVersion: "2.0.0",
            changesets: [],
          },
        ]
      );

      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            dependencies: {
              "pkg-b": "1.0.0",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
        },
        releasePlan.getReleasePlan(),
        {
          ...releasePlan.config,
          changelog: [
            path.resolve(__dirname, "test-utils/simple-get-changelog-entry"),
            null,
          ],
        }
      );

      let readmePath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}CHANGELOG.md`)
      );
      let readmePathB = changedFiles.find((a) =>
        a.endsWith(`pkg-b${path.sep}CHANGELOG.md`)
      );

      if (!readmePath || !readmePathB)
        throw new Error(`could not find an updated changelog`);
      let readme = await fs.readFile(readmePath, "utf-8");
      let readmeB = await fs.readFile(readmePathB, "utf-8");

      expect(readme.trim()).toEqual(outdent`# pkg-a

      ## 1.1.0

      ### Minor Changes

      - Hey, let's have fun with testing!

      ### Patch Changes

      - pkg-b@2.0.0`);

      expect(readmeB.trim()).toEqual(outdent`# pkg-b

      ## 2.0.0`);
    });

    it("should not update the changelog if only devDeps changed", async () => {
      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
            devDependencies: {
              "pkg-b": "1.0.0",
            },
          }),
          "packages/pkg-b/package.json": JSON.stringify({
            name: "pkg-b",
            version: "1.0.0",
          }),
        },
        {
          changesets: [
            {
              id: "quick-lions-devour",
              summary: "Hey, let's have fun with testing!",
              releases: [
                { name: "pkg-a", type: "none" },
                { name: "pkg-b", type: "minor" },
              ],
            },
          ],
          releases: [
            {
              name: "pkg-a",
              type: "none",
              oldVersion: "1.0.0",
              newVersion: "1.0.0",
              changesets: [],
            },
            {
              name: "pkg-b",
              type: "minor",
              oldVersion: "1.0.0",
              newVersion: "1.1.0",
              changesets: ["quick-lions-devour"],
            },
          ],
          preState: undefined,
        },
        {
          commit: false,
          fixed: [],
          linked: [],
          access: "restricted",
          baseBranch: "main",
          changedFilePatterns: ["**"],
          changelog: [
            path.resolve(__dirname, "test-utils/simple-get-changelog-entry"),
            null,
          ],
          updateInternalDependencies: "patch",
          ignore: [],
          prettier: true,
          privatePackages: { version: true, tag: false },
          ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
            onlyUpdatePeerDependentsWhenOutOfRange: false,
            updateInternalDependents: "out-of-range",
          },
          snapshot: {
            useCalculatedVersion: false,
            prereleaseTemplate: null,
          },
        }
      );
      let pkgAChangelogPath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}CHANGELOG.md`)
      );

      expect(pkgAChangelogPath).toBeUndefined();
    });

    test("should list multi-line same-type summaries correctly", async () => {
      const releasePlan = new FakeReleasePlan([
        {
          id: "some-id-1",
          summary: "Random stuff\n\nget it while it's hot!",
          releases: [{ name: "pkg-a", type: "minor" }],
        },
        {
          id: "some-id-2",
          summary: "New feature, much wow\n\nlook at this shiny stuff!",
          releases: [{ name: "pkg-a", type: "minor" }],
        },
      ]);
      releasePlan.releases[0].changesets.push("some-id-1", "some-id-2");

      let { changedFiles } = await testSetup(
        {
          "package.json": JSON.stringify({
            private: true,
            workspaces: ["packages/*"],
          }),
          "packages/pkg-a/package.json": JSON.stringify({
            name: "pkg-a",
            version: "1.0.0",
          }),
        },
        releasePlan.getReleasePlan(),
        {
          ...releasePlan.config,
          changelog: [
            path.resolve(__dirname, "test-utils/simple-get-changelog-entry"),
            null,
          ],
        }
      );

      let readmePath = changedFiles.find((a) =>
        a.endsWith(`pkg-a${path.sep}CHANGELOG.md`)
     
Download .txt
gitextract_zdwe5kv4/

├── .changeset/
│   ├── README.md
│   └── config.json
├── .eslintignore
├── .eslintrc
├── .github/
│   ├── ISSUE_TEMPLATE.md
│   ├── actions/
│   │   └── ci-setup/
│   │       └── action.yml
│   ├── dependabot.yml
│   └── workflows/
│       ├── ci.yml
│       └── publish.yml
├── .gitignore
├── .prettierignore
├── .vscode/
│   ├── launch.json
│   └── settings.json
├── FUNDING.json
├── LICENSE
├── README.md
├── SECURITY.md
├── assets/
│   ├── README.md
│   └── images/
│       └── README.md
├── babel.config.js
├── docs/
│   ├── adding-a-changeset.md
│   ├── automating-changesets.md
│   ├── checking-for-changesets.md
│   ├── command-line-options.md
│   ├── common-questions.md
│   ├── config-file-options.md
│   ├── decisions.md
│   ├── detailed-explanation.md
│   ├── dictionary.md
│   ├── experimental-options.md
│   ├── fixed-packages.md
│   ├── intro-to-using-changesets.md
│   ├── linked-packages.md
│   ├── modifying-changelog-format.md
│   ├── prereleases.md
│   ├── problems-publishing-in-monorepos.md
│   ├── snapshot-releases.md
│   └── versioning-apps.md
├── jest.config.js
├── package.json
├── packages/
│   ├── apply-release-plan/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── get-changelog-entry.ts
│   │       ├── index.test.ts
│   │       ├── index.ts
│   │       ├── test-utils/
│   │       │   ├── failing-functions.ts
│   │       │   ├── get-changelog-dep-updated.ts
│   │       │   ├── get-changelog-entry-with-git-hash.ts
│   │       │   ├── simple-get-changelog-entry.ts
│   │       │   └── simple-get-commit-entry.ts
│   │       ├── types.ts
│   │       ├── utils.ts
│   │       └── version-package.ts
│   ├── assemble-release-plan/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── README.md
│   │       ├── apply-links.ts
│   │       ├── determine-dependents.ts
│   │       ├── flatten-releases.ts
│   │       ├── increment.test.ts
│   │       ├── increment.ts
│   │       ├── index.test.ts
│   │       ├── index.ts
│   │       ├── match-fixed-constraint.ts
│   │       ├── test-utils.ts
│   │       ├── types.ts
│   │       └── utils.ts
│   ├── changelog-git/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   └── src/
│   │       └── index.ts
│   ├── changelog-github/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── cli/
│   │   ├── CHANGELOG.md
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── bin.js
│   │   ├── changelog/
│   │   │   └── package.json
│   │   ├── commit/
│   │   │   └── package.json
│   │   ├── default-files/
│   │   │   └── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── changelog.ts
│   │       ├── commands/
│   │       │   ├── add/
│   │       │   │   ├── __tests__/
│   │       │   │   │   └── add.ts
│   │       │   │   ├── createChangeset.ts
│   │       │   │   ├── index.ts
│   │       │   │   └── messages.ts
│   │       │   ├── init/
│   │       │   │   ├── __tests__/
│   │       │   │   │   └── command.ts
│   │       │   │   └── index.ts
│   │       │   ├── pre/
│   │       │   │   ├── index.test.ts
│   │       │   │   └── index.ts
│   │       │   ├── publish/
│   │       │   │   ├── __tests__/
│   │       │   │   │   ├── index.test.ts
│   │       │   │   │   ├── publishPackages.test.ts
│   │       │   │   │   └── releaseCommand.test.ts
│   │       │   │   ├── index.ts
│   │       │   │   ├── npm-utils.ts
│   │       │   │   └── publishPackages.ts
│   │       │   ├── status/
│   │       │   │   ├── __tests__/
│   │       │   │   │   └── status.ts
│   │       │   │   └── index.ts
│   │       │   ├── tag/
│   │       │   │   ├── __tests__/
│   │       │   │   │   └── index.test.ts
│   │       │   │   └── index.ts
│   │       │   └── version/
│   │       │       ├── index.ts
│   │       │       └── version.test.ts
│   │       ├── commit/
│   │       │   ├── commit.test.ts
│   │       │   ├── getCommitFunctions.ts
│   │       │   └── index.ts
│   │       ├── index.ts
│   │       ├── run.test.ts
│   │       ├── run.ts
│   │       ├── types.ts
│   │       └── utils/
│   │           ├── cli-utilities.ts
│   │           ├── createPromiseQueue.test.ts
│   │           ├── createPromiseQueue.ts
│   │           ├── getLastJsonObjectFromString.test.ts
│   │           ├── getLastJsonObjectFromString.ts
│   │           ├── getUntaggedPackages.ts
│   │           ├── types.ts
│   │           ├── v1-legacy/
│   │           │   ├── README.md
│   │           │   └── removeFolders.ts
│   │           └── versionablePackages.ts
│   ├── config/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   ├── schema.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── errors/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── get-dependents-graph/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── get-dependency-graph.test.ts
│   │       ├── get-dependency-graph.ts
│   │       └── index.ts
│   ├── get-github-info/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── get-release-plan/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       └── index.ts
│   ├── get-version-range-type/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── git/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── logger/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── parse/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── pre/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       └── index.ts
│   ├── read/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── index.test.ts
│   │       ├── index.ts
│   │       └── legacy.ts
│   ├── release-utils/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   └── src/
│   │       ├── __snapshots__/
│   │       │   └── utils.test.ts.snap
│   │       ├── fake-publish-script-multi-package.js
│   │       ├── fake-publish-script-single-package.js
│   │       ├── gitUtils.ts
│   │       ├── index.ts
│   │       ├── readChangesetState.ts
│   │       ├── run.test.ts
│   │       ├── run.ts
│   │       ├── utils.test.ts
│   │       └── utils.ts
│   ├── should-skip-package/
│   │   ├── CHANGELOG.md
│   │   ├── package.json
│   │   └── src/
│   │       └── index.ts
│   ├── types/
│   │   ├── CHANGELOG.md
│   │   ├── README.md
│   │   ├── package.json
│   │   └── src/
│   │       └── index.ts
│   └── write/
│       ├── CHANGELOG.md
│       ├── README.md
│       ├── package.json
│       └── src/
│           ├── index.test.ts
│           └── index.ts
├── scripts/
│   └── test-utils/
│       ├── CHANGELOG.md
│       ├── README.md
│       ├── package.json
│       └── src/
│           ├── index.test.ts
│           └── index.ts
├── tsconfig.json
└── types/
    ├── boxen.d.ts
    ├── fixturez.d.ts
    ├── human-id.d.ts
    ├── lodash.d.ts
    └── spawndamnit.d.ts
Download .txt
SYMBOL INDEX (239 symbols across 66 files)

FILE: packages/apply-release-plan/src/get-changelog-entry.ts
  type ChangelogLines (line 8) | type ChangelogLines = {
  function generateChangesForVersionTypeMarkdown (line 14) | async function generateChangesForVersionTypeMarkdown(
  function getChangelogEntry (line 26) | async function getChangelogEntry(

FILE: packages/apply-release-plan/src/index.test.ts
  class FakeReleasePlan (line 23) | class FakeReleasePlan {
    method constructor (line 28) | constructor(
    method getReleasePlan (line 72) | getReleasePlan(): ReleasePlan {
  function testSetup (line 81) | async function testSetup(

FILE: packages/apply-release-plan/src/index.ts
  function getPrettierInstance (line 20) | function getPrettierInstance(cwd: string): typeof prettier {
  function stringDefined (line 31) | function stringDefined(s: string | undefined): s is string {
  function getCommitsThatAddChangesets (line 34) | async function getCommitsThatAddChangesets(
  function applyReleasePlan (line 67) | async function applyReleasePlan(
  function getNewChangelogEntry (line 192) | async function getNewChangelogEntry(
  function updateChangelog (line 282) | async function updateChangelog(
  function updatePackageJson (line 305) | async function updatePackageJson(
  function prependFile (line 317) | async function prependFile(
  function writeFormattedMarkdownFile (line 355) | async function writeFormattedMarkdownFile(

FILE: packages/apply-release-plan/src/test-utils/get-changelog-entry-with-git-hash.ts
  function getReleaseLine (line 8) | async function getReleaseLine(changeset: NewChangeset, cwd: string) {
  function getReleaseLines (line 23) | async function getReleaseLines(
  function defaultChangelogGetter (line 37) | async function defaultChangelogGetter(

FILE: packages/apply-release-plan/src/types.ts
  type RelevantChangesets (line 3) | type RelevantChangesets = {

FILE: packages/apply-release-plan/src/utils.ts
  function getBumpLevel (line 10) | function getBumpLevel(type: VersionType) {
  function shouldUpdateDependencyBasedOnConfig (line 18) | function shouldUpdateDependencyBasedOnConfig(

FILE: packages/apply-release-plan/src/version-package.ts
  constant DEPENDENCY_TYPES (line 12) | const DEPENDENCY_TYPES = [
  function versionPackage (line 19) | function versionPackage(

FILE: packages/assemble-release-plan/src/apply-links.ts
  function applyLinks (line 18) | function applyLinks(

FILE: packages/assemble-release-plan/src/determine-dependents.ts
  function determineDependents (line 26) | function determineDependents({
  function getDependencyVersionRanges (line 176) | function getDependencyVersionRanges(
  function shouldBumpMajor (line 219) | function shouldBumpMajor({

FILE: packages/assemble-release-plan/src/flatten-releases.ts
  function flattenReleases (line 10) | function flattenReleases(

FILE: packages/assemble-release-plan/src/increment.ts
  function incrementVersion (line 5) | function incrementVersion(

FILE: packages/assemble-release-plan/src/index.ts
  type SnapshotReleaseParameters (line 21) | type SnapshotReleaseParameters = {
  function getPreVersion (line 26) | function getPreVersion(version: string) {
  function getSnapshotSuffix (line 37) | function getSnapshotSuffix(
  function getSnapshotVersion (line 85) | function getSnapshotVersion(
  function getNewVersion (line 111) | function getNewVersion(
  type OptionalProp (line 122) | type OptionalProp<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
  function assembleReleasePlan (line 124) | function assembleReleasePlan(
  function getRelevantChangesets (line 272) | function getRelevantChangesets(
  function getHighestPreVersion (line 323) | function getHighestPreVersion(
  function getPreInfo (line 345) | function getPreInfo(

FILE: packages/assemble-release-plan/src/match-fixed-constraint.ts
  function matchFixedConstraint (line 11) | function matchFixedConstraint(

FILE: packages/assemble-release-plan/src/test-utils.ts
  function getPackage (line 4) | function getPackage({
  function getChangeset (line 20) | function getChangeset(
  function getRelease (line 37) | function getRelease({
  class FakeFullState (line 64) | class FakeFullState {
    method constructor (line 68) | constructor(custom?: { packages?: Packages; changesets?: NewChangeset[...
    method addChangeset (line 74) | addChangeset(
    method updateDependency (line 90) | updateDependency(pkgA: string, pkgB: string, versionRange: string) {
    method updateDevDependency (line 98) | updateDevDependency(pkgA: string, pkgB: string, versionRange: string) {
    method updatePeerDependency (line 106) | updatePeerDependency(pkgA: string, pkgB: string, versionRange: string) {
    method addPackage (line 115) | addPackage(name: string, version: string) {
    method updatePackage (line 128) | updatePackage(name: string, version: string) {

FILE: packages/assemble-release-plan/src/types.ts
  type InternalRelease (line 3) | type InternalRelease = {
  type PreInfo (line 10) | type PreInfo = {

FILE: packages/assemble-release-plan/src/utils.ts
  function getHighestReleaseType (line 7) | function getHighestReleaseType(
  function getCurrentHighestVersion (line 36) | function getCurrentHighestVersion(
  function mapGetOrThrow (line 60) | function mapGetOrThrow<V extends {}>(
  function mapGetOrThrowInternal (line 72) | function mapGetOrThrowInternal<V extends {}>(

FILE: packages/changelog-github/src/index.test.ts
  method getInfo (line 22) | async getInfo({ commit, repo }) {
  method getInfoFromPullRequest (line 31) | async getInfoFromPullRequest({ pull, repo }) {

FILE: packages/changelog-github/src/index.ts
  function linkifyIssueRefs (line 10) | function linkifyIssueRefs(
  function readEnv (line 21) | function readEnv() {

FILE: packages/cli/src/commands/add/createChangeset.ts
  function confirmMajorRelease (line 13) | async function confirmMajorRelease(pkgJSON: PackageJSON) {
  function getPackagesToRelease (line 37) | async function getPackagesToRelease(
  function getPkgJsonsByName (line 99) | function getPkgJsonsByName(packages: Package[]) {
  function formatPkgNameAndVersion (line 105) | function formatPkgNameAndVersion(pkgName: string, version: string) {
  function createChangeset (line 109) | async function createChangeset(

FILE: packages/cli/src/commands/add/index.ts
  function add (line 19) | async function add(

FILE: packages/cli/src/commands/add/messages.ts
  function printConfirmationMessage (line 5) | function printConfirmationMessage(

FILE: packages/cli/src/commands/init/index.ts
  function init (line 18) | async function init(cwd: string) {

FILE: packages/cli/src/commands/pre/index.ts
  function pre (line 10) | async function pre(

FILE: packages/cli/src/commands/publish/index.ts
  function logReleases (line 11) | function logReleases(pkgs: Array<{ name: string; newVersion: string }>) {
  function showNonLatestTagWarning (line 24) | function showNonLatestTagWarning(tag?: string, preState?: PreState) {
  function publish (line 41) | async function publish(
  function tagPublish (line 119) | async function tagPublish(

FILE: packages/cli/src/commands/publish/npm-utils.ts
  type PublishOptions (line 14) | interface PublishOptions {
  constant NPM_REQUEST_CONCURRENCY_LIMIT (line 21) | const NPM_REQUEST_CONCURRENCY_LIMIT = 40;
  constant NPM_PUBLISH_CONCURRENCY_LIMIT (line 22) | const NPM_PUBLISH_CONCURRENCY_LIMIT = 10;
  function jsonParse (line 31) | function jsonParse(input: string) {
  type RegistryInfo (line 51) | interface RegistryInfo {
  function normalizeRegistry (line 56) | function normalizeRegistry(registry: string | undefined) {
  function getCorrectRegistry (line 60) | function getCorrectRegistry(packageJson?: PackageJSON): RegistryInfo {
  function getPublishTool (line 90) | async function getPublishTool(
  function getTokenIsRequired (line 112) | async function getTokenIsRequired() {
  function getPackageInfo (line 136) | function getPackageInfo(packageJson: PackageJSON) {
  function infoAllow404 (line 168) | async function infoAllow404(packageJson: PackageJSON) {
  function internalPublish (line 190) | async function internalPublish(
  function publish (line 304) | function publish(

FILE: packages/cli/src/commands/publish/publishPackages.ts
  type PublishedState (line 18) | type PublishedState = "never" | "published" | "only-pre";
  type PkgInfo (line 20) | type PkgInfo = {
  type PublishedResult (line 27) | type PublishedResult = {
  function getReleaseTag (line 33) | function getReleaseTag(pkgInfo: PkgInfo, preState?: PreState, tag?: stri...
  function publishPackages (line 85) | async function publishPackages({
  function publishAPackage (line 131) | async function publishAPackage(
  function getUnpublishedPackages (line 160) | async function getUnpublishedPackages(

FILE: packages/cli/src/commands/status/__tests__/status.ts
  function readConfig (line 12) | async function readConfig(cwd: string) {
  function replaceHumanIds (line 16) | function replaceHumanIds(releaseObj: ReleasePlan | undefined) {

FILE: packages/cli/src/commands/status/index.ts
  function status (line 14) | async function status(
  function SimplePrint (line 72) | function SimplePrint(type: VersionType, releases: Array<Release>) {
  function verbosePrint (line 84) | function verbosePrint(

FILE: packages/cli/src/commands/tag/__tests__/index.test.ts
  function readConfig (line 9) | async function readConfig(cwd: string) {

FILE: packages/cli/src/commands/tag/index.ts
  function tag (line 8) | async function tag(cwd: string, config: Config) {

FILE: packages/cli/src/commands/version/index.ts
  function version (line 25) | async function version(

FILE: packages/cli/src/commands/version/version.test.ts
  function mockGlobalDate (line 14) | function mockGlobalDate<

FILE: packages/cli/src/commit/getCommitFunctions.ts
  function getCommitFunctions (line 5) | async function getCommitFunctions(

FILE: packages/cli/src/commit/index.ts
  type SkipCI (line 3) | type SkipCI = boolean | "add" | "version";

FILE: packages/cli/src/run.ts
  function run (line 19) | async function run(

FILE: packages/cli/src/types.ts
  type CliOptions (line 1) | type CliOptions = {
  type CommandOptions (line 18) | type CommandOptions = CliOptions & {

FILE: packages/cli/src/utils/cli-utilities.ts
  type PromptOptions (line 10) | type PromptOptions = Extract<Parameters<typeof prompt>[0], { type: strin...
  type ArrayPromptOptions (line 11) | type ArrayPromptOptions = Extract<
  type BooleanPromptOptions (line 25) | type BooleanPromptOptions = Extract<PromptOptions, { type: "confirm" }>;
  type StringPromptOptions (line 26) | type StringPromptOptions = Extract<
  function askCheckboxPlus (line 50) | async function askCheckboxPlus(
  function askQuestion (line 81) | async function askQuestion(message: string): Promise<string> {
  function askQuestionWithEditor (line 99) | function askQuestionWithEditor(message: string): string {
  function askConfirm (line 107) | async function askConfirm(message: string): Promise<boolean> {
  function askList (line 126) | async function askList<Choice extends string>(

FILE: packages/cli/src/utils/createPromiseQueue.test.ts
  function asyncSpy (line 3) | function asyncSpy(implementation: () => unknown = () => {}) {
  function syncSpy (line 7) | function syncSpy(implementation: () => unknown = () => {}) {

FILE: packages/cli/src/utils/createPromiseQueue.ts
  type PromiseWithResolvers (line 1) | interface PromiseWithResolvers<T> {
  function withResolvers (line 7) | function withResolvers<T>(): PromiseWithResolvers<T> {
  function promiseTry (line 16) | function promiseTry<T>(fn: () => Promise<T>): Promise<T> {
  function createPromiseQueue (line 20) | function createPromiseQueue(concurrency: number) {

FILE: packages/cli/src/utils/getUntaggedPackages.ts
  function getUntaggedPackages (line 5) | async function getUntaggedPackages(

FILE: packages/cli/src/utils/types.ts
  type TwoFactorState (line 1) | type TwoFactorState = {

FILE: packages/cli/src/utils/versionablePackages.ts
  function getVersionableChangedPackages (line 5) | async function getVersionableChangedPackages(

FILE: packages/config/src/index.test.ts
  type CorrectCase (line 21) | type CorrectCase = {

FILE: packages/config/src/index.ts
  function flatten (line 30) | function flatten<T>(arr: Array<T[]>): T[] {
  function getNormalizedChangelogOption (line 34) | function getNormalizedChangelogOption(
  function getNormalizedCommitOption (line 46) | function getNormalizedCommitOption(
  function getUnmatchedPatterns (line 61) | function getUnmatchedPatterns(
  function isArray (line 85) | function isArray<T>(

FILE: packages/errors/src/index.ts
  class GitError (line 3) | class GitError extends ExtendableError {
    method constructor (line 5) | constructor(code: number, message: string) {
  class ValidationError (line 11) | class ValidationError extends ExtendableError {}
  class ExitError (line 13) | class ExitError extends ExtendableError {
    method constructor (line 15) | constructor(code: number) {
  class PreExitButNotInPreModeError (line 21) | class PreExitButNotInPreModeError extends ExtendableError {
    method constructor (line 22) | constructor() {
  class PreEnterButInPreModeError (line 27) | class PreEnterButInPreModeError extends ExtendableError {
    method constructor (line 28) | constructor() {
  class InternalError (line 33) | class InternalError extends ExtendableError {
    method constructor (line 34) | constructor(message: string) {

FILE: packages/get-dependents-graph/src/get-dependency-graph.ts
  constant DEPENDENCY_TYPES (line 7) | const DEPENDENCY_TYPES = [
  function getDependencyGraph (line 56) | function getDependencyGraph(

FILE: packages/get-dependents-graph/src/index.ts
  function getDependentsGraph (line 4) | function getDependentsGraph(

FILE: packages/get-github-info/src/index.ts
  function readEnv (line 4) | function readEnv() {
  type RequestData (line 15) | type RequestData =
  type ReposWithCommitsAndPRsToFetch (line 19) | type ReposWithCommitsAndPRsToFetch = Record<
  function makeQuery (line 24) | function makeQuery(repos: ReposWithCommitsAndPRsToFetch) {
  function getInfo (line 177) | async function getInfo(request: {
  function getInfoFromPullRequest (line 246) | async function getInfoFromPullRequest(request: {

FILE: packages/get-release-plan/src/index.ts
  function getReleasePlan (line 8) | async function getReleasePlan(

FILE: packages/get-version-range-type/src/index.ts
  function getVersionRangeType (line 1) | function getVersionRangeType(

FILE: packages/git/src/index.test.ts
  function getCommitCount (line 22) | async function getCommitCount(cwd: string) {
  function createDummyCommits (line 274) | async function createDummyCommits(count: number, cwd: string) {
  function addFileAndCommit (line 280) | async function addFileAndCommit(file: string, cwd: string) {
  function createShallowClone (line 287) | async function createShallowClone(

FILE: packages/git/src/index.ts
  function add (line 9) | async function add(pathToFile: string, cwd: string) {
  function commit (line 18) | async function commit(message: string, cwd: string) {
  function getAllTags (line 27) | async function getAllTags(cwd: string): Promise<Set<string>> {
  function tag (line 40) | async function tag(tagStr: string, cwd: string) {
  function getDivergedCommit (line 48) | async function getDivergedCommit(cwd: string, ref: string) {
  function getCommitsThatAddFiles (line 64) | async function getCommitsThatAddFiles(
  function isRepoShallow (line 139) | async function isRepoShallow({ cwd }: { cwd: string }) {
  function deepenCloneBy (line 170) | async function deepenCloneBy({ by, cwd }: { by: number; cwd: string }) {
  function getRepoRoot (line 173) | async function getRepoRoot({ cwd }: { cwd: string }) {
  function getChangedFilesSince (line 187) | async function getChangedFilesSince({
  function getChangedChangesetFilesSinceRef (line 221) | async function getChangedChangesetFilesSinceRef({
  function getChangedPackagesSinceRef (line 253) | async function getChangedPackagesSinceRef({
  function tagExists (line 289) | async function tagExists(tagStr: string, cwd: string) {
  function getCurrentCommitId (line 296) | async function getCurrentCommitId({
  function remoteTagExists (line 314) | async function remoteTagExists(tagStr: string) {

FILE: packages/logger/src/index.ts
  function format (line 6) | function format(args: Array<any>, customPrefix?: string) {
  function error (line 18) | function error(...args: Array<any>) {
  function info (line 22) | function info(...args: Array<any>) {
  function log (line 26) | function log(...args: Array<any>) {
  function success (line 30) | function success(...args: Array<any>) {
  function warn (line 34) | function warn(...args: Array<any>) {

FILE: packages/parse/src/index.ts
  constant EXAMPLE_FORMAT (line 6) | const EXAMPLE_FORMAT = `---\n"package-name": patch\n---`;
  function truncate (line 15) | function truncate(s: string, max = 200): string {
  function validateReleases (line 19) | function validateReleases(releases: Release[], contents: string): void {
  function parseChangesetFile (line 51) | function parseChangesetFile(contents: string): {

FILE: packages/pre/src/index.ts
  function readPreState (line 10) | async function readPreState(
  function exitPre (line 34) | async function exitPre(rootDir: string) {
  function enterPre (line 49) | async function enterPre(rootDir: string, tag: string) {

FILE: packages/read/src/index.ts
  function filterChangesetsSinceRef (line 8) | async function filterChangesetsSinceRef(
  function getChangesets (line 22) | async function getChangesets(

FILE: packages/read/src/legacy.ts
  function getOldChangesets (line 18) | async function getOldChangesets(
  function getOldChangesetsAndWarn (line 45) | async function getOldChangesetsAndWarn(

FILE: packages/release-utils/src/readChangesetState.ts
  type ChangesetState (line 5) | type ChangesetState = {
  function readChangesetState (line 10) | async function readChangesetState(

FILE: packages/release-utils/src/run.test.ts
  function setupRepoAndClone (line 29) | async function setupRepoAndClone(cwd: string) {

FILE: packages/release-utils/src/run.ts
  type PublishOptions (line 12) | type PublishOptions = {
  type PublishedPackage (line 17) | type PublishedPackage = { name: string; version: string };
  type PublishResult (line 19) | type PublishResult =
  function runPublish (line 28) | async function runPublish({
  type VersionOptions (line 99) | type VersionOptions = {
  function runVersion (line 105) | async function runVersion({

FILE: packages/release-utils/src/utils.ts
  function getVersionsByDirectory (line 17) | async function getVersionsByDirectory(cwd: string) {
  function getChangedPackages (line 22) | async function getChangedPackages(
  function getChangelogEntry (line 39) | function getChangelogEntry(changelog: string, version: string) {
  function execWithOutput (line 91) | async function execWithOutput(
  function sortChangelogEntries (line 117) | function sortChangelogEntries(

FILE: packages/should-skip-package/src/index.ts
  function shouldSkipPackage (line 4) | function shouldSkipPackage(

FILE: packages/types/src/index.ts
  constant DEPENDENCY_TYPES (line 3) | const DEPENDENCY_TYPES = [
  type VersionType (line 10) | type VersionType = "major" | "minor" | "patch" | "none";
  type DependencyType (line 12) | type DependencyType = typeof DEPENDENCY_TYPES[number];
  type AccessType (line 14) | type AccessType = "public" | "restricted";
  type Release (line 16) | type Release = { name: string; type: VersionType };
  type ComprehensiveRelease (line 20) | type ComprehensiveRelease = {
  type Changeset (line 28) | type Changeset = {
  type NewChangeset (line 33) | type NewChangeset = Changeset & {
  type ReleasePlan (line 37) | type ReleasePlan = {
  type PackageJSON (line 43) | type PackageJSON = {
  type PackageGroup (line 60) | type PackageGroup = ReadonlyArray<string>;
  type Fixed (line 62) | type Fixed = ReadonlyArray<PackageGroup>;
  type Linked (line 63) | type Linked = ReadonlyArray<PackageGroup>;
  type PrivatePackages (line 65) | interface PrivatePackages {
  type Config (line 70) | type Config = {
  type WrittenConfig (line 97) | type WrittenConfig = {
  type ExperimentalOptions (line 124) | type ExperimentalOptions = {
  type NewChangesetWithCommit (line 131) | type NewChangesetWithCommit = NewChangeset & { commit?: string };
  type ModCompWithPackage (line 133) | type ModCompWithPackage = ComprehensiveRelease & {
  type GetReleaseLine (line 138) | type GetReleaseLine = (
  type GetDependencyReleaseLine (line 144) | type GetDependencyReleaseLine = (
  type ChangelogFunctions (line 150) | type ChangelogFunctions = {
  type GetAddMessage (line 155) | type GetAddMessage = (
  type GetVersionMessage (line 160) | type GetVersionMessage = (
  type CommitFunctions (line 165) | type CommitFunctions = {
  type PreState (line 170) | type PreState = {

FILE: packages/write/src/index.ts
  function getPrettierInstance (line 7) | function getPrettierInstance(cwd: string): typeof prettier {
  function writeChangeset (line 18) | async function writeChangeset(

FILE: scripts/test-utils/src/index.ts
  method setup (line 32) | setup() {
  type Fixture (line 92) | interface Fixture extends Record<string, string> {}
  function testdir (line 94) | async function testdir(dir: Fixture) {
  function gitdir (line 107) | async function gitdir(dir: Fixture) {

FILE: types/fixturez.d.ts
  type Opts (line 1) | type Opts = {
Condensed preview — 214 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,171K chars).
[
  {
    "path": ".changeset/README.md",
    "chars": 502,
    "preview": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that wo"
  },
  {
    "path": ".changeset/config.json",
    "chars": 269,
    "preview": "{\n  \"changelog\": [\n    \"@changesets/changelog-github\",\n    { \"repo\": \"changesets/changesets\" }\n  ],\n  \"baseBranch\": \"mai"
  },
  {
    "path": ".eslintignore",
    "chars": 45,
    "preview": "dist\n__fixtures__\nnode_modules\nscratchings.js"
  },
  {
    "path": ".eslintrc",
    "chars": 1460,
    "preview": "{\n  \"extends\": [\n    \"plugin:@typescript-eslint/eslint-recommended\",\n    \"standard\",\n    \"prettier\"\n  ],\n  \"plugins\": [\""
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "chars": 562,
    "preview": "## Affected Packages\n\n<!-- Because monorepos, it's super helpful if you tell us which packages are affected, so it's eas"
  },
  {
    "path": ".github/actions/ci-setup/action.yml",
    "chars": 455,
    "preview": "name: Setup CI\n\ninputs:\n  node-version:\n    description: \"Node.js version\"\n    required: false\n    default: 20\n\nruns:\n  "
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 502,
    "preview": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where "
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 1578,
    "preview": "name: CI\n\non:\n  pull_request:\n  push:\n    branches: [main]\n  merge_group:\n    branches: [main]\n\npermissions:\n  contents:"
  },
  {
    "path": ".github/workflows/publish.yml",
    "chars": 6190,
    "preview": "name: Publish\n\non:\n  push:\n    branches:\n      - main\n      - next\n  issue_comment:\n    types: [created]\n\nconcurrency: $"
  },
  {
    "path": ".gitignore",
    "chars": 61,
    "preview": "node_modules/\n*error.log\nscratchings.js\ndist/\n.env\ncoverage/\n"
  },
  {
    "path": ".prettierignore",
    "chars": 17,
    "preview": "dist\n__fixtures__"
  },
  {
    "path": ".vscode/launch.json",
    "chars": 529,
    "preview": "{\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"type\": \"node\",\n      \"request\": \"launch\",\n      \"name\": \"Jest"
  },
  {
    "path": ".vscode/settings.json",
    "chars": 152,
    "preview": "{\n  \"typescript.tsdk\": \"node_modules/typescript/lib\",\n  \"grammarly.selectors\": [\n    {\n      \"language\": \"markdown\",\n   "
  },
  {
    "path": "FUNDING.json",
    "chars": 107,
    "preview": "{\n  \"drips\": {\n    \"ethereum\": {\n      \"ownedBy\": \"0x334C0464Ec1e9B32835B18465250c95aCa86FaF9\"\n    }\n  }\n}\n"
  },
  {
    "path": "LICENSE",
    "chars": 1068,
    "preview": "MIT License\n\nCopyright (c) 2019 Ben Conolly\n\nPermission is hereby granted, free of charge, to any person obtaining a cop"
  },
  {
    "path": "README.md",
    "chars": 6437,
    "preview": "<p align=\"center\">\n  <img src=\"./assets/images/changesets-banner-light.png\" />\n</p>\n\n<p align=\"center\">\n  A tool to mana"
  },
  {
    "path": "SECURITY.md",
    "chars": 221,
    "preview": "# Security policy\n\n## Supported versions\n\nThe latest version of the project is currently supported with security updates"
  },
  {
    "path": "assets/README.md",
    "chars": 400,
    "preview": "<p align=\"center\">\n  <a href=\"https://github.com/changesets/changesets\">\n    <img\n      alt=\"The Changesets logo concept"
  },
  {
    "path": "assets/images/README.md",
    "chars": 185,
    "preview": "<p align=\"center\">\n  <img src=\"./key.png\" />\n</p>\n<p align=\"center\">\n  <a href=\"https://www.figma.com/file/VaT6Eii1qcSI8"
  },
  {
    "path": "babel.config.js",
    "chars": 202,
    "preview": "module.exports = {\n  presets: [\n    [\n      \"@babel/preset-env\",\n      {\n        targets: { node: 8 },\n      },\n    ],\n "
  },
  {
    "path": "docs/adding-a-changeset.md",
    "chars": 3477,
    "preview": "# Adding a changeset\n\nHi! You might be here because a person or a bot has asked you to 'add a changeset' to a project. L"
  },
  {
    "path": "docs/automating-changesets.md",
    "chars": 3105,
    "preview": "# Automating Changesets\n\nWhile changesets are designed to work with a fully manual process, it also provides tools to he"
  },
  {
    "path": "docs/checking-for-changesets.md",
    "chars": 579,
    "preview": "# Checking for changesets\n\nUsing `@changesets/cli`, there is a `status` command. See the docs for it in the\n[@changesets"
  },
  {
    "path": "docs/command-line-options.md",
    "chars": 8859,
    "preview": "# Command line options\n\nThe command line for changesets is the main way of interacting with it. There are 4 main command"
  },
  {
    "path": "docs/common-questions.md",
    "chars": 1596,
    "preview": "# Common Questions\n\nA quick list of common questions you might want answered to understand what changesets is doing, wit"
  },
  {
    "path": "docs/config-file-options.md",
    "chars": 10228,
    "preview": "# Configuring Changesets\n\nChangesets has a minimal amount of configuration options. Mostly these are for when you need t"
  },
  {
    "path": "docs/decisions.md",
    "chars": 4291,
    "preview": "# Decisions\n\nThis file is a discussion of some of the rules and design decisions that have gone into making changesets. "
  },
  {
    "path": "docs/detailed-explanation.md",
    "chars": 3139,
    "preview": "# A Detailed Explanation of Changesets\n\nBelow, you will find a detailed explanation of what changesets are, and how they"
  },
  {
    "path": "docs/dictionary.md",
    "chars": 6031,
    "preview": "# Changesets Dictionary\n\nThis is a list of some words and phrases that are used in changesets which are helpful to know "
  },
  {
    "path": "docs/experimental-options.md",
    "chars": 716,
    "preview": "# Experimental Options\n\nAll experimental options are configured in `config.json` under `___experimentalUnsafeOptions_WIL"
  },
  {
    "path": "docs/fixed-packages.md",
    "chars": 1579,
    "preview": "# Fixed Packages\n\nFixed packages allow you to specify a group or groups of packages that should be versioned and publish"
  },
  {
    "path": "docs/intro-to-using-changesets.md",
    "chars": 2464,
    "preview": "# Using Changesets\n\nChangesets are designed to make your workflows easier, by allowing the person making contributions t"
  },
  {
    "path": "docs/linked-packages.md",
    "chars": 3001,
    "preview": "# Linked Packages\n\nLinked packages allow you to specify a group or groups of packages that should be versioned together."
  },
  {
    "path": "docs/modifying-changelog-format.md",
    "chars": 3000,
    "preview": "# Modifying The Changelog Formats\n\nChangesets comes with a default format for the changelogs for packages which is relat"
  },
  {
    "path": "docs/prereleases.md",
    "chars": 4782,
    "preview": "# Prereleases\n\n> Warning! Prereleases are very complicated! Using them requires a thorough understanding of all parts of"
  },
  {
    "path": "docs/problems-publishing-in-monorepos.md",
    "chars": 480,
    "preview": "# Problems Publishing in Monorepos\n\nMonorepos have a heap of complexity around how publishing to npm works. Changesets h"
  },
  {
    "path": "docs/snapshot-releases.md",
    "chars": 3000,
    "preview": "# Snapshot Releases\n\nSnapshot releases are a way to release your changes for testing without updating the versions. Both"
  },
  {
    "path": "docs/versioning-apps.md",
    "chars": 1560,
    "preview": "# Managing applications or non-npm packages\n\nChangesets can also be used to manage application versions or non-npm packa"
  },
  {
    "path": "jest.config.js",
    "chars": 139,
    "preview": "module.exports = {\n  clearMocks: true,\n  watchPlugins: [\n    \"jest-watch-typeahead/filename\",\n    \"jest-watch-typeahead/"
  },
  {
    "path": "package.json",
    "chars": 2442,
    "preview": "{\n  \"name\": \"@changesets/repository\",\n  \"version\": \"1.0.0\",\n  \"private\": true,\n  \"description\": \"A tool to help manage t"
  },
  {
    "path": "packages/apply-release-plan/CHANGELOG.md",
    "chars": 32570,
    "preview": "# @changesets/apply-release-plan\n\n## 7.1.0\n\n### Minor Changes\n\n- [#1774](https://github.com/changesets/changesets/pull/1"
  },
  {
    "path": "packages/apply-release-plan/README.md",
    "chars": 1150,
    "preview": "# Apply Release Plan\n\n[![npm package](https://img.shields.io/npm/v/@changesets/apply-release-plan)](https://npmjs.com/pa"
  },
  {
    "path": "packages/apply-release-plan/package.json",
    "chars": 1346,
    "preview": "{\n  \"name\": \"@changesets/apply-release-plan\",\n  \"version\": \"7.1.0\",\n  \"description\": \"Takes a release plan and applies i"
  },
  {
    "path": "packages/apply-release-plan/src/get-changelog-entry.ts",
    "chars": 3504,
    "preview": "import { ChangelogFunctions, NewChangesetWithCommit } from \"@changesets/types\";\n\nimport { ModCompWithPackage } from \"@ch"
  },
  {
    "path": "packages/apply-release-plan/src/index.test.ts",
    "chars": 101631,
    "preview": "import {\n  ReleasePlan,\n  Config,\n  NewChangeset,\n  ComprehensiveRelease,\n  PreState,\n} from \"@changesets/types\";\nimport"
  },
  {
    "path": "packages/apply-release-plan/src/index.ts",
    "chars": 11221,
    "preview": "import { defaultConfig } from \"@changesets/config\";\nimport * as git from \"@changesets/git\";\nimport { shouldSkipPackage }"
  },
  {
    "path": "packages/apply-release-plan/src/test-utils/failing-functions.ts",
    "chars": 160,
    "preview": "export default {\n  getReleaseLine: () => {\n    throw new Error(\"no chance\");\n  },\n  getDependencyReleaseLine: () => {\n  "
  },
  {
    "path": "packages/apply-release-plan/src/test-utils/get-changelog-dep-updated.ts",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "packages/apply-release-plan/src/test-utils/get-changelog-entry-with-git-hash.ts",
    "chars": 1800,
    "preview": "/* eslint-disable import/no-extraneous-dependencies */\nimport startCase from \"lodash.startcase\";\nimport { getCommitsThat"
  },
  {
    "path": "packages/apply-release-plan/src/test-utils/simple-get-changelog-entry.ts",
    "chars": 260,
    "preview": "// We are doing it here to avoide adding a circular dependency and as this is only used in testing.\n// This is wicked, a"
  },
  {
    "path": "packages/apply-release-plan/src/test-utils/simple-get-commit-entry.ts",
    "chars": 257,
    "preview": "// We are doing it here to avoide adding a circular dependency and as this is only used in testing.\n// This is wicked, a"
  },
  {
    "path": "packages/apply-release-plan/src/types.ts",
    "chars": 164,
    "preview": "import { NewChangeset } from \"@changesets/types\";\n\nexport type RelevantChangesets = {\n  major: NewChangeset[];\n  minor: "
  },
  {
    "path": "packages/apply-release-plan/src/utils.ts",
    "chars": 1342,
    "preview": "/**\n * Shared utility functions and business logic\n */\nimport semverSatisfies from \"semver/functions/satisfies\";\nimport "
  },
  {
    "path": "packages/apply-release-plan/src/version-package.ts",
    "chars": 3497,
    "preview": "import {\n  ComprehensiveRelease,\n  PackageJSON,\n  VersionType,\n} from \"@changesets/types\";\nimport getVersionRangeType fr"
  },
  {
    "path": "packages/assemble-release-plan/CHANGELOG.md",
    "chars": 25720,
    "preview": "# @changesets/assemble-release-plan\n\n## 6.0.9\n\n### Patch Changes\n\n- [#1693](https://github.com/changesets/changesets/pul"
  },
  {
    "path": "packages/assemble-release-plan/README.md",
    "chars": 1550,
    "preview": "# Assemble Release Plan\n\n[![npm package](https://img.shields.io/npm/v/@changesets/assemble-release-plan)](https://npmjs."
  },
  {
    "path": "packages/assemble-release-plan/package.json",
    "chars": 1155,
    "preview": "{\n  \"name\": \"@changesets/assemble-release-plan\",\n  \"version\": \"6.0.9\",\n  \"description\": \"Reads changesets and adds infor"
  },
  {
    "path": "packages/assemble-release-plan/src/README.md",
    "chars": 148,
    "preview": "# Get Release Info\n\nThis package does the end-to-end work of reading in the current set of changesets, and generating a "
  },
  {
    "path": "packages/assemble-release-plan/src/apply-links.ts",
    "chars": 2102,
    "preview": "import { Linked } from \"@changesets/types\";\nimport { Package } from \"@manypkg/get-packages\";\nimport { InternalRelease } "
  },
  {
    "path": "packages/assemble-release-plan/src/determine-dependents.ts",
    "chars": 8348,
    "preview": "import { shouldSkipPackage } from \"@changesets/should-skip-package\";\nimport {\n  Config,\n  DependencyType,\n  PackageJSON,"
  },
  {
    "path": "packages/assemble-release-plan/src/flatten-releases.ts",
    "chars": 2215,
    "preview": "// This function takes in changesets and returns one release per\n// package listed in the changesets\n\nimport { shouldSki"
  },
  {
    "path": "packages/assemble-release-plan/src/increment.test.ts",
    "chars": 741,
    "preview": "import { incrementVersion } from \"./increment\";\nimport { InternalRelease, PreInfo } from \"./types\";\n\ndescribe(\"increment"
  },
  {
    "path": "packages/assemble-release-plan/src/increment.ts",
    "chars": 868,
    "preview": "import semverInc from \"semver/functions/inc\";\nimport { InternalRelease, PreInfo } from \"./types\";\nimport { mapGetOrThrow"
  },
  {
    "path": "packages/assemble-release-plan/src/index.test.ts",
    "chars": 46624,
    "preview": "import { defaultConfig } from \"@changesets/config\";\nimport assembleReleasePlan from \"./\";\nimport FakeFullState from \"./t"
  },
  {
    "path": "packages/assemble-release-plan/src/index.ts",
    "chars": 12719,
    "preview": "import { InternalError } from \"@changesets/errors\";\nimport { getDependentsGraph } from \"@changesets/get-dependents-graph"
  },
  {
    "path": "packages/assemble-release-plan/src/match-fixed-constraint.ts",
    "chars": 2030,
    "preview": "import { shouldSkipPackage } from \"@changesets/should-skip-package\";\nimport { Config } from \"@changesets/types\";\nimport "
  },
  {
    "path": "packages/assemble-release-plan/src/test-utils.ts",
    "chars": 3611,
    "preview": "import { NewChangeset, Release, VersionType } from \"@changesets/types\";\nimport { Package, Packages } from \"@manypkg/get-"
  },
  {
    "path": "packages/assemble-release-plan/src/types.ts",
    "chars": 261,
    "preview": "import { VersionType, PreState } from \"@changesets/types\";\n\nexport type InternalRelease = {\n  name: string;\n  type: Vers"
  },
  {
    "path": "packages/assemble-release-plan/src/utils.ts",
    "chars": 2005,
    "preview": "import { PackageGroup, VersionType } from \"@changesets/types\";\nimport { Package } from \"@manypkg/get-packages\";\nimport s"
  },
  {
    "path": "packages/changelog-git/CHANGELOG.md",
    "chars": 4827,
    "preview": "# @changesets/changelog-git\n\n## 0.2.1\n\n### Patch Changes\n\n- Updated dependencies [[`84a4a1b`](https://github.com/changes"
  },
  {
    "path": "packages/changelog-git/package.json",
    "chars": 812,
    "preview": "{\n  \"name\": \"@changesets/changelog-git\",\n  \"version\": \"0.2.1\",\n  \"description\": \"A changelog entry generator for git tha"
  },
  {
    "path": "packages/changelog-git/src/index.ts",
    "chars": 1276,
    "preview": "import {\n  NewChangesetWithCommit,\n  VersionType,\n  ChangelogFunctions,\n  ModCompWithPackage,\n} from \"@changesets/types\""
  },
  {
    "path": "packages/changelog-github/CHANGELOG.md",
    "chars": 10616,
    "preview": "# @changesets/changelog-github\n\n## 0.6.0\n\n### Minor Changes\n\n- [#1850](https://github.com/changesets/changesets/pull/185"
  },
  {
    "path": "packages/changelog-github/package.json",
    "chars": 986,
    "preview": "{\n  \"name\": \"@changesets/changelog-github\",\n  \"version\": \"0.6.0\",\n  \"description\": \"A changelog entry generator for GitH"
  },
  {
    "path": "packages/changelog-github/src/index.test.ts",
    "chars": 8140,
    "preview": "import changelogFunctions from \"./index\";\nimport parse from \"@changesets/parse\";\n\nconst getReleaseLine = changelogFuncti"
  },
  {
    "path": "packages/changelog-github/src/index.ts",
    "chars": 4684,
    "preview": "import { ChangelogFunctions } from \"@changesets/types\";\n// @ts-ignore\nimport { config } from \"dotenv\";\nimport { getInfo,"
  },
  {
    "path": "packages/cli/CHANGELOG.md",
    "chars": 113861,
    "preview": "# @changesets/cli\n\n## 2.30.0\n\n### Minor Changes\n\n- [#1840](https://github.com/changesets/changesets/pull/1840) [`057cca2"
  },
  {
    "path": "packages/cli/LICENSE",
    "chars": 1068,
    "preview": "MIT License\n\nCopyright (c) 2019 Ben Conolly\n\nPermission is hereby granted, free of charge, to any person obtaining a cop"
  },
  {
    "path": "packages/cli/README.md",
    "chars": 7321,
    "preview": "## @changesets/cli 🦋\n\n[![npm package](https://img.shields.io/npm/v/@changesets/cli)](https://npmjs.com/package/@changese"
  },
  {
    "path": "packages/cli/bin.js",
    "chars": 50,
    "preview": "#!/usr/bin/env node\n\"use strict\";\n\nrequire(\"./\");\n"
  },
  {
    "path": "packages/cli/changelog/package.json",
    "chars": 105,
    "preview": "{\n  \"main\": \"dist/changesets-cli-changelog.cjs.js\",\n  \"module\": \"dist/changesets-cli-changelog.esm.js\"\n}\n"
  },
  {
    "path": "packages/cli/commit/package.json",
    "chars": 99,
    "preview": "{\n  \"main\": \"dist/changesets-cli-commit.cjs.js\",\n  \"module\": \"dist/changesets-cli-commit.esm.js\"\n}\n"
  },
  {
    "path": "packages/cli/default-files/README.md",
    "chars": 512,
    "preview": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that wo"
  },
  {
    "path": "packages/cli/package.json",
    "chars": 3186,
    "preview": "{\n  \"name\": \"@changesets/cli\",\n  \"version\": \"2.30.0\",\n  \"description\": \"Organise your package versioning and publishing "
  },
  {
    "path": "packages/cli/src/changelog.ts",
    "chars": 53,
    "preview": "export { default } from \"@changesets/changelog-git\";\n"
  },
  {
    "path": "packages/cli/src/commands/add/__tests__/add.ts",
    "chars": 17707,
    "preview": "import path from \"path\";\nimport stripAnsi from \"strip-ansi\";\nimport * as git from \"@changesets/git\";\nimport { defaultCon"
  },
  {
    "path": "packages/cli/src/commands/add/createChangeset.ts",
    "chars": 8378,
    "preview": "import pc from \"picocolors\";\n\nimport semverLt from \"semver/functions/lt\";\n\nimport * as cli from \"../../utils/cli-utiliti"
  },
  {
    "path": "packages/cli/src/commands/add/index.ts",
    "chars": 4765,
    "preview": "import pc from \"picocolors\";\nimport { spawn } from \"child_process\";\nimport path from \"path\";\n\nimport * as git from \"@cha"
  },
  {
    "path": "packages/cli/src/commands/add/messages.ts",
    "chars": 1256,
    "preview": "import pc from \"picocolors\";\nimport { log } from \"@changesets/logger\";\nimport { Release, VersionType } from \"@changesets"
  },
  {
    "path": "packages/cli/src/commands/init/__tests__/command.ts",
    "chars": 2202,
    "preview": "import fs from \"fs-extra\";\nimport path from \"path\";\nimport { defaultWrittenConfig } from \"@changesets/config\";\nimport { "
  },
  {
    "path": "packages/cli/src/commands/init/index.ts",
    "chars": 2558,
    "preview": "import path from \"path\";\nimport fs from \"fs-extra\";\nimport pc from \"picocolors\";\n\nimport { defaultWrittenConfig } from \""
  },
  {
    "path": "packages/cli/src/commands/pre/index.test.ts",
    "chars": 3508,
    "preview": "import path from \"path\";\nimport pc from \"picocolors\";\nimport * as fs from \"fs-extra\";\nimport * as logger from \"@changese"
  },
  {
    "path": "packages/cli/src/commands/pre/index.ts",
    "chars": 1496,
    "preview": "import * as logger from \"@changesets/logger\";\nimport pc from \"picocolors\";\nimport { exitPre, enterPre } from \"@changeset"
  },
  {
    "path": "packages/cli/src/commands/publish/__tests__/index.test.ts",
    "chars": 1089,
    "preview": "import publishCommand from \"../index\";\nimport { defaultConfig } from \"@changesets/config\";\nimport * as path from \"path\";"
  },
  {
    "path": "packages/cli/src/commands/publish/__tests__/publishPackages.test.ts",
    "chars": 1259,
    "preview": "import publishPackages from \"../publishPackages\";\nimport * as npmUtils from \"../npm-utils\";\nimport { getPackages } from "
  },
  {
    "path": "packages/cli/src/commands/publish/__tests__/releaseCommand.test.ts",
    "chars": 1698,
    "preview": "import publishPackages from \"../publishPackages\";\nimport * as git from \"@changesets/git\";\nimport { defaultConfig } from "
  },
  {
    "path": "packages/cli/src/commands/publish/index.ts",
    "chars": 4229,
    "preview": "import publishPackages, { PublishedResult } from \"./publishPackages\";\nimport { ExitError } from \"@changesets/errors\";\nim"
  },
  {
    "path": "packages/cli/src/commands/publish/npm-utils.ts",
    "chars": 10555,
    "preview": "import { spawnSync } from \"child_process\";\nimport { ExitError } from \"@changesets/errors\";\nimport { error, info, warn } "
  },
  {
    "path": "packages/cli/src/commands/publish/publishPackages.ts",
    "chars": 5407,
    "preview": "import { resolve } from \"path\";\nimport semverParse from \"semver/functions/parse\";\nimport pc from \"picocolors\";\nimport { "
  },
  {
    "path": "packages/cli/src/commands/status/__tests__/status.ts",
    "chars": 15619,
    "preview": "import { read } from \"@changesets/config\";\nimport * as git from \"@changesets/git\";\nimport { gitdir, silenceLogsInBlock }"
  },
  {
    "path": "packages/cli/src/commands/status/index.ts",
    "chars": 2745,
    "preview": "import pc from \"picocolors\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport getReleasePlan from \"@changesets"
  },
  {
    "path": "packages/cli/src/commands/tag/__tests__/index.test.ts",
    "chars": 3584,
    "preview": "import { read } from \"@changesets/config\";\nimport * as git from \"@changesets/git\";\nimport { silenceLogsInBlock, testdir "
  },
  {
    "path": "packages/cli/src/commands/tag/index.ts",
    "chars": 1048,
    "preview": "import * as git from \"@changesets/git\";\nimport { log } from \"@changesets/logger\";\nimport { shouldSkipPackage } from \"@ch"
  },
  {
    "path": "packages/cli/src/commands/version/index.ts",
    "chars": 3565,
    "preview": "import pc from \"picocolors\";\nimport path from \"path\";\nimport * as git from \"@changesets/git\";\nimport { log, warn, error "
  },
  {
    "path": "packages/cli/src/commands/version/version.test.ts",
    "chars": 90688,
    "preview": "import fs from \"fs-extra\";\nimport path from \"path\";\nimport * as git from \"@changesets/git\";\nimport { warn } from \"@chang"
  },
  {
    "path": "packages/cli/src/commit/commit.test.ts",
    "chars": 5161,
    "preview": "import outdent from \"outdent\";\nimport defaultCommitFunctions from \".\";\nimport { NewChangeset, ReleasePlan } from \"@chang"
  },
  {
    "path": "packages/cli/src/commit/getCommitFunctions.ts",
    "chars": 1132,
    "preview": "import { CommitFunctions } from \"@changesets/types\";\nimport path from \"path\";\nimport resolveFrom from \"resolve-from\";\n\ne"
  },
  {
    "path": "packages/cli/src/commit/index.ts",
    "chars": 1227,
    "preview": "import { Changeset, CommitFunctions, ReleasePlan } from \"@changesets/types\";\n\ntype SkipCI = boolean | \"add\" | \"version\";"
  },
  {
    "path": "packages/cli/src/index.ts",
    "chars": 3190,
    "preview": "import mri from \"mri\";\nimport { ExitError, InternalError } from \"@changesets/errors\";\nimport { error } from \"@changesets"
  },
  {
    "path": "packages/cli/src/run.test.ts",
    "chars": 12499,
    "preview": "import path from \"path\";\nimport { error } from \"@changesets/logger\";\nimport { testdir } from \"@changesets/test-utils\";\ni"
  },
  {
    "path": "packages/cli/src/run.ts",
    "chars": 8940,
    "preview": "import { read } from \"@changesets/config\";\nimport { ExitError } from \"@changesets/errors\";\nimport { getDependentsGraph }"
  },
  {
    "path": "packages/cli/src/types.ts",
    "chars": 407,
    "preview": "export type CliOptions = {\n  sinceMaster?: boolean;\n  verbose?: boolean;\n  output?: string;\n  otp?: string;\n  empty?: bo"
  },
  {
    "path": "packages/cli/src/utils/cli-utilities.ts",
    "chars": 3785,
    "preview": "// @ts-ignore it's not worth writing a TS declaration file in this repo for a tiny module we use once like this\nimport t"
  },
  {
    "path": "packages/cli/src/utils/createPromiseQueue.test.ts",
    "chars": 3437,
    "preview": "import { createPromiseQueue } from \"./createPromiseQueue\";\n\nfunction asyncSpy(implementation: () => unknown = () => {}) "
  },
  {
    "path": "packages/cli/src/utils/createPromiseQueue.ts",
    "chars": 1474,
    "preview": "interface PromiseWithResolvers<T> {\n  promise: Promise<T>;\n  resolve: (value: T | PromiseLike<T>) => void;\n  reject: (re"
  },
  {
    "path": "packages/cli/src/utils/getLastJsonObjectFromString.test.ts",
    "chars": 2051,
    "preview": "import { getLastJsonObjectFromString } from \"./getLastJsonObjectFromString\";\n\ndescribe(\"getLastJsonObjectFromString\", ()"
  },
  {
    "path": "packages/cli/src/utils/getLastJsonObjectFromString.ts",
    "chars": 372,
    "preview": "export const getLastJsonObjectFromString = (str: string) => {\n  str = str.replace(/[^}]*$/, \"\");\n\n  while (str) {\n    st"
  },
  {
    "path": "packages/cli/src/utils/getUntaggedPackages.ts",
    "chars": 1012,
    "preview": "import * as git from \"@changesets/git\";\nimport { Package, Tool } from \"@manypkg/get-packages\";\nimport { PublishedResult "
  },
  {
    "path": "packages/cli/src/utils/types.ts",
    "chars": 116,
    "preview": "export type TwoFactorState = {\n  token: string | undefined;\n  isRequired: boolean;\n  allowConcurrency?: boolean;\n};\n"
  },
  {
    "path": "packages/cli/src/utils/v1-legacy/README.md",
    "chars": 160,
    "preview": "# Quick Note\n\nThese exist in the changeset codebase specifically to support still processing v1 changesets\nand should be"
  },
  {
    "path": "packages/cli/src/utils/v1-legacy/removeFolders.ts",
    "chars": 760,
    "preview": "import path from \"path\";\nimport fs from \"fs-extra\";\n\n// This helper is designed to operate on the .changeset\n// folder, "
  },
  {
    "path": "packages/cli/src/utils/versionablePackages.ts",
    "chars": 670,
    "preview": "import { Config } from \"@changesets/types\";\nimport { getChangedPackagesSinceRef } from \"@changesets/git\";\nimport { shoul"
  },
  {
    "path": "packages/config/CHANGELOG.md",
    "chars": 21733,
    "preview": "# @changesets/config\n\n## 3.1.3\n\n### Patch Changes\n\n- [#1834](https://github.com/changesets/changesets/pull/1834) [`b6f4c"
  },
  {
    "path": "packages/config/README.md",
    "chars": 643,
    "preview": "# @changesets/config\n\n> Utilities for reading and parsing Changeset's config\n\n[![npm package](https://img.shields.io/npm"
  },
  {
    "path": "packages/config/package.json",
    "chars": 1363,
    "preview": "{\n  \"name\": \"@changesets/config\",\n  \"version\": \"3.1.3\",\n  \"description\": \"Utilities for reading and parsing Changeset's "
  },
  {
    "path": "packages/config/schema.json",
    "chars": 4343,
    "preview": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"changelog\": {\n     "
  },
  {
    "path": "packages/config/src/index.test.ts",
    "chars": 31058,
    "preview": "import { read, parse } from \"./\";\nimport jestInCase from \"jest-in-case\";\nimport * as logger from \"@changesets/logger\";\ni"
  },
  {
    "path": "packages/config/src/index.ts",
    "chars": 20023,
    "preview": "import * as fs from \"fs-extra\";\nimport path from \"path\";\nimport micromatch from \"micromatch\";\nimport { ValidationError }"
  },
  {
    "path": "packages/errors/CHANGELOG.md",
    "chars": 2397,
    "preview": "# @changesets/errors\n\n## 0.2.0\n\n### Minor Changes\n\n- [#1185](https://github.com/changesets/changesets/pull/1185) [`a9716"
  },
  {
    "path": "packages/errors/README.md",
    "chars": 263,
    "preview": "# @changesets/errors\n\n[![npm package](https://img.shields.io/npm/v/@changesets/errors)](https://npmjs.com/package/@chang"
  },
  {
    "path": "packages/errors/package.json",
    "chars": 723,
    "preview": "{\n  \"name\": \"@changesets/errors\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Error classes for @changesets\",\n  \"main\": \"dis"
  },
  {
    "path": "packages/errors/src/index.test.ts",
    "chars": 470,
    "preview": "import { GitError } from \"./index\";\n\ndescribe(\"Error classes\", () => {\n  describe(\"GitError class\", () => {\n    let erro"
  },
  {
    "path": "packages/errors/src/index.ts",
    "chars": 880,
    "preview": "import ExtendableError from \"extendable-error\";\n\nexport class GitError extends ExtendableError {\n  code: number;\n  const"
  },
  {
    "path": "packages/get-dependents-graph/CHANGELOG.md",
    "chars": 8893,
    "preview": "# @changesets/get-dependents-graph\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [[`84a4a1b`](https://github.com/"
  },
  {
    "path": "packages/get-dependents-graph/README.md",
    "chars": 646,
    "preview": "# Get Dependents Graph\n\n[![npm package](https://img.shields.io/npm/v/@changesets/get-dependents-graph)](https://npmjs.co"
  },
  {
    "path": "packages/get-dependents-graph/package.json",
    "chars": 1015,
    "preview": "{\n  \"name\": \"@changesets/get-dependents-graph\",\n  \"version\": \"2.1.3\",\n  \"description\": \"Get the graph of dependents in a"
  },
  {
    "path": "packages/get-dependents-graph/src/get-dependency-graph.test.ts",
    "chars": 5078,
    "preview": "import { temporarilySilenceLogs } from \"@changesets/test-utils\";\nimport getDependencyGraph from \"./get-dependency-graph\""
  },
  {
    "path": "packages/get-dependents-graph/src/get-dependency-graph.ts",
    "chars": 3506,
    "preview": "// This is a modified version of the graph-getting in bolt\nimport Range from \"semver/classes/range\";\nimport pc from \"pic"
  },
  {
    "path": "packages/get-dependents-graph/src/index.ts",
    "chars": 1476,
    "preview": "import { Packages, Package } from \"@manypkg/get-packages\";\nimport getDependencyGraph from \"./get-dependency-graph\";\n\nexp"
  },
  {
    "path": "packages/get-github-info/CHANGELOG.md",
    "chars": 7612,
    "preview": "# @changesets/get-github-info\n\n## 0.8.0\n\n### Minor Changes\n\n- [#1758](https://github.com/changesets/changesets/pull/1758"
  },
  {
    "path": "packages/get-github-info/README.md",
    "chars": 2696,
    "preview": "# @changesets/get-github-info\n\n[![npm package](https://img.shields.io/npm/v/@changesets/get-github-info)](https://npmjs."
  },
  {
    "path": "packages/get-github-info/package.json",
    "chars": 959,
    "preview": "{\n  \"name\": \"@changesets/get-github-info\",\n  \"version\": \"0.8.0\",\n  \"description\": \"Get the GitHub username and PR number"
  },
  {
    "path": "packages/get-github-info/src/index.test.ts",
    "chars": 14992,
    "preview": "import { getInfo, getInfoFromPullRequest } from \".\";\nimport nock from \"nock\";\nimport prettier from \"prettier\";\n\nprocess."
  },
  {
    "path": "packages/get-github-info/src/index.ts",
    "chars": 8345,
    "preview": "import fetch from \"node-fetch\";\nimport DataLoader from \"dataloader\";\n\nfunction readEnv() {\n  const GITHUB_GRAPHQL_URL =\n"
  },
  {
    "path": "packages/get-release-plan/CHANGELOG.md",
    "chars": 20997,
    "preview": "# @changesets/get-release-plan\n\n## 4.0.15\n\n### Patch Changes\n\n- Updated dependencies [[`b6f4c74`](https://github.com/cha"
  },
  {
    "path": "packages/get-release-plan/README.md",
    "chars": 863,
    "preview": "# @changesets/get-release-plan\n\n[![npm package](https://img.shields.io/npm/v/@changesets/get-release-plan)](https://npmj"
  },
  {
    "path": "packages/get-release-plan/package.json",
    "chars": 1048,
    "preview": "{\n  \"name\": \"@changesets/get-release-plan\",\n  \"version\": \"4.0.15\",\n  \"description\": \"Reads changesets and adds informati"
  },
  {
    "path": "packages/get-release-plan/src/index.ts",
    "chars": 839,
    "preview": "import assembleReleasePlan from \"@changesets/assemble-release-plan\";\nimport readChangesets from \"@changesets/read\";\nimpo"
  },
  {
    "path": "packages/get-version-range-type/CHANGELOG.md",
    "chars": 2194,
    "preview": "# @changesets/get-version-range-type\n\n## 0.4.0\n\n### Minor Changes\n\n- [#1185](https://github.com/changesets/changesets/pu"
  },
  {
    "path": "packages/get-version-range-type/README.md",
    "chars": 496,
    "preview": "# @changesets/get-version-range-type\n\n[![npm package](https://img.shields.io/npm/v/@changesets/get-version-range-type)]("
  },
  {
    "path": "packages/get-version-range-type/package.json",
    "chars": 843,
    "preview": "{\n  \"name\": \"@changesets/get-version-range-type\",\n  \"version\": \"0.4.0\",\n  \"description\": \"Common get-version-range-type "
  },
  {
    "path": "packages/get-version-range-type/src/index.test.ts",
    "chars": 306,
    "preview": "import getVersionRangeType from \"./\";\n\ntest.each([\n  [\"^1.0.0\", \"^\"],\n  [\"~1.0.0\", \"~\"],\n  [\">=1.0.0\", \">=\"],\n  [\"<=1.0."
  },
  {
    "path": "packages/get-version-range-type/src/index.ts",
    "chars": 373,
    "preview": "export default function getVersionRangeType(\n  versionRange: string\n): \"^\" | \"~\" | \">=\" | \"<=\" | \">\" | \"\" {\n  if (versio"
  },
  {
    "path": "packages/git/CHANGELOG.md",
    "chars": 16605,
    "preview": "# @changesets/git\n\n## 3.0.4\n\n### Patch Changes\n\n- [#1636](https://github.com/changesets/changesets/pull/1636) [`f73f84a`"
  },
  {
    "path": "packages/git/README.md",
    "chars": 371,
    "preview": "# @changesets/git\n\n[![npm package](https://img.shields.io/npm/v/@changesets/git)](https://npmjs.com/package/@changesets/"
  },
  {
    "path": "packages/git/package.json",
    "chars": 991,
    "preview": "{\n  \"name\": \"@changesets/git\",\n  \"version\": \"3.0.4\",\n  \"description\": \"Some git helpers that changesets use to get infor"
  },
  {
    "path": "packages/git/src/index.test.ts",
    "chars": 26321,
    "preview": "import path from \"path\";\nimport fs from \"fs-extra\";\nimport spawn from \"spawndamnit\";\nimport fileUrl from \"file-url\";\nimp"
  },
  {
    "path": "packages/git/src/index.ts",
    "chars": 9171,
    "preview": "import spawn from \"spawndamnit\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport { getPackages, Package } from \"@ma"
  },
  {
    "path": "packages/logger/CHANGELOG.md",
    "chars": 2118,
    "preview": "# @changesets/logger\n\n## 0.1.1\n\n### Patch Changes\n\n- [#1417](https://github.com/changesets/changesets/pull/1417) [`bc75c"
  },
  {
    "path": "packages/logger/README.md",
    "chars": 1393,
    "preview": "## @changesets/logger\n\n[![npm package](https://img.shields.io/npm/v/@changesets/logger)](https://npmjs.com/package/@chan"
  },
  {
    "path": "packages/logger/package.json",
    "chars": 705,
    "preview": "{\n  \"name\": \"@changesets/logger\",\n  \"version\": \"0.1.1\",\n  \"description\": \"Console log alias\",\n  \"main\": \"dist/changesets"
  },
  {
    "path": "packages/logger/src/index.test.ts",
    "chars": 2348,
    "preview": "import { log, error, info, warn, success } from \"./index\";\n\ndescribe(\"@changesets/logger\", () => {\n  const logMessageOne"
  },
  {
    "path": "packages/logger/src/index.ts",
    "chars": 817,
    "preview": "import pc from \"picocolors\";\nimport util from \"util\";\n\nexport let prefix = \"🦋 \";\n\nfunction format(args: Array<any>, cust"
  },
  {
    "path": "packages/parse/CHANGELOG.md",
    "chars": 7531,
    "preview": "# @changesets/parse\n\n## 0.4.3\n\n### Patch Changes\n\n- [#1831](https://github.com/changesets/changesets/pull/1831) [`1f9187"
  },
  {
    "path": "packages/parse/README.md",
    "chars": 1055,
    "preview": "# @changesets/parse\n\n[![npm package](https://img.shields.io/npm/v/@changesets/parse)](https://npmjs.com/package/@changes"
  },
  {
    "path": "packages/parse/package.json",
    "chars": 854,
    "preview": "{\n  \"name\": \"@changesets/parse\",\n  \"version\": \"0.4.3\",\n  \"description\": \"Parse a changeset file's contents into a usable"
  },
  {
    "path": "packages/parse/src/index.test.ts",
    "chars": 9802,
    "preview": "import outdent from \"outdent\";\n\nimport parse from \"./\";\n\ndescribe(\"parsing a changeset\", () => {\n  it(\"should parse a ch"
  },
  {
    "path": "packages/parse/src/index.ts",
    "chars": 3484,
    "preview": "import yaml from \"js-yaml\";\nimport { Release, VersionType } from \"@changesets/types\";\n\nconst mdRegex = /\\s*---([^]*?)\\n\\"
  },
  {
    "path": "packages/pre/CHANGELOG.md",
    "chars": 7933,
    "preview": "# @changesets/pre\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [[`84a4a1b`](https://github.com/changesets/change"
  },
  {
    "path": "packages/pre/README.md",
    "chars": 1064,
    "preview": "# @changesets/pre\n\n[![npm package](https://img.shields.io/npm/v/@changesets/pre)](https://npmjs.com/package/@changesets/"
  },
  {
    "path": "packages/pre/package.json",
    "chars": 886,
    "preview": "{\n  \"name\": \"@changesets/pre\",\n  \"version\": \"2.0.2\",\n  \"description\": \"Utils to make a Changesets repo enter and exit pr"
  },
  {
    "path": "packages/pre/src/index.test.ts",
    "chars": 5617,
    "preview": "import { enterPre, exitPre, readPreState } from \"./index\";\nimport * as fs from \"fs-extra\";\nimport path from \"path\";\nimpo"
  },
  {
    "path": "packages/pre/src/index.ts",
    "chars": 2084,
    "preview": "import * as fs from \"fs-extra\";\nimport path from \"path\";\nimport { PreState } from \"@changesets/types\";\nimport { getPacka"
  },
  {
    "path": "packages/read/CHANGELOG.md",
    "chars": 13692,
    "preview": "# @changesets/read\n\n## 0.6.7\n\n### Patch Changes\n\n- Updated dependencies [[`1f91879`](https://github.com/changesets/chang"
  },
  {
    "path": "packages/read/README.md",
    "chars": 420,
    "preview": "# @changesets/read\n\n[![npm package](https://img.shields.io/npm/v/@changesets/read)](https://npmjs.com/package/@changeset"
  },
  {
    "path": "packages/read/package.json",
    "chars": 1039,
    "preview": "{\n  \"name\": \"@changesets/read\",\n  \"version\": \"0.6.7\",\n  \"description\": \"Read changesets from disc, and return the inform"
  },
  {
    "path": "packages/read/src/index.test.ts",
    "chars": 6714,
    "preview": "import fs from \"fs-extra\";\nimport path from \"node:path\";\n\nimport read from \"./\";\nimport { gitdir, silenceLogsInBlock, te"
  },
  {
    "path": "packages/read/src/index.ts",
    "chars": 1724,
    "preview": "import fs from \"fs-extra\";\nimport path from \"path\";\nimport parse from \"@changesets/parse\";\nimport { NewChangeset } from "
  },
  {
    "path": "packages/read/src/legacy.ts",
    "chars": 2036,
    "preview": "import path from \"path\";\nimport pc from \"picocolors\";\nimport { NewChangeset } from \"@changesets/types\";\nimport * as fs f"
  },
  {
    "path": "packages/release-utils/CHANGELOG.md",
    "chars": 5636,
    "preview": "# @changesets/release-utils\n\n## 0.2.7\n\n### Patch Changes\n\n- Updated dependencies []:\n  - @changesets/read@0.6.7\n\n## 0.2."
  },
  {
    "path": "packages/release-utils/package.json",
    "chars": 1175,
    "preview": "{\n  \"name\": \"@changesets/release-utils\",\n  \"version\": \"0.2.7\",\n  \"repository\": \"https://github.com/changesets/changesets"
  },
  {
    "path": "packages/release-utils/src/__snapshots__/utils.test.ts.snap",
    "chars": 822,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`it sorts the things right 1`] = `\n[\n  {\n    \"highestLevel\": 3,\n    "
  },
  {
    "path": "packages/release-utils/src/fake-publish-script-multi-package.js",
    "chars": 293,
    "preview": "/* eslint-disable import/no-commonjs */\n/* eslint-disable import/no-extraneous-dependencies */\nconst git = require(\"@cha"
  },
  {
    "path": "packages/release-utils/src/fake-publish-script-single-package.js",
    "chars": 205,
    "preview": "/* eslint-disable import/no-commonjs */\n/* eslint-disable import/no-extraneous-dependencies */\nconst git = require(\"@cha"
  },
  {
    "path": "packages/release-utils/src/gitUtils.ts",
    "chars": 1743,
    "preview": "import { execWithOutput } from \"./utils\";\n\nexport const getCurrentBranch = async (cwd: string) => {\n  const { stdout } ="
  },
  {
    "path": "packages/release-utils/src/index.ts",
    "chars": 208,
    "preview": "export { readChangesetState } from \"./readChangesetState\";\nexport { runPublish as publish, runVersion as version } from "
  },
  {
    "path": "packages/release-utils/src/readChangesetState.ts",
    "chars": 786,
    "preview": "import { PreState, NewChangeset } from \"@changesets/types\";\nimport { readPreState } from \"@changesets/pre\";\nimport readC"
  },
  {
    "path": "packages/release-utils/src/run.test.ts",
    "chars": 9389,
    "preview": "import { add, commit } from \"@changesets/git\";\nimport { silenceLogsInBlock, tempdir, testdir } from \"@changesets/test-ut"
  },
  {
    "path": "packages/release-utils/src/run.ts",
    "chars": 4011,
    "preview": "import { getPackages, Package } from \"@manypkg/get-packages\";\nimport path from \"path\";\nimport semverLt from \"semver/func"
  },
  {
    "path": "packages/release-utils/src/utils.test.ts",
    "chars": 2484,
    "preview": "import { getChangelogEntry, BumpLevels, sortChangelogEntries } from \"./utils\";\n\nlet changelog = `# @keystone-alpha/email"
  },
  {
    "path": "packages/release-utils/src/utils.ts",
    "chars": 3453,
    "preview": "import { getPackages, Package } from \"@manypkg/get-packages\";\n// @ts-ignore\nimport mdastToString from \"mdast-util-to-str"
  },
  {
    "path": "packages/should-skip-package/CHANGELOG.md",
    "chars": 501,
    "preview": "# @changesets/should-skip-package\n\n## 0.1.2\n\n### Patch Changes\n\n- Updated dependencies [[`84a4a1b`](https://github.com/c"
  },
  {
    "path": "packages/should-skip-package/package.json",
    "chars": 985,
    "preview": "{\n  \"name\": \"@changesets/should-skip-package\",\n  \"version\": \"0.1.2\",\n  \"description\": \"Checks if a package should be ski"
  },
  {
    "path": "packages/should-skip-package/src/index.ts",
    "chars": 455,
    "preview": "import { Package } from \"@manypkg/get-packages\";\nimport { PackageGroup } from \"@changesets/types\";\n\nexport function shou"
  },
  {
    "path": "packages/types/CHANGELOG.md",
    "chars": 11035,
    "preview": "# @changesets/types\n\n## 6.1.0\n\n### Minor Changes\n\n- [#1453](https://github.com/changesets/changesets/pull/1453) [`84a4a1"
  },
  {
    "path": "packages/types/README.md",
    "chars": 591,
    "preview": "# @changesets/types\n\n[![npm package](https://img.shields.io/npm/v/@changesets/types)](https://npmjs.com/package/@changes"
  },
  {
    "path": "packages/types/package.json",
    "chars": 673,
    "preview": "{\n  \"name\": \"@changesets/types\",\n  \"version\": \"6.1.0\",\n  \"description\": \"Common types shared between changeset packages\""
  },
  {
    "path": "packages/types/src/index.ts",
    "chars": 5016,
    "preview": "// NB: Bolt check uses a different dependnecy set to every other package.\n// You need think before you use this.\nconst D"
  },
  {
    "path": "packages/write/CHANGELOG.md",
    "chars": 5684,
    "preview": "# @changesets/write\n\n## 0.4.0\n\n### Minor Changes\n\n- [#1453](https://github.com/changesets/changesets/pull/1453) [`84a4a1"
  },
  {
    "path": "packages/write/README.md",
    "chars": 834,
    "preview": "# @changesets/write\n\nWrites a changeset to a file.\n\n```js\nimport write from \"@changesets/write\";\n\nconst changeset = {\n  "
  }
]

// ... and 14 more files (download for full content)

About this extraction

This page contains the full source code of the changesets/changesets GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 214 files (1.1 MB), approximately 309.6k tokens, and a symbol index with 239 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!