From 21c1159e4d6b217cfcc8674c1caac69bec20e19a Mon Sep 17 00:00:00 2001 From: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Date: Fri, 22 Aug 2025 13:16:17 -0700 Subject: [PATCH] Switch build output to ESM format and update entrypoints Changed the build script to output ES modules instead of CommonJS. Updated action.yml to reference .js files instead of .cjs, and clarified proxy support logic in bootstrap.js. --- action.yml | 4 ++-- bootstrap.js | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 2b5d045..380280d 100644 --- a/action.yml +++ b/action.yml @@ -133,5 +133,5 @@ outputs: description: "GitHub App slug" runs: using: "node24" - main: "dist/bootstrap.cjs" - post: "dist/post.cjs" + main: "dist/bootstrap.js" + post: "dist/post.js" diff --git a/bootstrap.js b/bootstrap.js index 845c7a3..0619965 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -1,4 +1,4 @@ -// Enable env-based proxy support (honors explicit opt-out if caller set NODE_USE_ENV_PROXY) +// Enable env-based proxy support before loading the main bundle (unless caller explicitly set NODE_USE_ENV_PROXY) if (process.env.NODE_USE_ENV_PROXY == null) { process.env.NODE_USE_ENV_PROXY = "1"; } diff --git a/package.json b/package.json index 2123f18..76a73cb 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "node": ">=24.4.0" }, "scripts": { - "build": "esbuild bootstrap.js main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --packages=bundle", + "build": "esbuild bootstrap.js main.js post.js --bundle --outdir=dist --format=esm --platform=node --packages=bundle", "test": "c8 --100 ava tests/index.js", "coverage": "c8 report --reporter html", "postcoverage": "open-cli coverage/index.html"