mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-22 01:26:48 +03:00
Add ESM builds (#997)
* Use rollup for d3tooltip * Use rollup for map2tree * Set moduleResolution * Use rollup for d3-state-visualizer * Use rollup for react-base16-styling * Use rollup for react-dock * Use rollup for react-json-tree * Use rollup for redux-devtools * Use rollup for redux-devtools-intrument * Use rollup for redux-devtools-chart-monitor * Update export * Use rollup for redux-devtools-dock-monitor * Use rollup for redux-devtools-inspector-monitor * Fix inspector demo * Fix invalid eslint config * Use rollup for inspector-monitor-test-tab * Use rollup for inspector-monitor-trace-tab * Use rollup for redux-devtools-log-monitor * Use rollup for redux-devtools-remote * Use rollup in redux-devtools-rtk-query-monitor * Use rollup for redux-devtools-serialize * Fix redux-devtools examples * Use rollup for redux-devtools-slider-monitor * Fix slider examples * Use rollup for redux-devtools-ui * Use rollup for redux-devtools-utils * Use rollup for redux-devtools-extension * Use rollup for redux-devtools-app * Fix Webpack app build * Fix extension build * Turn on minimization * Update CLI
This commit is contained in:
parent
aa93a0d703
commit
b82de74592
3
eslintrc.js.base.json
Normal file
3
eslintrc.js.base.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"parser": "@babel/eslint-parser"
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
./docs/README.md
|
|
|
@ -1,7 +1,7 @@
|
||||||
import mapValues from 'lodash/mapValues';
|
import mapValues from 'lodash/mapValues';
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
import { LiftedState, PerformAction } from '@redux-devtools/instrument';
|
import { LiftedState, PerformAction } from '@redux-devtools/instrument';
|
||||||
import { LocalFilter } from '@redux-devtools/utils/lib/filters';
|
import { LocalFilter } from '@redux-devtools/utils';
|
||||||
|
|
||||||
export type FilterStateValue =
|
export type FilterStateValue =
|
||||||
| 'DO_NOT_FILTER'
|
| 'DO_NOT_FILTER'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import jsan from 'jsan';
|
import jsan from 'jsan';
|
||||||
import seralizeImmutable from '@redux-devtools/serialize/lib/immutable/serialize';
|
import { immutableSerialize } from '@redux-devtools/serialize';
|
||||||
import {
|
import {
|
||||||
Config,
|
Config,
|
||||||
SerializeWithImmutable,
|
SerializeWithImmutable,
|
||||||
|
@ -44,7 +44,7 @@ export default function importState<S, A extends Action<unknown>>(
|
||||||
parse = (v) =>
|
parse = (v) =>
|
||||||
jsan.parse(
|
jsan.parse(
|
||||||
v,
|
v,
|
||||||
seralizeImmutable(
|
immutableSerialize(
|
||||||
serialize.immutable,
|
serialize.immutable,
|
||||||
serialize.refs,
|
serialize.refs,
|
||||||
serialize.replacer,
|
serialize.replacer,
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
import jsan, { Options } from 'jsan';
|
import jsan, { Options } from 'jsan';
|
||||||
import throttle from 'lodash/throttle';
|
import throttle from 'lodash/throttle';
|
||||||
import serializeImmutable from '@redux-devtools/serialize/lib/immutable/serialize';
|
import { immutableSerialize } from '@redux-devtools/serialize';
|
||||||
import { getActionsArray } from '@redux-devtools/utils';
|
import { getActionsArray, getLocalFilter } from '@redux-devtools/utils';
|
||||||
import { getLocalFilter } from '@redux-devtools/utils/lib/filters';
|
|
||||||
import { isFiltered, PartialLiftedState } from './filters';
|
import { isFiltered, PartialLiftedState } from './filters';
|
||||||
import importState from './importState';
|
import importState from './importState';
|
||||||
import generateId from './generateInstanceId';
|
import generateId from './generateInstanceId';
|
||||||
import { Config } from '../../browser/extension/inject/pageScript';
|
import { Config } from '../../browser/extension/inject/pageScript';
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
import { LiftedState, PerformAction } from '@redux-devtools/instrument';
|
import { LiftedState, PerformAction } from '@redux-devtools/instrument';
|
||||||
import { LibConfig } from '@redux-devtools/app/lib/actions';
|
import { LibConfig } from '@redux-devtools/app';
|
||||||
import {
|
import {
|
||||||
ContentScriptToPageScriptMessage,
|
ContentScriptToPageScriptMessage,
|
||||||
ListenerMessage,
|
ListenerMessage,
|
||||||
|
@ -77,7 +76,7 @@ export function getSerializeParameter(config: Config) {
|
||||||
if (serialize) {
|
if (serialize) {
|
||||||
if (serialize === true) return { options: true };
|
if (serialize === true) return { options: true };
|
||||||
if (serialize.immutable) {
|
if (serialize.immutable) {
|
||||||
const immutableSerializer = serializeImmutable(
|
const immutableSerializer = immutableSerialize(
|
||||||
serialize.immutable,
|
serialize.immutable,
|
||||||
serialize.refs,
|
serialize.refs,
|
||||||
serialize.replacer,
|
serialize.replacer,
|
||||||
|
|
|
@ -1,26 +1,24 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect, ResolveThunks } from 'react-redux';
|
import { connect, ResolveThunks } from 'react-redux';
|
||||||
import { Button, Container, Divider, Toolbar } from '@redux-devtools/ui';
|
import { Button, Container, Divider, Toolbar } from '@redux-devtools/ui';
|
||||||
import SliderMonitor from '@redux-devtools/app/lib/containers/monitors/Slider';
|
|
||||||
import { liftedDispatch, getReport } from '@redux-devtools/app/lib/actions';
|
|
||||||
import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances';
|
|
||||||
import DevTools from '@redux-devtools/app/lib/containers/DevTools';
|
|
||||||
import Dispatcher from '@redux-devtools/app/lib/containers/monitors/Dispatcher';
|
|
||||||
import TopButtons from '@redux-devtools/app/lib/components/TopButtons';
|
|
||||||
import ExportButton from '@redux-devtools/app/lib/components/buttons/ExportButton';
|
|
||||||
import ImportButton from '@redux-devtools/app/lib/components/buttons/ImportButton';
|
|
||||||
import PrintButton from '@redux-devtools/app/lib/components/buttons/PrintButton';
|
|
||||||
import MonitorSelector from '@redux-devtools/app/lib/components/MonitorSelector';
|
|
||||||
import SliderButton from '@redux-devtools/app/lib/components/buttons/SliderButton';
|
|
||||||
import DispatcherButton from '@redux-devtools/app/lib/components/buttons/DispatcherButton';
|
|
||||||
import { StoreState } from '@redux-devtools/app/lib/reducers';
|
|
||||||
import { GoRadioTower } from 'react-icons/go';
|
|
||||||
import {
|
import {
|
||||||
MdBorderBottom,
|
DevTools,
|
||||||
MdBorderLeft,
|
Dispatcher,
|
||||||
MdBorderRight,
|
DispatcherButton,
|
||||||
MdSave,
|
ExportButton,
|
||||||
} from 'react-icons/md';
|
getActiveInstance,
|
||||||
|
getReport,
|
||||||
|
ImportButton,
|
||||||
|
liftedDispatch,
|
||||||
|
MonitorSelector,
|
||||||
|
PrintButton,
|
||||||
|
SliderButton,
|
||||||
|
SliderMonitor,
|
||||||
|
StoreState,
|
||||||
|
TopButtons,
|
||||||
|
} from '@redux-devtools/app';
|
||||||
|
import { GoRadioTower } from 'react-icons/go';
|
||||||
|
import { MdBorderBottom, MdBorderLeft, MdBorderRight } from 'react-icons/md';
|
||||||
import { Position } from '../api/openWindow';
|
import { Position } from '../api/openWindow';
|
||||||
import { SingleMessage } from '../middlewares/api';
|
import { SingleMessage } from '../middlewares/api';
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect, ResolveThunks } from 'react-redux';
|
import { connect, ResolveThunks } from 'react-redux';
|
||||||
import { Container, Notification } from '@redux-devtools/ui';
|
import { Container, Notification } from '@redux-devtools/ui';
|
||||||
import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances';
|
import {
|
||||||
import Settings from '@redux-devtools/app/lib/components/Settings';
|
clearNotification,
|
||||||
import Header from '@redux-devtools/app/lib/components/Header';
|
getActiveInstance,
|
||||||
import { clearNotification } from '@redux-devtools/app/lib/actions';
|
Header,
|
||||||
import { StoreState } from '@redux-devtools/app/lib/reducers';
|
Settings,
|
||||||
|
StoreState,
|
||||||
|
} from '@redux-devtools/app';
|
||||||
import Actions from './Actions';
|
import Actions from './Actions';
|
||||||
|
|
||||||
type StateProps = ReturnType<typeof mapStateToProps>;
|
type StateProps = ReturnType<typeof mapStateToProps>;
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
import stringifyJSON from '@redux-devtools/app/lib/utils/stringifyJSON';
|
|
||||||
import {
|
import {
|
||||||
UPDATE_STATE,
|
CustomAction,
|
||||||
REMOVE_INSTANCE,
|
DispatchAction as AppDispatchAction,
|
||||||
|
LibConfig,
|
||||||
LIFTED_ACTION,
|
LIFTED_ACTION,
|
||||||
TOGGLE_PERSIST,
|
nonReduxDispatch,
|
||||||
|
REMOVE_INSTANCE,
|
||||||
SET_PERSIST,
|
SET_PERSIST,
|
||||||
} from '@redux-devtools/app/lib/constants/actionTypes';
|
SetPersistAction,
|
||||||
import { nonReduxDispatch } from '@redux-devtools/app/lib/utils/monitorActions';
|
stringifyJSON,
|
||||||
|
TOGGLE_PERSIST,
|
||||||
|
UPDATE_STATE,
|
||||||
|
} from '@redux-devtools/app';
|
||||||
import syncOptions, {
|
import syncOptions, {
|
||||||
Options,
|
Options,
|
||||||
OptionsMessage,
|
OptionsMessage,
|
||||||
|
@ -16,12 +20,6 @@ import openDevToolsWindow, {
|
||||||
DevToolsPosition,
|
DevToolsPosition,
|
||||||
} from '../../browser/extension/background/openWindow';
|
} from '../../browser/extension/background/openWindow';
|
||||||
import { getReport } from '../../browser/extension/background/logging';
|
import { getReport } from '../../browser/extension/background/logging';
|
||||||
import {
|
|
||||||
CustomAction,
|
|
||||||
DispatchAction as AppDispatchAction,
|
|
||||||
LibConfig,
|
|
||||||
SetPersistAction,
|
|
||||||
} from '@redux-devtools/app/lib/actions';
|
|
||||||
import { Action, Dispatch, MiddlewareAPI } from 'redux';
|
import { Action, Dispatch, MiddlewareAPI } from 'redux';
|
||||||
import {
|
import {
|
||||||
ContentScriptToBackgroundMessage,
|
ContentScriptToBackgroundMessage,
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Dispatch, MiddlewareAPI } from 'redux';
|
import { Dispatch, MiddlewareAPI } from 'redux';
|
||||||
import {
|
import {
|
||||||
SELECT_INSTANCE,
|
SELECT_INSTANCE,
|
||||||
|
StoreAction,
|
||||||
|
StoreState,
|
||||||
UPDATE_STATE,
|
UPDATE_STATE,
|
||||||
} from '@redux-devtools/app/lib/constants/actionTypes';
|
} from '@redux-devtools/app';
|
||||||
import { StoreAction } from '@redux-devtools/app/lib/actions';
|
|
||||||
import { StoreState } from '@redux-devtools/app/lib/reducers';
|
|
||||||
|
|
||||||
function selectInstance(
|
function selectInstance(
|
||||||
tabId: number,
|
tabId: number,
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import {
|
import {
|
||||||
|
getActiveInstance,
|
||||||
LIFTED_ACTION,
|
LIFTED_ACTION,
|
||||||
UPDATE_STATE,
|
|
||||||
SELECT_INSTANCE,
|
SELECT_INSTANCE,
|
||||||
|
StoreAction,
|
||||||
|
StoreState,
|
||||||
TOGGLE_PERSIST,
|
TOGGLE_PERSIST,
|
||||||
} from '@redux-devtools/app/lib/constants/actionTypes';
|
UPDATE_STATE,
|
||||||
import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances';
|
} from '@redux-devtools/app';
|
||||||
import { Dispatch, MiddlewareAPI } from 'redux';
|
import { Dispatch, MiddlewareAPI } from 'redux';
|
||||||
import { StoreState } from '@redux-devtools/app/lib/reducers';
|
|
||||||
import { StoreAction } from '@redux-devtools/app/lib/actions';
|
|
||||||
|
|
||||||
function panelDispatcher(bgConnection: chrome.runtime.Port) {
|
function panelDispatcher(bgConnection: chrome.runtime.Port) {
|
||||||
let autoselected = false;
|
let autoselected = false;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import {
|
import {
|
||||||
UPDATE_STATE,
|
getActiveInstance,
|
||||||
LIFTED_ACTION,
|
LIFTED_ACTION,
|
||||||
|
StoreAction,
|
||||||
|
StoreState,
|
||||||
TOGGLE_PERSIST,
|
TOGGLE_PERSIST,
|
||||||
} from '@redux-devtools/app/lib/constants/actionTypes';
|
UPDATE_STATE,
|
||||||
import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances';
|
} from '@redux-devtools/app';
|
||||||
import { Dispatch, MiddlewareAPI, Store } from 'redux';
|
import { Dispatch, MiddlewareAPI, Store } from 'redux';
|
||||||
import { BackgroundState } from '../reducers/background';
|
import { BackgroundState } from '../reducers/background';
|
||||||
import { StoreAction } from '@redux-devtools/app/lib/actions';
|
|
||||||
import { WindowStoreAction } from '../stores/windowStore';
|
import { WindowStoreAction } from '../stores/windowStore';
|
||||||
import { StoreState } from '@redux-devtools/app/lib/reducers';
|
|
||||||
import { BackgroundAction } from '../stores/backgroundStore';
|
import { BackgroundAction } from '../stores/backgroundStore';
|
||||||
|
|
||||||
const syncStores =
|
const syncStores =
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import { combineReducers, Reducer } from 'redux';
|
import { combineReducers, Reducer } from 'redux';
|
||||||
import instances, {
|
import { instances, InstancesState } from '@redux-devtools/app';
|
||||||
InstancesState,
|
|
||||||
} from '@redux-devtools/app/lib/reducers/instances';
|
|
||||||
import { BackgroundAction } from '../../stores/backgroundStore';
|
import { BackgroundAction } from '../../stores/backgroundStore';
|
||||||
|
|
||||||
export interface BackgroundState {
|
export interface BackgroundState {
|
||||||
|
|
|
@ -1,24 +1,21 @@
|
||||||
import { combineReducers, Reducer } from 'redux';
|
import { combineReducers, Reducer } from 'redux';
|
||||||
import instances, {
|
import {
|
||||||
InstancesState,
|
connection,
|
||||||
} from '@redux-devtools/app/lib/reducers/instances';
|
|
||||||
import monitor, {
|
|
||||||
MonitorState,
|
|
||||||
} from '@redux-devtools/app/lib/reducers/monitor';
|
|
||||||
import notification, {
|
|
||||||
NotificationState,
|
|
||||||
} from '@redux-devtools/app/lib/reducers/notification';
|
|
||||||
import reports, {
|
|
||||||
ReportsState,
|
|
||||||
} from '@redux-devtools/app/lib/reducers/reports';
|
|
||||||
import section, {
|
|
||||||
SectionState,
|
|
||||||
} from '@redux-devtools/app/lib/reducers/section';
|
|
||||||
import theme, { ThemeState } from '@redux-devtools/app/lib/reducers/theme';
|
|
||||||
import connection, {
|
|
||||||
ConnectionState,
|
ConnectionState,
|
||||||
} from '@redux-devtools/app/lib/reducers/connection';
|
instances,
|
||||||
import { StoreAction } from '@redux-devtools/app/lib/actions';
|
InstancesState,
|
||||||
|
monitor,
|
||||||
|
MonitorState,
|
||||||
|
notification,
|
||||||
|
NotificationState,
|
||||||
|
reports,
|
||||||
|
ReportsState,
|
||||||
|
section,
|
||||||
|
SectionState,
|
||||||
|
StoreAction,
|
||||||
|
theme,
|
||||||
|
ThemeState,
|
||||||
|
} from '@redux-devtools/app';
|
||||||
|
|
||||||
export interface StoreStateWithoutSocket {
|
export interface StoreStateWithoutSocket {
|
||||||
readonly section: SectionState;
|
readonly section: SectionState;
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
import { combineReducers, Reducer } from 'redux';
|
import { combineReducers, Reducer } from 'redux';
|
||||||
|
import {
|
||||||
|
connection,
|
||||||
|
monitor,
|
||||||
|
notification,
|
||||||
|
reports,
|
||||||
|
section,
|
||||||
|
socket,
|
||||||
|
theme,
|
||||||
|
StoreState,
|
||||||
|
} from '@redux-devtools/app';
|
||||||
import instances from './instances';
|
import instances from './instances';
|
||||||
import monitor from '@redux-devtools/app/lib/reducers/monitor';
|
|
||||||
import notification from '@redux-devtools/app/lib/reducers/notification';
|
|
||||||
import socket from '@redux-devtools/app/lib/reducers/socket';
|
|
||||||
import reports from '@redux-devtools/app/lib/reducers/reports';
|
|
||||||
import section from '@redux-devtools/app/lib/reducers/section';
|
|
||||||
import theme from '@redux-devtools/app/lib/reducers/theme';
|
|
||||||
import connection from '@redux-devtools/app/lib/reducers/connection';
|
|
||||||
import { StoreState } from '@redux-devtools/app/lib/reducers';
|
|
||||||
import { WindowStoreAction } from '../../stores/windowStore';
|
import { WindowStoreAction } from '../../stores/windowStore';
|
||||||
|
|
||||||
const rootReducer: Reducer<StoreState, WindowStoreAction> =
|
const rootReducer: Reducer<StoreState, WindowStoreAction> =
|
||||||
|
|
|
@ -1,20 +1,18 @@
|
||||||
import {
|
import {
|
||||||
initialState,
|
instancesInitialState,
|
||||||
dispatchAction,
|
dispatchAction,
|
||||||
} from '@redux-devtools/app/lib/reducers/instances';
|
|
||||||
import {
|
|
||||||
UPDATE_STATE,
|
UPDATE_STATE,
|
||||||
SELECT_INSTANCE,
|
SELECT_INSTANCE,
|
||||||
LIFTED_ACTION,
|
LIFTED_ACTION,
|
||||||
SET_PERSIST,
|
SET_PERSIST,
|
||||||
} from '@redux-devtools/app/lib/constants/actionTypes';
|
} from '@redux-devtools/app';
|
||||||
import {
|
import {
|
||||||
ExpandedUpdateStateAction,
|
ExpandedUpdateStateAction,
|
||||||
WindowStoreAction,
|
WindowStoreAction,
|
||||||
} from '../../stores/windowStore';
|
} from '../../stores/windowStore';
|
||||||
|
|
||||||
export default function instances(
|
export default function instances(
|
||||||
state = initialState,
|
state = instancesInitialState,
|
||||||
action: WindowStoreAction
|
action: WindowStoreAction
|
||||||
) {
|
) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
import { LiftedState } from '@redux-devtools/instrument';
|
import { LiftedState } from '@redux-devtools/instrument';
|
||||||
import { DispatchAction, LibConfig } from '@redux-devtools/app/lib/actions';
|
import { DispatchAction, LibConfig } from '@redux-devtools/app';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { createStore, applyMiddleware, PreloadedState } from 'redux';
|
import { createStore, applyMiddleware, PreloadedState } from 'redux';
|
||||||
import rootReducer, { BackgroundState } from '../reducers/background';
|
|
||||||
import api, { CONNECTED, DISCONNECTED } from '../middlewares/api';
|
|
||||||
import { LIFTED_ACTION } from '@redux-devtools/app/lib/constants/actionTypes';
|
|
||||||
import {
|
import {
|
||||||
CustomAction,
|
CustomAction,
|
||||||
DispatchAction,
|
DispatchAction,
|
||||||
|
LIFTED_ACTION,
|
||||||
StoreActionWithoutLiftedAction,
|
StoreActionWithoutLiftedAction,
|
||||||
} from '@redux-devtools/app/lib/actions';
|
} from '@redux-devtools/app';
|
||||||
|
import rootReducer, { BackgroundState } from '../reducers/background';
|
||||||
|
import api, { CONNECTED, DISCONNECTED } from '../middlewares/api';
|
||||||
|
|
||||||
interface LiftedActionActionBase {
|
interface LiftedActionActionBase {
|
||||||
action?: DispatchAction | string | CustomAction;
|
action?: DispatchAction | string | CustomAction;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Action, compose, Reducer, StoreEnhancerStoreCreator } from 'redux';
|
import { Action, compose, Reducer, StoreEnhancerStoreCreator } from 'redux';
|
||||||
import instrument from '@redux-devtools/instrument';
|
import { instrument } from '@redux-devtools/instrument';
|
||||||
import persistState from '@redux-devtools/core/lib/persistState';
|
import { persistState } from '@redux-devtools/core';
|
||||||
import { ConfigWithExpandedMaxAge } from '../../browser/extension/inject/pageScript';
|
import { ConfigWithExpandedMaxAge } from '../../browser/extension/inject/pageScript';
|
||||||
|
|
||||||
export function getUrlParam(key: string) {
|
export function getUrlParam(key: string) {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import { createStore, applyMiddleware, PreloadedState, Reducer } from 'redux';
|
import { createStore, applyMiddleware, Reducer } from 'redux';
|
||||||
import localForage from 'localforage';
|
import localForage from 'localforage';
|
||||||
import { persistReducer, persistStore } from 'redux-persist';
|
import { persistReducer, persistStore } from 'redux-persist';
|
||||||
import exportState from '@redux-devtools/app/lib/middlewares/exportState';
|
import { exportStateMiddleware, StoreAction } from '@redux-devtools/app';
|
||||||
import panelDispatcher from '../middlewares/panelSync';
|
import panelDispatcher from '../middlewares/panelSync';
|
||||||
import rootReducer, { StoreStateWithoutSocket } from '../reducers/panel';
|
import rootReducer, { StoreStateWithoutSocket } from '../reducers/panel';
|
||||||
import { StoreAction } from '@redux-devtools/app/lib/actions';
|
|
||||||
|
|
||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: 'redux-devtools',
|
key: 'redux-devtools',
|
||||||
|
@ -19,7 +18,10 @@ export default function configureStore(
|
||||||
position: string,
|
position: string,
|
||||||
bgConnection: chrome.runtime.Port
|
bgConnection: chrome.runtime.Port
|
||||||
) {
|
) {
|
||||||
const enhancer = applyMiddleware(exportState, panelDispatcher(bgConnection));
|
const enhancer = applyMiddleware(
|
||||||
|
exportStateMiddleware,
|
||||||
|
panelDispatcher(bgConnection)
|
||||||
|
);
|
||||||
const store = createStore(persistedReducer, enhancer);
|
const store = createStore(persistedReducer, enhancer);
|
||||||
const persistor = persistStore(store);
|
const persistor = persistStore(store);
|
||||||
return { store, persistor };
|
return { store, persistor };
|
||||||
|
|
|
@ -8,21 +8,21 @@ import {
|
||||||
} from 'redux';
|
} from 'redux';
|
||||||
import localForage from 'localforage';
|
import localForage from 'localforage';
|
||||||
import { persistReducer, persistStore } from 'redux-persist';
|
import { persistReducer, persistStore } from 'redux-persist';
|
||||||
import exportState from '@redux-devtools/app/lib/middlewares/exportState';
|
|
||||||
import api from '@redux-devtools/app/lib/middlewares/api';
|
|
||||||
import { CONNECT_REQUEST } from '@redux-devtools/app/lib/constants/socketActionTypes';
|
|
||||||
import {
|
import {
|
||||||
|
api,
|
||||||
|
CONNECT_REQUEST,
|
||||||
|
exportStateMiddleware,
|
||||||
|
InstancesState,
|
||||||
StoreActionWithoutUpdateState,
|
StoreActionWithoutUpdateState,
|
||||||
|
StoreState,
|
||||||
UpdateStateAction,
|
UpdateStateAction,
|
||||||
} from '@redux-devtools/app/lib/actions';
|
} from '@redux-devtools/app';
|
||||||
import { InstancesState } from '@redux-devtools/app/lib/reducers/instances';
|
|
||||||
import syncStores from '../middlewares/windowSync';
|
import syncStores from '../middlewares/windowSync';
|
||||||
import instanceSelector from '../middlewares/instanceSelector';
|
import instanceSelector from '../middlewares/instanceSelector';
|
||||||
import rootReducer from '../reducers/window';
|
import rootReducer from '../reducers/window';
|
||||||
import { BackgroundState } from '../reducers/background';
|
import { BackgroundState } from '../reducers/background';
|
||||||
import { BackgroundAction } from './backgroundStore';
|
import { BackgroundAction } from './backgroundStore';
|
||||||
import { EmptyUpdateStateAction, NAAction } from '../middlewares/api';
|
import { EmptyUpdateStateAction, NAAction } from '../middlewares/api';
|
||||||
import { StoreState } from '@redux-devtools/app/lib/reducers';
|
|
||||||
|
|
||||||
export interface ExpandedUpdateStateAction extends UpdateStateAction {
|
export interface ExpandedUpdateStateAction extends UpdateStateAction {
|
||||||
readonly instances: InstancesState;
|
readonly instances: InstancesState;
|
||||||
|
@ -50,7 +50,7 @@ export default function configureStore(
|
||||||
position: string
|
position: string
|
||||||
) {
|
) {
|
||||||
let enhancer: StoreEnhancer;
|
let enhancer: StoreEnhancer;
|
||||||
const middlewares = [exportState, api, syncStores(baseStore)];
|
const middlewares = [exportStateMiddleware, api, syncStores(baseStore)];
|
||||||
if (!position || position === '#popup') {
|
if (!position || position === '#popup') {
|
||||||
// select current tab instance for devPanel and pageAction
|
// select current tab instance for devPanel and pageAction
|
||||||
middlewares.push(instanceSelector);
|
middlewares.push(instanceSelector);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { LIFTED_ACTION } from '@redux-devtools/app/lib/constants/actionTypes';
|
import { LIFTED_ACTION } from '@redux-devtools/app';
|
||||||
|
|
||||||
export function getReport(
|
export function getReport(
|
||||||
reportId: string,
|
reportId: string,
|
||||||
|
|
|
@ -2,13 +2,12 @@ import React, { CSSProperties } from 'react';
|
||||||
import { render, unmountComponentAtNode } from 'react-dom';
|
import { render, unmountComponentAtNode } from 'react-dom';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { Persistor } from 'redux-persist';
|
import { Persistor } from 'redux-persist';
|
||||||
import { REMOVE_INSTANCE } from '@redux-devtools/app/lib/constants/actionTypes';
|
import { REMOVE_INSTANCE, StoreAction } from '@redux-devtools/app';
|
||||||
import App from '../../../app/containers/App';
|
import App from '../../../app/containers/App';
|
||||||
import configureStore from '../../../app/stores/panelStore';
|
import configureStore from '../../../app/stores/panelStore';
|
||||||
|
|
||||||
import '../../views/devpanel.pug';
|
import '../../views/devpanel.pug';
|
||||||
import { Action, Store } from 'redux';
|
import { Action, Store } from 'redux';
|
||||||
import { StoreAction } from '@redux-devtools/app/lib/actions';
|
|
||||||
import { PanelMessage } from '../../../app/middlewares/api';
|
import { PanelMessage } from '../../../app/middlewares/api';
|
||||||
import { StoreStateWithoutSocket } from '../../../app/reducers/panel';
|
import { StoreStateWithoutSocket } from '../../../app/reducers/panel';
|
||||||
import { PersistGate } from 'redux-persist/integration/react';
|
import { PersistGate } from 'redux-persist/integration/react';
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { Action } from 'redux';
|
||||||
import {
|
import {
|
||||||
CustomAction,
|
CustomAction,
|
||||||
DispatchAction as AppDispatchAction,
|
DispatchAction as AppDispatchAction,
|
||||||
} from '@redux-devtools/app/lib/actions';
|
} from '@redux-devtools/app';
|
||||||
import { LiftedState } from '@redux-devtools/instrument';
|
import { LiftedState } from '@redux-devtools/instrument';
|
||||||
const source = '@devtools-extension';
|
const source = '@devtools-extension';
|
||||||
const pageSource = '@devtools-page';
|
const pageSource = '@devtools-page';
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import {
|
import {
|
||||||
getActionsArray,
|
|
||||||
evalAction,
|
|
||||||
ActionCreatorObject,
|
ActionCreatorObject,
|
||||||
|
evalAction,
|
||||||
|
getActionsArray,
|
||||||
|
getLocalFilter,
|
||||||
} from '@redux-devtools/utils';
|
} from '@redux-devtools/utils';
|
||||||
import throttle from 'lodash/throttle';
|
import throttle from 'lodash/throttle';
|
||||||
import {
|
import {
|
||||||
|
@ -14,7 +15,18 @@ import {
|
||||||
StoreEnhancerStoreCreator,
|
StoreEnhancerStoreCreator,
|
||||||
} from 'redux';
|
} from 'redux';
|
||||||
import Immutable from 'immutable';
|
import Immutable from 'immutable';
|
||||||
import { EnhancedStore, PerformAction } from '@redux-devtools/instrument';
|
import {
|
||||||
|
EnhancedStore,
|
||||||
|
LiftedAction,
|
||||||
|
LiftedState,
|
||||||
|
PerformAction,
|
||||||
|
} from '@redux-devtools/instrument';
|
||||||
|
import {
|
||||||
|
CustomAction,
|
||||||
|
DispatchAction,
|
||||||
|
LibConfig,
|
||||||
|
Features,
|
||||||
|
} from '@redux-devtools/app';
|
||||||
import configureStore, { getUrlParam } from '../../../app/stores/enhancerStore';
|
import configureStore, { getUrlParam } from '../../../app/stores/enhancerStore';
|
||||||
import { isAllowed, Options } from '../options/syncOptions';
|
import { isAllowed, Options } from '../options/syncOptions';
|
||||||
import Monitor from '../../../app/service/Monitor';
|
import Monitor from '../../../app/service/Monitor';
|
||||||
|
@ -40,15 +52,7 @@ import {
|
||||||
StructuralPerformAction,
|
StructuralPerformAction,
|
||||||
ConnectResponse,
|
ConnectResponse,
|
||||||
} from '../../../app/api';
|
} from '../../../app/api';
|
||||||
import { LiftedAction, LiftedState } from '@redux-devtools/instrument';
|
|
||||||
import {
|
|
||||||
CustomAction,
|
|
||||||
DispatchAction,
|
|
||||||
LibConfig,
|
|
||||||
} from '@redux-devtools/app/lib/actions';
|
|
||||||
import { ContentScriptToPageScriptMessage } from './contentScript';
|
import { ContentScriptToPageScriptMessage } from './contentScript';
|
||||||
import { Features } from '@redux-devtools/app/lib/reducers/instances';
|
|
||||||
import { getLocalFilter } from '@redux-devtools/utils/lib/filters';
|
|
||||||
|
|
||||||
type EnhancedStoreWithInitialDispatch<
|
type EnhancedStoreWithInitialDispatch<
|
||||||
S,
|
S,
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { PersistGate } from 'redux-persist/integration/react';
|
import { PersistGate } from 'redux-persist/integration/react';
|
||||||
import { UPDATE_STATE } from '@redux-devtools/app/lib/constants/actionTypes';
|
import { UPDATE_STATE } from '@redux-devtools/app';
|
||||||
import App from '../../../app/containers/App';
|
import App from '../../../app/containers/App';
|
||||||
import configureStore from '../../../app/stores/windowStore';
|
import configureStore from '../../../app/stores/windowStore';
|
||||||
import { MonitorMessage } from '../../../app/middlewares/api';
|
import { MonitorMessage } from '../../../app/middlewares/api';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import App from '@redux-devtools/app';
|
import { Root } from '@redux-devtools/app';
|
||||||
|
|
||||||
import '../../views/remote.pug';
|
import '../../views/remote.pug';
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ chrome.storage.local.get(
|
||||||
's:secure': null,
|
's:secure': null,
|
||||||
},
|
},
|
||||||
(options) => {
|
(options) => {
|
||||||
const AppAsAny = App as any;
|
const AppAsAny = Root as any;
|
||||||
render(
|
render(
|
||||||
<AppAsAny
|
<AppAsAny
|
||||||
selectMonitor={options['select-monitor']}
|
selectMonitor={options['select-monitor']}
|
||||||
|
|
|
@ -52,9 +52,6 @@ const baseConfig = (params) => ({
|
||||||
})
|
})
|
||||||
: []
|
: []
|
||||||
),
|
),
|
||||||
optimization: {
|
|
||||||
minimize: false,
|
|
||||||
},
|
|
||||||
performance: {
|
performance: {
|
||||||
hints: false,
|
hints: false,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.16.7",
|
||||||
|
"@babel/eslint-parser": "^7.16.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||||
"@typescript-eslint/parser": "^5.8.1",
|
"@typescript-eslint/parser": "^5.8.1",
|
||||||
"eslint": "^8.6.0",
|
"eslint": "^8.6.0",
|
||||||
|
|
|
@ -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,3 +1,2 @@
|
||||||
examples
|
examples
|
||||||
lib
|
|
||||||
dist
|
dist
|
||||||
|
|
|
@ -1,16 +1,12 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: '../../eslintrc.ts.base.json',
|
extends: '../../eslintrc.js.base.json',
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: ['./tsconfig.json'],
|
|
||||||
},
|
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ['webpack.config.umd.ts'],
|
files: ['*.ts'],
|
||||||
extends: '../../eslintrc.ts.base.json',
|
extends: '../../eslintrc.ts.base.json',
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
tsconfigRootDir: __dirname,
|
tsconfigRootDir: __dirname,
|
||||||
project: ['./tsconfig.webpack.json'],
|
project: ['./tsconfig.json'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -17,28 +17,26 @@
|
||||||
"author": "romseguy",
|
"author": "romseguy",
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
"lib",
|
|
||||||
"src"
|
"src"
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "dist/d3-state-visualizer.cjs.js",
|
||||||
"types": "lib/index.d.ts",
|
"module": "dist/d3-state-visualizer.esm.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"unpkg": "dist/d3-state-visualizer.umd.js",
|
||||||
"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 && yarn run build:umd && yarn run build:umd:min",
|
"build": "rollup -c",
|
||||||
"build:types": "tsc --emitDeclarationOnly",
|
"clean": "rimraf dist",
|
||||||
"build:js": "babel src --out-dir lib --extensions \".ts\" --source-maps inline",
|
|
||||||
"build:umd": "webpack --env production --progress --config webpack.config.umd.ts",
|
|
||||||
"build:umd:min": "webpack --env production --progress --config webpack.config.umd.ts",
|
|
||||||
"clean": "rimraf lib dist",
|
|
||||||
"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",
|
||||||
"@types/d3": "^3.5.46",
|
"@types/d3": "^3.5.46",
|
||||||
"d3": "^3.5.17",
|
"d3": "^3.5.17",
|
||||||
"d3tooltip": "^1.3.2",
|
"d3tooltip": "^1.3.2",
|
||||||
|
@ -47,21 +45,24 @@
|
||||||
"ramda": "^0.27.1"
|
"ramda": "^0.27.1"
|
||||||
},
|
},
|
||||||
"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",
|
||||||
"@types/node": "^16.11.17",
|
"@rollup/plugin-babel": "^5.3.0",
|
||||||
|
"@rollup/plugin-commonjs": "^21.0.1",
|
||||||
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||||
"@types/ramda": "^0.27.62",
|
"@types/ramda": "^0.27.62",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||||
"@typescript-eslint/parser": "^5.8.1",
|
"@typescript-eslint/parser": "^5.8.1",
|
||||||
"babel-loader": "^8.2.3",
|
|
||||||
"eslint": "^8.6.0",
|
"eslint": "^8.6.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"ts-node": "^10.4.0",
|
"rollup": "^2.63.0",
|
||||||
"typescript": "~4.5.4",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"webpack": "^5.65.0",
|
"rollup-plugin-typescript2": "^0.31.1",
|
||||||
"webpack-cli": "^4.9.1"
|
"tslib": "^2.3.1",
|
||||||
|
"typescript": "~4.5.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
70
packages/d3-state-visualizer/rollup.config.js
Normal file
70
packages/d3-state-visualizer/rollup.config.js
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import babel from '@rollup/plugin-babel';
|
||||||
|
import { terser } from 'rollup-plugin-terser';
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: {
|
||||||
|
name: 'd3-state-visualizer',
|
||||||
|
file: 'dist/d3-state-visualizer.umd.js',
|
||||||
|
format: 'umd',
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: {
|
||||||
|
name: 'd3-state-visualizer',
|
||||||
|
file: 'dist/d3-state-visualizer.umd.min.js',
|
||||||
|
format: 'umd',
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
terser(),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: [
|
||||||
|
{ file: 'dist/d3-state-visualizer.cjs.js', format: 'cjs' },
|
||||||
|
{ file: 'dist/d3-state-visualizer.esm.js', format: 'esm' },
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
external: [
|
||||||
|
/@babel\/runtime/,
|
||||||
|
'd3',
|
||||||
|
'ramda',
|
||||||
|
'map2tree',
|
||||||
|
'deepmerge',
|
||||||
|
'd3tooltip',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
|
@ -1,2 +1,2 @@
|
||||||
export { default as tree } from './tree/tree';
|
export { default as tree } from './tree/tree';
|
||||||
export type { InputOptions, NodeWithId } from './tree/tree';
|
export type { InputOptions, NodeWithId, Primitive } from './tree/tree';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import d3, { ZoomEvent, Primitive } from 'd3';
|
import d3, { ZoomEvent, Primitive } from 'd3';
|
||||||
import { isEmpty } from 'ramda';
|
import { isEmpty } from 'ramda';
|
||||||
import map2tree from 'map2tree';
|
import { map2tree } from 'map2tree';
|
||||||
import deepmerge from 'deepmerge';
|
import deepmerge from 'deepmerge';
|
||||||
import {
|
import {
|
||||||
getTooltipString,
|
getTooltipString,
|
||||||
|
@ -8,7 +8,7 @@ import {
|
||||||
visit,
|
visit,
|
||||||
getNodeGroupByDepthCount,
|
getNodeGroupByDepthCount,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
import d3tooltip from 'd3tooltip';
|
import { tooltip } from 'd3tooltip';
|
||||||
|
|
||||||
export interface InputOptions {
|
export interface InputOptions {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||||
|
@ -401,7 +401,7 @@ export default function (
|
||||||
|
|
||||||
if (!tooltipOptions.disabled) {
|
if (!tooltipOptions.disabled) {
|
||||||
nodeEnter.call(
|
nodeEnter.call(
|
||||||
d3tooltip<NodeWithId>(d3, 'tooltip', { ...tooltipOptions, root })
|
tooltip<NodeWithId>(d3, 'tooltip', { ...tooltipOptions, root })
|
||||||
.text((d, i) => getTooltipString(d, i, tooltipOptions))
|
.text((d, i) => getTooltipString(d, i, tooltipOptions))
|
||||||
.style(tooltipOptions.style)
|
.style(tooltipOptions.style)
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,6 +1,2 @@
|
||||||
import * as charts from './charts';
|
|
||||||
|
|
||||||
export { tree } from './charts';
|
export { tree } from './charts';
|
||||||
export type { InputOptions, NodeWithId } from './charts';
|
export type { InputOptions, NodeWithId, Primitive } from './charts';
|
||||||
|
|
||||||
export default charts;
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.base.json",
|
|
||||||
"include": ["webpack.config.umd.ts"]
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
import * as path from 'path';
|
|
||||||
import * as webpack from 'webpack';
|
|
||||||
|
|
||||||
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
|
|
||||||
mode: env.production ? 'production' : 'development',
|
|
||||||
entry: {
|
|
||||||
app: ['./src/index'],
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
library: 'd3-state-visualizer',
|
|
||||||
libraryTarget: 'umd',
|
|
||||||
path: path.resolve(__dirname, 'dist'),
|
|
||||||
filename: env.production
|
|
||||||
? 'd3-state-visualizer.min.js'
|
|
||||||
: 'd3-state-visualizer.js',
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.(js|ts)$/,
|
|
||||||
loader: 'babel-loader',
|
|
||||||
exclude: /node_modules/,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -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,3 +1 @@
|
||||||
examples
|
|
||||||
lib
|
|
||||||
dist
|
dist
|
||||||
|
|
|
@ -1,16 +1,12 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: '../../eslintrc.ts.base.json',
|
extends: '../../eslintrc.js.base.json',
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: ['./tsconfig.json'],
|
|
||||||
},
|
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ['webpack.config.umd.ts'],
|
files: ['*.ts'],
|
||||||
extends: '../../eslintrc.ts.base.json',
|
extends: '../../eslintrc.ts.base.json',
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
tsconfigRootDir: __dirname,
|
tsconfigRootDir: __dirname,
|
||||||
project: ['./tsconfig.webpack.json'],
|
project: ['./tsconfig.json'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -11,7 +11,7 @@ It was created by [@romseguy](https://github.com/romseguy) and merged from [`rom
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import d3 from 'd3';
|
import d3 from 'd3';
|
||||||
import d3tooltip from 'd3tooltip';
|
import { tooltip } from 'd3tooltip';
|
||||||
|
|
||||||
const DOMNode = document.getElementById('chart');
|
const DOMNode = document.getElementById('chart');
|
||||||
const root = d3.select(DOMNode);
|
const root = d3.select(DOMNode);
|
||||||
|
|
|
@ -13,50 +13,51 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "romseguy",
|
"author": "romseguy",
|
||||||
"files": [
|
"files": [
|
||||||
"lib",
|
|
||||||
"dist",
|
"dist",
|
||||||
"src"
|
"src"
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "dist/d3tooltip.cjs.js",
|
||||||
"types": "lib/index.d.ts",
|
"module": "dist/d3tooltip.esm.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"unpkg": "dist/d3tooltip.umd.js",
|
||||||
"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 && yarn run build:umd && yarn run build:umd:min",
|
"build": "rollup -c",
|
||||||
"build:types": "tsc --emitDeclarationOnly",
|
"clean": "rimraf dist",
|
||||||
"build:js": "babel src --out-dir lib --extensions \".ts\" --source-maps inline",
|
|
||||||
"build:umd": "webpack --progress --config webpack.config.umd.ts",
|
|
||||||
"build:umd:min": "webpack --env production --progress --config webpack.config.umd.ts",
|
|
||||||
"clean": "rimraf lib dist",
|
|
||||||
"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",
|
||||||
"ramda": "^0.27.1"
|
"ramda": "^0.27.1"
|
||||||
},
|
},
|
||||||
"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",
|
||||||
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||||
"@types/d3": "^3.5.46",
|
"@types/d3": "^3.5.46",
|
||||||
"@types/node": "^16.11.17",
|
|
||||||
"@types/ramda": "^0.27.62",
|
"@types/ramda": "^0.27.62",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||||
"@typescript-eslint/parser": "^5.8.1",
|
"@typescript-eslint/parser": "^5.8.1",
|
||||||
"babel-loader": "^8.2.3",
|
|
||||||
"d3": "^3.5.17",
|
"d3": "^3.5.17",
|
||||||
"eslint": "^8.6.0",
|
"eslint": "^8.6.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"ts-node": "^10.4.0",
|
"rollup": "^2.63.0",
|
||||||
"typescript": "~4.5.4",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"webpack": "^5.65.0",
|
"rollup-plugin-typescript2": "^0.31.1",
|
||||||
"webpack-cli": "^4.9.1"
|
"tslib": "^2.3.1",
|
||||||
|
"typescript": "~4.5.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@types/d3": "^3.5.46",
|
"@types/d3": "^3.5.46",
|
||||||
|
|
63
packages/d3tooltip/rollup.config.js
Normal file
63
packages/d3tooltip/rollup.config.js
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import babel from '@rollup/plugin-babel';
|
||||||
|
import { terser } from 'rollup-plugin-terser';
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: {
|
||||||
|
name: 'd3tooltip',
|
||||||
|
file: 'dist/d3tooltip.umd.js',
|
||||||
|
format: 'umd',
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: {
|
||||||
|
name: 'd3tooltip',
|
||||||
|
file: 'dist/d3tooltip.umd.min.js',
|
||||||
|
format: 'umd',
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
terser(),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: [
|
||||||
|
{ file: 'dist/d3tooltip.cjs.js', format: 'cjs' },
|
||||||
|
{ file: 'dist/d3tooltip.esm.js', format: 'esm' },
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
external: [/@babel\/runtime/, 'ramda'],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
|
@ -49,7 +49,7 @@ interface Tip<Datum> {
|
||||||
) => this;
|
) => this;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function tooltip<Datum>(
|
export function tooltip<Datum>(
|
||||||
d3: typeof d3Package,
|
d3: typeof d3Package,
|
||||||
className = 'tooltip',
|
className = 'tooltip',
|
||||||
options: Partial<Options<Datum>> = {}
|
options: Partial<Options<Datum>> = {}
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.base.json",
|
|
||||||
"include": ["webpack.config.umd.ts"]
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
import * as path from 'path';
|
|
||||||
import * as webpack from 'webpack';
|
|
||||||
|
|
||||||
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
|
|
||||||
mode: env.production ? 'production' : 'development',
|
|
||||||
entry: {
|
|
||||||
app: ['./src/index'],
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
library: 'd3tooltip',
|
|
||||||
libraryTarget: 'umd',
|
|
||||||
path: path.resolve(__dirname, 'dist'),
|
|
||||||
filename: env.production ? 'd3tooltip.min.js' : 'd3tooltip.js',
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.(js|ts)$/,
|
|
||||||
loader: 'babel-loader',
|
|
||||||
exclude: /node_modules/,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -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,3 +1 @@
|
||||||
examples
|
|
||||||
lib
|
|
||||||
dist
|
dist
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: '../../eslintrc.ts.base.json',
|
extends: '../../eslintrc.js.base.json',
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: ['./tsconfig.json'],
|
|
||||||
},
|
|
||||||
overrides: [
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['*.ts'],
|
||||||
|
extends: '../../eslintrc.ts.jest.base.json',
|
||||||
|
parserOptions: {
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
project: ['./test/tsconfig.json'],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ['test/**/*.ts'],
|
files: ['test/**/*.ts'],
|
||||||
extends: '../../eslintrc.ts.jest.base.json',
|
extends: '../../eslintrc.ts.jest.base.json',
|
||||||
|
@ -13,13 +17,5 @@ module.exports = {
|
||||||
project: ['./test/tsconfig.json'],
|
project: ['./test/tsconfig.json'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
files: ['webpack.config.umd.ts'],
|
|
||||||
extends: '../../eslintrc.ts.base.json',
|
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: ['./tsconfig.webpack.json'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,23 +16,20 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "romseguy",
|
"author": "romseguy",
|
||||||
"files": [
|
"files": [
|
||||||
"lib",
|
|
||||||
"dist",
|
"dist",
|
||||||
"src"
|
"src"
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "dist/map2tree.cjs.js",
|
||||||
"types": "lib/index.d.ts",
|
"module": "dist/map2tree.esm.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"unpkg": "dist/map2tree.umd.js",
|
||||||
"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 && yarn run build:umd && yarn run build:umd:min",
|
"build": "rollup -c",
|
||||||
"build:types": "tsc --emitDeclarationOnly",
|
"clean": "rimraf dist",
|
||||||
"build:js": "babel src --out-dir lib --extensions \".ts\" --source-maps inline",
|
|
||||||
"build:umd": "webpack --progress --config webpack.config.umd.ts",
|
|
||||||
"build:umd:min": "webpack --env production --progress --config webpack.config.umd.ts",
|
|
||||||
"clean": "rimraf lib dist",
|
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint . --ext .ts",
|
||||||
"type-check": "tsc --noEmit",
|
"type-check": "tsc --noEmit",
|
||||||
|
@ -40,29 +37,33 @@
|
||||||
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.16.7",
|
||||||
"lodash": "^4.17.21"
|
"lodash": "^4.17.21"
|
||||||
},
|
},
|
||||||
"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",
|
||||||
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.0",
|
||||||
"@types/lodash": "^4.14.178",
|
"@types/lodash": "^4.14.178",
|
||||||
"@types/node": "^16.11.17",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||||
"@typescript-eslint/parser": "^5.8.1",
|
"@typescript-eslint/parser": "^5.8.1",
|
||||||
"babel-loader": "^8.2.3",
|
|
||||||
"eslint": "^8.6.0",
|
"eslint": "^8.6.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-jest": "^25.3.4",
|
"eslint-plugin-jest": "^25.3.4",
|
||||||
"immutable": "^4.0.0",
|
"immutable": "^4.0.0",
|
||||||
"jest": "^27.4.5",
|
"jest": "^27.4.5",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
"rollup": "^2.63.0",
|
||||||
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
|
"rollup-plugin-typescript2": "^0.31.1",
|
||||||
"ts-jest": "^27.1.2",
|
"ts-jest": "^27.1.2",
|
||||||
"ts-node": "^10.4.0",
|
"tslib": "^2.3.1",
|
||||||
"typescript": "~4.5.4",
|
"typescript": "~4.5.4"
|
||||||
"webpack": "^5.65.0",
|
|
||||||
"webpack-cli": "^4.9.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
63
packages/map2tree/rollup.config.js
Normal file
63
packages/map2tree/rollup.config.js
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import babel from '@rollup/plugin-babel';
|
||||||
|
import { terser } from 'rollup-plugin-terser';
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: {
|
||||||
|
name: 'map2tree',
|
||||||
|
file: 'dist/map2tree.umd.js',
|
||||||
|
format: 'umd',
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: {
|
||||||
|
name: 'map2tree',
|
||||||
|
file: 'dist/map2tree.umd.min.js',
|
||||||
|
format: 'umd',
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
terser(),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: [
|
||||||
|
{ file: 'dist/map2tree.cjs.js', format: 'cjs' },
|
||||||
|
{ file: 'dist/map2tree.esm.js', format: 'esm' },
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
external: [/@babel\/runtime/, /lodash/],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
|
@ -42,7 +42,7 @@ function getNode(tree: Node, key: string): Node | null {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function map2tree(
|
export function map2tree(
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||||
root: unknown,
|
root: unknown,
|
||||||
options: { key?: string; pushMethod?: 'push' | 'unshift' } = {},
|
options: { key?: string; pushMethod?: 'push' | 'unshift' } = {},
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import map2tree, { Node } from '../src';
|
import { map2tree, Node } from '../src';
|
||||||
import * as immutable from 'immutable';
|
import * as immutable from 'immutable';
|
||||||
|
|
||||||
test('# rootNodeKey', () => {
|
test('# rootNodeKey', () => {
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.base.json",
|
|
||||||
"include": ["webpack.config.umd.ts"]
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
import * as path from 'path';
|
|
||||||
import * as webpack from 'webpack';
|
|
||||||
|
|
||||||
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
|
|
||||||
mode: env.production ? 'production' : 'development',
|
|
||||||
entry: {
|
|
||||||
app: ['./src/index'],
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
library: 'map2tree',
|
|
||||||
libraryTarget: 'umd',
|
|
||||||
path: path.resolve(__dirname, 'dist'),
|
|
||||||
filename: env.production ? 'map2tree.min.js' : 'map2tree.js',
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.(js|ts)$/,
|
|
||||||
loader: 'babel-loader',
|
|
||||||
exclude: /node_modules/,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -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 +1 @@
|
||||||
lib
|
dist
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: '../../eslintrc.ts.base.json',
|
extends: '../../eslintrc.js.base.json',
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: ['./tsconfig.json'],
|
|
||||||
},
|
|
||||||
overrides: [
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['*.ts'],
|
||||||
|
extends: '../../eslintrc.ts.jest.base.json',
|
||||||
|
parserOptions: {
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
project: ['./test/tsconfig.json'],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ['test/**/*.ts'],
|
files: ['test/**/*.ts'],
|
||||||
extends: '../../eslintrc.ts.jest.base.json',
|
extends: '../../eslintrc.ts.jest.base.json',
|
||||||
|
|
|
@ -15,20 +15,19 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Alexander <alexkuz@gmail.com> (http://kuzya.org/)",
|
"author": "Alexander <alexkuz@gmail.com> (http://kuzya.org/)",
|
||||||
"files": [
|
"files": [
|
||||||
"lib",
|
"dist",
|
||||||
"src"
|
"src"
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "dist/react-base16-styling.cjs.js",
|
||||||
"types": "lib/index.d.ts",
|
"module": "dist/react-base16-styling.esm.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/reduxjs/redux-devtools.git"
|
"url": "git+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",
|
|
||||||
"clean": "rimraf lib",
|
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint . --ext .ts",
|
||||||
"type-check": "tsc --noEmit",
|
"type-check": "tsc --noEmit",
|
||||||
|
@ -36,6 +35,7 @@
|
||||||
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.16.7",
|
||||||
"@types/base16": "^1.0.2",
|
"@types/base16": "^1.0.2",
|
||||||
"@types/lodash": "^4.14.178",
|
"@types/lodash": "^4.14.178",
|
||||||
"base16": "^1.0.0",
|
"base16": "^1.0.0",
|
||||||
|
@ -44,10 +44,12 @@
|
||||||
"lodash.curry": "^4.1.1"
|
"lodash.curry": "^4.1.1"
|
||||||
},
|
},
|
||||||
"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",
|
||||||
"@types/color": "^3.0.2",
|
"@types/color": "^3.0.2",
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.0",
|
||||||
"@types/lodash.curry": "^4.1.6",
|
"@types/lodash.curry": "^4.1.6",
|
||||||
|
@ -58,7 +60,10 @@
|
||||||
"eslint-plugin-jest": "^25.3.4",
|
"eslint-plugin-jest": "^25.3.4",
|
||||||
"jest": "^27.4.5",
|
"jest": "^27.4.5",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
"rollup": "^2.63.0",
|
||||||
|
"rollup-plugin-typescript2": "^0.31.1",
|
||||||
"ts-jest": "^27.1.2",
|
"ts-jest": "^27.1.2",
|
||||||
|
"tslib": "^2.3.1",
|
||||||
"typescript": "~4.5.4"
|
"typescript": "~4.5.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
23
packages/react-base16-styling/rollup.config.js
Normal file
23
packages/react-base16-styling/rollup.config.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
import babel from '@rollup/plugin-babel';
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: [
|
||||||
|
{ file: 'dist/react-base16-styling.cjs.js', format: 'cjs' },
|
||||||
|
{ file: 'dist/react-base16-styling.esm.js', format: 'esm' },
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
external: [/@babel\/runtime/, 'base16', 'color', 'lodash.curry'],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"presets": [
|
"presets": [
|
||||||
"@babel/preset-env",
|
["@babel/preset-env", { "targets": "defaults" }],
|
||||||
"@babel/preset-react",
|
"@babel/preset-react",
|
||||||
"@babel/preset-typescript"
|
"@babel/preset-typescript"
|
||||||
]
|
],
|
||||||
|
"plugins": ["@babel/plugin-transform-runtime"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
demo
|
demo
|
||||||
lib
|
dist
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: '../../eslintrc.ts.react.base.json',
|
extends: '../../eslintrc.js.base.json',
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: ['./tsconfig.json'],
|
|
||||||
},
|
|
||||||
overrides: [
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['*.ts', '*.tsx'],
|
||||||
|
extends: '../../eslintrc.ts.react.base.json',
|
||||||
|
parserOptions: {
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
project: ['./tsconfig.json'],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ['test/**/*.ts', 'test/**/*.tsx'],
|
files: ['test/**/*.ts', 'test/**/*.tsx'],
|
||||||
extends: '../../eslintrc.ts.react.jest.base.json',
|
extends: '../../eslintrc.ts.react.jest.base.json',
|
||||||
|
|
|
@ -15,20 +15,19 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Alexander <alexkuz@gmail.com> (http://kuzya.org/)",
|
"author": "Alexander <alexkuz@gmail.com> (http://kuzya.org/)",
|
||||||
"files": [
|
"files": [
|
||||||
"lib",
|
"dist",
|
||||||
"src"
|
"src"
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "dist/react-dock.cjs.js",
|
||||||
"types": "lib/index.d.ts",
|
"module": "dist/react-dock.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,.tsx\" --source-maps inline",
|
|
||||||
"clean": "rimraf lib",
|
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"lint": "eslint . --ext .ts,.tsx",
|
"lint": "eslint . --ext .ts,.tsx",
|
||||||
"type-check": "tsc --noEmit",
|
"type-check": "tsc --noEmit",
|
||||||
|
@ -36,17 +35,20 @@
|
||||||
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.16.7",
|
||||||
"@types/lodash": "^4.14.178",
|
"@types/lodash": "^4.14.178",
|
||||||
"@types/prop-types": "^15.7.4",
|
"@types/prop-types": "^15.7.4",
|
||||||
"lodash.debounce": "^4.0.8",
|
"lodash.debounce": "^4.0.8",
|
||||||
"prop-types": "^15.8.0"
|
"prop-types": "^15.8.0"
|
||||||
},
|
},
|
||||||
"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-react": "^7.16.7",
|
"@babel/preset-react": "^7.16.7",
|
||||||
"@babel/preset-typescript": "^7.16.7",
|
"@babel/preset-typescript": "^7.16.7",
|
||||||
|
"@rollup/plugin-babel": "^5.3.0",
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.0",
|
||||||
"@types/lodash.debounce": "^4.0.6",
|
"@types/lodash.debounce": "^4.0.6",
|
||||||
"@types/react": "^17.0.38",
|
"@types/react": "^17.0.38",
|
||||||
|
@ -62,7 +64,10 @@
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-test-renderer": "^17.0.2",
|
"react-test-renderer": "^17.0.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
"rollup": "^2.63.0",
|
||||||
|
"rollup-plugin-typescript2": "^0.31.1",
|
||||||
"ts-jest": "^27.1.2",
|
"ts-jest": "^27.1.2",
|
||||||
|
"tslib": "^2.3.1",
|
||||||
"typescript": "~4.5.4"
|
"typescript": "~4.5.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
23
packages/react-dock/rollup.config.js
Normal file
23
packages/react-dock/rollup.config.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
import babel from '@rollup/plugin-babel';
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: [
|
||||||
|
{ file: 'dist/react-dock.cjs.js', format: 'cjs' },
|
||||||
|
{ file: 'dist/react-dock.esm.js', format: 'esm' },
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts', '.tsx'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
external: [/@babel\/runtime/, 'react', 'prop-types', 'lodash.debounce'],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
|
@ -1,2 +1 @@
|
||||||
import Dock from './Dock';
|
export { default as Dock } from './Dock';
|
||||||
export default Dock;
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"presets": [
|
"presets": [
|
||||||
"@babel/preset-env",
|
["@babel/preset-env", { "targets": "defaults" }],
|
||||||
"@babel/preset-react",
|
"@babel/preset-react",
|
||||||
"@babel/preset-typescript"
|
"@babel/preset-typescript"
|
||||||
]
|
],
|
||||||
|
"plugins": ["@babel/plugin-transform-runtime"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
|
dist
|
||||||
examples
|
examples
|
||||||
lib
|
|
||||||
umd
|
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: '../../eslintrc.ts.react.base.json',
|
extends: '../../eslintrc.js.base.json',
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: ['./tsconfig.json'],
|
|
||||||
},
|
|
||||||
overrides: [
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['*.ts', '*.tsx'],
|
||||||
|
extends: '../../eslintrc.ts.react.base.json',
|
||||||
|
parserOptions: {
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
project: ['./tsconfig.json'],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ['test/**/*.ts', 'test/**/*.tsx'],
|
files: ['test/**/*.ts', 'test/**/*.tsx'],
|
||||||
extends: '../../eslintrc.ts.react.jest.base.json',
|
extends: '../../eslintrc.ts.react.jest.base.json',
|
||||||
|
|
|
@ -7,7 +7,7 @@ React JSON Viewer Component, Extracted from [redux-devtools](https://github.com/
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
import JSONTree from 'react-json-tree';
|
import { JSONTree } from 'react-json-tree';
|
||||||
// If you're using Immutable.js: `npm i --save immutable`
|
// If you're using Immutable.js: `npm i --save immutable`
|
||||||
import { Map } from 'immutable';
|
import { Map } from 'immutable';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Map } from 'immutable';
|
import { Map } from 'immutable';
|
||||||
import JSONTree, { StylingValue } from 'react-json-tree';
|
import { JSONTree, StylingValue } from 'react-json-tree';
|
||||||
|
|
||||||
const getLabelStyle: StylingValue = ({ style }, nodeType, expanded) => ({
|
const getLabelStyle: StylingValue = ({ style }, nodeType, expanded) => ({
|
||||||
style: {
|
style: {
|
||||||
|
|
|
@ -19,23 +19,20 @@
|
||||||
"Mihail Diordiev <zalmoxisus@gmail.com> (https://github.com/zalmoxisus)"
|
"Mihail Diordiev <zalmoxisus@gmail.com> (https://github.com/zalmoxisus)"
|
||||||
],
|
],
|
||||||
"files": [
|
"files": [
|
||||||
"lib",
|
"dist",
|
||||||
"src",
|
"src"
|
||||||
"umd"
|
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "dist/react-json-tree.cjs.js",
|
||||||
"types": "lib/index.d.ts",
|
"module": "dist/react-json-tree.esm.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"unpkg": "dist/react-json-tree.umd.js",
|
||||||
"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 && yarn run build:umd && npm run build:umd:min",
|
"build": "rollup -c",
|
||||||
"build:types": "tsc --emitDeclarationOnly",
|
"clean": "rimraf umd",
|
||||||
"build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline",
|
|
||||||
"build:umd": "rimraf ./umd && webpack --progress --config webpack.config.umd.ts",
|
|
||||||
"build:umd:min": "webpack --env production --progress --config webpack.config.umd.ts",
|
|
||||||
"clean": "rimraf lib umd",
|
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"lint": "eslint . --ext .ts,.tsx",
|
"lint": "eslint . --ext .ts,.tsx",
|
||||||
"type-check": "tsc --noEmit",
|
"type-check": "tsc --noEmit",
|
||||||
|
@ -43,23 +40,26 @@
|
||||||
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.16.7",
|
||||||
"@types/prop-types": "^15.7.4",
|
"@types/prop-types": "^15.7.4",
|
||||||
"prop-types": "^15.8.0",
|
"prop-types": "^15.8.0",
|
||||||
"react-base16-styling": "^0.8.2"
|
"react-base16-styling": "^0.8.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-react": "^7.16.7",
|
"@babel/preset-react": "^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",
|
||||||
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.0",
|
||||||
"@types/node": "^16.11.17",
|
|
||||||
"@types/react": "^17.0.38",
|
"@types/react": "^17.0.38",
|
||||||
"@types/react-test-renderer": "^17.0.1",
|
"@types/react-test-renderer": "^17.0.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
||||||
"@typescript-eslint/parser": "^5.8.1",
|
"@typescript-eslint/parser": "^5.8.1",
|
||||||
"babel-loader": "^8.2.3",
|
|
||||||
"eslint": "^8.6.0",
|
"eslint": "^8.6.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-jest": "^25.3.4",
|
"eslint-plugin-jest": "^25.3.4",
|
||||||
|
@ -69,11 +69,12 @@
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-test-renderer": "^17.0.2",
|
"react-test-renderer": "^17.0.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
"rollup": "^2.63.0",
|
||||||
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
|
"rollup-plugin-typescript2": "^0.31.1",
|
||||||
"ts-jest": "^27.1.2",
|
"ts-jest": "^27.1.2",
|
||||||
"ts-node": "^10.4.0",
|
"tslib": "^2.3.1",
|
||||||
"typescript": "~4.5.4",
|
"typescript": "~4.5.4"
|
||||||
"webpack": "^5.65.0",
|
|
||||||
"webpack-cli": "^4.9.1"
|
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@types/react": "^16.3.0 || ^17.0.0",
|
"@types/react": "^16.3.0 || ^17.0.0",
|
||||||
|
|
76
packages/react-json-tree/rollup.config.js
Normal file
76
packages/react-json-tree/rollup.config.js
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import babel from '@rollup/plugin-babel';
|
||||||
|
import { terser } from 'rollup-plugin-terser';
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
input: 'src/index.tsx',
|
||||||
|
output: {
|
||||||
|
name: 'ReactJsonTree',
|
||||||
|
file: 'dist/react-json-tree.umd.js',
|
||||||
|
format: 'umd',
|
||||||
|
globals: {
|
||||||
|
react: 'React',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts', '.tsx'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
external: ['react'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'src/index.tsx',
|
||||||
|
output: {
|
||||||
|
name: 'ReactJsonTree',
|
||||||
|
file: 'dist/react-json-tree.umd.min.js',
|
||||||
|
format: 'umd',
|
||||||
|
globals: {
|
||||||
|
react: 'React',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts', '.tsx'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
terser(),
|
||||||
|
],
|
||||||
|
external: ['react'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: 'src/index.tsx',
|
||||||
|
output: [
|
||||||
|
{ file: 'dist/react-json-tree.cjs.js', format: 'cjs' },
|
||||||
|
{ file: 'dist/react-json-tree.esm.js', format: 'esm' },
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts', '.tsx'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
external: [
|
||||||
|
/@babel\/runtime/,
|
||||||
|
'react',
|
||||||
|
'prop-types',
|
||||||
|
'react-base16-styling',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
|
@ -102,7 +102,7 @@ function getStateFromProps(props: Props) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class JSONTree extends React.Component<Props, State> {
|
export class JSONTree extends React.Component<Props, State> {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
data: PropTypes.any,
|
data: PropTypes.any,
|
||||||
hideRoot: PropTypes.bool,
|
hideRoot: PropTypes.bool,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { createRenderer } from 'react-test-renderer/shallow';
|
import { createRenderer } from 'react-test-renderer/shallow';
|
||||||
|
|
||||||
import JSONTree from '../src/index';
|
import { JSONTree } from '../src/index';
|
||||||
import JSONNode from '../src/JSONNode';
|
import JSONNode from '../src/JSONNode';
|
||||||
|
|
||||||
const BASIC_DATA = { a: 1, b: 'c' };
|
const BASIC_DATA = { a: 1, b: 'c' };
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.base.json",
|
|
||||||
"include": ["webpack.config.umd.ts"]
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
import * as path from 'path';
|
|
||||||
import * as webpack from 'webpack';
|
|
||||||
|
|
||||||
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
|
|
||||||
mode: env.production ? 'production' : 'development',
|
|
||||||
entry: {
|
|
||||||
app: ['./src/index'],
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
library: 'ReactJsonTree',
|
|
||||||
libraryExport: 'default',
|
|
||||||
libraryTarget: 'umd',
|
|
||||||
path: path.resolve(__dirname, 'umd'),
|
|
||||||
filename: env.production ? 'react-json-tree.min.js' : 'react-json-tree.js',
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.(js|ts)x?$/,
|
|
||||||
loader: 'babel-loader',
|
|
||||||
exclude: /node_modules/,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
||||||
},
|
|
||||||
externals: {
|
|
||||||
react: {
|
|
||||||
root: 'React',
|
|
||||||
commonjs2: 'react',
|
|
||||||
commonjs: 'react',
|
|
||||||
amd: 'react',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"presets": [
|
"presets": [
|
||||||
"@babel/preset-env",
|
["@babel/preset-env", { "targets": "defaults" }],
|
||||||
"@babel/preset-react",
|
"@babel/preset-react",
|
||||||
"@babel/preset-typescript"
|
"@babel/preset-typescript"
|
||||||
]
|
],
|
||||||
|
"plugins": ["@babel/plugin-transform-runtime"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
lib
|
dist
|
||||||
umd
|
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: '../../eslintrc.ts.react.base.json',
|
extends: '../../eslintrc.js.base.json',
|
||||||
parserOptions: {
|
|
||||||
tsconfigRootDir: __dirname,
|
|
||||||
project: ['./tsconfig.json'],
|
|
||||||
},
|
|
||||||
overrides: [
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['*.ts', '*.tsx'],
|
||||||
|
extends: '../../eslintrc.ts.react.base.json',
|
||||||
|
parserOptions: {
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
project: ['./tsconfig.json'],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ['demo/**/*.ts', 'demo/**/*.tsx'],
|
files: ['demo/**/*.ts', 'demo/**/*.tsx'],
|
||||||
extends: '../../eslintrc.ts.react.base.json',
|
extends: '../../eslintrc.ts.react.base.json',
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import App from '../src';
|
import { Root } from '../src';
|
||||||
|
|
||||||
render(<App />, document.getElementById('root'));
|
render(<Root />, document.getElementById('root'));
|
||||||
|
|
||||||
if (module.hot) {
|
if (module.hot) {
|
||||||
// https://github.com/webpack/webpack/issues/418#issuecomment-53398056
|
// https://github.com/webpack/webpack/issues/418#issuecomment-53398056
|
||||||
|
|
|
@ -9,25 +9,25 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Mihail Diordiev <zalmoxisus@gmail.com> (https://github.com/zalmoxisus)",
|
"author": "Mihail Diordiev <zalmoxisus@gmail.com> (https://github.com/zalmoxisus)",
|
||||||
"files": [
|
"files": [
|
||||||
|
"dist",
|
||||||
"src",
|
"src",
|
||||||
"lib",
|
|
||||||
"umd"
|
"umd"
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "dist/redux-devtools-app.cjs.js",
|
||||||
"types": "lib/index.d.ts",
|
"module": "dist/redux-devtools-app.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": {
|
||||||
"start": "webpack serve --hot --env development --env platform=web --progress",
|
"start": "webpack serve --hot --env development --env platform=web --progress",
|
||||||
"build": "yarn run build:types && yarn run build:js && yarn run build:web && yarn run build:umd && yarn run build:umd:min",
|
"build": "yarn run build:lib && yarn run build:web && yarn run build:umd && yarn run build:umd:min",
|
||||||
"build:types": "tsc --emitDeclarationOnly",
|
"build:lib": "rollup -c",
|
||||||
"build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline",
|
"build:web": "webpack --env platform=web --progress",
|
||||||
"build:web": "rimraf ./build/web && webpack --env platform=web --progress",
|
"build:umd": "webpack --progress --config webpack.config.umd.ts",
|
||||||
"build:umd": "rimraf ./umd && webpack --progress --config webpack.config.umd.ts",
|
|
||||||
"build:umd:min": "webpack --env production --progress --config webpack.config.umd.ts",
|
"build:umd:min": "webpack --env production --progress --config webpack.config.umd.ts",
|
||||||
"clean": "rimraf lib",
|
"clean": "rimraf build dist umd",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"lint": "eslint . --ext .ts,.tsx",
|
"lint": "eslint . --ext .ts,.tsx",
|
||||||
"type-check": "tsc --noEmit",
|
"type-check": "tsc --noEmit",
|
||||||
|
@ -35,6 +35,7 @@
|
||||||
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.16.7",
|
||||||
"@redux-devtools/chart-monitor": "^1.9.2",
|
"@redux-devtools/chart-monitor": "^1.9.2",
|
||||||
"@redux-devtools/core": "^3.9.2",
|
"@redux-devtools/core": "^3.9.2",
|
||||||
"@redux-devtools/inspector-monitor": "^1.0.2",
|
"@redux-devtools/inspector-monitor": "^1.0.2",
|
||||||
|
@ -61,12 +62,14 @@
|
||||||
"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-react": "^7.16.7",
|
"@babel/preset-react": "^7.16.7",
|
||||||
"@babel/preset-typescript": "^7.16.7",
|
"@babel/preset-typescript": "^7.16.7",
|
||||||
"@rjsf/core": "^3.2.1",
|
"@rjsf/core": "^3.2.1",
|
||||||
|
"@rollup/plugin-babel": "^5.3.0",
|
||||||
"@testing-library/jest-dom": "^5.16.1",
|
"@testing-library/jest-dom": "^5.16.1",
|
||||||
"@testing-library/react": "^12.1.2",
|
"@testing-library/react": "^12.1.2",
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.0",
|
||||||
|
@ -100,10 +103,13 @@
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
"rollup": "^2.63.0",
|
||||||
|
"rollup-plugin-typescript2": "^0.31.1",
|
||||||
"style-loader": "^3.3.1",
|
"style-loader": "^3.3.1",
|
||||||
"styled-components": "^5.3.3",
|
"styled-components": "^5.3.3",
|
||||||
"ts-jest": "^27.1.2",
|
"ts-jest": "^27.1.2",
|
||||||
"ts-node": "^10.4.0",
|
"ts-node": "^10.4.0",
|
||||||
|
"tslib": "^2.3.1",
|
||||||
"typescript": "~4.5.4",
|
"typescript": "~4.5.4",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
"webpack": "^5.65.0",
|
"webpack": "^5.65.0",
|
||||||
|
|
54
packages/redux-devtools-app/rollup.config.js
Normal file
54
packages/redux-devtools-app/rollup.config.js
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
import babel from '@rollup/plugin-babel';
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
input: 'src/index.tsx',
|
||||||
|
output: [
|
||||||
|
{
|
||||||
|
file: 'dist/redux-devtools-app.cjs.js',
|
||||||
|
format: 'cjs',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
file: 'dist/redux-devtools-app.esm.js',
|
||||||
|
format: 'esm',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
babel({
|
||||||
|
babelHelpers: 'runtime',
|
||||||
|
extensions: ['.ts', '.tsx'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
external: [
|
||||||
|
/@babel\/runtime/,
|
||||||
|
'react',
|
||||||
|
'react-redux',
|
||||||
|
'redux',
|
||||||
|
'localforage',
|
||||||
|
/redux-persist/,
|
||||||
|
'@redux-devtools/ui',
|
||||||
|
'socketcluster-client',
|
||||||
|
'jsan',
|
||||||
|
/react-icons/,
|
||||||
|
'styled-components',
|
||||||
|
'@redux-devtools/slider-monitor',
|
||||||
|
'prop-types',
|
||||||
|
/lodash/,
|
||||||
|
'@redux-devtools/core',
|
||||||
|
'@redux-devtools/log-monitor',
|
||||||
|
'@redux-devtools/rtk-query-monitor',
|
||||||
|
'@redux-devtools/chart-monitor',
|
||||||
|
'@redux-devtools/inspector-monitor',
|
||||||
|
'@redux-devtools/inspector-monitor-trace-tab',
|
||||||
|
'@redux-devtools/inspector-monitor-test-tab',
|
||||||
|
'javascript-stringify',
|
||||||
|
'jsondiffpatch',
|
||||||
|
'd3-state-visualizer',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
|
@ -1,4 +1,4 @@
|
||||||
import { Scheme, Theme } from '@redux-devtools/ui';
|
import { SchemeName, ThemeName } from '@redux-devtools/ui';
|
||||||
import { AuthStates, States } from 'socketcluster-client/lib/scclientsocket';
|
import { AuthStates, States } from 'socketcluster-client/lib/scclientsocket';
|
||||||
import {
|
import {
|
||||||
CHANGE_SECTION,
|
CHANGE_SECTION,
|
||||||
|
@ -64,8 +64,8 @@ export function changeSection(section: string): ChangeSectionAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ChangeThemeFormData {
|
interface ChangeThemeFormData {
|
||||||
readonly theme: Theme;
|
readonly theme: ThemeName;
|
||||||
readonly scheme: Scheme;
|
readonly scheme: SchemeName;
|
||||||
readonly colorPreference: 'auto' | 'light' | 'dark';
|
readonly colorPreference: 'auto' | 'light' | 'dark';
|
||||||
}
|
}
|
||||||
interface ChangeThemeData {
|
interface ChangeThemeData {
|
||||||
|
@ -73,8 +73,8 @@ interface ChangeThemeData {
|
||||||
}
|
}
|
||||||
export interface ChangeThemeAction {
|
export interface ChangeThemeAction {
|
||||||
readonly type: typeof CHANGE_THEME;
|
readonly type: typeof CHANGE_THEME;
|
||||||
readonly theme: Theme;
|
readonly theme: ThemeName;
|
||||||
readonly scheme: Scheme;
|
readonly scheme: SchemeName;
|
||||||
readonly colorPreference: 'auto' | 'light' | 'dark';
|
readonly colorPreference: 'auto' | 'light' | 'dark';
|
||||||
}
|
}
|
||||||
export function changeTheme(data: ChangeThemeData): ChangeThemeAction {
|
export function changeTheme(data: ChangeThemeData): ChangeThemeAction {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
} from 'json-schema';
|
} from 'json-schema';
|
||||||
import { ConnectionType, saveSocketSettings } from '../../actions';
|
import { ConnectionType, saveSocketSettings } from '../../actions';
|
||||||
import { StoreState } from '../../reducers';
|
import { StoreState } from '../../reducers';
|
||||||
import { ConnectionOptions } from '../../reducers/connection';
|
import { ConnectionStateOptions } from '../../reducers/connection';
|
||||||
import { IChangeEvent, ISubmitEvent } from '@rjsf/core';
|
import { IChangeEvent, ISubmitEvent } from '@rjsf/core';
|
||||||
|
|
||||||
declare module 'json-schema' {
|
declare module 'json-schema' {
|
||||||
|
@ -57,7 +57,7 @@ type StateProps = ReturnType<typeof mapStateToProps>;
|
||||||
type DispatchProps = ResolveThunks<typeof actionCreators>;
|
type DispatchProps = ResolveThunks<typeof actionCreators>;
|
||||||
type Props = StateProps & DispatchProps;
|
type Props = StateProps & DispatchProps;
|
||||||
|
|
||||||
interface FormData extends ConnectionOptions {
|
interface FormData extends ConnectionStateOptions {
|
||||||
readonly type: ConnectionType;
|
readonly type: ConnectionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect, ResolveThunks } from 'react-redux';
|
import { connect, ResolveThunks } from 'react-redux';
|
||||||
import { Container, Form } from '@redux-devtools/ui';
|
import { Container, Form } from '@redux-devtools/ui';
|
||||||
import { listSchemes, listThemes } from '@redux-devtools/ui/lib/utils/theme';
|
import { listSchemes, listThemes } from '@redux-devtools/ui';
|
||||||
import { changeTheme } from '../../actions';
|
import { changeTheme } from '../../actions';
|
||||||
import { StoreState } from '../../reducers';
|
import { StoreState } from '../../reducers';
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ interface State {
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||||
class Settings extends Component<{}, State> {
|
export default class Settings extends Component<{}, State> {
|
||||||
tabs = [
|
tabs = [
|
||||||
{ name: 'Connection', component: Connection },
|
{ name: 'Connection', component: Connection },
|
||||||
{ name: 'Themes', component: Themes },
|
{ name: 'Themes', component: Themes },
|
||||||
|
@ -30,5 +30,3 @@ class Settings extends Component<{}, State> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Settings;
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect, ResolveThunks } from 'react-redux';
|
import { connect, ResolveThunks } from 'react-redux';
|
||||||
import ChartMonitor from '@redux-devtools/chart-monitor';
|
import { ChartMonitor } from '@redux-devtools/chart-monitor';
|
||||||
import { NodeWithId } from 'd3-state-visualizer';
|
import { NodeWithId } from 'd3-state-visualizer';
|
||||||
import { selectMonitorWithState } from '../../actions';
|
import { selectMonitorWithState } from '../../actions';
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect, ResolveThunks } from 'react-redux';
|
import { connect, ResolveThunks } from 'react-redux';
|
||||||
import { Tab, Tabs } from '@redux-devtools/ui';
|
import { Tab, Tabs } from '@redux-devtools/ui';
|
||||||
import { TabComponentProps } from '@redux-devtools/inspector-monitor';
|
import {
|
||||||
|
TabComponentProps,
|
||||||
|
StateTab,
|
||||||
|
ActionTab,
|
||||||
|
DiffTab,
|
||||||
|
} from '@redux-devtools/inspector-monitor';
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
import StateTree from '@redux-devtools/inspector-monitor/lib/tabs/StateTab';
|
|
||||||
import ActionTree from '@redux-devtools/inspector-monitor/lib/tabs/ActionTab';
|
|
||||||
import DiffTree from '@redux-devtools/inspector-monitor/lib/tabs/DiffTab';
|
|
||||||
import { selectMonitorTab } from '../../../actions';
|
import { selectMonitorTab } from '../../../actions';
|
||||||
import RawTab from './RawTab';
|
import RawTab from './RawTab';
|
||||||
import ChartTab from './ChartTab';
|
import ChartTab from './ChartTab';
|
||||||
|
@ -51,7 +53,7 @@ class SubTabs extends Component<Props> {
|
||||||
this.tabs = [
|
this.tabs = [
|
||||||
{
|
{
|
||||||
name: 'Tree',
|
name: 'Tree',
|
||||||
component: DiffTree,
|
component: DiffTab,
|
||||||
selector: () => this.props,
|
selector: () => this.props,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -66,7 +68,7 @@ class SubTabs extends Component<Props> {
|
||||||
this.tabs = [
|
this.tabs = [
|
||||||
{
|
{
|
||||||
name: 'Tree',
|
name: 'Tree',
|
||||||
component: parentTab === 'Action' ? ActionTree : StateTree,
|
component: parentTab === 'Action' ? ActionTab : StateTab,
|
||||||
selector: () => this.props,
|
selector: () => this.props,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Delta, formatters } from 'jsondiffpatch';
|
import { Delta, formatters } from 'jsondiffpatch';
|
||||||
import styled, { ThemedStyledProps } from 'styled-components';
|
import styled, { ThemedStyledProps } from 'styled-components';
|
||||||
import { effects } from '@redux-devtools/ui';
|
import { effects, Theme } from '@redux-devtools/ui';
|
||||||
import { Theme } from '@redux-devtools/ui/lib/themes/default';
|
|
||||||
|
|
||||||
export const StyledContainer = styled.div`
|
export const StyledContainer = styled.div`
|
||||||
.jsondiffpatch-delta {
|
.jsondiffpatch-delta {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import InspectorMonitor, { Tab } from '@redux-devtools/inspector-monitor';
|
import { Action } from 'redux';
|
||||||
import TraceTab from '@redux-devtools/inspector-monitor-trace-tab';
|
import { InspectorMonitor, Tab } from '@redux-devtools/inspector-monitor';
|
||||||
import TestTab from '@redux-devtools/inspector-monitor-test-tab';
|
import { TraceTab } from '@redux-devtools/inspector-monitor-trace-tab';
|
||||||
|
import { TestTab } from '@redux-devtools/inspector-monitor-test-tab';
|
||||||
import { DATA_TYPE_KEY } from '../../../constants/dataTypes';
|
import { DATA_TYPE_KEY } from '../../../constants/dataTypes';
|
||||||
import SubTabs from './SubTabs';
|
import SubTabs from './SubTabs';
|
||||||
import { Action } from 'redux';
|
|
||||||
|
|
||||||
const DEFAULT_TABS = [
|
const DEFAULT_TABS = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import styled, { withTheme } from 'styled-components';
|
import styled, { withTheme } from 'styled-components';
|
||||||
import SliderMonitor from '@redux-devtools/slider-monitor';
|
import { SliderMonitor } from '@redux-devtools/slider-monitor';
|
||||||
import { LiftedAction } from '@redux-devtools/core';
|
import { LiftedAction } from '@redux-devtools/core';
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
import { ThemeFromProvider } from '@redux-devtools/ui';
|
import { ThemeFromProvider } from '@redux-devtools/ui';
|
||||||
|
|
|
@ -9,7 +9,7 @@ import App from './containers/App';
|
||||||
import { StoreState } from './reducers';
|
import { StoreState } from './reducers';
|
||||||
import { StoreAction } from './actions';
|
import { StoreAction } from './actions';
|
||||||
|
|
||||||
class Root extends Component {
|
export class Root extends Component {
|
||||||
store?: Store<StoreState, StoreAction>;
|
store?: Store<StoreState, StoreAction>;
|
||||||
persistor?: Persistor;
|
persistor?: Persistor;
|
||||||
|
|
||||||
|
@ -39,4 +39,31 @@ class Root extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Root;
|
export * from './actions';
|
||||||
|
export { default as DispatcherButton } from './components/buttons/DispatcherButton';
|
||||||
|
export { default as ExportButton } from './components/buttons/ExportButton';
|
||||||
|
export { default as ImportButton } from './components/buttons/ImportButton';
|
||||||
|
export { default as PrintButton } from './components/buttons/PrintButton';
|
||||||
|
export { default as SliderButton } from './components/buttons/SliderButton';
|
||||||
|
export { default as Header } from './components/Header';
|
||||||
|
export { default as MonitorSelector } from './components/MonitorSelector';
|
||||||
|
export { default as Settings } from './components/Settings';
|
||||||
|
export { default as TopButtons } from './components/TopButtons';
|
||||||
|
export { default as DevTools } from './containers/DevTools';
|
||||||
|
export { default as Dispatcher } from './containers/monitors/Dispatcher';
|
||||||
|
export { default as SliderMonitor } from './containers/monitors/Slider';
|
||||||
|
export * from './constants/actionTypes';
|
||||||
|
export * from './constants/socketActionTypes';
|
||||||
|
export * from './middlewares/api';
|
||||||
|
export * from './middlewares/exportState';
|
||||||
|
export * from './reducers';
|
||||||
|
export * from './reducers/connection';
|
||||||
|
export * from './reducers/instances';
|
||||||
|
export * from './reducers/monitor';
|
||||||
|
export * from './reducers/notification';
|
||||||
|
export * from './reducers/reports';
|
||||||
|
export * from './reducers/section';
|
||||||
|
export * from './reducers/socket';
|
||||||
|
export * from './reducers/theme';
|
||||||
|
export * from './utils/monitorActions';
|
||||||
|
export * from './utils/stringifyJSON';
|
||||||
|
|
|
@ -244,9 +244,7 @@ function getReport(reportId: unknown) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function api(
|
export function api(inStore: MiddlewareAPI<Dispatch<StoreAction>, StoreState>) {
|
||||||
inStore: MiddlewareAPI<Dispatch<StoreAction>, StoreState>
|
|
||||||
) {
|
|
||||||
store = inStore;
|
store = inStore;
|
||||||
return (next: Dispatch<StoreAction>) => (action: StoreAction) => {
|
return (next: Dispatch<StoreAction>) => (action: StoreAction) => {
|
||||||
const result = next(action);
|
const result = next(action);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import stringifyJSON from '../utils/stringifyJSON';
|
import { stringifyJSON } from '../utils/stringifyJSON';
|
||||||
import { UPDATE_STATE, LIFTED_ACTION, EXPORT } from '../constants/actionTypes';
|
import { UPDATE_STATE, LIFTED_ACTION, EXPORT } from '../constants/actionTypes';
|
||||||
import { getActiveInstance } from '../reducers/instances';
|
import { getActiveInstance } from '../reducers/instances';
|
||||||
import { Dispatch, MiddlewareAPI } from 'redux';
|
import { Dispatch, MiddlewareAPI } from 'redux';
|
||||||
|
@ -22,7 +22,7 @@ function download(state: string) {
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportState =
|
export const exportStateMiddleware =
|
||||||
(store: MiddlewareAPI<Dispatch<StoreAction>, StoreState>) =>
|
(store: MiddlewareAPI<Dispatch<StoreAction>, StoreState>) =>
|
||||||
(next: Dispatch<StoreAction>) =>
|
(next: Dispatch<StoreAction>) =>
|
||||||
(action: StoreAction) => {
|
(action: StoreAction) => {
|
||||||
|
@ -63,5 +63,3 @@ const exportState =
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default exportState;
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import { RECONNECT } from '../constants/socketActionTypes';
|
import { RECONNECT } from '../constants/socketActionTypes';
|
||||||
import { ConnectionType, StoreAction } from '../actions';
|
import { ConnectionType, StoreAction } from '../actions';
|
||||||
|
|
||||||
export interface ConnectionOptions {
|
export interface ConnectionStateOptions {
|
||||||
readonly hostname: string;
|
readonly hostname: string;
|
||||||
readonly port: number;
|
readonly port: number;
|
||||||
readonly secure: boolean;
|
readonly secure: boolean;
|
||||||
}
|
}
|
||||||
export interface ConnectionState {
|
export interface ConnectionState {
|
||||||
readonly options: ConnectionOptions;
|
readonly options: ConnectionStateOptions;
|
||||||
readonly type: ConnectionType;
|
readonly type: ConnectionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function connection(
|
export function connection(
|
||||||
state: ConnectionState = {
|
state: ConnectionState = {
|
||||||
options: { hostname: 'localhost', port: 8000, secure: false },
|
options: { hostname: 'localhost', port: 8000, secure: false },
|
||||||
type: 'disabled',
|
type: 'disabled',
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { combineReducers } from 'redux';
|
import { combineReducers } from 'redux';
|
||||||
import section, { SectionState } from './section';
|
import { section, SectionState } from './section';
|
||||||
import connection, { ConnectionState } from './connection';
|
import { connection, ConnectionState } from './connection';
|
||||||
import socket, { SocketState } from './socket';
|
import { socket, SocketState } from './socket';
|
||||||
import monitor, { MonitorState } from './monitor';
|
import { monitor, MonitorState } from './monitor';
|
||||||
import notification, { NotificationState } from './notification';
|
import { notification, NotificationState } from './notification';
|
||||||
import instances, { InstancesState } from './instances';
|
import { instances, InstancesState } from './instances';
|
||||||
import reports, { ReportsState } from './reports';
|
import { reports, ReportsState } from './reports';
|
||||||
import theme, { ThemeState } from './theme';
|
import { theme, ThemeState } from './theme';
|
||||||
import { StoreAction } from '../actions';
|
import { StoreAction } from '../actions';
|
||||||
|
|
||||||
export interface StoreState {
|
export interface StoreState {
|
||||||
|
@ -20,7 +20,7 @@ export interface StoreState {
|
||||||
readonly notification: NotificationState;
|
readonly notification: NotificationState;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rootReducer = combineReducers<StoreState, StoreAction>({
|
export const rootReducer = combineReducers<StoreState, StoreAction>({
|
||||||
section,
|
section,
|
||||||
theme,
|
theme,
|
||||||
connection,
|
connection,
|
||||||
|
@ -30,5 +30,3 @@ const rootReducer = combineReducers<StoreState, StoreAction>({
|
||||||
reports,
|
reports,
|
||||||
notification,
|
notification,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default rootReducer;
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ export interface InstancesState {
|
||||||
persisted?: boolean;
|
persisted?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const initialState: InstancesState = {
|
export const instancesInitialState: InstancesState = {
|
||||||
selected: null,
|
selected: null,
|
||||||
current: 'default',
|
current: 'default',
|
||||||
sync: false,
|
sync: false,
|
||||||
|
@ -303,8 +303,8 @@ function init(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function instances(
|
export function instances(
|
||||||
state = initialState,
|
state = instancesInitialState,
|
||||||
action: StoreAction
|
action: StoreAction
|
||||||
): InstancesState {
|
): InstancesState {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
|
@ -375,7 +375,7 @@ export default function instances(
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
case DISCONNECTED:
|
case DISCONNECTED:
|
||||||
return initialState;
|
return instancesInitialState;
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ export function dispatchMonitorAction(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function monitor(
|
export function monitor(
|
||||||
state = initialState,
|
state = initialState,
|
||||||
action: StoreAction
|
action: StoreAction
|
||||||
): MonitorState {
|
): MonitorState {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user