storybook 10.1.0-alpha.12 → 10.1.0-alpha.14
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/dist/_browser-chunks/{chunk-74YHFU5B.js → chunk-2XZMBGTA.js} +1 -1
- package/dist/_browser-chunks/{chunk-EBHB6RPS.js → chunk-FQ7SLVLR.js} +6 -1
- package/dist/_browser-chunks/{chunk-X3DUQ5RA.js → chunk-GFY5R5EY.js} +1 -1
- package/dist/_browser-chunks/{chunk-WXP2XJ3O.js → chunk-P4F4UVXX.js} +1 -0
- package/dist/_browser-chunks/{chunk-BE2DAXKJ.js → chunk-SS2NHR7W.js} +4 -1
- package/dist/_browser-chunks/{syntaxhighlighter-WKBQ5RC7.js → syntaxhighlighter-IQDEPFLK.js} +1 -1
- package/dist/_node-chunks/{builder-manager-YUOHSIUB.js → builder-manager-FQ5J6V3U.js} +32 -22
- package/dist/_node-chunks/{chunk-B6JWY6PC.js → camelcase-VGUYV77Z.js} +8 -8
- package/dist/_node-chunks/{chunk-FZLRAH4N.js → chunk-2JR3QBT2.js} +7 -7
- package/dist/_node-chunks/chunk-3EBH66BB.js +23 -0
- package/dist/_node-chunks/{chunk-E5FJS66Z.js → chunk-4ZFHN3ZY.js} +6 -6
- package/dist/_node-chunks/{chunk-5HV3B5OP.js → chunk-63PL4NNE.js} +1104 -13
- package/dist/_node-chunks/{chunk-NAOYEL54.js → chunk-A4KENTXT.js} +7 -7
- package/dist/_node-chunks/{chunk-4FT2DHGE.js → chunk-ALIA3J6S.js} +44 -10
- package/dist/_node-chunks/{chunk-WFLWJO24.js → chunk-C2HKH2XQ.js} +5710 -2414
- package/dist/_node-chunks/{chunk-WA6KZQZ2.js → chunk-DQNBAQYT.js} +6 -6
- package/dist/_node-chunks/{chunk-JARUEMEP.js → chunk-F74UHHR6.js} +7 -7
- package/dist/_node-chunks/{chunk-WUXQMQCB.js → chunk-H5XWXVWR.js} +6 -6
- package/dist/_node-chunks/{chunk-OP3INKUD.js → chunk-JMP7YFX2.js} +6 -6
- package/dist/_node-chunks/{chunk-DWXTZT3D.js → chunk-JZR4DHG2.js} +19 -7
- package/dist/_node-chunks/{chunk-QCO2ZM7F.js → chunk-KEA7CVMZ.js} +122 -32
- package/dist/_node-chunks/{chunk-DUXPWBOK.js → chunk-KF3WTAEP.js} +7 -7
- package/dist/_node-chunks/{chunk-2D2IODUU.js → chunk-LPPM7L5D.js} +51 -71
- package/dist/_node-chunks/{chunk-2DMESZFJ.js → chunk-MJUDR7HQ.js} +7 -7
- package/dist/_node-chunks/chunk-NPB4THZQ.js +18 -0
- package/dist/_node-chunks/chunk-NZBK3DSJ.js +29 -0
- package/dist/_node-chunks/{chunk-5KLIDWFN.js → chunk-Q2QUNQK6.js} +7 -7
- package/dist/_node-chunks/{chunk-EZWWR7AR.js → chunk-TMCKISJR.js} +101 -118
- package/dist/_node-chunks/chunk-TWK7AR3U.js +6024 -0
- package/dist/_node-chunks/{chunk-CZ5GHJCC.js → chunk-V7CXWJXC.js} +7 -7
- package/dist/_node-chunks/chunk-W4F3T6CY.js +3781 -0
- package/dist/_node-chunks/{chunk-SEMIAAWG.js → chunk-WACDSFMO.js} +9 -9
- package/dist/_node-chunks/{chunk-A4APXFQ2.js → chunk-WVXZFQQU.js} +14 -8
- package/dist/_node-chunks/chunk-XBPE4PT7.js +78 -0
- package/dist/_node-chunks/chunk-YMM6BYF2.js +61 -0
- package/dist/_node-chunks/{chunk-XXPJ7XR3.js → chunk-ZGZKNZ5S.js} +6 -6
- package/dist/_node-chunks/{dist-DS2B5A3J.js → dist-DR3AP3RJ.js} +9 -9
- package/dist/_node-chunks/{globby-6THB7HVX.js → globby-D4FPSHY2.js} +9 -9
- package/dist/_node-chunks/{lib-5NKX4YGG.js → lib-ZEFOVNTK.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-ZLT3QOFF.js → mdx-N42X6CFJ-PJF3ICCG.js} +8 -8
- package/dist/_node-chunks/{p-limit-PDMWNG7W.js → p-limit-CYQOFYPV.js} +7 -7
- package/dist/babel/index.js +10 -11
- package/dist/bin/core.js +33 -26
- package/dist/bin/dispatcher.js +31 -20
- package/dist/bin/loader.js +10 -13
- package/dist/cli/index.d.ts +1479 -133
- package/dist/cli/index.js +30 -5159
- package/dist/common/index.d.ts +139 -62
- package/dist/common/index.js +66 -51
- package/dist/components/index.d.ts +136 -26
- package/dist/components/index.js +3163 -2859
- package/dist/core-server/index.d.ts +3 -2
- package/dist/core-server/index.js +112 -1486
- package/dist/core-server/presets/common-manager.js +5 -5
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +272 -81
- package/dist/csf/index.js +2 -2
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +21557 -21133
- package/dist/manager/manager-stores.d.ts +1 -0
- package/dist/manager/manager-stores.js +23 -0
- package/dist/manager/runtime.js +6695 -720
- package/dist/manager-api/index.d.ts +1802 -1
- package/dist/manager-api/index.js +105 -11
- package/dist/manager-errors.d.ts +6 -0
- package/dist/manager-errors.js +2 -2
- package/dist/mocking-utils/index.d.ts +1126 -0
- package/dist/{_node-chunks/chunk-ZXSD6L3S.js → mocking-utils/index.js} +441 -16
- package/dist/node-logger/index.d.ts +192 -24
- package/dist/node-logger/index.js +23 -3148
- package/dist/preview/runtime.js +35 -3
- package/dist/preview-api/index.d.ts +69 -68
- package/dist/preview-api/index.js +2 -2
- package/dist/preview-errors.d.ts +6 -0
- package/dist/preview-errors.js +2 -2
- package/dist/server-errors.d.ts +31 -1
- package/dist/server-errors.js +17 -10
- package/dist/telemetry/index.d.ts +24 -3
- package/dist/telemetry/index.js +25 -24
- package/dist/types/index.d.ts +71 -8
- package/dist/types/index.js +25 -1
- package/package.json +11 -9
- package/dist/_node-chunks/camelcase-JREIL7NV.js +0 -18
- package/dist/_node-chunks/chunk-FDXFVHIL.js +0 -1114
- package/dist/_node-chunks/chunk-HZG65SU3.js +0 -34
- package/dist/_node-chunks/chunk-IXVYNBMD.js +0 -18
- package/dist/_node-chunks/chunk-LIH7MTP7.js +0 -3214
- package/dist/_node-chunks/chunk-N5GIRUP5.js +0 -1047
- package/dist/_node-chunks/chunk-O5DA7YLO.js +0 -3171
- package/dist/_node-chunks/chunk-QYQIZBS6.js +0 -26
- package/dist/_node-chunks/chunk-TS2UUH2J.js +0 -301
- package/dist/_node-chunks/chunk-Y4E6IGQF.js +0 -61
- package/dist/_node-chunks/chunk-ZL3AFKRX.js +0 -1029
- package/dist/_node-chunks/plugin-6XMWOGPO.js +0 -123
- package/dist/_node-chunks/plugin-LTOXVT6A.js +0 -109
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-2SFE5LQS.js +0 -46582
- package/dist/_node-chunks/webpack-mock-plugin-CX5J2U56.js +0 -92
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -32
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -28
|
@@ -1,92 +1,86 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
|
-
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
15
|
-
import {
|
|
16
|
-
require_pretty_hrtime
|
|
17
|
-
} from "../_node-chunks/chunk-HZG65SU3.js";
|
|
18
|
-
import {
|
|
19
|
-
boxen,
|
|
20
|
-
require_string_width
|
|
21
|
-
} from "../_node-chunks/chunk-N5GIRUP5.js";
|
|
22
|
-
import "../_node-chunks/chunk-B6JWY6PC.js";
|
|
23
|
-
import {
|
|
24
|
-
StatusTypeIdMismatchError,
|
|
25
|
-
StorybookError
|
|
26
|
-
} from "../_node-chunks/chunk-2D2IODUU.js";
|
|
13
|
+
StatusTypeIdMismatchError
|
|
14
|
+
} from "../_node-chunks/chunk-LPPM7L5D.js";
|
|
27
15
|
import {
|
|
16
|
+
debounce,
|
|
28
17
|
getErrorLevel,
|
|
18
|
+
isTelemetryEnabled,
|
|
29
19
|
mapStaticDir,
|
|
30
20
|
parseStaticDir,
|
|
31
21
|
sendTelemetryError,
|
|
32
22
|
useStatics,
|
|
33
23
|
withTelemetry
|
|
34
|
-
} from "../_node-chunks/chunk-
|
|
35
|
-
import "../_node-chunks/chunk-
|
|
24
|
+
} from "../_node-chunks/chunk-KEA7CVMZ.js";
|
|
25
|
+
import "../_node-chunks/chunk-V7CXWJXC.js";
|
|
26
|
+
import {
|
|
27
|
+
detectPnp
|
|
28
|
+
} from "../_node-chunks/chunk-3EBH66BB.js";
|
|
29
|
+
import {
|
|
30
|
+
StorybookError
|
|
31
|
+
} from "../_node-chunks/chunk-XBPE4PT7.js";
|
|
36
32
|
import {
|
|
37
33
|
telemetry
|
|
38
|
-
} from "../_node-chunks/chunk-
|
|
39
|
-
import "../_node-chunks/chunk-
|
|
34
|
+
} from "../_node-chunks/chunk-TMCKISJR.js";
|
|
35
|
+
import "../_node-chunks/chunk-NPB4THZQ.js";
|
|
40
36
|
import {
|
|
37
|
+
optionalEnvToBoolean,
|
|
38
|
+
require_cross_spawn,
|
|
41
39
|
resolveImport,
|
|
42
40
|
supportedExtensions,
|
|
43
41
|
userOrAutoTitleFromSpecifier
|
|
44
|
-
} from "../_node-chunks/chunk-
|
|
45
|
-
import "../_node-chunks/chunk-
|
|
46
|
-
import "../_node-chunks/chunk-
|
|
47
|
-
import "../_node-chunks/chunk-4FT2DHGE.js";
|
|
42
|
+
} from "../_node-chunks/chunk-C2HKH2XQ.js";
|
|
43
|
+
import "../_node-chunks/chunk-YMM6BYF2.js";
|
|
44
|
+
import "../_node-chunks/chunk-MJUDR7HQ.js";
|
|
48
45
|
import {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
require_pretty_hrtime
|
|
47
|
+
} from "../_node-chunks/chunk-W4F3T6CY.js";
|
|
48
|
+
import "../_node-chunks/chunk-H5XWXVWR.js";
|
|
49
|
+
import "../_node-chunks/chunk-ALIA3J6S.js";
|
|
52
50
|
import {
|
|
51
|
+
invariant,
|
|
53
52
|
up2 as up
|
|
54
|
-
} from "../_node-chunks/chunk-
|
|
55
|
-
import "../_node-chunks/chunk-WUXQMQCB.js";
|
|
56
|
-
import {
|
|
57
|
-
invariant
|
|
58
|
-
} from "../_node-chunks/chunk-QYQIZBS6.js";
|
|
53
|
+
} from "../_node-chunks/chunk-JZR4DHG2.js";
|
|
59
54
|
import {
|
|
60
55
|
importModule,
|
|
61
56
|
resolvePackageDir
|
|
62
|
-
} from "../_node-chunks/chunk-
|
|
57
|
+
} from "../_node-chunks/chunk-WVXZFQQU.js";
|
|
58
|
+
import "../_node-chunks/chunk-NZBK3DSJ.js";
|
|
63
59
|
import {
|
|
60
|
+
dirname,
|
|
64
61
|
join,
|
|
65
62
|
relative,
|
|
66
63
|
resolve
|
|
67
|
-
} from "../_node-chunks/chunk-
|
|
68
|
-
import
|
|
69
|
-
require_prompts
|
|
70
|
-
} from "../_node-chunks/chunk-LIH7MTP7.js";
|
|
71
|
-
import "../_node-chunks/chunk-JARUEMEP.js";
|
|
64
|
+
} from "../_node-chunks/chunk-DQNBAQYT.js";
|
|
65
|
+
import "../_node-chunks/chunk-F74UHHR6.js";
|
|
72
66
|
import {
|
|
73
67
|
slash
|
|
74
|
-
} from "../_node-chunks/chunk-
|
|
68
|
+
} from "../_node-chunks/chunk-4ZFHN3ZY.js";
|
|
75
69
|
import {
|
|
76
70
|
require_dist
|
|
77
|
-
} from "../_node-chunks/chunk-
|
|
71
|
+
} from "../_node-chunks/chunk-KF3WTAEP.js";
|
|
78
72
|
import {
|
|
79
73
|
require_lib,
|
|
80
74
|
require_src
|
|
81
|
-
} from "../_node-chunks/chunk-
|
|
75
|
+
} from "../_node-chunks/chunk-2JR3QBT2.js";
|
|
82
76
|
import {
|
|
83
77
|
require_picocolors
|
|
84
|
-
} from "../_node-chunks/chunk-
|
|
78
|
+
} from "../_node-chunks/chunk-A4KENTXT.js";
|
|
85
79
|
import {
|
|
86
80
|
__commonJS,
|
|
87
81
|
__require,
|
|
88
82
|
__toESM
|
|
89
|
-
} from "../_node-chunks/chunk-
|
|
83
|
+
} from "../_node-chunks/chunk-JMP7YFX2.js";
|
|
90
84
|
|
|
91
85
|
// ../node_modules/tsconfig-paths/lib/filesystem.js
|
|
92
86
|
var require_filesystem = __commonJS({
|
|
@@ -1006,7 +1000,7 @@ var require_stringify_stream = __commonJS({
|
|
|
1006
1000
|
STRING_STREAM,
|
|
1007
1001
|
OBJECT_STREAM
|
|
1008
1002
|
}
|
|
1009
|
-
} = require_utils(),
|
|
1003
|
+
} = require_utils(), noop = () => {
|
|
1010
1004
|
}, hasOwnProperty2 = Object.prototype.hasOwnProperty, wellformedStringStringify = JSON.stringify("\uD800") === '"\\ud800"' ? JSON.stringify : (s) => JSON.stringify(s).replace(
|
|
1011
1005
|
new RegExp("\\p{Surrogate}", "gu"),
|
|
1012
1006
|
(m) => `\\u${m.charCodeAt(0).toString(16)}`
|
|
@@ -1081,7 +1075,7 @@ ${this.space.repeat(this._depth - 1)}]`) : this.push("]"), this.popStack();
|
|
|
1081
1075
|
}
|
|
1082
1076
|
this.space = normalizeSpace(space), this._depth = 0, this.error = null, this._processing = !1, this._ended = !1, this._readSize = 0, this._buffer = "", this._stack = null, this._visited = /* @__PURE__ */ new WeakSet(), this.pushStack({
|
|
1083
1077
|
handler: () => {
|
|
1084
|
-
this.popStack(), this.processValue({ "": value }, "", value,
|
|
1078
|
+
this.popStack(), this.processValue({ "": value }, "", value, noop);
|
|
1085
1079
|
}
|
|
1086
1080
|
});
|
|
1087
1081
|
}
|
|
@@ -1120,7 +1114,7 @@ ${this.space.repeat(this._depth - 1)}]`) : this.push("]"), this.popStack();
|
|
|
1120
1114
|
break;
|
|
1121
1115
|
case PROMISE:
|
|
1122
1116
|
this.pushStack({
|
|
1123
|
-
handler:
|
|
1117
|
+
handler: noop,
|
|
1124
1118
|
awaiting: !0
|
|
1125
1119
|
}), Promise.resolve(value).then((resolved) => {
|
|
1126
1120
|
this.popStack(), this.processValue(holder, key, resolved, callback), this.processStack();
|
|
@@ -1684,7 +1678,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1684
1678
|
"../node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
1685
1679
|
var fs6 = __require("fs"), polyfills = require_polyfills(), legacy = require_legacy_streams(), clone = require_clone(), util = __require("util"), gracefulQueue, previousSymbol;
|
|
1686
1680
|
typeof Symbol == "function" && typeof Symbol.for == "function" ? (gracefulQueue = Symbol.for("graceful-fs.queue"), previousSymbol = Symbol.for("graceful-fs.previous")) : (gracefulQueue = "___graceful-fs.queue", previousSymbol = "___graceful-fs.previous");
|
|
1687
|
-
function
|
|
1681
|
+
function noop() {
|
|
1688
1682
|
}
|
|
1689
1683
|
function publishQueue(context, queue2) {
|
|
1690
1684
|
Object.defineProperty(context, gracefulQueue, {
|
|
@@ -1693,7 +1687,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1693
1687
|
}
|
|
1694
1688
|
});
|
|
1695
1689
|
}
|
|
1696
|
-
var debug =
|
|
1690
|
+
var debug = noop;
|
|
1697
1691
|
util.debuglog ? debug = util.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (debug = function() {
|
|
1698
1692
|
var m = util.format.apply(util, arguments);
|
|
1699
1693
|
m = "GFS4: " + m.split(/\n/).join(`
|
|
@@ -1882,15 +1876,15 @@ GFS4: `), console.error(m);
|
|
|
1882
1876
|
return fs7;
|
|
1883
1877
|
}
|
|
1884
1878
|
function enqueue(elem) {
|
|
1885
|
-
debug("ENQUEUE", elem[0].name, elem[1]), fs6[gracefulQueue].push(elem),
|
|
1879
|
+
debug("ENQUEUE", elem[0].name, elem[1]), fs6[gracefulQueue].push(elem), retry();
|
|
1886
1880
|
}
|
|
1887
1881
|
var retryTimer;
|
|
1888
1882
|
function resetQueue() {
|
|
1889
1883
|
for (var now = Date.now(), i = 0; i < fs6[gracefulQueue].length; ++i)
|
|
1890
1884
|
fs6[gracefulQueue][i].length > 2 && (fs6[gracefulQueue][i][3] = now, fs6[gracefulQueue][i][4] = now);
|
|
1891
|
-
|
|
1885
|
+
retry();
|
|
1892
1886
|
}
|
|
1893
|
-
function
|
|
1887
|
+
function retry() {
|
|
1894
1888
|
if (clearTimeout(retryTimer), retryTimer = void 0, fs6[gracefulQueue].length !== 0) {
|
|
1895
1889
|
var elem = fs6[gracefulQueue].shift(), fn = elem[0], args = elem[1], err = elem[2], startTime = elem[3], lastTime = elem[4];
|
|
1896
1890
|
if (startTime === void 0)
|
|
@@ -1903,7 +1897,7 @@ GFS4: `), console.error(m);
|
|
|
1903
1897
|
var sinceAttempt = Date.now() - lastTime, sinceStart = Math.max(lastTime - startTime, 1), desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
1904
1898
|
sinceAttempt >= desiredDelay ? (debug("RETRY", fn.name, args), fn.apply(null, args.concat([startTime]))) : fs6[gracefulQueue].push(elem);
|
|
1905
1899
|
}
|
|
1906
|
-
retryTimer === void 0 && (retryTimer = setTimeout(
|
|
1900
|
+
retryTimer === void 0 && (retryTimer = setTimeout(retry, 0));
|
|
1907
1901
|
}
|
|
1908
1902
|
}
|
|
1909
1903
|
}
|
|
@@ -3843,7 +3837,7 @@ var require_dist2 = __commonJS({
|
|
|
3843
3837
|
MapCache.prototype.has = mapCacheHas_default;
|
|
3844
3838
|
MapCache.prototype.set = mapCacheSet_default;
|
|
3845
3839
|
var MapCache_default = MapCache, FUNC_ERROR_TEXT = "Expected a function";
|
|
3846
|
-
function
|
|
3840
|
+
function memoize(func, resolver) {
|
|
3847
3841
|
if (typeof func != "function" || resolver != null && typeof resolver != "function")
|
|
3848
3842
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
3849
3843
|
var memoized = function() {
|
|
@@ -3853,10 +3847,10 @@ var require_dist2 = __commonJS({
|
|
|
3853
3847
|
var result = func.apply(this, args);
|
|
3854
3848
|
return memoized.cache = cache2.set(key, result) || cache2, result;
|
|
3855
3849
|
};
|
|
3856
|
-
return memoized.cache = new (
|
|
3850
|
+
return memoized.cache = new (memoize.Cache || MapCache_default)(), memoized;
|
|
3857
3851
|
}
|
|
3858
|
-
|
|
3859
|
-
var memoize_default =
|
|
3852
|
+
memoize.Cache = MapCache_default;
|
|
3853
|
+
var memoize_default = memoize, MAX_MEMOIZE_SIZE = 500;
|
|
3860
3854
|
function memoizeCapped(func) {
|
|
3861
3855
|
var result = memoize_default(func, function(key) {
|
|
3862
3856
|
return cache2.size === MAX_MEMOIZE_SIZE && cache2.clear(), key;
|
|
@@ -4245,1290 +4239,6 @@ var require_detect_port2 = __commonJS({
|
|
|
4245
4239
|
}
|
|
4246
4240
|
});
|
|
4247
4241
|
|
|
4248
|
-
// ../node_modules/cli-table3/src/debug.js
|
|
4249
|
-
var require_debug = __commonJS({
|
|
4250
|
-
"../node_modules/cli-table3/src/debug.js"(exports, module) {
|
|
4251
|
-
var messages = [], level = 0, debug = (msg, min) => {
|
|
4252
|
-
level >= min && messages.push(msg);
|
|
4253
|
-
};
|
|
4254
|
-
debug.WARN = 1;
|
|
4255
|
-
debug.INFO = 2;
|
|
4256
|
-
debug.DEBUG = 3;
|
|
4257
|
-
debug.reset = () => {
|
|
4258
|
-
messages = [];
|
|
4259
|
-
};
|
|
4260
|
-
debug.setDebugLevel = (v) => {
|
|
4261
|
-
level = v;
|
|
4262
|
-
};
|
|
4263
|
-
debug.warn = (msg) => debug(msg, debug.WARN);
|
|
4264
|
-
debug.info = (msg) => debug(msg, debug.INFO);
|
|
4265
|
-
debug.debug = (msg) => debug(msg, debug.DEBUG);
|
|
4266
|
-
debug.debugMessages = () => messages;
|
|
4267
|
-
module.exports = debug;
|
|
4268
|
-
}
|
|
4269
|
-
});
|
|
4270
|
-
|
|
4271
|
-
// ../node_modules/cli-table3/src/utils.js
|
|
4272
|
-
var require_utils2 = __commonJS({
|
|
4273
|
-
"../node_modules/cli-table3/src/utils.js"(exports, module) {
|
|
4274
|
-
var stringWidth = require_string_width();
|
|
4275
|
-
function codeRegex(capture) {
|
|
4276
|
-
return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g;
|
|
4277
|
-
}
|
|
4278
|
-
function strlen(str) {
|
|
4279
|
-
let code = codeRegex();
|
|
4280
|
-
return ("" + str).replace(code, "").split(`
|
|
4281
|
-
`).reduce(function(memo, s) {
|
|
4282
|
-
return stringWidth(s) > memo ? stringWidth(s) : memo;
|
|
4283
|
-
}, 0);
|
|
4284
|
-
}
|
|
4285
|
-
function repeat(str, times) {
|
|
4286
|
-
return Array(times + 1).join(str);
|
|
4287
|
-
}
|
|
4288
|
-
function pad(str, len, pad2, dir) {
|
|
4289
|
-
let length = strlen(str);
|
|
4290
|
-
if (len + 1 >= length) {
|
|
4291
|
-
let padlen = len - length;
|
|
4292
|
-
switch (dir) {
|
|
4293
|
-
case "right": {
|
|
4294
|
-
str = repeat(pad2, padlen) + str;
|
|
4295
|
-
break;
|
|
4296
|
-
}
|
|
4297
|
-
case "center": {
|
|
4298
|
-
let right = Math.ceil(padlen / 2), left = padlen - right;
|
|
4299
|
-
str = repeat(pad2, left) + str + repeat(pad2, right);
|
|
4300
|
-
break;
|
|
4301
|
-
}
|
|
4302
|
-
default: {
|
|
4303
|
-
str = str + repeat(pad2, padlen);
|
|
4304
|
-
break;
|
|
4305
|
-
}
|
|
4306
|
-
}
|
|
4307
|
-
}
|
|
4308
|
-
return str;
|
|
4309
|
-
}
|
|
4310
|
-
var codeCache = {};
|
|
4311
|
-
function addToCodeCache(name, on, off) {
|
|
4312
|
-
on = "\x1B[" + on + "m", off = "\x1B[" + off + "m", codeCache[on] = { set: name, to: !0 }, codeCache[off] = { set: name, to: !1 }, codeCache[name] = { on, off };
|
|
4313
|
-
}
|
|
4314
|
-
addToCodeCache("bold", 1, 22);
|
|
4315
|
-
addToCodeCache("italics", 3, 23);
|
|
4316
|
-
addToCodeCache("underline", 4, 24);
|
|
4317
|
-
addToCodeCache("inverse", 7, 27);
|
|
4318
|
-
addToCodeCache("strikethrough", 9, 29);
|
|
4319
|
-
function updateState(state, controlChars) {
|
|
4320
|
-
let controlCode = controlChars[1] ? parseInt(controlChars[1].split(";")[0]) : 0;
|
|
4321
|
-
if (controlCode >= 30 && controlCode <= 39 || controlCode >= 90 && controlCode <= 97) {
|
|
4322
|
-
state.lastForegroundAdded = controlChars[0];
|
|
4323
|
-
return;
|
|
4324
|
-
}
|
|
4325
|
-
if (controlCode >= 40 && controlCode <= 49 || controlCode >= 100 && controlCode <= 107) {
|
|
4326
|
-
state.lastBackgroundAdded = controlChars[0];
|
|
4327
|
-
return;
|
|
4328
|
-
}
|
|
4329
|
-
if (controlCode === 0) {
|
|
4330
|
-
for (let i in state)
|
|
4331
|
-
Object.prototype.hasOwnProperty.call(state, i) && delete state[i];
|
|
4332
|
-
return;
|
|
4333
|
-
}
|
|
4334
|
-
let info = codeCache[controlChars[0]];
|
|
4335
|
-
info && (state[info.set] = info.to);
|
|
4336
|
-
}
|
|
4337
|
-
function readState(line) {
|
|
4338
|
-
let code = codeRegex(!0), controlChars = code.exec(line), state = {};
|
|
4339
|
-
for (; controlChars !== null; )
|
|
4340
|
-
updateState(state, controlChars), controlChars = code.exec(line);
|
|
4341
|
-
return state;
|
|
4342
|
-
}
|
|
4343
|
-
function unwindState(state, ret) {
|
|
4344
|
-
let lastBackgroundAdded = state.lastBackgroundAdded, lastForegroundAdded = state.lastForegroundAdded;
|
|
4345
|
-
return delete state.lastBackgroundAdded, delete state.lastForegroundAdded, Object.keys(state).forEach(function(key) {
|
|
4346
|
-
state[key] && (ret += codeCache[key].off);
|
|
4347
|
-
}), lastBackgroundAdded && lastBackgroundAdded != "\x1B[49m" && (ret += "\x1B[49m"), lastForegroundAdded && lastForegroundAdded != "\x1B[39m" && (ret += "\x1B[39m"), ret;
|
|
4348
|
-
}
|
|
4349
|
-
function rewindState(state, ret) {
|
|
4350
|
-
let lastBackgroundAdded = state.lastBackgroundAdded, lastForegroundAdded = state.lastForegroundAdded;
|
|
4351
|
-
return delete state.lastBackgroundAdded, delete state.lastForegroundAdded, Object.keys(state).forEach(function(key) {
|
|
4352
|
-
state[key] && (ret = codeCache[key].on + ret);
|
|
4353
|
-
}), lastBackgroundAdded && lastBackgroundAdded != "\x1B[49m" && (ret = lastBackgroundAdded + ret), lastForegroundAdded && lastForegroundAdded != "\x1B[39m" && (ret = lastForegroundAdded + ret), ret;
|
|
4354
|
-
}
|
|
4355
|
-
function truncateWidth(str, desiredLength) {
|
|
4356
|
-
if (str.length === strlen(str))
|
|
4357
|
-
return str.substr(0, desiredLength);
|
|
4358
|
-
for (; strlen(str) > desiredLength; )
|
|
4359
|
-
str = str.slice(0, -1);
|
|
4360
|
-
return str;
|
|
4361
|
-
}
|
|
4362
|
-
function truncateWidthWithAnsi(str, desiredLength) {
|
|
4363
|
-
let code = codeRegex(!0), split = str.split(codeRegex()), splitIndex = 0, retLen = 0, ret = "", myArray, state = {};
|
|
4364
|
-
for (; retLen < desiredLength; ) {
|
|
4365
|
-
myArray = code.exec(str);
|
|
4366
|
-
let toAdd = split[splitIndex];
|
|
4367
|
-
if (splitIndex++, retLen + strlen(toAdd) > desiredLength && (toAdd = truncateWidth(toAdd, desiredLength - retLen)), ret += toAdd, retLen += strlen(toAdd), retLen < desiredLength) {
|
|
4368
|
-
if (!myArray)
|
|
4369
|
-
break;
|
|
4370
|
-
ret += myArray[0], updateState(state, myArray);
|
|
4371
|
-
}
|
|
4372
|
-
}
|
|
4373
|
-
return unwindState(state, ret);
|
|
4374
|
-
}
|
|
4375
|
-
function truncate(str, desiredLength, truncateChar) {
|
|
4376
|
-
if (truncateChar = truncateChar || "\u2026", strlen(str) <= desiredLength)
|
|
4377
|
-
return str;
|
|
4378
|
-
desiredLength -= strlen(truncateChar);
|
|
4379
|
-
let ret = truncateWidthWithAnsi(str, desiredLength);
|
|
4380
|
-
ret += truncateChar;
|
|
4381
|
-
let hrefTag = "\x1B]8;;\x07";
|
|
4382
|
-
return str.includes(hrefTag) && !ret.includes(hrefTag) && (ret += hrefTag), ret;
|
|
4383
|
-
}
|
|
4384
|
-
function defaultOptions() {
|
|
4385
|
-
return {
|
|
4386
|
-
chars: {
|
|
4387
|
-
top: "\u2500",
|
|
4388
|
-
"top-mid": "\u252C",
|
|
4389
|
-
"top-left": "\u250C",
|
|
4390
|
-
"top-right": "\u2510",
|
|
4391
|
-
bottom: "\u2500",
|
|
4392
|
-
"bottom-mid": "\u2534",
|
|
4393
|
-
"bottom-left": "\u2514",
|
|
4394
|
-
"bottom-right": "\u2518",
|
|
4395
|
-
left: "\u2502",
|
|
4396
|
-
"left-mid": "\u251C",
|
|
4397
|
-
mid: "\u2500",
|
|
4398
|
-
"mid-mid": "\u253C",
|
|
4399
|
-
right: "\u2502",
|
|
4400
|
-
"right-mid": "\u2524",
|
|
4401
|
-
middle: "\u2502"
|
|
4402
|
-
},
|
|
4403
|
-
truncate: "\u2026",
|
|
4404
|
-
colWidths: [],
|
|
4405
|
-
rowHeights: [],
|
|
4406
|
-
colAligns: [],
|
|
4407
|
-
rowAligns: [],
|
|
4408
|
-
style: {
|
|
4409
|
-
"padding-left": 1,
|
|
4410
|
-
"padding-right": 1,
|
|
4411
|
-
head: ["red"],
|
|
4412
|
-
border: ["grey"],
|
|
4413
|
-
compact: !1
|
|
4414
|
-
},
|
|
4415
|
-
head: []
|
|
4416
|
-
};
|
|
4417
|
-
}
|
|
4418
|
-
function mergeOptions(options, defaults) {
|
|
4419
|
-
options = options || {}, defaults = defaults || defaultOptions();
|
|
4420
|
-
let ret = Object.assign({}, defaults, options);
|
|
4421
|
-
return ret.chars = Object.assign({}, defaults.chars, options.chars), ret.style = Object.assign({}, defaults.style, options.style), ret;
|
|
4422
|
-
}
|
|
4423
|
-
function wordWrap(maxLength, input) {
|
|
4424
|
-
let lines = [], split = input.split(/(\s+)/g), line = [], lineLength = 0, whitespace;
|
|
4425
|
-
for (let i = 0; i < split.length; i += 2) {
|
|
4426
|
-
let word = split[i], newLength = lineLength + strlen(word);
|
|
4427
|
-
lineLength > 0 && whitespace && (newLength += whitespace.length), newLength > maxLength ? (lineLength !== 0 && lines.push(line.join("")), line = [word], lineLength = strlen(word)) : (line.push(whitespace || "", word), lineLength = newLength), whitespace = split[i + 1];
|
|
4428
|
-
}
|
|
4429
|
-
return lineLength && lines.push(line.join("")), lines;
|
|
4430
|
-
}
|
|
4431
|
-
function textWrap(maxLength, input) {
|
|
4432
|
-
let lines = [], line = "";
|
|
4433
|
-
function pushLine(str, ws) {
|
|
4434
|
-
for (line.length && ws && (line += ws), line += str; line.length > maxLength; )
|
|
4435
|
-
lines.push(line.slice(0, maxLength)), line = line.slice(maxLength);
|
|
4436
|
-
}
|
|
4437
|
-
let split = input.split(/(\s+)/g);
|
|
4438
|
-
for (let i = 0; i < split.length; i += 2)
|
|
4439
|
-
pushLine(split[i], i && split[i - 1]);
|
|
4440
|
-
return line.length && lines.push(line), lines;
|
|
4441
|
-
}
|
|
4442
|
-
function multiLineWordWrap(maxLength, input, wrapOnWordBoundary = !0) {
|
|
4443
|
-
let output = [];
|
|
4444
|
-
input = input.split(`
|
|
4445
|
-
`);
|
|
4446
|
-
let handler = wrapOnWordBoundary ? wordWrap : textWrap;
|
|
4447
|
-
for (let i = 0; i < input.length; i++)
|
|
4448
|
-
output.push.apply(output, handler(maxLength, input[i]));
|
|
4449
|
-
return output;
|
|
4450
|
-
}
|
|
4451
|
-
function colorizeLines(input) {
|
|
4452
|
-
let state = {}, output = [];
|
|
4453
|
-
for (let i = 0; i < input.length; i++) {
|
|
4454
|
-
let line = rewindState(state, input[i]);
|
|
4455
|
-
state = readState(line);
|
|
4456
|
-
let temp = Object.assign({}, state);
|
|
4457
|
-
output.push(unwindState(temp, line));
|
|
4458
|
-
}
|
|
4459
|
-
return output;
|
|
4460
|
-
}
|
|
4461
|
-
function hyperlink(url, text) {
|
|
4462
|
-
return ["\x1B]", "8", ";", ";", url || text, "\x07", text, "\x1B]", "8", ";", ";", "\x07"].join("");
|
|
4463
|
-
}
|
|
4464
|
-
module.exports = {
|
|
4465
|
-
strlen,
|
|
4466
|
-
repeat,
|
|
4467
|
-
pad,
|
|
4468
|
-
truncate,
|
|
4469
|
-
mergeOptions,
|
|
4470
|
-
wordWrap: multiLineWordWrap,
|
|
4471
|
-
colorizeLines,
|
|
4472
|
-
hyperlink
|
|
4473
|
-
};
|
|
4474
|
-
}
|
|
4475
|
-
});
|
|
4476
|
-
|
|
4477
|
-
// ../node_modules/@colors/colors/lib/styles.js
|
|
4478
|
-
var require_styles = __commonJS({
|
|
4479
|
-
"../node_modules/@colors/colors/lib/styles.js"(exports, module) {
|
|
4480
|
-
var styles = {};
|
|
4481
|
-
module.exports = styles;
|
|
4482
|
-
var codes = {
|
|
4483
|
-
reset: [0, 0],
|
|
4484
|
-
bold: [1, 22],
|
|
4485
|
-
dim: [2, 22],
|
|
4486
|
-
italic: [3, 23],
|
|
4487
|
-
underline: [4, 24],
|
|
4488
|
-
inverse: [7, 27],
|
|
4489
|
-
hidden: [8, 28],
|
|
4490
|
-
strikethrough: [9, 29],
|
|
4491
|
-
black: [30, 39],
|
|
4492
|
-
red: [31, 39],
|
|
4493
|
-
green: [32, 39],
|
|
4494
|
-
yellow: [33, 39],
|
|
4495
|
-
blue: [34, 39],
|
|
4496
|
-
magenta: [35, 39],
|
|
4497
|
-
cyan: [36, 39],
|
|
4498
|
-
white: [37, 39],
|
|
4499
|
-
gray: [90, 39],
|
|
4500
|
-
grey: [90, 39],
|
|
4501
|
-
brightRed: [91, 39],
|
|
4502
|
-
brightGreen: [92, 39],
|
|
4503
|
-
brightYellow: [93, 39],
|
|
4504
|
-
brightBlue: [94, 39],
|
|
4505
|
-
brightMagenta: [95, 39],
|
|
4506
|
-
brightCyan: [96, 39],
|
|
4507
|
-
brightWhite: [97, 39],
|
|
4508
|
-
bgBlack: [40, 49],
|
|
4509
|
-
bgRed: [41, 49],
|
|
4510
|
-
bgGreen: [42, 49],
|
|
4511
|
-
bgYellow: [43, 49],
|
|
4512
|
-
bgBlue: [44, 49],
|
|
4513
|
-
bgMagenta: [45, 49],
|
|
4514
|
-
bgCyan: [46, 49],
|
|
4515
|
-
bgWhite: [47, 49],
|
|
4516
|
-
bgGray: [100, 49],
|
|
4517
|
-
bgGrey: [100, 49],
|
|
4518
|
-
bgBrightRed: [101, 49],
|
|
4519
|
-
bgBrightGreen: [102, 49],
|
|
4520
|
-
bgBrightYellow: [103, 49],
|
|
4521
|
-
bgBrightBlue: [104, 49],
|
|
4522
|
-
bgBrightMagenta: [105, 49],
|
|
4523
|
-
bgBrightCyan: [106, 49],
|
|
4524
|
-
bgBrightWhite: [107, 49],
|
|
4525
|
-
// legacy styles for colors pre v1.0.0
|
|
4526
|
-
blackBG: [40, 49],
|
|
4527
|
-
redBG: [41, 49],
|
|
4528
|
-
greenBG: [42, 49],
|
|
4529
|
-
yellowBG: [43, 49],
|
|
4530
|
-
blueBG: [44, 49],
|
|
4531
|
-
magentaBG: [45, 49],
|
|
4532
|
-
cyanBG: [46, 49],
|
|
4533
|
-
whiteBG: [47, 49]
|
|
4534
|
-
};
|
|
4535
|
-
Object.keys(codes).forEach(function(key) {
|
|
4536
|
-
var val = codes[key], style = styles[key] = [];
|
|
4537
|
-
style.open = "\x1B[" + val[0] + "m", style.close = "\x1B[" + val[1] + "m";
|
|
4538
|
-
});
|
|
4539
|
-
}
|
|
4540
|
-
});
|
|
4541
|
-
|
|
4542
|
-
// ../node_modules/@colors/colors/lib/system/has-flag.js
|
|
4543
|
-
var require_has_flag = __commonJS({
|
|
4544
|
-
"../node_modules/@colors/colors/lib/system/has-flag.js"(exports, module) {
|
|
4545
|
-
"use strict";
|
|
4546
|
-
module.exports = function(flag, argv) {
|
|
4547
|
-
argv = argv || process.argv;
|
|
4548
|
-
var terminatorPos = argv.indexOf("--"), prefix = /^-{1,2}/.test(flag) ? "" : "--", pos = argv.indexOf(prefix + flag);
|
|
4549
|
-
return pos !== -1 && (terminatorPos === -1 ? !0 : pos < terminatorPos);
|
|
4550
|
-
};
|
|
4551
|
-
}
|
|
4552
|
-
});
|
|
4553
|
-
|
|
4554
|
-
// ../node_modules/@colors/colors/lib/system/supports-colors.js
|
|
4555
|
-
var require_supports_colors = __commonJS({
|
|
4556
|
-
"../node_modules/@colors/colors/lib/system/supports-colors.js"(exports, module) {
|
|
4557
|
-
"use strict";
|
|
4558
|
-
var os3 = __require("os"), hasFlag = require_has_flag(), env = process.env, forceColor = void 0;
|
|
4559
|
-
hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") ? forceColor = !1 : (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) && (forceColor = !0);
|
|
4560
|
-
"FORCE_COLOR" in env && (forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0);
|
|
4561
|
-
function translateLevel(level) {
|
|
4562
|
-
return level === 0 ? !1 : {
|
|
4563
|
-
level,
|
|
4564
|
-
hasBasic: !0,
|
|
4565
|
-
has256: level >= 2,
|
|
4566
|
-
has16m: level >= 3
|
|
4567
|
-
};
|
|
4568
|
-
}
|
|
4569
|
-
function supportsColor(stream) {
|
|
4570
|
-
if (forceColor === !1)
|
|
4571
|
-
return 0;
|
|
4572
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor"))
|
|
4573
|
-
return 3;
|
|
4574
|
-
if (hasFlag("color=256"))
|
|
4575
|
-
return 2;
|
|
4576
|
-
if (stream && !stream.isTTY && forceColor !== !0)
|
|
4577
|
-
return 0;
|
|
4578
|
-
var min = forceColor ? 1 : 0;
|
|
4579
|
-
if (process.platform === "win32") {
|
|
4580
|
-
var osRelease = os3.release().split(".");
|
|
4581
|
-
return Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ? Number(osRelease[2]) >= 14931 ? 3 : 2 : 1;
|
|
4582
|
-
}
|
|
4583
|
-
if ("CI" in env)
|
|
4584
|
-
return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(sign) {
|
|
4585
|
-
return sign in env;
|
|
4586
|
-
}) || env.CI_NAME === "codeship" ? 1 : min;
|
|
4587
|
-
if ("TEAMCITY_VERSION" in env)
|
|
4588
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
4589
|
-
if ("TERM_PROGRAM" in env) {
|
|
4590
|
-
var version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
4591
|
-
switch (env.TERM_PROGRAM) {
|
|
4592
|
-
case "iTerm.app":
|
|
4593
|
-
return version >= 3 ? 3 : 2;
|
|
4594
|
-
case "Hyper":
|
|
4595
|
-
return 3;
|
|
4596
|
-
case "Apple_Terminal":
|
|
4597
|
-
return 2;
|
|
4598
|
-
}
|
|
4599
|
-
}
|
|
4600
|
-
return /-256(color)?$/i.test(env.TERM) ? 2 : /^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM) || "COLORTERM" in env ? 1 : (env.TERM === "dumb", min);
|
|
4601
|
-
}
|
|
4602
|
-
function getSupportLevel(stream) {
|
|
4603
|
-
var level = supportsColor(stream);
|
|
4604
|
-
return translateLevel(level);
|
|
4605
|
-
}
|
|
4606
|
-
module.exports = {
|
|
4607
|
-
supportsColor: getSupportLevel,
|
|
4608
|
-
stdout: getSupportLevel(process.stdout),
|
|
4609
|
-
stderr: getSupportLevel(process.stderr)
|
|
4610
|
-
};
|
|
4611
|
-
}
|
|
4612
|
-
});
|
|
4613
|
-
|
|
4614
|
-
// ../node_modules/@colors/colors/lib/custom/trap.js
|
|
4615
|
-
var require_trap = __commonJS({
|
|
4616
|
-
"../node_modules/@colors/colors/lib/custom/trap.js"(exports, module) {
|
|
4617
|
-
module.exports = function(text, options) {
|
|
4618
|
-
var result = "";
|
|
4619
|
-
text = text || "Run the trap, drop the bass", text = text.split("");
|
|
4620
|
-
var trap = {
|
|
4621
|
-
a: ["@", "\u0104", "\u023A", "\u0245", "\u0394", "\u039B", "\u0414"],
|
|
4622
|
-
b: ["\xDF", "\u0181", "\u0243", "\u026E", "\u03B2", "\u0E3F"],
|
|
4623
|
-
c: ["\xA9", "\u023B", "\u03FE"],
|
|
4624
|
-
d: ["\xD0", "\u018A", "\u0500", "\u0501", "\u0502", "\u0503"],
|
|
4625
|
-
e: [
|
|
4626
|
-
"\xCB",
|
|
4627
|
-
"\u0115",
|
|
4628
|
-
"\u018E",
|
|
4629
|
-
"\u0258",
|
|
4630
|
-
"\u03A3",
|
|
4631
|
-
"\u03BE",
|
|
4632
|
-
"\u04BC",
|
|
4633
|
-
"\u0A6C"
|
|
4634
|
-
],
|
|
4635
|
-
f: ["\u04FA"],
|
|
4636
|
-
g: ["\u0262"],
|
|
4637
|
-
h: ["\u0126", "\u0195", "\u04A2", "\u04BA", "\u04C7", "\u050A"],
|
|
4638
|
-
i: ["\u0F0F"],
|
|
4639
|
-
j: ["\u0134"],
|
|
4640
|
-
k: ["\u0138", "\u04A0", "\u04C3", "\u051E"],
|
|
4641
|
-
l: ["\u0139"],
|
|
4642
|
-
m: ["\u028D", "\u04CD", "\u04CE", "\u0520", "\u0521", "\u0D69"],
|
|
4643
|
-
n: ["\xD1", "\u014B", "\u019D", "\u0376", "\u03A0", "\u048A"],
|
|
4644
|
-
o: [
|
|
4645
|
-
"\xD8",
|
|
4646
|
-
"\xF5",
|
|
4647
|
-
"\xF8",
|
|
4648
|
-
"\u01FE",
|
|
4649
|
-
"\u0298",
|
|
4650
|
-
"\u047A",
|
|
4651
|
-
"\u05DD",
|
|
4652
|
-
"\u06DD",
|
|
4653
|
-
"\u0E4F"
|
|
4654
|
-
],
|
|
4655
|
-
p: ["\u01F7", "\u048E"],
|
|
4656
|
-
q: ["\u09CD"],
|
|
4657
|
-
r: ["\xAE", "\u01A6", "\u0210", "\u024C", "\u0280", "\u042F"],
|
|
4658
|
-
s: ["\xA7", "\u03DE", "\u03DF", "\u03E8"],
|
|
4659
|
-
t: ["\u0141", "\u0166", "\u0373"],
|
|
4660
|
-
u: ["\u01B1", "\u054D"],
|
|
4661
|
-
v: ["\u05D8"],
|
|
4662
|
-
w: ["\u0428", "\u0460", "\u047C", "\u0D70"],
|
|
4663
|
-
x: ["\u04B2", "\u04FE", "\u04FC", "\u04FD"],
|
|
4664
|
-
y: ["\xA5", "\u04B0", "\u04CB"],
|
|
4665
|
-
z: ["\u01B5", "\u0240"]
|
|
4666
|
-
};
|
|
4667
|
-
return text.forEach(function(c) {
|
|
4668
|
-
c = c.toLowerCase();
|
|
4669
|
-
var chars = trap[c] || [" "], rand = Math.floor(Math.random() * chars.length);
|
|
4670
|
-
typeof trap[c] < "u" ? result += trap[c][rand] : result += c;
|
|
4671
|
-
}), result;
|
|
4672
|
-
};
|
|
4673
|
-
}
|
|
4674
|
-
});
|
|
4675
|
-
|
|
4676
|
-
// ../node_modules/@colors/colors/lib/custom/zalgo.js
|
|
4677
|
-
var require_zalgo = __commonJS({
|
|
4678
|
-
"../node_modules/@colors/colors/lib/custom/zalgo.js"(exports, module) {
|
|
4679
|
-
module.exports = function(text, options) {
|
|
4680
|
-
text = text || " he is here ";
|
|
4681
|
-
var soul = {
|
|
4682
|
-
up: [
|
|
4683
|
-
"\u030D",
|
|
4684
|
-
"\u030E",
|
|
4685
|
-
"\u0304",
|
|
4686
|
-
"\u0305",
|
|
4687
|
-
"\u033F",
|
|
4688
|
-
"\u0311",
|
|
4689
|
-
"\u0306",
|
|
4690
|
-
"\u0310",
|
|
4691
|
-
"\u0352",
|
|
4692
|
-
"\u0357",
|
|
4693
|
-
"\u0351",
|
|
4694
|
-
"\u0307",
|
|
4695
|
-
"\u0308",
|
|
4696
|
-
"\u030A",
|
|
4697
|
-
"\u0342",
|
|
4698
|
-
"\u0313",
|
|
4699
|
-
"\u0308",
|
|
4700
|
-
"\u034A",
|
|
4701
|
-
"\u034B",
|
|
4702
|
-
"\u034C",
|
|
4703
|
-
"\u0303",
|
|
4704
|
-
"\u0302",
|
|
4705
|
-
"\u030C",
|
|
4706
|
-
"\u0350",
|
|
4707
|
-
"\u0300",
|
|
4708
|
-
"\u0301",
|
|
4709
|
-
"\u030B",
|
|
4710
|
-
"\u030F",
|
|
4711
|
-
"\u0312",
|
|
4712
|
-
"\u0313",
|
|
4713
|
-
"\u0314",
|
|
4714
|
-
"\u033D",
|
|
4715
|
-
"\u0309",
|
|
4716
|
-
"\u0363",
|
|
4717
|
-
"\u0364",
|
|
4718
|
-
"\u0365",
|
|
4719
|
-
"\u0366",
|
|
4720
|
-
"\u0367",
|
|
4721
|
-
"\u0368",
|
|
4722
|
-
"\u0369",
|
|
4723
|
-
"\u036A",
|
|
4724
|
-
"\u036B",
|
|
4725
|
-
"\u036C",
|
|
4726
|
-
"\u036D",
|
|
4727
|
-
"\u036E",
|
|
4728
|
-
"\u036F",
|
|
4729
|
-
"\u033E",
|
|
4730
|
-
"\u035B",
|
|
4731
|
-
"\u0346",
|
|
4732
|
-
"\u031A"
|
|
4733
|
-
],
|
|
4734
|
-
down: [
|
|
4735
|
-
"\u0316",
|
|
4736
|
-
"\u0317",
|
|
4737
|
-
"\u0318",
|
|
4738
|
-
"\u0319",
|
|
4739
|
-
"\u031C",
|
|
4740
|
-
"\u031D",
|
|
4741
|
-
"\u031E",
|
|
4742
|
-
"\u031F",
|
|
4743
|
-
"\u0320",
|
|
4744
|
-
"\u0324",
|
|
4745
|
-
"\u0325",
|
|
4746
|
-
"\u0326",
|
|
4747
|
-
"\u0329",
|
|
4748
|
-
"\u032A",
|
|
4749
|
-
"\u032B",
|
|
4750
|
-
"\u032C",
|
|
4751
|
-
"\u032D",
|
|
4752
|
-
"\u032E",
|
|
4753
|
-
"\u032F",
|
|
4754
|
-
"\u0330",
|
|
4755
|
-
"\u0331",
|
|
4756
|
-
"\u0332",
|
|
4757
|
-
"\u0333",
|
|
4758
|
-
"\u0339",
|
|
4759
|
-
"\u033A",
|
|
4760
|
-
"\u033B",
|
|
4761
|
-
"\u033C",
|
|
4762
|
-
"\u0345",
|
|
4763
|
-
"\u0347",
|
|
4764
|
-
"\u0348",
|
|
4765
|
-
"\u0349",
|
|
4766
|
-
"\u034D",
|
|
4767
|
-
"\u034E",
|
|
4768
|
-
"\u0353",
|
|
4769
|
-
"\u0354",
|
|
4770
|
-
"\u0355",
|
|
4771
|
-
"\u0356",
|
|
4772
|
-
"\u0359",
|
|
4773
|
-
"\u035A",
|
|
4774
|
-
"\u0323"
|
|
4775
|
-
],
|
|
4776
|
-
mid: [
|
|
4777
|
-
"\u0315",
|
|
4778
|
-
"\u031B",
|
|
4779
|
-
"\u0300",
|
|
4780
|
-
"\u0301",
|
|
4781
|
-
"\u0358",
|
|
4782
|
-
"\u0321",
|
|
4783
|
-
"\u0322",
|
|
4784
|
-
"\u0327",
|
|
4785
|
-
"\u0328",
|
|
4786
|
-
"\u0334",
|
|
4787
|
-
"\u0335",
|
|
4788
|
-
"\u0336",
|
|
4789
|
-
"\u035C",
|
|
4790
|
-
"\u035D",
|
|
4791
|
-
"\u035E",
|
|
4792
|
-
"\u035F",
|
|
4793
|
-
"\u0360",
|
|
4794
|
-
"\u0362",
|
|
4795
|
-
"\u0338",
|
|
4796
|
-
"\u0337",
|
|
4797
|
-
"\u0361",
|
|
4798
|
-
" \u0489"
|
|
4799
|
-
]
|
|
4800
|
-
}, all = [].concat(soul.up, soul.down, soul.mid);
|
|
4801
|
-
function randomNumber(range) {
|
|
4802
|
-
var r = Math.floor(Math.random() * range);
|
|
4803
|
-
return r;
|
|
4804
|
-
}
|
|
4805
|
-
function isChar(character) {
|
|
4806
|
-
var bool = !1;
|
|
4807
|
-
return all.filter(function(i) {
|
|
4808
|
-
bool = i === character;
|
|
4809
|
-
}), bool;
|
|
4810
|
-
}
|
|
4811
|
-
function heComes(text2, options2) {
|
|
4812
|
-
var result = "", counts, l;
|
|
4813
|
-
options2 = options2 || {}, options2.up = typeof options2.up < "u" ? options2.up : !0, options2.mid = typeof options2.mid < "u" ? options2.mid : !0, options2.down = typeof options2.down < "u" ? options2.down : !0, options2.size = typeof options2.size < "u" ? options2.size : "maxi", text2 = text2.split("");
|
|
4814
|
-
for (l in text2)
|
|
4815
|
-
if (!isChar(l)) {
|
|
4816
|
-
switch (result = result + text2[l], counts = { up: 0, down: 0, mid: 0 }, options2.size) {
|
|
4817
|
-
case "mini":
|
|
4818
|
-
counts.up = randomNumber(8), counts.mid = randomNumber(2), counts.down = randomNumber(8);
|
|
4819
|
-
break;
|
|
4820
|
-
case "maxi":
|
|
4821
|
-
counts.up = randomNumber(16) + 3, counts.mid = randomNumber(4) + 1, counts.down = randomNumber(64) + 3;
|
|
4822
|
-
break;
|
|
4823
|
-
default:
|
|
4824
|
-
counts.up = randomNumber(8) + 1, counts.mid = randomNumber(6) / 2, counts.down = randomNumber(8) + 1;
|
|
4825
|
-
break;
|
|
4826
|
-
}
|
|
4827
|
-
var arr = ["up", "mid", "down"];
|
|
4828
|
-
for (var d in arr)
|
|
4829
|
-
for (var index = arr[d], i = 0; i <= counts[index]; i++)
|
|
4830
|
-
options2[index] && (result = result + soul[index][randomNumber(soul[index].length)]);
|
|
4831
|
-
}
|
|
4832
|
-
return result;
|
|
4833
|
-
}
|
|
4834
|
-
return heComes(text, options);
|
|
4835
|
-
};
|
|
4836
|
-
}
|
|
4837
|
-
});
|
|
4838
|
-
|
|
4839
|
-
// ../node_modules/@colors/colors/lib/maps/america.js
|
|
4840
|
-
var require_america = __commonJS({
|
|
4841
|
-
"../node_modules/@colors/colors/lib/maps/america.js"(exports, module) {
|
|
4842
|
-
module.exports = function(colors3) {
|
|
4843
|
-
return function(letter, i, exploded) {
|
|
4844
|
-
if (letter === " ") return letter;
|
|
4845
|
-
switch (i % 3) {
|
|
4846
|
-
case 0:
|
|
4847
|
-
return colors3.red(letter);
|
|
4848
|
-
case 1:
|
|
4849
|
-
return colors3.white(letter);
|
|
4850
|
-
case 2:
|
|
4851
|
-
return colors3.blue(letter);
|
|
4852
|
-
}
|
|
4853
|
-
};
|
|
4854
|
-
};
|
|
4855
|
-
}
|
|
4856
|
-
});
|
|
4857
|
-
|
|
4858
|
-
// ../node_modules/@colors/colors/lib/maps/zebra.js
|
|
4859
|
-
var require_zebra = __commonJS({
|
|
4860
|
-
"../node_modules/@colors/colors/lib/maps/zebra.js"(exports, module) {
|
|
4861
|
-
module.exports = function(colors3) {
|
|
4862
|
-
return function(letter, i, exploded) {
|
|
4863
|
-
return i % 2 === 0 ? letter : colors3.inverse(letter);
|
|
4864
|
-
};
|
|
4865
|
-
};
|
|
4866
|
-
}
|
|
4867
|
-
});
|
|
4868
|
-
|
|
4869
|
-
// ../node_modules/@colors/colors/lib/maps/rainbow.js
|
|
4870
|
-
var require_rainbow = __commonJS({
|
|
4871
|
-
"../node_modules/@colors/colors/lib/maps/rainbow.js"(exports, module) {
|
|
4872
|
-
module.exports = function(colors3) {
|
|
4873
|
-
var rainbowColors = ["red", "yellow", "green", "blue", "magenta"];
|
|
4874
|
-
return function(letter, i, exploded) {
|
|
4875
|
-
return letter === " " ? letter : colors3[rainbowColors[i++ % rainbowColors.length]](letter);
|
|
4876
|
-
};
|
|
4877
|
-
};
|
|
4878
|
-
}
|
|
4879
|
-
});
|
|
4880
|
-
|
|
4881
|
-
// ../node_modules/@colors/colors/lib/maps/random.js
|
|
4882
|
-
var require_random = __commonJS({
|
|
4883
|
-
"../node_modules/@colors/colors/lib/maps/random.js"(exports, module) {
|
|
4884
|
-
module.exports = function(colors3) {
|
|
4885
|
-
var available = [
|
|
4886
|
-
"underline",
|
|
4887
|
-
"inverse",
|
|
4888
|
-
"grey",
|
|
4889
|
-
"yellow",
|
|
4890
|
-
"red",
|
|
4891
|
-
"green",
|
|
4892
|
-
"blue",
|
|
4893
|
-
"white",
|
|
4894
|
-
"cyan",
|
|
4895
|
-
"magenta",
|
|
4896
|
-
"brightYellow",
|
|
4897
|
-
"brightRed",
|
|
4898
|
-
"brightGreen",
|
|
4899
|
-
"brightBlue",
|
|
4900
|
-
"brightWhite",
|
|
4901
|
-
"brightCyan",
|
|
4902
|
-
"brightMagenta"
|
|
4903
|
-
];
|
|
4904
|
-
return function(letter, i, exploded) {
|
|
4905
|
-
return letter === " " ? letter : colors3[available[Math.round(Math.random() * (available.length - 2))]](letter);
|
|
4906
|
-
};
|
|
4907
|
-
};
|
|
4908
|
-
}
|
|
4909
|
-
});
|
|
4910
|
-
|
|
4911
|
-
// ../node_modules/@colors/colors/lib/colors.js
|
|
4912
|
-
var require_colors = __commonJS({
|
|
4913
|
-
"../node_modules/@colors/colors/lib/colors.js"(exports, module) {
|
|
4914
|
-
var colors3 = {};
|
|
4915
|
-
module.exports = colors3;
|
|
4916
|
-
colors3.themes = {};
|
|
4917
|
-
var util = __require("util"), ansiStyles = colors3.styles = require_styles(), defineProps = Object.defineProperties, newLineRegex = new RegExp(/[\r\n]+/g);
|
|
4918
|
-
colors3.supportsColor = require_supports_colors().supportsColor;
|
|
4919
|
-
typeof colors3.enabled > "u" && (colors3.enabled = colors3.supportsColor() !== !1);
|
|
4920
|
-
colors3.enable = function() {
|
|
4921
|
-
colors3.enabled = !0;
|
|
4922
|
-
};
|
|
4923
|
-
colors3.disable = function() {
|
|
4924
|
-
colors3.enabled = !1;
|
|
4925
|
-
};
|
|
4926
|
-
colors3.stripColors = colors3.strip = function(str) {
|
|
4927
|
-
return ("" + str).replace(/\x1B\[\d+m/g, "");
|
|
4928
|
-
};
|
|
4929
|
-
var stylize = colors3.stylize = function(str, style) {
|
|
4930
|
-
if (!colors3.enabled)
|
|
4931
|
-
return str + "";
|
|
4932
|
-
var styleMap = ansiStyles[style];
|
|
4933
|
-
return !styleMap && style in colors3 ? colors3[style](str) : styleMap.open + str + styleMap.close;
|
|
4934
|
-
}, matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g, escapeStringRegexp = function(str) {
|
|
4935
|
-
if (typeof str != "string")
|
|
4936
|
-
throw new TypeError("Expected a string");
|
|
4937
|
-
return str.replace(matchOperatorsRe, "\\$&");
|
|
4938
|
-
};
|
|
4939
|
-
function build2(_styles) {
|
|
4940
|
-
var builder = function builder2() {
|
|
4941
|
-
return applyStyle.apply(builder2, arguments);
|
|
4942
|
-
};
|
|
4943
|
-
return builder._styles = _styles, builder.__proto__ = proto, builder;
|
|
4944
|
-
}
|
|
4945
|
-
var styles = (function() {
|
|
4946
|
-
var ret = {};
|
|
4947
|
-
return ansiStyles.grey = ansiStyles.gray, Object.keys(ansiStyles).forEach(function(key) {
|
|
4948
|
-
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g"), ret[key] = {
|
|
4949
|
-
get: function() {
|
|
4950
|
-
return build2(this._styles.concat(key));
|
|
4951
|
-
}
|
|
4952
|
-
};
|
|
4953
|
-
}), ret;
|
|
4954
|
-
})(), proto = defineProps(function() {
|
|
4955
|
-
}, styles);
|
|
4956
|
-
function applyStyle() {
|
|
4957
|
-
var args = Array.prototype.slice.call(arguments), str = args.map(function(arg) {
|
|
4958
|
-
return arg != null && arg.constructor === String ? arg : util.inspect(arg);
|
|
4959
|
-
}).join(" ");
|
|
4960
|
-
if (!colors3.enabled || !str)
|
|
4961
|
-
return str;
|
|
4962
|
-
for (var newLinesPresent = str.indexOf(`
|
|
4963
|
-
`) != -1, nestedStyles = this._styles, i = nestedStyles.length; i--; ) {
|
|
4964
|
-
var code = ansiStyles[nestedStyles[i]];
|
|
4965
|
-
str = code.open + str.replace(code.closeRe, code.open) + code.close, newLinesPresent && (str = str.replace(newLineRegex, function(match) {
|
|
4966
|
-
return code.close + match + code.open;
|
|
4967
|
-
}));
|
|
4968
|
-
}
|
|
4969
|
-
return str;
|
|
4970
|
-
}
|
|
4971
|
-
colors3.setTheme = function(theme) {
|
|
4972
|
-
if (typeof theme == "string") {
|
|
4973
|
-
console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");
|
|
4974
|
-
return;
|
|
4975
|
-
}
|
|
4976
|
-
for (var style in theme)
|
|
4977
|
-
(function(style2) {
|
|
4978
|
-
colors3[style2] = function(str) {
|
|
4979
|
-
if (typeof theme[style2] == "object") {
|
|
4980
|
-
var out = str;
|
|
4981
|
-
for (var i in theme[style2])
|
|
4982
|
-
out = colors3[theme[style2][i]](out);
|
|
4983
|
-
return out;
|
|
4984
|
-
}
|
|
4985
|
-
return colors3[theme[style2]](str);
|
|
4986
|
-
};
|
|
4987
|
-
})(style);
|
|
4988
|
-
};
|
|
4989
|
-
function init() {
|
|
4990
|
-
var ret = {};
|
|
4991
|
-
return Object.keys(styles).forEach(function(name) {
|
|
4992
|
-
ret[name] = {
|
|
4993
|
-
get: function() {
|
|
4994
|
-
return build2([name]);
|
|
4995
|
-
}
|
|
4996
|
-
};
|
|
4997
|
-
}), ret;
|
|
4998
|
-
}
|
|
4999
|
-
var sequencer = function(map2, str) {
|
|
5000
|
-
var exploded = str.split("");
|
|
5001
|
-
return exploded = exploded.map(map2), exploded.join("");
|
|
5002
|
-
};
|
|
5003
|
-
colors3.trap = require_trap();
|
|
5004
|
-
colors3.zalgo = require_zalgo();
|
|
5005
|
-
colors3.maps = {};
|
|
5006
|
-
colors3.maps.america = require_america()(colors3);
|
|
5007
|
-
colors3.maps.zebra = require_zebra()(colors3);
|
|
5008
|
-
colors3.maps.rainbow = require_rainbow()(colors3);
|
|
5009
|
-
colors3.maps.random = require_random()(colors3);
|
|
5010
|
-
for (map in colors3.maps)
|
|
5011
|
-
(function(map2) {
|
|
5012
|
-
colors3[map2] = function(str) {
|
|
5013
|
-
return sequencer(colors3.maps[map2], str);
|
|
5014
|
-
};
|
|
5015
|
-
})(map);
|
|
5016
|
-
var map;
|
|
5017
|
-
defineProps(colors3, init());
|
|
5018
|
-
}
|
|
5019
|
-
});
|
|
5020
|
-
|
|
5021
|
-
// ../node_modules/@colors/colors/safe.js
|
|
5022
|
-
var require_safe = __commonJS({
|
|
5023
|
-
"../node_modules/@colors/colors/safe.js"(exports, module) {
|
|
5024
|
-
var colors3 = require_colors();
|
|
5025
|
-
module.exports = colors3;
|
|
5026
|
-
}
|
|
5027
|
-
});
|
|
5028
|
-
|
|
5029
|
-
// ../node_modules/cli-table3/src/cell.js
|
|
5030
|
-
var require_cell = __commonJS({
|
|
5031
|
-
"../node_modules/cli-table3/src/cell.js"(exports, module) {
|
|
5032
|
-
var { info, debug } = require_debug(), utils = require_utils2(), Cell = class _Cell {
|
|
5033
|
-
/**
|
|
5034
|
-
* A representation of a cell within the table.
|
|
5035
|
-
* Implementations must have `init` and `draw` methods,
|
|
5036
|
-
* as well as `colSpan`, `rowSpan`, `desiredHeight` and `desiredWidth` properties.
|
|
5037
|
-
* @param options
|
|
5038
|
-
* @constructor
|
|
5039
|
-
*/
|
|
5040
|
-
constructor(options) {
|
|
5041
|
-
this.setOptions(options), this.x = null, this.y = null;
|
|
5042
|
-
}
|
|
5043
|
-
setOptions(options) {
|
|
5044
|
-
["boolean", "number", "bigint", "string"].indexOf(typeof options) !== -1 && (options = { content: "" + options }), options = options || {}, this.options = options;
|
|
5045
|
-
let content = options.content;
|
|
5046
|
-
if (["boolean", "number", "bigint", "string"].indexOf(typeof content) !== -1)
|
|
5047
|
-
this.content = String(content);
|
|
5048
|
-
else if (!content)
|
|
5049
|
-
this.content = this.options.href || "";
|
|
5050
|
-
else
|
|
5051
|
-
throw new Error("Content needs to be a primitive, got: " + typeof content);
|
|
5052
|
-
this.colSpan = options.colSpan || 1, this.rowSpan = options.rowSpan || 1, this.options.href && Object.defineProperty(this, "href", {
|
|
5053
|
-
get() {
|
|
5054
|
-
return this.options.href;
|
|
5055
|
-
}
|
|
5056
|
-
});
|
|
5057
|
-
}
|
|
5058
|
-
mergeTableOptions(tableOptions, cells) {
|
|
5059
|
-
this.cells = cells;
|
|
5060
|
-
let optionsChars = this.options.chars || {}, tableChars = tableOptions.chars, chars = this.chars = {};
|
|
5061
|
-
CHAR_NAMES.forEach(function(name) {
|
|
5062
|
-
setOption(optionsChars, tableChars, name, chars);
|
|
5063
|
-
}), this.truncate = this.options.truncate || tableOptions.truncate;
|
|
5064
|
-
let style = this.options.style = this.options.style || {}, tableStyle = tableOptions.style;
|
|
5065
|
-
setOption(style, tableStyle, "padding-left", this), setOption(style, tableStyle, "padding-right", this), this.head = style.head || tableStyle.head, this.border = style.border || tableStyle.border, this.fixedWidth = tableOptions.colWidths[this.x], this.lines = this.computeLines(tableOptions), this.desiredWidth = utils.strlen(this.content) + this.paddingLeft + this.paddingRight, this.desiredHeight = this.lines.length;
|
|
5066
|
-
}
|
|
5067
|
-
computeLines(tableOptions) {
|
|
5068
|
-
let tableWordWrap = tableOptions.wordWrap || tableOptions.textWrap, { wordWrap = tableWordWrap } = this.options;
|
|
5069
|
-
if (this.fixedWidth && wordWrap) {
|
|
5070
|
-
if (this.fixedWidth -= this.paddingLeft + this.paddingRight, this.colSpan) {
|
|
5071
|
-
let i = 1;
|
|
5072
|
-
for (; i < this.colSpan; )
|
|
5073
|
-
this.fixedWidth += tableOptions.colWidths[this.x + i], i++;
|
|
5074
|
-
}
|
|
5075
|
-
let { wrapOnWordBoundary: tableWrapOnWordBoundary = !0 } = tableOptions, { wrapOnWordBoundary = tableWrapOnWordBoundary } = this.options;
|
|
5076
|
-
return this.wrapLines(utils.wordWrap(this.fixedWidth, this.content, wrapOnWordBoundary));
|
|
5077
|
-
}
|
|
5078
|
-
return this.wrapLines(this.content.split(`
|
|
5079
|
-
`));
|
|
5080
|
-
}
|
|
5081
|
-
wrapLines(computedLines) {
|
|
5082
|
-
let lines = utils.colorizeLines(computedLines);
|
|
5083
|
-
return this.href ? lines.map((line) => utils.hyperlink(this.href, line)) : lines;
|
|
5084
|
-
}
|
|
5085
|
-
/**
|
|
5086
|
-
* Initializes the Cells data structure.
|
|
5087
|
-
*
|
|
5088
|
-
* @param tableOptions - A fully populated set of tableOptions.
|
|
5089
|
-
* In addition to the standard default values, tableOptions must have fully populated the
|
|
5090
|
-
* `colWidths` and `rowWidths` arrays. Those arrays must have lengths equal to the number
|
|
5091
|
-
* of columns or rows (respectively) in this table, and each array item must be a Number.
|
|
5092
|
-
*
|
|
5093
|
-
*/
|
|
5094
|
-
init(tableOptions) {
|
|
5095
|
-
let x = this.x, y = this.y;
|
|
5096
|
-
this.widths = tableOptions.colWidths.slice(x, x + this.colSpan), this.heights = tableOptions.rowHeights.slice(y, y + this.rowSpan), this.width = this.widths.reduce(sumPlusOne, -1), this.height = this.heights.reduce(sumPlusOne, -1), this.hAlign = this.options.hAlign || tableOptions.colAligns[x], this.vAlign = this.options.vAlign || tableOptions.rowAligns[y], this.drawRight = x + this.colSpan == tableOptions.colWidths.length;
|
|
5097
|
-
}
|
|
5098
|
-
/**
|
|
5099
|
-
* Draws the given line of the cell.
|
|
5100
|
-
* This default implementation defers to methods `drawTop`, `drawBottom`, `drawLine` and `drawEmpty`.
|
|
5101
|
-
* @param lineNum - can be `top`, `bottom` or a numerical line number.
|
|
5102
|
-
* @param spanningCell - will be a number if being called from a RowSpanCell, and will represent how
|
|
5103
|
-
* many rows below it's being called from. Otherwise it's undefined.
|
|
5104
|
-
* @returns {String} The representation of this line.
|
|
5105
|
-
*/
|
|
5106
|
-
draw(lineNum, spanningCell) {
|
|
5107
|
-
if (lineNum == "top") return this.drawTop(this.drawRight);
|
|
5108
|
-
if (lineNum == "bottom") return this.drawBottom(this.drawRight);
|
|
5109
|
-
let content = utils.truncate(this.content, 10, this.truncate);
|
|
5110
|
-
lineNum || info(`${this.y}-${this.x}: ${this.rowSpan - lineNum}x${this.colSpan} Cell ${content}`);
|
|
5111
|
-
let padLen = Math.max(this.height - this.lines.length, 0), padTop;
|
|
5112
|
-
switch (this.vAlign) {
|
|
5113
|
-
case "center":
|
|
5114
|
-
padTop = Math.ceil(padLen / 2);
|
|
5115
|
-
break;
|
|
5116
|
-
case "bottom":
|
|
5117
|
-
padTop = padLen;
|
|
5118
|
-
break;
|
|
5119
|
-
default:
|
|
5120
|
-
padTop = 0;
|
|
5121
|
-
}
|
|
5122
|
-
if (lineNum < padTop || lineNum >= padTop + this.lines.length)
|
|
5123
|
-
return this.drawEmpty(this.drawRight, spanningCell);
|
|
5124
|
-
let forceTruncation = this.lines.length > this.height && lineNum + 1 >= this.height;
|
|
5125
|
-
return this.drawLine(lineNum - padTop, this.drawRight, forceTruncation, spanningCell);
|
|
5126
|
-
}
|
|
5127
|
-
/**
|
|
5128
|
-
* Renders the top line of the cell.
|
|
5129
|
-
* @param drawRight - true if this method should render the right edge of the cell.
|
|
5130
|
-
* @returns {String}
|
|
5131
|
-
*/
|
|
5132
|
-
drawTop(drawRight) {
|
|
5133
|
-
let content = [];
|
|
5134
|
-
return this.cells ? this.widths.forEach(function(width, index) {
|
|
5135
|
-
content.push(this._topLeftChar(index)), content.push(utils.repeat(this.chars[this.y == 0 ? "top" : "mid"], width));
|
|
5136
|
-
}, this) : (content.push(this._topLeftChar(0)), content.push(utils.repeat(this.chars[this.y == 0 ? "top" : "mid"], this.width))), drawRight && content.push(this.chars[this.y == 0 ? "topRight" : "rightMid"]), this.wrapWithStyleColors("border", content.join(""));
|
|
5137
|
-
}
|
|
5138
|
-
_topLeftChar(offset) {
|
|
5139
|
-
let x = this.x + offset, leftChar;
|
|
5140
|
-
if (this.y == 0)
|
|
5141
|
-
leftChar = x == 0 ? "topLeft" : offset == 0 ? "topMid" : "top";
|
|
5142
|
-
else if (x == 0)
|
|
5143
|
-
leftChar = "leftMid";
|
|
5144
|
-
else if (leftChar = offset == 0 ? "midMid" : "bottomMid", this.cells && (this.cells[this.y - 1][x] instanceof _Cell.ColSpanCell && (leftChar = offset == 0 ? "topMid" : "mid"), offset == 0)) {
|
|
5145
|
-
let i = 1;
|
|
5146
|
-
for (; this.cells[this.y][x - i] instanceof _Cell.ColSpanCell; )
|
|
5147
|
-
i++;
|
|
5148
|
-
this.cells[this.y][x - i] instanceof _Cell.RowSpanCell && (leftChar = "leftMid");
|
|
5149
|
-
}
|
|
5150
|
-
return this.chars[leftChar];
|
|
5151
|
-
}
|
|
5152
|
-
wrapWithStyleColors(styleProperty, content) {
|
|
5153
|
-
if (this[styleProperty] && this[styleProperty].length)
|
|
5154
|
-
try {
|
|
5155
|
-
let colors3 = require_safe();
|
|
5156
|
-
for (let i = this[styleProperty].length - 1; i >= 0; i--)
|
|
5157
|
-
colors3 = colors3[this[styleProperty][i]];
|
|
5158
|
-
return colors3(content);
|
|
5159
|
-
} catch {
|
|
5160
|
-
return content;
|
|
5161
|
-
}
|
|
5162
|
-
else
|
|
5163
|
-
return content;
|
|
5164
|
-
}
|
|
5165
|
-
/**
|
|
5166
|
-
* Renders a line of text.
|
|
5167
|
-
* @param lineNum - Which line of text to render. This is not necessarily the line within the cell.
|
|
5168
|
-
* There may be top-padding above the first line of text.
|
|
5169
|
-
* @param drawRight - true if this method should render the right edge of the cell.
|
|
5170
|
-
* @param forceTruncationSymbol - `true` if the rendered text should end with the truncation symbol even
|
|
5171
|
-
* if the text fits. This is used when the cell is vertically truncated. If `false` the text should
|
|
5172
|
-
* only include the truncation symbol if the text will not fit horizontally within the cell width.
|
|
5173
|
-
* @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.
|
|
5174
|
-
* @returns {String}
|
|
5175
|
-
*/
|
|
5176
|
-
drawLine(lineNum, drawRight, forceTruncationSymbol, spanningCell) {
|
|
5177
|
-
let left = this.chars[this.x == 0 ? "left" : "middle"];
|
|
5178
|
-
if (this.x && spanningCell && this.cells) {
|
|
5179
|
-
let cellLeft = this.cells[this.y + spanningCell][this.x - 1];
|
|
5180
|
-
for (; cellLeft instanceof ColSpanCell; )
|
|
5181
|
-
cellLeft = this.cells[cellLeft.y][cellLeft.x - 1];
|
|
5182
|
-
cellLeft instanceof RowSpanCell || (left = this.chars.rightMid);
|
|
5183
|
-
}
|
|
5184
|
-
let leftPadding = utils.repeat(" ", this.paddingLeft), right = drawRight ? this.chars.right : "", rightPadding = utils.repeat(" ", this.paddingRight), line = this.lines[lineNum], len = this.width - (this.paddingLeft + this.paddingRight);
|
|
5185
|
-
forceTruncationSymbol && (line += this.truncate || "\u2026");
|
|
5186
|
-
let content = utils.truncate(line, len, this.truncate);
|
|
5187
|
-
return content = utils.pad(content, len, " ", this.hAlign), content = leftPadding + content + rightPadding, this.stylizeLine(left, content, right);
|
|
5188
|
-
}
|
|
5189
|
-
stylizeLine(left, content, right) {
|
|
5190
|
-
return left = this.wrapWithStyleColors("border", left), right = this.wrapWithStyleColors("border", right), this.y === 0 && (content = this.wrapWithStyleColors("head", content)), left + content + right;
|
|
5191
|
-
}
|
|
5192
|
-
/**
|
|
5193
|
-
* Renders the bottom line of the cell.
|
|
5194
|
-
* @param drawRight - true if this method should render the right edge of the cell.
|
|
5195
|
-
* @returns {String}
|
|
5196
|
-
*/
|
|
5197
|
-
drawBottom(drawRight) {
|
|
5198
|
-
let left = this.chars[this.x == 0 ? "bottomLeft" : "bottomMid"], content = utils.repeat(this.chars.bottom, this.width), right = drawRight ? this.chars.bottomRight : "";
|
|
5199
|
-
return this.wrapWithStyleColors("border", left + content + right);
|
|
5200
|
-
}
|
|
5201
|
-
/**
|
|
5202
|
-
* Renders a blank line of text within the cell. Used for top and/or bottom padding.
|
|
5203
|
-
* @param drawRight - true if this method should render the right edge of the cell.
|
|
5204
|
-
* @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.
|
|
5205
|
-
* @returns {String}
|
|
5206
|
-
*/
|
|
5207
|
-
drawEmpty(drawRight, spanningCell) {
|
|
5208
|
-
let left = this.chars[this.x == 0 ? "left" : "middle"];
|
|
5209
|
-
if (this.x && spanningCell && this.cells) {
|
|
5210
|
-
let cellLeft = this.cells[this.y + spanningCell][this.x - 1];
|
|
5211
|
-
for (; cellLeft instanceof ColSpanCell; )
|
|
5212
|
-
cellLeft = this.cells[cellLeft.y][cellLeft.x - 1];
|
|
5213
|
-
cellLeft instanceof RowSpanCell || (left = this.chars.rightMid);
|
|
5214
|
-
}
|
|
5215
|
-
let right = drawRight ? this.chars.right : "", content = utils.repeat(" ", this.width);
|
|
5216
|
-
return this.stylizeLine(left, content, right);
|
|
5217
|
-
}
|
|
5218
|
-
}, ColSpanCell = class {
|
|
5219
|
-
/**
|
|
5220
|
-
* A Cell that doesn't do anything. It just draws empty lines.
|
|
5221
|
-
* Used as a placeholder in column spanning.
|
|
5222
|
-
* @constructor
|
|
5223
|
-
*/
|
|
5224
|
-
constructor() {
|
|
5225
|
-
}
|
|
5226
|
-
draw(lineNum) {
|
|
5227
|
-
return typeof lineNum == "number" && debug(`${this.y}-${this.x}: 1x1 ColSpanCell`), "";
|
|
5228
|
-
}
|
|
5229
|
-
init() {
|
|
5230
|
-
}
|
|
5231
|
-
mergeTableOptions() {
|
|
5232
|
-
}
|
|
5233
|
-
}, RowSpanCell = class {
|
|
5234
|
-
/**
|
|
5235
|
-
* A placeholder Cell for a Cell that spans multiple rows.
|
|
5236
|
-
* It delegates rendering to the original cell, but adds the appropriate offset.
|
|
5237
|
-
* @param originalCell
|
|
5238
|
-
* @constructor
|
|
5239
|
-
*/
|
|
5240
|
-
constructor(originalCell) {
|
|
5241
|
-
this.originalCell = originalCell;
|
|
5242
|
-
}
|
|
5243
|
-
init(tableOptions) {
|
|
5244
|
-
let y = this.y, originalY = this.originalCell.y;
|
|
5245
|
-
this.cellOffset = y - originalY, this.offset = findDimension(tableOptions.rowHeights, originalY, this.cellOffset);
|
|
5246
|
-
}
|
|
5247
|
-
draw(lineNum) {
|
|
5248
|
-
return lineNum == "top" ? this.originalCell.draw(this.offset, this.cellOffset) : lineNum == "bottom" ? this.originalCell.draw("bottom") : (debug(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`), this.originalCell.draw(this.offset + 1 + lineNum));
|
|
5249
|
-
}
|
|
5250
|
-
mergeTableOptions() {
|
|
5251
|
-
}
|
|
5252
|
-
};
|
|
5253
|
-
function firstDefined(...args) {
|
|
5254
|
-
return args.filter((v) => v != null).shift();
|
|
5255
|
-
}
|
|
5256
|
-
function setOption(objA, objB, nameB, targetObj) {
|
|
5257
|
-
let nameA = nameB.split("-");
|
|
5258
|
-
nameA.length > 1 ? (nameA[1] = nameA[1].charAt(0).toUpperCase() + nameA[1].substr(1), nameA = nameA.join(""), targetObj[nameA] = firstDefined(objA[nameA], objA[nameB], objB[nameA], objB[nameB])) : targetObj[nameB] = firstDefined(objA[nameB], objB[nameB]);
|
|
5259
|
-
}
|
|
5260
|
-
function findDimension(dimensionTable, startingIndex, span) {
|
|
5261
|
-
let ret = dimensionTable[startingIndex];
|
|
5262
|
-
for (let i = 1; i < span; i++)
|
|
5263
|
-
ret += 1 + dimensionTable[startingIndex + i];
|
|
5264
|
-
return ret;
|
|
5265
|
-
}
|
|
5266
|
-
function sumPlusOne(a, b) {
|
|
5267
|
-
return a + b + 1;
|
|
5268
|
-
}
|
|
5269
|
-
var CHAR_NAMES = [
|
|
5270
|
-
"top",
|
|
5271
|
-
"top-mid",
|
|
5272
|
-
"top-left",
|
|
5273
|
-
"top-right",
|
|
5274
|
-
"bottom",
|
|
5275
|
-
"bottom-mid",
|
|
5276
|
-
"bottom-left",
|
|
5277
|
-
"bottom-right",
|
|
5278
|
-
"left",
|
|
5279
|
-
"left-mid",
|
|
5280
|
-
"mid",
|
|
5281
|
-
"mid-mid",
|
|
5282
|
-
"right",
|
|
5283
|
-
"right-mid",
|
|
5284
|
-
"middle"
|
|
5285
|
-
];
|
|
5286
|
-
module.exports = Cell;
|
|
5287
|
-
module.exports.ColSpanCell = ColSpanCell;
|
|
5288
|
-
module.exports.RowSpanCell = RowSpanCell;
|
|
5289
|
-
}
|
|
5290
|
-
});
|
|
5291
|
-
|
|
5292
|
-
// ../node_modules/cli-table3/src/layout-manager.js
|
|
5293
|
-
var require_layout_manager = __commonJS({
|
|
5294
|
-
"../node_modules/cli-table3/src/layout-manager.js"(exports, module) {
|
|
5295
|
-
var { warn, debug } = require_debug(), Cell = require_cell(), { ColSpanCell, RowSpanCell } = Cell;
|
|
5296
|
-
(function() {
|
|
5297
|
-
function next(alloc, col) {
|
|
5298
|
-
return alloc[col] > 0 ? next(alloc, col + 1) : col;
|
|
5299
|
-
}
|
|
5300
|
-
function layoutTable(table) {
|
|
5301
|
-
let alloc = {};
|
|
5302
|
-
table.forEach(function(row, rowIndex) {
|
|
5303
|
-
let col = 0;
|
|
5304
|
-
row.forEach(function(cell) {
|
|
5305
|
-
cell.y = rowIndex, cell.x = rowIndex ? next(alloc, col) : col;
|
|
5306
|
-
let rowSpan = cell.rowSpan || 1, colSpan = cell.colSpan || 1;
|
|
5307
|
-
if (rowSpan > 1)
|
|
5308
|
-
for (let cs = 0; cs < colSpan; cs++)
|
|
5309
|
-
alloc[cell.x + cs] = rowSpan;
|
|
5310
|
-
col = cell.x + colSpan;
|
|
5311
|
-
}), Object.keys(alloc).forEach((idx) => {
|
|
5312
|
-
alloc[idx]--, alloc[idx] < 1 && delete alloc[idx];
|
|
5313
|
-
});
|
|
5314
|
-
});
|
|
5315
|
-
}
|
|
5316
|
-
function maxWidth(table) {
|
|
5317
|
-
let mw = 0;
|
|
5318
|
-
return table.forEach(function(row) {
|
|
5319
|
-
row.forEach(function(cell) {
|
|
5320
|
-
mw = Math.max(mw, cell.x + (cell.colSpan || 1));
|
|
5321
|
-
});
|
|
5322
|
-
}), mw;
|
|
5323
|
-
}
|
|
5324
|
-
function maxHeight(table) {
|
|
5325
|
-
return table.length;
|
|
5326
|
-
}
|
|
5327
|
-
function cellsConflict(cell1, cell2) {
|
|
5328
|
-
let yMin1 = cell1.y, yMax1 = cell1.y - 1 + (cell1.rowSpan || 1), yMin2 = cell2.y, yMax2 = cell2.y - 1 + (cell2.rowSpan || 1), yConflict = !(yMin1 > yMax2 || yMin2 > yMax1), xMin1 = cell1.x, xMax1 = cell1.x - 1 + (cell1.colSpan || 1), xMin2 = cell2.x, xMax2 = cell2.x - 1 + (cell2.colSpan || 1), xConflict = !(xMin1 > xMax2 || xMin2 > xMax1);
|
|
5329
|
-
return yConflict && xConflict;
|
|
5330
|
-
}
|
|
5331
|
-
function conflictExists(rows, x, y) {
|
|
5332
|
-
let i_max = Math.min(rows.length - 1, y), cell = { x, y };
|
|
5333
|
-
for (let i = 0; i <= i_max; i++) {
|
|
5334
|
-
let row = rows[i];
|
|
5335
|
-
for (let j = 0; j < row.length; j++)
|
|
5336
|
-
if (cellsConflict(cell, row[j]))
|
|
5337
|
-
return !0;
|
|
5338
|
-
}
|
|
5339
|
-
return !1;
|
|
5340
|
-
}
|
|
5341
|
-
function allBlank(rows, y, xMin, xMax) {
|
|
5342
|
-
for (let x = xMin; x < xMax; x++)
|
|
5343
|
-
if (conflictExists(rows, x, y))
|
|
5344
|
-
return !1;
|
|
5345
|
-
return !0;
|
|
5346
|
-
}
|
|
5347
|
-
function addRowSpanCells(table) {
|
|
5348
|
-
table.forEach(function(row, rowIndex) {
|
|
5349
|
-
row.forEach(function(cell) {
|
|
5350
|
-
for (let i = 1; i < cell.rowSpan; i++) {
|
|
5351
|
-
let rowSpanCell = new RowSpanCell(cell);
|
|
5352
|
-
rowSpanCell.x = cell.x, rowSpanCell.y = cell.y + i, rowSpanCell.colSpan = cell.colSpan, insertCell(rowSpanCell, table[rowIndex + i]);
|
|
5353
|
-
}
|
|
5354
|
-
});
|
|
5355
|
-
});
|
|
5356
|
-
}
|
|
5357
|
-
function addColSpanCells(cellRows) {
|
|
5358
|
-
for (let rowIndex = cellRows.length - 1; rowIndex >= 0; rowIndex--) {
|
|
5359
|
-
let cellColumns = cellRows[rowIndex];
|
|
5360
|
-
for (let columnIndex = 0; columnIndex < cellColumns.length; columnIndex++) {
|
|
5361
|
-
let cell = cellColumns[columnIndex];
|
|
5362
|
-
for (let k = 1; k < cell.colSpan; k++) {
|
|
5363
|
-
let colSpanCell = new ColSpanCell();
|
|
5364
|
-
colSpanCell.x = cell.x + k, colSpanCell.y = cell.y, cellColumns.splice(columnIndex + 1, 0, colSpanCell);
|
|
5365
|
-
}
|
|
5366
|
-
}
|
|
5367
|
-
}
|
|
5368
|
-
}
|
|
5369
|
-
function insertCell(cell, row) {
|
|
5370
|
-
let x = 0;
|
|
5371
|
-
for (; x < row.length && row[x].x < cell.x; )
|
|
5372
|
-
x++;
|
|
5373
|
-
row.splice(x, 0, cell);
|
|
5374
|
-
}
|
|
5375
|
-
function fillInTable(table) {
|
|
5376
|
-
let h_max = maxHeight(table), w_max = maxWidth(table);
|
|
5377
|
-
debug(`Max rows: ${h_max}; Max cols: ${w_max}`);
|
|
5378
|
-
for (let y = 0; y < h_max; y++)
|
|
5379
|
-
for (let x = 0; x < w_max; x++)
|
|
5380
|
-
if (!conflictExists(table, x, y)) {
|
|
5381
|
-
let opts = { x, y, colSpan: 1, rowSpan: 1 };
|
|
5382
|
-
for (x++; x < w_max && !conflictExists(table, x, y); )
|
|
5383
|
-
opts.colSpan++, x++;
|
|
5384
|
-
let y2 = y + 1;
|
|
5385
|
-
for (; y2 < h_max && allBlank(table, y2, opts.x, opts.x + opts.colSpan); )
|
|
5386
|
-
opts.rowSpan++, y2++;
|
|
5387
|
-
let cell = new Cell(opts);
|
|
5388
|
-
cell.x = opts.x, cell.y = opts.y, warn(`Missing cell at ${cell.y}-${cell.x}.`), insertCell(cell, table[y]);
|
|
5389
|
-
}
|
|
5390
|
-
}
|
|
5391
|
-
function generateCells(rows) {
|
|
5392
|
-
return rows.map(function(row) {
|
|
5393
|
-
if (!Array.isArray(row)) {
|
|
5394
|
-
let key = Object.keys(row)[0];
|
|
5395
|
-
row = row[key], Array.isArray(row) ? (row = row.slice(), row.unshift(key)) : row = [key, row];
|
|
5396
|
-
}
|
|
5397
|
-
return row.map(function(cell) {
|
|
5398
|
-
return new Cell(cell);
|
|
5399
|
-
});
|
|
5400
|
-
});
|
|
5401
|
-
}
|
|
5402
|
-
function makeTableLayout(rows) {
|
|
5403
|
-
let cellRows = generateCells(rows);
|
|
5404
|
-
return layoutTable(cellRows), fillInTable(cellRows), addRowSpanCells(cellRows), addColSpanCells(cellRows), cellRows;
|
|
5405
|
-
}
|
|
5406
|
-
module.exports = {
|
|
5407
|
-
makeTableLayout,
|
|
5408
|
-
layoutTable,
|
|
5409
|
-
addRowSpanCells,
|
|
5410
|
-
maxWidth,
|
|
5411
|
-
fillInTable,
|
|
5412
|
-
computeWidths: makeComputeWidths("colSpan", "desiredWidth", "x", 1),
|
|
5413
|
-
computeHeights: makeComputeWidths("rowSpan", "desiredHeight", "y", 1)
|
|
5414
|
-
};
|
|
5415
|
-
})();
|
|
5416
|
-
function makeComputeWidths(colSpan, desiredWidth, x, forcedMin) {
|
|
5417
|
-
return function(vals, table) {
|
|
5418
|
-
let result = [], spanners = [], auto = {};
|
|
5419
|
-
table.forEach(function(row) {
|
|
5420
|
-
row.forEach(function(cell) {
|
|
5421
|
-
(cell[colSpan] || 1) > 1 ? spanners.push(cell) : result[cell[x]] = Math.max(result[cell[x]] || 0, cell[desiredWidth] || 0, forcedMin);
|
|
5422
|
-
});
|
|
5423
|
-
}), vals.forEach(function(val, index) {
|
|
5424
|
-
typeof val == "number" && (result[index] = val);
|
|
5425
|
-
});
|
|
5426
|
-
for (let k = spanners.length - 1; k >= 0; k--) {
|
|
5427
|
-
let cell = spanners[k], span = cell[colSpan], col = cell[x], existingWidth = result[col], editableCols = typeof vals[col] == "number" ? 0 : 1;
|
|
5428
|
-
if (typeof existingWidth == "number")
|
|
5429
|
-
for (let i = 1; i < span; i++)
|
|
5430
|
-
existingWidth += 1 + result[col + i], typeof vals[col + i] != "number" && editableCols++;
|
|
5431
|
-
else
|
|
5432
|
-
existingWidth = desiredWidth === "desiredWidth" ? cell.desiredWidth - 1 : 1, (!auto[col] || auto[col] < existingWidth) && (auto[col] = existingWidth);
|
|
5433
|
-
if (cell[desiredWidth] > existingWidth) {
|
|
5434
|
-
let i = 0;
|
|
5435
|
-
for (; editableCols > 0 && cell[desiredWidth] > existingWidth; ) {
|
|
5436
|
-
if (typeof vals[col + i] != "number") {
|
|
5437
|
-
let dif = Math.round((cell[desiredWidth] - existingWidth) / editableCols);
|
|
5438
|
-
existingWidth += dif, result[col + i] += dif, editableCols--;
|
|
5439
|
-
}
|
|
5440
|
-
i++;
|
|
5441
|
-
}
|
|
5442
|
-
}
|
|
5443
|
-
}
|
|
5444
|
-
Object.assign(vals, result, auto);
|
|
5445
|
-
for (let j = 0; j < vals.length; j++)
|
|
5446
|
-
vals[j] = Math.max(forcedMin, vals[j] || 0);
|
|
5447
|
-
};
|
|
5448
|
-
}
|
|
5449
|
-
}
|
|
5450
|
-
});
|
|
5451
|
-
|
|
5452
|
-
// ../node_modules/cli-table3/src/table.js
|
|
5453
|
-
var require_table = __commonJS({
|
|
5454
|
-
"../node_modules/cli-table3/src/table.js"(exports, module) {
|
|
5455
|
-
var debug = require_debug(), utils = require_utils2(), tableLayout = require_layout_manager(), Table2 = class extends Array {
|
|
5456
|
-
constructor(opts) {
|
|
5457
|
-
super();
|
|
5458
|
-
let options = utils.mergeOptions(opts);
|
|
5459
|
-
if (Object.defineProperty(this, "options", {
|
|
5460
|
-
value: options,
|
|
5461
|
-
enumerable: options.debug
|
|
5462
|
-
}), options.debug) {
|
|
5463
|
-
switch (typeof options.debug) {
|
|
5464
|
-
case "boolean":
|
|
5465
|
-
debug.setDebugLevel(debug.WARN);
|
|
5466
|
-
break;
|
|
5467
|
-
case "number":
|
|
5468
|
-
debug.setDebugLevel(options.debug);
|
|
5469
|
-
break;
|
|
5470
|
-
case "string":
|
|
5471
|
-
debug.setDebugLevel(parseInt(options.debug, 10));
|
|
5472
|
-
break;
|
|
5473
|
-
default:
|
|
5474
|
-
debug.setDebugLevel(debug.WARN), debug.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof options.debug}`);
|
|
5475
|
-
}
|
|
5476
|
-
Object.defineProperty(this, "messages", {
|
|
5477
|
-
get() {
|
|
5478
|
-
return debug.debugMessages();
|
|
5479
|
-
}
|
|
5480
|
-
});
|
|
5481
|
-
}
|
|
5482
|
-
}
|
|
5483
|
-
toString() {
|
|
5484
|
-
let array = this, headersPresent = this.options.head && this.options.head.length;
|
|
5485
|
-
headersPresent ? (array = [this.options.head], this.length && array.push.apply(array, this)) : this.options.style.head = [];
|
|
5486
|
-
let cells = tableLayout.makeTableLayout(array);
|
|
5487
|
-
cells.forEach(function(row) {
|
|
5488
|
-
row.forEach(function(cell) {
|
|
5489
|
-
cell.mergeTableOptions(this.options, cells);
|
|
5490
|
-
}, this);
|
|
5491
|
-
}, this), tableLayout.computeWidths(this.options.colWidths, cells), tableLayout.computeHeights(this.options.rowHeights, cells), cells.forEach(function(row) {
|
|
5492
|
-
row.forEach(function(cell) {
|
|
5493
|
-
cell.init(this.options);
|
|
5494
|
-
}, this);
|
|
5495
|
-
}, this);
|
|
5496
|
-
let result = [];
|
|
5497
|
-
for (let rowIndex = 0; rowIndex < cells.length; rowIndex++) {
|
|
5498
|
-
let row = cells[rowIndex], heightOfRow = this.options.rowHeights[rowIndex];
|
|
5499
|
-
(rowIndex === 0 || !this.options.style.compact || rowIndex == 1 && headersPresent) && doDraw(row, "top", result);
|
|
5500
|
-
for (let lineNum = 0; lineNum < heightOfRow; lineNum++)
|
|
5501
|
-
doDraw(row, lineNum, result);
|
|
5502
|
-
rowIndex + 1 == cells.length && doDraw(row, "bottom", result);
|
|
5503
|
-
}
|
|
5504
|
-
return result.join(`
|
|
5505
|
-
`);
|
|
5506
|
-
}
|
|
5507
|
-
get width() {
|
|
5508
|
-
return this.toString().split(`
|
|
5509
|
-
`)[0].length;
|
|
5510
|
-
}
|
|
5511
|
-
};
|
|
5512
|
-
Table2.reset = () => debug.reset();
|
|
5513
|
-
function doDraw(row, lineNum, result) {
|
|
5514
|
-
let line = [];
|
|
5515
|
-
row.forEach(function(cell) {
|
|
5516
|
-
line.push(cell.draw(lineNum));
|
|
5517
|
-
});
|
|
5518
|
-
let str = line.join("");
|
|
5519
|
-
str.length && result.push(str);
|
|
5520
|
-
}
|
|
5521
|
-
module.exports = Table2;
|
|
5522
|
-
}
|
|
5523
|
-
});
|
|
5524
|
-
|
|
5525
|
-
// ../node_modules/cli-table3/index.js
|
|
5526
|
-
var require_cli_table3 = __commonJS({
|
|
5527
|
-
"../node_modules/cli-table3/index.js"(exports, module) {
|
|
5528
|
-
module.exports = require_table();
|
|
5529
|
-
}
|
|
5530
|
-
});
|
|
5531
|
-
|
|
5532
4242
|
// src/core-server/index.ts
|
|
5533
4243
|
import { getPreviewHeadTemplate, getPreviewBodyTemplate } from "storybook/internal/common";
|
|
5534
4244
|
|
|
@@ -6295,7 +5005,7 @@ function serializeTsType(tsType) {
|
|
|
6295
5005
|
// src/core-server/utils/StoryIndexGenerator.ts
|
|
6296
5006
|
import { existsSync } from "node:fs";
|
|
6297
5007
|
import { readFile } from "node:fs/promises";
|
|
6298
|
-
import { dirname, extname, join as join2, normalize, relative as relative2, resolve as resolve2, sep } from "node:path";
|
|
5008
|
+
import { dirname as dirname2, extname, join as join2, normalize, relative as relative2, resolve as resolve2, sep } from "node:path";
|
|
6299
5009
|
import { commonGlobOptions, getProjectRoot, normalizeStoryPath } from "storybook/internal/common";
|
|
6300
5010
|
import { combineTags, storyNameFromExport, toId } from "storybook/internal/csf";
|
|
6301
5011
|
import { getStorySortParameter, loadConfig } from "storybook/internal/csf-tools";
|
|
@@ -6410,7 +5120,7 @@ var AUTODOCS_TAG = "autodocs", ATTACHED_MDX_TAG = "attached-mdx", UNATTACHED_MDX
|
|
|
6410
5120
|
function isMdxEntry({ tags }) {
|
|
6411
5121
|
return tags?.includes(UNATTACHED_MDX_TAG) || tags?.includes(ATTACHED_MDX_TAG);
|
|
6412
5122
|
}
|
|
6413
|
-
var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.startsWith(".") ? slash(resolve2(workingDir, normalizeStoryPath(join2(
|
|
5123
|
+
var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.startsWith(".") ? slash(resolve2(workingDir, normalizeStoryPath(join2(dirname2(normalizedPath), otherImport)))) : otherImport, StoryIndexGenerator = class _StoryIndexGenerator {
|
|
6414
5124
|
constructor(specifiers, options) {
|
|
6415
5125
|
this.specifiers = specifiers;
|
|
6416
5126
|
this.options = options;
|
|
@@ -6437,7 +5147,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
6437
5147
|
let cacheKey = this.getFindMatchingFilesCacheKey(specifier, workingDir, ignoreWarnings), cached = this.findMatchingFilesCache.get(cacheKey);
|
|
6438
5148
|
if (cached)
|
|
6439
5149
|
return cached;
|
|
6440
|
-
let pathToSubIndex = {}, globCwd = slash(resolve2(workingDir, specifier.directory)), globPattern = specifier.files, { globby } = await import("../_node-chunks/globby-
|
|
5150
|
+
let pathToSubIndex = {}, globCwd = slash(resolve2(workingDir, specifier.directory)), globPattern = specifier.files, { globby } = await import("../_node-chunks/globby-D4FPSHY2.js"), files = await globby(globPattern, {
|
|
6441
5151
|
absolute: !0,
|
|
6442
5152
|
cwd: globCwd,
|
|
6443
5153
|
...commonGlobOptions(globPattern)
|
|
@@ -6555,7 +5265,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
6555
5265
|
resolveComponentPath(rawComponentPath, absolutePath, matchPath) {
|
|
6556
5266
|
let matchedPath = matchPath?.(rawComponentPath, void 0, void 0, supportedExtensions) ?? rawComponentPath, resolved;
|
|
6557
5267
|
try {
|
|
6558
|
-
resolved = resolveImport(matchedPath, { basedir:
|
|
5268
|
+
resolved = resolveImport(matchedPath, { basedir: dirname2(absolutePath) });
|
|
6559
5269
|
} catch {
|
|
6560
5270
|
return matchedPath;
|
|
6561
5271
|
}
|
|
@@ -6626,7 +5336,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
|
|
|
6626
5336
|
async extractDocs(specifier, absolutePath, projectTags = []) {
|
|
6627
5337
|
let relativePath = relative2(this.options.workingDir, absolutePath);
|
|
6628
5338
|
try {
|
|
6629
|
-
let normalizedPath = normalizeStoryPath(relativePath), importPath = slash(normalizedPath), content = await readFile(absolutePath, { encoding: "utf8" }), { analyze } = await import("../_node-chunks/dist-
|
|
5339
|
+
let normalizedPath = normalizeStoryPath(relativePath), importPath = slash(normalizedPath), content = await readFile(absolutePath, { encoding: "utf8" }), { analyze } = await import("../_node-chunks/dist-DR3AP3RJ.js"), result = await analyze(content);
|
|
6630
5340
|
if (result.isTemplate)
|
|
6631
5341
|
return !1;
|
|
6632
5342
|
let absoluteImports = result.imports.map(
|
|
@@ -6870,7 +5580,7 @@ async function copyAllStaticFilesRelativeToMain(staticDirs, outputDir, configDir
|
|
|
6870
5580
|
})
|
|
6871
5581
|
), targetPath = join3(outputDir, to), skipPaths = ["index.html", "iframe.html"].map((f) => join3(outputDir, f));
|
|
6872
5582
|
from.includes("node_modules") || logger2.info(
|
|
6873
|
-
|
|
5583
|
+
`Copying static files: ${import_picocolors2.default.cyan(print(from))} at ${import_picocolors2.default.cyan(print(targetPath))}`
|
|
6874
5584
|
), await cp(from, targetPath, {
|
|
6875
5585
|
dereference: !0,
|
|
6876
5586
|
preserveTimestamps: !0,
|
|
@@ -6886,7 +5596,7 @@ function print(p) {
|
|
|
6886
5596
|
// src/core-server/utils/get-builders.ts
|
|
6887
5597
|
import { MissingBuilderError } from "storybook/internal/server-errors";
|
|
6888
5598
|
async function getManagerBuilder() {
|
|
6889
|
-
return await import("../_node-chunks/builder-manager-
|
|
5599
|
+
return await import("../_node-chunks/builder-manager-FQ5J6V3U.js");
|
|
6890
5600
|
}
|
|
6891
5601
|
async function getPreviewBuilder(resolvedPreviewBuilder) {
|
|
6892
5602
|
return await importModule(resolvedPreviewBuilder);
|
|
@@ -6921,11 +5631,11 @@ import { logger as logger3 } from "storybook/internal/node-logger";
|
|
|
6921
5631
|
async function outputStats(directory, previewStats, managerStats) {
|
|
6922
5632
|
if (previewStats) {
|
|
6923
5633
|
let filePath = await writeStats(directory, "preview", previewStats);
|
|
6924
|
-
logger3.info(
|
|
5634
|
+
logger3.info(`Preview stats written to ${import_picocolors3.default.cyan(filePath)}`);
|
|
6925
5635
|
}
|
|
6926
5636
|
if (managerStats) {
|
|
6927
5637
|
let filePath = await writeStats(directory, "manager", managerStats);
|
|
6928
|
-
logger3.info(
|
|
5638
|
+
logger3.info(`Manager stats written to ${import_picocolors3.default.cyan(filePath)}`);
|
|
6929
5639
|
}
|
|
6930
5640
|
}
|
|
6931
5641
|
var writeStats = async (directory, name, stats) => {
|
|
@@ -6940,63 +5650,6 @@ import { writeFile as writeFile2 } from "node:fs/promises";
|
|
|
6940
5650
|
import { basename as basename3 } from "node:path";
|
|
6941
5651
|
import { STORY_INDEX_INVALIDATED } from "storybook/internal/core-events";
|
|
6942
5652
|
|
|
6943
|
-
// ../node_modules/es-toolkit/dist/function/debounce.mjs
|
|
6944
|
-
function debounce(func, debounceMs, { signal, edges } = {}) {
|
|
6945
|
-
let pendingThis, pendingArgs = null, leading = edges != null && edges.includes("leading"), trailing = edges == null || edges.includes("trailing"), invoke = () => {
|
|
6946
|
-
pendingArgs !== null && (func.apply(pendingThis, pendingArgs), pendingThis = void 0, pendingArgs = null);
|
|
6947
|
-
}, onTimerEnd = () => {
|
|
6948
|
-
trailing && invoke(), cancel();
|
|
6949
|
-
}, timeoutId = null, schedule = () => {
|
|
6950
|
-
timeoutId != null && clearTimeout(timeoutId), timeoutId = setTimeout(() => {
|
|
6951
|
-
timeoutId = null, onTimerEnd();
|
|
6952
|
-
}, debounceMs);
|
|
6953
|
-
}, cancelTimer = () => {
|
|
6954
|
-
timeoutId !== null && (clearTimeout(timeoutId), timeoutId = null);
|
|
6955
|
-
}, cancel = () => {
|
|
6956
|
-
cancelTimer(), pendingThis = void 0, pendingArgs = null;
|
|
6957
|
-
}, flush = () => {
|
|
6958
|
-
invoke();
|
|
6959
|
-
}, debounced = function(...args) {
|
|
6960
|
-
if (signal?.aborted)
|
|
6961
|
-
return;
|
|
6962
|
-
pendingThis = this, pendingArgs = args;
|
|
6963
|
-
let isFirstCall = timeoutId == null;
|
|
6964
|
-
schedule(), leading && isFirstCall && invoke();
|
|
6965
|
-
};
|
|
6966
|
-
return debounced.schedule = schedule, debounced.cancel = cancel, debounced.flush = flush, signal?.addEventListener("abort", cancel, { once: !0 }), debounced;
|
|
6967
|
-
}
|
|
6968
|
-
|
|
6969
|
-
// ../node_modules/es-toolkit/dist/function/partial.mjs
|
|
6970
|
-
function partial(func, ...partialArgs) {
|
|
6971
|
-
return partialImpl(func, placeholderSymbol, ...partialArgs);
|
|
6972
|
-
}
|
|
6973
|
-
function partialImpl(func, placeholder, ...partialArgs) {
|
|
6974
|
-
let partialed = function(...providedArgs) {
|
|
6975
|
-
let providedArgsIndex = 0, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg), remainingArgs = providedArgs.slice(providedArgsIndex);
|
|
6976
|
-
return func.apply(this, substitutedArgs.concat(remainingArgs));
|
|
6977
|
-
};
|
|
6978
|
-
return func.prototype && (partialed.prototype = Object.create(func.prototype)), partialed;
|
|
6979
|
-
}
|
|
6980
|
-
var placeholderSymbol = Symbol("partial.placeholder");
|
|
6981
|
-
partial.placeholder = placeholderSymbol;
|
|
6982
|
-
|
|
6983
|
-
// ../node_modules/es-toolkit/dist/function/partialRight.mjs
|
|
6984
|
-
function partialRight(func, ...partialArgs) {
|
|
6985
|
-
return partialRightImpl(func, placeholderSymbol2, ...partialArgs);
|
|
6986
|
-
}
|
|
6987
|
-
function partialRightImpl(func, placeholder, ...partialArgs) {
|
|
6988
|
-
let partialedRight = function(...providedArgs) {
|
|
6989
|
-
let placeholderLength = partialArgs.filter((arg) => arg === placeholder).length, rangeLength = Math.max(providedArgs.length - placeholderLength, 0), remainingArgs = providedArgs.slice(0, rangeLength), providedArgsIndex = rangeLength, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg);
|
|
6990
|
-
return func.apply(this, remainingArgs.concat(substitutedArgs));
|
|
6991
|
-
};
|
|
6992
|
-
return func.prototype && (partialedRight.prototype = Object.create(func.prototype)), partialedRight;
|
|
6993
|
-
}
|
|
6994
|
-
var placeholderSymbol2 = Symbol("partialRight.placeholder");
|
|
6995
|
-
partialRight.placeholder = placeholderSymbol2;
|
|
6996
|
-
|
|
6997
|
-
// ../node_modules/es-toolkit/dist/function/retry.mjs
|
|
6998
|
-
var DEFAULT_RETRIES = Number.POSITIVE_INFINITY;
|
|
6999
|
-
|
|
7000
5653
|
// src/core-server/utils/watch-story-specifiers.ts
|
|
7001
5654
|
import { lstatSync, readdirSync } from "node:fs";
|
|
7002
5655
|
import { basename as basename2, join as join5, relative as relative4, resolve as resolve3 } from "node:path";
|
|
@@ -7043,7 +5696,7 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
|
|
|
7043
5696
|
// files can be e.g. '**/foo/*/*.js' so we just want the last bit,
|
|
7044
5697
|
// because the directory could already be within the files part (e.g. './x/foo/bar')
|
|
7045
5698
|
basename2(specifier.files)
|
|
7046
|
-
), { globby } = await import("../_node-chunks/globby-
|
|
5699
|
+
), { globby } = await import("../_node-chunks/globby-D4FPSHY2.js");
|
|
7047
5700
|
(await globby(slash(dirGlob), commonGlobOptions2(dirGlob))).forEach((filePath) => {
|
|
7048
5701
|
let fileImportPath = toImportPath(filePath);
|
|
7049
5702
|
specifier.importPathMatcher.exec(fileImportPath) && onInvalidate(specifier, fileImportPath, removed);
|
|
@@ -7154,9 +5807,7 @@ function summarizeIndex(storyIndex) {
|
|
|
7154
5807
|
async function buildStaticStandalone(options) {
|
|
7155
5808
|
if (options.configType = "PRODUCTION", options.outputDir === "")
|
|
7156
5809
|
throw new Error("Won't remove current directory. Check your outputDir!");
|
|
7157
|
-
if (options.outputDir = resolve(options.outputDir), options.configDir = resolve(options.configDir), logger4.
|
|
7158
|
-
`=> Cleaning outputDir: ${import_picocolors4.default.cyan(relative(process.cwd(), options.outputDir))}`
|
|
7159
|
-
), options.outputDir === "/")
|
|
5810
|
+
if (options.outputDir = resolve(options.outputDir), options.configDir = resolve(options.configDir), logger4.step(`Cleaning outputDir: ${import_picocolors4.default.cyan(relative(process.cwd(), options.outputDir))}`), options.outputDir === "/")
|
|
7160
5811
|
throw new Error("Won't remove directory '/'. Check your outputDir!");
|
|
7161
5812
|
await rm(options.outputDir, { recursive: !0, force: !0 }).catch(() => {
|
|
7162
5813
|
}), await mkdir(options.outputDir, { recursive: !0 });
|
|
@@ -7168,7 +5819,7 @@ async function buildStaticStandalone(options) {
|
|
|
7168
5819
|
), commonOverridePreset = import.meta.resolve(
|
|
7169
5820
|
"storybook/internal/core-server/presets/common-override-preset"
|
|
7170
5821
|
);
|
|
7171
|
-
logger4.
|
|
5822
|
+
logger4.step("Loading presets");
|
|
7172
5823
|
let presets = await loadAllPresets({
|
|
7173
5824
|
corePresets: [commonPreset, ...corePresets],
|
|
7174
5825
|
overridePresets: [commonOverridePreset],
|
|
@@ -7248,7 +5899,7 @@ async function buildStaticStandalone(options) {
|
|
|
7248
5899
|
}
|
|
7249
5900
|
core2?.disableProjectJson || effects.push(
|
|
7250
5901
|
extractStorybookMetadata(join(options.outputDir, "project.json"), options.configDir)
|
|
7251
|
-
), options.debugWebpack && logConfig("Preview webpack config", await previewBuilder.getConfig(fullOptions)), options.ignorePreview ? logger4.info("
|
|
5902
|
+
), options.debugWebpack && logConfig("Preview webpack config", await previewBuilder.getConfig(fullOptions)), options.ignorePreview ? logger4.info("Not building preview") : logger4.info("Building preview..");
|
|
7252
5903
|
let startTime = process.hrtime();
|
|
7253
5904
|
await Promise.all([
|
|
7254
5905
|
...options.ignorePreview ? [] : [
|
|
@@ -7256,14 +5907,14 @@ async function buildStaticStandalone(options) {
|
|
|
7256
5907
|
startTime,
|
|
7257
5908
|
options: fullOptions
|
|
7258
5909
|
}).then(async (previewStats) => {
|
|
7259
|
-
logger4.trace({ message: "
|
|
5910
|
+
logger4.trace({ message: "Preview built", time: process.hrtime(startTime) });
|
|
7260
5911
|
let statsOption = options.webpackStatsJson || options.statsJson;
|
|
7261
5912
|
if (statsOption) {
|
|
7262
5913
|
let target = statsOption === !0 ? options.outputDir : statsOption;
|
|
7263
5914
|
await outputStats(target, previewStats);
|
|
7264
5915
|
}
|
|
7265
5916
|
}).catch((error) => {
|
|
7266
|
-
throw logger4.error("
|
|
5917
|
+
throw logger4.error("Failed to build the preview"), process.exitCode = 1, error;
|
|
7267
5918
|
})
|
|
7268
5919
|
],
|
|
7269
5920
|
...effects
|
|
@@ -7276,7 +5927,7 @@ async function buildStaticStandalone(options) {
|
|
|
7276
5927
|
storyIndex: summarizeIndex(storyIndex)
|
|
7277
5928
|
}), await telemetry2("build", payload, { configDir: options.configDir });
|
|
7278
5929
|
})
|
|
7279
|
-
), logger4.
|
|
5930
|
+
), logger4.step(`Output directory: ${options.outputDir}`);
|
|
7280
5931
|
}
|
|
7281
5932
|
|
|
7282
5933
|
// src/core-server/build-dev.ts
|
|
@@ -7293,11 +5944,10 @@ import {
|
|
|
7293
5944
|
validateFrameworkName,
|
|
7294
5945
|
versions
|
|
7295
5946
|
} from "storybook/internal/common";
|
|
7296
|
-
import { deprecate, logger as
|
|
5947
|
+
import { deprecate, logger as logger12, prompt } from "storybook/internal/node-logger";
|
|
7297
5948
|
import { MissingBuilderError as MissingBuilderError3, NoStatsForViteDevError } from "storybook/internal/server-errors";
|
|
7298
5949
|
import { oneWayHash, telemetry as telemetry4 } from "storybook/internal/telemetry";
|
|
7299
5950
|
import { global as global3 } from "@storybook/global";
|
|
7300
|
-
var import_prompts = __toESM(require_prompts(), 1);
|
|
7301
5951
|
var import_ts_dedent8 = __toESM(require_dist(), 1);
|
|
7302
5952
|
|
|
7303
5953
|
// src/core-server/dev-server.ts
|
|
@@ -8525,14 +7175,14 @@ async function storybookDevServer(options) {
|
|
|
8525
7175
|
server,
|
|
8526
7176
|
channel: serverChannel
|
|
8527
7177
|
}), previewResult = await Promise.resolve();
|
|
8528
|
-
options.ignorePreview || (
|
|
7178
|
+
options.ignorePreview || (logger8.debug("Starting preview.."), previewResult = await previewBuilder.start({
|
|
8529
7179
|
startTime: process.hrtime(),
|
|
8530
7180
|
options,
|
|
8531
7181
|
router: app,
|
|
8532
7182
|
server,
|
|
8533
7183
|
channel: serverChannel
|
|
8534
7184
|
}).catch(async (e) => {
|
|
8535
|
-
throw logger8.error("
|
|
7185
|
+
throw logger8.error("Failed to build the preview"), process.exitCode = 1, await managerBuilder?.bail().catch(), await previewBuilder?.bail().catch(), e;
|
|
8536
7186
|
}));
|
|
8537
7187
|
let listening = new Promise((resolve4, reject) => {
|
|
8538
7188
|
server.once("error", reject), app.listen({ port, host }, resolve4);
|
|
@@ -8596,8 +7246,8 @@ async function storybookDevServer(options) {
|
|
|
8596
7246
|
}
|
|
8597
7247
|
|
|
8598
7248
|
// src/core-server/utils/output-startup-information.ts
|
|
8599
|
-
|
|
8600
|
-
|
|
7249
|
+
var import_picocolors7 = __toESM(require_picocolors(), 1), import_pretty_hrtime = __toESM(require_pretty_hrtime(), 1), import_ts_dedent6 = __toESM(require_dist(), 1);
|
|
7250
|
+
import { CLI_COLORS, logger as logger9 } from "storybook/internal/node-logger";
|
|
8601
7251
|
|
|
8602
7252
|
// src/core-server/utils/update-check.ts
|
|
8603
7253
|
var import_picocolors6 = __toESM(require_picocolors(), 1), import_ts_dedent5 = __toESM(require_dist(), 1);
|
|
@@ -8641,62 +7291,39 @@ function createUpdateMessage(updateInfo, version) {
|
|
|
8641
7291
|
|
|
8642
7292
|
// src/core-server/utils/output-startup-information.ts
|
|
8643
7293
|
function outputStartupInformation(options) {
|
|
8644
|
-
let { updateInfo, version, name, address, networkAddress, managerTotalTime, previewTotalTime } = options, updateMessage = createUpdateMessage(updateInfo, version),
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
}
|
|
8662
|
-
// @ts-expect-error (Converted from ts-ignore)
|
|
8663
|
-
paddingLeft: 0,
|
|
8664
|
-
paddingRight: 0,
|
|
8665
|
-
paddingTop: 0,
|
|
8666
|
-
paddingBottom: 0
|
|
8667
|
-
});
|
|
8668
|
-
serveMessage.push(
|
|
8669
|
-
["Local:", import_picocolors7.default.cyan(address)],
|
|
8670
|
-
["On your network:", import_picocolors7.default.cyan(networkAddress)]
|
|
7294
|
+
let { updateInfo, version, name, address, networkAddress, managerTotalTime, previewTotalTime } = options, updateMessage = createUpdateMessage(updateInfo, version), serverMessages = [
|
|
7295
|
+
`- Local: ${address}`,
|
|
7296
|
+
`- On your network: ${networkAddress}`
|
|
7297
|
+
];
|
|
7298
|
+
logger9.logBox(
|
|
7299
|
+
import_ts_dedent6.dedent`
|
|
7300
|
+
Storybook ready!
|
|
7301
|
+
|
|
7302
|
+
${serverMessages.join(`
|
|
7303
|
+
`)}${updateMessage ? `
|
|
7304
|
+
|
|
7305
|
+
${updateMessage}` : ""}
|
|
7306
|
+
`,
|
|
7307
|
+
{
|
|
7308
|
+
formatBorder: CLI_COLORS.storybook,
|
|
7309
|
+
contentPadding: 3,
|
|
7310
|
+
rounded: !0
|
|
7311
|
+
}
|
|
8671
7312
|
);
|
|
8672
7313
|
let timeStatement = [
|
|
8673
7314
|
managerTotalTime && `${import_picocolors7.default.underline((0, import_pretty_hrtime.default)(managerTotalTime))} for manager`,
|
|
8674
7315
|
previewTotalTime && `${import_picocolors7.default.underline((0, import_pretty_hrtime.default)(previewTotalTime))} for preview`
|
|
8675
7316
|
].filter(Boolean).join(" and ");
|
|
8676
|
-
|
|
8677
|
-
boxen(
|
|
8678
|
-
import_ts_dedent6.dedent`
|
|
8679
|
-
${colors2.green(
|
|
8680
|
-
`Storybook ${import_picocolors7.default.bold(version)} for ${import_picocolors7.default.bold(name)} started`
|
|
8681
|
-
)}
|
|
8682
|
-
${import_picocolors7.default.gray(timeStatement)}
|
|
8683
|
-
|
|
8684
|
-
${serveMessage.toString()}${updateMessage ? `
|
|
8685
|
-
|
|
8686
|
-
${updateMessage}` : ""}
|
|
8687
|
-
`,
|
|
8688
|
-
{ borderStyle: "round", padding: 1, borderColor: "#F1618C" }
|
|
8689
|
-
)
|
|
8690
|
-
);
|
|
7317
|
+
logger9.info(timeStatement);
|
|
8691
7318
|
}
|
|
8692
7319
|
|
|
8693
7320
|
// src/core-server/utils/warnOnIncompatibleAddons.ts
|
|
8694
|
-
import { logger as
|
|
7321
|
+
import { logger as logger11 } from "storybook/internal/node-logger";
|
|
8695
7322
|
|
|
8696
7323
|
// ../lib/cli-storybook/src/doctor/getIncompatibleStorybookPackages.ts
|
|
8697
7324
|
var import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
8698
7325
|
import { versions as storybookCorePackages } from "storybook/internal/common";
|
|
8699
|
-
import { logger as
|
|
7326
|
+
import { logger as logger10 } from "storybook/internal/node-logger";
|
|
8700
7327
|
import semver2 from "semver";
|
|
8701
7328
|
|
|
8702
7329
|
// ../lib/cli-storybook/src/automigrate/helpers/consolidated-packages.ts
|
|
@@ -8756,7 +7383,7 @@ var checkPackageCompatibility = async (dependency, context) => {
|
|
|
8756
7383
|
availableCoreUpdate
|
|
8757
7384
|
};
|
|
8758
7385
|
} catch (err) {
|
|
8759
|
-
return skipErrors ||
|
|
7386
|
+
return skipErrors || logger10.log(
|
|
8760
7387
|
`Error checking compatibility for ${dependency}, please report an issue:
|
|
8761
7388
|
` + String(err)
|
|
8762
7389
|
), { packageName: dependency };
|
|
@@ -8826,7 +7453,7 @@ var warnOnIncompatibleAddons = async (currentStorybookVersion, packageManager) =
|
|
|
8826
7453
|
incompatiblePackagesList,
|
|
8827
7454
|
currentStorybookVersion
|
|
8828
7455
|
);
|
|
8829
|
-
incompatiblePackagesMessage &&
|
|
7456
|
+
incompatiblePackagesMessage && logger11.warn(incompatiblePackagesMessage);
|
|
8830
7457
|
};
|
|
8831
7458
|
|
|
8832
7459
|
// src/core-server/utils/warnWhenUsingArgTypesRegex.ts
|
|
@@ -8877,15 +7504,13 @@ async function buildDevStandalone(options) {
|
|
|
8877
7504
|
getServerPort(options.port, { exactPort: options.exactPort }),
|
|
8878
7505
|
versionUpdates ? updateCheck(storybookVersion) : Promise.resolve({ success: !1, cached: !1, data: {}, time: Date.now() })
|
|
8879
7506
|
]);
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
shouldChangePort || process.exit(1);
|
|
8888
|
-
}
|
|
7507
|
+
!options.ci && !options.smokeTest && options.port != null && port !== options.port && (await prompt.confirm({
|
|
7508
|
+
message: import_ts_dedent8.dedent`
|
|
7509
|
+
Port ${options.port} is not available.
|
|
7510
|
+
Would you like to run Storybook on port ${port} instead?
|
|
7511
|
+
`,
|
|
7512
|
+
initialValue: !0
|
|
7513
|
+
}) || process.exit(1));
|
|
8889
7514
|
let cacheKey = oneWayHash(relative(getProjectRoot2(), configDir)), cacheOutputDir = resolvePathInStorybookCache("public", cacheKey), outputDir = resolve(options.outputDir || cacheOutputDir);
|
|
8890
7515
|
options.smokeTest && (outputDir = cacheOutputDir), options.port = port, options.versionCheck = versionCheck, options.configType = "DEVELOPMENT", options.configDir = configDir, options.cacheKey = cacheKey, options.outputDir = outputDir, options.serverChannelUrl = getServerChannelUrl(port, options), options.pnp = await detectPnp(), options.pnp && deprecate(import_ts_dedent8.dedent`
|
|
8891
7516
|
As of Storybook 10.0, PnP is deprecated.
|
|
@@ -8901,7 +7526,7 @@ async function buildDevStandalone(options) {
|
|
|
8901
7526
|
try {
|
|
8902
7527
|
await warnOnIncompatibleAddons(storybookVersion, packageManager);
|
|
8903
7528
|
} catch (e) {
|
|
8904
|
-
|
|
7529
|
+
logger12.warn("Storybook failed to check addon compatibility"), logger12.debug(`${e instanceof Error ? e.stack : String(e)}`);
|
|
8905
7530
|
}
|
|
8906
7531
|
try {
|
|
8907
7532
|
await warnWhenUsingArgTypesRegex(previewConfigPath, config);
|
|
@@ -8971,7 +7596,7 @@ async function buildDevStandalone(options) {
|
|
|
8971
7596
|
let problems = warnings.filter((warning) => !warning.message.includes("export 'useInsertionEffect'")).filter((warning) => !warning.message.includes("compilation but it's unused")).filter(
|
|
8972
7597
|
(warning) => !warning.message.includes("Conflicting values for 'process.env.NODE_ENV'")
|
|
8973
7598
|
);
|
|
8974
|
-
|
|
7599
|
+
logger12.log(problems.map((p) => p.stack).join(`
|
|
8975
7600
|
`)), process.exit(problems.length > 0 ? 1 : 0);
|
|
8976
7601
|
} else {
|
|
8977
7602
|
let name = frameworkName.split("@storybook/").length > 1 ? frameworkName.split("@storybook/")[1] : frameworkName;
|
|
@@ -8991,7 +7616,7 @@ async function buildDevStandalone(options) {
|
|
|
8991
7616
|
// src/core-server/build-index.ts
|
|
8992
7617
|
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
8993
7618
|
import { normalizeStories as normalizeStories3 } from "storybook/internal/common";
|
|
8994
|
-
import { logger as
|
|
7619
|
+
import { logger as logger13 } from "storybook/internal/node-logger";
|
|
8995
7620
|
|
|
8996
7621
|
// src/core-server/load.ts
|
|
8997
7622
|
import {
|
|
@@ -9015,8 +7640,8 @@ async function loadStorybook(options) {
|
|
|
9015
7640
|
],
|
|
9016
7641
|
...options,
|
|
9017
7642
|
isCritical: !0
|
|
9018
|
-
}), { renderer } = await presets.apply("core", {}), resolvedRenderer = renderer && resolveAddonName3(options.configDir, renderer, options);
|
|
9019
|
-
presets = await loadAllPresets3({
|
|
7643
|
+
}), { renderer, builder } = await presets.apply("core", {}), resolvedRenderer = renderer && resolveAddonName3(options.configDir, renderer, options), builderName = typeof builder == "string" ? builder : builder?.name;
|
|
7644
|
+
builderName && corePresets.push(join(dirname(builderName), "preset.js")), presets = await loadAllPresets3({
|
|
9020
7645
|
corePresets: [
|
|
9021
7646
|
join(resolvePackageDir("storybook"), "dist/core-server/presets/common-preset.js"),
|
|
9022
7647
|
...resolvedRenderer ? [resolvedRenderer] : [],
|
|
@@ -9053,7 +7678,7 @@ var buildIndex = async (options) => {
|
|
|
9053
7678
|
return await generator.initialize(), generator.getIndex();
|
|
9054
7679
|
}, buildIndexStandalone = async (options) => {
|
|
9055
7680
|
let index = await buildIndex(options);
|
|
9056
|
-
|
|
7681
|
+
logger13.info(`Writing index to ${options.outputFile}`), await writeFile4(options.outputFile, JSON.stringify(index));
|
|
9057
7682
|
};
|
|
9058
7683
|
|
|
9059
7684
|
// src/core-server/standalone.ts
|
|
@@ -9367,6 +7992,7 @@ export {
|
|
|
9367
7992
|
fullTestProviderStore as internal_fullTestProviderStore,
|
|
9368
7993
|
universalStatusStore as internal_universalStatusStore,
|
|
9369
7994
|
universalTestProviderStore as internal_universalTestProviderStore,
|
|
7995
|
+
isTelemetryEnabled,
|
|
9370
7996
|
mapStaticDir,
|
|
9371
7997
|
sendTelemetryError,
|
|
9372
7998
|
withTelemetry
|