Skip to content

Commit 8abf156

Browse files
committed
3.0.1 accepted changes
1 parent 00f140b commit 8abf156

File tree

7 files changed

+28
-23
lines changed

7 files changed

+28
-23
lines changed

packages/react-scripts/lib/react-app.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
declare namespace NodeJS {
66
interface ProcessEnv {
7-
NODE_ENV: 'development' | 'production' | 'test';
8-
PUBLIC_URL: string;
7+
readonly NODE_ENV: 'development' | 'production' | 'test';
8+
readonly PUBLIC_URL: string;
99
}
1010
}
1111

@@ -42,7 +42,7 @@ declare module '*.webp' {
4242
declare module '*.svg' {
4343
import * as React from 'react';
4444

45-
export const ReactComponent: React.SFC<React.SVGProps<SVGSVGElement>>;
45+
export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
4646

4747
const src: string;
4848
export default src;

packages/react-scripts/scripts/eject.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,25 @@ function getGitStatus() {
3838
}
3939
}
4040

41+
function tryGitAdd(appPath) {
42+
try {
43+
spawnSync(
44+
'git',
45+
['add', path.join(appPath, 'config'), path.join(appPath, 'scripts')],
46+
{
47+
stdio: 'inherit',
48+
}
49+
);
50+
51+
return true;
52+
} catch (e) {
53+
return false;
54+
}
55+
}
56+
4157
console.log(
4258
chalk.cyan.bold(
43-
'NOTE: Create React App 2 supports TypeScript, Sass, CSS Modules and more without ejecting: ' +
59+
'NOTE: Create React App 2+ supports TypeScript, Sass, CSS Modules and more without ejecting: ' +
4460
'https://reactjs.org/blog/2018/10/01/create-react-app-v2.html'
4561
)
4662
);
@@ -310,6 +326,11 @@ inquirer
310326
console.log(green('Ejected successfully!'));
311327
console.log();
312328

329+
if (tryGitAdd(appPath)) {
330+
console.log(cyan('Staged ejected files for commit.'));
331+
console.log();
332+
}
333+
313334
console.log(
314335
green('Please consider sharing why you ejected in this survey:')
315336
);

packages/react-scripts/scripts/test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,16 @@ function isInMercurialRepository() {
5454
}
5555
}
5656

57-
// Watch unless on CI, in coverage mode, explicitly adding `--no-watch`,
58-
// or explicitly running all tests
57+
// Watch unless on CI or explicitly running all tests
5958
if (
6059
!process.env.CI &&
61-
argv.indexOf('--coverage') === -1 &&
62-
argv.indexOf('--no-watch') === -1 &&
6360
argv.indexOf('--watchAll') === -1
6461
) {
6562
// https://github.com/facebook/create-react-app/issues/5210
6663
const hasSourceControl = isInGitRepository() || isInMercurialRepository();
6764
argv.push(hasSourceControl ? '--watch' : '--watchAll');
6865
}
6966

70-
// Jest doesn't have this option so we'll remove it
71-
if (argv.indexOf('--no-watch') !== -1) {
72-
argv = argv.filter(arg => arg !== '--no-watch');
73-
}
74-
7567
// @remove-on-eject-begin
7668
// This is not necessary after eject because we embed config into package.json.
7769
const createJestConfig = require('./utils/createJestConfig');

packages/react-scripts/template-typescript/public/index.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6-
<meta
7-
name="viewport"
8-
content="width=device-width, initial-scale=1, shrink-to-fit=no"
9-
/>
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
107
<meta name="theme-color" content="#000000" />
118
<!--
129
manifest.json provides metadata used when your web app is installed on a

packages/react-scripts/template-typescript/src/index.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
body {
22
margin: 0;
3-
padding: 0;
43
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
54
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
65
sans-serif;

packages/react-scripts/template/public/index.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6-
<meta
7-
name="viewport"
8-
content="width=device-width, initial-scale=1, shrink-to-fit=no"
9-
/>
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
107
<meta name="theme-color" content="#000000" />
118
<!--
129
manifest.json provides metadata used when your web app is installed on a

packages/react-scripts/template/src/index.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
body {
22
margin: 0;
3-
padding: 0;
43
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
54
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
65
sans-serif;

0 commit comments

Comments
 (0)