Repository navigation
build(check-changelog): bundle the script with esbuild - #32
Open
rekmarks-consensys-1 wants to merge 6 commits into
Open
rekmarks-consensys-1 wants to merge 6 commits into
rekmarks-consensys-1 wants to merge 6 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog-bundle
branch
from
November 25, 2026 01:14
923e190 to
9b57241
Compare
rekmarks-consensys-1
marked this pull request as ready for review
November 25, 2026 01:22
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog-bundle
branch
2 times, most recently
from
December 1, 2026 17:08
0f81384 to
0d3ee99
Compare
The action installs about 133 production packages at run time, most of them @metamask/auto-changelog's CLI dependencies, though the script only uses parseChangelog and semver. `npm run build` bundles the script into a committed dist/check-changelog.js with only that code: a plugin resolves @metamask/auto-changelog to its parse-changelog.js module, which the package's exports map doesn't expose. The bundled packages' licenses go to dist/LICENSES.txt. All dependencies are now devDependencies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndencies The action runs dist/check-changelog.js and no longer runs npm ci, so no package is installed or resolved at run time. The fixture tests and the ocap-kernel job run the bundle, so the shipped artifact is what is tested, and CI rebuilds the bundle and fails if dist/ is out of date, so a dependency bump without a rebuild doesn't pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t-in esbuild leaves an import it cannot resolve, such as a dynamic import in a try block, in the bundle as a run-time import without a warning. The action has no node_modules at run time, so such an import would fail only when reached. The build now reads the metafile and fails if the output imports anything other than node: built-ins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The build overwrote its outputs but left any other file in dist/, so a stale file committed there passed the CI check that dist/ matches a fresh build. Emptying dist/ first makes such a file show up as deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The action runs dist/check-changelog.js, not the TypeScript source, so the usage message and header comment now name check-changelog.js. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog-bundle
branch
from
December 2, 2026 19:01
6b65d5a to
1b5aa77
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lines added, by type
Generated:
dist/check-changelog.jsanddist/LICENSES.txt, written bynpm run build. Lockfiles: the action'spackage-lock.json.Bundles the
check-changelogscript with esbuild into a committeddist/check-changelog.js, and runs that instead of installing dependencies at run time. The action no longer runsnpm ci; its inputs and behavior are otherwise unchanged from #31.Stacked on #31.
To review: the first commit adds the build and
dist/; the second switches the action, tests and README to the bundle; the rest are fixes to the build and the usage text.dist/check-changelog.jsis generated and can be skipped.Implementation
dist/check-changelog.js, a committed, unminified esbuild (0.28.2) bundle of the script and the code it uses from its dependencies:semverand@metamask/auto-changelog'sparseChangelog(the package'sdist/parse-changelog.jsand the modules it imports).scripts/build.tsresolves@metamask/auto-changelogto that module, which the package's exports map doesn't expose, instead of its index, so the bundle contains none of the package's CLI dependencies (@yarnpkg/core, Octokit, execa, yargs).node:built-ins at run time. esbuild leaves an import it can't resolve in the bundle without a warning, and the action has nonode_modulesto load it from.npm ci. All dependencies, pinned bypackage-lock.json, are now devDependencies, used only to build, typecheck and test.dist/LICENSES.txt, written by the same build.npm run buildand commitdist/. CI rebuilds the bundle and fails ifdist/would change. The build emptiesdist/first, so a committed file there that the build doesn't write also fails that check.check-changelog.js, the entry point the action runs.Differences from upstream
${{ github.action_path }}as the committed bundle, instead of checking outgithub-toolsand runningyarnandts-node. In feat: add check-changelog action #26 and fix(check-changelog): fix package detection, output and checkout #31, it ran the TypeScript source afternpm ci.Security
The action installs and resolves no packages at run time: it runs the committed bundle, built from the versions in
package-lock.json.Tests
test/fixtures.shnow runs the bundle,dist/check-changelog.js, which is what the action ships, and needs only Node.js.SCRIPT=<path>runs another script, such as the source..github/workflows/test_check-changelog.ymlrunsnpm run buildand fails ifdist/differs from what is committed, as after a dependency bump without a rebuild. The ocap-kernel job runs the bundled script, withoutnpm ci.🤖 Generated with Claude Code