-
Notifications
You must be signed in to change notification settings - Fork 0
chore: introduce changesets #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the initial changeset.
Once this PR is merged, a release PR should be created, and merging that will bump the patch version for all packages.
| "name": "function", | ||
| "private": true, | ||
| "scripts": { | ||
| "ci:publish": "pnpm publish -r --no-git-checks --access=public" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the command called from changeset/action.
The -r flag attempts to publish all packages, but packages that already have that version published (i.e., packages with no updates) are skipped without errors.
refs:
https://pnpm.io/cli/publish
https://pnpm.io/using-changesets
| "check-write": "biome check --write .", | ||
| "type-check": "tsc" | ||
| "type-check": "tsc", | ||
| "prepublishOnly": "pnpm run build" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we need to run build before publish, we're defining prepublishOnly.
| "devDependencies": { | ||
| "@biomejs/biome": "1.9.4", | ||
| "@tailor-platform/function-types": "0.6.0", | ||
| "@tailor-platform/function-types": "workspace:*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When depending on other packages within the monorepo, changesets will generate a warning if the specified version is outdated, so I'm replacing all of them with workspace:*.
This should be fine since they'll be replaced with the actual latest versions during publishing.
https://pnpm.io/workspaces#publishing-workspace-packages
| "engines": { | ||
| "node": "22.x" | ||
| }, | ||
| "packageManager": "pnpm@10.18.0", | ||
| "pnpm": { | ||
| "onlyBuiltDependencies": ["@biomejs/biome", "esbuild"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved engines.node / packageManager to the root package.json, and onlyBuiltDependencies to pnpm-workspace.yaml.
| "prepublishOnly": "pnpm run build" | ||
| }, | ||
| "dependencies": { | ||
| "@tailor-platform/function-typeorm-tailordb-codegen": "link:", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed link: since it causes errors when installing with npm as it can't be interpreted. This should be unnecessary, right...?
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 | ||
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With v5, it seems to try to enable pnpm caching by default and throws an error, so I've updated to v6.
I think this went unnoticed because the workflow probably hasn't been run once since updating to v5...
actions/setup-node#1357
dragon3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Manually bumping the version for each package and triggering the workflow was cumbersome, so I configured pnpm workspace and introduced changesets.
Note: Before actually publishing new versions, we need to update the Trusted Publishing settings for each package.