Skip to content

chore: Automatically publishing packages that have changed since release as PR packages#2655

Open
iwoplaza wants to merge 2 commits into
mainfrom
chore/pkg-pr-typegpu-gl
Open

chore: Automatically publishing packages that have changed since release as PR packages#2655
iwoplaza wants to merge 2 commits into
mainfrom
chore/pkg-pr-typegpu-gl

Conversation

@iwoplaza

@iwoplaza iwoplaza commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Changes:

  • Gathering packages that have changed compared to the release branch, builds them, and publishes them through pkg.pr.new
  • Made @typegpu/gl a public package, so that it can be published both on npm and on pkg-pr-new.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/tgpu-gen@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0
https://pkg.pr.new/software-mansion/TypeGPU/typegpu@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/color@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/gl@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/radiance-cascades@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/react@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/sdf@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/three@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@18af7184dccb8e5cdbcfd9084b0799d8529c3ba0

benchmark
view benchmark

commit
view commit

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/gl to the root nightly-build script filters.
  • Add ./packages/typegpu-gl to the pkg-pr-new publish workflow 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.

Comment thread package.json Outdated
Comment thread .github/workflows/pkg-pr.yml Outdated
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 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 ($${\color{green}-3.2\%}$$)
tgpu_initFromDevice.ts 254.56 kB ($${\color{green}-3.4\%}$$)
tgpu_resolve.ts 187.00 kB ($${\color{green}-29.0\%}$$)
tgpu_resolveWithContext.ts 186.94 kB ($${\color{green}-29.1\%}$$)
tgpu_bindGroupLayout.ts 68.88 kB ($${\color{green}-73.9\%}$$)
tgpu_mutableAccessor.ts 65.86 kB ($${\color{green}-75.0\%}$$)
tgpu_accessor.ts 65.84 kB ($${\color{green}-75.0\%}$$)
tgpu_privateVar.ts 65.18 kB ($${\color{green}-75.3\%}$$)
tgpu_workgroupVar.ts 65.17 kB ($${\color{green}-75.3\%}$$)
tgpu_const.ts 64.40 kB ($${\color{green}-75.6\%}$$)
tgpu_fn.ts 37.94 kB ($${\color{green}-85.6\%}$$)
tgpu_fragmentFn.ts 37.87 kB ($${\color{green}-85.6\%}$$)
tgpu_vertexFn.ts 37.69 kB ($${\color{green}-85.7\%}$$)
tgpu_computeFn.ts 37.39 kB ($${\color{green}-85.8\%}$$)
tgpu_vertexLayout.ts 26.61 kB ($${\color{green}-89.9\%}$$)
tgpu_comptime.ts 14.41 kB ($${\color{green}-94.5\%}$$)
tgpu_unroll.ts 2.60 kB ($${\color{green}-99.0\%}$$)
tgpu_slot.ts 1.57 kB ($${\color{green}-99.4\%}$$)
tgpu_lazy.ts 1.22 kB ($${\color{green}-99.5\%}$$)

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

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]
Loading
---
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]
Loading
---
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]
Loading

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 the pkg-pr-new publish command in .github/workflows/pkg-pr.yml.
  • Adds --filter @typegpu/gl to the nightly-build script in package.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.

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@iwoplaza iwoplaza force-pushed the chore/pkg-pr-typegpu-gl branch 2 times, most recently from aecfd24 to 2293d76 Compare June 29, 2026 11:13

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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": true from packages/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.

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@iwoplaza iwoplaza force-pushed the chore/pkg-pr-typegpu-gl branch 3 times, most recently from 6128781 to ad78cd8 Compare July 6, 2026 10:58

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml with a call to scripts/publish-pkg-pr.ts and removed the preceding pnpm nightly-build step.
  • Removed the root nightly-build script from package.json.
  • Added scripts/_utils.ts with shared helpers for package discovery (getPackages), npm existence checks (isPublished), and dist-tag derivation (getTag).
  • Added scripts/publish-pkg-pr.ts to discover non-private packages and invoke pkg-pr-new publish dynamically.
  • Refactored scripts/publish.ts to consume the same shared helpers; behavior is otherwise unchanged.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread .github/workflows/pkg-pr.yml
