Skip to content

Commit 99e0aad

Browse files
committed
Issue 20
2 parents bafd85e + 1ceee87 commit 99e0aad

File tree

3 files changed

+123
-117
lines changed

3 files changed

+123
-117
lines changed
Lines changed: 115 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,118 @@
11
{
2-
"name": "@devloco/react-scripts-wptheme",
3-
"version": "3.0.1-wptheme-3.0.4",
4-
"description": "Configuration and scripts for Create React WP Theme.",
5-
"repository": "devloco/create-react-wptheme",
6-
"author": "devloco",
7-
"license": "MIT",
8-
"keywords": [
9-
"wordpress",
10-
"create-react-app",
11-
"wordpress-theme",
12-
"wordpress-development",
13-
"wordpress-starter-theme",
14-
"wordpress-api",
15-
"reactjs",
16-
"react",
17-
"react-theme",
18-
"wordpress-server",
19-
"react-tutorial",
20-
"react-wordpress-themes",
21-
"php"
2+
"name": "@devloco/react-scripts-wptheme",
3+
"version": "3.0.1-wptheme-3.0.4",
4+
"description": "Configuration and scripts for Create React WP Theme.",
5+
"repository": "devloco/create-react-wptheme",
6+
"author": "devloco",
7+
"license": "MIT",
8+
"keywords": [
9+
"wordpress",
10+
"create-react-app",
11+
"wordpress-theme",
12+
"wordpress-development",
13+
"wordpress-starter-theme",
14+
"wordpress-api",
15+
"reactjs",
16+
"react",
17+
"react-theme",
18+
"wordpress-server",
19+
"react-tutorial",
20+
"react-wordpress-themes",
21+
"php"
22+
],
23+
"engines": {
24+
"node": ">=8.10"
25+
},
26+
"bugs": {
27+
"url": "https://github.com/devloco/create-react-wptheme/issues"
28+
},
29+
"files": [
30+
"bin",
31+
"config",
32+
"lib",
33+
"scripts",
34+
"template",
35+
"template-typescript",
36+
"utils"
37+
],
38+
"bin": {
39+
"react-scripts": "./bin/react-scripts.js",
40+
"wptheme-scripts": "./bin/wptheme-scripts.js"
41+
},
42+
"types": "./lib/react-app.d.ts",
43+
"dependencies": {
44+
"@babel/core": "7.4.3",
45+
"@svgr/webpack": "4.1.0",
46+
"@typescript-eslint/eslint-plugin": "1.6.0",
47+
"@typescript-eslint/parser": "1.6.0",
48+
"babel-eslint": "10.0.1",
49+
"babel-jest": "^24.8.0",
50+
"babel-loader": "8.0.5",
51+
"babel-plugin-named-asset-import": "^0.3.2",
52+
"babel-preset-react-app": "^9.0.0",
53+
"camelcase": "^5.2.0",
54+
"case-sensitive-paths-webpack-plugin": "2.2.0",
55+
"css-loader": "2.1.1",
56+
"dotenv": "6.2.0",
57+
"dotenv-expand": "4.2.0",
58+
"eslint": "^5.16.0",
59+
"eslint-config-react-app": "^4.0.1",
60+
"eslint-loader": "2.1.2",
61+
"eslint-plugin-flowtype": "2.50.1",
62+
"eslint-plugin-import": "2.16.0",
63+
"eslint-plugin-jsx-a11y": "6.2.1",
64+
"eslint-plugin-react": "7.12.4",
65+
"eslint-plugin-react-hooks": "^1.5.0",
66+
"file-loader": "3.0.1",
67+
"fs-extra": "7.0.1",
68+
"html-webpack-plugin": "4.0.0-beta.5",
69+
"identity-obj-proxy": "3.0.0",
70+
"is-wsl": "^1.1.0",
71+
"jest": "24.7.1",
72+
"jest-environment-jsdom-fourteen": "0.1.0",
73+
"jest-resolve": "24.7.1",
74+
"jest-watch-typeahead": "0.3.0",
75+
"mini-css-extract-plugin": "0.5.0",
76+
"optimize-css-assets-webpack-plugin": "5.0.1",
77+
"pnp-webpack-plugin": "1.2.1",
78+
"postcss-flexbugs-fixes": "4.1.0",
79+
"postcss-loader": "3.0.0",
80+
"postcss-normalize": "7.0.1",
81+
"postcss-preset-env": "6.6.0",
82+
"postcss-safe-parser": "4.0.1",
83+
"react-app-polyfill": "^1.0.1",
84+
"react-dev-utils": "^9.0.1",
85+
"resolve": "1.10.0",
86+
"sass-loader": "7.1.0",
87+
"semver": "6.0.0",
88+
"style-loader": "0.23.1",
89+
"terser-webpack-plugin": "1.2.3",
90+
"ts-pnp": "1.1.2",
91+
"url-loader": "1.1.2",
92+
"webpack": "4.29.6",
93+
"webpack-dev-server": "3.2.1",
94+
"webpack-manifest-plugin": "2.0.4",
95+
"workbox-webpack-plugin": "4.2.0",
96+
"@devloco/react-scripts-wptheme-utils": "^1.4.9",
97+
"@devloco/react-scripts-wptheme-error-overlay": "^1.4.4"
98+
},
99+
"devDependencies": {
100+
"react": "^16.8.4",
101+
"react-dom": "^16.8.4"
102+
},
103+
"optionalDependencies": {
104+
"fsevents": "2.0.6"
105+
},
106+
"browserslist": {
107+
"production": [
108+
">0.2%",
109+
"not dead",
110+
"not op_mini all"
22111
],
23-
"engines": {
24-
"node": ">=8.10"
25-
},
26-
"bugs": {
27-
"url": "https://github.com/devloco/create-react-wptheme/issues"
28-
},
29-
"files": [
30-
"bin",
31-
"config",
32-
"lib",
33-
"scripts",
34-
"template",
35-
"template-typescript",
36-
"utils"
37-
],
38-
"bin": {
39-
"react-scripts": "./bin/react-scripts.js",
40-
"wptheme-scripts": "./bin/wptheme-scripts.js"
41-
},
42-
"types": "./lib/react-app.d.ts",
43-
"dependencies": {
44-
"@babel/core": "7.4.3",
45-
"@svgr/webpack": "4.1.0",
46-
"@typescript-eslint/eslint-plugin": "1.6.0",
47-
"@typescript-eslint/parser": "1.6.0",
48-
"babel-eslint": "10.0.1",
49-
"babel-jest": "^24.8.0",
50-
"babel-loader": "8.0.5",
51-
"babel-plugin-named-asset-import": "^0.3.2",
52-
"babel-preset-react-app": "^9.0.0",
53-
"camelcase": "^5.2.0",
54-
"case-sensitive-paths-webpack-plugin": "2.2.0",
55-
"css-loader": "2.1.1",
56-
"dotenv": "6.2.0",
57-
"dotenv-expand": "4.2.0",
58-
"eslint": "^5.16.0",
59-
"eslint-config-react-app": "^4.0.1",
60-
"eslint-loader": "2.1.2",
61-
"eslint-plugin-flowtype": "2.50.1",
62-
"eslint-plugin-import": "2.16.0",
63-
"eslint-plugin-jsx-a11y": "6.2.1",
64-
"eslint-plugin-react": "7.12.4",
65-
"eslint-plugin-react-hooks": "^1.5.0",
66-
"file-loader": "3.0.1",
67-
"fs-extra": "7.0.1",
68-
"html-webpack-plugin": "4.0.0-beta.5",
69-
"identity-obj-proxy": "3.0.0",
70-
"is-wsl": "^1.1.0",
71-
"jest": "24.7.1",
72-
"jest-environment-jsdom-fourteen": "0.1.0",
73-
"jest-resolve": "24.7.1",
74-
"jest-watch-typeahead": "0.3.0",
75-
"mini-css-extract-plugin": "0.5.0",
76-
"optimize-css-assets-webpack-plugin": "5.0.1",
77-
"pnp-webpack-plugin": "1.2.1",
78-
"postcss-flexbugs-fixes": "4.1.0",
79-
"postcss-loader": "3.0.0",
80-
"postcss-normalize": "7.0.1",
81-
"postcss-preset-env": "6.6.0",
82-
"postcss-safe-parser": "4.0.1",
83-
"react-app-polyfill": "^1.0.1",
84-
"react-dev-utils": "^9.0.1",
85-
"resolve": "1.10.0",
86-
"sass-loader": "7.1.0",
87-
"semver": "6.0.0",
88-
"style-loader": "0.23.1",
89-
"terser-webpack-plugin": "1.2.3",
90-
"ts-pnp": "1.1.2",
91-
"url-loader": "1.1.2",
92-
"webpack": "4.29.6",
93-
"webpack-dev-server": "3.2.1",
94-
"webpack-manifest-plugin": "2.0.4",
95-
"workbox-webpack-plugin": "4.2.0",
96-
"@devloco/react-scripts-wptheme-utils": "^1.4.5",
97-
"@devloco/react-scripts-wptheme-error-overlay": "^1.4.4"
98-
},
99-
"devDependencies": {
100-
"react": "^16.8.4",
101-
"react-dom": "^16.8.4"
102-
},
103-
"optionalDependencies": {
104-
"fsevents": "2.0.6"
105-
},
106-
"browserslist": {
107-
"production": [
108-
">0.2%",
109-
"not dead",
110-
"not op_mini all"
111-
],
112-
"development": [
113-
"last 1 chrome version",
114-
"last 1 firefox version",
115-
"last 1 safari version"
116-
]
117-
}
112+
"development": [
113+
"last 1 chrome version",
114+
"last 1 firefox version",
115+
"last 1 safari version"
116+
]
117+
}
118118
}

packages/react-scripts/scripts/wpbuild.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const wpThemeFileFunctions = require('@devloco/react-scripts-wptheme-utils/fileF
5454
const copyPublicFolder = wpThemeFileFunctions.copyPublicFolder;
5555
const copyToThemeFolder = wpThemeFileFunctions.copyToThemeFolder;
5656
const cleanThemeFolder = wpThemeFileFunctions.cleanThemeFolder;
57+
const writeReadyToDeployFile = wpThemeFileFunctions.writeReadyToDeployFile;
5758

5859
// These sizes are pretty large. We'll warn for bundles exceeding them.
5960
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
@@ -83,7 +84,7 @@ checkBrowsers(paths.appPath, isInteractive)
8384
// if you're in it, you don't end up in Trash
8485
fs.emptyDirSync(paths.appBuild);
8586
// clean the WP theme folder
86-
cleanThemeFolder(true);
87+
cleanThemeFolder(paths, true);
8788
// Merge with the public folder
8889
copyPublicFolder(paths);
8990
// Start the webpack build
@@ -226,7 +227,8 @@ function build(previousFileSizes) {
226227
warnings: messages.warnings,
227228
};
228229

229-
copyToThemeFolder(paths);
230+
copyToThemeFolder(paths, true);
231+
writeReadyToDeployFile(paths);
230232

231233
return resolve(resolveArgs);
232234
});

packages/react-scripts/scripts/wpstart.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const wpThemeFileFunctions = require('@devloco/react-scripts-wptheme-utils/fileF
6262

6363
const copyPublicFolder = wpThemeFileFunctions.copyPublicFolder;
6464
const copyToThemeFolder = wpThemeFileFunctions.copyToThemeFolder;
65+
const deleteDeployFolder = wpThemeFileFunctions.deleteDeployFolder;
6566
const setupCopyToThemeFolder = wpThemeFileFunctions.setupCopyToThemeFolder;
6667
const writeDoNotEditFile = wpThemeFileFunctions.writeDoNotEditFile;
6768

@@ -118,6 +119,9 @@ function startWatch() {
118119
fs.emptyDirSync(paths.appBuild);
119120
fs.emptyDirSync('../static');
120121

122+
// Going into Dev mode, so delete the deploy folder.
123+
deleteDeployFolder(paths);
124+
121125
const injectWpThemeClient = function(wpThemeServer) {
122126
if (!wpThemeUserConfig) {
123127
return;

0 commit comments

Comments
 (0)