From d998b96b94d6cc765cc4363cd82105766377fd7d Mon Sep 17 00:00:00 2001 From: devloco <40293912+devloco@users.noreply.github.com> Date: Sat, 12 Oct 2019 19:27:59 -0500 Subject: [PATCH] Updated to match create-react-app 3.2.0 --- README.md | 4 +++- createReactWpTheme.js | 13 ++++++++----- package.json | 8 ++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2874a5f..2517a87 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Create React WP Theme -*UPDATED* to support [Create React App](https://github.com/facebook/create-react-app) v3.1.2 +Oct. 12, 2019 +
+*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. diff --git a/createReactWpTheme.js b/createReactWpTheme.js index ab9339e..543ebcd 100644 --- a/createReactWpTheme.js +++ b/createReactWpTheme.js @@ -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. @@ -47,9 +47,10 @@ 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(); }; @@ -57,7 +58,7 @@ const _getScriptsPath = function() { const scriptsFromNpm = function() { //console.log("SCRIPTS FROM NPM"); return { - path: "@devloco/react-scripts-wptheme", + path: `@devloco/react-scripts-wptheme@^${_reactScriptsWpThemeVersion}`, callback: function() {} }; }; @@ -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) { @@ -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) { diff --git a/package.json b/package.json index ed22b93..f5c08b5 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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" }