Skip to content

Commit 9d895db

Browse files
committed
init.js and package.json
1 parent 36a0d47 commit 9d895db

File tree

3 files changed

+65
-72
lines changed

3 files changed

+65
-72
lines changed

packages/react-scripts/cra-original-package.json

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scripts",
3-
"version": "3.3.0",
3+
"version": "3.3.1",
44
"description": "Configuration and scripts for Create React App.",
55
"repository": {
66
"type": "git",
@@ -28,62 +28,62 @@
2828
},
2929
"types": "./lib/react-app.d.ts",
3030
"dependencies": {
31-
"@babel/core": "7.7.4",
31+
"@babel/core": "7.8.4",
3232
"@svgr/webpack": "4.3.3",
33-
"@typescript-eslint/eslint-plugin": "^2.8.0",
34-
"@typescript-eslint/parser": "^2.8.0",
33+
"@typescript-eslint/eslint-plugin": "^2.10.0",
34+
"@typescript-eslint/parser": "^2.10.0",
3535
"babel-eslint": "10.0.3",
3636
"babel-jest": "^24.9.0",
3737
"babel-loader": "8.0.6",
38-
"babel-plugin-named-asset-import": "^0.3.5",
39-
"babel-preset-react-app": "^9.1.0",
38+
"babel-plugin-named-asset-import": "^0.3.6",
39+
"babel-preset-react-app": "^9.1.1",
4040
"camelcase": "^5.3.1",
41-
"case-sensitive-paths-webpack-plugin": "2.2.0",
42-
"css-loader": "3.2.0",
41+
"case-sensitive-paths-webpack-plugin": "2.3.0",
42+
"css-loader": "3.4.2",
4343
"dotenv": "8.2.0",
4444
"dotenv-expand": "5.1.0",
4545
"eslint": "^6.6.0",
46-
"eslint-config-react-app": "^5.1.0",
47-
"eslint-loader": "3.0.2",
48-
"eslint-plugin-flowtype": "3.13.0",
49-
"eslint-plugin-import": "2.18.2",
46+
"eslint-config-react-app": "^5.2.0",
47+
"eslint-loader": "3.0.3",
48+
"eslint-plugin-flowtype": "4.6.0",
49+
"eslint-plugin-import": "2.20.0",
5050
"eslint-plugin-jsx-a11y": "6.2.3",
51-
"eslint-plugin-react": "7.16.0",
51+
"eslint-plugin-react": "7.18.0",
5252
"eslint-plugin-react-hooks": "^1.6.1",
5353
"file-loader": "4.3.0",
5454
"fs-extra": "^8.1.0",
55-
"html-webpack-plugin": "4.0.0-beta.5",
55+
"html-webpack-plugin": "4.0.0-beta.11",
5656
"identity-obj-proxy": "3.0.0",
5757
"jest": "24.9.0",
58-
"jest-environment-jsdom-fourteen": "0.1.0",
58+
"jest-environment-jsdom-fourteen": "1.0.1",
5959
"jest-resolve": "24.9.0",
6060
"jest-watch-typeahead": "0.4.2",
61-
"mini-css-extract-plugin": "0.8.0",
61+
"mini-css-extract-plugin": "0.9.0",
6262
"optimize-css-assets-webpack-plugin": "5.0.3",
63-
"pnp-webpack-plugin": "1.5.0",
63+
"pnp-webpack-plugin": "1.6.0",
6464
"postcss-flexbugs-fixes": "4.1.0",
6565
"postcss-loader": "3.0.0",
6666
"postcss-normalize": "8.0.1",
6767
"postcss-preset-env": "6.7.0",
6868
"postcss-safe-parser": "4.0.1",
69-
"react-app-polyfill": "^1.0.5",
70-
"react-dev-utils": "^10.0.0",
71-
"resolve": "1.12.2",
69+
"react-app-polyfill": "^1.0.6",
70+
"react-dev-utils": "^10.1.0",
71+
"resolve": "1.15.0",
7272
"resolve-url-loader": "3.1.1",
73-
"sass-loader": "8.0.0",
73+
"sass-loader": "8.0.2",
7474
"semver": "6.3.0",
75-
"style-loader": "1.0.0",
76-
"terser-webpack-plugin": "2.2.1",
75+
"style-loader": "1.1.3",
76+
"terser-webpack-plugin": "2.3.4",
7777
"ts-pnp": "1.1.5",
7878
"url-loader": "2.3.0",
79-
"webpack": "4.41.2",
80-
"webpack-dev-server": "3.9.0",
79+
"webpack": "4.41.5",
80+
"webpack-dev-server": "3.10.1",
8181
"webpack-manifest-plugin": "2.2.0",
8282
"workbox-webpack-plugin": "4.3.1"
8383
},
8484
"devDependencies": {
85-
"react": "^16.11.0",
86-
"react-dom": "^16.11.0"
85+
"react": "^16.12.0",
86+
"react-dom": "^16.12.0"
8787
},
8888
"optionalDependencies": {
8989
"fsevents": "2.1.2"
@@ -97,11 +97,7 @@
9797
}
9898
},
9999
"browserslist": {
100-
"production": [
101-
">0.2%",
102-
"not dead",
103-
"not op_mini all"
104-
],
100+
"production": [">0.2%", "not dead", "not op_mini all"],
105101
"development": [
106102
"last 1 chrome version",
107103
"last 1 firefox version",

packages/react-scripts/package.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devloco/react-scripts-wptheme",
3-
"version": "3.3.0-wp.11",
3+
"version": "3.3.1-wp.1",
44
"description": "Configuration and scripts for Create React WP Theme.",
55
"repository": {
66
"type": "git",
@@ -42,63 +42,63 @@
4242
},
4343
"types": "./lib/react-app.d.ts",
4444
"dependencies": {
45-
"@babel/core": "7.7.4",
45+
"@babel/core": "7.8.4",
4646
"@svgr/webpack": "4.3.3",
47-
"@typescript-eslint/eslint-plugin": "^2.8.0",
48-
"@typescript-eslint/parser": "^2.8.0",
47+
"@typescript-eslint/eslint-plugin": "^2.10.0",
48+
"@typescript-eslint/parser": "^2.10.0",
4949
"babel-eslint": "10.0.3",
5050
"babel-jest": "^24.9.0",
5151
"babel-loader": "8.0.6",
52-
"babel-plugin-named-asset-import": "^0.3.5",
53-
"babel-preset-react-app": "^9.1.0",
52+
"babel-plugin-named-asset-import": "^0.3.6",
53+
"babel-preset-react-app": "^9.1.1",
5454
"camelcase": "^5.3.1",
55-
"case-sensitive-paths-webpack-plugin": "2.2.0",
56-
"css-loader": "3.2.0",
55+
"case-sensitive-paths-webpack-plugin": "2.3.0",
56+
"css-loader": "3.4.2",
5757
"dotenv": "8.2.0",
5858
"dotenv-expand": "5.1.0",
5959
"eslint": "^6.6.0",
60-
"eslint-config-react-app": "^5.1.0",
61-
"eslint-loader": "3.0.2",
62-
"eslint-plugin-flowtype": "3.13.0",
63-
"eslint-plugin-import": "2.18.2",
60+
"eslint-config-react-app": "^5.2.0",
61+
"eslint-loader": "3.0.3",
62+
"eslint-plugin-flowtype": "4.6.0",
63+
"eslint-plugin-import": "2.20.0",
6464
"eslint-plugin-jsx-a11y": "6.2.3",
65-
"eslint-plugin-react": "7.16.0",
65+
"eslint-plugin-react": "7.18.0",
6666
"eslint-plugin-react-hooks": "^1.6.1",
6767
"file-loader": "4.3.0",
6868
"fs-extra": "^8.1.0",
69-
"html-webpack-plugin": "4.0.0-beta.5",
69+
"html-webpack-plugin": "4.0.0-beta.11",
7070
"identity-obj-proxy": "3.0.0",
7171
"jest": "24.9.0",
72-
"jest-environment-jsdom-fourteen": "0.1.0",
72+
"jest-environment-jsdom-fourteen": "1.0.1",
7373
"jest-resolve": "24.9.0",
7474
"jest-watch-typeahead": "0.4.2",
75-
"mini-css-extract-plugin": "0.8.0",
75+
"mini-css-extract-plugin": "0.9.0",
7676
"optimize-css-assets-webpack-plugin": "5.0.3",
77-
"pnp-webpack-plugin": "1.5.0",
77+
"pnp-webpack-plugin": "1.6.0",
7878
"postcss-flexbugs-fixes": "4.1.0",
7979
"postcss-loader": "3.0.0",
8080
"postcss-normalize": "8.0.1",
8181
"postcss-preset-env": "6.7.0",
8282
"postcss-safe-parser": "4.0.1",
83-
"react-app-polyfill": "^1.0.5",
84-
"react-dev-utils": "^10.0.0",
85-
"resolve": "1.12.2",
83+
"react-app-polyfill": "^1.0.6",
84+
"react-dev-utils": "^10.1.0",
85+
"resolve": "1.15.0",
8686
"resolve-url-loader": "3.1.1",
87-
"sass-loader": "8.0.0",
87+
"sass-loader": "8.0.2",
8888
"semver": "6.3.0",
89-
"style-loader": "1.0.0",
90-
"terser-webpack-plugin": "2.2.1",
89+
"style-loader": "1.1.3",
90+
"terser-webpack-plugin": "2.3.4",
9191
"ts-pnp": "1.1.5",
9292
"url-loader": "2.3.0",
93-
"webpack": "4.41.2",
94-
"webpack-dev-server": "3.9.0",
93+
"webpack": "4.41.5",
94+
"webpack-dev-server": "3.10.1",
9595
"webpack-manifest-plugin": "2.2.0",
9696
"workbox-webpack-plugin": "4.3.1",
97-
"@devloco/create-react-wptheme-utils": "^3.3.0-wp.3"
97+
"@devloco/create-react-wptheme-utils": "^3.3.1-wp.1"
9898
},
9999
"devDependencies": {
100-
"react": "^16.11.0",
101-
"react-dom": "^16.11.0"
100+
"react": "^16.12.0",
101+
"react-dom": "^16.12.0"
102102
},
103103
"optionalDependencies": {
104104
"fsevents": "2.1.2"

packages/react-scripts/scripts/init.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,23 +205,20 @@ module.exports = function(
205205
}
206206
}
207207

208-
// Rename gitignore after the fact to prevent npm from renaming it to .npmignore
209-
// See: https://github.com/npm/npm/issues/1862
210-
try {
208+
const gitignoreExists = fs.existsSync(path.join(appPath, '.gitignore'));
209+
if (gitignoreExists) {
210+
// Append if there's already a `.gitignore` file there
211+
const data = fs.readFileSync(path.join(appPath, 'gitignore'));
212+
fs.appendFileSync(path.join(appPath, '.gitignore'), data);
213+
fs.unlinkSync(path.join(appPath, 'gitignore'));
214+
} else {
215+
// Rename gitignore after the fact to prevent npm from renaming it to .npmignore
216+
// See: https://github.com/npm/npm/issues/1862
211217
fs.moveSync(
212218
path.join(appPath, 'gitignore'),
213219
path.join(appPath, '.gitignore'),
214220
[]
215221
);
216-
} catch (err) {
217-
// Append if there's already a `.gitignore` file there
218-
if (err.code === 'EEXIST') {
219-
const data = fs.readFileSync(path.join(appPath, 'gitignore'));
220-
fs.appendFileSync(path.join(appPath, '.gitignore'), data);
221-
fs.unlinkSync(path.join(appPath, 'gitignore'));
222-
} else {
223-
throw err;
224-
}
225222
}
226223

227224
let command;

0 commit comments

Comments
 (0)