@ansstory/hias 1.0.0 → 1.0.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/lib/config.js +8 -4
- package/lib/core/action.js +4 -3
- package/lib/core/commander.js +6 -6
- package/package.json +1 -1
package/lib/config.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
const foramworkUrl = {
|
|
2
|
-
'
|
|
3
|
-
'
|
|
4
|
-
'
|
|
5
|
-
'
|
|
2
|
+
'vue2': 'https://gitee.com/AnsStory/hias-vue2-template.git',
|
|
3
|
+
'vue3': 'https://gitee.com/AnsStory/hias-vue3-template.git',
|
|
4
|
+
'vue-ts': 'https://gitee.com/AnsStory/hias-vue-ts-template.git',
|
|
5
|
+
'uni-vite': 'https://gitee.com/AnsStory/hias-uni-vite.git',
|
|
6
|
+
'nuxt-web': 'https://gitee.com/AnsStory/hias-nuxt-web-tmp.git',
|
|
7
|
+
'vue-screen': 'https://gitee.com/AnsStory/hias-vite-screen.git',
|
|
8
|
+
'react': 'https://gitee.com/AnsStory/hias-react-template.git',
|
|
9
|
+
'react-ts': 'https://gitee.com/AnsStory/hias-react-ts-template.git',
|
|
6
10
|
}
|
|
7
11
|
const framwork = Object.keys(foramworkUrl)
|
|
8
12
|
|
package/lib/core/action.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
const inquirer = require('inquirer')
|
|
2
|
+
const chalk = require('chalk')
|
|
2
3
|
const { program } = require('commander')
|
|
3
4
|
var config = require('../config')
|
|
4
5
|
var downloadFun = require('./download')
|
|
@@ -29,7 +30,7 @@ async function addComponentAction(cpnName, temPath, fileType) {
|
|
|
29
30
|
|
|
30
31
|
const dest = program.opts().dest || 'src/components'
|
|
31
32
|
await writeFile(`${dest}/${cpnName}.${fileType}`, result)
|
|
32
|
-
console.log('Component creation was successful:', cpnName
|
|
33
|
+
console.log(chalk.green.bold('Component creation was successful:'), chalk.blue.bold(`${cpnName}.${fileType}`), chalk.underline(dest))
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
async function addVueComponentAction(cpnName) {
|
|
@@ -54,5 +55,5 @@ module.exports = {
|
|
|
54
55
|
addReactComponentAction,
|
|
55
56
|
addReactTsComponentAction,
|
|
56
57
|
addReduxStoreAction,
|
|
57
|
-
addReduxTsStoreAction
|
|
58
|
+
addReduxTsStoreAction,
|
|
58
59
|
}
|
package/lib/core/commander.js
CHANGED
|
@@ -8,26 +8,26 @@ const {
|
|
|
8
8
|
} = require('./action')
|
|
9
9
|
|
|
10
10
|
const beginCommander = function (program) {
|
|
11
|
-
program.command('create <project> [other...]').alias('crt').description('create project. For example:
|
|
11
|
+
program.command('create <project> [other...]').alias('crt').description('create project. For example: hias create airbnb').action(beginAction)
|
|
12
12
|
program
|
|
13
13
|
.command('adv <vuecpnname> [...others]')
|
|
14
|
-
.description('add vue component into a folder, For example:
|
|
14
|
+
.description('add vue component into a folder, For example: hias addv Demo -d src/components')
|
|
15
15
|
.action(addVueComponentAction)
|
|
16
16
|
program
|
|
17
17
|
.command('adr <reactcpnname> [...others]')
|
|
18
|
-
.description('add react jsx component into a folder, For example:
|
|
18
|
+
.description('add react jsx component into a folder, For example: hias addr Demo -d src/components')
|
|
19
19
|
.action(addReactComponentAction)
|
|
20
20
|
program
|
|
21
21
|
.command('adrt <reactcpnname> [...others]')
|
|
22
|
-
.description('add react tsx component into a folder, For example:
|
|
22
|
+
.description('add react tsx component into a folder, For example: hias addrt Demo -d src/components')
|
|
23
23
|
.action(addReactTsComponentAction)
|
|
24
24
|
program
|
|
25
25
|
.command('adrd <reactcpnname> [...others]')
|
|
26
|
-
.description('add redux jsx store into a folder, For example:
|
|
26
|
+
.description('add redux jsx store into a folder, For example: hias addrt useDemoStore -d src/store/modules')
|
|
27
27
|
.action(addReduxStoreAction)
|
|
28
28
|
program
|
|
29
29
|
.command('adrdt <reactcpnname> [...others]')
|
|
30
|
-
.description('add redux tsx store into a folder, For example:
|
|
30
|
+
.description('add redux tsx store into a folder, For example: hias addrt useDemoStore -d src/store/modules')
|
|
31
31
|
.action(addReduxTsStoreAction)
|
|
32
32
|
}
|
|
33
33
|
|