Skip to content

Commit baceeb2

Browse files
committed
restoring wptheme lines
1 parent b0f0863 commit baceeb2

File tree

9 files changed

+64
-16
lines changed

9 files changed

+64
-16
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ declare module '*.svg' {
4949
}
5050

5151
declare module '*.module.css' {
52-
const classes: { [key: string]: string };
52+
const classes: { readonly [key: string]: string };
5353
export default classes;
5454
}
5555

5656
declare module '*.module.scss' {
57-
const classes: { [key: string]: string };
57+
const classes: { readonly [key: string]: string };
5858
export default classes;
5959
}
6060

6161
declare module '*.module.sass' {
62-
const classes: { [key: string]: string };
62+
const classes: { readonly [key: string]: string };
6363
export default classes;
6464
}

packages/react-scripts/scripts/eject.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ inquirer
187187
}
188188
Object.keys(ownPackage.dependencies).forEach(key => {
189189
// For some reason optionalDependencies end up in dependencies after install
190-
if (ownPackage.optionalDependencies[key]) {
190+
if (
191+
ownPackage.optionalDependencies &&
192+
ownPackage.optionalDependencies[key]
193+
) {
191194
return;
192195
}
193196
console.log(` Adding ${cyan(key)} to dependencies`);
@@ -236,10 +239,12 @@ inquirer
236239
};
237240

238241
// Add ESlint config
239-
console.log(` Adding ${cyan('ESLint')} configuration`);
240-
appPackage.eslintConfig = {
241-
extends: 'react-app',
242-
};
242+
if (!appPackage.eslintConfig) {
243+
console.log(` Adding ${cyan('ESLint')} configuration`);
244+
appPackage.eslintConfig = {
245+
extends: 'react-app',
246+
};
247+
}
243248

244249
fs.writeFileSync(
245250
path.join(appPath, 'package.json'),

packages/react-scripts/scripts/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ function isInMercurialRepository() {
5757
// Watch unless on CI or explicitly running all tests
5858
if (
5959
!process.env.CI &&
60-
argv.indexOf('--watchAll') === -1
60+
argv.indexOf('--watchAll') === -1 &&
61+
argv.indexOf('--watchAll=false') === -1
6162
) {
6263
// https://github.com/facebook/create-react-app/issues/5210
6364
const hasSourceControl = isInGitRepository() || isInMercurialRepository();

packages/react-scripts/scripts/utils/createJestConfig.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ module.exports = (resolve, rootDir, isEjecting) => {
2323
: undefined;
2424

2525
const config = {
26+
roots: ['<rootDir>/src'],
27+
2628
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!src/**/*.d.ts'],
2729

2830
setupFiles: [
@@ -71,18 +73,29 @@ module.exports = (resolve, rootDir, isEjecting) => {
7173
'collectCoverageFrom',
7274
'coverageReporters',
7375
'coverageThreshold',
76+
'coveragePathIgnorePatterns',
7477
'extraGlobals',
7578
'globalSetup',
7679
'globalTeardown',
80+
'moduleNameMapper',
7781
'resetMocks',
7882
'resetModules',
7983
'snapshotSerializers',
84+
'transform',
85+
'transformIgnorePatterns',
8086
'watchPathIgnorePatterns',
8187
];
8288
if (overrides) {
8389
supportedKeys.forEach(key => {
84-
if (overrides.hasOwnProperty(key)) {
85-
config[key] = overrides[key];
90+
if (Object.prototype.hasOwnProperty.call(overrides, key)) {
91+
if (Array.isArray(config[key]) || typeof config[key] !== 'object') {
92+
// for arrays or primitive types, directly override the config key
93+
config[key] = overrides[key];
94+
} else {
95+
// for object types, extend gracefully
96+
config[key] = Object.assign({}, config[key], overrides[key]);
97+
}
98+
8699
delete overrides[key];
87100
}
88101
});

packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,8 @@ function verifyTypeScriptSetup() {
125125
isolatedModules: { value: true, reason: 'implementation limitation' },
126126
noEmit: { value: true },
127127
jsx: {
128-
parsedValue: ts.JsxEmit.Preserve,
129-
value: 'preserve',
130-
reason: 'JSX is compiled by Babel',
128+
parsedValue: ts.JsxEmit.React,
129+
suggested: 'react',
131130
},
132131
paths: { value: undefined, reason: 'aliased imports are not supported' },
133132
};

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="logo192.png" />
813
<!--
914
manifest.json provides metadata used when your web app is installed on a
1015
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/

packages/react-scripts/template-typescript/public/manifest.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66
"src": "favicon.ico",
77
"sizes": "64x64 32x32 24x24 16x16",
88
"type": "image/x-icon"
9-
}
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
1020
],
1121
"start_url": ".",
1222
"display": "standalone",

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="logo192.png" />
813
<!--
914
manifest.json provides metadata used when your web app is installed on a
1015
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/

packages/react-scripts/template/public/manifest.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66
"src": "favicon.ico",
77
"sizes": "64x64 32x32 24x24 16x16",
88
"type": "image/x-icon"
9-
}
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
1020
],
1121
"start_url": ".",
1222
"display": "standalone",

0 commit comments

Comments
 (0)