mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
prettier
This commit is contained in:
parent
4448ac51ce
commit
930cf3c833
|
@ -170,33 +170,42 @@ gulp.task('test:electron', () => {
|
||||||
.on('end', () => crdv.stop());
|
.on('end', () => crdv.stop());
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('default', gulp.parallel(
|
gulp.task(
|
||||||
'replace-webpack-code',
|
'default',
|
||||||
'webpack:dev',
|
gulp.parallel(
|
||||||
'views:dev',
|
'replace-webpack-code',
|
||||||
'copy:dev',
|
'webpack:dev',
|
||||||
'views:watch',
|
'views:dev',
|
||||||
'copy:watch',
|
'copy:dev',
|
||||||
));
|
'views:watch',
|
||||||
gulp.task('build:extension', gulp.parallel(
|
'copy:watch'
|
||||||
'replace-webpack-code',
|
)
|
||||||
'webpack:build:extension',
|
);
|
||||||
'views:build:extension',
|
gulp.task(
|
||||||
'copy:build:extension',
|
'build:extension',
|
||||||
));
|
gulp.parallel(
|
||||||
gulp.task('copy:build:firefox', gulp.series('build:extension', (done) => {
|
'replace-webpack-code',
|
||||||
gulp
|
'webpack:build:extension',
|
||||||
.src([
|
'views:build:extension',
|
||||||
'./build/extension/**',
|
'copy:build:extension'
|
||||||
'!./build/extension/js/redux-devtools-extension.js',
|
)
|
||||||
])
|
);
|
||||||
.pipe(gulp.dest('./build/firefox'))
|
gulp.task(
|
||||||
.on('finish', function() {
|
'copy:build:firefox',
|
||||||
gulp
|
gulp.series('build:extension', (done) => {
|
||||||
.src('./src/browser/firefox/manifest.json')
|
gulp
|
||||||
.pipe(gulp.dest('./build/firefox'));
|
.src([
|
||||||
});
|
'./build/extension/**',
|
||||||
copy('./build/firefox');
|
'!./build/extension/js/redux-devtools-extension.js',
|
||||||
done();
|
])
|
||||||
}));
|
.pipe(gulp.dest('./build/firefox'))
|
||||||
|
.on('finish', function () {
|
||||||
|
gulp
|
||||||
|
.src('./src/browser/firefox/manifest.json')
|
||||||
|
.pipe(gulp.dest('./build/firefox'));
|
||||||
|
});
|
||||||
|
copy('./build/firefox');
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
);
|
||||||
gulp.task('build:firefox', gulp.series('copy:build:firefox'));
|
gulp.task('build:firefox', gulp.series('copy:build:firefox'));
|
||||||
|
|
|
@ -70,8 +70,7 @@ export function filterState(
|
||||||
) {
|
) {
|
||||||
if (type === 'ACTION') {
|
if (type === 'ACTION') {
|
||||||
return !stateSanitizer ? state : stateSanitizer(state, nextActionId - 1);
|
return !stateSanitizer ? state : stateSanitizer(state, nextActionId - 1);
|
||||||
}
|
} else if (type !== 'STATE') return state;
|
||||||
else if (type !== 'STATE') return state;
|
|
||||||
|
|
||||||
if (predicate || !noFiltersApplied(localFilter)) {
|
if (predicate || !noFiltersApplied(localFilter)) {
|
||||||
const filteredStagedActionIds = [];
|
const filteredStagedActionIds = [];
|
||||||
|
|
|
@ -372,7 +372,7 @@ export function connect(preConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateStore(stores) {
|
export function updateStore(stores) {
|
||||||
return function(newStore, instanceId) {
|
return function (newStore, instanceId) {
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
console.warn(
|
console.warn(
|
||||||
'`__REDUX_DEVTOOLS_EXTENSION__.updateStore` is deprecated, remove it and just use ' +
|
'`__REDUX_DEVTOOLS_EXTENSION__.updateStore` is deprecated, remove it and just use ' +
|
||||||
|
|
|
@ -3,7 +3,7 @@ let lastTime = 0;
|
||||||
|
|
||||||
function createExpBackoffTimer(step) {
|
function createExpBackoffTimer(step) {
|
||||||
let count = 1;
|
let count = 1;
|
||||||
return function(reset) {
|
return function (reset) {
|
||||||
// Reset call
|
// Reset call
|
||||||
if (reset) {
|
if (reset) {
|
||||||
count = 1;
|
count = 1;
|
||||||
|
|
|
@ -28,7 +28,7 @@ export function getReport(reportId, tabId, instanceId) {
|
||||||
instanceId: `${tabId}/${instanceId}`,
|
instanceId: `${tabId}/${instanceId}`,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(function(err) {
|
.catch(function (err) {
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
console.warn(err);
|
console.warn(err);
|
||||||
/* eslint-enable no-console */
|
/* eslint-enable no-console */
|
||||||
|
|
|
@ -76,7 +76,7 @@ if (window.isElectron) {
|
||||||
}
|
}
|
||||||
// Avoid error: chrome.runtime.sendMessage is not supported responseCallback
|
// Avoid error: chrome.runtime.sendMessage is not supported responseCallback
|
||||||
const originSendMessage = chrome.runtime.sendMessage;
|
const originSendMessage = chrome.runtime.sendMessage;
|
||||||
chrome.runtime.sendMessage = function() {
|
chrome.runtime.sendMessage = function () {
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
return originSendMessage(...arguments);
|
return originSendMessage(...arguments);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ function createPanel(url) {
|
||||||
'Redux',
|
'Redux',
|
||||||
'img/logo/scalable.png',
|
'img/logo/scalable.png',
|
||||||
url,
|
url,
|
||||||
function() {}
|
function () {}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ require('./pageScript');
|
||||||
chrome.runtime.sendMessage(
|
chrome.runtime.sendMessage(
|
||||||
window.devToolsExtensionID,
|
window.devToolsExtensionID,
|
||||||
{ type: 'GET_OPTIONS' },
|
{ type: 'GET_OPTIONS' },
|
||||||
function(response) {
|
function (response) {
|
||||||
if (!response.options.inject) {
|
if (!response.options.inject) {
|
||||||
const urls = response.options.urls.split('\n').filter(Boolean).join('|');
|
const urls = response.options.urls.split('\n').filter(Boolean).join('|');
|
||||||
if (!location.href.match(new RegExp(urls))) return;
|
if (!location.href.match(new RegExp(urls))) return;
|
||||||
|
|
|
@ -38,7 +38,7 @@ function deprecateParam(oldParam, newParam) {
|
||||||
/* eslint-enable no-console */
|
/* eslint-enable no-console */
|
||||||
}
|
}
|
||||||
|
|
||||||
const __REDUX_DEVTOOLS_EXTENSION__ = function(
|
const __REDUX_DEVTOOLS_EXTENSION__ = function (
|
||||||
reducer,
|
reducer,
|
||||||
preloadedState,
|
preloadedState,
|
||||||
config
|
config
|
||||||
|
@ -299,7 +299,11 @@ const __REDUX_DEVTOOLS_EXTENSION__ = function(
|
||||||
const filteredActionIds = []; // simple circular buffer of non-excluded actions with fixed maxAge-1 length
|
const filteredActionIds = []; // simple circular buffer of non-excluded actions with fixed maxAge-1 length
|
||||||
const getMaxAge = (liftedAction, liftedState) => {
|
const getMaxAge = (liftedAction, liftedState) => {
|
||||||
let m = (config && config.maxAge) || window.devToolsOptions.maxAge || 50;
|
let m = (config && config.maxAge) || window.devToolsOptions.maxAge || 50;
|
||||||
if (!liftedAction || noFiltersApplied(localFilter) || !liftedAction.action) {
|
if (
|
||||||
|
!liftedAction ||
|
||||||
|
noFiltersApplied(localFilter) ||
|
||||||
|
!liftedAction.action
|
||||||
|
) {
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
if (!maxAge || maxAge < m) maxAge = m; // it can be modified in process on options page
|
if (!maxAge || maxAge < m) maxAge = m; // it can be modified in process on options page
|
||||||
|
|
|
@ -8,7 +8,7 @@ if (process.env.NODE_ENV === 'production') {
|
||||||
s.parentNode.removeChild(s);
|
s.parentNode.removeChild(s);
|
||||||
} else {
|
} else {
|
||||||
s.src = chrome.extension.getURL('js/page.bundle.js');
|
s.src = chrome.extension.getURL('js/page.bundle.js');
|
||||||
s.onload = function() {
|
s.onload = function () {
|
||||||
this.parentNode.removeChild(this);
|
this.parentNode.removeChild(this);
|
||||||
};
|
};
|
||||||
(document.head || document.documentElement).appendChild(s);
|
(document.head || document.documentElement).appendChild(s);
|
||||||
|
|
|
@ -47,7 +47,7 @@ const get = (callback) => {
|
||||||
'^https?://localhost|0\\.0\\.0\\.0:\\d+\n^https?://.+\\.github\\.io',
|
'^https?://localhost|0\\.0\\.0\\.0:\\d+\n^https?://.+\\.github\\.io',
|
||||||
showContextMenus: true,
|
showContextMenus: true,
|
||||||
},
|
},
|
||||||
function(items) {
|
function (items) {
|
||||||
options = migrateOldOptions(items);
|
options = migrateOldOptions(items);
|
||||||
callback(options);
|
callback(options);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,10 +22,10 @@ chrome.storage.local.get(
|
||||||
socketOptions={
|
socketOptions={
|
||||||
options['s:hostname'] && options['s:port']
|
options['s:hostname'] && options['s:port']
|
||||||
? {
|
? {
|
||||||
hostname: options['s:hostname'],
|
hostname: options['s:hostname'],
|
||||||
port: options['s:port'],
|
port: options['s:port'],
|
||||||
secure: options['s:secure'],
|
secure: options['s:secure'],
|
||||||
}
|
}
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
/>,
|
/>,
|
||||||
|
|
|
@ -8,7 +8,7 @@ const path = resolve('build/extension');
|
||||||
const extensionId = 'lmhkpmbekcpmknklioeibfkpmmfibljd';
|
const extensionId = 'lmhkpmbekcpmknklioeibfkpmmfibljd';
|
||||||
const actionsPattern = /^@@INIT(.|\n)+@@reduxReactRouter\/routerDidChange(.|\n)+@@reduxReactRouter\/initRoutes(.|\n)+$/;
|
const actionsPattern = /^@@INIT(.|\n)+@@reduxReactRouter\/routerDidChange(.|\n)+@@reduxReactRouter\/initRoutes(.|\n)+$/;
|
||||||
|
|
||||||
describe('Chrome extension', function() {
|
describe('Chrome extension', function () {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { switchMonitorTests, delay } from '../utils/e2e';
|
||||||
const port = 9515;
|
const port = 9515;
|
||||||
const devPanelPath = 'chrome-extension://redux-devtools/devpanel.html';
|
const devPanelPath = 'chrome-extension://redux-devtools/devpanel.html';
|
||||||
|
|
||||||
describe('DevTools panel for Electron', function() {
|
describe('DevTools panel for Electron', function () {
|
||||||
this.timeout(10000);
|
this.timeout(10000);
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
|
@ -36,7 +36,7 @@ describe('DevTools panel for Electron', function() {
|
||||||
|
|
||||||
await this.driver.manage().timeouts().pageLoadTimeout(5000);
|
await this.driver.manage().timeouts().pageLoadTimeout(5000);
|
||||||
|
|
||||||
const id = await this.driver.executeAsyncScript(function(callback) {
|
const id = await this.driver.executeAsyncScript(function (callback) {
|
||||||
let attempts = 5;
|
let attempts = 5;
|
||||||
function showReduxPanel() {
|
function showReduxPanel() {
|
||||||
if (attempts === 0) {
|
if (attempts === 0) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ export const delay = (time) =>
|
||||||
new Promise((resolve) => setTimeout(resolve, time));
|
new Promise((resolve) => setTimeout(resolve, time));
|
||||||
|
|
||||||
export const switchMonitorTests = {
|
export const switchMonitorTests = {
|
||||||
'should switch to Log Monitor': async function() {
|
'should switch to Log Monitor': async function () {
|
||||||
await this.driver
|
await this.driver
|
||||||
.findElement(webdriver.By.xpath('//div[text()="Inspector"]'))
|
.findElement(webdriver.By.xpath('//div[text()="Inspector"]'))
|
||||||
.click();
|
.click();
|
||||||
|
@ -19,7 +19,7 @@ export const switchMonitorTests = {
|
||||||
await delay(500);
|
await delay(500);
|
||||||
},
|
},
|
||||||
|
|
||||||
'should switch to Chart Monitor': async function() {
|
'should switch to Chart Monitor': async function () {
|
||||||
await this.driver
|
await this.driver
|
||||||
.findElement(webdriver.By.xpath('//div[text()="Log monitor"]'))
|
.findElement(webdriver.By.xpath('//div[text()="Log monitor"]'))
|
||||||
.click();
|
.click();
|
||||||
|
@ -34,7 +34,7 @@ export const switchMonitorTests = {
|
||||||
await delay(500); // Wait till menu is closed
|
await delay(500); // Wait till menu is closed
|
||||||
},
|
},
|
||||||
|
|
||||||
'should switch back to Inspector Monitor': async function() {
|
'should switch back to Inspector Monitor': async function () {
|
||||||
await this.driver
|
await this.driver
|
||||||
.findElement(webdriver.By.xpath('//div[text()="Chart"]'))
|
.findElement(webdriver.By.xpath('//div[text()="Chart"]'))
|
||||||
.click();
|
.click();
|
||||||
|
|
|
@ -34,9 +34,9 @@ const baseConfig = (params) => ({
|
||||||
...(params.plugins
|
...(params.plugins
|
||||||
? params.plugins
|
? params.plugins
|
||||||
: [
|
: [
|
||||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||||
new webpack.optimize.OccurrenceOrderPlugin(),
|
new webpack.optimize.OccurrenceOrderPlugin(),
|
||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
optimization: {
|
optimization: {
|
||||||
minimizer: [
|
minimizer: [
|
||||||
|
@ -67,12 +67,12 @@ const baseConfig = (params) => ({
|
||||||
...(params.loaders
|
...(params.loaders
|
||||||
? params.loaders
|
? params.loaders
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
use: 'babel-loader',
|
use: 'babel-loader',
|
||||||
exclude: /(node_modules|tmp\/page\.bundle)/,
|
exclude: /(node_modules|tmp\/page\.bundle)/,
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
test: /\.css?$/,
|
test: /\.css?$/,
|
||||||
use: ['style-loader', 'raw-loader'],
|
use: ['style-loader', 'raw-loader'],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user