@create-node-app/core 0.1.2 → 0.1.3
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/dist/index.js +13 -2
- package/dist/index.mjs +13 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -57,18 +57,26 @@ var import_semver = __toESM(require("semver"));
|
|
|
57
57
|
var import_dns = __toESM(require("dns"));
|
|
58
58
|
var import_url = require("url");
|
|
59
59
|
var shouldUseYarn = () => {
|
|
60
|
-
const { hasMinYarnPnp, hasMaxYarnPnp } = checkYarnVersion();
|
|
60
|
+
const { hasMinYarnPnp, hasMaxYarnPnp, yarnVersion } = checkYarnVersion();
|
|
61
61
|
if (!hasMinYarnPnp) {
|
|
62
|
+
console.log(
|
|
63
|
+
import_chalk.default.yellow(
|
|
64
|
+
`You are using yarn version ${import_chalk.default.bold(
|
|
65
|
+
yarnVersion
|
|
66
|
+
)} which is not supported yet. To use Yarn, install v1.12.0 or higher and lower than v2.0.0. See https://yarnpkg.com for instructions on how to update.`
|
|
67
|
+
)
|
|
68
|
+
);
|
|
62
69
|
return false;
|
|
63
70
|
}
|
|
64
71
|
if (!hasMaxYarnPnp) {
|
|
65
72
|
console.log(
|
|
66
73
|
import_chalk.default.yellow(
|
|
67
|
-
`You are using a pre-release version of Yarn which is not supported yet. To use Yarn, install v1.12.0 or higher.`
|
|
74
|
+
`You are using a pre-release version of Yarn which is not supported yet. To use Yarn, install v1.12.0 or higher and lower than v2.0.0. See https://yarnpkg.com for instructions on how to update.`
|
|
68
75
|
)
|
|
69
76
|
);
|
|
70
77
|
return false;
|
|
71
78
|
}
|
|
79
|
+
return true;
|
|
72
80
|
};
|
|
73
81
|
var checkThatNpmCanReadCwd = () => {
|
|
74
82
|
const cwd = process.cwd();
|
|
@@ -758,6 +766,9 @@ var run = async ({
|
|
|
758
766
|
const packageJson = JSON.parse(
|
|
759
767
|
import_fs5.default.readFileSync(`${root}/package.json`, "utf8")
|
|
760
768
|
);
|
|
769
|
+
if (packageJson.scripts && packageJson.scripts["format"]) {
|
|
770
|
+
(0, import_cross_spawn2.default)(runCommand, ["format"], { stdio: "inherit", cwd: root });
|
|
771
|
+
}
|
|
761
772
|
if (packageJson.scripts && packageJson.scripts["lint:fix"]) {
|
|
762
773
|
(0, import_cross_spawn2.default)(runCommand, ["lint:fix"], { stdio: "inherit", cwd: root });
|
|
763
774
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -29,18 +29,26 @@ import semver from "semver";
|
|
|
29
29
|
import dns from "dns";
|
|
30
30
|
import { URL as URL2 } from "url";
|
|
31
31
|
var shouldUseYarn = () => {
|
|
32
|
-
const { hasMinYarnPnp, hasMaxYarnPnp } = checkYarnVersion();
|
|
32
|
+
const { hasMinYarnPnp, hasMaxYarnPnp, yarnVersion } = checkYarnVersion();
|
|
33
33
|
if (!hasMinYarnPnp) {
|
|
34
|
+
console.log(
|
|
35
|
+
chalk.yellow(
|
|
36
|
+
`You are using yarn version ${chalk.bold(
|
|
37
|
+
yarnVersion
|
|
38
|
+
)} which is not supported yet. To use Yarn, install v1.12.0 or higher and lower than v2.0.0. See https://yarnpkg.com for instructions on how to update.`
|
|
39
|
+
)
|
|
40
|
+
);
|
|
34
41
|
return false;
|
|
35
42
|
}
|
|
36
43
|
if (!hasMaxYarnPnp) {
|
|
37
44
|
console.log(
|
|
38
45
|
chalk.yellow(
|
|
39
|
-
`You are using a pre-release version of Yarn which is not supported yet. To use Yarn, install v1.12.0 or higher.`
|
|
46
|
+
`You are using a pre-release version of Yarn which is not supported yet. To use Yarn, install v1.12.0 or higher and lower than v2.0.0. See https://yarnpkg.com for instructions on how to update.`
|
|
40
47
|
)
|
|
41
48
|
);
|
|
42
49
|
return false;
|
|
43
50
|
}
|
|
51
|
+
return true;
|
|
44
52
|
};
|
|
45
53
|
var checkThatNpmCanReadCwd = () => {
|
|
46
54
|
const cwd = process.cwd();
|
|
@@ -730,6 +738,9 @@ var run = async ({
|
|
|
730
738
|
const packageJson = JSON.parse(
|
|
731
739
|
fs4.readFileSync(`${root}/package.json`, "utf8")
|
|
732
740
|
);
|
|
741
|
+
if (packageJson.scripts && packageJson.scripts["format"]) {
|
|
742
|
+
spawn2(runCommand, ["format"], { stdio: "inherit", cwd: root });
|
|
743
|
+
}
|
|
733
744
|
if (packageJson.scripts && packageJson.scripts["lint:fix"]) {
|
|
734
745
|
spawn2(runCommand, ["lint:fix"], { stdio: "inherit", cwd: root });
|
|
735
746
|
}
|