|
1 | 1 | /** |
2 | | - * Copyright (c) 2018-present, https://github.com/devloco |
| 2 | + * Copyright (c) 2019-present, https://github.com/devloco |
3 | 3 | * |
4 | 4 | * This source code is licensed under the MIT license found in the |
5 | 5 | * LICENSE file in the root directory of this source tree. |
@@ -47,17 +47,18 @@ const envinfo = require("envinfo"); |
47 | 47 |
|
48 | 48 | const packageJson = require("./package.json"); |
49 | 49 | const _wpThemeVersion = packageJson.version; |
50 | | -// const _createReactAppVersion = _wpThemeVersion.split('-')[0]; |
| 50 | +const _createReactAppVersion = _wpThemeVersion.split("-wp.")[0]; |
51 | 51 |
|
52 | | -// Check this!!!! |
| 52 | +// Check these!!!! |
| 53 | +const _reactScriptsWpThemeVersion = "3.2.0-wp.1"; |
53 | 54 | const _getScriptsPath = function() { |
54 | 55 | return scriptsFromNpm(); |
55 | 56 | }; |
56 | 57 |
|
57 | 58 | const scriptsFromNpm = function() { |
58 | 59 | //console.log("SCRIPTS FROM NPM"); |
59 | 60 | return { |
60 | | - path: "@devloco/react-scripts-wptheme", |
| 61 | + path: `@devloco/react-scripts-wptheme@^${_reactScriptsWpThemeVersion}`, |
61 | 62 | callback: function() {} |
62 | 63 | }; |
63 | 64 | }; |
@@ -169,6 +170,8 @@ function printValidationResults(results) { |
169 | 170 | } |
170 | 171 |
|
171 | 172 | console.log(program.name() + " version: " + chalk.magenta(_wpThemeVersion)); |
| 173 | +console.log("@devloco/react-scripts-wptheme version: " + chalk.magenta(_reactScriptsWpThemeVersion)); |
| 174 | +console.log("create-react-app version: " + chalk.magenta(_createReactAppVersion)); |
172 | 175 | createApp(projectName, program.verbose, program.scriptsVersion, program.useNpm, program.usePnp, program.typescript); |
173 | 176 |
|
174 | 177 | function createApp(name, verbose, version, useNpm, usePnp, useTypescript, template) { |
@@ -239,7 +242,7 @@ function createReactApp(createWpThemeReactRoot, appName, version, verbose, origi |
239 | 242 | let command = "npx"; |
240 | 243 |
|
241 | 244 | let args = []; |
242 | | - args.push("create-react-app"); |
| 245 | + args.push(`create-react-app@${_createReactAppVersion}`); |
243 | 246 | args.push(createWpThemeReactRoot); |
244 | 247 |
|
245 | 248 | if (verbose) { |
|
0 commit comments