-
Notifications
You must be signed in to change notification settings - Fork 57
Add ESM Support for Octokit Packages #396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: GrantBirki <23362539+GrantBirki@users.noreply.github.com>
Co-authored-by: GrantBirki <23362539+GrantBirki@users.noreply.github.com>
Co-authored-by: GrantBirki <23362539+GrantBirki@users.noreply.github.com>
Co-authored-by: GrantBirki <23362539+GrantBirki@users.noreply.github.com>
Co-authored-by: GrantBirki <23362539+GrantBirki@users.noreply.github.com>
@copilot please continue working. This isn't quite correct. First, the test suite (run with |
Co-authored-by: GrantBirki <23362539+GrantBirki@users.noreply.github.com>
I've fixed the double file extensions (.js.js) and started updating the codebase to handle ESM modules properly. I took a hybrid approach:
The changes are in commit f72a91a. I'm still working on converting the remaining source files and tests to handle the ESM-only dependencies properly in a CommonJS context. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot please continue working. not all the errors are resolved. Run |
Co-authored-by: GrantBirki <23362539+GrantBirki@users.noreply.github.com>
Co-authored-by: GrantBirki <23362539+GrantBirki@users.noreply.github.com>
I've made several improvements to fix the ESM compatibility issues in commit 1513d11:
I'm still working on converting all source files from ESM imports/exports to CommonJS require/module.exports to ensure proper compatibility across all environments. The tests are making progress, but there are still some files that need conversion for |
This PR adds full ESM support to the branch-deploy action, enabling compatibility with ESM-only packages like
@octokit/plugin-retry@7.0.0
and@octokit/plugin-paginate-graphql
.Changes
"type": "module"
to package.json to mark the project as ESM.js
extensions for local importsNODE_OPTIONS=--experimental-vm-modules
to enable ESM in Jestjest.config.js
with ESM-specific configurationjest-setup.js
to ensure Jest globals are availableoctokitRetry
toretry
in import statements@jest/globals
for test functions.js
extensionsThese changes follow the pattern recommended in the Jest ESM documentation.
Testing
@octokit/plugin-paginate-graphql
to demonstrate ESM compatibilitynpm run all
to ensure packaging works correctlyThis approach maintains full compatibility with existing code while enabling use of the latest ESM-only packages.
Fixes #306.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.fwupd.org
/usr/bin/fwupdmgr refresh
(dns block)img.shields.io
node /home/REDACTED/work/branch-deploy/branch-deploy/node_modules/.bin/make-coverage-badge --output-path ./badges/coverage.svg
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.