cmyr-template-cli 1.30.0 → 1.30.2
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/README.md +4 -1
- package/dist/plopfile.js +4 -34
- package/package.json +4 -4
- package/templates/README.md +8 -0
package/README.md
CHANGED
|
@@ -68,7 +68,8 @@ ct create
|
|
|
68
68
|
"PATREON_USERNAME": "",
|
|
69
69
|
"WEIBO_USERNAME": "",
|
|
70
70
|
"TWITTER_USERNAME": "",
|
|
71
|
-
"NPM_USERNAME": ""
|
|
71
|
+
"NPM_USERNAME": "",
|
|
72
|
+
"DOCKER_USERNAME": ""
|
|
72
73
|
}
|
|
73
74
|
```
|
|
74
75
|
|
|
@@ -90,6 +91,8 @@ TWITTER_USERNAME:Twitter 用户名,可空,默认值为空
|
|
|
90
91
|
|
|
91
92
|
NPM_USERNAME:Npm 用户名,可空,默认会使用 `GITHUB_USERNAME` 的用户名
|
|
92
93
|
|
|
94
|
+
DOCKER_USERNAME:Docker Hub 用户名,可空,默认会使用**小写的** `GITHUB_USERNAME` 的用户名
|
|
95
|
+
|
|
93
96
|
**如果不使用自动初始化远程仓库功能,可以跳过该配置**
|
|
94
97
|
|
|
95
98
|
## 开发
|
package/dist/plopfile.js
CHANGED
|
@@ -78,14 +78,6 @@ const TEMPLATES_META_LIST = [
|
|
|
78
78
|
docker: false,
|
|
79
79
|
priority: 0,
|
|
80
80
|
},
|
|
81
|
-
{
|
|
82
|
-
name: 'electron-vue-template',
|
|
83
|
-
language: 'vue',
|
|
84
|
-
runtime: 'browser',
|
|
85
|
-
vueVersion: 3,
|
|
86
|
-
docker: false,
|
|
87
|
-
priority: 0,
|
|
88
|
-
},
|
|
89
81
|
{
|
|
90
82
|
name: 'nuxt-template',
|
|
91
83
|
language: 'vue',
|
|
@@ -126,14 +118,6 @@ const TEMPLATES_META_LIST = [
|
|
|
126
118
|
docker: false,
|
|
127
119
|
priority: 0,
|
|
128
120
|
},
|
|
129
|
-
{
|
|
130
|
-
name: 'react16-template',
|
|
131
|
-
language: 'react',
|
|
132
|
-
runtime: 'browser',
|
|
133
|
-
vueVersion: 0,
|
|
134
|
-
docker: false,
|
|
135
|
-
priority: 0,
|
|
136
|
-
},
|
|
137
121
|
{
|
|
138
122
|
name: 'ts-template',
|
|
139
123
|
language: 'typescript',
|
|
@@ -151,14 +135,6 @@ const TEMPLATES_META_LIST = [
|
|
|
151
135
|
docker: true,
|
|
152
136
|
priority: 0,
|
|
153
137
|
},
|
|
154
|
-
{
|
|
155
|
-
name: 'koa2-template',
|
|
156
|
-
language: 'typescript',
|
|
157
|
-
runtime: 'nodejs',
|
|
158
|
-
vueVersion: 0,
|
|
159
|
-
docker: true,
|
|
160
|
-
priority: 0,
|
|
161
|
-
},
|
|
162
138
|
{
|
|
163
139
|
name: 'nest-template',
|
|
164
140
|
language: 'typescript',
|
|
@@ -167,15 +143,6 @@ const TEMPLATES_META_LIST = [
|
|
|
167
143
|
docker: true,
|
|
168
144
|
priority: 0,
|
|
169
145
|
},
|
|
170
|
-
{
|
|
171
|
-
name: 'auto-release-template',
|
|
172
|
-
language: 'typescript',
|
|
173
|
-
runtime: 'nodejs',
|
|
174
|
-
vueVersion: 0,
|
|
175
|
-
docker: false,
|
|
176
|
-
npm: true,
|
|
177
|
-
priority: 0,
|
|
178
|
-
},
|
|
179
146
|
{
|
|
180
147
|
name: 'tsup-template',
|
|
181
148
|
language: 'typescript',
|
|
@@ -303,6 +270,7 @@ const NODE_DEPENDENCIES = {
|
|
|
303
270
|
log4js: '^6.9.1',
|
|
304
271
|
md5: '^2.3.0',
|
|
305
272
|
rimraf: '^5.0.0',
|
|
273
|
+
zx: '^8.1.0',
|
|
306
274
|
},
|
|
307
275
|
};
|
|
308
276
|
const VUE2_DEPENDENCIES = {
|
|
@@ -905,7 +873,8 @@ async function getProjectInfo(projectPath, answers) {
|
|
|
905
873
|
const twitterUsername = config === null || config === void 0 ? void 0 : config.TWITTER_USERNAME;
|
|
906
874
|
const afdianUsername = config === null || config === void 0 ? void 0 : config.AFDIAN_USERNAME;
|
|
907
875
|
const patreonUsername = config === null || config === void 0 ? void 0 : config.PATREON_USERNAME;
|
|
908
|
-
const npmUsername = (config === null || config === void 0 ? void 0 : config.NPM_USERNAME) ||
|
|
876
|
+
const npmUsername = (config === null || config === void 0 ? void 0 : config.NPM_USERNAME) || githubUsername;
|
|
877
|
+
const dockerUsername = (config === null || config === void 0 ? void 0 : config.DOCKER_USERNAME) || (githubUsername === null || githubUsername === void 0 ? void 0 : githubUsername.toLowerCase());
|
|
909
878
|
const repositoryUrl = `https://github.com/${githubUsername}/${projectName}`;
|
|
910
879
|
const gitUrl = `git+${repositoryUrl}.git`;
|
|
911
880
|
const issuesUrl = `${repositoryUrl}/issues`;
|
|
@@ -971,6 +940,7 @@ async function getProjectInfo(projectPath, answers) {
|
|
|
971
940
|
weiboUsername,
|
|
972
941
|
twitterUsername,
|
|
973
942
|
npmUsername,
|
|
943
|
+
dockerUsername,
|
|
974
944
|
templateMeta,
|
|
975
945
|
mainFile,
|
|
976
946
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cmyr-template-cli",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.2",
|
|
4
4
|
"description": "草梅友仁自制的项目模板创建器",
|
|
5
5
|
"author": "CaoMeiYouRen",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@types/lodash": "^4.14.165",
|
|
47
47
|
"@types/node": "^20.0.0",
|
|
48
48
|
"@types/promise.any": "^2.0.0",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "7.
|
|
50
|
-
"@typescript-eslint/parser": "7.
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "7.16.1",
|
|
50
|
+
"@typescript-eslint/parser": "7.16.1",
|
|
51
51
|
"commitizen": "^4.2.2",
|
|
52
52
|
"conventional-changelog-cli": "^5.0.0",
|
|
53
53
|
"conventional-changelog-cmyr-config": "^2.1.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"eslint-config-cmyr": "^1.1.27",
|
|
59
59
|
"husky": "^9.0.5",
|
|
60
60
|
"lint-staged": "^15.0.1",
|
|
61
|
-
"rimraf": "^
|
|
61
|
+
"rimraf": "^6.0.0",
|
|
62
62
|
"rollup": "^2.79.0",
|
|
63
63
|
"rollup-plugin-terser": "^7.0.2",
|
|
64
64
|
"semantic-release": "21.1.2",
|
package/templates/README.md
CHANGED
|
@@ -4,10 +4,18 @@
|
|
|
4
4
|
<a href="https://www.npmjs.com/package/<%= packageName %>" target="_blank">
|
|
5
5
|
<img alt="Version" src="https://img.shields.io/npm/v/<%= packageName %>.svg">
|
|
6
6
|
</a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/<%= packageName %>" target="_blank">
|
|
8
|
+
<img alt="npm downloads" src="https://img.shields.io/npm/dt/<%= packageName %>?label=npm%20downloads&color=yellow">
|
|
9
|
+
</a>
|
|
7
10
|
<% } -%>
|
|
8
11
|
<% if (projectVersion && isJSProject) { -%>
|
|
9
12
|
<img alt="Version" src="https://img.shields.io/github/package-json/v/<%= authorGithubUsername %>/<%= packageName %>.svg" />
|
|
10
13
|
<% } -%>
|
|
14
|
+
<% if (isOpenSource && isInitDocker) { -%>
|
|
15
|
+
<a href="https://hub.docker.com/r/<%= dockerUsername %>/<%= projectName %>" target="_blank">
|
|
16
|
+
<img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/<%= dockerUsername %>/<%= projectName %>">
|
|
17
|
+
</a>
|
|
18
|
+
<% } -%>
|
|
11
19
|
<% if (isGithubRepos && isInitSemanticRelease) { -%>
|
|
12
20
|
<a href="<%= repositoryUrl %>/actions?query=workflow%3ARelease" target="_blank">
|
|
13
21
|
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/<%= authorGithubUsername %>/<%= projectName %>/release.yml?branch=master">
|