Skip to content

Commit

Permalink
Updated to match create-react-app 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
devloco committed Oct 13, 2019
1 parent ec41f6f commit d998b96
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Create React WP Theme <!-- omit in toc -->

*UPDATED* to support [Create React App](https://github.com/facebook/create-react-app) v3.1.2
Oct. 12, 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://reactjs.org/)

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 Down
13 changes: 8 additions & 5 deletions createReactWpTheme.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2018-present, https://github.com/devloco
* Copyright (c) 2019-present, https://github.com/devloco
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -47,17 +47,18 @@ const envinfo = require("envinfo");

const packageJson = require("./package.json");
const _wpThemeVersion = packageJson.version;
// const _createReactAppVersion = _wpThemeVersion.split('-')[0];
const _createReactAppVersion = _wpThemeVersion.split("-wp.")[0];

// Check this!!!!
// Check these!!!!
const _reactScriptsWpThemeVersion = "3.2.0-wp.1";
const _getScriptsPath = function() {
return scriptsFromNpm();
};

const scriptsFromNpm = function() {
//console.log("SCRIPTS FROM NPM");
return {
path: "@devloco/react-scripts-wptheme",
path: `@devloco/react-scripts-wptheme@^${_reactScriptsWpThemeVersion}`,
callback: function() {}
};
};
Expand Down Expand Up @@ -169,6 +170,8 @@ function printValidationResults(results) {
}

console.log(program.name() + " version: " + chalk.magenta(_wpThemeVersion));
console.log("@devloco/react-scripts-wptheme version: " + chalk.magenta(_reactScriptsWpThemeVersion));
console.log("create-react-app version: " + chalk.magenta(_createReactAppVersion));
createApp(projectName, program.verbose, program.scriptsVersion, program.useNpm, program.usePnp, program.typescript);

function createApp(name, verbose, version, useNpm, usePnp, useTypescript, template) {
Expand Down Expand Up @@ -239,7 +242,7 @@ function createReactApp(createWpThemeReactRoot, appName, version, verbose, origi
let command = "npx";

let args = [];
args.push("create-react-app");
args.push(`create-react-app@${_createReactAppVersion}`);
args.push(createWpThemeReactRoot);

if (verbose) {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-react-wptheme",
"version": "3.1.201",
"name": "@devloco/create-react-wptheme",
"version": "3.2.0-wp.1",
"description": "Create React WP themes with no build configuration.",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -43,11 +43,11 @@
},
"dependencies": {
"chalk": "2.4.2",
"commander": "2.19.0",
"commander": "2.20.0",
"cross-spawn": "6.0.5",
"envinfo": "7.3.1",
"fs-extra": "7.0.1",
"semver": "6.0.0",
"semver": "6.3.0",
"tmp": "0.0.33",
"validate-npm-package-name": "3.0.0"
}
Expand Down

0 comments on commit d998b96

Please sign in to comment.