tmui-cli 1.1.5 → 1.1.7
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 +19 -7
- package/bin/cmdTool.js +223 -0
- package/bin/createTmui.js +375 -0
- package/bin/dirTool.js +152 -0
- package/bin/hooks.js +58 -15
- package/bin/net.js +136 -0
- package/bin/selectedDir.js +28 -0
- package/bin/tmui.js +22 -243
- package/package.json +23 -62
- package/website/favicon.ico +0 -0
- package/website/index.html +20 -0
- package/website/js/app.js +997 -0
- package/website/js/chunk-vendors.js +13592 -0
- package/bin/cmd/cmdTool.js +0 -219
- package/bin/cmd/dirTool.js +0 -174
- package/bin/cmd/selectedDir.js +0 -27
- package/bin/donet.js +0 -50
- package/src/create.js +0 -176
- package/src/create4xhbx.js +0 -98
- package/src/createHbx.js +0 -142
- package/src/rcli.js +0 -136
- package/src/rhbx.js +0 -131
- package/src/router.js +0 -28
- package/src/theme.js +0 -8
- package/src/tmui2.js +0 -60
- package/src/util.js +0 -37
- package/src/viewTmuiVer.js +0 -24
package/bin/tmui.js
CHANGED
|
@@ -1,243 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// async function main(){
|
|
26
|
-
// const Chalk = await (await chalk).default
|
|
27
|
-
// const Inquirer = await (await inquirer).default
|
|
28
|
-
// const Fetch = await (await fetch).default
|
|
29
|
-
// figlet('TMUI3.1.0',figletSucess)
|
|
30
|
-
// function figletSucess(err,d){
|
|
31
|
-
// console.log(Chalk.green(d))
|
|
32
|
-
// console.log(Chalk.white('请注意浏览器打开状态,如果打开失败'))
|
|
33
|
-
// console.log(Chalk.white('请访问:http://localhost:6170'))
|
|
34
|
-
// }
|
|
35
|
-
|
|
36
|
-
// }
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// main()
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
chalk.then(v=>{
|
|
52
|
-
const ck = new v.Chalk();
|
|
53
|
-
|
|
54
|
-
figlet('TMUI4.0x CLI', function(err, data) {
|
|
55
|
-
if (err) {
|
|
56
|
-
console.log('Something went wrong...');
|
|
57
|
-
console.dir(err);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
console.log(ck.green(data))
|
|
61
|
-
console.log(ck.green(`tmui2.0文档地址:https://jx2d.cn`))
|
|
62
|
-
console.log(ck.blue(`tmui3.0文档地址:https://tmui.design`))
|
|
63
|
-
console.log(ck.yellow(`tmui4.0x文档地址:https://xui.tmui.design`))
|
|
64
|
-
console.log(ck.white(`---------------------------------------------------`))
|
|
65
|
-
console.log(ck.white(`命令使用方式为:tmui xxx命令 比如:tmui use`))
|
|
66
|
-
console.log(ck.white(`---------------------------------------------------`))
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
inquirer.then(ivk=>{
|
|
70
|
-
const { prompt,Separator} = ivk.default;
|
|
71
|
-
|
|
72
|
-
function createTest(type,name){
|
|
73
|
-
if(type=="rcli"){
|
|
74
|
-
rcli.run(type,name,null,'npm','')
|
|
75
|
-
}else if(type=="rhbx"){
|
|
76
|
-
createHbx.run(type,name,null,'npm','')
|
|
77
|
-
}
|
|
78
|
-
prompt([{
|
|
79
|
-
type: 'input',
|
|
80
|
-
name: 'filename',
|
|
81
|
-
message: '在当前路径下创建项目,请输入项目名称:',
|
|
82
|
-
}, ])
|
|
83
|
-
.then(answers2 => {
|
|
84
|
-
if(type=="cli"){
|
|
85
|
-
create.run(type,name,null,'npm',answers2.filename)
|
|
86
|
-
}else if(type=="rcli"){
|
|
87
|
-
rcli.run(type,name,null,'npm',answers2.filename)
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
program
|
|
92
|
-
.version(require('../package').version)
|
|
93
|
-
program.command('4x')
|
|
94
|
-
.description('创建uniapp的tmui4.0x hbx项目')
|
|
95
|
-
.action(function(type, name){
|
|
96
|
-
create4xhbx.run(type,name,null,null)
|
|
97
|
-
})
|
|
98
|
-
program.command('cli')
|
|
99
|
-
.description('创建uniapp的cli项目包含tmui3.0[推荐]')
|
|
100
|
-
.action(function(type, name){
|
|
101
|
-
createTest('cli',name)
|
|
102
|
-
})
|
|
103
|
-
program.command('hbx')
|
|
104
|
-
.description('创建uniapp的hbx项目包含tmui3.0[不推荐]')
|
|
105
|
-
.action(function(type, name){
|
|
106
|
-
// createHbx.run(type,name)
|
|
107
|
-
createTest('hbx',name)
|
|
108
|
-
|
|
109
|
-
})
|
|
110
|
-
program.command('rcli')
|
|
111
|
-
.description('为cli项目下载/更新tmui3.0')
|
|
112
|
-
.action(function(type, name){
|
|
113
|
-
// rcli.run(type,name)
|
|
114
|
-
createTest('rcli',name)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
})
|
|
118
|
-
program.command('rhbx')
|
|
119
|
-
.description('为hbx项目下载/更新tmui3.0')
|
|
120
|
-
.action(function(type, name){
|
|
121
|
-
// rhbx.run(type,name)
|
|
122
|
-
createTest('rhbx',name)
|
|
123
|
-
})
|
|
124
|
-
program.command('ver')
|
|
125
|
-
.description('查看tmui可用版本号')
|
|
126
|
-
.action(function(type, name){
|
|
127
|
-
viewTmuiVer.run(type,name)
|
|
128
|
-
})
|
|
129
|
-
program.command('use')
|
|
130
|
-
.description('引导式安装tmui3.0项目[自定义安装]')
|
|
131
|
-
.action(function(type, name){
|
|
132
|
-
prompt([
|
|
133
|
-
{
|
|
134
|
-
type: 'list',
|
|
135
|
-
name: 'tmuiVerName',
|
|
136
|
-
message: '请选择你的uniApp项目的vue版本/项目类型',
|
|
137
|
-
choices: [
|
|
138
|
-
'vue2',
|
|
139
|
-
'vue3',
|
|
140
|
-
'tmui4.0x'
|
|
141
|
-
],
|
|
142
|
-
}
|
|
143
|
-
])
|
|
144
|
-
.then((answers) => {
|
|
145
|
-
if(answers.tmuiVerName=="vue2"){
|
|
146
|
-
console.log("tmui2.0版本只支持uniApp HBX项目,请务必当前目录在你的项目文件夹下/或者一个空文件都可以。")
|
|
147
|
-
console.log("正在为你的项目下载/更新tmui2.0的最新版本。")
|
|
148
|
-
tm2.run()
|
|
149
|
-
}else if(answers.tmuiVerName=='vue3'){
|
|
150
|
-
|
|
151
|
-
ft.then((fah)=>{
|
|
152
|
-
const fetch = fah.default
|
|
153
|
-
fetch('https://cdn.tmui.design/tmuiVer.txt').then(async (res)=>{
|
|
154
|
-
let verText = await res.text();
|
|
155
|
-
let lastVer = verText.split('\n').slice(0,10)
|
|
156
|
-
prompt([
|
|
157
|
-
{
|
|
158
|
-
type: 'list',
|
|
159
|
-
name: 'moshi',
|
|
160
|
-
message: '选择安装方式:',
|
|
161
|
-
choices: [
|
|
162
|
-
'cli',
|
|
163
|
-
'rcli',
|
|
164
|
-
'hbx',
|
|
165
|
-
'rhbx',
|
|
166
|
-
],
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
type: 'list',
|
|
170
|
-
name: 'ver',
|
|
171
|
-
message: '选择最近的版本号',
|
|
172
|
-
choices: lastVer,
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
type: 'list',
|
|
176
|
-
name: 'pack',
|
|
177
|
-
message: '选择你的包管理框架',
|
|
178
|
-
choices: [
|
|
179
|
-
'npm',
|
|
180
|
-
'yarn',
|
|
181
|
-
'pnpm',
|
|
182
|
-
'cnpm',
|
|
183
|
-
],
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
])
|
|
187
|
-
.then((answers) => {
|
|
188
|
-
let ms = answers.moshi;
|
|
189
|
-
let ver = answers.ver.trim()
|
|
190
|
-
let packname=answers.pack.trim()
|
|
191
|
-
if(!ver||typeof ver=="undefined"){
|
|
192
|
-
console.log(ck.red("请正确输入版本号"))
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
prompt([{
|
|
196
|
-
type: 'input',
|
|
197
|
-
name: 'filename',
|
|
198
|
-
message: '在当前路径下创建项目,请输入项目名称:',
|
|
199
|
-
}, ])
|
|
200
|
-
.then(answers2 => {
|
|
201
|
-
|
|
202
|
-
if(ms=="cli"){
|
|
203
|
-
create.run(null,null,ver,packname,answers2.filename)
|
|
204
|
-
}else if(ms=="rcli"){
|
|
205
|
-
rcli.run(null,null,ver,packname,answers2.filename)
|
|
206
|
-
}else if(ms=="hbx"){
|
|
207
|
-
createHbx.run(null,null,ver,packname,answers2.filename)
|
|
208
|
-
}else if(ms=="rhbx"){
|
|
209
|
-
rhbx.run(null,null,ver,packname,answers2.filename)
|
|
210
|
-
}
|
|
211
|
-
})
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
})
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
}else if(answers.tmuiVerName=='tmui4.0x'){
|
|
220
|
-
|
|
221
|
-
prompt([{
|
|
222
|
-
type: 'input',
|
|
223
|
-
name: 'filename',
|
|
224
|
-
message: '在当前路径下创建项目,请输入项目名称:',
|
|
225
|
-
}, ])
|
|
226
|
-
.then(answers2 => {
|
|
227
|
-
create4xhbx.run(null,null,null,answers2.filename)
|
|
228
|
-
})
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
})
|
|
234
|
-
program.parse();
|
|
235
|
-
|
|
236
|
-
})
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
})
|
|
243
|
-
|
|
1
|
+
import { Chalk } from "chalk";
|
|
2
|
+
import figlet from "figlet"
|
|
3
|
+
import { createNet } from "./net.js";
|
|
4
|
+
import "./hooks.js";
|
|
5
|
+
|
|
6
|
+
let chalk = new Chalk()
|
|
7
|
+
const main = ()=>{
|
|
8
|
+
figlet('TMUI for UniApp',function(err,d){
|
|
9
|
+
if(err){
|
|
10
|
+
console.log(chalk.red(err))
|
|
11
|
+
console.dir(err)
|
|
12
|
+
return
|
|
13
|
+
}
|
|
14
|
+
console.log(chalk.green(d))
|
|
15
|
+
console.log(chalk.yellow('请注意浏览器打开状态,如果打开失败'))
|
|
16
|
+
console.log(chalk.yellow('请访问:http://localhost:6170'))
|
|
17
|
+
createNet()
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
main();
|
|
22
|
+
|
package/package.json
CHANGED
|
@@ -1,70 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"registry": true,
|
|
10
|
-
"raw": "tmui-cli",
|
|
11
|
-
"name": "tmui-cli",
|
|
12
|
-
"escapedName": "tmui-cli",
|
|
13
|
-
"rawSpec": "",
|
|
14
|
-
"saveSpec": null,
|
|
15
|
-
"fetchSpec": "latest"
|
|
2
|
+
"name": "tmui-cli",
|
|
3
|
+
"version": "1.1.7",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "tmui2.0,3.0,4.0x,3.2",
|
|
6
|
+
"main": "./bin/tmui.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "node ./bin/tmui.js"
|
|
16
9
|
},
|
|
17
|
-
"
|
|
18
|
-
"
|
|
10
|
+
"keywords": [
|
|
11
|
+
"tmui"
|
|
19
12
|
],
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"_spec": "tmui-cli",
|
|
23
|
-
"_where": "C:\\Users\\zsylp",
|
|
24
|
-
"author": {
|
|
25
|
-
"name": "tmzdy tmui"
|
|
26
|
-
},
|
|
27
|
-
"bin": {
|
|
28
|
-
"tmui": "bin/tmui.js"
|
|
29
|
-
},
|
|
13
|
+
"author": "tmzdy",
|
|
14
|
+
"license": "MIT",
|
|
30
15
|
"dependencies": {
|
|
16
|
+
"body-parser": "^1.20.3",
|
|
31
17
|
"bufferhelper": "^0.2.1",
|
|
32
|
-
"chalk": "^5.0
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"figlet": "^1.5.2",
|
|
41
|
-
"global-dirs": "^3.0.1",
|
|
42
|
-
"iconv-lite": "^0.6.3",
|
|
43
|
-
"inquirer": "^9.1.4",
|
|
44
|
-
"node-fetch": "^3.2.10",
|
|
18
|
+
"chalk": "^5.3.0",
|
|
19
|
+
"codecs": "^3.1.0",
|
|
20
|
+
"compressing": "^1.10.1",
|
|
21
|
+
"express": "^4.21.1",
|
|
22
|
+
"figlet": "^1.8.0",
|
|
23
|
+
"global-dirs": "^4.0.0",
|
|
24
|
+
"inquirer": "^12.0.0",
|
|
25
|
+
"node-fetch": "^3.3.2",
|
|
45
26
|
"node-os-utils": "^1.3.7",
|
|
46
|
-
"open": "^
|
|
27
|
+
"open": "^10.1.0",
|
|
47
28
|
"ps-tree": "^1.2.0",
|
|
48
|
-
"ws": "^8.
|
|
49
|
-
}
|
|
50
|
-
"deprecated": false,
|
|
51
|
-
"description": "tmui3.0,tmui4.0x,tmui2.0",
|
|
52
|
-
"keywords": [
|
|
53
|
-
"tmui",
|
|
54
|
-
"tm-vuetify",
|
|
55
|
-
"tmui4",
|
|
56
|
-
"tmui4.0x",
|
|
57
|
-
"tmui2.0",
|
|
58
|
-
"uts",
|
|
59
|
-
"uvue",
|
|
60
|
-
"uniappx",
|
|
61
|
-
"uniapp"
|
|
62
|
-
],
|
|
63
|
-
"license": "ISC",
|
|
64
|
-
"main": "./bin/tmui.js",
|
|
65
|
-
"name": "tmui-cli",
|
|
66
|
-
"scripts": {
|
|
67
|
-
"run": "node ./bin/tmui.js"
|
|
68
|
-
},
|
|
69
|
-
"version": "1.1.5"
|
|
29
|
+
"ws": "^8.18.0"
|
|
30
|
+
}
|
|
70
31
|
}
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
7
|
+
<link rel="icon" href="/favicon.ico" />
|
|
8
|
+
<title>tmuistore</title>
|
|
9
|
+
<script defer src="/js/chunk-vendors.js"></script><script defer src="/js/app.js"></script></head>
|
|
10
|
+
<body>
|
|
11
|
+
<noscript>
|
|
12
|
+
<strong
|
|
13
|
+
>We're sorry but tmuistore doesn't work properly without JavaScript enabled. Please enable it to
|
|
14
|
+
continue.</strong
|
|
15
|
+
>
|
|
16
|
+
</noscript>
|
|
17
|
+
<div id="app"></div>
|
|
18
|
+
<!-- built files will be auto injected -->
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|