cmyr-template-cli 1.41.2 → 1.41.4
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/plopfile.js +25 -25
- package/package.json +7 -10
- package/templates/.github/workflows/docker.yml +3 -3
- package/templates/.github/workflows/release.yml +2 -2
- package/templates/.github/workflows/test.yml +2 -2
- package/templates/.github/workflows/todo.yml +2 -2
- package/templates/release.config.js +1 -34
package/dist/plopfile.js
CHANGED
|
@@ -1478,7 +1478,7 @@ async function initCommitlint(projectPath) {
|
|
|
1478
1478
|
try {
|
|
1479
1479
|
const pkg = await getProjectJson(projectPath);
|
|
1480
1480
|
const devDependencies = {
|
|
1481
|
-
commitlint: "
|
|
1481
|
+
commitlint: `^${await getNpmPackageVersion("commitlint")}`,
|
|
1482
1482
|
"@commitlint/cli": void 0
|
|
1483
1483
|
};
|
|
1484
1484
|
const pkgData = {
|
|
@@ -1544,10 +1544,12 @@ async function initSemanticRelease(projectPath) {
|
|
|
1544
1544
|
await removeFiles(projectPath, files);
|
|
1545
1545
|
await copyFilesFromTemplates(projectPath, ["release.config.js"], true);
|
|
1546
1546
|
const devDependencies = {
|
|
1547
|
-
"
|
|
1548
|
-
"
|
|
1549
|
-
"
|
|
1550
|
-
"conventional-changelog-
|
|
1547
|
+
"semantic-release": `^${await getNpmPackageVersion("semantic-release")}`,
|
|
1548
|
+
"semantic-release-cmyr-config": `^${await getNpmPackageVersion("semantic-release-cmyr-config")}`,
|
|
1549
|
+
"conventional-changelog-cli": void 0,
|
|
1550
|
+
"conventional-changelog-cmyr-config": void 0,
|
|
1551
|
+
"@semantic-release/changelog": void 0,
|
|
1552
|
+
"@semantic-release/git": void 0
|
|
1551
1553
|
};
|
|
1552
1554
|
const pkgData = {
|
|
1553
1555
|
scripts: {
|
|
@@ -1556,9 +1558,7 @@ async function initSemanticRelease(projectPath) {
|
|
|
1556
1558
|
},
|
|
1557
1559
|
devDependencies: {
|
|
1558
1560
|
...pkg?.devDependencies,
|
|
1559
|
-
...devDependencies
|
|
1560
|
-
"conventional-changelog-cmyr-config": `^${await getNpmPackageVersion("conventional-changelog-cmyr-config")}`,
|
|
1561
|
-
"semantic-release": devDependencies["semantic-release"]
|
|
1561
|
+
...devDependencies
|
|
1562
1562
|
},
|
|
1563
1563
|
changelog: {
|
|
1564
1564
|
language: "zh"
|
|
@@ -1590,8 +1590,8 @@ async function initHusky(projectPath) {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
const keyname = `*.{${extnames.join(",")}}`;
|
|
1592
1592
|
const devDependencies = {
|
|
1593
|
-
husky: "
|
|
1594
|
-
"lint-staged": "
|
|
1593
|
+
husky: `^${await getNpmPackageVersion("husky")}`,
|
|
1594
|
+
"lint-staged": `^${await getNpmPackageVersion("lint-staged")}`
|
|
1595
1595
|
};
|
|
1596
1596
|
const pkgData = {
|
|
1597
1597
|
scripts: {
|
|
@@ -1599,8 +1599,8 @@ async function initHusky(projectPath) {
|
|
|
1599
1599
|
prepare: "husky init"
|
|
1600
1600
|
},
|
|
1601
1601
|
devDependencies: {
|
|
1602
|
-
...devDependencies,
|
|
1603
|
-
...
|
|
1602
|
+
...pkg?.devDependencies,
|
|
1603
|
+
...devDependencies
|
|
1604
1604
|
},
|
|
1605
1605
|
husky: void 0,
|
|
1606
1606
|
"lint-staged": {
|
|
@@ -1634,7 +1634,7 @@ async function initEslint(projectPath, answers) {
|
|
|
1634
1634
|
if (templateMeta?.language === "vue") {
|
|
1635
1635
|
Object.assign(devDependencies, {
|
|
1636
1636
|
"@vue/eslint-config-typescript": void 0,
|
|
1637
|
-
"eslint-plugin-vue": "
|
|
1637
|
+
"eslint-plugin-vue": `^${await getNpmPackageVersion("eslint-plugin-vue")}`
|
|
1638
1638
|
});
|
|
1639
1639
|
extnames.push("vue");
|
|
1640
1640
|
eslintType = "eslint-config-cmyr/vue";
|
|
@@ -1642,17 +1642,17 @@ async function initEslint(projectPath, answers) {
|
|
|
1642
1642
|
extnames.push("jsx", "tsx");
|
|
1643
1643
|
eslintType = "eslint-config-cmyr/react";
|
|
1644
1644
|
Object.assign(devDependencies, {
|
|
1645
|
-
"eslint-plugin-react": "
|
|
1645
|
+
"eslint-plugin-react": `^${await getNpmPackageVersion("eslint-plugin-react")}`
|
|
1646
1646
|
});
|
|
1647
1647
|
}
|
|
1648
1648
|
const pkgData = {
|
|
1649
1649
|
scripts: {
|
|
1650
|
-
|
|
1651
|
-
|
|
1650
|
+
...pkg?.scripts,
|
|
1651
|
+
lint: `cross-env NODE_ENV=production eslint . --fix`
|
|
1652
1652
|
},
|
|
1653
1653
|
devDependencies: {
|
|
1654
|
-
...devDependencies,
|
|
1655
1654
|
...pkg?.devDependencies,
|
|
1655
|
+
...devDependencies,
|
|
1656
1656
|
"eslint-config-cmyr": `^${await getNpmPackageVersion("eslint-config-cmyr")}`
|
|
1657
1657
|
}
|
|
1658
1658
|
};
|
|
@@ -1693,9 +1693,9 @@ async function initStylelint(projectPath) {
|
|
|
1693
1693
|
const files = ["stylelint.config.js"];
|
|
1694
1694
|
await copyFilesFromTemplates(projectPath, files, true);
|
|
1695
1695
|
const devDependencies = {
|
|
1696
|
-
postcss: "
|
|
1697
|
-
sass: "
|
|
1698
|
-
stylelint: "
|
|
1696
|
+
postcss: `^${await getNpmPackageVersion("postcss")}`,
|
|
1697
|
+
sass: `^${await getNpmPackageVersion("sass")}`,
|
|
1698
|
+
stylelint: `^${await getNpmPackageVersion("stylelint")}`,
|
|
1699
1699
|
"stylelint-config-cmyr": `^${await getNpmPackageVersion("stylelint-config-cmyr")}`,
|
|
1700
1700
|
// 移除不必要的依赖
|
|
1701
1701
|
"postcss-html": void 0,
|
|
@@ -1713,8 +1713,8 @@ async function initStylelint(projectPath) {
|
|
|
1713
1713
|
...pkg?.scripts
|
|
1714
1714
|
},
|
|
1715
1715
|
devDependencies: {
|
|
1716
|
-
...devDependencies,
|
|
1717
|
-
...
|
|
1716
|
+
...pkg?.devDependencies,
|
|
1717
|
+
...devDependencies
|
|
1718
1718
|
}
|
|
1719
1719
|
};
|
|
1720
1720
|
await saveProjectJson(projectPath, pkgData);
|
|
@@ -1729,7 +1729,7 @@ async function initCommitizen(projectPath) {
|
|
|
1729
1729
|
try {
|
|
1730
1730
|
const pkg = await getProjectJson(projectPath);
|
|
1731
1731
|
const devDependencies = {
|
|
1732
|
-
commitizen: "
|
|
1732
|
+
commitizen: `^${await getNpmPackageVersion("commitizen")}`,
|
|
1733
1733
|
"cz-conventional-changelog-cmyr": `^${await getNpmPackageVersion("cz-conventional-changelog-cmyr")}`
|
|
1734
1734
|
};
|
|
1735
1735
|
const pkgData = {
|
|
@@ -1738,8 +1738,8 @@ async function initCommitizen(projectPath) {
|
|
|
1738
1738
|
commit: "cz"
|
|
1739
1739
|
},
|
|
1740
1740
|
devDependencies: {
|
|
1741
|
-
...devDependencies,
|
|
1742
|
-
...
|
|
1741
|
+
...pkg?.devDependencies,
|
|
1742
|
+
...devDependencies
|
|
1743
1743
|
},
|
|
1744
1744
|
config: {
|
|
1745
1745
|
...pkg?.config,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cmyr-template-cli",
|
|
3
|
-
"version": "1.41.
|
|
3
|
+
"version": "1.41.4",
|
|
4
4
|
"description": "草梅友仁自制的项目模板创建器",
|
|
5
5
|
"author": "CaoMeiYouRen",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"lint": "cross-env NODE_ENV=production eslint . --fix",
|
|
22
22
|
"prebuild": "rimraf dist",
|
|
23
23
|
"build": "cross-env NODE_ENV=production tsup",
|
|
24
|
-
"dev": "cross-env NODE_ENV=development
|
|
24
|
+
"dev": "cross-env NODE_ENV=development tsx --watch src/index.ts",
|
|
25
25
|
"dev:tsup": "cross-env NODE_ENV=development tsup --watch",
|
|
26
26
|
"rm": "rimraf node_modules",
|
|
27
27
|
"start": "node ./dist/index.js",
|
|
@@ -33,8 +33,6 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@commitlint/cli": "^19.8.1",
|
|
36
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
37
|
-
"@semantic-release/git": "^10.0.1",
|
|
38
36
|
"@types/debug": "^4.1.5",
|
|
39
37
|
"@types/ejs": "^3.1.0",
|
|
40
38
|
"@types/fs-extra": "^11.0.0",
|
|
@@ -43,20 +41,19 @@
|
|
|
43
41
|
"@types/lodash": "^4.14.165",
|
|
44
42
|
"@types/node": "^24.0.7",
|
|
45
43
|
"commitizen": "^4.3.1",
|
|
46
|
-
"commitlint-config-cmyr": "1.0.0
|
|
47
|
-
"conventional-changelog-cmyr-config": "3.0.0-beta.1",
|
|
44
|
+
"commitlint-config-cmyr": "1.0.0",
|
|
48
45
|
"cross-env": "^10.0.0",
|
|
49
|
-
"cz-conventional-changelog-cmyr": "2.0.0
|
|
46
|
+
"cz-conventional-changelog-cmyr": "2.0.0",
|
|
50
47
|
"debug": "^4.3.1",
|
|
51
48
|
"eslint": "^9.34.0",
|
|
52
|
-
"eslint-config-cmyr": "2.0.0
|
|
49
|
+
"eslint-config-cmyr": "2.0.0",
|
|
53
50
|
"husky": "^9.0.5",
|
|
54
51
|
"lint-staged": "^16.1.0",
|
|
55
52
|
"rimraf": "^6.0.0",
|
|
56
53
|
"semantic-release": "24.2.7",
|
|
57
|
-
"
|
|
58
|
-
"ts-node-dev": "^2.0.0",
|
|
54
|
+
"semantic-release-cmyr-config": "1.0.0",
|
|
59
55
|
"tsup": "^8.3.5",
|
|
56
|
+
"tsx": "^4.20.5",
|
|
60
57
|
"typescript": "^5.0.2"
|
|
61
58
|
},
|
|
62
59
|
"dependencies": {
|
|
@@ -17,13 +17,13 @@ jobs:
|
|
|
17
17
|
runs-on: ubuntu-latest
|
|
18
18
|
timeout-minutes: 10
|
|
19
19
|
steps:
|
|
20
|
-
- uses: actions/checkout@
|
|
20
|
+
- uses: actions/checkout@v5
|
|
21
21
|
- name: Setup pnpm
|
|
22
22
|
uses: pnpm/action-setup@v4
|
|
23
23
|
with:
|
|
24
24
|
version: "latest"
|
|
25
25
|
- name: Setup Node.js@lts environment
|
|
26
|
-
uses: actions/setup-node@
|
|
26
|
+
uses: actions/setup-node@v5
|
|
27
27
|
with:
|
|
28
28
|
node-version: "lts/*"
|
|
29
29
|
cache: "pnpm"
|
|
@@ -39,7 +39,7 @@ jobs:
|
|
|
39
39
|
packages: write
|
|
40
40
|
contents: read
|
|
41
41
|
steps:
|
|
42
|
-
- uses: actions/checkout@
|
|
42
|
+
- uses: actions/checkout@v5
|
|
43
43
|
with:
|
|
44
44
|
persist-credentials: false
|
|
45
45
|
- name: Set up QEMU
|
|
@@ -18,7 +18,7 @@ jobs:
|
|
|
18
18
|
issues: write
|
|
19
19
|
pull-requests: write
|
|
20
20
|
steps:
|
|
21
|
-
- uses: actions/checkout@
|
|
21
|
+
- uses: actions/checkout@v5
|
|
22
22
|
with:
|
|
23
23
|
persist-credentials: false
|
|
24
24
|
- name: Setup pnpm
|
|
@@ -26,7 +26,7 @@ jobs:
|
|
|
26
26
|
with:
|
|
27
27
|
version: "latest"
|
|
28
28
|
- name: Setup Node.js environment
|
|
29
|
-
uses: actions/setup-node@
|
|
29
|
+
uses: actions/setup-node@v5
|
|
30
30
|
with:
|
|
31
31
|
node-version: "lts/*"
|
|
32
32
|
cache: "pnpm"
|
|
@@ -9,13 +9,13 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
timeout-minutes: 10
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v5
|
|
13
13
|
- name: Setup pnpm
|
|
14
14
|
uses: pnpm/action-setup@v4
|
|
15
15
|
with:
|
|
16
16
|
version: "latest"
|
|
17
17
|
- name: Setup Node.js@lts environment
|
|
18
|
-
uses: actions/setup-node@
|
|
18
|
+
uses: actions/setup-node@v5
|
|
19
19
|
with:
|
|
20
20
|
node-version: "lts/*"
|
|
21
21
|
cache: "pnpm"
|
|
@@ -1,39 +1,6 @@
|
|
|
1
|
-
import pkg from './package.json' with { type: 'json' }
|
|
2
|
-
const { name } = pkg
|
|
3
1
|
/**
|
|
4
2
|
* @type {import('semantic-release').GlobalConfig}
|
|
5
3
|
*/
|
|
6
4
|
export default {
|
|
7
|
-
|
|
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
|
-
],
|
|
5
|
+
extends: ['semantic-release-cmyr-config'],
|
|
39
6
|
}
|