Skip to content
This repository was archived by the owner on May 30, 2026. It is now read-only.

fix: shim dirname/filename globals and disable async chunks in ESM action bundles - #84

Merged
C. Spencer Beggs (spencerbeggs) merged 1 commit into
mainfrom
bug/cjs-shims
May 20, 2026
Merged

C. Spencer Beggs (spencerbeggs) merged 1 commit into
mainfrom
bug/cjs-shims

Conversation

@spencerbeggs

Copy link
Copy Markdown
Contributor

Summary

  • Inject CJS compatibility shims (__dirname, __filename, __require) into every ESM action bundle so CJS dependencies referencing these globals work at runtime without needing to be externalized
  • Set asyncChunks: false per action entry so each action always produces a single predictable output file; dynamic import() calls are folded into the parent chunk
  • Temporarily switch dev releases to branch off the current dev branch (CI-only, non-user-facing)

Test plan

  • Run pnpm test — unit and integration tests pass
  • Build a test action that uses a CJS dependency referencing __dirname (e.g., path.resolve(__dirname, 'data.json')) and verify it runs without ReferenceError in a GitHub Actions environment
  • Confirm the action output directory contains exactly one .js file per action entry (no chunk files)
  • Verify pnpm run build produces clean output with no errors

Signed-off-by: C. Spencer Beggs spencer@beg.gs

…tion bundles

Inject CJS compatibility shims (dirname, filename, require) into every
ESM action bundle so CJS dependencies referencing these globals work at
runtime without needing to be externalized. Set asyncChunks to false per
entry so each action always produces a single predictable output file.

Signed-off-by: C. Spencer Beggs <spencer@beg.gs>
@spencerbeggs
C. Spencer Beggs (spencerbeggs) merged commit 9814a9e into main May 20, 2026
19 checks passed
@spencerbeggs
C. Spencer Beggs (spencerbeggs) deleted the bug/cjs-shims branch May 20, 2026 17:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant