Skip to content

Commit 6477c65

Browse files
committed
maint: Figure out what's going on with Changesets (#742)
1 parent d87f4e5 commit 6477c65

File tree

5 files changed

+51
-12
lines changed

5 files changed

+51
-12
lines changed

.changeset/config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3-
"changelog": "@changesets/cli/changelog",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{ "repo": "hms-dbmi/viv" }
6+
],
47
"fixed": [["@hms-dbmi/viv", "@vivjs/*"]],
58
"commit": false,
69
"access": "public",

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@ jobs:
1919
version: 7
2020
run_install: true
2121

22-
- run: pnpm build
23-
2422
- name: Create Release Pull Request or Publish to npm
2523
id: changesets
2624
uses: changesets/action@v1
2725
with:
2826
title: Create Release
29-
version: node scripts/version.mjs
30-
publish: pnpm changeset publish
27+
version: pnpm run version
28+
publish: pnpm run publish
29+
createGithubReleases: false
3130
env:
3231
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3332
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
"test": "pnpm -r --parallel test",
1919
"check-format": "prettier --check --ignore-path .gitignore tsconfig.json sites/avivator packages/",
2020
"lint": "npm run check-format && eslint \"packages/*/src/**/*\" \"sites/avivator/src/**/*\"",
21-
"format": "npm run check-format -- --write"
21+
"format": "npm run check-format -- --write",
22+
"version": "node ./scripts/version.mjs",
23+
"publish": "pnpm build && pnpm changeset publish"
2224
},
2325
"dependencies": {
2426
"@deck.gl/core": "~8.8.27",
@@ -41,6 +43,7 @@
4143
"@pnpm/meta-updater": "^0.0.6",
4244
"@pnpm/types": "^8.4.0",
4345
"@probe.gl/test-utils": "^3.5.0",
46+
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
4447
"@typescript-eslint/eslint-plugin": "^6.10.0",
4548
"@typescript-eslint/parser": "^6.10.0",
4649
"esbuild": "^0.19.5",

pnpm-lock.yaml

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/version.mjs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,19 @@ function clearChangelogs(pkgDir) {
8989
* Deletes all the other changelogs.
9090
*/
9191
function postChangesetsVersion() {
92+
const mainPkg = path.resolve(__dirname, '..', 'packages', 'main');
9293
// remove dependency updates from main changelog
93-
const mainChangelogPath = path.resolve(__dirname, '..', 'packages', 'main', 'CHANGELOG.md');
94+
const mainChangelogPath = path.resolve(mainPkg, 'CHANGELOG.md');
9495
const contents = fs.readFileSync(mainChangelogPath, { encoding: 'utf-8' });
95-
const lines = contents.split('\n');
96-
const newChangelog = lines
97-
.filter(line => !line.startsWith(' - @vivjs/')) // remove dependency updates
96+
const newChangelog = contents
97+
.split('\n')
98+
.filter(line => !line.startsWith('- Updated dependencies'))
99+
.filter(line => !line.startsWith(' - @vivjs/'))
98100
.join('\n');
99101
fs.writeFileSync(mainChangelogPath, newChangelog);
100-
clearChangelogs(path.resolve(__dirname, '..', 'packages'));
101-
clearChangelogs(path.resolve(__dirname, '..', 'sites'));
102+
103+
// clearChangelogs(path.resolve(__dirname, '..', 'packages'));
104+
// clearChangelogs(path.resolve(__dirname, '..', 'sites'));
102105
}
103106

104107
preChangesetsVersion();

0 commit comments

Comments
 (0)