mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Cleaned up some extnesions build script stuff
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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:
|
||||
# Build
|
||||
|
||||
You can also build and install from source:
|
||||
```sh
|
||||
git clone git@github.com:bvaughn/react-devtools-experimental.git
|
||||
|
||||
cd react-devtools-experimental
|
||||
|
||||
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.
|
||||
@@ -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(
|
||||
|
||||
3
packages/react-devtools-extensions/build.js
vendored
3
packages/react-devtools-extensions/build.js
vendored
@@ -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
|
||||
@@ -27,7 +27,6 @@ const build = async (tempPath, manifestPath) => {
|
||||
__dirname,
|
||||
'..',
|
||||
'..',
|
||||
'..',
|
||||
'node_modules',
|
||||
'.bin',
|
||||
'webpack',
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const deploy = require('../shared/deploy');
|
||||
const deploy = require('../deploy');
|
||||
|
||||
const main = async () => await deploy('chrome');
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</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>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
2
packages/react-devtools-extensions/deploy.js
vendored
2
packages/react-devtools-extensions/deploy.js
vendored
@@ -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')}`, {
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const deploy = require('../shared/deploy');
|
||||
const deploy = require('../deploy');
|
||||
|
||||
const main = async () => await deploy('firefox');
|
||||
|
||||
|
||||
@@ -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
packages/react-devtools-extensions/utils.js
vendored
4
packages/react-devtools-extensions/utils.js
vendored
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user