Comment thread scripts/publish-pkg-pr.ts Outdated
Comment thread scripts/publish-pkg-pr.ts Outdated
@iwoplaza iwoplaza force-pushed the chore/pkg-pr-typegpu-gl branch from eda212c to 104b79c Compare July 6, 2026 12:01

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 since release and invokes pkg-pr-new publish dynamically.
  • Removed the root nightly-build script from package.json; build logic now lives inside publish-pkg-pr.ts.
  • Removed the separate workflow build step in .github/workflows/pkg-pr.yml; the script now runs prepublishOnly on selected packages before publishing.
  • Made @typegpu/gl publishable by removing "private": true.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread scripts/publish-pkg-pr.ts Outdated
Comment thread scripts/publish-pkg-pr.ts Outdated
Comment thread scripts/publish-pkg-pr.ts Outdated
Comment thread scripts/_utils.ts Outdated
@iwoplaza iwoplaza force-pushed the chore/pkg-pr-typegpu-gl branch 4 times, most recently from 9d17266 to fc57408 Compare July 6, 2026 12:27

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 on pkg.dirname.
  • Added no-changes-gated comment in .github/workflows/pkg-pr.yml — the comment step posts "No packages changed since release" when output.json is absent.
  • Removed dead isPublished import from scripts/publish-pkg-pr.ts.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread scripts/publish-pkg-pr.ts Outdated
Comment thread scripts/publish-pkg-pr.ts Outdated
Comment thread scripts/publish-pkg-pr.ts Outdated
@iwoplaza iwoplaza force-pushed the chore/pkg-pr-typegpu-gl branch from fc57408 to 353b9eb Compare July 6, 2026 12:30

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.tsgetPackagesChangedSinceRelease now returns PackageInfo[] matched by directory name.
  • Removed the g flag from packageNameRegex in scripts/_utils.ts.
  • Extracted helper functions in .github/workflows/pkg-pr.yml for issue-number lookup and publish logging.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread .github/workflows/pkg-pr.yml Outdated
@iwoplaza iwoplaza force-pushed the chore/pkg-pr-typegpu-gl branch from 353b9eb to b63e3ca Compare July 6, 2026 12:31

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 --filter argument by switching to the --filter=${pkg.name} form.
  • Fixed pkg-pr-new publish paths by removing the literal single quotes around ./packages/${pkg.dirname}.

Pullfrog  | Fix it ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.ymllogPublishInfo now logs output.templates instead of the undefined templates.

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.

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@iwoplaza iwoplaza force-pushed the chore/pkg-pr-typegpu-gl branch from b63e3ca to 63c0aa9 Compare July 6, 2026 12:40
@iwoplaza iwoplaza changed the title chore: Publish @typegpu/gl as a PR nightly chore: Improve PR package workflow Jul 6, 2026
@iwoplaza iwoplaza changed the title chore: Improve PR package workflow chore: Automatically publishing packages that have changed since release as PR packages Jul 6, 2026
@iwoplaza iwoplaza force-pushed the chore/pkg-pr-typegpu-gl branch 2 times, most recently from 71a3f4f to 99e2187 Compare July 6, 2026 12:46

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 publish invocation with a dynamic Bun script (scripts/publish-pkg-pr.ts) that builds and publishes only non-private packages changed since release.
  • Added shared script helpers in scripts/_utils.ts for package discovery, npm existence checks, dist-tag derivation, and changed-package gating.
  • Removed the root nightly-build script and the dedicated pnpm nightly-build workflow step.
  • Made @typegpu/gl publishable by removing "private": true.
  • Refactored scripts/publish.ts to use the shared helpers.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread scripts/_utils.ts Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts to compare against release.. instead of release..HEAD (same working-tree assumption, still relies on the release ref).
  • Removed the unused type PackageInfo import from scripts/publish-pkg-pr.ts.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread scripts/_utils.ts
@iwoplaza iwoplaza force-pushed the chore/pkg-pr-typegpu-gl branch from 99e2187 to 3ab4601 Compare July 6, 2026 12:56

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 ref step to .github/workflows/pkg-pr.yml — runs git fetch --no-tags --depth=1 origin release:release before the publish script, giving getPackagesChangedSinceRelease in scripts/_utils.ts the local release ref 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.

Pullfrog  | View workflow run | Using 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense to publish based on target branch? I think this would simplify logic, as well as reduce unnecessary publishes

@cieplypolar cieplypolar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@iwoplaza iwoplaza force-pushed the chore/pkg-pr-typegpu-gl branch from 3ab4601 to 18af718 Compare July 7, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants