@bigcommerce/create-catalyst 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.cjs +13 -3
- package/dist/index.js +443 -114
- package/dist/index.js.map +1 -1
- package/package.json +29 -23
package/bin/index.cjs
CHANGED
|
@@ -2,12 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
const semver = require('semver');
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Discourage use of odd-numbered versions of Node.js
|
|
7
|
+
* @see https://nodejs.org/en/about/previous-releases#nodejs-releases
|
|
8
|
+
*/
|
|
9
|
+
const catalystRequiredNodeVersions = ['^20', '^22'];
|
|
6
10
|
const userNodeVersion = process.version;
|
|
7
11
|
|
|
8
|
-
if (!semver.satisfies(userNodeVersion,
|
|
12
|
+
if (!catalystRequiredNodeVersions.some((version) => semver.satisfies(userNodeVersion, version))) {
|
|
13
|
+
const prettyRequiredNodeVersions = catalystRequiredNodeVersions
|
|
14
|
+
.map((version) => semver.coerce(version).major)
|
|
15
|
+
.join(', ');
|
|
16
|
+
|
|
9
17
|
console.error(`\n\x1b[31mYou are using Node.js ${userNodeVersion}.`);
|
|
10
|
-
console.error(
|
|
18
|
+
console.error(
|
|
19
|
+
`You must use one of the following Node.js versions: ${prettyRequiredNodeVersions}\x1b[0m\n`,
|
|
20
|
+
);
|
|
11
21
|
process.exit(1);
|
|
12
22
|
}
|
|
13
23
|
|