Skip to content

Commit 600a576

Browse files
authored
Switch to ESM (#338)
1 parent c967052 commit 600a576

File tree

101 files changed

+2533
-1949
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2533
-1949
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"rules": {
2828
"import/no-cycle": "error",
2929
"node/no-extraneous-import": "error",
30+
"node/file-extension-in-import": "error",
3031
"@typescript-eslint/ban-ts-ignore": "off",
3132
"@typescript-eslint/ban-ts-comment": "off",
3233
"@typescript-eslint/explicit-module-boundary-types": "off",

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
9+
### Changed
10+
- BREAKING CHANGE: Switch to ESM ([#338](https://github.com/cucumber/react-components/pull/338))
911

1012
## [21.1.1] - 2023-07-13
1113
### Fixed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
## Usage
1010

11-
React 18 or above is required.
11+
- This package is distributed in ES module format only.
12+
- React 18 or above is required.
1213

1314
The source code for screenshots above is:
1415

File renamed without changes.

jest.config.cjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
preset: 'ts-jest/presets/default-esm',
4+
moduleNameMapper: {
5+
'^(\\.{1,2}/.*)\\.js$': '$1', // trim .js extensions from imports which confuse jest-resolve
6+
'.+\\.(css|scss)$': 'identity-obj-proxy', // map stylesheet imports to an empty object
7+
},
8+
setupFilesAfterEnv: ['<rootDir>/jest.setup.cjs'],
9+
testEnvironment: 'jsdom',
10+
transform: {
11+
'^.+\\.tsx?$': [
12+
'ts-jest',
13+
{
14+
useESM: true,
15+
isolatedModules: true
16+
},
17+
],
18+
},
19+
}
20+

jest.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)