Skip to content

Remove CommonJS support - #3437

Merged
novemberborn merged 12 commits into
mainfrom
remove-cjs
Apr 26, 2026
Merged

novemberborn merged 12 commits into
mainfrom
remove-cjs

Conversation

@sindresorhus

@sindresorhus sindresorhus commented Apr 9, 2026 •

Copy link
Copy Markdown
Member

Fixes #3349

Breaking changes:

  • Removes support for ava.config.cjs files
  • Always uses import() to load test files and extra modules through the require configuration
  • No longer includes .cjs extension in the defaults (so will not find test.cjs files)
  • Removes the commonjs value in the extensions configuration
  • Update provider protocol to ava-8 to reflect these changes (requires new @ava/typescript)

@sindresorhus

Copy link
Copy Markdown
Member Author

Ready

@novemberborn

Copy link
Copy Markdown
Member

@sindresorhus looks good! I've tried to summarize the breaking changes in the PR description. Unfortunately this does impact the @ava/typescript provider protocol. I can ship a new version there that is compatible with AVA 7 and 8.

I've pushed a few further simplifications. I did add back support for configuring a cjs extension, but only with a true value. It's weird to specify module.

I wonder if, instead of mandating module for all other extensions we should just always mandate true values when extensions is given in object form. Or remove support for object form entirely. What do you think?

@sindresorhus

Copy link
Copy Markdown
Member Author

I wonder if, instead of mandating module for all other extensions we should just always mandate true values when extensions is given in object form. Or remove support for object form entirely. What do you think?

I would just remove support for object form.

@sindresorhus

Copy link
Copy Markdown
Member Author

Your changes look good.

@novemberborn

Copy link
Copy Markdown
Member

avajs/typescript#63 is green, but I need to do a bunch of config to make it publish, so that's for another evening.

@novemberborn novemberborn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just waiting for CI to pass and then this can be merged.

@novemberborn
novemberborn merged commit a304990 into main Apr 26, 2026
14 checks passed
@novemberborn
novemberborn deleted the remove-cjs branch April 26, 2026 19:10
Comment thread docs/06-configuration.md
@@ -68,18 +68,18 @@ Provide the `typescript` option (and install [`@ava/typescript`](https://github.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ر

Comment thread docs/06-configuration.md
@@ -42,7 +42,7 @@ Arguments passed to the CLI will always take precedence over the CLI options con

## Options

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ت

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.

Ava test() expression is not callable / has no call signatures

3 participants