chore: Automatically publishing packages that have changed since release as PR packages#2655
chore: Automatically publishing packages that have changed since release as PR packages#2655iwoplaza wants to merge 2 commits into
Conversation
|
pkg.pr.new packages benchmark commit |
There was a problem hiding this comment.
Pull request overview
This PR updates the PR-nightly publishing pipeline to include the @typegpu/gl package so it’s built and published alongside the other TypeGPU packages.
Changes:
- Add
@typegpu/glto the rootnightly-buildscript filters. - Add
./packages/typegpu-glto thepkg-pr-new publishworkflow step so it’s published in PR builds.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Includes @typegpu/gl in the nightly prepublish/build step via pnpm filters. |
| .github/workflows/pkg-pr.yml | Publishes the typegpu-gl package in the PR package publishing workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased | ❔ Unknown |
|---|---|---|---|
| 0 | 320 | 0 | 0 |
import { ... } in PR vs import * as ... in PR (is the library tree-Shakeable?):
| Test | tsdown |
|---|---|
| tgpu_init.ts | 255.07 kB ( |
| tgpu_initFromDevice.ts | 254.56 kB ( |
| tgpu_resolve.ts | 187.00 kB ( |
| tgpu_resolveWithContext.ts | 186.94 kB ( |
| tgpu_bindGroupLayout.ts | 68.88 kB ( |
| tgpu_mutableAccessor.ts | 65.86 kB ( |
| tgpu_accessor.ts | 65.84 kB ( |
| tgpu_privateVar.ts | 65.18 kB ( |
| tgpu_workgroupVar.ts | 65.17 kB ( |
| tgpu_const.ts | 64.40 kB ( |
| tgpu_fn.ts | 37.94 kB ( |
| tgpu_fragmentFn.ts | 37.87 kB ( |
| tgpu_vertexFn.ts | 37.69 kB ( |
| tgpu_computeFn.ts | 37.39 kB ( |
| tgpu_vertexLayout.ts | 26.61 kB ( |
| tgpu_comptime.ts | 14.41 kB ( |
| tgpu_unroll.ts | 2.60 kB ( |
| tgpu_slot.ts | 1.57 kB ( |
| tgpu_lazy.ts | 1.22 kB ( |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
Resolution Time Benchmark---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.84, 1.74, 3.98, 5.32, 6.16, 10.29, 19.08, 21.34]
line [0.88, 1.70, 3.96, 4.97, 6.27, 10.05, 19.63, 19.20]
line [0.80, 1.69, 3.47, 5.54, 6.86, 9.85, 19.40, 19.36]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.28, 0.51, 0.62, 0.78, 1.04, 1.09, 1.31, 1.37]
line [0.32, 0.49, 0.66, 0.82, 1.03, 1.10, 1.30, 1.41]
line [0.33, 0.51, 0.67, 0.81, 1.01, 1.00, 1.21, 1.34]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.90, 1.78, 3.85, 5.44, 10.73, 22.29, 49.32, 97.15]
line [0.87, 1.77, 3.49, 5.36, 11.05, 23.23, 47.04, 97.41]
line [0.78, 1.69, 3.41, 5.46, 10.86, 22.91, 47.12, 98.02]
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — adds @typegpu/gl to the PR nightly publish list and to the monorepo nightly-build script so its prepublishOnly build runs before publish.
- Adds
'./packages/typegpu-gl'to thepkg-pr-new publishcommand in.github/workflows/pkg-pr.yml. - Adds
--filter @typegpu/glto thenightly-buildscript inpackage.json.
The packages/typegpu-gl/package.json already has proper publishConfig and prepublishOnly wiring, so this is a complete and minimal change. A blank line was added in the workflow after the publish step—harmless but note it if you prefer a tighter diff.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
aecfd24 to
2293d76
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the last review, the PR now removes the "private": true flag from packages/typegpu-gl/package.json so the package is treated as publishable by pkg.pr.new and by the release script.
- Removed
"private": truefrompackages/typegpu-gl/package.json— this makes the package publishable, matching the other scoped packages (@typegpu/noise,@typegpu/react) that are already non-private and published.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
6128781 to
ad78cd8
Compare
There was a problem hiding this comment.
Caution
The new dynamic publishing script has incorrect package-path mapping and an isPublished guard that would prevent @typegpu/gl from being published, so PR nightlies will fail or be silently skipped.
Reviewed changes — replaced the static pkg-pr-new publish invocation with a dynamic Bun discovery script, removed the monorepo nightly-build script, and refactored scripts/publish.ts to share helpers with the new PR-publishing script.
- Replaced the workflow publish step in
.github/workflows/pkg-pr.ymlwith a call toscripts/publish-pkg-pr.tsand removed the precedingpnpm nightly-buildstep. - Removed the root
nightly-buildscript frompackage.json. - Added
scripts/_utils.tswith shared helpers for package discovery (getPackages), npm existence checks (isPublished), and dist-tag derivation (getTag). - Added
scripts/publish-pkg-pr.tsto discover non-private packages and invokepkg-pr-new publishdynamically. - Refactored
scripts/publish.tsto consume the same shared helpers; behavior is otherwise unchanged.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
eda212c to
104b79c
Compare
There was a problem hiding this comment.
Caution
The dynamic pkg-pr-new publishing script still builds package paths from scoped package names, which will fail for every scoped package (including the new @typegpu/gl).
Reviewed changes — the PR replaces the static pkg-pr-new publish invocation with a dynamic Bun discovery script, removes the monorepo nightly-build script, and refactors scripts/publish.ts to use shared helpers.
- Added
scripts/_utils.ts— shared helpers for package discovery (getPackages), npm existence checks (isPublished), changed-package detection (getNamesOfPackagesChangedSinceRelease), and dist-tag derivation (getTag). - Added
scripts/publish-pkg-pr.ts— discovers non-private packages changed sincereleaseand invokespkg-pr-new publishdynamically. - Removed the root
nightly-buildscript frompackage.json; build logic now lives insidepublish-pkg-pr.ts. - Removed the separate workflow build step in
.github/workflows/pkg-pr.yml; the script now runsprepublishOnlyon selected packages before publishing. - Made
@typegpu/glpublishable by removing"private": true.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
9d17266 to
fc57408
Compare
There was a problem hiding this comment.
Caution
The publishing script still constructs invalid command arguments in two places (pnpm --filter values are merged into a single argument, and pkg-pr-new receives paths wrapped in literal single quotes) and gates changed packages by comparing directory names to scoped package names. These bugs will either silently skip @typegpu/gl or cause the PR publish step to fail.
Reviewed changes — since the last review, the PR switched package paths from pkg.name to pkg.dirname, resolving the scoped-name directory mismatch, and added fallback handling in the workflow comment step when no packages changed since release.
- Fixed scoped-name path derivation in
scripts/publish-pkg-pr.ts— package paths are now based onpkg.dirname. - Added no-changes-gated comment in
.github/workflows/pkg-pr.yml— the comment step posts "No packages changed since release" whenoutput.jsonis absent. - Removed dead
isPublishedimport fromscripts/publish-pkg-pr.ts.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
fc57408 to
353b9eb
Compare
There was a problem hiding this comment.
Caution
The workflow refactor in the latest push introduces a ReferenceError in logPublishInfo by referencing an undefined templates variable. This will cause the comment step to throw and also mask any original exception because it runs in a finally block.
Reviewed changes — since 7096230, the latest commit fixed the changed-since-release filter by comparing against pkg.dirname, removed the regex g flag, and refactored the comment-posting step into findIssueNumber, createOrUpdateComment, and logPublishInfo helpers.
- Fixed scoped-package changed detection in
scripts/_utils.ts—getPackagesChangedSinceReleasenow returnsPackageInfo[]matched by directory name. - Removed the
gflag frompackageNameRegexinscripts/_utils.ts. - Extracted helper functions in
.github/workflows/pkg-pr.ymlfor issue-number lookup and publish logging.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
353b9eb to
b63e3ca
Compare
There was a problem hiding this comment.
✅ No new issues in this push.
Reviewed changes — the latest commit fixed both command-argument construction bugs in scripts/publish-pkg-pr.ts.
- Fixed the
pnpm --filterargument by switching to the--filter=${pkg.name}form. - Fixed
pkg-pr-newpublish paths by removing the literal single quotes around./packages/${pkg.dirname}.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since 353b9ebd, the latest commit fixed the workflow logPublishInfo helper to use output.templates, removing the ReferenceError. All prior review feedback has now been addressed.
- Fixed workflow logging in
.github/workflows/pkg-pr.yml—logPublishInfonow logsoutput.templatesinstead of the undefinedtemplates.
The PR is now a complete, minimal change: @typegpu/gl is made publishable, the monorepo nightly-build script is removed in favor of scripts/publish-pkg-pr.ts, and the dynamic publish script correctly discovers, builds, and publishes changed non-private packages.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
b63e3ca to
63c0aa9
Compare
71a3f4f to
99e2187
Compare
There was a problem hiding this comment.
Important
The dynamic publish script looks correct, but it assumes a release ref that the default actions/checkout@v4 fetch probably does not provide, so the PR publish step will fail when any package changed since release.
Reviewed changes — the current PR state since the prior Pullfrog review at b63e3ca3.
- Replaced the static
pkg-pr-new publishinvocation with a dynamic Bun script (scripts/publish-pkg-pr.ts) that builds and publishes only non-private packages changed sincerelease. - Added shared script helpers in
scripts/_utils.tsfor package discovery, npm existence checks, dist-tag derivation, and changed-package gating. - Removed the root
nightly-buildscript and the dedicatedpnpm nightly-buildworkflow step. - Made
@typegpu/glpublishable by removing"private": true. - Refactored
scripts/publish.tsto use the shared helpers.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The latest delta trims HEAD from the diff range and drops an unused import, but it still doesn’t address the missing release ref in the checkout, so the PR publish step remains at risk of failing in CI.
Reviewed changes — the latest push since 63c0aa9a.
- Changed
scripts/_utils.tsto compare againstrelease..instead ofrelease..HEAD(same working-tree assumption, still relies on thereleaseref). - Removed the unused
type PackageInfoimport fromscripts/publish-pkg-pr.ts.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
99e2187 to
3ab4601
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — this push resolves the last open review concern by fetching the release ref before the dynamic PR publish script runs.
- Added the
Fetch release refstep to.github/workflows/pkg-pr.yml— runsgit fetch --no-tags --depth=1 origin release:releasebefore the publish script, givinggetPackagesChangedSinceReleaseinscripts/_utils.tsthe localreleaseref it needs.
All prior Pullfrog review feedback has been addressed. The PR now correctly discovers non-private packages changed since release, builds them, and publishes via pkg.pr.new.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Fetch release ref | ||
| run: git fetch --no-tags --depth=1 origin release:release |
There was a problem hiding this comment.
Wouldn't it make more sense to publish based on target branch? I think this would simplify logic, as well as reduce unnecessary publishes
3ab4601 to
18af718
Compare

Changes:
releasebranch, builds them, and publishes them throughpkg.pr.new@typegpu/gla public package, so that it can be published both on npm and on pkg-pr-new.