Skip to content

Commit

Permalink
Issue 31
Browse files Browse the repository at this point in the history
  • Loading branch information
devloco committed Nov 24, 2019
1 parent 69f51e9 commit f8fa50c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Create React WP Theme <!-- omit in toc -->

Oct. 12, 2019
Nov. 23, 2019
<br />
*UPDATED* to match [v3.2.0](https://github.com/facebook/create-react-app/releases/tag/v3.2.0) of [Create React App](https://create-react-app.dev/)
[v3.2.0](https://github.com/facebook/create-react-app/releases/tag/v3.2.0) of [Create React App](https://create-react-app.dev/) is still the latest.

The intention of this project is to maintain a set of custom `react-scripts` that will allow you to
create React WordPress themes as easily as `create-react-app` allows other devs to create their apps.
Expand All @@ -19,6 +19,7 @@ Check it out:
[Let's build a WordPress theme with React: Part 1 (Setup)](http://michaelsoriano.com/wordpress-theme-react-part-1-setup/)

## Readme Contents <!-- omit in toc -->

For more details check out the rest of this document.

- [Creating a New Theme](#creating-a-new-theme)
Expand Down Expand Up @@ -58,7 +59,7 @@ To create a WordPress theme using the `create-react-wptheme`, follow these steps
- Write access for your web server is only needed during this setup step.
- **You can revoke write access after the setup has completed.**
- Interested (paranoid?) about what it's doing? Check out the file: `<your theme folder name>/index.php`
- When that's done the theme tells you to `Please restart the Nodejs watcher now...`
- When that's done you'll see: `Now, back in your command prompt, rerun the "start" script again...`
- To do that, go back to your command prompt where you first ran `npm run start` and rerun that same command again.
- In a few seconds you should see your browser load with the standard create-react-app page, but it's running as a WordPress theme!

Expand Down Expand Up @@ -154,16 +155,17 @@ When that command finishes, your optimized files are located in a folder that ca

Here's an example showing which folder to deploy to your server:

- ...wp-content
- themes
- my-theme
- my-theme `<- deploy this folder to your production server's themes folder`
- react-src
- !READY_TO_DEPLOY!.txt
- ...wp-content
- themes
- my-theme
- my-theme `<- deploy this folder to your production server's themes folder`
- react-src
- !READY_TO_DEPLOY!.txt

If you need to continue developing your theme, simply:
- `cd react-src`
- `npm run start`

- `cd react-src`
- `npm run start`

And all your theme files will reappear.

Expand Down
12 changes: 1 addition & 11 deletions createReactWpTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const _wpThemeVersion = packageJson.version;
const _createReactAppVersion = _wpThemeVersion.split("-wp.")[0];

// Check these!!!!
const _reactScriptsWpThemeVersion = "3.2.0-wp.1";
const _reactScriptsWpThemeVersion = "3.2.0-wp.2";
const _getScriptsPath = function() {
return scriptsFromNpm();
};
Expand Down Expand Up @@ -98,16 +98,6 @@ const scriptsFromGit = function() {
};
};

const scriptsFromFile = function() {
let filePath = "file:E:\\WPDev\\github\\devloco\\create-react-wptheme-scripts\\packages\\react-scripts";
console.log("SCRIPTS FROM FILE", filePath);
//let filePath = "file:/mnt/e/WPDev/github/devloco/create-react-wptheme-scripts/packages/react-scripts";
return {
path: filePath,
callback: function() {}
};
};

let projectName;
const program = new commander.Command(packageJson.name)
.version(packageJson.version)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devloco/create-react-wptheme",
"version": "3.2.0-wp.2",
"version": "3.2.0-wp.3",
"description": "Create React WP themes with no build configuration.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit f8fa50c

Please sign in to comment.