Skip to content

Commit

Permalink
Reorganized folders into packages/*
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Aug 13, 2019
1 parent ec7ef50 commit 08743b1
Show file tree
Hide file tree
Showing 145 changed files with 375 additions and 412 deletions.
22 changes: 11 additions & 11 deletions packages/react-devtools-core/src/backend.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// @flow

import Agent from 'src/backend/agent';
import Bridge from 'src/bridge';
import { installHook } from 'src/hook';
import { initBackend } from 'src/backend';
import { __DEBUG__ } from 'src/constants';
import setupNativeStyleEditor from 'src/backend/NativeStyleEditor/setupNativeStyleEditor';
import { getDefaultComponentFilters } from 'src/utils';
import Agent from 'react-devtools-shared/src/backend/agent';
import Bridge from 'react-devtools-shared/src/bridge';
import { installHook } from 'react-devtools-shared/src/hook';
import { initBackend } from 'react-devtools-shared/src/backend';
import { __DEBUG__ } from 'react-devtools-shared/src/constants';
import setupNativeStyleEditor from 'react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor';
import { getDefaultComponentFilters } from 'react-devtools-shared/src/utils';

import type { BackendBridge } from 'src/bridge';
import type { ComponentFilter } from 'src/types';
import type { DevToolsHook } from 'src/backend/types';
import type { ResolveNativeStyle } from 'src/backend/NativeStyleEditor/setupNativeStyleEditor';
import type { BackendBridge } from 'react-devtools-shared/src/bridge';
import type { ComponentFilter } from 'react-devtools-shared/src/types';
import type { DevToolsHook } from 'react-devtools-shared/src/backend/types';
import type { ResolveNativeStyle } from 'react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor';

type ConnectOptions = {
host?: string,
Expand Down
16 changes: 8 additions & 8 deletions packages/react-devtools-core/src/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import {
// $FlowFixMe Flow does not yet know about createRoot()
unstable_createRoot as createRoot,
} from 'react-dom';
import Bridge from 'src/bridge';
import Store from 'src/devtools/store';
import { getSavedComponentFilters, getAppendComponentStack } from 'src/utils';
import Bridge from 'react-devtools-shared/src/bridge';
import Store from 'react-devtools-shared/src/devtools/store';
import { getSavedComponentFilters, getAppendComponentStack } from 'react-devtools-shared/src/utils';
import { Server } from 'ws';
import { existsSync, readFileSync } from 'fs';
import { installHook } from 'src/hook';
import DevTools from 'src/devtools/views/DevTools';
import { installHook } from 'react-devtools-shared/src/hook';
import DevTools from 'react-devtools-shared/src/devtools/views/DevTools';
import { doesFilePathExist, launchEditor } from './editor';
import { __DEBUG__ } from 'src/constants';
import { __DEBUG__ } from 'react-devtools-shared/src/constants';

import type { FrontendBridge } from 'src/bridge';
import type { InspectedElement } from 'src/devtools/views/Components/types';
import type { FrontendBridge } from 'react-devtools-shared/src/bridge';
import type { InspectedElement } from 'react-devtools-shared/src/devtools/views/Components/types';

installHook(window);

Expand Down
166 changes: 4 additions & 162 deletions packages/react-devtools-extensions/package.json
Original file line number Diff line number Diff line change
@@ -1,164 +1,6 @@
{
"version": "4.0.0",
"repository": "bvaughn/react-devtools-experimental",
"license": "MIT",
"private": true,
"workspaces": [
"packages/*"
],
"jest": {
"modulePathIgnorePatterns": [
"<rootDir>/shells"
],
"modulePaths": [
"<rootDir>"
],
"moduleNameMapper": {
"^src/(.*)$": "<rootDir>/src/$1",
"\\.css$": "<rootDir>/src/__tests__/__mocks__/cssMock.js"
},
"setupFiles": [
"<rootDir>/src/__tests__/setupEnv"
],
"setupFilesAfterEnv": [
"<rootDir>/src/__tests__/setupTests"
],
"snapshotSerializers": [
"<rootDir>/src/__tests__/inspectedElementSerializer",
"<rootDir>/src/__tests__/storeSerializer"
],
"testMatch": [
"**/__tests__/**/*-test.js"
]
},
"scripts": {
"build:core:backend": "cd ./packages/react-devtools-core && yarn build:backend",
"build:core:standalone": "cd ./packages/react-devtools-core && yarn build:standalone",
"build:core": "cd ./packages/react-devtools-core && yarn build",
"build:inline": "cd ./packages/react-devtools-inline && yarn build",
"build:demo": "cd ./shells/dev && cross-env NODE_ENV=development cross-env TARGET=remote webpack --config webpack.config.js",
"build:extension": "cross-env NODE_ENV=production yarn run build:extension:chrome && yarn run build:extension:firefox",
"build:extension:dev": "cross-env NODE_ENV=development yarn run build:extension:chrome && yarn run build:extension:firefox",
"build:extension:chrome": "cross-env NODE_ENV=production node ./shells/browser/chrome/build",
"build:extension:chrome:crx": "cross-env NODE_ENV=production node ./shells/browser/chrome/build --crx",
"build:extension:chrome:dev": "cross-env NODE_ENV=development node ./shells/browser/chrome/build",
"build:extension:firefox": "cross-env NODE_ENV=production node ./shells/browser/firefox/build",
"build:extension:firefox:dev": "cross-env NODE_ENV=development node ./shells/browser/firefox/build",
"build:standalone": "cd packages/react-devtools-core && yarn run build",
"deploy": "yarn run deploy:demo && yarn run deploy:chrome && yarn run deploy:firefox",
"deploy:demo": "yarn run build:demo && cd shells/dev/ && now deploy && now alias react-devtools-experimental",
"deploy:chrome": "node ./shells/browser/chrome/deploy",
"deploy:firefox": "node ./shells/browser/firefox/deploy",
"linc": "lint-staged",
"lint": "eslint '**/*.js'",
"lint:ci": "eslint '**/*.js' --max-warnings 0",
"precommit": "lint-staged",
"prettier": "prettier --write '**/*.{js,json,css}'",
"prettier:ci": "prettier --check '**/*.{js,json,css}'",
"start": "cd ./shells/dev && cross-env NODE_ENV=development cross-env TARGET=local webpack-dev-server --open",
"start:core:backend": "cd ./packages/react-devtools-core && yarn start:backend",
"start:core:standalone": "cd ./packages/react-devtools-core && yarn start:standalone",
"start:electron": "cd ./packages/react-devtools && node bin.js",
"start:prod": "cd ./shells/dev && cross-env NODE_ENV=production cross-env TARGET=local webpack-dev-server --open",
"test": "jest",
"test-debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
"test:chrome": "node ./shells/browser/chrome/test",
"test:firefox": "node ./shells/browser/firefox/test",
"test:standalone": "cd packages/react-devtools && yarn start",
"typecheck": "flow check --show-all-errors"
},
"devEngines": {
"node": "10.x || 11.x"
},
"lint-staged": {
"{shells,src}/**/*.{js,json,css}": [
"prettier --write",
"git add"
],
"**/*.js": "eslint --max-warnings 0"
},
"devDependencies": {
"@babel/core": "^7.1.6",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-transform-flow-strip-types": "^7.1.6",
"@babel/plugin-transform-react-jsx-source": "^7.2.0",
"@babel/preset-env": "^7.1.6",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@reach/menu-button": "^0.1.17",
"@reach/tooltip": "^0.2.2",
"archiver": "^3.0.0",
"babel-core": "^7.0.0-bridge",
"babel-eslint": "^9.0.0",
"babel-jest": "^24.7.1",
"babel-loader": "^8.0.4",
"child-process-promise": "^2.2.1",
"chrome-launch": "^1.1.4",
"classnames": "2.2.1",
"cli-spinners": "^1.0.0",
"clipboard-js": "^0.3.6",
"cross-env": "^5.2.0",
"crx": "^5.0.0",
"css-loader": "^1.0.1",
"error-stack-parser": "^2.0.2",
"es6-symbol": "3.0.2",
"escape-string-regexp": "^1.0.5",
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.9.0",
"eslint-config-react-app": "^2.1.0",
"eslint-config-standard": "^11.0.0",
"eslint-config-standard-react": "^6.0.0",
"eslint-plugin-flowtype": "^2.47.1",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^5",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-react-hooks": "^1.6.0",
"eslint-plugin-standard": "^3.0.1",
"events": "^3.0.0",
"fbjs": "0.5.1",
"fbjs-scripts": "0.7.0",
"firefox-profile": "^1.0.2",
"flow-bin": "^0.103.0",
"fs-extra": "^3.0.1",
"gh-pages": "^1.0.0",
"immutable": "3.7.6",
"jest": "^24.7.1",
"lerna": "^2.8.0",
"lint-staged": "^7.0.5",
"local-storage-fallback": "^4.1.1",
"lodash.throttle": "^4.1.1",
"log-update": "^2.0.0",
"lru-cache": "^4.1.3",
"memoize-one": "^3.1.1",
"node-libs-browser": "0.5.3",
"nullthrows": "^1.0.0",
"object-assign": "4.0.1",
"opener": "^1.5.1",
"prettier": "^1.16.4",
"prop-types": "^15.6.2",
"raw-loader": "^3.1.0",
"react": "^0.0.0-424099da6",
"react-15": "npm:react@^15",
"react-color": "^2.11.7",
"react-dom": "^0.0.0-424099da6",
"react-dom-15": "npm:react-dom@^15",
"react-is": "0.0.0-424099da6",
"react-native-web": "^0.11.5",
"react-test-renderer": "^0.0.0-424099da6",
"react-virtualized-auto-sizer": "^1.0.2",
"request-promise": "^4.2.4",
"rimraf": "^2.6.3",
"scheduler": "^0.0.0-424099da6",
"semver": "^5.5.1",
"serve-static": "^1.14.1",
"style-loader": "^0.23.1",
"web-ext": "^3.0.0",
"webpack": "^4.26.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.3.1",
"yargs": "^13.2.4"
}

