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