Skip to content

Commit 6481386

Browse files
authored
Convert remaining packages to ESM (#2013)
* redux-devtools-app-core * redux-devtools-app * redux-devtools-extension * redux-devtools-serialize * Fix patch * redux-devtools-utils * redux-devtools-remote * extension * Fixes * Fixes * Update package versions to major and convert to ESM Convert remaining packages in the project to ESM. * Updates * Fix * Fix
1 parent 12849a4 commit 6481386

147 files changed

Lines changed: 469 additions & 679 deletions

File tree

Some content is hidden

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

.changeset/tidy-ladybugs-invite.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@redux-devtools/app': major
3+
'@redux-devtools/app-core': major
4+
'@redux-devtools/extension': major
5+
'@redux-devtools/remote': major
6+
'@redux-devtools/serialize': major
7+
'@redux-devtools/utils': major
8+
---
9+
10+
Convert remaining packages to ESM

extension/eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default [
1414
'edge',
1515
'examples',
1616
'firefox',
17+
'jest.config.ts',
1718
'test/electron/fixture/dist',
1819
],
1920
},

extension/jest.config.cjs

Lines changed: 0 additions & 11 deletions
This file was deleted.

extension/jest.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { createJsWithTsEsmPreset, type JestConfigWithTsJest } from 'ts-jest';
2+
3+
const presetConfig = createJsWithTsEsmPreset({
4+
tsconfig: 'tsconfig.json',
5+
});
6+
7+
const jestConfig: JestConfigWithTsJest = {
8+
...presetConfig,
9+
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
10+
testPathIgnorePatterns: ['<rootDir>/examples'],
11+
testEnvironment: 'jsdom',
12+
moduleNameMapper: {
13+
'^(\\.{1,2}/.*)\\.js$': '$1',
14+
'\\.css$': '<rootDir>/test/__mocks__/styleMock.js',
15+
},
16+
};
17+
18+
export default jestConfig;

extension/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/extension",
77
"license": "MIT",
88
"author": "Mihail Diordiev <zalmoxisus@gmail.com> (https://github.com/zalmoxisus)",
9+
"type": "module",
910
"repository": {
1011
"type": "git",
1112
"url": "https://github.com/reduxjs/redux-devtools.git"
@@ -15,10 +16,10 @@
1516
"build:extension": "node build.mjs",
1617
"build:examples": "babel-node examples/buildAll.js",
1718
"clean": "rimraf dist && rimraf chrome/dist && rimraf edge/dist && rimraf firefox/dist",
18-
"test:app": "cross-env BABEL_ENV=test jest test/app",
19-
"test:chrome": "cross-env SE_FORCE_BROWSER_DOWNLOAD=true jest test/chrome",
19+
"test:app": "cross-env BABEL_ENV=test node --experimental-vm-modules node_modules/jest/bin/jest.js test/app",
20+
"test:chrome": "cross-env SE_FORCE_BROWSER_DOWNLOAD=true node --experimental-vm-modules node_modules/jest/bin/jest.js test/chrome",
2021
"build:test:electron:fixture": "webpack --config test/electron/fixture/webpack.config.js",
21-
"test:electron": "pnpm run build:test:electron:fixture && jest test/electron",
22+
"test:electron": "pnpm run build:test:electron:fixture && node --experimental-vm-modules node_modules/jest/bin/jest.js test/electron",
2223
"test": "pnpm run test:app && pnpm run test:chrome && pnpm run test:electron",
2324
"lint": "eslint .",
2425
"type-check": "tsc --noEmit"
@@ -53,6 +54,7 @@
5354
"@babel/preset-react": "^7.28.5",
5455
"@babel/preset-typescript": "^7.28.5",
5556
"@babel/register": "^7.28.6",
57+
"@jest/globals": "^30.2.0",
5658
"@testing-library/dom": "^10.4.1",
5759
"@testing-library/jest-dom": "^6.9.1",
5860
"@testing-library/react": "^16.3.2",

extension/src/app/Actions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import {
1919
} from '@redux-devtools/app';
2020
import { GoBroadcast } from 'react-icons/go';
2121
import { MdOutlineWindow } from 'react-icons/md';
22-
import type { Position } from '../pageScript/api/openWindow';
23-
import type { SingleMessage } from '../background/store/apiMiddleware';
22+
import type { Position } from '../pageScript/api/openWindow.js';
23+
import type { SingleMessage } from '../background/store/apiMiddleware.js';
2424

2525
type StateProps = ReturnType<typeof mapStateToProps>;
2626
type DispatchProps = ResolveThunks<typeof actionCreators>;

extension/src/app/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
Settings,
99
StoreState,
1010
} from '@redux-devtools/app';
11-
import Actions from './Actions';
11+
import Actions from './Actions.js';
1212

1313
type StateProps = ReturnType<typeof mapStateToProps>;
1414
type DispatchProps = ResolveThunks<typeof actionCreators>;

extension/src/background/contextMenus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import openDevToolsWindow, { DevToolsPosition } from './openWindow';
1+
import openDevToolsWindow, { DevToolsPosition } from './openWindow.js';
22

33
export function createMenu() {
44
const menus = [

extension/src/background/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import '../chromeApiMock';
2-
import configureStore from './store/backgroundStore';
3-
import openDevToolsWindow, { DevToolsPosition } from './openWindow';
4-
import { createMenu, removeMenu } from './contextMenus';
5-
import { getOptions } from '../options/syncOptions';
1+
import '../chromeApiMock.js';
2+
import configureStore from './store/backgroundStore.js';
3+
import openDevToolsWindow, { DevToolsPosition } from './openWindow.js';
4+
import { createMenu, removeMenu } from './contextMenus.js';
5+
import { getOptions } from '../options/syncOptions.js';
66

77
// Expose the extension's store globally to access it from the windows
88
// via chrome.runtime.getBackgroundPage

extension/src/background/logging.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { LIFTED_ACTION } from '@redux-devtools/app';
2-
import { store } from './index';
2+
import { store } from './index.js';
33

44
export function getReport(
55
reportId: string,

0 commit comments

Comments
 (0)