Skip to content

Commit

Permalink
maint: Figure out what's going on with Changesets (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Nov 17, 2023
1 parent d87f4e5 commit 6c43fa4
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"changelog": [
"@svitejs/changesets-changelog-github-compact",
{ "repo": "hms-dbmi/viv" }
],
"fixed": [["@hms-dbmi/viv", "@vivjs/*"]],
"commit": false,
"access": "public",
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ jobs:
version: 7
run_install: true

- run: pnpm build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
title: Create Release
version: node scripts/version.mjs
publish: pnpm changeset publish
version: pnpm run version
publish: pnpm run publish
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"test": "pnpm -r --parallel test",
"check-format": "prettier --check --ignore-path .gitignore tsconfig.json sites/avivator packages/",
"lint": "npm run check-format && eslint \"packages/*/src/**/*\" \"sites/avivator/src/**/*\"",
"format": "npm run check-format -- --write"
"format": "npm run check-format -- --write",
"version": "node ./scripts/version.mjs",
"publish": "pnpm build && pnpm changeset publish"
},
"dependencies": {
"@deck.gl/core": "~8.8.27",
Expand All @@ -41,6 +43,7 @@
"@pnpm/meta-updater": "^0.0.6",
"@pnpm/types": "^8.4.0",
"@probe.gl/test-utils": "^3.5.0",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"esbuild": "^0.19.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/main/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Changelog
# @hms-dbmi/viv

## 0.15.0

Expand Down
31 changes: 31 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions scripts/version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,19 @@ function clearChangelogs(pkgDir) {
* Deletes all the other changelogs.
*/
function postChangesetsVersion() {
const mainPkg = path.resolve(__dirname, '..', 'packages', 'main');
// remove dependency updates from main changelog
const mainChangelogPath = path.resolve(__dirname, '..', 'packages', 'main', 'CHANGELOG.md');
const mainChangelogPath = path.resolve(mainPkg, 'CHANGELOG.md');
const contents = fs.readFileSync(mainChangelogPath, { encoding: 'utf-8' });
const lines = contents.split('\n');
const newChangelog = lines
.filter(line => !line.startsWith(' - @vivjs/')) // remove dependency updates
const newChangelog = contents
.split('\n')
.filter(line => !line.startsWith('- Updated dependencies'))
.filter(line => !line.startsWith(' - @vivjs/'))
.join('\n');
fs.writeFileSync(mainChangelogPath, newChangelog);
clearChangelogs(path.resolve(__dirname, '..', 'packages'));
clearChangelogs(path.resolve(__dirname, '..', 'sites'));

// clearChangelogs(path.resolve(__dirname, '..', 'packages'));
// clearChangelogs(path.resolve(__dirname, '..', 'sites'));
}

preChangesetsVersion();
Expand Down

0 comments on commit 6c43fa4

Please sign in to comment.