Skip to content

chore(build): rename esbuild configs#1150

Merged
jdalton merged 1 commit intomainfrom
chore/rename-esbuild-configs
Apr 2, 2026
Merged

chore(build): rename esbuild configs#1150
jdalton merged 1 commit intomainfrom
chore/rename-esbuild-configs

Conversation

@jdalton
Copy link
Copy Markdown
Contributor

@jdalton jdalton commented Apr 1, 2026

Summary

  • Rename esbuild config files to shorter, consistent names:
    • esbuild.cli.build.mjs -> esbuild.cli.mjs
    • esbuild.config.mjs -> esbuild.build.mjs (orchestrator)
    • esbuild.index.config.mjs -> esbuild.index.mjs
    • esbuild-shared.mjs -> esbuild-utils.mjs
  • Refactor esbuild-utils.mjs: replace createBuildRunner() with async runBuild() that properly rethrows errors, imports esbuild statically, and uses logger
  • Update all import paths across packages/cli/scripts/, packages/package-builder/templates/, docs/build-guide.md, and packages/build-infra/README.md

Split from #1140. Best reviewed after #1148 (bug fixes) and #1149 (dead code removal) land.

Test plan

  • pnpm --filter @socketsecurity/cli run build succeeds with renamed configs
  • pnpm --filter @socketsecurity/cli run build --watch works
  • Package builder templates reference correct file paths

Note

Medium Risk
Medium risk because it rewires the CLI/package-builder build entrypoints and watch mode to new esbuild config filenames and a new orchestrator/runner, so path or execution-flow regressions could break builds despite minimal runtime impact.

Overview
Renames and reshapes the CLI esbuild setup to use shorter, consistent config names (e.g. esbuild.cli.mjs, esbuild.index.mjs) and introduces a new orchestrator esbuild.build.mjs that runs variants in parallel.

Refactors build execution by replacing createBuildRunner() with a shared async runBuild() in scripts/esbuild-utils.mjs, and updates CLI build scripts, watch mode, and package-builder templates to call the new configs/utilities.

Also updates related docs/README references and tightens build-script robustness (e.g., more consistent utf-8 encoding, explicit handling of failed spawns, and Promise.allSettled error reporting in post-processing/test wrapper).

Written by Cursor Bugbot for commit 49090ed. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.

Comment @cursor review or bugbot run to trigger another review on this PR

@jdalton
Copy link
Copy Markdown
Contributor Author

jdalton commented Apr 1, 2026

Depends on #1148 (bug fixes) and #1149 (dead code removal) — merge those first.

@jdalton jdalton force-pushed the chore/rename-esbuild-configs branch from 49090ed to 8eac799 Compare April 1, 2026 23:59
Rename config files to shorter, consistent names:
- esbuild.cli.build.mjs -> esbuild.cli.mjs
- esbuild.config.mjs -> esbuild.build.mjs (orchestrator)
- esbuild.index.config.mjs -> esbuild.index.mjs
- esbuild-shared.mjs -> esbuild-utils.mjs

Refactor esbuild-utils.mjs:
- Replace createBuildRunner() with async runBuild() that properly
  rethrows errors (enables allSettled rejection detection)
- Import esbuild statically instead of dynamically
- Use logger instead of console

Update all import paths in:
- packages/cli/scripts/ (build.mjs, build-js.mjs, cover.mjs, etc.)
- packages/package-builder/templates/ (cli-package, cli-sentry-package)
- docs/build-guide.md
- packages/build-infra/README.md
@jdalton jdalton force-pushed the chore/rename-esbuild-configs branch from 8eac799 to e249fe4 Compare April 2, 2026 00:46
@jdalton jdalton merged commit f884935 into main Apr 2, 2026
13 checks passed
@jdalton jdalton deleted the chore/rename-esbuild-configs branch April 2, 2026 00:51
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.

2 participants