Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/next' into next
Browse files Browse the repository at this point in the history
* upstream/next: (35 commits)
  Update envinfo and issue template (facebook#4375)
  Update sass-loader to 7.0.1 (facebook#4376)
  Support package distribution tags (facebook#4350)
  fix broken css module support in prod (facebook#4361)
  Bumped jest version to 22.4.1 (facebook#4362)
  bump babel 7 to beta 46
  bump lint-staged to node 10 compatible version
  documentation: Added License to the README.md (facebook#4294)
  Bump `fsevents`. (facebook#4331)
  Fix typo in e2e-simple.sh comment (facebook#4323)
  Add Sass loader (facebook#4195)
  Fix some typos in README.md (facebook#4286)
  Added learnstorybook.com to Storybook links (facebook#4298)
  Document multiple build environments via `env-cmd` facebook#4071 (facebook#4117)
  Fixed link to CSS imports blog post
  Update CSS Modules localIndetName (facebook#4192)
  Enable loose mode for `class-properties` (facebook#4248)
  bump babel 7 beta (facebook#4253)
  Small typo fix facebook#4217
  Changelog for 1.1.4
  ...
  • Loading branch information
kellyrmilligan committed May 2, 2018
2 parents e8b0d89 + 7b2eae1 commit b021bb4
Show file tree
Hide file tree
Showing 47 changed files with 784 additions and 182 deletions.
17 changes: 8 additions & 9 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,18 @@
### Environment

<!--
Please fill in all the relevant fields by running these commands in terminal.
-->
To help identify if a problem is specific to a platform, browser, or module version, information about your environment is required.
This enables the maintainers quickly reproduce the issue and give feedback.
1. `node -v`:
2. `npm -v`:
3. `yarn --version` (if you use Yarn):
4. `npm ls react-scripts` (if you haven’t ejected):
Run the following command in your React app's folder in terminal.
Note: The result is copied to your clipboard directly.
Then, specify:
`npx create-react-app --info`
1. Operating system:
2. Browser and version (if relevant):
Paste the output of the command in the section below.
-->

(paste the output of the command here)

### Steps to Reproduce

Expand Down
82 changes: 82 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,85 @@
## 1.1.4 (April 3, 2018)

#### :bug: Bug Fix

* `react-dev-utils`

* [#4250](https://github.com/facebook/create-react-app/pull/4250) Upgrade `detect-port-alt` to fix [#4189](https://github.com/facebook/create-react-app/issues/4189). ([@Timer](https://github.com/Timer))

#### Committers: 1
- Joe Haddad ([Timer](https://github.com/Timer))

### Migrating from 1.1.3 to 1.1.4

Inside any created project that has not been ejected, run:

```
npm install --save --save-exact [email protected]
```

or

```
yarn add --exact [email protected]
```

## 1.1.3 (April 3, 2018)

#### :bug: Bug Fix

* `react-scripts`

* [#4247](https://github.com/facebook/create-react-app/pull/4247) Fix `environment.dispose is not a function` error caused by a Jest bug. ([@gaearon](https://github.com/gaearon))

#### Committers: 1
- Dan Abramov ([gaearon](https://github.com/gaearon))

### Migrating from 1.1.2 to 1.1.3

Inside any created project that has not been ejected, run:

```
npm install --save --save-exact [email protected]
```

or

```
yarn add --exact [email protected]
```

## 1.1.2 (April 3, 2018)

#### :bug: Bug Fix

* `react-scripts`

* [#4085](https://github.com/facebook/create-react-app/pull/4085) Resolve `.js` before `.mjs` files to unbreak dependencies with native ESM support. ([@leebyron](https://github.com/leebyron))

#### :memo: Documentation

* `react-scripts`

* [#4197](https://github.com/facebook/create-react-app/pull/4197) Add troubleshooting for Github Pages. ([@xnt](https://github.com/xnt))

#### Committers: 2
- Lee Byron ([leebyron](https://github.com/leebyron))
- Vicente Plata ([xnt](https://github.com/xnt))

### Migrating from 1.1.1 to 1.1.2

Inside any created project that has not been ejected, run:

```
npm install --save --save-exact [email protected]
```

or

```
yarn add --exact [email protected]
```

## 1.1.1 (February 2, 2018)

#### :bug: Bug Fix
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,7 @@ We are grateful to the authors of existing related projects for their ideas and
* [@eanplatter](https://github.com/eanplatter)
* [@insin](https://github.com/insin)
* [@mxstbr](https://github.com/mxstbr)

## License

Create React App is open source software [licensed as MIT](https://github.com/facebook/create-react-app/blob/master/LICENSE).
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"husky": "^0.13.2",
"lerna": "2.6.0",
"lerna-changelog": "^0.6.0",
"lint-staged": "^3.3.1",
"lint-staged": "^7.0.5",
"meow": "^4.0.0",
"multimatch": "^2.1.0",
"prettier": "1.6.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-named-asset-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"index.js"
],
"peerDependencies": {
"@babel/core": "7.0.0-beta.42"
"@babel/core": "7.0.0-beta.46"
}
}
9 changes: 8 additions & 1 deletion packages/babel-preset-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ module.exports = function(api, opts) {
// don't work without it: https://github.com/babel/babel/issues/7215
require('@babel/plugin-transform-destructuring').default,
// class { handleClick = () => { } }
require('@babel/plugin-proposal-class-properties').default,
// Enable loose mode to use assignment instead of defineProperty
// See discussion in https://github.com/facebook/create-react-app/issues/4263
[
require('@babel/plugin-proposal-class-properties').default,
{
loose: true,
},
],
// The following two plugins use Object.assign directly, instead of Babel's
// extends helper. Note that this assumes `Object.assign` is available.
// { ...todo, completed: true }
Expand Down
26 changes: 13 additions & 13 deletions packages/babel-preset-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
"dependencies.js"
],
"dependencies": {
"@babel/core": "7.0.0-beta.42",
"@babel/plugin-proposal-class-properties": "7.0.0-beta.42",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.42",
"@babel/plugin-syntax-dynamic-import": "7.0.0-beta.42",
"@babel/plugin-transform-classes": "7.0.0-beta.42",
"@babel/plugin-transform-destructuring": "7.0.0-beta.42",
"@babel/plugin-transform-react-constant-elements": "7.0.0-beta.42",
"@babel/plugin-transform-react-display-name": "7.0.0-beta.42",
"@babel/plugin-transform-regenerator": "7.0.0-beta.42",
"@babel/plugin-transform-runtime": "7.0.0-beta.42",
"@babel/preset-env": "7.0.0-beta.42",
"@babel/preset-flow": "7.0.0-beta.42",
"@babel/preset-react": "7.0.0-beta.42",
"@babel/core": "7.0.0-beta.46",
"@babel/plugin-proposal-class-properties": "7.0.0-beta.46",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.46",
"@babel/plugin-syntax-dynamic-import": "7.0.0-beta.46",
"@babel/plugin-transform-classes": "7.0.0-beta.46",
"@babel/plugin-transform-destructuring": "7.0.0-beta.46",
"@babel/plugin-transform-react-constant-elements": "7.0.0-beta.46",
"@babel/plugin-transform-react-display-name": "7.0.0-beta.46",
"@babel/plugin-transform-regenerator": "7.0.0-beta.46",
"@babel/plugin-transform-runtime": "7.0.0-beta.46",
"@babel/preset-env": "7.0.0-beta.46",
"@babel/preset-flow": "7.0.0-beta.46",
"@babel/preset-react": "7.0.0-beta.46",
"babel-plugin-macros": "2.0.0",
"babel-plugin-transform-dynamic-import": "2.0.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.12"
Expand Down
2 changes: 1 addition & 1 deletion packages/confusing-browser-globals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"index.js"
],
"devDependencies": {
"jest": "22.1.2"
"jest": "22.4.1"
}
}
53 changes: 38 additions & 15 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,17 @@ const program = new commander.Command(packageJson.name)
` A custom ${chalk.cyan('--scripts-version')} can be one of:`
);
console.log(` - a specific npm version: ${chalk.green('0.8.2')}`);
console.log(` - a specific npm tag: ${chalk.green('@next')}`);
console.log(
` - a custom fork published on npm: ${chalk.green(
'my-react-scripts'
)}`
);
console.log(
` - a local path relative to the current working directory: ${chalk.green(
'file:../my-react-scripts'
)}`
);
console.log(
` - a .tgz archive: ${chalk.green(
'https://mysite.com/my-react-scripts-0.8.2.tgz'
Expand All @@ -115,15 +121,28 @@ const program = new commander.Command(packageJson.name)
})
.parse(process.argv);

if (program.info) {
console.log(chalk.bold('\nEnvironment Info:'));
return envinfo
.run(
{
System: ['OS', 'CPU'],
Binaries: ['Node', 'npm', 'Yarn'],
Browsers: ['Chrome', 'Edge', 'Internet Explorer', 'Firefox', 'Safari'],
npmPackages: ['react', 'react-dom', 'react-scripts'],
npmGlobalPackages: ['create-react-app'],
},
{
clipboard: true,
duplicates: true,
showNotFound: true,
}
)
.then(console.log)
.then(() => console.log(chalk.green('Copied To Clipboard!\n')));
}

if (typeof projectName === 'undefined') {
if (program.info) {
envinfo.print({
packages: ['react', 'react-dom', 'react-scripts'],
noNativeIDE: true,
duplicates: true,
});
process.exit(0);
}
console.error('Please specify the project directory:');
console.log(
` ${chalk.cyan(program.name())} ${chalk.green('<project-directory>')}`
Expand Down Expand Up @@ -389,14 +408,18 @@ function getInstallPackage(version, originalDirectory) {
const validSemver = semver.valid(version);
if (validSemver) {
packageToInstall += `@${validSemver}`;
} else if (version && version.match(/^file:/)) {
packageToInstall = `file:${path.resolve(
originalDirectory,
version.match(/^file:(.*)?$/)[1]
)}`;
} else if (version) {
// for tar.gz or alternative paths
packageToInstall = version;
if (version[0] === '@') {
packageToInstall += version;
} else if (version.match(/^file:/)) {
packageToInstall = `file:${path.resolve(
originalDirectory,
version.match(/^file:(.*)?$/)[1]
)}`;
} else {
// for tar.gz or alternative paths
packageToInstall = version;
}
}
return packageToInstall;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"chalk": "^1.1.3",
"commander": "^2.9.0",
"cross-spawn": "^4.0.0",
"envinfo": "3.4.2",
"envinfo": "5.4.0",
"fs-extra": "^5.0.0",
"hyperquest": "^2.1.2",
"react-dev-utils": "^5.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module.exports = {
'no-unused-vars': [
'warn',
{
args: 'all',
args: 'none',
ignoreRestSiblings: true,
},
],
Expand Down Expand Up @@ -186,6 +186,7 @@ module.exports = {
'import/no-webpack-loader-syntax': 'error',

// https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
'react/forbid-foreign-prop-types': ['warn', { allowInPropTypes: true }],
'react/jsx-no-comment-textnodes': 'warn',
'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }],
'react/jsx-no-target-blank': 'warn',
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"eslint-plugin-flowtype": "^2.34.1",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.1.0"
"eslint-plugin-react": "^7.7.0"
},
"dependencies": {
"confusing-browser-globals": "^1.0.0"
Expand Down
26 changes: 17 additions & 9 deletions packages/react-dev-utils/ModuleScopePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const path = require('path');

class ModuleScopePlugin {
constructor(appSrc, allowedFiles = []) {
this.appSrc = appSrc;
this.appSrcs = Array.isArray(appSrc) ? appSrc : [appSrc];
this.allowedFiles = new Set(allowedFiles);
}

apply(resolver) {
const { appSrc } = this;
const { appSrcs } = this;
resolver.plugin('file', (request, callback) => {
// Unknown issuer, probably webpack internals
if (!request.context.issuer) {
Expand All @@ -34,9 +34,13 @@ class ModuleScopePlugin {
}
// Resolve the issuer from our appSrc and make sure it's one of our files
// Maybe an indexOf === 0 would be better?
const relative = path.relative(appSrc, request.context.issuer);
// If it's not in src/ or a subdirectory, not our request!
if (relative.startsWith('../') || relative.startsWith('..\\')) {
if (
appSrcs.every(appSrc => {
const relative = path.relative(appSrc, request.context.issuer);
// If it's not in one of our app src or a subdirectory, not our request!
return relative.startsWith('../') || relative.startsWith('..\\');
})
) {
return callback();
}
const requestFullPath = path.resolve(
Expand All @@ -47,11 +51,15 @@ class ModuleScopePlugin {
return callback();
}
// Find path from src to the requested file
// Error if in a parent directory of src/
const requestRelative = path.relative(appSrc, requestFullPath);
// Error if in a parent directory of all given appSrcs
if (
requestRelative.startsWith('../') ||
requestRelative.startsWith('..\\')
appSrcs.every(appSrc => {
const requestRelative = path.relative(appSrc, requestFullPath);
return (
requestRelative.startsWith('../') ||
requestRelative.startsWith('..\\')
);
})
) {
callback(
new Error(
Expand Down
Loading

0 comments on commit b021bb4

Please sign in to comment.