@baic/yolk-cli 2.1.0-alpha.54 → 2.1.0-alpha.57

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.
@@ -0,0 +1 @@
1
+ {"name":"prettier","author":"James Long","license":"MIT"}
@@ -0,0 +1,48 @@
1
+ /// <reference types="node" />
2
+
3
+ import fs = require('fs');
4
+ import glob = require('glob');
5
+
6
+ export declare type Options = rimraf.Options;
7
+
8
+ declare function rimraf(path: string, options: rimraf.Options, callback: (error: Error | null | undefined) => void): void;
9
+
10
+ declare function rimraf(path: string, callback: (error: Error | null | undefined) => void): void;
11
+
12
+ declare namespace rimraf {
13
+ /**
14
+ * It can remove stuff synchronously, too.
15
+ * But that's not so good. Use the async API.
16
+ * It's better.
17
+ */
18
+ function sync(path: string, options?: Options): void;
19
+
20
+ /**
21
+ * see {@link https://github.com/isaacs/rimraf/blob/79b933fb362b2c51bedfa448be848e1d7ed32d7e/README.md#options}
22
+ */
23
+ interface Options {
24
+ maxBusyTries?: number | undefined;
25
+ emfileWait?: number | undefined;
26
+ /** @default false */
27
+ disableGlob?: boolean | undefined;
28
+ glob?: glob.IOptions | false | undefined;
29
+
30
+ unlink?: typeof fs.unlink | undefined;
31
+ chmod?: typeof fs.chmod | undefined;
32
+ stat?: typeof fs.stat | undefined;
33
+ lstat?: typeof fs.lstat | undefined;
34
+ rmdir?: typeof fs.rmdir | undefined;
35
+ readdir?: typeof fs.readdir | undefined;
36
+ unlinkSync?: typeof fs.unlinkSync | undefined;
37
+ chmodSync?: typeof fs.chmodSync | undefined;
38
+ statSync?: typeof fs.statSync | undefined;
39
+ lstatSync?: typeof fs.lstatSync | undefined;
40
+ rmdirSync?: typeof fs.rmdirSync | undefined;
41
+ readdirSync?: typeof fs.readdirSync | undefined;
42
+ }
43
+ }
44
+ export default rimraf;
45
+
46
+ export declare type sync = rimraf.sync;
47
+
48
+ export { }
@@ -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","author":"Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)","license":"ISC"}