Skip to content

Migrate to ESM#147

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/migrate-to-esm
Draft

Migrate to ESM#147
Copilot wants to merge 2 commits into
mainfrom
copilot/migrate-to-esm

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 27, 2026

Converts the project from CommonJS to native ECMAScript Modules.

Source

  • src/main.js / src/index.js: require()import, module.exportsexport, top-level await run() in entrypoint

Tests

  • Replaced jest.mock() (requires Babel hoisting) with jest.unstable_mockModule() + top-level await and explicit import { jest } from '@jest/globals'
  • Rewrote main.test.js tests to match the actual action logic (prior tests were template leftovers testing a non-existent milliseconds input)

Config

  • package.json: "type": "module", NODE_OPTIONS=--experimental-vm-modules on test scripts, "transform": {} to disable Babel-jest
  • ESLint: env.commonjses2022; 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.

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
Copilot AI requested a review from neilenns March 27, 2026 12:21
@neilenns
Copy link
Copy Markdown
Owner

@SocksTheWolf Wanna give this a try and see if AI was competent?

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