Skip to content

Commit af16a17

Browse files
Merge branch 'next' into feature/serve-app-under-homepage
* 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 ...
2 parents 405f6db + b021bb4 commit af16a17

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+784
-182
lines changed

.github/ISSUE_TEMPLATE.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,18 @@
8585
### Environment
8686

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

99+
(paste the output of the command here)
101100

102101
### Steps to Reproduce
103102

CHANGELOG.md

+82
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,85 @@
1+
## 1.1.4 (April 3, 2018)
2+
3+
#### :bug: Bug Fix
4+
5+
* `react-dev-utils`
6+
7+
* [#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))
8+
9+
#### Committers: 1
10+
- Joe Haddad ([Timer](https://github.com/Timer))
11+
12+
### Migrating from 1.1.3 to 1.1.4
13+
14+
Inside any created project that has not been ejected, run:
15+
16+
```
17+
npm install --save --save-exact [email protected]
18+
```
19+
20+
or
21+
22+
```
23+
yarn add --exact [email protected]
24+
```
25+
26+
## 1.1.3 (April 3, 2018)
27+
28+
#### :bug: Bug Fix
29+
30+
* `react-scripts`
31+
32+
* [#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))
33+
34+
#### Committers: 1
35+
- Dan Abramov ([gaearon](https://github.com/gaearon))
36+
37+
### Migrating from 1.1.2 to 1.1.3
38+
39+
Inside any created project that has not been ejected, run:
40+
41+
```
42+
npm install --save --save-exact [email protected]
43+
```
44+
45+
or
46+
47+
```
48+
yarn add --exact [email protected]
49+
```
50+
51+
## 1.1.2 (April 3, 2018)
52+
53+
#### :bug: Bug Fix
54+
55+
* `react-scripts`
56+
57+
* [#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))
58+
59+
#### :memo: Documentation
60+
61+
* `react-scripts`
62+
63+
* [#4197](https://github.com/facebook/create-react-app/pull/4197) Add troubleshooting for Github Pages. ([@xnt](https://github.com/xnt))
64+
65+
#### Committers: 2
66+
- Lee Byron ([leebyron](https://github.com/leebyron))
67+
- Vicente Plata ([xnt](https://github.com/xnt))
68+
69+
### Migrating from 1.1.1 to 1.1.2
70+
71+
Inside any created project that has not been ejected, run:
72+
73+
```
74+
npm install --save --save-exact [email protected]
75+
```
76+
77+
or
78+
79+
```
80+
yarn add --exact [email protected]
81+
```
82+
183
## 1.1.1 (February 2, 2018)
284

385
#### :bug: Bug Fix

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,7 @@ We are grateful to the authors of existing related projects for their ideas and
224224
* [@eanplatter](https://github.com/eanplatter)
225225
* [@insin](https://github.com/insin)
226226
* [@mxstbr](https://github.com/mxstbr)
227+
228+
## License
229+
230+
Create React App is open source software [licensed as MIT](https://github.com/facebook/create-react-app/blob/master/LICENSE).

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"husky": "^0.13.2",
2525
"lerna": "2.6.0",
2626
"lerna-changelog": "^0.6.0",
27-
"lint-staged": "^3.3.1",
27+
"lint-staged": "^7.0.5",
2828
"meow": "^4.0.0",
2929
"multimatch": "^2.1.0",
3030
"prettier": "1.6.1",

packages/babel-plugin-named-asset-import/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"index.js"
1313
],
1414
"peerDependencies": {
15-
"@babel/core": "7.0.0-beta.42"
15+
"@babel/core": "7.0.0-beta.46"
1616
}
1717
}

packages/babel-preset-react-app/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,14 @@ module.exports = function(api, opts) {
9292
// don't work without it: https://github.com/babel/babel/issues/7215
9393
require('@babel/plugin-transform-destructuring').default,
9494
// class { handleClick = () => { } }
95-
require('@babel/plugin-proposal-class-properties').default,
95+
// Enable loose mode to use assignment instead of defineProperty
96+
// See discussion in https://github.com/facebook/create-react-app/issues/4263
97+
[
98+
require('@babel/plugin-proposal-class-properties').default,
99+
{
100+
loose: true,
101+
},
102+
],
96103
// The following two plugins use Object.assign directly, instead of Babel's
97104
// extends helper. Note that this assumes `Object.assign` is available.
98105
// { ...todo, completed: true }

packages/babel-preset-react-app/package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
"dependencies.js"
1313
],
1414
"dependencies": {
15-
"@babel/core": "7.0.0-beta.42",
16-
"@babel/plugin-proposal-class-properties": "7.0.0-beta.42",
17-
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.42",
18-
"@babel/plugin-syntax-dynamic-import": "7.0.0-beta.42",
19-
"@babel/plugin-transform-classes": "7.0.0-beta.42",
20-
"@babel/plugin-transform-destructuring": "7.0.0-beta.42",
21-
"@babel/plugin-transform-react-constant-elements": "7.0.0-beta.42",
22-
"@babel/plugin-transform-react-display-name": "7.0.0-beta.42",
23-
"@babel/plugin-transform-regenerator": "7.0.0-beta.42",
24-
"@babel/plugin-transform-runtime": "7.0.0-beta.42",
25-
"@babel/preset-env": "7.0.0-beta.42",
26-
"@babel/preset-flow": "7.0.0-beta.42",
27-
"@babel/preset-react": "7.0.0-beta.42",
15+
"@babel/core": "7.0.0-beta.46",
16+
"@babel/plugin-proposal-class-properties": "7.0.0-beta.46",
17+
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.46",
18+
"@babel/plugin-syntax-dynamic-import": "7.0.0-beta.46",
19+
"@babel/plugin-transform-classes": "7.0.0-beta.46",
20+
"@babel/plugin-transform-destructuring": "7.0.0-beta.46",
21+
"@babel/plugin-transform-react-constant-elements": "7.0.0-beta.46",
22+
"@babel/plugin-transform-react-display-name": "7.0.0-beta.46",
23+
"@babel/plugin-transform-regenerator": "7.0.0-beta.46",
24+
"@babel/plugin-transform-runtime": "7.0.0-beta.46",
25+
"@babel/preset-env": "7.0.0-beta.46",
26+
"@babel/preset-flow": "7.0.0-beta.46",
27+
"@babel/preset-react": "7.0.0-beta.46",
2828
"babel-plugin-macros": "2.0.0",
2929
"babel-plugin-transform-dynamic-import": "2.0.0",
3030
"babel-plugin-transform-react-remove-prop-types": "0.4.12"

packages/confusing-browser-globals/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"index.js"
1717
],
1818
"devDependencies": {
19-
"jest": "22.1.2"
19+
"jest": "22.4.1"
2020
}
2121
}

packages/create-react-app/createReactApp.js

+38-15
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,17 @@ const program = new commander.Command(packageJson.name)
8484
` A custom ${chalk.cyan('--scripts-version')} can be one of:`
8585
);
8686
console.log(` - a specific npm version: ${chalk.green('0.8.2')}`);
87+
console.log(` - a specific npm tag: ${chalk.green('@next')}`);
8788
console.log(
8889
` - a custom fork published on npm: ${chalk.green(
8990
'my-react-scripts'
9091
)}`
9192
);
93+
console.log(
94+
` - a local path relative to the current working directory: ${chalk.green(
95+
'file:../my-react-scripts'
96+
)}`
97+
);
9298
console.log(
9399
` - a .tgz archive: ${chalk.green(
94100
'https://mysite.com/my-react-scripts-0.8.2.tgz'
@@ -115,15 +121,28 @@ const program = new commander.Command(packageJson.name)
115121
})
116122
.parse(process.argv);
117123

124+
if (program.info) {
125+
console.log(chalk.bold('\nEnvironment Info:'));
126+
return envinfo
127+
.run(
128+
{
129+
System: ['OS', 'CPU'],
130+
Binaries: ['Node', 'npm', 'Yarn'],
131+
Browsers: ['Chrome', 'Edge', 'Internet Explorer', 'Firefox', 'Safari'],
132+
npmPackages: ['react', 'react-dom', 'react-scripts'],
133+
npmGlobalPackages: ['create-react-app'],
134+
},
135+
{
136+
clipboard: true,
137+
duplicates: true,
138+
showNotFound: true,
139+
}
140+
)
141+
.then(console.log)
142+
.then(() => console.log(chalk.green('Copied To Clipboard!\n')));
143+
}
144+
118145
if (typeof projectName === 'undefined') {
119-
if (program.info) {
120-
envinfo.print({
121-
packages: ['react', 'react-dom', 'react-scripts'],
122-
noNativeIDE: true,
123-
duplicates: true,
124-
});
125-
process.exit(0);
126-
}
127146
console.error('Please specify the project directory:');
128147
console.log(
129148
` ${chalk.cyan(program.name())} ${chalk.green('<project-directory>')}`
@@ -389,14 +408,18 @@ function getInstallPackage(version, originalDirectory) {
389408
const validSemver = semver.valid(version);
390409
if (validSemver) {
391410
packageToInstall += `@${validSemver}`;
392-
} else if (version && version.match(/^file:/)) {
393-
packageToInstall = `file:${path.resolve(
394-
originalDirectory,
395-
version.match(/^file:(.*)?$/)[1]
396-
)}`;
397411
} else if (version) {
398-
// for tar.gz or alternative paths
399-
packageToInstall = version;
412+
if (version[0] === '@') {
413+
packageToInstall += version;
414+
} else if (version.match(/^file:/)) {
415+
packageToInstall = `file:${path.resolve(
416+
originalDirectory,
417+
version.match(/^file:(.*)?$/)[1]
418+
)}`;
419+
} else {
420+
// for tar.gz or alternative paths
421+
packageToInstall = version;
422+
}
400423
}
401424
return packageToInstall;
402425
}

packages/create-react-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"chalk": "^1.1.3",
2525
"commander": "^2.9.0",
2626
"cross-spawn": "^4.0.0",
27-
"envinfo": "3.4.2",
27+
"envinfo": "5.4.0",
2828
"fs-extra": "^5.0.0",
2929
"hyperquest": "^2.1.2",
3030
"react-dev-utils": "^5.0.0",

packages/eslint-config-react-app/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ module.exports = {
131131
'no-unused-vars': [
132132
'warn',
133133
{
134-
args: 'all',
134+
args: 'none',
135135
ignoreRestSiblings: true,
136136
},
137137
],
@@ -186,6 +186,7 @@ module.exports = {
186186
'import/no-webpack-loader-syntax': 'error',
187187

188188
// https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
189+
'react/forbid-foreign-prop-types': ['warn', { allowInPropTypes: true }],
189190
'react/jsx-no-comment-textnodes': 'warn',
190191
'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }],
191192
'react/jsx-no-target-blank': 'warn',

packages/eslint-config-react-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"eslint-plugin-flowtype": "^2.34.1",
1717
"eslint-plugin-import": "^2.6.0",
1818
"eslint-plugin-jsx-a11y": "^6.0.2",
19-
"eslint-plugin-react": "^7.1.0"
19+
"eslint-plugin-react": "^7.7.0"
2020
},
2121
"dependencies": {
2222
"confusing-browser-globals": "^1.0.0"

packages/react-dev-utils/ModuleScopePlugin.js

+17-9
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const path = require('path');
1212

1313
class ModuleScopePlugin {
1414
constructor(appSrc, allowedFiles = []) {
15-
this.appSrc = appSrc;
15+
this.appSrcs = Array.isArray(appSrc) ? appSrc : [appSrc];
1616
this.allowedFiles = new Set(allowedFiles);
1717
}
1818

1919
apply(resolver) {
20-
const { appSrc } = this;
20+
const { appSrcs } = this;
2121
resolver.plugin('file', (request, callback) => {
2222
// Unknown issuer, probably webpack internals
2323
if (!request.context.issuer) {
@@ -34,9 +34,13 @@ class ModuleScopePlugin {
3434
}
3535
// Resolve the issuer from our appSrc and make sure it's one of our files
3636
// Maybe an indexOf === 0 would be better?
37-
const relative = path.relative(appSrc, request.context.issuer);
38-
// If it's not in src/ or a subdirectory, not our request!
39-
if (relative.startsWith('../') || relative.startsWith('..\\')) {
37+
if (
38+
appSrcs.every(appSrc => {
39+
const relative = path.relative(appSrc, request.context.issuer);
40+
// If it's not in one of our app src or a subdirectory, not our request!
41+
return relative.startsWith('../') || relative.startsWith('..\\');
42+
})
43+
) {
4044
return callback();
4145
}
4246
const requestFullPath = path.resolve(
@@ -47,11 +51,15 @@ class ModuleScopePlugin {
4751
return callback();
4852
}
4953
// Find path from src to the requested file
50-
// Error if in a parent directory of src/
51-
const requestRelative = path.relative(appSrc, requestFullPath);
54+
// Error if in a parent directory of all given appSrcs
5255
if (
53-
requestRelative.startsWith('../') ||
54-
requestRelative.startsWith('..\\')
56+
appSrcs.every(appSrc => {
57+
const requestRelative = path.relative(appSrc, requestFullPath);
58+
return (
59+
requestRelative.startsWith('../') ||
60+
requestRelative.startsWith('..\\')
61+
);
62+
})
5563
) {
5664
callback(
5765
new Error(

0 commit comments

Comments
 (0)