@baic/yolk-cli 2.1.0-alpha.132 → 2.1.0-alpha.133
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/compiled/commander/package.json +1 -1
- package/compiled/glob/index.d.ts +102 -0
- package/compiled/glob/index.js +2222 -0
- package/compiled/glob/package.json +1 -0
- package/compiled/minimatch/index.d.ts +312 -0
- package/compiled/minimatch/index.js +1292 -0
- package/compiled/minimatch/package.json +1 -0
- package/compiled/mkdirp/index.d.ts +114 -0
- package/compiled/mkdirp/index.js +348 -0
- package/compiled/mkdirp/package.json +1 -0
- package/compiled/mustache/package.json +1 -1
- package/compiled/prettier/index.js +3 -3
- package/compiled/prettier/package.json +1 -1
- package/compiled/rimraf/index.d.ts +48 -0
- package/compiled/rimraf/index.js +449 -0
- package/compiled/rimraf/package.json +1 -0
- package/compiled/staged-git-files/package.json +1 -1
- package/es/yolk.js +1 -1
- package/lib/yolk.js +1 -1
- package/package.json +12 -10
- package/templates/miniprogram/project.config.json.tpl +1 -1
- package/templates/umi-mobile/src/pages/demo/index.tsx +3 -3
- package/templates/umi-mobile-h5+app/src/pages/demo/index.tsx +3 -3
- package/templates/umi-mobile-native/android/app/build.gradle +4 -19
- package/templates/umi-mobile-native/android/app/libs/Bluetooth-release.aar +0 -0
- package/templates/umi-mobile-native/android/gradle.properties +1 -1
- package/templates/umi-mobile-native/src/common/bluetooth.ts +6 -6
- package/templates/umi-mobile-native/src/common/bridge.ts +6 -6
- package/templates/umi-mobile-native/src/pages/demo/index.tsx +3 -3
- package/templates/umi-web/src/pages/demo/index.tsx +3 -3
- package/templates/umi-web-screen/src/components/resize-container/index.tsx +5 -5
- package/es/.lintstagedrc.js +0 -27
- package/es/index.d.ts +0 -3
- package/es/util.d.ts +0 -18
- package/es/util.js +0 -1
- package/es/yolk.d.ts +0 -2
- package/lib/.lintstagedrc.js +0 -27
- package/lib/index.d.ts +0 -3
- package/lib/util.d.ts +0 -18
- package/lib/util.js +0 -1
- package/lib/yolk.d.ts +0 -2
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
/******/ (function() { // webpackBootstrap
|
|
2
|
+
/******/ var __webpack_modules__ = ({
|
|
3
|
+
|
|
4
|
+
/***/ 780:
|
|
5
|
+
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
|
|
6
|
+
|
|
7
|
+
const assert = __nccwpck_require__(491)
|
|
8
|
+
const path = __nccwpck_require__(17)
|
|
9
|
+
const fs = __nccwpck_require__(147)
|
|
10
|
+
let glob = undefined
|
|
11
|
+
try {
|
|
12
|
+
glob = __nccwpck_require__(110)
|
|
13
|
+
} catch (_err) {
|
|
14
|
+
// treat glob as optional.
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const defaultGlobOpts = {
|
|
18
|
+
nosort: true,
|
|
19
|
+
silent: true
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// for EMFILE handling
|
|
23
|
+
let timeout = 0
|
|
24
|
+
|
|
25
|
+
const isWindows = (process.platform === "win32")
|
|
26
|
+
|
|
27
|
+
const defaults = options => {
|
|
28
|
+
const methods = [
|
|
29
|
+
'unlink',
|
|
30
|
+
'chmod',
|
|
31
|
+
'stat',
|
|
32
|
+
'lstat',
|
|
33
|
+
'rmdir',
|
|
34
|
+
'readdir'
|
|
35
|
+
]
|
|
36
|
+
methods.forEach(m => {
|
|
37
|
+
options[m] = options[m] || fs[m]
|
|
38
|
+
m = m + 'Sync'
|
|
39
|
+
options[m] = options[m] || fs[m]
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
options.maxBusyTries = options.maxBusyTries || 3
|
|
43
|
+
options.emfileWait = options.emfileWait || 1000
|
|
44
|
+
if (options.glob === false) {
|
|
45
|
+
options.disableGlob = true
|
|
46
|
+
}
|
|
47
|
+
if (options.disableGlob !== true && glob === undefined) {
|
|
48
|
+
throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')
|
|
49
|
+
}
|
|
50
|
+
options.disableGlob = options.disableGlob || false
|
|
51
|
+
options.glob = options.glob || defaultGlobOpts
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const rimraf = (p, options, cb) => {
|
|
55
|
+
if (typeof options === 'function') {
|
|
56
|
+
cb = options
|
|
57
|
+
options = {}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
assert(p, 'rimraf: missing path')
|
|
61
|
+
assert.equal(typeof p, 'string', 'rimraf: path should be a string')
|
|
62
|
+
assert.equal(typeof cb, 'function', 'rimraf: callback function required')
|
|
63
|
+
assert(options, 'rimraf: invalid options argument provided')
|
|
64
|
+
assert.equal(typeof options, 'object', 'rimraf: options should be object')
|
|
65
|
+
|
|
66
|
+
defaults(options)
|
|
67
|
+
|
|
68
|
+
let busyTries = 0
|
|
69
|
+
let errState = null
|
|
70
|
+
let n = 0
|
|
71
|
+
|
|
72
|
+
const next = (er) => {
|
|
73
|
+
errState = errState || er
|
|
74
|
+
if (--n === 0)
|
|
75
|
+
cb(errState)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const afterGlob = (er, results) => {
|
|
79
|
+
if (er)
|
|
80
|
+
return cb(er)
|
|
81
|
+
|
|
82
|
+
n = results.length
|
|
83
|
+
if (n === 0)
|
|
84
|
+
return cb()
|
|
85
|
+
|
|
86
|
+
results.forEach(p => {
|
|
87
|
+
const CB = (er) => {
|
|
88
|
+
if (er) {
|
|
89
|
+
if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
|
|
90
|
+
busyTries < options.maxBusyTries) {
|
|
91
|
+
busyTries ++
|
|
92
|
+
// try again, with the same exact callback as this one.
|
|
93
|
+
return setTimeout(() => rimraf_(p, options, CB), busyTries * 100)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// this one won't happen if graceful-fs is used.
|
|
97
|
+
if (er.code === "EMFILE" && timeout < options.emfileWait) {
|
|
98
|
+
return setTimeout(() => rimraf_(p, options, CB), timeout ++)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// already gone
|
|
102
|
+
if (er.code === "ENOENT") er = null
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
timeout = 0
|
|
106
|
+
next(er)
|
|
107
|
+
}
|
|
108
|
+
rimraf_(p, options, CB)
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (options.disableGlob || !glob.hasMagic(p))
|
|
113
|
+
return afterGlob(null, [p])
|
|
114
|
+
|
|
115
|
+
options.lstat(p, (er, stat) => {
|
|
116
|
+
if (!er)
|
|
117
|
+
return afterGlob(null, [p])
|
|
118
|
+
|
|
119
|
+
glob(p, options.glob, afterGlob)
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Two possible strategies.
|
|
125
|
+
// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
|
|
126
|
+
// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
|
|
127
|
+
//
|
|
128
|
+
// Both result in an extra syscall when you guess wrong. However, there
|
|
129
|
+
// are likely far more normal files in the world than directories. This
|
|
130
|
+
// is based on the assumption that a the average number of files per
|
|
131
|
+
// directory is >= 1.
|
|
132
|
+
//
|
|
133
|
+
// If anyone ever complains about this, then I guess the strategy could
|
|
134
|
+
// be made configurable somehow. But until then, YAGNI.
|
|
135
|
+
const rimraf_ = (p, options, cb) => {
|
|
136
|
+
assert(p)
|
|
137
|
+
assert(options)
|
|
138
|
+
assert(typeof cb === 'function')
|
|
139
|
+
|
|
140
|
+
// sunos lets the root user unlink directories, which is... weird.
|
|
141
|
+
// so we have to lstat here and make sure it's not a dir.
|
|
142
|
+
options.lstat(p, (er, st) => {
|
|
143
|
+
if (er && er.code === "ENOENT")
|
|
144
|
+
return cb(null)
|
|
145
|
+
|
|
146
|
+
// Windows can EPERM on stat. Life is suffering.
|
|
147
|
+
if (er && er.code === "EPERM" && isWindows)
|
|
148
|
+
fixWinEPERM(p, options, er, cb)
|
|
149
|
+
|
|
150
|
+
if (st && st.isDirectory())
|
|
151
|
+
return rmdir(p, options, er, cb)
|
|
152
|
+
|
|
153
|
+
options.unlink(p, er => {
|
|
154
|
+
if (er) {
|
|
155
|
+
if (er.code === "ENOENT")
|
|
156
|
+
return cb(null)
|
|
157
|
+
if (er.code === "EPERM")
|
|
158
|
+
return (isWindows)
|
|
159
|
+
? fixWinEPERM(p, options, er, cb)
|
|
160
|
+
: rmdir(p, options, er, cb)
|
|
161
|
+
if (er.code === "EISDIR")
|
|
162
|
+
return rmdir(p, options, er, cb)
|
|
163
|
+
}
|
|
164
|
+
return cb(er)
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const fixWinEPERM = (p, options, er, cb) => {
|
|
170
|
+
assert(p)
|
|
171
|
+
assert(options)
|
|
172
|
+
assert(typeof cb === 'function')
|
|
173
|
+
|
|
174
|
+
options.chmod(p, 0o666, er2 => {
|
|
175
|
+
if (er2)
|
|
176
|
+
cb(er2.code === "ENOENT" ? null : er)
|
|
177
|
+
else
|
|
178
|
+
options.stat(p, (er3, stats) => {
|
|
179
|
+
if (er3)
|
|
180
|
+
cb(er3.code === "ENOENT" ? null : er)
|
|
181
|
+
else if (stats.isDirectory())
|
|
182
|
+
rmdir(p, options, er, cb)
|
|
183
|
+
else
|
|
184
|
+
options.unlink(p, cb)
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const fixWinEPERMSync = (p, options, er) => {
|
|
190
|
+
assert(p)
|
|
191
|
+
assert(options)
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
options.chmodSync(p, 0o666)
|
|
195
|
+
} catch (er2) {
|
|
196
|
+
if (er2.code === "ENOENT")
|
|
197
|
+
return
|
|
198
|
+
else
|
|
199
|
+
throw er
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
let stats
|
|
203
|
+
try {
|
|
204
|
+
stats = options.statSync(p)
|
|
205
|
+
} catch (er3) {
|
|
206
|
+
if (er3.code === "ENOENT")
|
|
207
|
+
return
|
|
208
|
+
else
|
|
209
|
+
throw er
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (stats.isDirectory())
|
|
213
|
+
rmdirSync(p, options, er)
|
|
214
|
+
else
|
|
215
|
+
options.unlinkSync(p)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const rmdir = (p, options, originalEr, cb) => {
|
|
219
|
+
assert(p)
|
|
220
|
+
assert(options)
|
|
221
|
+
assert(typeof cb === 'function')
|
|
222
|
+
|
|
223
|
+
// try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
|
|
224
|
+
// if we guessed wrong, and it's not a directory, then
|
|
225
|
+
// raise the original error.
|
|
226
|
+
options.rmdir(p, er => {
|
|
227
|
+
if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
|
|
228
|
+
rmkids(p, options, cb)
|
|
229
|
+
else if (er && er.code === "ENOTDIR")
|
|
230
|
+
cb(originalEr)
|
|
231
|
+
else
|
|
232
|
+
cb(er)
|
|
233
|
+
})
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const rmkids = (p, options, cb) => {
|
|
237
|
+
assert(p)
|
|
238
|
+
assert(options)
|
|
239
|
+
assert(typeof cb === 'function')
|
|
240
|
+
|
|
241
|
+
options.readdir(p, (er, files) => {
|
|
242
|
+
if (er)
|
|
243
|
+
return cb(er)
|
|
244
|
+
let n = files.length
|
|
245
|
+
if (n === 0)
|
|
246
|
+
return options.rmdir(p, cb)
|
|
247
|
+
let errState
|
|
248
|
+
files.forEach(f => {
|
|
249
|
+
rimraf(path.join(p, f), options, er => {
|
|
250
|
+
if (errState)
|
|
251
|
+
return
|
|
252
|
+
if (er)
|
|
253
|
+
return cb(errState = er)
|
|
254
|
+
if (--n === 0)
|
|
255
|
+
options.rmdir(p, cb)
|
|
256
|
+
})
|
|
257
|
+
})
|
|
258
|
+
})
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// this looks simpler, and is strictly *faster*, but will
|
|
262
|
+
// tie up the JavaScript thread and fail on excessively
|
|
263
|
+
// deep directory trees.
|
|
264
|
+
const rimrafSync = (p, options) => {
|
|
265
|
+
options = options || {}
|
|
266
|
+
defaults(options)
|
|
267
|
+
|
|
268
|
+
assert(p, 'rimraf: missing path')
|
|
269
|
+
assert.equal(typeof p, 'string', 'rimraf: path should be a string')
|
|
270
|
+
assert(options, 'rimraf: missing options')
|
|
271
|
+
assert.equal(typeof options, 'object', 'rimraf: options should be object')
|
|
272
|
+
|
|
273
|
+
let results
|
|
274
|
+
|
|
275
|
+
if (options.disableGlob || !glob.hasMagic(p)) {
|
|
276
|
+
results = [p]
|
|
277
|
+
} else {
|
|
278
|
+
try {
|
|
279
|
+
options.lstatSync(p)
|
|
280
|
+
results = [p]
|
|
281
|
+
} catch (er) {
|
|
282
|
+
results = glob.sync(p, options.glob)
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (!results.length)
|
|
287
|
+
return
|
|
288
|
+
|
|
289
|
+
for (let i = 0; i < results.length; i++) {
|
|
290
|
+
const p = results[i]
|
|
291
|
+
|
|
292
|
+
let st
|
|
293
|
+
try {
|
|
294
|
+
st = options.lstatSync(p)
|
|
295
|
+
} catch (er) {
|
|
296
|
+
if (er.code === "ENOENT")
|
|
297
|
+
return
|
|
298
|
+
|
|
299
|
+
// Windows can EPERM on stat. Life is suffering.
|
|
300
|
+
if (er.code === "EPERM" && isWindows)
|
|
301
|
+
fixWinEPERMSync(p, options, er)
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
try {
|
|
305
|
+
// sunos lets the root user unlink directories, which is... weird.
|
|
306
|
+
if (st && st.isDirectory())
|
|
307
|
+
rmdirSync(p, options, null)
|
|
308
|
+
else
|
|
309
|
+
options.unlinkSync(p)
|
|
310
|
+
} catch (er) {
|
|
311
|
+
if (er.code === "ENOENT")
|
|
312
|
+
return
|
|
313
|
+
if (er.code === "EPERM")
|
|
314
|
+
return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
|
|
315
|
+
if (er.code !== "EISDIR")
|
|
316
|
+
throw er
|
|
317
|
+
|
|
318
|
+
rmdirSync(p, options, er)
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const rmdirSync = (p, options, originalEr) => {
|
|
324
|
+
assert(p)
|
|
325
|
+
assert(options)
|
|
326
|
+
|
|
327
|
+
try {
|
|
328
|
+
options.rmdirSync(p)
|
|
329
|
+
} catch (er) {
|
|
330
|
+
if (er.code === "ENOENT")
|
|
331
|
+
return
|
|
332
|
+
if (er.code === "ENOTDIR")
|
|
333
|
+
throw originalEr
|
|
334
|
+
if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
|
|
335
|
+
rmkidsSync(p, options)
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const rmkidsSync = (p, options) => {
|
|
340
|
+
assert(p)
|
|
341
|
+
assert(options)
|
|
342
|
+
options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))
|
|
343
|
+
|
|
344
|
+
// We only end up here once we got ENOTEMPTY at least once, and
|
|
345
|
+
// at this point, we are guaranteed to have removed all the kids.
|
|
346
|
+
// So, we know that it won't be ENOENT or ENOTDIR or anything else.
|
|
347
|
+
// try really hard to delete stuff on windows, because it has a
|
|
348
|
+
// PROFOUNDLY annoying habit of not closing handles promptly when
|
|
349
|
+
// files are deleted, resulting in spurious ENOTEMPTY errors.
|
|
350
|
+
const retries = isWindows ? 100 : 1
|
|
351
|
+
let i = 0
|
|
352
|
+
do {
|
|
353
|
+
let threw = true
|
|
354
|
+
try {
|
|
355
|
+
const ret = options.rmdirSync(p, options)
|
|
356
|
+
threw = false
|
|
357
|
+
return ret
|
|
358
|
+
} finally {
|
|
359
|
+
if (++i < retries && threw)
|
|
360
|
+
continue
|
|
361
|
+
}
|
|
362
|
+
} while (true)
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
module.exports = rimraf
|
|
366
|
+
rimraf.sync = rimrafSync
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
/***/ }),
|
|
370
|
+
|
|
371
|
+
/***/ 110:
|
|
372
|
+
/***/ (function(module) {
|
|
373
|
+
|
|
374
|
+
"use strict";
|
|
375
|
+
module.exports = require("../glob");
|
|
376
|
+
|
|
377
|
+
/***/ }),
|
|
378
|
+
|
|
379
|
+
/***/ 491:
|
|
380
|
+
/***/ (function(module) {
|
|
381
|
+
|
|
382
|
+
"use strict";
|
|
383
|
+
module.exports = require("assert");
|
|
384
|
+
|
|
385
|
+
/***/ }),
|
|
386
|
+
|
|
387
|
+
/***/ 147:
|
|
388
|
+
/***/ (function(module) {
|
|
389
|
+
|
|
390
|
+
"use strict";
|
|
391
|
+
module.exports = require("fs");
|
|
392
|
+
|
|
393
|
+
/***/ }),
|
|
394
|
+
|
|
395
|
+
/***/ 17:
|
|
396
|
+
/***/ (function(module) {
|
|
397
|
+
|
|
398
|
+
"use strict";
|
|
399
|
+
module.exports = require("path");
|
|
400
|
+
|
|
401
|
+
/***/ })
|
|
402
|
+
|
|
403
|
+
/******/ });
|
|
404
|
+
/************************************************************************/
|
|
405
|
+
/******/ // The module cache
|
|
406
|
+
/******/ var __webpack_module_cache__ = {};
|
|
407
|
+
/******/
|
|
408
|
+
/******/ // The require function
|
|
409
|
+
/******/ function __nccwpck_require__(moduleId) {
|
|
410
|
+
/******/ // Check if module is in cache
|
|
411
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
412
|
+
/******/ if (cachedModule !== undefined) {
|
|
413
|
+
/******/ return cachedModule.exports;
|
|
414
|
+
/******/ }
|
|
415
|
+
/******/ // Create a new module (and put it into the cache)
|
|
416
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
417
|
+
/******/ // no module.id needed
|
|
418
|
+
/******/ // no module.loaded needed
|
|
419
|
+
/******/ exports: {}
|
|
420
|
+
/******/ };
|
|
421
|
+
/******/
|
|
422
|
+
/******/ // Execute the module function
|
|
423
|
+
/******/ var threw = true;
|
|
424
|
+
/******/ try {
|
|
425
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
|
|
426
|
+
/******/ threw = false;
|
|
427
|
+
/******/ } finally {
|
|
428
|
+
/******/ if(threw) delete __webpack_module_cache__[moduleId];
|
|
429
|
+
/******/ }
|
|
430
|
+
/******/
|
|
431
|
+
/******/ // Return the exports of the module
|
|
432
|
+
/******/ return module.exports;
|
|
433
|
+
/******/ }
|
|
434
|
+
/******/
|
|
435
|
+
/************************************************************************/
|
|
436
|
+
/******/ /* webpack/runtime/compat */
|
|
437
|
+
/******/
|
|
438
|
+
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
|
439
|
+
/******/
|
|
440
|
+
/************************************************************************/
|
|
441
|
+
/******/
|
|
442
|
+
/******/ // startup
|
|
443
|
+
/******/ // Load entry module and return exports
|
|
444
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
445
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(780);
|
|
446
|
+
/******/ module.exports = __webpack_exports__;
|
|
447
|
+
/******/
|
|
448
|
+
/******/ })()
|
|
449
|
+
;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"rimraf","version":"3.0.2","author":"Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)","license":"ISC","_lastModified":"2023-04-19T01:06:46.272Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"staged-git-files","version":"1.3.0","author":"Matthew Chase Whittemore <mcwhittemore@gmail.com>","license":"BSD-2-Clause","_lastModified":"2023-
|
|
1
|
+
{"name":"staged-git-files","version":"1.3.0","author":"Matthew Chase Whittemore <mcwhittemore@gmail.com>","license":"BSD-2-Clause","_lastModified":"2023-04-19T01:06:46.318Z"}
|
package/es/yolk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
import e from"@babel/runtime/helpers/esm/defineProperty";import t from"@babel/runtime/helpers/esm/toArray";import o from"@babel/runtime/helpers/esm/asyncToGenerator";import n from"lodash/pick";import r from"lodash/isString";import a from"lodash/floor";function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function c(t){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?i(Object(n),!0).forEach((function(o){e(t,o,n[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}import s from"@babel/runtime/regenerator";import{execSync as m,spawn as p}from"child_process";import l from"fs";import d from"os";import u from"path";import{globSync as f}from"glob";import y from"inquirer";import*as g from"miniprogram-ci";import{mkdirpSync as v}from"mkdirp";import{rimrafSync as b}from"rimraf";import h from"../compiled/commander";import j from"../compiled/mustache";import k from"../package.json";import{ENCODING as O,fail as w,getPackageJSON as S,getProjectConfigJSON as x,getYolkConfig as P,info as D,succeed as _,warn as I}from"./util";var K=require("../compiled/staged-git-files"),q=process.cwd(),F="##### CREATED BY YOLK #####",N={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},E=20,T=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],U=function(e){return"win32"===process.platform?"".concat(e,".cmd"):e},Q=function(){_("yolk complete!"),process.exit(0)},Y=function(){I("yolk break!"),process.exit(0)},W=function(e){var t=e.command,o=e.args,n=e.complete,r=e.close,a=e.exit,i=void 0===a||a,c=p(U(t),o||[],{stdio:"inherit"}).on("close",(function(e){e?(r&&r(),w("yolk close!"),process.exit(e)):(n&&n(),i&&Q())}));process.on("SIGINT",(function(){h.runningCommand&&h.runningCommand.kill("SIGKILL"),c.kill(),Y()}))},L=function(e,t,o){y.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:u.basename(u.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:"default",choices:[{name:"\u9ed8\u8ba4\u5b89\u88c5",value:"default"},{name:"\u8df3\u8fc7\u5b89\u88c5",value:!1},{name:"pnpm install",value:"pnpm"},{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"}]}]).then((function(n){var r={projectName:n.projectName,dependenciesInstallType:n.dependenciesInstallType,yolkVersion:k.version},a=t||u.join(__dirname,"../templates/".concat(n.type));_("\u590d\u5236\u6a21\u7248 ".concat(u.basename(a)));var i=f("**/*",{cwd:a,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(i.forEach((function(t){if(a){var o=u.join(a,t);if(!l.statSync(o).isDirectory())if(t.endsWith(".tpl")){var n=l.readFileSync(o,O),i=u.join(e,t.replace(/\.tpl$/,"")),c=j.render(n,r);v(u.dirname(i)),_("\u521b\u5efa ".concat(u.relative(e,i))),l.writeFileSync(i,c,O)}else{_("\u521b\u5efa ".concat(t));var s=u.join(e,t);v(u.dirname(s)),l.copyFileSync(o,s)}}})),_("\u590d\u5236\u6a21\u7248 success!"),o&&l.existsSync(a)&&b(a)&&_("\u7f13\u5b58\u5220\u9664 success! ".concat(u.basename(a||""))),n.dependenciesInstallType)switch(_("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),n.dependenciesInstallType){case"default":case"pnpm":W({command:"pnpm",args:["install"]});break;case"yarn":W({command:"yarn",args:["install"]});break;case"npm":W({command:"npm",args:["install"]});break;default:}_("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},R=function(e,t){return L(e,t,!0)},A=function(){return l.existsSync(u.join(q,"project.config.json"))},B=function(){var e=l.existsSync(u.join(q,"node_modules/.bin/max"));if(!e)try{e=l.existsSync(require.resolve("@umijs/max"))}catch(n){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test(m("umi -v").toString())}catch(n){}if(!e){var t=u.join(q,"node_modules","umi","package.json");if(l.existsSync(t))try{var o=JSON.parse(l.readFileSync(t,O))||{};e=o.version&&+o.version.split(".")[0]>3}catch(n){}}return e},C=function(){var e=u.join(q,"project.config.json");if(l.existsSync(e)){var t=require(e);return t.appid}return""},G=function(){return l.existsSync(u.join(q,"project.tt.json"))&&0===C().indexOf("tt")},V=function(){return 0===C().indexOf("20")},$=function(){var e=u.join(q,".git/"),t=u.join(q,".git/hooks"),o=u.join(t,"pre-commit"),n=l.existsSync(e),r=l.existsSync(o),a=r&&l.readFileSync(o,O).includes(F);if(n&&(!r||!a)){v(t),l.writeFileSync(o,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",F].join(d.EOL),O);try{l.chmodSync(o,"777")}catch(i){w("chmod ".concat(o," failed: ").concat(i.message))}_("Create pre-commit hook")}},H=function(){var e=o(s.mark((function e(){var t,o,n,r;return s.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t=P(),o=!1!==t.strict,n=t.eslintIgnore,r=t.stylelintIgnore,I("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),o&&(I("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),r&&I("\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ".concat(r,"\u3002")),n&&I("\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ".concat(n,"\u3002"))),W({command:"lint-staged",args:["-c",require.resolve("./.lintstagedrc")]});case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(e){var t=e.mAppid,o=e.mProject,n=e.mPrivateKeyPath,r=e.mVersion,a=e.mDesc,i=e.mRobot,c=e.mQrcodeFormat,s=e.mQrcodeOutputDest,p=e.mPagePath,d=e.mSearchQuery,f=l.existsSync(u.join(q,".git"))?m("git log -1 --pretty=format:%H").toString():"",y=x(),v=t||y.appid,b=o||u.join(q,"dist"),h=n||u.join(q,"private.".concat(v,".key"));if(l.existsSync(b)){if(l.existsSync(h)){var j=S(),k=r||j.version||y.version||"1.0.0",O=a||j.description||y.description,w="".concat(f?" commit: ".concat(f,";"):"").concat(O?" description: ".concat(O,";"):"");f&&D("commit: ".concat(f)),D("dist: ".concat(b)),D("key: ".concat(h)),D("appid: ".concat(v)),D("version: ".concat(k)),D("desc: ".concat(w));var P=new g.Project({appid:v,type:"miniProgram",projectPath:b,privateKeyPath:h,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:v,options:{project:P,version:k,desc:w,setting:y.setting,robot:i,qrcodeFormat:c,qrcodeOutputDest:s,pagePath:p,searchQuery:d}}}throw Error("\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(".concat(h,")"))}throw Error("\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(".concat(b,")"))},J=function(){$(),process.argv.length>2?h.version(k.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mAppid <appid>","\u5c0f\u7a0b\u5e8fappid").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action((function(e,o){var i=t(o),s=i[0],m=i.slice(1),p=e.clone,f=e.template,y=e.docs;if(s)switch(D("yolk version: ".concat(k.version)),D("node version: ".concat(process.version)),D("platform: ".concat(d.platform())),D("memory: ".concat(a(d.freemem()/1024/1024)," MB(").concat(a(d.totalmem()/1024/1024)," MB)")),s){case"init":if(_("yolk ".concat(s," \u5f00\u59cb")),p)if(f){var v=".yolk",h=u.join(q,v);l.existsSync(h)&&b(h)&&_("\u7f13\u5b58\u5220\u9664 success! ".concat(h)),W({command:"git",args:["clone","-b","master","--depth","1",f,v].concat(m)}),R(q,h)}else w("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else L(q);break;case"start":A()?G()?W({command:"taro",args:["build","--type","tt","--watch"].concat(m)}):V()?W({command:"taro",args:["build","--type","alipay","--watch"].concat(m)}):W({command:"taro",args:["build","--type","weapp","--watch"].concat(m)}):y?(process.env.DID_YOU_KNOW="none",W({command:"dumi",args:["dev"].concat(m)})):B()?(process.env.DID_YOU_KNOW="none",W({command:"max",args:["dev"].concat(m)})):(process.env.DID_YOU_KNOW="none",W({command:"umi",args:["dev"].concat(m)}));break;case"build":A()?G()?W({command:"taro",args:["build","--type","tt"].concat(m)}):V()?W({command:"taro",args:["build","--type","alipay"].concat(m)}):W({command:"taro",args:["build","--type","weapp"].concat(m)}):y?(process.env.DID_YOU_KNOW="none",W({command:"dumi",args:["build"].concat(m)})):B()?(process.env.DID_YOU_KNOW="none",W({command:"max",args:["setup"].concat(m),complete:function(){return W({command:"max",args:["build"].concat(m)})},exit:!1})):(process.env.DID_YOU_KNOW="none",W({command:"umi",args:["build"].concat(m)}));break;case"pre-commit":H();break;case"miniprogram-upload":if(A())if(G());else if(V());else{var j=M(e),O=j.appid,S=j.options;D("".concat(O,"\u4e0a\u4f20\u5f00\u59cb")),g.upload(c(c({},n(S,["project","version","desc","setting","robot"])),{},{onProgressUpdate:function(e){if(r(e))D("task: ".concat(e));else{var t=e.status,o=e.message;D("task(".concat(t,"): ").concat(o))}}})).then((function(){_("".concat(O,"\u4e0a\u4f20\u5b8c\u6210"))}))}break;case"miniprogram-preview":if(A())if(G());else if(V());else{var x=M(e),P=x.appid,I=x.options;D("".concat(P,"\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb")),g.preview(c(c({},n(I,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:function(e){if(r(e))D("task: ".concat(e));else{var t=e.status,o=e.message;D("task(".concat(t,"): ").concat(o))}}})).then((function(){_("".concat(P,"\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210"))}))}break;default:Y()}})).parse(process.argv):Y()};J();
|
|
2
|
+
import e from"@babel/runtime/helpers/esm/toArray";import t from"@babel/runtime/helpers/esm/toConsumableArray";import n from"@babel/runtime/helpers/esm/defineProperty";import o from"lodash/isString";import r from"lodash/pick";import c from"lodash/floor";import i from"lodash/chunk";function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}import{execSync as m,spawn as l}from"child_process";import p from"fs";import u from"os";import f from"path";import d from"inquirer";import*as y from"miniprogram-ci";import g from"ora";import h from"../compiled/commander";import v from"../compiled/glob";import b from"../compiled/minimatch";import j from"../compiled/mkdirp";import S from"../compiled/mustache";import{format as x}from"../compiled/prettier";import k from"../compiled/rimraf";import w from"../package.json";var O=require("../compiled/staged-git-files"),P=process.cwd(),D="##### CREATED BY YOLK #####",_={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},F="utf-8",I=20,E=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],N=g(),B=function(e){return e&&N.warn(Buffer.from(e,F).toString())},q=function(e){return e&&N.fail(Buffer.from(e,F).toString())},K=function(e){return e&&N.succeed(Buffer.from(e,F).toString())},$=function(e){return e&&N.info(Buffer.from(e,F).toString())},U=function(e){return"win32"===process.platform?"".concat(e,".cmd"):e},A=function(){K("yolk complete!"),process.exit(0)},Q=function(){B("yolk break!"),process.exit(0)},R=function(e){var t=e.command,n=e.args,o=e.complete,r=e.close,c=e.exit,i=void 0===c||c,s=l(U(t),n||[],{stdio:"inherit"}).on("close",(function(e){e?(r&&r(),q("yolk close!"),process.exit(e)):(o&&o(),i&&A())}));process.on("SIGINT",(function(){h.runningCommand&&h.runningCommand.kill("SIGKILL"),s.kill(),Q()}))},T=function(e,t,n){d.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:f.basename(f.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:"default",choices:[{name:"\u9ed8\u8ba4\u5b89\u88c5",value:"default"},{name:"\u8df3\u8fc7\u5b89\u88c5",value:!1},{name:"pnpm install",value:"pnpm"},{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"}]}]).then((function(o){var r={projectName:o.projectName,dependenciesInstallType:o.dependenciesInstallType,yolkVersion:w.version},c=t||f.join(__dirname,"../templates/".concat(o.type));K("\u590d\u5236\u6a21\u7248 ".concat(f.basename(c)));var i=v.sync("**/*",{cwd:c,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(i.forEach((function(t){if(c){var n=f.join(c,t);if(!p.statSync(n).isDirectory())if(t.endsWith(".tpl")){var o=p.readFileSync(n,F),i=f.join(e,t.replace(/\.tpl$/,"")),s=S.render(o,r);j.sync(f.dirname(i)),K("\u521b\u5efa ".concat(f.relative(e,i))),p.writeFileSync(i,s,F)}else{K("\u521b\u5efa ".concat(t));var a=f.join(e,t);j.sync(f.dirname(a)),p.copyFileSync(n,a)}}})),K("\u590d\u5236\u6a21\u7248 success!"),n&&p.existsSync(c)&&k(c,(function(){K("\u7f13\u5b58\u5220\u9664 success! ".concat(f.basename(c||"")))})),o.dependenciesInstallType)switch(K("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),o.dependenciesInstallType){case"default":case"pnpm":R({command:"pnpm",args:["install"]});break;case"yarn":R({command:"yarn",args:["install"]});break;case"npm":R({command:"npm",args:["install"]});break;default:}K("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},Y=function(e,t){return T(e,t,!0)},W=function(){var e=v.sync("*.yolkrc*",{cwd:P,dot:!0});if(!e.length)return{};var t=f.join(P,e[0]);if(!p.existsSync(t))return{};try{return JSON.parse(p.readFileSync(t,F))||{}}catch(n){return q(n.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},L=function(){var e=f.join(P,".prettierrc");if(p.existsSync(e))try{return JSON.parse(p.readFileSync(e,F))||{}}catch(t){return q(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return require("./.prettierrc")},C=function(){var e=f.join(P,"project.config.json");if(!p.existsSync(e))return{};try{return JSON.parse(p.readFileSync(e,F))||{}}catch(t){return q(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},J=function(){var e=f.join(P,"package.json");if(!p.existsSync(e))return{};try{return JSON.parse(p.readFileSync(e,F))||{}}catch(t){return q(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},V=function(){return p.existsSync(f.join(P,"project.config.json"))},G=function(){var e=p.existsSync(f.join(P,"node_modules/.bin/max"));if(!e)try{e=p.existsSync(require.resolve("@umijs/max"))}catch(o){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test(m("umi -v").toString())}catch(o){}if(!e){var t=f.join(P,"node_modules","umi","package.json");if(p.existsSync(t))try{var n=JSON.parse(p.readFileSync(t,F))||{};e=n.version&&+n.version.split(".")[0]>3}catch(o){}}return e},H=function(){var e=f.join(P,"project.config.json");if(p.existsSync(e)){var t=require(e);return t.appid}return""},M=function(){return p.existsSync(f.join(P,"project.tt.json"))&&0===H().indexOf("tt")},X=function(){return 0===H().indexOf("20")},z=function(){var e=W(),t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(r){}var n=v.sync("*.eslintrc*",{cwd:P,dot:!0}),o=n[0];return!1===e.strict&&o&&p.existsSync(o)?o:p.existsSync(t)?t:o},Z=function(){var e=W(),t="";try{t=require.resolve("@baic/stylelint-config-yolk")}catch(r){}var n=v.sync("*.stylelintrc*",{cwd:P,dot:!0}),o=n[0];return!1===e.strict&&o&&p.existsSync(o)?o:p.existsSync(t)?t:o},ee=function(){var e=f.join(P,".git/"),t=f.join(P,".git/hooks"),n=f.join(t,"pre-commit"),o=p.existsSync(e),r=p.existsSync(n),c=r&&p.readFileSync(n,F).includes(D);if(o&&(!r||!c)){j.sync(t),p.writeFileSync(n,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",D].join(u.EOL),F);try{p.chmodSync(n,"777")}catch(i){q("chmod ".concat(n," failed: ").concat(i.message))}K("Create pre-commit hook")}},te=function(){var e=W(),n=!1!==e.strict,o=e.eslintIgnore,r=e.stylelintIgnore;O().then((function(e){var c=function(o){return new Promise((function(c,s){var m=Z();if(m){var l=e.map((function(e){return e.filename})).filter((function(e){return/^(src|tests)/i.test(e)})).filter((function(e){return{css:/\.cs{2}$/i,less:/\.les{2}$/i,sass:/\.sas{2}$/i,scss:/\.scs{2}$/i}[o].test(e)})).filter((function(e){var t=f.join(P,e);return p.existsSync(t)})).filter((function(e){return E.every((function(t){return!b(e,t,{matchBase:!0})}))})).filter((function(e){return"string"===typeof r?!b(e,r,{matchBase:!0}):r instanceof RegExp?!r.test(e):!Array.isArray(r)||r.every((function(t){return"string"===typeof t?!b(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)}))}));if(l.length)if(l.forEach((function(e){if(e&&p.existsSync(e)){var t=f.extname(e).replace(/^\./,""),n=p.readFileSync(e,F),o=x(n,a({parser:_[t]},L()));p.writeFileSync(e,o,F)}})),K("".concat(o," - ").concat(l.length," files prettier success!")),l.length>=I){var u=[];i(l,I).forEach((function(e){u.push(new Promise((function(r,c){R({command:"stylelint",args:[n?"--ignore-disables":"","--allow-empty-input","--custom-syntax","postcss-".concat(o),"--config",m].concat(t(e)),complete:r,close:c,exit:!1})})))}));var d=0,y=function e(){d<u.length?u[d].then((function(){d++,e()})).catch(s):(K("".concat(o," - ").concat(l.length," files stylelint success!")),c())};y()}else l.length&&R({command:"stylelint",args:[n?"--ignore-disables":"","--allow-empty-input","--custom-syntax","postcss-".concat(o),"--config",m].concat(t(l)),complete:function(){K("".concat(o," - ").concat(l.length," files stylelint success!")),c()},close:s,exit:!1});else c()}else q("\u6ca1\u6709 stylelintrc \u6587\u4ef6\uff0c".concat(o," files prettier fail!")),c()}))},s=function(r){return new Promise((function(c,s){var m=z();if(m){var l=e.map((function(e){return e.filename})).filter((function(e){return/^(src|tests)/i.test(e)})).filter((function(e){return{js:/\.js$/i,jsx:/\.jsx$/i,ts:/\.ts$/i,tsx:/\.tsx$/i}[r].test(e)})).filter((function(e){var t=f.join(P,e);return p.existsSync(t)})).filter((function(e){return E.every((function(t){return!b(e,t,{matchBase:!0})}))})).filter((function(e){return"string"===typeof o?!b(e,o,{matchBase:!0}):o instanceof RegExp?!o.test(e):!Array.isArray(o)||o.every((function(t){return"string"===typeof t?!b(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)}))}));if(l.length)if(l.forEach((function(e){if(e&&p.existsSync(e)){var t=f.extname(e).replace(/^\./,""),n=p.readFileSync(e,F),o=x(n,a({parser:_[t]},L()));p.writeFileSync(e,o,F)}})),K("".concat(r," - ").concat(l.length," files prettier success!")),l.length>=I){var u=[];i(l,I).forEach((function(e){u.push(new Promise((function(o,r){R({command:"eslint",args:[n?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",m].concat(t(e)),complete:o,close:r,exit:!1})})))}));var d=0,y=function e(){d<u.length?u[d].then((function(){d++,e()})).catch(s):(K("".concat(r," - ").concat(l.length," files eslint success!")),c())};y()}else l.length&&R({command:"eslint",args:[n?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",m].concat(t(l)),complete:function(){K("".concat(r," - ").concat(l.length," files eslint success!")),c()},close:s,exit:!1});else c()}else q("\u6ca1\u6709 eslintrc \u6587\u4ef6\uff0c".concat(r," files eslint fail!")),c()}))};B("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),n&&(B("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),r&&B("\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ".concat(r,"\u3002")),o&&B("\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ".concat(o,"\u3002"))),c("css").then((function(){return c("less")})).then((function(){return c("sass")})).then((function(){return c("scss")})).then((function(){return s("js")})).then((function(){return s("jsx")})).then((function(){return s("ts")})).then((function(){return s("tsx")})).then(A).catch(A)}))},ne=function(e){var t=e.mAppid,n=e.mProject,o=e.mPrivateKeyPath,r=e.mVersion,c=e.mDesc,i=e.mRobot,s=e.mQrcodeFormat,a=e.mQrcodeOutputDest,l=e.mPagePath,u=e.mSearchQuery,d=p.existsSync(f.join(P,".git"))?m("git log -1 --pretty=format:%H").toString():"",g=C(),h=t||g.appid,v=n||f.join(P,"dist"),b=o||f.join(P,"private.".concat(h,".key"));if(p.existsSync(v)){if(p.existsSync(b)){var j=J(),S=r||j.version||g.version||"1.0.0",x=c||j.description||g.description,k="".concat(d?" commit: ".concat(d,";"):"").concat(x?" description: ".concat(x,";"):"");d&&$("commit: ".concat(d)),$("dist: ".concat(v)),$("key: ".concat(b)),$("appid: ".concat(h)),$("version: ".concat(S)),$("desc: ".concat(k));var w=new y.Project({appid:h,type:"miniProgram",projectPath:v,privateKeyPath:b,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:h,options:{project:w,version:S,desc:k,setting:g.setting,robot:i,qrcodeFormat:s,qrcodeOutputDest:a,pagePath:l,searchQuery:u}}}throw Error("\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(".concat(b,")"))}throw Error("\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(".concat(v,")"))},oe=function(){ee(),process.argv.length>2?h.version(w.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mAppid <appid>","\u5c0f\u7a0b\u5e8fappid").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action((function(t,n){var i=e(n),s=i[0],m=i.slice(1),l=t.clone,d=t.template,g=t.docs;if(s)switch($("yolk version: ".concat(w.version)),$("node version: ".concat(process.version)),$("platform: ".concat(u.platform())),$("memory: ".concat(c(u.freemem()/1024/1024)," MB(").concat(c(u.totalmem()/1024/1024)," MB)")),s){case"init":if(K("yolk ".concat(s," \u5f00\u59cb")),l)if(d){var h=".yolk",v=f.join(P,h);p.existsSync(v)&&k(v,(function(){K("\u7f13\u5b58\u5220\u9664 success! ".concat(v))})),R({command:"git",args:["clone","-b","master","--depth","1",d,h].concat(m)}),Y(P,v)}else q("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else T(P);break;case"start":V()?M()?R({command:"taro",args:["build","--type","tt","--watch"].concat(m)}):X()?R({command:"taro",args:["build","--type","alipay","--watch"].concat(m)}):R({command:"taro",args:["build","--type","weapp","--watch"].concat(m)}):g?(process.env.DID_YOU_KNOW="none",R({command:"dumi",args:["dev"].concat(m)})):G()?(process.env.DID_YOU_KNOW="none",R({command:"max",args:["dev"].concat(m)})):(process.env.DID_YOU_KNOW="none",R({command:"umi",args:["dev"].concat(m)}));break;case"build":V()?M()?R({command:"taro",args:["build","--type","tt"].concat(m)}):X()?R({command:"taro",args:["build","--type","alipay"].concat(m)}):R({command:"taro",args:["build","--type","weapp"].concat(m)}):g?(process.env.DID_YOU_KNOW="none",R({command:"dumi",args:["build"].concat(m)})):G()?(process.env.DID_YOU_KNOW="none",R({command:"max",args:["setup"].concat(m),complete:function(){return R({command:"max",args:["build"].concat(m)})},exit:!1})):(process.env.DID_YOU_KNOW="none",R({command:"umi",args:["build"].concat(m)}));break;case"pre-commit":te();break;case"miniprogram-upload":if(V())if(M());else if(X());else{var b=ne(t),j=b.appid,S=b.options;$("".concat(j,"\u4e0a\u4f20\u5f00\u59cb")),y.upload(a(a({},r(S,["project","version","desc","setting","robot"])),{},{onProgressUpdate:function(e){if(o(e))$("task: ".concat(e));else{var t=e.status,n=e.message;$("task(".concat(t,"): ").concat(n))}}})).then((function(){K("".concat(j,"\u4e0a\u4f20\u5b8c\u6210"))}))}break;case"miniprogram-preview":if(V())if(M());else if(X());else{var x=ne(t),O=x.appid,D=x.options;$("".concat(O,"\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb")),y.preview(a(a({},r(D,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"])),{},{onProgressUpdate:function(e){if(o(e))$("task: ".concat(e));else{var t=e.status,n=e.message;$("task(".concat(t,"): ").concat(n))}}})).then((function(){K("".concat(O,"\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210"))}))}break;default:Q()}})).parse(process.argv):Q()};oe();
|
package/lib/yolk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
var e=Object.create,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,r=(e,n,r,s)=>{if(n&&"object"===typeof n||"function"===typeof n)for(let c of o(n))i.call(e,c)||c===r||t(e,c,{get:()=>n[c],enumerable:!(s=a(n,c))||s.enumerable});return e},s=(a,o,i)=>(i=null!=a?e(n(a)):{},r(!o&&a&&a.__esModule?i:t(i,"default",{value:a,enumerable:!0}),a)),c=require("child_process"),l=s(require("fs")),m=s(require("os")),d=s(require("path")),p=require("lodash"),u=require("glob"),f=s(require("inquirer")),y=s(require("miniprogram-ci")),g=require("mkdirp"),b=require("rimraf"),v=s(require("../compiled/commander")),h=s(require("../compiled/mustache")),k=s(require("../package.json")),j=require("./util"),S=require("../compiled/staged-git-files"),$=process.cwd(),O="##### CREATED BY YOLK #####",w=e=>"win32"===process.platform?`${e}.cmd`:e,x=()=>{(0,j.succeed)("yolk complete!"),process.exit(0)},D=()=>{(0,j.warn)("yolk break!"),process.exit(0)},P=({command:e,args:t,complete:a,close:o,exit:n=!0})=>{const i=(0,c.spawn)(w(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(o&&o(),(0,j.fail)("yolk close!"),process.exit(e)):(a&&a(),n&&x())}));process.on("SIGINT",(()=>{v.default.runningCommand&&v.default.runningCommand.kill("SIGKILL"),i.kill(),D()}))},q=(e,t,a)=>{f.default.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:d.default.basename(d.default.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:"default",choices:[{name:"\u9ed8\u8ba4\u5b89\u88c5",value:"default"},{name:"\u8df3\u8fc7\u5b89\u88c5",value:!1},{name:"pnpm install",value:"pnpm"},{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"}]}]).then((o=>{const n={projectName:o.projectName,dependenciesInstallType:o.dependenciesInstallType,yolkVersion:k.default.version},i=t||d.default.join(__dirname,`../templates/${o.type}`);(0,j.succeed)(`\u590d\u5236\u6a21\u7248 ${d.default.basename(i)}`);const r=(0,u.globSync)("**/*",{cwd:i,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(r.forEach((t=>{if(!i)return;const a=d.default.join(i,t);if(!l.default.statSync(a).isDirectory())if(t.endsWith(".tpl")){const o=l.default.readFileSync(a,j.ENCODING),i=d.default.join(e,t.replace(/\.tpl$/,"")),r=h.default.render(o,n);(0,g.mkdirpSync)(d.default.dirname(i)),(0,j.succeed)(`\u521b\u5efa ${d.default.relative(e,i)}`),l.default.writeFileSync(i,r,j.ENCODING)}else{(0,j.succeed)(`\u521b\u5efa ${t}`);const o=d.default.join(e,t);(0,g.mkdirpSync)(d.default.dirname(o)),l.default.copyFileSync(a,o)}})),(0,j.succeed)("\u590d\u5236\u6a21\u7248 success!"),a&&l.default.existsSync(i)&&(0,b.rimrafSync)(i)&&(0,j.succeed)(`\u7f13\u5b58\u5220\u9664 success! ${d.default.basename(i||"")}`),o.dependenciesInstallType)switch((0,j.succeed)("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),o.dependenciesInstallType){case"default":case"pnpm":P({command:"pnpm",args:["install"]});break;case"yarn":P({command:"yarn",args:["install"]});break;case"npm":P({command:"npm",args:["install"]});break;default:}(0,j.succeed)("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},I=(e,t)=>q(e,t,!0),N=()=>l.default.existsSync(d.default.join($,"project.config.json")),_=()=>{let e=l.default.existsSync(d.default.join($,"node_modules/.bin/max"));if(!e)try{e=l.default.existsSync(require.resolve("@umijs/max"))}catch(t){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test((0,c.execSync)("umi -v").toString())}catch(t){}if(!e){const a=d.default.join($,"node_modules","umi","package.json");if(l.default.existsSync(a))try{const t=JSON.parse(l.default.readFileSync(a,j.ENCODING))||{};e=t.version&&+t.version.split(".")[0]>3}catch(t){}}return e},E=()=>{const e=d.default.join($,"project.config.json");if(l.default.existsSync(e)){const t=require(e);return t.appid}return""},K=()=>l.default.existsSync(d.default.join($,"project.tt.json"))&&0===E().indexOf("tt"),C=()=>0===E().indexOf("20"),F=()=>{const e=d.default.join($,".git/"),t=d.default.join($,".git/hooks"),a=d.default.join(t,"pre-commit"),o=l.default.existsSync(e),n=l.default.existsSync(a),i=n&&l.default.readFileSync(a,j.ENCODING).includes(O);if(o&&(!n||!i)){(0,g.mkdirpSync)(t),l.default.writeFileSync(a,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",O].join(m.default.EOL),j.ENCODING);try{l.default.chmodSync(a,"777")}catch(r){(0,j.fail)(`chmod ${a} failed: ${r.message}`)}(0,j.succeed)("Create pre-commit hook")}},U=async()=>{const e=(0,j.getYolkConfig)(),t=!1!==e.strict,a=e.eslintIgnore,o=e.stylelintIgnore;(0,j.warn)("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),t&&((0,j.warn)("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),o&&(0,j.warn)(`\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ${o}\u3002`),a&&(0,j.warn)(`\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ${a}\u3002`)),P({command:"lint-staged",args:["-c",require.resolve("./.lintstagedrc")]})},Q=({mAppid:e,mProject:t,mPrivateKeyPath:a,mVersion:o,mDesc:n,mRobot:i,mQrcodeFormat:r,mQrcodeOutputDest:s,mPagePath:m,mSearchQuery:p})=>{const u=l.default.existsSync(d.default.join($,".git"))?(0,c.execSync)("git log -1 --pretty=format:%H").toString():"",f=(0,j.getProjectConfigJSON)(),g=e||f.appid,b=t||d.default.join($,"dist"),v=a||d.default.join($,`private.${g}.key`);if(l.default.existsSync(b)){if(l.default.existsSync(v)){const e=(0,j.getPackageJSON)(),t=o||e.version||f.version||"1.0.0",a=n||e.description||f.description,c=`${u?` commit: ${u};`:""}${a?` description: ${a};`:""}`;u&&(0,j.info)(`commit: ${u}`),(0,j.info)(`dist: ${b}`),(0,j.info)(`key: ${v}`),(0,j.info)(`appid: ${g}`),(0,j.info)(`version: ${t}`),(0,j.info)(`desc: ${c}`);const l=new y.Project({appid:g,type:"miniProgram",projectPath:b,privateKeyPath:v,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:g,options:{project:l,version:t,desc:c,setting:f.setting,robot:i,qrcodeFormat:r,qrcodeOutputDest:s,pagePath:m,searchQuery:p}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${v})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${b})`)},T=()=>{F(),process.argv.length>2?v.default.version(k.default.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mAppid <appid>","\u5c0f\u7a0b\u5e8fappid").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action(((e,t)=>{const[a,...o]=t,{clone:n,template:i,docs:r}=e;if(a)switch((0,j.info)(`yolk version: ${k.default.version}`),(0,j.info)(`node version: ${process.version}`),(0,j.info)(`platform: ${m.default.platform()}`),(0,j.info)(`memory: ${(0,p.floor)(m.default.freemem()/1024/1024)} MB(${(0,p.floor)(m.default.totalmem()/1024/1024)} MB)`),a){case"init":if((0,j.succeed)(`yolk ${a} \u5f00\u59cb`),n)if(i){const e=".yolk",t=d.default.join($,e);l.default.existsSync(t)&&(0,b.rimrafSync)(t)&&(0,j.succeed)(`\u7f13\u5b58\u5220\u9664 success! ${t}`),P({command:"git",args:["clone","-b","master","--depth","1",i,e].concat(o)}),I($,t)}else(0,j.fail)("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else q($);break;case"start":N()?K()?P({command:"taro",args:["build","--type","tt","--watch"].concat(o)}):C()?P({command:"taro",args:["build","--type","alipay","--watch"].concat(o)}):P({command:"taro",args:["build","--type","weapp","--watch"].concat(o)}):r?(process.env.DID_YOU_KNOW="none",P({command:"dumi",args:["dev"].concat(o)})):_()?(process.env.DID_YOU_KNOW="none",P({command:"max",args:["dev"].concat(o)})):(process.env.DID_YOU_KNOW="none",P({command:"umi",args:["dev"].concat(o)}));break;case"build":N()?K()?P({command:"taro",args:["build","--type","tt"].concat(o)}):C()?P({command:"taro",args:["build","--type","alipay"].concat(o)}):P({command:"taro",args:["build","--type","weapp"].concat(o)}):r?(process.env.DID_YOU_KNOW="none",P({command:"dumi",args:["build"].concat(o)})):_()?(process.env.DID_YOU_KNOW="none",P({command:"max",args:["setup"].concat(o),complete:()=>P({command:"max",args:["build"].concat(o)}),exit:!1})):(process.env.DID_YOU_KNOW="none",P({command:"umi",args:["build"].concat(o)}));break;case"pre-commit":U();break;case"miniprogram-upload":if(N())if(K());else if(C());else{const{appid:t,options:a}=Q(e);(0,j.info)(`${t}\u4e0a\u4f20\u5f00\u59cb`),y.upload({...(0,p.pick)(a,["project","version","desc","setting","robot"]),onProgressUpdate:e=>{if((0,p.isString)(e))(0,j.info)(`task: ${e}`);else{const{status:t,message:a}=e;(0,j.info)(`task(${t}): ${a}`)}}}).then((()=>{(0,j.succeed)(`${t}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniprogram-preview":if(N())if(K());else if(C());else{const{appid:t,options:a}=Q(e);(0,j.info)(`${t}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),y.preview({...(0,p.pick)(a,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"]),onProgressUpdate:e=>{if((0,p.isString)(e))(0,j.info)(`task: ${e}`);else{const{status:t,message:a}=e;(0,j.info)(`task(${t}): ${a}`)}}}).then((()=>{(0,j.succeed)(`${t}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:D()}})).parse(process.argv):D()};T();
|
|
2
|
+
var e=Object.create,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,n=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,o=(e,n,o,r)=>{if(n&&"object"===typeof n||"function"===typeof n)for(let c of a(n))i.call(e,c)||c===o||t(e,c,{get:()=>n[c],enumerable:!(r=s(n,c))||r.enumerable});return e},r=(s,a,i)=>(i=null!=s?e(n(s)):{},o(!a&&s&&s.__esModule?i:t(i,"default",{value:s,enumerable:!0}),s)),c=e=>o(t({},"__esModule",{value:!0}),e),l={};module.exports=c(l);var d=require("child_process"),u=r(require("fs")),m=r(require("os")),p=r(require("path")),f=r(require("lodash")),y=r(require("inquirer")),g=r(require("miniprogram-ci")),h=r(require("ora")),$=r(require("../compiled/commander")),b=r(require("../compiled/glob")),x=r(require("../compiled/minimatch")),S=r(require("../compiled/mkdirp")),j=r(require("../compiled/mustache")),v=require("../compiled/prettier"),k=r(require("../compiled/rimraf")),w=r(require("../package.json")),O=require("../compiled/staged-git-files"),q=process.cwd(),P="##### CREATED BY YOLK #####",_={ts:"typescript",tsx:"typescript",less:"less",sass:"scss",scss:"scss",css:"css"},D="utf-8",F=20,I=["**/node_modules/**","**/.umi/**","**/.umi-production/**","**/build/**","**/dist/**","**/lib/**","**/es/**","**/public/**","**/assets/**","**/h5+app/**","**/android/**","**/ios/**","**/mock/**","**/yolk*/**"],E=(0,h.default)(),N=e=>e&&E.warn(Buffer.from(e,D).toString()),B=e=>e&&E.fail(Buffer.from(e,D).toString()),K=e=>e&&E.succeed(Buffer.from(e,D).toString()),U=e=>e&&E.info(Buffer.from(e,D).toString()),Q=e=>"win32"===process.platform?`${e}.cmd`:e,R=()=>{K("yolk complete!"),process.exit(0)},T=()=>{N("yolk break!"),process.exit(0)},Y=({command:e,args:t,complete:s,close:a,exit:n=!0})=>{const i=(0,d.spawn)(Q(e),t||[],{stdio:"inherit"}).on("close",(e=>{e?(a&&a(),B("yolk close!"),process.exit(e)):(s&&s(),n&&R())}));process.on("SIGINT",(()=>{$.default.runningCommand&&$.default.runningCommand.kill("SIGKILL"),i.kill(),T()}))},A=(e,t,s)=>{y.default.prompt([{type:"list",name:"type",message:"\u9009\u62e9\u6a21\u7248",default:"web",choices:[{name:"web template(umi framework)",value:"umi-web"},{name:"web big screen template(umi framework)",value:"umi-web-screen"},{name:"mobile template(umi framework)",value:"umi-mobile"},{name:"mobile HBuilderX h5+app template(umi framework)",value:"umi-mobile-h5+app"},{name:"mobile native template(umi framework)",value:"umi-mobile-native"},{name:"miniprogram template",value:"miniprogram"}]},{type:"input",name:"projectName",message:"\u9879\u76ee\u540d\u79f0",default:p.default.basename(p.default.basename(process.cwd()))},{type:"list",name:"dependenciesInstallType",message:"\u9009\u62e9\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f",default:"default",choices:[{name:"\u9ed8\u8ba4\u5b89\u88c5",value:"default"},{name:"\u8df3\u8fc7\u5b89\u88c5",value:!1},{name:"pnpm install",value:"pnpm"},{name:"yarn install",value:"yarn"},{name:"npm install",value:"npm"}]}]).then((a=>{const n={projectName:a.projectName,dependenciesInstallType:a.dependenciesInstallType,yolkVersion:w.default.version},i=t||p.default.join(__dirname,`../templates/${a.type}`);K(`\u590d\u5236\u6a21\u7248 ${p.default.basename(i)}`);const o=b.default.sync("**/*",{cwd:i,dot:!0,ignore:["**/node_modules/**","**/.git/**","**/.DS_Store","**/.idea/**"]});if(o.forEach((t=>{if(!i)return;const s=p.default.join(i,t);if(!u.default.statSync(s).isDirectory())if(t.endsWith(".tpl")){const a=u.default.readFileSync(s,D),i=p.default.join(e,t.replace(/\.tpl$/,"")),o=j.default.render(a,n);S.default.sync(p.default.dirname(i)),K(`\u521b\u5efa ${p.default.relative(e,i)}`),u.default.writeFileSync(i,o,D)}else{K(`\u521b\u5efa ${t}`);const a=p.default.join(e,t);S.default.sync(p.default.dirname(a)),u.default.copyFileSync(s,a)}})),K("\u590d\u5236\u6a21\u7248 success!"),s&&u.default.existsSync(i)&&(0,k.default)(i,(()=>{K(`\u7f13\u5b58\u5220\u9664 success! ${p.default.basename(i||"")}`)})),a.dependenciesInstallType)switch(K("\u521d\u59cb\u5316\u4f9d\u8d56\u5305"),a.dependenciesInstallType){case"default":case"pnpm":Y({command:"pnpm",args:["install"]});break;case"yarn":Y({command:"yarn",args:["install"]});break;case"npm":Y({command:"npm",args:["install"]});break;default:}K("\u53ef\u67e5\u9605<<https://303394539.github.io/yolk-docs/>>\u4e86\u89e3\u76f8\u5173\u6587\u6863")}))},W=(e,t)=>A(e,t,!0),L=()=>{const e=b.default.sync("*.yolkrc*",{cwd:q,dot:!0});if(!e.length)return{};const t=p.default.join(q,e[0]);if(!u.default.existsSync(t))return{};try{return JSON.parse(u.default.readFileSync(t,D))||{}}catch(s){return B(s.message||".yolkrc\u8f6c\u6362\u9519\u8bef"),{}}},J=()=>{const e=p.default.join(q,".prettierrc");if(u.default.existsSync(e))try{return JSON.parse(u.default.readFileSync(e,D))||{}}catch(t){return B(t.message||".prettierrc\u8f6c\u6362\u9519\u8bef"),{}}return require("./.prettierrc")},C=()=>{const e=p.default.join(q,"project.config.json");if(!u.default.existsSync(e))return{};try{return JSON.parse(u.default.readFileSync(e,D))||{}}catch(t){return B(t.message||"project.config.json\u8f6c\u6362\u9519\u8bef"),{}}},M=()=>{const e=p.default.join(q,"package.json");if(!u.default.existsSync(e))return{};try{return JSON.parse(u.default.readFileSync(e,D))||{}}catch(t){return B(t.message||"package.json\u8f6c\u6362\u9519\u8bef"),{}}},V=()=>u.default.existsSync(p.default.join(q,"project.config.json")),G=()=>{let e=u.default.existsSync(p.default.join(q,"node_modules/.bin/max"));if(!e)try{e=u.default.existsSync(require.resolve("@umijs/max"))}catch(t){}if(!e)try{e=/umi@4\.(\d+)\.(\d+)/.test((0,d.execSync)("umi -v").toString())}catch(t){}if(!e){const s=p.default.join(q,"node_modules","umi","package.json");if(u.default.existsSync(s))try{const t=JSON.parse(u.default.readFileSync(s,D))||{};e=t.version&&+t.version.split(".")[0]>3}catch(t){}}return e},H=()=>{const e=p.default.join(q,"project.config.json");if(u.default.existsSync(e)){const t=require(e);return t.appid}return""},X=()=>u.default.existsSync(p.default.join(q,"project.tt.json"))&&0===H().indexOf("tt"),z=()=>0===H().indexOf("20"),Z=()=>{const e=L();let t="";try{t=require.resolve("@baic/eslint-config-yolk")}catch(n){}const s=b.default.sync("*.eslintrc*",{cwd:q,dot:!0}),a=s[0];return!1===e.strict&&a&&u.default.existsSync(a)?a:u.default.existsSync(t)?t:a},ee=()=>{const e=L();let t="";try{t=require.resolve("@baic/stylelint-config-yolk")}catch(n){}const s=b.default.sync("*.stylelintrc*",{cwd:q,dot:!0}),a=s[0];return!1===e.strict&&a&&u.default.existsSync(a)?a:u.default.existsSync(t)?t:a},te=()=>{const e=p.default.join(q,".git/"),t=p.default.join(q,".git/hooks"),s=p.default.join(t,"pre-commit"),a=u.default.existsSync(e),n=u.default.existsSync(s),i=n&&u.default.readFileSync(s,D).includes(P);if(a&&(!n||!i)){S.default.sync(t),u.default.writeFileSync(s,["#!/usr/bin/env bash","npx yolk pre-commit","RESULT=$?","[ $RESULT -ne 0 ] && exit 1","exit 0",P].join(m.default.EOL),D);try{u.default.chmodSync(s,"777")}catch(o){B(`chmod ${s} failed: ${o.message}`)}K("Create pre-commit hook")}},se=()=>{const e=L(),t=!1!==e.strict,s=e.eslintIgnore,a=e.stylelintIgnore;O().then((e=>{const n=s=>new Promise(((n,i)=>{const o=ee();if(o){const r=e.map((e=>e.filename)).filter((e=>/^(src|tests)/i.test(e))).filter((e=>({css:/\.cs{2}$/i,less:/\.les{2}$/i,sass:/\.sas{2}$/i,scss:/\.scs{2}$/i}[s].test(e)))).filter((e=>{const t=p.default.join(q,e);return u.default.existsSync(t)})).filter((e=>I.every((t=>!(0,x.default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof a?!(0,x.default)(e,a,{matchBase:!0}):a instanceof RegExp?!a.test(e):!Array.isArray(a)||a.every((t=>"string"===typeof t?!(0,x.default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(r.length)if(r.forEach((e=>{if(e&&u.default.existsSync(e)){const t=p.default.extname(e).replace(/^\./,""),s=u.default.readFileSync(e,D),a=(0,v.format)(s,{parser:_[t],...J()});u.default.writeFileSync(e,a,D)}})),K(`${s} - ${r.length} files prettier success!`),r.length>=F){const e=[];f.default.chunk(r,F).forEach((a=>{e.push(new Promise(((e,n)=>{Y({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax",`postcss-${s}`,"--config",o,...a],complete:e,close:n,exit:!1})})))}));let a=0;const c=()=>{a<e.length?e[a].then((()=>{a++,c()})).catch(i):(K(`${s} - ${r.length} files stylelint success!`),n())};c()}else r.length&&Y({command:"stylelint",args:[t?"--ignore-disables":"","--allow-empty-input","--custom-syntax",`postcss-${s}`,"--config",o,...r],complete:()=>{K(`${s} - ${r.length} files stylelint success!`),n()},close:i,exit:!1});else n()}else B(`\u6ca1\u6709 stylelintrc \u6587\u4ef6\uff0c${s} files prettier fail!`),n()})),i=a=>new Promise(((n,i)=>{const o=Z();if(o){const r=e.map((e=>e.filename)).filter((e=>/^(src|tests)/i.test(e))).filter((e=>({js:/\.js$/i,jsx:/\.jsx$/i,ts:/\.ts$/i,tsx:/\.tsx$/i}[a].test(e)))).filter((e=>{const t=p.default.join(q,e);return u.default.existsSync(t)})).filter((e=>I.every((t=>!(0,x.default)(e,t,{matchBase:!0}))))).filter((e=>"string"===typeof s?!(0,x.default)(e,s,{matchBase:!0}):s instanceof RegExp?!s.test(e):!Array.isArray(s)||s.every((t=>"string"===typeof t?!(0,x.default)(e,t,{matchBase:!0}):!(t instanceof RegExp)||!t.test(e)))));if(r.length)if(r.forEach((e=>{if(e&&u.default.existsSync(e)){const t=p.default.extname(e).replace(/^\./,""),s=u.default.readFileSync(e,D),a=(0,v.format)(s,{parser:_[t],...J()});u.default.writeFileSync(e,a,D)}})),K(`${a} - ${r.length} files prettier success!`),r.length>=F){const e=[];f.default.chunk(r,F).forEach((s=>{e.push(new Promise(((e,a)=>{Y({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",o,...s],complete:e,close:a,exit:!1})})))}));let s=0;const c=()=>{s<e.length?e[s].then((()=>{s++,c()})).catch(i):(K(`${a} - ${r.length} files eslint success!`),n())};c()}else r.length&&Y({command:"eslint",args:[t?"--no-inline-config --no-ignore":"","--no-error-on-unmatched-pattern","--config",o,...r],complete:()=>{K(`${a} - ${r.length} files eslint success!`),n()},close:i,exit:!1});else n()}else B(`\u6ca1\u6709 eslintrc \u6587\u4ef6\uff0c${a} files eslint fail!`),n()}));N("\u7edf\u4e00\u4ee3\u7801\u89c4\u8303\uff0c\u8fdb\u884c\u4e25\u683c\u7684\u8bed\u6cd5\u68c0\u67e5\u3002"),t&&(N("git commit \u7981\u6b62 lint \u7684 ignore \u884c\u4e3a"),a&&N(`\u901a\u8fc7 .yolkrc \u914d\u7f6e stylelintIgnore: ${a}\u3002`),s&&N(`\u901a\u8fc7 .yolkrc \u914d\u7f6e eslintIgnore: ${s}\u3002`)),n("css").then((()=>n("less"))).then((()=>n("sass"))).then((()=>n("scss"))).then((()=>i("js"))).then((()=>i("jsx"))).then((()=>i("ts"))).then((()=>i("tsx"))).then(R).catch(R)}))},ae=({mAppid:e,mProject:t,mPrivateKeyPath:s,mVersion:a,mDesc:n,mRobot:i,mQrcodeFormat:o,mQrcodeOutputDest:r,mPagePath:c,mSearchQuery:l})=>{const m=u.default.existsSync(p.default.join(q,".git"))?(0,d.execSync)("git log -1 --pretty=format:%H").toString():"",f=C(),y=e||f.appid,h=t||p.default.join(q,"dist"),$=s||p.default.join(q,`private.${y}.key`);if(u.default.existsSync(h)){if(u.default.existsSync($)){const e=M(),t=a||e.version||f.version||"1.0.0",s=n||e.description||f.description,d=`${m?` commit: ${m};`:""}${s?` description: ${s};`:""}`;m&&U(`commit: ${m}`),U(`dist: ${h}`),U(`key: ${$}`),U(`appid: ${y}`),U(`version: ${t}`),U(`desc: ${d}`);const u=new g.Project({appid:y,type:"miniProgram",projectPath:h,privateKeyPath:$,ignores:["node_modules/**/*","**/*.txt","**/*.key","**/*.less","**/*.sass","**/*.scss","**/*.css","**/*.jsx","**/*.ts","**/*.tsx","**/*.md"]});return{appid:y,options:{project:u,version:t,desc:d,setting:f.setting,robot:i,qrcodeFormat:o,qrcodeOutputDest:r,pagePath:c,searchQuery:l}}}throw Error(`\u6ca1\u6709\u627e\u5230\u4e0a\u4f20\u5bc6\u94a5(${$})`)}throw Error(`\u6ca1\u6709\u627e\u5230dist\u76ee\u5f55(${h})`)},ne=()=>{te(),process.argv.length>2?$.default.version(w.default.version,"-v,--version","\u8f93\u51fa\u7248\u672c\u53f7").usage("[command] [options]").option("--clone","\u901a\u8fc7git clone\u62c9\u53d6\u6a21\u7248").option("--template <template>","\u6a21\u7248\u540d\u79f0\u6216\u8005clone\u6a21\u5f0f\u7684git\u5730\u5740").option("--docs","\u542f\u52a8\u6587\u6863\u6a21\u5f0f").option("--mAppid <appid>","\u5c0f\u7a0b\u5e8fappid").option("--mProject <project>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u5de5\u7a0b\u76ee\u5f55").option("--mPrivateKeyPath <privateKeyPath>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20key\u6587\u4ef6").option("--mVersion <version>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u7248\u672c\u53f7").option("--mDesc <desc>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20\u63cf\u8ff0").option("--mRobot <robot>","\u5c0f\u7a0b\u5e8f\u4e0a\u4f20ci\u673a\u5668\u4eba1~30").option("--mQrcodeFormat <qrcodeFormat>",'\u5c0f\u7a0b\u5e8f\u9884\u89c8\u8fd4\u56de\u4e8c\u7ef4\u7801\u6587\u4ef6\u7684\u683c\u5f0f "image" \u6216 "base64"\uff0c \u9ed8\u8ba4\u503c "terminal" \u4f9b\u8c03\u8bd5\u7528').option("--mQrcodeOutputDest <qrcodeOutputDest>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u4e8c\u7ef4\u7801\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84").option("--mPagePath <pagePath>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84").option("--mSearchQuery <searchQuery>","\u5c0f\u7a0b\u5e8f\u9884\u89c8\u9884\u89c8\u9875\u9762\u8def\u5f84\u542f\u52a8\u53c2\u6570").action(((e,t)=>{const[s,...a]=t,{clone:n,template:i,docs:o}=e;if(s)switch(U(`yolk version: ${w.default.version}`),U(`node version: ${process.version}`),U(`platform: ${m.default.platform()}`),U(`memory: ${f.default.floor(m.default.freemem()/1024/1024)} MB(${f.default.floor(m.default.totalmem()/1024/1024)} MB)`),s){case"init":if(K(`yolk ${s} \u5f00\u59cb`),n)if(i){const e=".yolk",t=p.default.join(q,e);u.default.existsSync(t)&&(0,k.default)(t,(()=>{K(`\u7f13\u5b58\u5220\u9664 success! ${t}`)})),Y({command:"git",args:["clone","-b","master","--depth","1",i,e].concat(a)}),W(q,t)}else B("--clone \u6a21\u5f0f\u5fc5\u987b\u6709--template");else A(q);break;case"start":V()?X()?Y({command:"taro",args:["build","--type","tt","--watch"].concat(a)}):z()?Y({command:"taro",args:["build","--type","alipay","--watch"].concat(a)}):Y({command:"taro",args:["build","--type","weapp","--watch"].concat(a)}):o?(process.env.DID_YOU_KNOW="none",Y({command:"dumi",args:["dev"].concat(a)})):G()?(process.env.DID_YOU_KNOW="none",Y({command:"max",args:["dev"].concat(a)})):(process.env.DID_YOU_KNOW="none",Y({command:"umi",args:["dev"].concat(a)}));break;case"build":V()?X()?Y({command:"taro",args:["build","--type","tt"].concat(a)}):z()?Y({command:"taro",args:["build","--type","alipay"].concat(a)}):Y({command:"taro",args:["build","--type","weapp"].concat(a)}):o?(process.env.DID_YOU_KNOW="none",Y({command:"dumi",args:["build"].concat(a)})):G()?(process.env.DID_YOU_KNOW="none",Y({command:"max",args:["setup"].concat(a),complete:()=>Y({command:"max",args:["build"].concat(a)}),exit:!1})):(process.env.DID_YOU_KNOW="none",Y({command:"umi",args:["build"].concat(a)}));break;case"pre-commit":se();break;case"miniprogram-upload":if(V())if(X());else if(z());else{const{appid:t,options:s}=ae(e);U(`${t}\u4e0a\u4f20\u5f00\u59cb`),g.upload({...f.default.pick(s,["project","version","desc","setting","robot"]),onProgressUpdate:e=>{if(f.default.isString(e))U(`task: ${e}`);else{const{status:t,message:s}=e;U(`task(${t}): ${s}`)}}}).then((()=>{K(`${t}\u4e0a\u4f20\u5b8c\u6210`)}))}break;case"miniprogram-preview":if(V())if(X());else if(z());else{const{appid:t,options:s}=ae(e);U(`${t}\u4e0a\u4f20\u9884\u89c8\u5f00\u59cb`),g.preview({...f.default.pick(s,["project","version","desc","setting","robot","qrcodeFormat","qrcodeOutputDest","pagePath","searchQuery"]),onProgressUpdate:e=>{if(f.default.isString(e))U(`task: ${e}`);else{const{status:t,message:s}=e;U(`task(${t}): ${s}`)}}}).then((()=>{K(`${t}\u4e0a\u4f20\u9884\u89c8\u5b8c\u6210`)}))}break;default:T()}})).parse(process.argv):T()};ne();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baic/yolk-cli",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.133",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/303394539/yolk.git"
|
|
@@ -27,29 +27,31 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@babel/runtime": "~7.x",
|
|
29
29
|
"@types/inquirer": "~8.x",
|
|
30
|
-
"@types/lint-staged": "~13.2.x",
|
|
31
30
|
"@types/lodash": "~4.x",
|
|
32
|
-
"
|
|
31
|
+
"@types/prettier": "~2.x",
|
|
33
32
|
"inquirer": "~8.x",
|
|
34
|
-
"lint-staged": "~13.2.x",
|
|
35
33
|
"lodash": "~4.x",
|
|
36
|
-
"minimatch": "~9.0.x",
|
|
37
34
|
"miniprogram-ci": "~1.9.x",
|
|
38
|
-
"mkdirp": "~3.0.x",
|
|
39
35
|
"ora": "5.4.1",
|
|
40
|
-
"
|
|
36
|
+
"prettier": "~2.x",
|
|
41
37
|
"v8-compile-cache": "~2.3.x"
|
|
42
38
|
},
|
|
43
39
|
"devDependencies": {
|
|
40
|
+
"@types/glob": "~8.x",
|
|
41
|
+
"@types/minimatch": "~5.1.x",
|
|
42
|
+
"@types/mkdirp": "~1.0.x",
|
|
44
43
|
"@types/mustache": "~4.2.x",
|
|
45
|
-
"@types/
|
|
44
|
+
"@types/rimraf": "~3.0.x",
|
|
46
45
|
"commander": "~6.x",
|
|
46
|
+
"glob": "~8.x",
|
|
47
|
+
"minimatch": "~5.1.x",
|
|
48
|
+
"mkdirp": "~1.0.x",
|
|
47
49
|
"mustache": "~4.2.x",
|
|
48
|
-
"
|
|
50
|
+
"rimraf": "~3.0.x",
|
|
49
51
|
"staged-git-files": "~1.3.x"
|
|
50
52
|
},
|
|
51
53
|
"publishConfig": {
|
|
52
54
|
"access": "public"
|
|
53
55
|
},
|
|
54
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "28cfe91d4b98377e3bf106f8893ba88014d3ac8d"
|
|
55
57
|
}
|