easy-soft-develop 2.1.73 → 2.1.79

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/bin/cli.js CHANGED
@@ -13,6 +13,7 @@ const createRepositoryProject = require('../src/cliCollection/create-repository-
13
13
  const clearAllDependence = require('../src/cliCollection/clear-all-dependence');
14
14
  const updatePackageFromPackage = require('../src/cliCollection/update-package-from-package');
15
15
  const createProjectWithTemplate = require('../src/cliCollection/create-project-with-template');
16
+ const createProjectWithMasterTemplate = require('../src/cliCollection/create-project-with-master-template');
16
17
  const prompt = require('../src/cliCollection/prompt');
17
18
  const code = require('../src/cliCollection/createCode');
18
19
 
@@ -131,6 +132,19 @@ program
131
132
  createProjectWithTemplate.run(a, o);
132
133
  });
133
134
 
135
+ program
136
+ .command('create-project-with-master-template')
137
+ .description('update package from local or remote package.json file')
138
+ .option('--templateUrl <string>', 'template url with download')
139
+ .option('--folder <string>', 'folder name create project in it')
140
+ .option(
141
+ '--exampleUrl <string>',
142
+ 'example url, if it has value, will prompt info after create',
143
+ )
144
+ .action((a, o) => {
145
+ createProjectWithMasterTemplate.run(a, o);
146
+ });
147
+
134
148
  program
135
149
  .command('code')
136
150
  .description('generate code source with code.json')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-soft-develop",
3
- "version": "2.1.73",
3
+ "version": "2.1.79",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/kityandhero/easy-soft-develop#readme",
6
6
  "bugs": {
@@ -57,6 +57,7 @@
57
57
  "z:post:extra:install": "echo do other postinstall work with here",
58
58
  "z:prettier:format:all": "npx prettier --write .",
59
59
  "z:prettier:format:change": "npx prettier --cache --write . && node ./bin/cli.js prompt --message \"format changed files complete\" --type success --blankLine",
60
+ "prez:publish:build": "npm run z:install && pnpm changeset && pnpm changeset version && npm run z:cz",
60
61
  "z:publish:build": "npm run z:publish:patch:npm",
61
62
  "postz:publish:build": "git push",
62
63
  "prez:publish:patch:npm": "npm run z:cz && npm version patch",
@@ -84,7 +85,7 @@
84
85
  "@commitlint/config-conventional": "^19.2.2",
85
86
  "@commitlint/config-pnpm-scopes": "^19.1.0",
86
87
  "commitizen": "^4.3.0",
87
- "conventional-changelog-conventionalcommits": "^7.0.2",
88
+ "conventional-changelog-conventionalcommits": "^8.0.0",
88
89
  "cz-git": "^1.9.1",
89
90
  "eslint": "^8.57.0",
90
91
  "eslint-config-prettier": "^9.1.0",
@@ -0,0 +1,65 @@
1
+ const download = require('download-git-repo');
2
+
3
+ const {
4
+ promptError,
5
+ exit,
6
+ checkStringIsEmpty,
7
+ promptWarn,
8
+ mkdirSync,
9
+ existDirectorySync,
10
+ promptInfo,
11
+ resolvePath,
12
+ promptSuccess,
13
+ } = require('../tools/meta');
14
+
15
+ exports.run = function (s, o) {
16
+ const {
17
+ _optionValues: { templateUrl, folder, exampleUrl = '' },
18
+ } = o;
19
+
20
+ if (checkStringIsEmpty(folder)) {
21
+ promptWarn('Please enter project folder name');
22
+
23
+ exit();
24
+ }
25
+
26
+ if (checkStringIsEmpty(folder)) {
27
+ promptWarn('project folder name not allow empty');
28
+
29
+ exit();
30
+ } else {
31
+ const templateUrlAdjust = checkStringIsEmpty(templateUrl)
32
+ ? 'https://gitee.com/lzt/mono-antd-management-fast-master-template.git' // 'https://gitee.com/lzt/mono-antd-management-fast-master-template/repository/archive/main.zip'
33
+ : templateUrl;
34
+
35
+ const folderPath = resolvePath(`./${folder}`);
36
+
37
+ if (existDirectorySync(folderPath)) {
38
+ promptWarn('project folder already exist, please choose another');
39
+
40
+ exit();
41
+ }
42
+
43
+ mkdirSync(folderPath);
44
+
45
+ promptInfo(`template url:${templateUrlAdjust}`);
46
+ promptInfo(`folder:${folder}`);
47
+ promptInfo('download will start, please wait a moment...');
48
+
49
+ download(templateUrlAdjust, folderPath, { clone: false }, (err) => {
50
+ if (!err) {
51
+ promptSuccess('download success');
52
+
53
+ if (!checkStringIsEmpty(exampleUrl)) {
54
+ promptInfo(`we build a example project repo is here: ${exampleUrl}`);
55
+ }
56
+
57
+ promptInfo('please modify info in package.json file');
58
+ } else {
59
+ promptError(err);
60
+ }
61
+
62
+ exit();
63
+ });
64
+ }
65
+ };
@@ -0,0 +1 @@
1
+ export function run(s: any, o: any): void;