Migrate to ESM#147
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/neilenns/streamdeck-cli-pack/sessions/ee8568b0-b28d-4b5d-b714-f4cb4b9ed589 Co-authored-by: neilenns <9524118+neilenns@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate codebase from CommonJS to ESM
Migrate to ESM
Mar 27, 2026
Owner
|
@SocksTheWolf Wanna give this a try and see if AI was competent? |
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.
Converts the project from CommonJS to native ECMAScript Modules.
Source
src/main.js/src/index.js:require()→import,module.exports→export, top-levelawait run()in entrypointTests
jest.mock()(requires Babel hoisting) withjest.unstable_mockModule()+ top-levelawaitand explicitimport { jest } from '@jest/globals'main.test.jstests to match the actual action logic (prior tests were template leftovers testing a non-existentmillisecondsinput)Config
package.json:"type": "module",NODE_OPTIONS=--experimental-vm-moduleson test scripts,"transform": {}to disable Babel-jestenv.commonjs→es2022;import/no-commonjs: error;import/extensions: ['error', 'ignorePackages'](extensions required by Node ESM resolver)⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.