Skip to content

Commit

Permalink
Cleaned up some extnesions build script stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Aug 14, 2019
1 parent 380da5f commit 441d014
Show file tree
Hide file tree
Showing 18 changed files with 2,598 additions and 97 deletions.
5 changes: 4 additions & 1 deletion packages/react-devtools-core/webpack.backend.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const {resolve} = require('path');
const {DefinePlugin} = require('webpack');
const {getGitHubURL, getVersionString} = require('../../shells/utils');
const {
getGitHubURL,
getVersionString,
} = require('react-devtools-extensions/utils');

const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
Expand Down
5 changes: 4 additions & 1 deletion packages/react-devtools-core/webpack.standalone.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const {resolve} = require('path');
const {DefinePlugin} = require('webpack');
const {getGitHubURL, getVersionString} = require('../../shells/utils');
const {
getGitHubURL,
getVersionString,
} = require('react-devtools-extensions/utils');

const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
Expand Down
24 changes: 9 additions & 15 deletions packages/react-devtools-extensions/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
This repo is a work-in-progress rewrite of the [React DevTools extension](https://github.com/facebook/react-devtools). A demo of the beta extension can be found online at [react-devtools-experimental.now.sh](https://react-devtools-experimental.now.sh/).
This is the source code for the React DevTools browser extension.

# Installation

Installation instructions are available online as well:
* [Chrome](https://react-devtools-experimental-chrome.now.sh/)
* [Firefox](https://react-devtools-experimental-firefox.now.sh/)
The easiest way to install this extension is as a browser add-on:
* [Chrome web store](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
* [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/)

Or you can build and install from source:
```sh
git clone git@github.com:bvaughn/react-devtools-experimental.git

cd react-devtools-experimental
# Build

You can also build and install from source:
```sh
yarn install

yarn build:extension:chrome # builds at "shells/browser/chrome/build"
yarn build:extension:firefox # builds at "shells/browser/firefox/build"
yarn build:extension:chrome # builds at "packages/react-devtools-extensions/chrome/build"
yarn build:extension:firefox # builds at "packages/react-devtools-extensions/firefox/build"
```

# Support

As this extension is in a beta period, it is not officially supported. However if you find a bug, we'd appreciate you reporting it as a [GitHub issue](https://github.com/bvaughn/react-devtools-experimental/issues/new) with repro instructions.
4 changes: 2 additions & 2 deletions packages/react-devtools-extensions/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const chromeManifest = require('./shells/browser/chrome/manifest.json');
const firefoxManifest = require('./shells/browser/firefox/manifest.json');
const chromeManifest = require('./chrome/manifest.json');
const firefoxManifest = require('./firefox/manifest.json');

const minChromeVersion = parseInt(chromeManifest.minimum_chrome_version, 10);
const minFirefoxVersion = parseInt(
Expand Down
3 changes: 1 addition & 2 deletions packages/react-devtools-extensions/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {execSync} = require('child_process');
const {readFileSync, writeFileSync, createWriteStream} = require('fs');
const {copy, ensureDir, move, remove} = require('fs-extra');
const {join} = require('path');
const {getGitCommit} = require('../../utils');
const {getGitCommit} = require('./utils');

// These files are copied along with Webpack-bundled files
// to produce the final web extension
Expand All @@ -27,7 +27,6 @@ const build = async (tempPath, manifestPath) => {
__dirname,
'..',
'..',
'..',
'node_modules',
'.bin',
'webpack',
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/chrome/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {execSync} = require('child_process');
const {existsSync} = require('fs');
const {isAbsolute, join, relative} = require('path');
const {argv} = require('yargs');
const build = require('../shared/build');
const build = require('../build');

const main = async () => {
const {crx, keyPath} = argv;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/chrome/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict';

const deploy = require('../shared/deploy');
const deploy = require('../deploy');

const main = async () => await deploy('chrome');

Expand Down
4 changes: 2 additions & 2 deletions packages/react-devtools-extensions/deploy.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h3>
</h3>

<p>
This is a preview build of an <a href="https://github.com/bvaughn/react-devtools-experimental">unreleased DevTools extension</a>.
This is a preview build of an <a href="https://github.com/facebook/react/tree/master/packages/react-devtools-extensions">unreleased DevTools extension</a>.
It has no developer support.
</p>

Expand All @@ -34,7 +34,7 @@ <h2>Installation instructions</h2>

<h2>Bug reports</h2>
<p>
Please report bugs as <a href="https://github.com/bvaughn/react-devtools-experimental/issues/new?labels=bug">GitHub issues</a>.
Please report bugs as <a href="https://github.com/facebook/react/issues/new?labels=Component:%20Developer%20Tools">GitHub issues</a>.
Please include all of the info required to reproduce the bug (e.g. links, code, instructions).
</p>

Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {readFileSync, writeFileSync} = require('fs');
const {join} = require('path');

const main = async buildId => {
const root = join(__dirname, '..', buildId);
const root = join(__dirname, buildId);
const buildPath = join(root, 'build');

execSync(`node ${join(root, './build')}`, {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/firefox/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'use strict';

const chalk = require('chalk');
const build = require('../shared/build');
const build = require('../build');

const main = async () => {
await build('firefox');
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/firefox/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict';

const deploy = require('../shared/deploy');
const deploy = require('../deploy');

const main = async () => await deploy('firefox');

Expand Down
11 changes: 10 additions & 1 deletion packages/react-devtools-extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@

"name": "react-devtools-extensions",
"version": "0.0.0",
"private": true
"private": true,
"devDependencies": {
"babel-loader": "^8.0.4",
"css-loader": "^1.0.1",
"raw-loader": "^3.1.0",
"style-loader": "^0.23.1",
"webpack": "^4.26.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.3.1"
}
}
4 changes: 3 additions & 1 deletion packages/react-devtools-extensions/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ function getGitHubURL() {

function getVersionString() {
const packageVersion = JSON.parse(
readFileSync(resolve(__dirname, '../package.json')),
readFileSync(
resolve(__dirname, '..', 'react-devtools-core', './package.json'),
),
).version;

const commit = getGitCommit();
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/webpack.backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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
5 changes: 4 additions & 1 deletion packages/react-devtools-inline/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const {resolve} = require('path');
const {DefinePlugin} = require('webpack');
const {getGitHubURL, getVersionString} = require('../../shells/utils');
const {
getGitHubURL,
getVersionString,
} = require('react-devtools-extensions/utils');

const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
Expand Down
5 changes: 4 additions & 1 deletion packages/react-devtools-shell/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const {resolve} = require('path');
const {DefinePlugin} = require('webpack');
const {getGitHubURL, getVersionString} = require('../utils');
const {
getGitHubURL,
getVersionString,
} = require('react-devtools-extensions/utils');

const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
Expand Down
Loading

0 comments on commit 441d014

Please sign in to comment.