cmyr-template-cli 1.19.0 → 1.19.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/dist/plopfile.js +5 -2
- package/package.json +1 -1
- package/templates/README.md +3 -1
package/dist/plopfile.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var lodash = require('lodash');
|
|
5
4
|
var fs = require('fs-extra');
|
|
6
5
|
var path = require('path');
|
|
7
6
|
var ora = require('ora');
|
|
@@ -10,6 +9,7 @@ var axios = require('axios');
|
|
|
10
9
|
var child_process = require('child_process');
|
|
11
10
|
var colors = require('colors');
|
|
12
11
|
var ejs = require('ejs');
|
|
12
|
+
var lodash = require('lodash');
|
|
13
13
|
var core = require('@lint-md/core');
|
|
14
14
|
var JSON5 = require('json5');
|
|
15
15
|
|
|
@@ -1070,6 +1070,9 @@ async function removeFiles(projectPath, files) {
|
|
|
1070
1070
|
throw error;
|
|
1071
1071
|
}
|
|
1072
1072
|
}
|
|
1073
|
+
function kebabCase(str) {
|
|
1074
|
+
return str.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/_+/g, '-').replace(/\s+/g, '-').toLowerCase();
|
|
1075
|
+
}
|
|
1073
1076
|
|
|
1074
1077
|
module.exports = function (plop) {
|
|
1075
1078
|
plop.setActionType('initProject', initProject);
|
|
@@ -1085,7 +1088,7 @@ module.exports = function (plop) {
|
|
|
1085
1088
|
return input.trim().length !== 0;
|
|
1086
1089
|
},
|
|
1087
1090
|
default: '',
|
|
1088
|
-
filter: (e) =>
|
|
1091
|
+
filter: (e) => kebabCase(e.trim()),
|
|
1089
1092
|
},
|
|
1090
1093
|
{
|
|
1091
1094
|
type: 'input',
|
package/package.json
CHANGED
package/templates/README.md
CHANGED
|
@@ -144,12 +144,14 @@
|
|
|
144
144
|
<img src="https://cdn.jsdelivr.net/gh/CaoMeiYouRen/image-hosting-01@master/images/202112181214695.png">
|
|
145
145
|
</a>
|
|
146
146
|
<% } -%>
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
<% if (isEnableStarHistory) { -%>
|
|
149
149
|
## 🌟 Star History
|
|
150
150
|
|
|
151
151
|
[](https://star-history.com/#<%= authorGithubUsername %>/<%= projectName %>&Date)
|
|
152
152
|
<% } -%>
|
|
153
|
+
|
|
154
|
+
<% if (licenseName && licenseUrl) { -%>
|
|
153
155
|
## 📝 License
|
|
154
156
|
|
|
155
157
|
<% if (authorName && authorGithubUsername) { -%>
|