mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-23 14:39:58 +03:00
Use rollup for redux-devtools-remote
This commit is contained in:
parent
337a428df7
commit
d533b822d1
|
@ -66,7 +66,6 @@
|
||||||
"redux": "^4.1.2",
|
"redux": "^4.1.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rollup": "^2.63.0",
|
"rollup": "^2.63.0",
|
||||||
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
||||||
"rollup-plugin-typescript2": "^0.31.1",
|
"rollup-plugin-typescript2": "^0.31.1",
|
||||||
"tslib": "^2.3.1",
|
"tslib": "^2.3.1",
|
||||||
"typescript": "~4.5.4"
|
"typescript": "~4.5.4"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import typescript from 'rollup-plugin-typescript2';
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
import babel from '@rollup/plugin-babel';
|
import babel from '@rollup/plugin-babel';
|
||||||
import nodePolyfills from 'rollup-plugin-node-polyfills';
|
|
||||||
|
|
||||||
const config = [
|
const config = [
|
||||||
{
|
{
|
||||||
|
@ -22,7 +21,6 @@ const config = [
|
||||||
extensions: ['.ts', '.tsx'],
|
extensions: ['.ts', '.tsx'],
|
||||||
plugins: ['@babel/plugin-transform-runtime'],
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
}),
|
}),
|
||||||
nodePolyfills(),
|
|
||||||
],
|
],
|
||||||
external: [
|
external: [
|
||||||
/@babel\/runtime/,
|
/@babel\/runtime/,
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
{
|
{
|
||||||
"presets": ["@babel/preset-env", "@babel/preset-typescript"]
|
"presets": [
|
||||||
|
["@babel/preset-env", { "targets": "defaults" }],
|
||||||
|
"@babel/preset-typescript"
|
||||||
|
],
|
||||||
|
"plugins": ["@babel/plugin-transform-runtime"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
|
dist
|
||||||
examples
|
examples
|
||||||
lib
|
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: '../../eslintrc.ts.base.json',
|
extends: '../../eslintrc.js.base.json',
|
||||||
parserOptions: {
|
overrides: [
|
||||||
tsconfigRootDir: __dirname,
|
{
|
||||||
project: ['./tsconfig.json'],
|
files: ['*.ts'],
|
||||||
},
|
extends: '../../eslintrc.ts.base.json',
|
||||||
|
parserOptions: {
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
project: ['./tsconfig.json'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,7 +27,7 @@ with
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { createStore } from 'redux';
|
import { createStore } from 'redux';
|
||||||
import devToolsEnhancer from '@redux-devtools/remote';
|
import { devToolsEnhancer } from '@redux-devtools/remote';
|
||||||
const store = createStore(reducer, devToolsEnhancer());
|
const store = createStore(reducer, devToolsEnhancer());
|
||||||
// or const store = createStore(reducer, preloadedState, devToolsEnhancer());
|
// or const store = createStore(reducer, preloadedState, devToolsEnhancer());
|
||||||
```
|
```
|
||||||
|
|
|
@ -21,24 +21,23 @@
|
||||||
"src",
|
"src",
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "dist/redux-devtools-remote.cjs.js",
|
||||||
"types": "lib/index.d.ts",
|
"module": "dist/redux-devtools-remote.esm.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/reduxjs/redux-devtools.git"
|
"url": "https://github.com/reduxjs/redux-devtools.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "yarn run build:types && yarn run build:js",
|
"build": "rollup -c",
|
||||||
"build:types": "tsc --emitDeclarationOnly",
|
"clean": "rimraf dist",
|
||||||
"build:js": "babel src --out-dir lib --extensions \".ts\" --source-maps inline",
|
|
||||||
"build:examples": "babel-node examples/buildAll.js",
|
|
||||||
"clean": "rimraf lib",
|
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint . --ext .ts",
|
||||||
"type-check": "tsc --noEmit",
|
"type-check": "tsc --noEmit",
|
||||||
"prepack": "yarn run clean && yarn run build",
|
"prepack": "yarn run clean && yarn run build",
|
||||||
"prepublish": "yarn run type-check && yarn run lint"
|
"prepublish": "yarn run type-check && yarn run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.16.7",
|
||||||
"@redux-devtools/instrument": "^1.11.2",
|
"@redux-devtools/instrument": "^1.11.2",
|
||||||
"@redux-devtools/utils": "^1.0.0",
|
"@redux-devtools/utils": "^1.0.0",
|
||||||
"jsan": "^3.1.14",
|
"jsan": "^3.1.14",
|
||||||
|
@ -47,10 +46,13 @@
|
||||||
"socketcluster-client": "^14.3.2"
|
"socketcluster-client": "^14.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.16.7",
|
|
||||||
"@babel/core": "^7.16.7",
|
"@babel/core": "^7.16.7",
|
||||||
|
"@babel/eslint-parser": "^7.16.5",
|
||||||
|
"@babel/plugin-transform-runtime": "^7.16.7",
|
||||||
"@babel/preset-env": "^7.16.7",
|
"@babel/preset-env": "^7.16.7",
|
||||||
"@babel/preset-typescript": "^7.16.7",
|
"@babel/preset-typescript": "^7.16.7",
|
||||||
|
"@rollup/plugin-babel": "^5.3.0",
|
||||||
|
"@rollup/plugin-commonjs": "^21.0.1",
|
||||||
"@types/jsan": "^3.1.2",
|
"@types/jsan": "^3.1.2",
|
||||||
"@types/socketcluster-client": "^13.0.5",
|
"@types/socketcluster-client": "^13.0.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||||
|
@ -59,6 +61,9 @@
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"redux": "^4.1.2",
|
"redux": "^4.1.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
"rollup": "^2.63.0",
|
||||||
|
"rollup-plugin-typescript2": "^0.31.1",
|
||||||
|
"tslib": "^2.3.1",
|
||||||
"typescript": "~4.5.4"
|
"typescript": "~4.5.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
36
packages/redux-devtools-remote/rollup.config.js
Normal file
36
packages/redux-devtools-remote/rollup.config.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
import babel from '@rollup/plugin-babel';
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: [
|
||||||
|
{
|
||||||
|
file: 'dist/redux-devtools-log-monitor.cjs.js',
|
||||||
|
format: 'cjs',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
file: 'dist/redux-devtools-log-monitor.esm.js',
|
||||||
|
format: 'esm',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
external: [
|
||||||
|
/@babel\/runtime/,
|
||||||
|
'jsan',
|
||||||
|
'socketcluster-client',
|
||||||
|
'@redux-devtools/utils',
|
||||||
|
'@redux-devtools/instrument',
|
||||||
|
'rn-host-detect',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
|
@ -1,4 +1,4 @@
|
||||||
import instrument, { Options } from '@redux-devtools/instrument';
|
import { instrument, Options } from '@redux-devtools/instrument';
|
||||||
import { Action, Reducer, StoreEnhancerStoreCreator } from 'redux';
|
import { Action, Reducer, StoreEnhancerStoreCreator } from 'redux';
|
||||||
|
|
||||||
export default function configureStore<
|
export default function configureStore<
|
||||||
|
|
|
@ -19,20 +19,17 @@ import {
|
||||||
} from '@redux-devtools/instrument';
|
} from '@redux-devtools/instrument';
|
||||||
import {
|
import {
|
||||||
ActionCreatorObject,
|
ActionCreatorObject,
|
||||||
evalAction,
|
|
||||||
getActionsArray,
|
|
||||||
} from '@redux-devtools/utils';
|
|
||||||
import catchErrors, {
|
|
||||||
ErrorAction,
|
ErrorAction,
|
||||||
} from '@redux-devtools/utils/lib/catchErrors';
|
evalAction,
|
||||||
import {
|
catchErrors,
|
||||||
|
getActionsArray,
|
||||||
getLocalFilter,
|
getLocalFilter,
|
||||||
isFiltered,
|
isFiltered,
|
||||||
filterStagedActions,
|
filterStagedActions,
|
||||||
filterState,
|
filterState,
|
||||||
LocalFilter,
|
LocalFilter,
|
||||||
State,
|
State,
|
||||||
} from '@redux-devtools/utils/lib/filters';
|
} from '@redux-devtools/utils';
|
||||||
|
|
||||||
function async(fn: () => unknown) {
|
function async(fn: () => unknown) {
|
||||||
setTimeout(fn, 0);
|
setTimeout(fn, 0);
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
import DevTools from './devTools';
|
export { default as devToolsEnhancer, composeWithDevTools } from './devTools';
|
||||||
export default DevTools;
|
|
||||||
export { composeWithDevTools } from './devTools';
|
|
||||||
|
|
|
@ -14,9 +14,7 @@ export interface ErrorAction {
|
||||||
column?: number;
|
column?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function catchErrors(
|
export function catchErrors(sendError: (errorAction: ErrorAction) => void) {
|
||||||
sendError: (errorAction: ErrorAction) => void
|
|
||||||
) {
|
|
||||||
if (typeof window === 'object' && typeof window.onerror === 'object') {
|
if (typeof window === 'object' && typeof window.onerror === 'object') {
|
||||||
window.onerror = function (message, url, lineNo, columnNo, error) {
|
window.onerror = function (message, url, lineNo, columnNo, error) {
|
||||||
const errorAction: ErrorAction = {
|
const errorAction: ErrorAction = {
|
||||||
|
|
|
@ -10,7 +10,7 @@ interface State {
|
||||||
committedState?: unknown;
|
committedState?: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function importState(
|
export function importState(
|
||||||
state: string,
|
state: string,
|
||||||
{
|
{
|
||||||
serialize,
|
serialize,
|
||||||
|
|
|
@ -253,3 +253,7 @@ export function getStackTrace(
|
||||||
}
|
}
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export * from './catchErrors';
|
||||||
|
export * from './filters';
|
||||||
|
export * from './importState';
|
||||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -5056,7 +5056,6 @@ __metadata:
|
||||||
redux-devtools-themes: ^1.0.0
|
redux-devtools-themes: ^1.0.0
|
||||||
rimraf: ^3.0.2
|
rimraf: ^3.0.2
|
||||||
rollup: ^2.63.0
|
rollup: ^2.63.0
|
||||||
rollup-plugin-node-polyfills: ^0.2.1
|
|
||||||
rollup-plugin-typescript2: ^0.31.1
|
rollup-plugin-typescript2: ^0.31.1
|
||||||
tslib: ^2.3.1
|
tslib: ^2.3.1
|
||||||
typescript: ~4.5.4
|
typescript: ~4.5.4
|
||||||
|
@ -5072,12 +5071,16 @@ __metadata:
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@redux-devtools/remote@workspace:packages/redux-devtools-remote"
|
resolution: "@redux-devtools/remote@workspace:packages/redux-devtools-remote"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/cli": ^7.16.7
|
|
||||||
"@babel/core": ^7.16.7
|
"@babel/core": ^7.16.7
|
||||||
|
"@babel/eslint-parser": ^7.16.5
|
||||||
|
"@babel/plugin-transform-runtime": ^7.16.7
|
||||||
"@babel/preset-env": ^7.16.7
|
"@babel/preset-env": ^7.16.7
|
||||||
"@babel/preset-typescript": ^7.16.7
|
"@babel/preset-typescript": ^7.16.7
|
||||||
|
"@babel/runtime": ^7.16.7
|
||||||
"@redux-devtools/instrument": ^1.11.2
|
"@redux-devtools/instrument": ^1.11.2
|
||||||
"@redux-devtools/utils": ^1.0.0
|
"@redux-devtools/utils": ^1.0.0
|
||||||
|
"@rollup/plugin-babel": ^5.3.0
|
||||||
|
"@rollup/plugin-commonjs": ^21.0.1
|
||||||
"@types/jsan": ^3.1.2
|
"@types/jsan": ^3.1.2
|
||||||
"@types/socketcluster-client": ^13.0.5
|
"@types/socketcluster-client": ^13.0.5
|
||||||
"@typescript-eslint/eslint-plugin": ^5.8.1
|
"@typescript-eslint/eslint-plugin": ^5.8.1
|
||||||
|
@ -5089,7 +5092,10 @@ __metadata:
|
||||||
redux: ^4.1.2
|
redux: ^4.1.2
|
||||||
rimraf: ^3.0.2
|
rimraf: ^3.0.2
|
||||||
rn-host-detect: ^1.2.0
|
rn-host-detect: ^1.2.0
|
||||||
|
rollup: ^2.63.0
|
||||||
|
rollup-plugin-typescript2: ^0.31.1
|
||||||
socketcluster-client: ^14.3.2
|
socketcluster-client: ^14.3.2
|
||||||
|
tslib: ^2.3.1
|
||||||
typescript: ~4.5.4
|
typescript: ~4.5.4
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
redux: ^3.5.2 || ^4.0.0
|
redux: ^3.5.2 || ^4.0.0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user