mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-10 19:56:54 +03:00
fix(extension): fix code editor styles (#817)
This commit is contained in:
parent
d38a438764
commit
1258902c35
|
@ -2,4 +2,7 @@ module.exports = {
|
||||||
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
|
setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
|
||||||
testPathIgnorePatterns: ['<rootDir>/examples'],
|
testPathIgnorePatterns: ['<rootDir>/examples'],
|
||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
|
moduleNameMapper: {
|
||||||
|
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,9 +7,9 @@ import { StoreState } from '@redux-devtools/app/lib/reducers';
|
||||||
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 getPreloadedState from '../background/getPreloadedState';
|
import getPreloadedState from '../background/getPreloadedState';
|
||||||
|
import { MonitorMessage } from '../../../app/middlewares/api';
|
||||||
|
|
||||||
import '../../views/window.pug';
|
import '../../views/window.pug';
|
||||||
import { MonitorMessage } from '../../../app/middlewares/api';
|
|
||||||
|
|
||||||
const position = location.hash;
|
const position = location.hash;
|
||||||
let preloadedState: PreloadedState<StoreState>;
|
let preloadedState: PreloadedState<StoreState>;
|
||||||
|
|
1
extension/test/__mocks__/styleMock.ts
Normal file
1
extension/test/__mocks__/styleMock.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export default {};
|
|
@ -77,7 +77,7 @@ const baseConfig = (params) => ({
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
test: /\.css?$/,
|
test: /\.css?$/,
|
||||||
use: ['style-loader', 'raw-loader'],
|
use: ['style-loader', 'css-loader'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.pug$/,
|
test: /\.pug$/,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Container } from '../src';
|
import { Container } from '../src';
|
||||||
import { listSchemes, listThemes } from '../src/utils/theme';
|
import { listSchemes, listThemes } from '../src/utils/theme';
|
||||||
import '../src/presets';
|
|
||||||
|
|
||||||
export const parameters = {
|
export const parameters = {
|
||||||
actions: { argTypesRegex: '^on[A-Z].*' },
|
actions: { argTypesRegex: '^on[A-Z].*' },
|
||||||
|
|
|
@ -2,4 +2,7 @@ module.exports = {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
|
moduleNameMapper: {
|
||||||
|
'\\.css$': '<rootDir>/tests/__mocks__/styleMock.ts',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,6 +6,15 @@ import { Base16Theme } from 'base16';
|
||||||
import { defaultStyle, themedStyle } from './styles';
|
import { defaultStyle, themedStyle } from './styles';
|
||||||
import { Theme } from '../themes/default';
|
import { Theme } from '../themes/default';
|
||||||
|
|
||||||
|
import 'codemirror/mode/javascript/javascript';
|
||||||
|
import 'codemirror/addon/fold/foldgutter';
|
||||||
|
import 'codemirror/addon/fold/foldcode';
|
||||||
|
import 'codemirror/addon/fold/brace-fold';
|
||||||
|
|
||||||
|
import '../../fonts/index.css';
|
||||||
|
import 'codemirror/lib/codemirror.css';
|
||||||
|
import 'codemirror/addon/fold/foldgutter.css';
|
||||||
|
|
||||||
const EditorContainer = styled.div(
|
const EditorContainer = styled.div(
|
||||||
'' as unknown as TemplateStringsArray,
|
'' as unknown as TemplateStringsArray,
|
||||||
({ theme }: { theme: Theme }) =>
|
({ theme }: { theme: Theme }) =>
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
/* eslint-disable global-require */
|
|
||||||
|
|
||||||
import 'codemirror/mode/javascript/javascript';
|
|
||||||
import 'codemirror/addon/fold/foldgutter';
|
|
||||||
import 'codemirror/addon/fold/foldcode';
|
|
||||||
import 'codemirror/addon/fold/brace-fold';
|
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'test') {
|
|
||||||
require('../fonts/index.css');
|
|
||||||
require('codemirror/lib/codemirror.css');
|
|
||||||
require('codemirror/addon/fold/foldgutter.css');
|
|
||||||
}
|
|
1
packages/devui/tests/__mocks__/styleMock.ts
Normal file
1
packages/devui/tests/__mocks__/styleMock.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export default {};
|
|
@ -2,4 +2,7 @@ module.exports = {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
|
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
|
||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
|
moduleNameMapper: {
|
||||||
|
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'devui/lib/presets';
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { Store } from 'redux';
|
import { Store } from 'redux';
|
||||||
|
|
1
packages/redux-devtools-app/test/__mocks__/styleMock.ts
Normal file
1
packages/redux-devtools-app/test/__mocks__/styleMock.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export default {};
|
|
@ -2,4 +2,7 @@ module.exports = {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
|
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
|
||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
|
moduleNameMapper: {
|
||||||
|
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
export default {};
|
Loading…
Reference in New Issue
Block a user