@yyp92-cli/create 0.1.0 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @yyp92-cli/create
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @yyp92-cli/utils@0.0.3
9
+
3
10
  ## 0.1.0
4
11
 
5
12
  ### Minor Changes
package/dist/index.js CHANGED
@@ -7,10 +7,43 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { select, input } from '@inquirer/prompts';
11
+ import os from 'node:os';
12
+ // import ora from 'ora';
10
13
  function create() {
11
14
  return __awaiter(this, void 0, void 0, function* () {
12
- console.log('create 命令执行中...');
15
+ const projectTemplate = yield select({
16
+ message: '请选择项目模板',
17
+ choices: [
18
+ {
19
+ name: 'react pc 项目',
20
+ value: '@yyp92-cli/template-react-pc'
21
+ },
22
+ {
23
+ name: 'react mobile 项目',
24
+ value: '@yyp92-cli/template-react-mobile'
25
+ },
26
+ {
27
+ name: 'vue pc 项目',
28
+ value: '@yyp92-cli/template-vue-pc'
29
+ },
30
+ {
31
+ name: 'vue mobile 项目',
32
+ value: '@yyp92-cli/template-vue-mobile'
33
+ }
34
+ ]
35
+ });
36
+ let projectName = '';
37
+ while (!projectName) {
38
+ projectName = yield input({ message: '请输入项目名' });
39
+ }
40
+ // const pkg = new NpmPackage({
41
+ // name: projectTemplate,
42
+ // targetPath: path.join(os.homedir(), '.yyp92-cli-tenplate')
43
+ // })
44
+ console.log(projectTemplate, projectName, os.homedir());
13
45
  });
14
46
  }
47
+ create();
15
48
  export default create;
16
49
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,SAAe,MAAM;;QACjB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IAClC,CAAC;CAAA;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,SAAS,CAAC;AAGzB,yBAAyB;AAEzB,SAAe,MAAM;;QACjB,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC;YACjC,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,aAAa;oBACnB,KAAK,EAAE,8BAA8B;iBACxC;gBACD;oBACI,IAAI,EAAE,iBAAiB;oBACvB,KAAK,EAAE,kCAAkC;iBAC5C;gBACD;oBACI,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,4BAA4B;iBACtC;gBACD;oBACI,IAAI,EAAE,eAAe;oBACrB,KAAK,EAAE,gCAAgC;iBAC1C;aACJ;SACJ,CAAC,CAAA;QAEF,IAAI,WAAW,GAAG,EAAE,CAAC;QACrB,OAAM,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,MAAM,KAAK,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,+BAA+B;QAC/B,6BAA6B;QAC7B,iEAAiE;QACjE,KAAK;QAEL,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,WAAW,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,CAAA;IAC3D,CAAC;CAAA;AAED,MAAM,EAAE,CAAC;AAET,eAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yyp92-cli/create",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,6 +11,10 @@
11
11
  "author": "",
12
12
  "license": "ISC",
13
13
  "description": "",
14
+ "dependencies": {
15
+ "@inquirer/prompts": "^7.8.4",
16
+ "@yyp92-cli/utils": "0.0.3"
17
+ },
14
18
  "scripts": {
15
19
  "test": "echo \"Error: no test specified\" && exit 1"
16
20
  }
package/src/index.ts CHANGED
@@ -1,5 +1,45 @@
1
+ import {select, input} from '@inquirer/prompts';
2
+ import os from 'node:os';
3
+ import { NpmPackage } from '@yyp92-cli/utils';
4
+ import path from 'node:path';
5
+ import ora from 'ora';
6
+
1
7
  async function create() {
2
- console.log('create 命令执行中...')
8
+ const projectTemplate = await select({
9
+ message: '请选择项目模板',
10
+ choices: [
11
+ {
12
+ name: 'react pc 项目',
13
+ value: '@yyp92-cli/template-react-pc'
14
+ },
15
+ {
16
+ name: 'react mobile 项目',
17
+ value: '@yyp92-cli/template-react-mobile'
18
+ },
19
+ {
20
+ name: 'vue pc 项目',
21
+ value: '@yyp92-cli/template-vue-pc'
22
+ },
23
+ {
24
+ name: 'vue mobile 项目',
25
+ value: '@yyp92-cli/template-vue-mobile'
26
+ }
27
+ ]
28
+ })
29
+
30
+ let projectName = '';
31
+ while(!projectName) {
32
+ projectName = await input({ message: '请输入项目名' });
33
+ }
34
+
35
+ const pkg = new NpmPackage({
36
+ name: projectTemplate,
37
+ targetPath: path.join(os.homedir(), '/desktop/.yyp92-cli-tenplate')
38
+ })
39
+
40
+ console.log(projectTemplate, projectName, os.homedir())
3
41
  }
4
42
 
43
+ create();
44
+
5
45
  export default create;