fix(ci): rename node:test files to .cjs for ESM compatibility#671
Merged
bradygaster merged 2 commits intobradygaster:devfrom Mar 29, 2026
Merged
fix(ci): rename node:test files to .cjs for ESM compatibility#671bradygaster merged 2 commits intobradygaster:devfrom
bradygaster merged 2 commits intobradygaster:devfrom
Conversation
The root package.json has "type": "module" but the 9 node:test files used require() (CommonJS). Node.js treats .js files as ESM in module-type packages, causing all tests to fail with: ReferenceError: require is not defined in ES module scope This broke Squad Release, Squad Preview, and Squad Insider Release workflows on every push to main since the ESM migration. Fix: rename *.test.js -> *.test.cjs (explicit CommonJS) and update all workflow globs from test/*.test.js to test/*.test.cjs. Zero logic changes — only file extensions and glob patterns. Vitest is unaffected (its config only includes test/**/*.test.ts). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes CI failures after the repo’s ESM migration by ensuring the Node.js built-in test runner executes CommonJS test files correctly in a "type": "module" package.
Changes:
- Renames the Node
node:testsuite from*.test.jsto*.test.cjsto force CommonJS execution. - Updates all release/preview/insider/CI workflow templates (and their mirrored copies) to run
node --test test/*.test.cjs.
Reviewed changes
Copilot reviewed 19 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/workflows.test.cjs | CommonJS node:test suite file renamed to .cjs for ESM-package compatibility. |
| test/version-stamping.test.cjs | CommonJS node:test suite file renamed to .cjs for ESM-package compatibility. |
| test/skills-export-import.test.cjs | CommonJS node:test suite file renamed to .cjs for ESM-package compatibility. |
| test/rework-rate.test.cjs | CommonJS node:test suite file renamed to .cjs for ESM-package compatibility. |
| test/plugin-marketplace.test.cjs | CommonJS node:test suite file renamed to .cjs for ESM-package compatibility. |
| test/migrate-directory.test.cjs | CommonJS node:test suite file renamed to .cjs for ESM-package compatibility. |
| test/mcp-config.test.cjs | CommonJS node:test suite file renamed to .cjs for ESM-package compatibility. |
| test/init-flow.test.cjs | CommonJS node:test suite file renamed to .cjs for ESM-package compatibility. |
| test/email-scrub.test.cjs | CommonJS node:test suite file renamed to .cjs for ESM-package compatibility. |
| templates/workflows/squad-ci.yml | Updates workflow test glob to run .test.cjs files. |
| templates/workflows/squad-preview.yml | Updates workflow test glob to run .test.cjs files. |
| templates/workflows/squad-release.yml | Updates workflow test glob to run .test.cjs files. |
| templates/workflows/squad-insider-release.yml | Updates workflow test glob to run .test.cjs files. |
| packages/squad-cli/templates/workflows/squad-ci.yml | Keeps template mirrors in sync by updating test glob to .test.cjs. |
| packages/squad-cli/templates/workflows/squad-preview.yml | Keeps template mirrors in sync by updating test glob to .test.cjs. |
| packages/squad-cli/templates/workflows/squad-release.yml | Keeps template mirrors in sync by updating test glob to .test.cjs. |
| packages/squad-cli/templates/workflows/squad-insider-release.yml | Keeps template mirrors in sync by updating test glob to .test.cjs. |
| packages/squad-sdk/templates/workflows/squad-ci.yml | Keeps template mirrors in sync by updating test glob to .test.cjs. |
| packages/squad-sdk/templates/workflows/squad-preview.yml | Keeps template mirrors in sync by updating test glob to .test.cjs. |
| packages/squad-sdk/templates/workflows/squad-release.yml | Keeps template mirrors in sync by updating test glob to .test.cjs. |
| packages/squad-sdk/templates/workflows/squad-insider-release.yml | Keeps template mirrors in sync by updating test glob to .test.cjs. |
| .squad-templates/workflows/squad-ci.yml | Updates canonical template set to use .test.cjs glob. |
| .squad-templates/workflows/squad-preview.yml | Updates canonical template set to use .test.cjs glob. |
| .squad-templates/workflows/squad-release.yml | Updates canonical template set to use .test.cjs glob. |
| .squad-templates/workflows/squad-insider-release.yml | Updates canonical template set to use .test.cjs glob. |
| .github/workflows/squad-preview.yml | Fixes failing preview workflow by running .test.cjs Node tests. |
| .github/workflows/squad-release.yml | Fixes failing release workflow by running .test.cjs Node tests. |
| .github/workflows/squad-insider-release.yml | Fixes failing insider workflow by running .test.cjs Node tests. |
robzelt
pushed a commit
to robzelt/squad
that referenced
this pull request
Apr 1, 2026
…gaster#666, bradygaster#676) (bradygaster#682) * docs(ai-team): CLI UI Polish PRD finalized — 20 issues created Session: 2026-03-01T20-13-00Z-ui-polish-prd Requested by: Brady Changes: - Created 6 orchestration logs (.squad/orchestration-log/2026-03-01T20-24-57Z-*.md) - Created session log (.squad/log/2026-03-01T20-13-00Z-ui-polish-prd.md) - Merged 5 decision files into decisions.md (PRD strategy, cast confirmation, processing state, Brady directives) - Deleted inbox files after merge (deduplication complete) - Updated team history files (Cheritto, Kovash, Redfoot, Marquez, Keaton, Fenster) - PRD created (docs/prd-cli-ui-polish.md) with 20 discrete issues (bradygaster#662-681) for alpha-1 release - Pragmatic alpha-first strategy: P0 blockers (blank screens, spinner, banner) + P1 quick wins, defer grand redesign Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(tui): consolidate separators, fix empty space, add info hierarchy and breathing room (bradygaster#655, bradygaster#670, bradygaster#671, bradygaster#677) - Create shared Separator component in components/Separator.tsx (bradygaster#677) All inline separator rendering (box.h.repeat) replaced across App.tsx, AgentPanel.tsx, and MessageStream.tsx - Remove flexGrow={1} from MessageStream outer Box (bradygaster#655) This was pushing content to bottom of viewport with empty space above - Bold primary CTAs in dim contexts (bradygaster#670) Header: @agent and /help now bold within dimColor usage line First-run: 'Try:' prompt bolded AgentPanel empty state: 'Send a message' and '/help' bolded - Add whitespace breathing room (bradygaster#671) Header wrapper gets marginBottom={1} Turn separators get marginTop={1} AgentPanel bottom separators upgraded from marginTop={0} to marginTop={1} Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: update Cheritto history and add separator decision Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: wire onPermissionRequest handler in CLI session creation (bradygaster#651) Add approveAllPermissions handler to all 4 client.createSession() calls in the CLI shell. The handler was defined in SDK adapter types but never wired, causing a raw SDK error for users. - Add approve-all handler in shell/index.ts (CLI runs locally with user trust) - Export SquadPermissionHandler types from @bradygaster/squad-sdk/client - Add clear error guidance in adapter/client.ts for missing handler Closes bradygaster#651 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(tui): bump secondary text contrast and wire table wrapping (bradygaster#666, bradygaster#676) - Replace dimColor with color="gray" for secondary text (system messages, italic markdown, duration labels, agent activity feed) — higher contrast than dim on dark terminals - Add GRAY ANSI constant and secondary() helper to output.ts - Add wrapTableContent() + truncateTableColumns() to MessageStream — tables exceeding terminal width are column-truncated with ellipsis - Wire table wrapping into both message history and streaming content paths Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Problem
Squad Release, Squad Preview, and Squad Insider Release workflows have been failing on every push to main since the ESM migration. All 9 node:test files fail with:
Root cause: package.json has "type": "module" but the 9 node:test files use require() (CommonJS). Node.js treats .js files as ESM in module-type packages.
Fix
Rename .test.js to .test.cjs (explicit CommonJS marker) and update all workflow globs from test/.test.js to test/.test.cjs.
Zero logic changes -- only file extensions and glob patterns.
Files changed
Not affected