diff --git a/extension/jest.config.js b/extension/jest.config.js index ff0d3db5..26d1c602 100644 --- a/extension/jest.config.js +++ b/extension/jest.config.js @@ -5,6 +5,7 @@ module.exports = { moduleNameMapper: { '\\.css$': '/test/__mocks__/styleMock.ts', }, - transformIgnorePatterns: ['/node_modules/(?!(d3)/)'], - resolver: '/jestResolver.js', + transformIgnorePatterns: [ + 'node_modules/(?!.pnpm|d3|dateformat|delaunator|nanoid|robust-predicates|uuid)', + ], }; diff --git a/extension/jestResolver.js b/extension/jestResolver.js deleted file mode 100644 index 8e066aa4..00000000 --- a/extension/jestResolver.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = (path, options) => { - return options.defaultResolver(path, { - ...options, - packageFilter: (pkg) => { - if (pkg.name === 'nanoid') { - pkg.exports['.'].browser = pkg.exports['.'].require; - } - if (pkg.name === 'uuid' && pkg.version.startsWith('8.')) { - delete pkg.exports; - delete pkg.module; - } - return pkg; - }, - }); -}; diff --git a/packages/redux-devtools-app/jest.config.js b/packages/redux-devtools-app/jest.config.js index b7bc0a5e..e15f90f8 100644 --- a/packages/redux-devtools-app/jest.config.js +++ b/packages/redux-devtools-app/jest.config.js @@ -9,6 +9,7 @@ module.exports = { '^.+\\.jsx?$': 'babel-jest', '^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }], }, - transformIgnorePatterns: ['/node_modules/(?!(d3)/)'], - resolver: '/jestResolver.js', + transformIgnorePatterns: [ + 'node_modules/(?!.pnpm|d3|dateformat|delaunator|nanoid|robust-predicates|uuid)', + ], }; diff --git a/packages/redux-devtools-app/jestResolver.js b/packages/redux-devtools-app/jestResolver.js deleted file mode 100644 index 8e066aa4..00000000 --- a/packages/redux-devtools-app/jestResolver.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = (path, options) => { - return options.defaultResolver(path, { - ...options, - packageFilter: (pkg) => { - if (pkg.name === 'nanoid') { - pkg.exports['.'].browser = pkg.exports['.'].require; - } - if (pkg.name === 'uuid' && pkg.version.startsWith('8.')) { - delete pkg.exports; - delete pkg.module; - } - return pkg; - }, - }); -}; diff --git a/packages/redux-devtools-inspector-monitor-test-tab/jest.config.js b/packages/redux-devtools-inspector-monitor-test-tab/jest.config.js index 3244f843..b5063992 100644 --- a/packages/redux-devtools-inspector-monitor-test-tab/jest.config.js +++ b/packages/redux-devtools-inspector-monitor-test-tab/jest.config.js @@ -5,7 +5,8 @@ module.exports = { '\\.css$': '/test/__mocks__/styleMock.ts', }, transform: { + '^.+\\.jsx?$': 'babel-jest', '^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }], }, - resolver: '/jestResolver.js', + transformIgnorePatterns: ['node_modules/(?!.pnpm|nanoid)'], }; diff --git a/packages/redux-devtools-inspector-monitor-test-tab/jestResolver.js b/packages/redux-devtools-inspector-monitor-test-tab/jestResolver.js deleted file mode 100644 index 385b2568..00000000 --- a/packages/redux-devtools-inspector-monitor-test-tab/jestResolver.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = (path, options) => { - return options.defaultResolver(path, { - ...options, - packageFilter: (pkg) => { - if (pkg.name === 'nanoid') { - pkg.exports['.'].browser = pkg.exports['.'].require; - } - return pkg; - }, - }); -}; diff --git a/packages/redux-devtools-inspector-monitor/package.json b/packages/redux-devtools-inspector-monitor/package.json index 956ae877..c32ec949 100644 --- a/packages/redux-devtools-inspector-monitor/package.json +++ b/packages/redux-devtools-inspector-monitor/package.json @@ -39,7 +39,7 @@ "@types/dragula": "^3.7.1", "@types/lodash": "^4.14.191", "@types/prop-types": "^15.7.5", - "dateformat": "^4.6.3", + "dateformat": "^5.0.3", "hex-rgba": "^1.0.2", "immutable": "^4.1.0", "javascript-stringify": "^2.1.0", @@ -62,7 +62,7 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.18.6", "@redux-devtools/core": "^3.13.1", - "@types/dateformat": "^3.0.1", + "@types/dateformat": "^5.0.0", "@types/hex-rgba": "^1.0.1", "@types/history": "^4.7.11", "@types/lodash.debounce": "^4.0.7", diff --git a/packages/redux-devtools-rtk-query-monitor/jest.config.js b/packages/redux-devtools-rtk-query-monitor/jest.config.js index 3244f843..b5063992 100644 --- a/packages/redux-devtools-rtk-query-monitor/jest.config.js +++ b/packages/redux-devtools-rtk-query-monitor/jest.config.js @@ -5,7 +5,8 @@ module.exports = { '\\.css$': '/test/__mocks__/styleMock.ts', }, transform: { + '^.+\\.jsx?$': 'babel-jest', '^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }], }, - resolver: '/jestResolver.js', + transformIgnorePatterns: ['node_modules/(?!.pnpm|nanoid)'], }; diff --git a/packages/redux-devtools-rtk-query-monitor/jestResolver.js b/packages/redux-devtools-rtk-query-monitor/jestResolver.js deleted file mode 100644 index 385b2568..00000000 --- a/packages/redux-devtools-rtk-query-monitor/jestResolver.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = (path, options) => { - return options.defaultResolver(path, { - ...options, - packageFilter: (pkg) => { - if (pkg.name === 'nanoid') { - pkg.exports['.'].browser = pkg.exports['.'].require; - } - return pkg; - }, - }); -}; diff --git a/packages/redux-devtools-ui/.babelrc.json b/packages/redux-devtools-ui/babel.config.json similarity index 100% rename from packages/redux-devtools-ui/.babelrc.json rename to packages/redux-devtools-ui/babel.config.json diff --git a/packages/redux-devtools-ui/jest.config.js b/packages/redux-devtools-ui/jest.config.js index 3244f843..b5063992 100644 --- a/packages/redux-devtools-ui/jest.config.js +++ b/packages/redux-devtools-ui/jest.config.js @@ -5,7 +5,8 @@ module.exports = { '\\.css$': '/test/__mocks__/styleMock.ts', }, transform: { + '^.+\\.jsx?$': 'babel-jest', '^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }], }, - resolver: '/jestResolver.js', + transformIgnorePatterns: ['node_modules/(?!.pnpm|nanoid)'], }; diff --git a/packages/redux-devtools-ui/jestResolver.js b/packages/redux-devtools-ui/jestResolver.js deleted file mode 100644 index 385b2568..00000000 --- a/packages/redux-devtools-ui/jestResolver.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = (path, options) => { - return options.defaultResolver(path, { - ...options, - packageFilter: (pkg) => { - if (pkg.name === 'nanoid') { - pkg.exports['.'].browser = pkg.exports['.'].require; - } - return pkg; - }, - }); -}; diff --git a/packages/redux-devtools-ui/package.json b/packages/redux-devtools-ui/package.json index 317c4cd4..52a073ed 100644 --- a/packages/redux-devtools-ui/package.json +++ b/packages/redux-devtools-ui/package.json @@ -30,7 +30,7 @@ "build": "pnpm run build:lib && pnpm run build:storybook", "build:lib": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types && pnpm run build:css", "build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs", - "build:esm": "babel src --config-file ./babel.config.esm.json --no-babelrc --extensions \".ts,.tsx\" --out-dir lib/esm", + "build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm", "build:types": "tsc --emitDeclarationOnly", "build:css": "ncp fonts lib/fonts", "clean": "rimraf lib storybook-static", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27dccc09..9779a31b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1132,7 +1132,7 @@ importers: '@babel/preset-typescript': ^7.18.6 '@babel/runtime': ^7.20.6 '@redux-devtools/core': ^3.13.1 - '@types/dateformat': ^3.0.1 + '@types/dateformat': ^5.0.0 '@types/dragula': ^3.7.1 '@types/hex-rgba': ^1.0.1 '@types/history': ^4.7.11 @@ -1144,7 +1144,7 @@ importers: '@types/redux-devtools-themes': ^1.0.0 '@typescript-eslint/eslint-plugin': ^5.47.0 '@typescript-eslint/parser': ^5.47.0 - dateformat: ^4.6.3 + dateformat: ^5.0.3 eslint: ^8.30.0 eslint-config-prettier: ^8.5.0 eslint-plugin-react: ^7.31.11 @@ -1170,7 +1170,7 @@ importers: '@types/dragula': 3.7.1 '@types/lodash': 4.14.191 '@types/prop-types': 15.7.5 - dateformat: 4.6.3 + dateformat: 5.0.3 hex-rgba: 1.0.2 immutable: 4.1.0 javascript-stringify: 2.1.0 @@ -1192,7 +1192,7 @@ importers: '@babel/preset-react': 7.18.6_@babel+core@7.20.5 '@babel/preset-typescript': 7.18.6_@babel+core@7.20.5 '@redux-devtools/core': link:../redux-devtools - '@types/dateformat': 3.0.1 + '@types/dateformat': 5.0.0 '@types/hex-rgba': 1.0.1 '@types/history': 4.7.11 '@types/lodash.debounce': 4.0.7 @@ -8325,8 +8325,8 @@ packages: '@types/d3-transition': 2.0.2 '@types/d3-zoom': 2.0.3 - /@types/dateformat/3.0.1: - resolution: {integrity: sha512-KlPPdikagvL6ELjWsljbyDIPzNCeliYkqRpI+zea99vBBbCIA5JNshZAwQKTON139c87y9qvTFVgkFd14rtS4g==} + /@types/dateformat/5.0.0: + resolution: {integrity: sha512-SZg4JdHIWHQGEokbYGZSDvo5wA4TLYPXaqhigs/wH+REDOejcJzgH+qyY+HtEUtWOZxEUkbhbdYPqQDiEgrXeA==} dev: true /@types/debug/4.1.7: @@ -12159,8 +12159,9 @@ packages: engines: {node: '>=0.11'} dev: false - /dateformat/4.6.3: - resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} + /dateformat/5.0.3: + resolution: {integrity: sha512-Kvr6HmPXUMerlLcLF+Pwq3K7apHpYmGDVqrxcDasBg86UcKeTSNWbEzU8bwdXnxnR44FtMhJAxI4Bov6Y/KUfA==} + engines: {node: '>=12.20'} dev: false /debug/2.6.9: