Skip to content

Commit

Permalink
Ensure package-lock.json is updated on release
Browse files Browse the repository at this point in the history
Workaround a problem in changesets where it does not update the package-lock.json
after the version has been bumped in package.json.

See changesets/changesets#421

Fixes cloudflare#198
  • Loading branch information
petebacondarwin committed Jan 7, 2022
1 parent 5d2c177 commit f2b64aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/changeset-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { execSync } = require("node:child_process");

// This script is used by the `release.yml` workflow to update the version of the packages being released.
// The standard step is only to run `changeset version` but this does not update the package-lock.json file.
// So we also run `npm install`, which does this update.
// This is a workaround until this is handled automatically by `changeset version`.
// See https://github.com/changesets/changesets/issues/421.
execSync("npx changeset version");
execSync("npm install");
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
version: node .github/changeset-version.js
publish: npx changeset publish --tag beta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit f2b64aa

Please sign in to comment.