"name": "react-devtools-extensions",
"version": "0.0.0",
"private": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ function welcome(event) {
window.addEventListener('message', welcome);

function setup(hook) {
const Agent = require('src/backend/agent').default;
const Bridge = require('src/bridge').default;
const { initBackend } = require('src/backend');
const setupNativeStyleEditor = require('src/backend/NativeStyleEditor/setupNativeStyleEditor')
const Agent = require('react-devtools-shared/src/backend/agent').default;
const Bridge = require('react-devtools-shared/src/bridge').default;
const { initBackend } = require('react-devtools-shared/src/backend');
const setupNativeStyleEditor = require('react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor')
.default;

const bridge = new Bridge({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* global chrome */

import nullthrows from 'nullthrows';
import { installHook } from 'src/hook';
import { SESSION_STORAGE_RELOAD_AND_PROFILE_KEY } from 'src/constants';
import { sessionStorageGetItem } from 'src/storage';
import { installHook } from 'react-devtools-shared/src/hook';
import { SESSION_STORAGE_RELOAD_AND_PROFILE_KEY } from 'react-devtools-shared/src/constants';
import { sessionStorageGetItem } from 'react-devtools-shared/src/storage';

function injectCode(code) {
const script = document.createElement('script');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

import { createElement } from 'react';
import { unstable_createRoot as createRoot, flushSync } from 'react-dom';
import Bridge from 'src/bridge';
import Store from 'src/devtools/store';
import Bridge from 'react-devtools-shared/src/bridge';
import Store from 'react-devtools-shared/src/devtools/store';
import inject from './inject';
import {
createViewElementSource,
getBrowserName,
getBrowserTheme,
} from './utils';
import { getSavedComponentFilters, getAppendComponentStack } from 'src/utils';
import { getSavedComponentFilters, getAppendComponentStack } from 'react-devtools-shared/src/utils';
import {
localStorageGetItem,
localStorageRemoveItem,
localStorageSetItem,
} from 'src/storage';
import DevTools from 'src/devtools/views/DevTools';
} from 'react-devtools-shared/src/storage';
import DevTools from 'react-devtools-shared/src/devtools/views/DevTools';

const LOCAL_STORAGE_SUPPORTS_PROFILING_KEY =
'React::DevTools::supportsProfiling';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @flow
*/

import { attach } from 'src/backend/renderer';
import { attach } from 'react-devtools-shared/src/backend/renderer';

Object.defineProperty(
window,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { resolve } = require('path');
const { DefinePlugin } = require('webpack');
const { getGitHubURL, getVersionString } = require('../../utils');
const { getGitHubURL, getVersionString } = require('../utils');

const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { resolve } = require('path');
const { DefinePlugin } = require('webpack');
const { getGitHubURL, getVersionString } = require('../../utils');
const { getGitHubURL, getVersionString } = require('../utils');

const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
Expand Down Expand Up @@ -28,11 +28,6 @@ module.exports = {
path: __dirname + '/build',
filename: '[name].js',
},
resolve: {
alias: {
src: resolve(__dirname, '../../../src'),
},
},
plugins: [
new DefinePlugin({
__DEV__: false,
Expand All @@ -48,7 +43,7 @@ module.exports = {
test: /\.js$/,
loader: 'babel-loader',
options: {
configFile: resolve(__dirname, '../../../babel.config.js'),
configFile: resolve(__dirname, '../babel.config.js'),
},
},
{
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions packages/react-devtools-inline/src/backend.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/** @flow */

import Agent from 'src/backend/agent';
import Bridge from 'src/bridge';
import { initBackend } from 'src/backend';
import { installHook } from 'src/hook';
import setupNativeStyleEditor from 'src/backend/NativeStyleEditor/setupNativeStyleEditor';
import Agent from 'react-devtools-shared/src/backend/agent';
import Bridge from 'react-devtools-shared/src/bridge';
import { initBackend } from 'react-devtools-shared/src/backend';
import { installHook } from 'react-devtools-shared/src/hook';
import setupNativeStyleEditor from 'react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor';
import {
MESSAGE_TYPE_GET_SAVED_PREFERENCES,
MESSAGE_TYPE_SAVED_PREFERENCES,
Expand Down
14 changes: 7 additions & 7 deletions packages/react-devtools-inline/src/frontend.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/** @flow */

import React, { forwardRef } from 'react';
import Bridge from 'src/bridge';
import Store from 'src/devtools/store';
import DevTools from 'src/devtools/views/DevTools';
import { getSavedComponentFilters, getAppendComponentStack } from 'src/utils';
import Bridge from 'react-devtools-shared/src/bridge';
import Store from 'react-devtools-shared/src/devtools/store';
import DevTools from 'react-devtools-shared/src/devtools/views/DevTools';
import { getSavedComponentFilters, getAppendComponentStack } from 'react-devtools-shared/src/utils';
import {
MESSAGE_TYPE_GET_SAVED_PREFERENCES,
MESSAGE_TYPE_SAVED_PREFERENCES,
} from './constants';

import type { FrontendBridge } from 'src/bridge';
import type { Props } from 'src/devtools/views/DevTools';
import type { FrontendBridge } from 'react-devtools-shared/src/bridge';
import type { Props } from 'react-devtools-shared/src/devtools/views/DevTools';

export function initialize(
contentWindow: window
): React$AbstractComponent<Props, mixed> {
): React.AbstractComponent<Props, mixed> {
const onMessage = ({ data, source }) => {
if (source === 'react-devtools-content-script') {
// Ignore messages from the DevTools browser extension.
Expand Down
13 changes: 13 additions & 0 deletions packages/react-devtools-shared/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"private": true,
"name": "react-devtools-shared",
"version": "0.0.0",
"dependencies": {
"@reach/menu-button": "^0.1.17",
"@reach/tooltip": "^0.2.2",
"clipboard-js": "^0.3.6",
"lodash.throttle": "^4.1.1",
"memoize-one": "^3.1.1",
"react-virtualized-auto-sizer": "^1.0.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Bridge', () => {
let Bridge;

beforeEach(() => {
Bridge = require('src/bridge').default;
Bridge = require('react-devtools-shared/src/bridge').default;
});

it('should shutdown properly', () => {
Expand Down
Loading

0 comments on commit 08743b1

Please sign in to comment.