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