cmyr-template-cli 1.40.0 → 1.41.1
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 +1 -1
- package/dist/plopfile.js +117 -88
- package/package.json +12 -13
- package/templates/.czrc +3 -0
- package/templates/commitlint.config.ts +3 -0
- package/templates/eslint.config.js +3 -0
- package/templates/release.config.js +39 -0
- package/templates/scripts/minify-docker.cjs +1 -2
- package/templates/stylelint.config.js +4 -0
- package/templates/.eslintignore +0 -9
- package/templates/.releaserc.js +0 -35
- package/templates/.stylelintignore +0 -6
- package/templates/.stylelintrc.cjs +0 -11
- package/templates/.stylelintrc.js +0 -11
- package/templates/commitlint.config.js +0 -23
package/dist/index.js
CHANGED
|
@@ -23,10 +23,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
));
|
|
24
24
|
|
|
25
25
|
// src/index.ts
|
|
26
|
+
var import_path = __toESM(require("path"));
|
|
26
27
|
var import_plop = require("plop");
|
|
27
28
|
var import_commander = require("commander");
|
|
28
29
|
var import_minimist = __toESM(require("minimist"));
|
|
29
|
-
var import_path = __toESM(require("path"));
|
|
30
30
|
var import_fs_extra = __toESM(require("fs-extra"));
|
|
31
31
|
var program = new import_commander.Command("ct").description("草梅项目创建器");
|
|
32
32
|
var pkg = import_fs_extra.default.readJSONSync(import_path.default.join(__dirname, "../package.json"));
|
package/dist/plopfile.js
CHANGED
|
@@ -22,22 +22,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
|
|
25
|
+
// src/plopfile.ts
|
|
26
|
+
var import_path3 = __toESM(require("path"));
|
|
27
|
+
var import_fs_extra4 = __toESM(require("fs-extra"));
|
|
28
|
+
|
|
25
29
|
// src/config/env.ts
|
|
26
30
|
var env = process.env;
|
|
27
31
|
var __DEV__ = env.NODE_ENV === "development";
|
|
28
32
|
var PACKAGE_MANAGER = "pnpm";
|
|
29
33
|
|
|
30
34
|
// src/utils/utils.ts
|
|
31
|
-
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
32
35
|
var import_path2 = __toESM(require("path"));
|
|
33
|
-
var import_ora2 = __toESM(require("ora"));
|
|
34
|
-
var import_download_git_repo = __toESM(require("download-git-repo"));
|
|
35
36
|
var import_child_process = require("child_process");
|
|
37
|
+
var import_os = __toESM(require("os"));
|
|
36
38
|
var import_colors = __toESM(require("@colors/colors"));
|
|
37
39
|
var import_ejs2 = __toESM(require("ejs"));
|
|
38
40
|
var import_lodash = require("lodash");
|
|
39
41
|
var import_json5 = __toESM(require("json5"));
|
|
40
|
-
var
|
|
42
|
+
var import_download_git_repo = __toESM(require("download-git-repo"));
|
|
43
|
+
var import_ora2 = __toESM(require("ora"));
|
|
44
|
+
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
41
45
|
var import_yaml = __toESM(require("yaml"));
|
|
42
46
|
var import_acorn = __toESM(require("acorn"));
|
|
43
47
|
var import_acorn_walk = __toESM(require("acorn-walk"));
|
|
@@ -51,17 +55,38 @@ var NODEJS_URLS = [
|
|
|
51
55
|
var NODE_INDEX_URL = "https://cdn.npmmirror.com/binaries/node/index.json";
|
|
52
56
|
var REMOTES = [
|
|
53
57
|
"https://github.com",
|
|
54
|
-
"https://hub.fastgit.xyz",
|
|
55
|
-
"https://download.fastgit.org",
|
|
56
|
-
"https://ghproxy.com/https://github.com",
|
|
57
|
-
"https://gh.ddlc.top/https://github.com",
|
|
58
58
|
"https://gh.flyinbug.top/gh/https://github.com",
|
|
59
59
|
"https://cors.isteed.cc/github.com",
|
|
60
|
-
"https://ghps.cc/https://github.com",
|
|
61
|
-
"https://download.nuaa.cf",
|
|
62
60
|
"https://kgithub.com",
|
|
63
|
-
"https://
|
|
64
|
-
"https://hub.
|
|
61
|
+
"https://ghproxy.1888866.xyz/https://github.com",
|
|
62
|
+
"https://hub.gitmirror.com/https://github.com",
|
|
63
|
+
"https://ghproxy.cfd/https://github.com",
|
|
64
|
+
"https://github.boki.moe/https://github.com",
|
|
65
|
+
"https://gh-proxy.net/https://github.com",
|
|
66
|
+
"https://gh.monlor.com/https://github.com",
|
|
67
|
+
"https://fastgit.cc/https://github.com",
|
|
68
|
+
"https://github.tbedu.top/https://github.com",
|
|
69
|
+
"https://ghfile.geekertao.top/https://github.com",
|
|
70
|
+
"https://ghp.keleyaa.com/https://github.com",
|
|
71
|
+
"https://ghpxy.hwinzniej.top/https://github.com",
|
|
72
|
+
"https://cdn.crashmc.com/https://github.com",
|
|
73
|
+
"https://git.yylx.win/https://github.com",
|
|
74
|
+
"https://gitproxy.mrhjx.cn/https://github.com",
|
|
75
|
+
"https://ghproxy.cxkpro.top/https://github.com",
|
|
76
|
+
"https://gh.xxooo.cf/https://github.com",
|
|
77
|
+
"https://gh.llkk.cc/https://github.com",
|
|
78
|
+
"https://raw.ihtw.moe/github.com",
|
|
79
|
+
"https://dgithub.xyz",
|
|
80
|
+
"https://gh.nxnow.top/https://github.com",
|
|
81
|
+
"https://gh.zwy.one/https://github.com",
|
|
82
|
+
"https://ghproxy.monkeyray.net/https://github.com",
|
|
83
|
+
"https://ghproxy.net/https://github.com",
|
|
84
|
+
"https://ghfast.top/https://github.com",
|
|
85
|
+
"https://wget.la/https://github.com",
|
|
86
|
+
"https://wget.la/https://github.com",
|
|
87
|
+
"https://hk.gh-proxy.com/https://github.com",
|
|
88
|
+
"https://ghfast.top/https://github.com",
|
|
89
|
+
"https://ghproxy.net/https://github.com"
|
|
65
90
|
];
|
|
66
91
|
|
|
67
92
|
// src/utils/dependencies.ts
|
|
@@ -446,8 +471,8 @@ async function ejsRender(templatePath, data, outputPath) {
|
|
|
446
471
|
}
|
|
447
472
|
|
|
448
473
|
// src/utils/files.ts
|
|
449
|
-
var import_fs_extra2 = __toESM(require("fs-extra"));
|
|
450
474
|
var import_path = __toESM(require("path"));
|
|
475
|
+
var import_fs_extra2 = __toESM(require("fs-extra"));
|
|
451
476
|
var import_ora = __toESM(require("ora"));
|
|
452
477
|
async function copyFilesFromTemplates(projectPath, files, lazy = false) {
|
|
453
478
|
const loading = (0, import_ora.default)(`正在复制文件 ${files.join()} ……`).start();
|
|
@@ -728,7 +753,8 @@ async function init(projectPath, answers) {
|
|
|
728
753
|
}
|
|
729
754
|
await initGithubWorkflows(projectPath, answers);
|
|
730
755
|
}
|
|
731
|
-
await
|
|
756
|
+
await initEditorconfig(projectPath);
|
|
757
|
+
await initCommitlint(projectPath);
|
|
732
758
|
await initCommitizen(projectPath);
|
|
733
759
|
if (isInitSemanticRelease) {
|
|
734
760
|
await initSemanticRelease(projectPath);
|
|
@@ -1013,24 +1039,6 @@ async function initDependabot(projectPath, answers) {
|
|
|
1013
1039
|
const dependabot = import_yaml.default.parse(await import_fs_extra3.default.readFile(dependabotPath, "utf-8"));
|
|
1014
1040
|
if (dependabot?.updates?.[0]["package-ecosystem"] === "npm") {
|
|
1015
1041
|
const dependencies = [];
|
|
1016
|
-
if (pkg?.devDependencies?.["semantic-release"]) {
|
|
1017
|
-
dependencies.push({
|
|
1018
|
-
"dependency-name": "semantic-release",
|
|
1019
|
-
versions: [">= 21.0.1"]
|
|
1020
|
-
});
|
|
1021
|
-
}
|
|
1022
|
-
if (pkg?.devDependencies?.["@commitlint/cli"]) {
|
|
1023
|
-
dependencies.push({
|
|
1024
|
-
"dependency-name": "@commitlint/cli",
|
|
1025
|
-
versions: [">= 19.0.0"]
|
|
1026
|
-
});
|
|
1027
|
-
}
|
|
1028
|
-
if (pkg?.devDependencies?.["@commitlint/config-conventional"]) {
|
|
1029
|
-
dependencies.push({
|
|
1030
|
-
"dependency-name": "@commitlint/config-conventional",
|
|
1031
|
-
versions: [">= 19.0.0"]
|
|
1032
|
-
});
|
|
1033
|
-
}
|
|
1034
1042
|
if (pkg?.dependencies?.["art-template"]) {
|
|
1035
1043
|
dependencies.push({
|
|
1036
1044
|
"dependency-name": "art-template",
|
|
@@ -1453,12 +1461,36 @@ async function initLicense(projectPath, projectInfos) {
|
|
|
1453
1461
|
console.error(error);
|
|
1454
1462
|
}
|
|
1455
1463
|
}
|
|
1456
|
-
async function
|
|
1464
|
+
async function initEditorconfig(projectPath) {
|
|
1465
|
+
try {
|
|
1466
|
+
const files = [".editorconfig"];
|
|
1467
|
+
await copyFilesFromTemplates(projectPath, files, true);
|
|
1468
|
+
} catch (error) {
|
|
1469
|
+
console.error(error);
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
async function initCommitlint(projectPath) {
|
|
1473
|
+
const loading = (0, import_ora2.default)("正在初始化 commitlint ……").start();
|
|
1457
1474
|
try {
|
|
1475
|
+
const pkg = await getProjectJson(projectPath);
|
|
1476
|
+
const devDependencies = {
|
|
1477
|
+
commitlint: "^19.8.1",
|
|
1478
|
+
"@commitlint/cli": void 0
|
|
1479
|
+
};
|
|
1480
|
+
const pkgData = {
|
|
1481
|
+
devDependencies: {
|
|
1482
|
+
"commitlint-config-cmyr": `^${await getNpmPackageVersion("commitlint-config-cmyr")}`,
|
|
1483
|
+
...pkg?.devDependencies,
|
|
1484
|
+
...devDependencies
|
|
1485
|
+
}
|
|
1486
|
+
};
|
|
1487
|
+
await saveProjectJson(projectPath, pkgData);
|
|
1458
1488
|
await removeFiles(projectPath, ["commitlint.config.cjs", "commitlint.config.js"]);
|
|
1459
|
-
const files = ["
|
|
1460
|
-
await copyFilesFromTemplates(projectPath, files);
|
|
1489
|
+
const files = ["commitlint.config.ts"];
|
|
1490
|
+
await copyFilesFromTemplates(projectPath, files, true);
|
|
1491
|
+
loading.succeed("commitlint 初始化成功!");
|
|
1461
1492
|
} catch (error) {
|
|
1493
|
+
loading.fail("commitlint 初始化失败!");
|
|
1462
1494
|
console.error(error);
|
|
1463
1495
|
}
|
|
1464
1496
|
}
|
|
@@ -1506,11 +1538,12 @@ async function initSemanticRelease(projectPath) {
|
|
|
1506
1538
|
const pkg = await getProjectJson(projectPath);
|
|
1507
1539
|
const files = [".releaserc.js", ".releaserc.cjs"];
|
|
1508
1540
|
await removeFiles(projectPath, files);
|
|
1509
|
-
await copyFilesFromTemplates(projectPath, [".
|
|
1541
|
+
await copyFilesFromTemplates(projectPath, ["release.config.js"], true);
|
|
1510
1542
|
const devDependencies = {
|
|
1511
1543
|
"@semantic-release/changelog": "^6.0.3",
|
|
1512
1544
|
"@semantic-release/git": "^10.0.1",
|
|
1513
|
-
"semantic-release": "
|
|
1545
|
+
"semantic-release": "^24.2.7",
|
|
1546
|
+
"conventional-changelog-cli": void 0
|
|
1514
1547
|
};
|
|
1515
1548
|
const pkgData = {
|
|
1516
1549
|
scripts: {
|
|
@@ -1518,8 +1551,8 @@ async function initSemanticRelease(projectPath) {
|
|
|
1518
1551
|
...pkg?.scripts
|
|
1519
1552
|
},
|
|
1520
1553
|
devDependencies: {
|
|
1521
|
-
...devDependencies,
|
|
1522
1554
|
...pkg?.devDependencies,
|
|
1555
|
+
...devDependencies,
|
|
1523
1556
|
"conventional-changelog-cmyr-config": `^${await getNpmPackageVersion("conventional-changelog-cmyr-config")}`,
|
|
1524
1557
|
"semantic-release": devDependencies["semantic-release"]
|
|
1525
1558
|
},
|
|
@@ -1553,13 +1586,13 @@ async function initHusky(projectPath) {
|
|
|
1553
1586
|
}
|
|
1554
1587
|
const keyname = `*.{${extnames.join(",")}}`;
|
|
1555
1588
|
const devDependencies = {
|
|
1556
|
-
husky: "^9.
|
|
1557
|
-
"lint-staged": "^
|
|
1589
|
+
husky: "^9.1.7",
|
|
1590
|
+
"lint-staged": "^16.1.5"
|
|
1558
1591
|
};
|
|
1559
1592
|
const pkgData = {
|
|
1560
1593
|
scripts: {
|
|
1561
1594
|
...pkg?.scripts,
|
|
1562
|
-
prepare: "husky
|
|
1595
|
+
prepare: "husky init"
|
|
1563
1596
|
},
|
|
1564
1597
|
devDependencies: {
|
|
1565
1598
|
...devDependencies,
|
|
@@ -1586,53 +1619,49 @@ async function initEslint(projectPath, answers) {
|
|
|
1586
1619
|
const templateMeta = getTemplateMeta(answers.template);
|
|
1587
1620
|
const pkg = await getProjectJson(projectPath);
|
|
1588
1621
|
const devDependencies = {
|
|
1589
|
-
"
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
eslint:
|
|
1622
|
+
"cross-env": "^10.0.0",
|
|
1623
|
+
eslint: "^9.34.0",
|
|
1624
|
+
// 移除不必要的依赖
|
|
1625
|
+
"@typescript-eslint/eslint-plugin": void 0,
|
|
1626
|
+
"@typescript-eslint/parser": void 0
|
|
1593
1627
|
};
|
|
1594
1628
|
let eslintType = "cmyr";
|
|
1595
1629
|
const extnames = ["js", "mjs", "cjs", "ts", "cts", "mts"];
|
|
1596
1630
|
if (templateMeta?.language === "vue") {
|
|
1597
1631
|
Object.assign(devDependencies, {
|
|
1598
|
-
"@vue/eslint-config-typescript":
|
|
1632
|
+
"@vue/eslint-config-typescript": void 0,
|
|
1599
1633
|
"eslint-plugin-vue": "^9.8.0"
|
|
1600
1634
|
});
|
|
1601
1635
|
extnames.push("vue");
|
|
1602
|
-
|
|
1603
|
-
eslintType = "cmyr/vue3";
|
|
1604
|
-
} else {
|
|
1605
|
-
eslintType = "cmyr/vue";
|
|
1606
|
-
}
|
|
1636
|
+
eslintType = "eslint-config-cmyr/vue";
|
|
1607
1637
|
} else if (templateMeta?.language === "react") {
|
|
1608
1638
|
extnames.push("jsx", "tsx");
|
|
1609
|
-
eslintType = "cmyr/react";
|
|
1639
|
+
eslintType = "eslint-config-cmyr/react";
|
|
1610
1640
|
Object.assign(devDependencies, {
|
|
1611
|
-
"eslint-
|
|
1641
|
+
"eslint-plugin-react": "^7.37.5"
|
|
1612
1642
|
});
|
|
1613
1643
|
}
|
|
1614
1644
|
const pkgData = {
|
|
1615
1645
|
scripts: {
|
|
1616
|
-
lint: `cross-env NODE_ENV=production eslint
|
|
1646
|
+
lint: `cross-env NODE_ENV=production eslint . --fix`,
|
|
1617
1647
|
...pkg?.scripts
|
|
1618
1648
|
},
|
|
1619
1649
|
devDependencies: {
|
|
1620
|
-
"eslint-plugin-import": "^2.28.1",
|
|
1621
1650
|
...devDependencies,
|
|
1622
1651
|
...pkg?.devDependencies,
|
|
1623
1652
|
"eslint-config-cmyr": `^${await getNpmPackageVersion("eslint-config-cmyr")}`
|
|
1624
1653
|
}
|
|
1625
1654
|
};
|
|
1626
1655
|
await saveProjectJson(projectPath, pkgData);
|
|
1627
|
-
const files = [".eslintignore"];
|
|
1628
|
-
await
|
|
1629
|
-
const eslintrc = `
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
const
|
|
1634
|
-
const jsPath = import_path2.default.join(projectPath, ".
|
|
1635
|
-
if (!await import_fs_extra3.default.pathExists(
|
|
1656
|
+
const files = [".eslintignore", ".eslintrc.cjs", ".eslintrc.js"];
|
|
1657
|
+
await removeFiles(projectPath, files);
|
|
1658
|
+
const eslintrc = `import { defineConfig } from 'eslint/config'
|
|
1659
|
+
import cmyr from '${eslintType}'
|
|
1660
|
+
export default defineConfig([cmyr])
|
|
1661
|
+
`;
|
|
1662
|
+
const mjsPath = import_path2.default.join(projectPath, "eslint.config.mjs");
|
|
1663
|
+
const jsPath = import_path2.default.join(projectPath, "eslint.config.js");
|
|
1664
|
+
if (!await import_fs_extra3.default.pathExists(mjsPath) && !await import_fs_extra3.default.pathExists(jsPath)) {
|
|
1636
1665
|
await import_fs_extra3.default.writeFile(jsPath, eslintrc);
|
|
1637
1666
|
}
|
|
1638
1667
|
loading.succeed("eslint 初始化成功!");
|
|
@@ -1656,22 +1685,27 @@ async function initStylelint(projectPath) {
|
|
|
1656
1685
|
});
|
|
1657
1686
|
return;
|
|
1658
1687
|
}
|
|
1659
|
-
const files = [".stylelintignore", ".stylelintrc.js"];
|
|
1660
1688
|
await removeFiles(projectPath, [".stylelintrc.js", ".stylelintrc.cjs"]);
|
|
1661
|
-
|
|
1689
|
+
const files = ["stylelint.config.js"];
|
|
1690
|
+
await copyFilesFromTemplates(projectPath, files, true);
|
|
1662
1691
|
const devDependencies = {
|
|
1663
|
-
|
|
1664
|
-
sass: "^1.
|
|
1665
|
-
stylelint: "^
|
|
1666
|
-
"stylelint-config-cmyr": "
|
|
1667
|
-
|
|
1668
|
-
"
|
|
1669
|
-
"
|
|
1670
|
-
"stylelint-
|
|
1692
|
+
postcss: "^8.5.6",
|
|
1693
|
+
sass: "^1.90.0",
|
|
1694
|
+
stylelint: "^16.23.1",
|
|
1695
|
+
"stylelint-config-cmyr": `^${await getNpmPackageVersion("stylelint-config-cmyr")}`,
|
|
1696
|
+
// 移除不必要的依赖
|
|
1697
|
+
"postcss-html": void 0,
|
|
1698
|
+
"postcss-scss": void 0,
|
|
1699
|
+
"stylelint-config-standard": void 0,
|
|
1700
|
+
"stylelint-config-recommended": void 0,
|
|
1701
|
+
"stylelint-config-standard-scss": void 0,
|
|
1702
|
+
"stylelint-scss": void 0,
|
|
1703
|
+
"stylelint-config-html": void 0,
|
|
1704
|
+
"stylelint-config-rational-order": void 0
|
|
1671
1705
|
};
|
|
1672
1706
|
const pkgData = {
|
|
1673
1707
|
scripts: {
|
|
1674
|
-
"lint:css": `stylelint src/**/*.{${extnames.join(",")}} --fix
|
|
1708
|
+
"lint:css": `stylelint src/**/*.{${extnames.join(",")}} --fix`,
|
|
1675
1709
|
...pkg?.scripts
|
|
1676
1710
|
},
|
|
1677
1711
|
devDependencies: {
|
|
@@ -1691,7 +1725,7 @@ async function initCommitizen(projectPath) {
|
|
|
1691
1725
|
try {
|
|
1692
1726
|
const pkg = await getProjectJson(projectPath);
|
|
1693
1727
|
const devDependencies = {
|
|
1694
|
-
commitizen: "^4.
|
|
1728
|
+
commitizen: "^4.3.1",
|
|
1695
1729
|
"cz-conventional-changelog-cmyr": `^${await getNpmPackageVersion("cz-conventional-changelog-cmyr")}`
|
|
1696
1730
|
};
|
|
1697
1731
|
const pkgData = {
|
|
@@ -1701,18 +1735,17 @@ async function initCommitizen(projectPath) {
|
|
|
1701
1735
|
},
|
|
1702
1736
|
devDependencies: {
|
|
1703
1737
|
...devDependencies,
|
|
1704
|
-
...pkg?.devDependencies
|
|
1705
|
-
"@commitlint/cli": "^18.6.1",
|
|
1706
|
-
"@commitlint/config-conventional": "^18.6.3"
|
|
1738
|
+
...pkg?.devDependencies
|
|
1707
1739
|
},
|
|
1708
1740
|
config: {
|
|
1709
1741
|
...pkg?.config,
|
|
1710
|
-
commitizen:
|
|
1711
|
-
|
|
1712
|
-
}
|
|
1742
|
+
commitizen: void 0
|
|
1743
|
+
// 移除旧的 commitizen 配置
|
|
1713
1744
|
}
|
|
1714
1745
|
};
|
|
1715
1746
|
await saveProjectJson(projectPath, pkgData);
|
|
1747
|
+
const files = [".czrc"];
|
|
1748
|
+
await copyFilesFromTemplates(projectPath, files, true);
|
|
1716
1749
|
loading.succeed("commitizen 初始化成功!");
|
|
1717
1750
|
} catch (error) {
|
|
1718
1751
|
console.error(error);
|
|
@@ -1794,10 +1827,10 @@ async function initTest(projectPath, answers) {
|
|
|
1794
1827
|
await copyFilesFromTemplates(projectPath, files);
|
|
1795
1828
|
const pkg = await getProjectJson(projectPath);
|
|
1796
1829
|
const devDependencies = {
|
|
1797
|
-
vitest: "^2.
|
|
1830
|
+
vitest: "^3.2.4"
|
|
1798
1831
|
};
|
|
1799
1832
|
if (!pkg?.dependencies?.vite && !pkg?.devDependencies?.vite) {
|
|
1800
|
-
devDependencies.vite = "^
|
|
1833
|
+
devDependencies.vite = "^7.0.5";
|
|
1801
1834
|
}
|
|
1802
1835
|
const newPkg = (0, import_lodash.merge)({}, pkg, {
|
|
1803
1836
|
scripts: {
|
|
@@ -2012,10 +2045,6 @@ async function saveProjectJson(projectPath, pkgData) {
|
|
|
2012
2045
|
await import_fs_extra3.default.writeFile(pkgPath, JSON.stringify(newPkg, null, 2));
|
|
2013
2046
|
}
|
|
2014
2047
|
|
|
2015
|
-
// src/plopfile.ts
|
|
2016
|
-
var import_fs_extra4 = __toESM(require("fs-extra"));
|
|
2017
|
-
var import_path3 = __toESM(require("path"));
|
|
2018
|
-
|
|
2019
2048
|
// src/utils/exec.ts
|
|
2020
2049
|
var import_child_process2 = require("child_process");
|
|
2021
2050
|
var import_colors2 = __toESM(require("@colors/colors"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cmyr-template-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.1",
|
|
4
4
|
"description": "草梅友仁自制的项目模板创建器",
|
|
5
5
|
"author": "CaoMeiYouRen",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"cmyr-template": "dist/index.js"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"lint": "cross-env NODE_ENV=production eslint
|
|
21
|
+
"lint": "cross-env NODE_ENV=production eslint . --fix",
|
|
22
22
|
"prebuild": "rimraf dist",
|
|
23
23
|
"build": "cross-env NODE_ENV=production tsup",
|
|
24
24
|
"dev": "cross-env NODE_ENV=development ts-node-dev src/index.ts",
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
"build:prod": "npm run build && rimraf temp && cross-env NODE_ENV=production ct create"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"@semantic-release/
|
|
35
|
+
"@commitlint/cli": "^19.8.1",
|
|
36
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
37
|
+
"@semantic-release/git": "^10.0.1",
|
|
37
38
|
"@types/debug": "^4.1.5",
|
|
38
39
|
"@types/ejs": "^3.1.0",
|
|
39
40
|
"@types/fs-extra": "^11.0.0",
|
|
@@ -41,20 +42,18 @@
|
|
|
41
42
|
"@types/libsodium-wrappers": "^0.7.14",
|
|
42
43
|
"@types/lodash": "^4.14.165",
|
|
43
44
|
"@types/node": "^24.0.7",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"conventional-changelog-cli": "^5.0.0",
|
|
48
|
-
"conventional-changelog-cmyr-config": "^2.1.1",
|
|
45
|
+
"commitizen": "^4.3.1",
|
|
46
|
+
"commitlint-config-cmyr": "1.0.0-beta.3",
|
|
47
|
+
"conventional-changelog-cmyr-config": "3.0.0-beta.1",
|
|
49
48
|
"cross-env": "^10.0.0",
|
|
50
|
-
"cz-conventional-changelog-cmyr": "
|
|
49
|
+
"cz-conventional-changelog-cmyr": "2.0.0-beta.3",
|
|
51
50
|
"debug": "^4.3.1",
|
|
52
|
-
"eslint": "
|
|
53
|
-
"eslint-config-cmyr": "
|
|
51
|
+
"eslint": "^9.34.0",
|
|
52
|
+
"eslint-config-cmyr": "2.0.0-beta.15",
|
|
54
53
|
"husky": "^9.0.5",
|
|
55
54
|
"lint-staged": "^16.1.0",
|
|
56
55
|
"rimraf": "^6.0.0",
|
|
57
|
-
"semantic-release": "
|
|
56
|
+
"semantic-release": "24.2.7",
|
|
58
57
|
"ts-node": "^10.2.1",
|
|
59
58
|
"ts-node-dev": "^2.0.0",
|
|
60
59
|
"tsup": "^8.3.5",
|
package/templates/.czrc
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import pkg from './package.json' with { type: 'json' }
|
|
2
|
+
const { name } = pkg
|
|
3
|
+
/**
|
|
4
|
+
* @type {import('semantic-release').GlobalConfig}
|
|
5
|
+
*/
|
|
6
|
+
export default {
|
|
7
|
+
plugins: [
|
|
8
|
+
[
|
|
9
|
+
'@semantic-release/commit-analyzer',
|
|
10
|
+
{
|
|
11
|
+
config: 'conventional-changelog-cmyr-config',
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
'@semantic-release/release-notes-generator',
|
|
16
|
+
{
|
|
17
|
+
config: 'conventional-changelog-cmyr-config',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
'@semantic-release/changelog',
|
|
22
|
+
{
|
|
23
|
+
changelogFile: 'CHANGELOG.md',
|
|
24
|
+
changelogTitle: `# ${name}`,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
'@semantic-release/npm',
|
|
28
|
+
'@semantic-release/github',
|
|
29
|
+
[
|
|
30
|
+
'@semantic-release/git',
|
|
31
|
+
{
|
|
32
|
+
assets: [
|
|
33
|
+
'CHANGELOG.md',
|
|
34
|
+
'package.json',
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
],
|
|
39
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/* eslint-disable no-console, @typescript-eslint/no-var-requires */
|
|
2
|
-
const fs = require('fs-extra')
|
|
3
1
|
const path = require('path')
|
|
2
|
+
const fs = require('fs-extra')
|
|
4
3
|
const { nodeFileTrace } = require('@vercel/nft');
|
|
5
4
|
// !!! if any new dependencies are added, update the Dockerfile !!!
|
|
6
5
|
|
package/templates/.eslintignore
DELETED
package/templates/.releaserc.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const { name } = require('./package.json')
|
|
2
|
-
module.exports = {
|
|
3
|
-
plugins: [
|
|
4
|
-
[
|
|
5
|
-
"@semantic-release/commit-analyzer",
|
|
6
|
-
{
|
|
7
|
-
"config": "conventional-changelog-cmyr-config"
|
|
8
|
-
}
|
|
9
|
-
],
|
|
10
|
-
[
|
|
11
|
-
"@semantic-release/release-notes-generator",
|
|
12
|
-
{
|
|
13
|
-
"config": "conventional-changelog-cmyr-config"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
[
|
|
17
|
-
"@semantic-release/changelog",
|
|
18
|
-
{
|
|
19
|
-
"changelogFile": "CHANGELOG.md",
|
|
20
|
-
"changelogTitle": "# " + name
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
'@semantic-release/npm',
|
|
24
|
-
'@semantic-release/github',
|
|
25
|
-
[
|
|
26
|
-
"@semantic-release/git",
|
|
27
|
-
{
|
|
28
|
-
"assets": [
|
|
29
|
-
"CHANGELOG.md",
|
|
30
|
-
"package.json"
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
]
|
|
35
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['@commitlint/config-conventional'],
|
|
3
|
-
rules: {
|
|
4
|
-
'type-enum': [2, 'always', [
|
|
5
|
-
'feat',
|
|
6
|
-
'fix',
|
|
7
|
-
'docs',
|
|
8
|
-
'style',
|
|
9
|
-
'refactor',
|
|
10
|
-
'perf',
|
|
11
|
-
'test',
|
|
12
|
-
'build',
|
|
13
|
-
'ci',
|
|
14
|
-
'chore',
|
|
15
|
-
'revert',
|
|
16
|
-
]],
|
|
17
|
-
'subject-full-stop': [0, 'never'],
|
|
18
|
-
'subject-case': [0, 'never'],
|
|
19
|
-
'body-max-line-length': [0, 'never'],
|
|
20
|
-
'footer-max-line-length': [0, 'never'],
|
|
21
|
-
'header-max-length': [2, 'always', 120],
|
|
22
|
-
},
|
|
23
|
-
}
|