mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
Move pageScript to top-level
This commit is contained in:
parent
ce0853e674
commit
790be9efed
|
@ -19,8 +19,8 @@ import {
|
||||||
} from '@redux-devtools/app';
|
} from '@redux-devtools/app';
|
||||||
import { GoRadioTower } from 'react-icons/go';
|
import { GoRadioTower } from 'react-icons/go';
|
||||||
import { MdBorderBottom, MdBorderLeft, MdBorderRight } from 'react-icons/md';
|
import { MdBorderBottom, MdBorderLeft, MdBorderRight } from 'react-icons/md';
|
||||||
import { Position } from '../api/openWindow';
|
import type { Position } from '../pageScript/api/openWindow';
|
||||||
import type { SingleMessage } from '../../background/store/apiMiddleware';
|
import type { SingleMessage } from '../background/store/apiMiddleware';
|
||||||
|
|
||||||
type StateProps = ReturnType<typeof mapStateToProps>;
|
type StateProps = ReturnType<typeof mapStateToProps>;
|
||||||
type DispatchProps = ResolveThunks<typeof actionCreators>;
|
type DispatchProps = ResolveThunks<typeof actionCreators>;
|
|
@ -1,15 +0,0 @@
|
||||||
import {
|
|
||||||
Action,
|
|
||||||
createStore,
|
|
||||||
PreloadedState,
|
|
||||||
Reducer,
|
|
||||||
StoreEnhancer,
|
|
||||||
} from 'redux';
|
|
||||||
|
|
||||||
export default function configureStore<S, A extends Action<unknown>>(
|
|
||||||
reducer: Reducer<S, A>,
|
|
||||||
initialState: PreloadedState<S> | undefined,
|
|
||||||
enhance: () => StoreEnhancer
|
|
||||||
) {
|
|
||||||
return createStore(reducer, initialState, enhance());
|
|
||||||
}
|
|
|
@ -27,10 +27,10 @@ import type {
|
||||||
ErrorMessage,
|
ErrorMessage,
|
||||||
PageScriptToContentScriptMessageForwardedToMonitors,
|
PageScriptToContentScriptMessageForwardedToMonitors,
|
||||||
PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance,
|
PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance,
|
||||||
} from '../../app/api';
|
} from '../../pageScript/api';
|
||||||
import { LiftedState } from '@redux-devtools/instrument';
|
import { LiftedState } from '@redux-devtools/instrument';
|
||||||
import type { BackgroundAction, LiftedActionAction } from './backgroundStore';
|
import type { BackgroundAction, LiftedActionAction } from './backgroundStore';
|
||||||
import type { Position } from '../../app/api/openWindow';
|
import type { Position } from '../../pageScript/api/openWindow';
|
||||||
import type { BackgroundState } from './backgroundReducer';
|
import type { BackgroundState } from './backgroundReducer';
|
||||||
|
|
||||||
interface TabMessageBase {
|
interface TabMessageBase {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import type {
|
||||||
PageScriptToContentScriptMessage,
|
PageScriptToContentScriptMessage,
|
||||||
PageScriptToContentScriptMessageWithoutDisconnect,
|
PageScriptToContentScriptMessageWithoutDisconnect,
|
||||||
PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance,
|
PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance,
|
||||||
} from '../app/api';
|
} from '../pageScript/api';
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
import {
|
import {
|
||||||
CustomAction,
|
CustomAction,
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { createRoot, Root } from 'react-dom/client';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { Persistor } from 'redux-persist';
|
import { Persistor } from 'redux-persist';
|
||||||
import { REMOVE_INSTANCE, StoreAction } from '@redux-devtools/app';
|
import { REMOVE_INSTANCE, StoreAction } from '@redux-devtools/app';
|
||||||
import App from '../app/containers/App';
|
import App from '../app/App';
|
||||||
import configureStore from './store/panelStore';
|
import configureStore from './store/panelStore';
|
||||||
|
|
||||||
import '../../views/devpanel.pug';
|
import '../../views/devpanel.pug';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FilterState } from '../app/api/filters';
|
import { FilterState } from '../pageScript/api/filters';
|
||||||
import { OptionsProps } from './Options';
|
import { OptionsProps } from './Options';
|
||||||
|
|
||||||
export default ({ options, saveOption }: OptionsProps) => {
|
export default ({ options, saveOption }: OptionsProps) => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { FilterState, FilterStateValue } from '../app/api/filters';
|
import { FilterState, FilterStateValue } from '../pageScript/api/filters';
|
||||||
|
|
||||||
export interface Options {
|
export interface Options {
|
||||||
readonly useEditor: number;
|
readonly useEditor: number;
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import jsan from 'jsan';
|
import jsan from 'jsan';
|
||||||
import { immutableSerialize } from '@redux-devtools/serialize';
|
import { immutableSerialize } from '@redux-devtools/serialize';
|
||||||
import type {
|
import type { Config, SerializeWithImmutable } from '../index';
|
||||||
Config,
|
|
||||||
SerializeWithImmutable,
|
|
||||||
} from '../../browser/extension/inject/pageScript';
|
|
||||||
import Immutable from 'immutable';
|
import Immutable from 'immutable';
|
||||||
import { LiftedState } from '@redux-devtools/instrument';
|
import { LiftedState } from '@redux-devtools/instrument';
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
|
@ -5,7 +5,7 @@ import { getActionsArray, getLocalFilter } from '@redux-devtools/utils';
|
||||||
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 type { Config } from '../../browser/extension/inject/pageScript';
|
import type { Config } from '../index';
|
||||||
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';
|
import { LibConfig } from '@redux-devtools/app';
|
|
@ -1,7 +1,7 @@
|
||||||
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';
|
import { persistState } from '@redux-devtools/core';
|
||||||
import { ConfigWithExpandedMaxAge } from '../../browser/extension/inject/pageScript';
|
import type { ConfigWithExpandedMaxAge } from './index';
|
||||||
|
|
||||||
export function getUrlParam(key: string) {
|
export function getUrlParam(key: string) {
|
||||||
const matches = window.location.href.match(
|
const matches = window.location.href.match(
|
|
@ -27,19 +27,19 @@ import {
|
||||||
LibConfig,
|
LibConfig,
|
||||||
Features,
|
Features,
|
||||||
} from '@redux-devtools/app';
|
} from '@redux-devtools/app';
|
||||||
import configureStore, { getUrlParam } from '../../../app/stores/enhancerStore';
|
import configureStore, { getUrlParam } from './enhancerStore';
|
||||||
import { isAllowed, Options } from '../../../options/syncOptions';
|
import { isAllowed, Options } from '../options/syncOptions';
|
||||||
import Monitor from '../../../app/service/Monitor';
|
import Monitor from './Monitor';
|
||||||
import {
|
import {
|
||||||
noFiltersApplied,
|
noFiltersApplied,
|
||||||
isFiltered,
|
isFiltered,
|
||||||
filterState,
|
filterState,
|
||||||
startingFrom,
|
startingFrom,
|
||||||
} from '../../../app/api/filters';
|
} from './api/filters';
|
||||||
import notifyErrors from '../../../app/api/notifyErrors';
|
import notifyErrors from './api/notifyErrors';
|
||||||
import importState from '../../../app/api/importState';
|
import importState from './api/importState';
|
||||||
import openWindow, { Position } from '../../../app/api/openWindow';
|
import openWindow, { Position } from './api/openWindow';
|
||||||
import generateId from '../../../app/api/generateInstanceId';
|
import generateId from './api/generateInstanceId';
|
||||||
import {
|
import {
|
||||||
toContentScript,
|
toContentScript,
|
||||||
sendMessage,
|
sendMessage,
|
||||||
|
@ -51,8 +51,8 @@ import {
|
||||||
Serialize,
|
Serialize,
|
||||||
StructuralPerformAction,
|
StructuralPerformAction,
|
||||||
ConnectResponse,
|
ConnectResponse,
|
||||||
} from '../../../app/api';
|
} from './api';
|
||||||
import type { ContentScriptToPageScriptMessage } from '../../../contentScript';
|
import type { ContentScriptToPageScriptMessage } from '../contentScript';
|
||||||
|
|
||||||
type EnhancedStoreWithInitialDispatch<
|
type EnhancedStoreWithInitialDispatch<
|
||||||
S,
|
S,
|
|
@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client';
|
||||||
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';
|
import { UPDATE_STATE } from '@redux-devtools/app';
|
||||||
import App from '../app/containers/App';
|
import App from '../app/App';
|
||||||
import configureStore from './store/windowStore';
|
import configureStore from './store/windowStore';
|
||||||
import type { MonitorMessage } from '../background/store/apiMiddleware';
|
import type { MonitorMessage } from '../background/store/apiMiddleware';
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ import webpack from 'webpack';
|
||||||
import CopyPlugin from 'copy-webpack-plugin';
|
import CopyPlugin from 'copy-webpack-plugin';
|
||||||
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
||||||
|
|
||||||
const extpath = path.join(__dirname, '../src/browser/extension/');
|
|
||||||
|
|
||||||
const baseConfig = (params) => ({
|
const baseConfig = (params) => ({
|
||||||
// devtool: 'source-map',
|
// devtool: 'source-map',
|
||||||
mode: params.mode,
|
mode: params.mode,
|
||||||
|
@ -16,7 +14,7 @@ const baseConfig = (params) => ({
|
||||||
devpanel: ['../src/chromeApiMock', '../src/devpanel/index'],
|
devpanel: ['../src/chromeApiMock', '../src/devpanel/index'],
|
||||||
devtools: ['../src/devtools/index'],
|
devtools: ['../src/devtools/index'],
|
||||||
content: ['../src/chromeApiMock', '../src/contentScript/index'],
|
content: ['../src/chromeApiMock', '../src/contentScript/index'],
|
||||||
pagewrap: [`${extpath}inject/pageScriptWrap`],
|
pagewrap: ['../src/pageScriptWrap'],
|
||||||
...params.inputExtra,
|
...params.inputExtra,
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import baseConfig from './base.config';
|
||||||
let config = baseConfig({
|
let config = baseConfig({
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
inputExtra: {
|
inputExtra: {
|
||||||
page: [path.join(__dirname, '../src/browser/extension/inject/pageScript')],
|
page: [path.join(__dirname, '../src/pageScript')],
|
||||||
},
|
},
|
||||||
output: { path: path.join(__dirname, '../dev') },
|
output: { path: path.join(__dirname, '../dev') },
|
||||||
globals: {
|
globals: {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import baseConfig from './base.config';
|
||||||
export default baseConfig({
|
export default baseConfig({
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
inputExtra: {
|
inputExtra: {
|
||||||
page: [path.join(__dirname, '../src/browser/extension/inject/pageScript')],
|
page: [path.join(__dirname, '../src/pageScript')],
|
||||||
},
|
},
|
||||||
output: { path: path.join(__dirname, '../build/extension') },
|
output: { path: path.join(__dirname, '../build/extension') },
|
||||||
globals: {
|
globals: {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import baseConfig from './base.config';
|
||||||
export default baseConfig({
|
export default baseConfig({
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
input: {
|
input: {
|
||||||
page: [path.join(__dirname, '../src/browser/extension/inject/pageScript')],
|
page: [path.join(__dirname, '../src/pageScript')],
|
||||||
},
|
},
|
||||||
output: { path: path.join(__dirname, '../build/tmp') },
|
output: { path: path.join(__dirname, '../build/tmp') },
|
||||||
globals: {
|
globals: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user