vitest 1.0.3 → 1.1.0
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/LICENSE.md +7 -0
- package/dist/browser.d.ts +1 -1
- package/dist/cli.js +11 -3
- package/dist/config.cjs +1 -0
- package/dist/config.d.ts +25 -24
- package/dist/config.js +1 -0
- package/dist/coverage.d.ts +1 -1
- package/dist/environments.d.ts +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/node.d.ts +2 -2
- package/dist/node.js +2 -2
- package/dist/{reporters-OH1c16Kq.d.ts → reporters-O4LBziQ_.d.ts} +34 -1
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +1 -1
- package/dist/runners.d.ts +1 -1
- package/dist/{suite-9ReVEt_h.d.ts → suite-dF4WyktM.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/vendor/{node.XBEcdByD.js → node.i3Lxw5di.js} +525 -320
- package/dist/vendor/{reporters.pr8MinP9.js → reporters.r0gTYN3L.js} +1 -1
- package/package.json +8 -8
|
@@ -17,7 +17,7 @@ import { slash as slash$2, normalizeRequestId, cleanUrl } from 'vite-node/utils'
|
|
|
17
17
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
18
18
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
19
19
|
import { ViteNodeServer } from 'vite-node/server';
|
|
20
|
-
import { r as removeUndefinedValues, a as isWindows
|
|
20
|
+
import { r as removeUndefinedValues, a as isWindows } from './index.XU72Rmy8.js';
|
|
21
21
|
import { g as getCoverageProvider, C as CoverageProviderMap } from './coverage.v6aD8iAh.js';
|
|
22
22
|
import { rootDir } from '../paths.js';
|
|
23
23
|
import v8 from 'node:v8';
|
|
@@ -39,7 +39,7 @@ import { isCI, provider as provider$1 } from 'std-env';
|
|
|
39
39
|
import ge from 'module';
|
|
40
40
|
import { ancestor, simple, findNodeAround } from 'acorn-walk';
|
|
41
41
|
import { generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, getTasks, hasFailed } from '@vitest/runner/utils';
|
|
42
|
-
import { R as ReportersMap, B as BenchmarkReportsMap, s as
|
|
42
|
+
import { R as ReportersMap, B as BenchmarkReportsMap, s as stripAnsi, a as ansiStyles, b as sliceAnsi, d as divider, F as F_POINTER, c as cliTruncate } from './reporters.r0gTYN3L.js';
|
|
43
43
|
import crypto, { createHash } from 'node:crypto';
|
|
44
44
|
import require$$0$3 from 'assert';
|
|
45
45
|
import MagicString from 'magic-string';
|
|
@@ -63,7 +63,7 @@ function _mergeNamespaces(n, m) {
|
|
|
63
63
|
return Object.freeze(n);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
var version$1 = "1.0
|
|
66
|
+
var version$1 = "1.1.0";
|
|
67
67
|
|
|
68
68
|
const __dirname$1 = url.fileURLToPath(new URL(".", import.meta.url));
|
|
69
69
|
async function ensurePackageInstalled(dependency, root) {
|
|
@@ -3251,11 +3251,12 @@ function stringifyRegex(input) {
|
|
|
3251
3251
|
return `$$vitest:${input.toString()}`;
|
|
3252
3252
|
}
|
|
3253
3253
|
function createChildProcessPool(ctx, { execArgv, env, forksPath }) {
|
|
3254
|
-
var _a
|
|
3254
|
+
var _a;
|
|
3255
3255
|
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length;
|
|
3256
3256
|
const threadsCount = ctx.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1);
|
|
3257
|
-
const
|
|
3258
|
-
const
|
|
3257
|
+
const poolOptions = ((_a = ctx.config.poolOptions) == null ? void 0 : _a.forks) ?? {};
|
|
3258
|
+
const maxThreads = poolOptions.maxForks ?? ctx.config.maxWorkers ?? threadsCount;
|
|
3259
|
+
const minThreads = poolOptions.minForks ?? ctx.config.minWorkers ?? threadsCount;
|
|
3259
3260
|
const options = {
|
|
3260
3261
|
runtime: "child_process",
|
|
3261
3262
|
filename: forksPath,
|
|
@@ -3263,17 +3264,16 @@ function createChildProcessPool(ctx, { execArgv, env, forksPath }) {
|
|
|
3263
3264
|
minThreads,
|
|
3264
3265
|
env,
|
|
3265
3266
|
execArgv: [
|
|
3266
|
-
...
|
|
3267
|
+
...poolOptions.execArgv ?? [],
|
|
3267
3268
|
...execArgv
|
|
3268
3269
|
],
|
|
3269
|
-
terminateTimeout: ctx.config.teardownTimeout
|
|
3270
|
+
terminateTimeout: ctx.config.teardownTimeout,
|
|
3271
|
+
concurrentTasksPerWorker: 1
|
|
3270
3272
|
};
|
|
3271
|
-
|
|
3273
|
+
const isolated = poolOptions.isolate ?? true;
|
|
3274
|
+
if (isolated)
|
|
3272
3275
|
options.isolateWorkers = true;
|
|
3273
|
-
|
|
3274
|
-
}
|
|
3275
|
-
if ((_j = (_i = ctx.config.poolOptions) == null ? void 0 : _i.forks) == null ? void 0 : _j.singleFork) {
|
|
3276
|
-
options.concurrentTasksPerWorker = 1;
|
|
3276
|
+
if (poolOptions.singleFork || !ctx.config.fileParallelism) {
|
|
3277
3277
|
options.maxThreads = 1;
|
|
3278
3278
|
options.minThreads = 1;
|
|
3279
3279
|
}
|
|
@@ -3307,7 +3307,6 @@ function createChildProcessPool(ctx, { execArgv, env, forksPath }) {
|
|
|
3307
3307
|
}
|
|
3308
3308
|
}
|
|
3309
3309
|
return async (specs, invalidates) => {
|
|
3310
|
-
var _a2, _b2;
|
|
3311
3310
|
ctx.onCancel(() => pool.cancelPendingTasks());
|
|
3312
3311
|
const configs = /* @__PURE__ */ new Map();
|
|
3313
3312
|
const getConfig = (project) => {
|
|
@@ -3329,18 +3328,18 @@ function createChildProcessPool(ctx, { execArgv, env, forksPath }) {
|
|
|
3329
3328
|
workspaceMap.set(file, workspaceFiles);
|
|
3330
3329
|
}
|
|
3331
3330
|
const singleFork = specs.filter(([project]) => {
|
|
3332
|
-
var
|
|
3333
|
-
return (
|
|
3331
|
+
var _a2, _b;
|
|
3332
|
+
return (_b = (_a2 = project.config.poolOptions) == null ? void 0 : _a2.forks) == null ? void 0 : _b.singleFork;
|
|
3334
3333
|
});
|
|
3335
3334
|
const multipleForks = specs.filter(([project]) => {
|
|
3336
|
-
var
|
|
3337
|
-
return !((
|
|
3335
|
+
var _a2, _b;
|
|
3336
|
+
return !((_b = (_a2 = project.config.poolOptions) == null ? void 0 : _a2.forks) == null ? void 0 : _b.singleFork);
|
|
3338
3337
|
});
|
|
3339
3338
|
if (multipleForks.length) {
|
|
3340
3339
|
const filesByEnv = await groupFilesByEnv(multipleForks);
|
|
3341
3340
|
const files = Object.values(filesByEnv).flat();
|
|
3342
3341
|
const results = [];
|
|
3343
|
-
if (
|
|
3342
|
+
if (isolated) {
|
|
3344
3343
|
results.push(...await Promise.allSettled(files.map(({ file, environment, project }) => runFiles(project, getConfig(project), [file], environment, invalidates))));
|
|
3345
3344
|
} else {
|
|
3346
3345
|
const grouped = groupBy(files, ({ project, environment }) => project.getName() + environment.name + JSON.stringify(environment.options));
|
|
@@ -3402,31 +3401,31 @@ function createWorkerChannel$1(project) {
|
|
|
3402
3401
|
return { workerPort, port };
|
|
3403
3402
|
}
|
|
3404
3403
|
function createThreadsPool(ctx, { execArgv, env, workerPath }) {
|
|
3405
|
-
var _a
|
|
3404
|
+
var _a;
|
|
3406
3405
|
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length;
|
|
3407
3406
|
const threadsCount = ctx.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1);
|
|
3408
|
-
const
|
|
3409
|
-
const
|
|
3407
|
+
const poolOptions = ((_a = ctx.config.poolOptions) == null ? void 0 : _a.threads) ?? {};
|
|
3408
|
+
const maxThreads = poolOptions.maxThreads ?? ctx.config.maxWorkers ?? threadsCount;
|
|
3409
|
+
const minThreads = poolOptions.minThreads ?? ctx.config.minWorkers ?? threadsCount;
|
|
3410
3410
|
const options = {
|
|
3411
3411
|
filename: workerPath,
|
|
3412
3412
|
// TODO: investigate further
|
|
3413
3413
|
// It seems atomics introduced V8 Fatal Error https://github.com/vitest-dev/vitest/issues/1191
|
|
3414
|
-
useAtomics:
|
|
3414
|
+
useAtomics: poolOptions.useAtomics ?? false,
|
|
3415
3415
|
maxThreads,
|
|
3416
3416
|
minThreads,
|
|
3417
3417
|
env,
|
|
3418
3418
|
execArgv: [
|
|
3419
|
-
...
|
|
3419
|
+
...poolOptions.execArgv ?? [],
|
|
3420
3420
|
...execArgv
|
|
3421
3421
|
],
|
|
3422
|
-
terminateTimeout: ctx.config.teardownTimeout
|
|
3422
|
+
terminateTimeout: ctx.config.teardownTimeout,
|
|
3423
|
+
concurrentTasksPerWorker: 1
|
|
3423
3424
|
};
|
|
3424
|
-
|
|
3425
|
+
const isolated = poolOptions.isolate ?? true;
|
|
3426
|
+
if (isolated)
|
|
3425
3427
|
options.isolateWorkers = true;
|
|
3426
|
-
|
|
3427
|
-
}
|
|
3428
|
-
if ((_l = (_k = ctx.config.poolOptions) == null ? void 0 : _k.threads) == null ? void 0 : _l.singleThread) {
|
|
3429
|
-
options.concurrentTasksPerWorker = 1;
|
|
3428
|
+
if (poolOptions.singleThread || !ctx.config.fileParallelism) {
|
|
3430
3429
|
options.maxThreads = 1;
|
|
3431
3430
|
options.minThreads = 1;
|
|
3432
3431
|
}
|
|
@@ -3462,7 +3461,6 @@ function createThreadsPool(ctx, { execArgv, env, workerPath }) {
|
|
|
3462
3461
|
}
|
|
3463
3462
|
}
|
|
3464
3463
|
return async (specs, invalidates) => {
|
|
3465
|
-
var _a2, _b2;
|
|
3466
3464
|
ctx.onCancel(() => pool.cancelPendingTasks());
|
|
3467
3465
|
const configs = /* @__PURE__ */ new Map();
|
|
3468
3466
|
const getConfig = (project) => {
|
|
@@ -3479,18 +3477,18 @@ function createThreadsPool(ctx, { execArgv, env, workerPath }) {
|
|
|
3479
3477
|
workspaceMap.set(file, workspaceFiles);
|
|
3480
3478
|
}
|
|
3481
3479
|
const singleThreads = specs.filter(([project]) => {
|
|
3482
|
-
var
|
|
3483
|
-
return (
|
|
3480
|
+
var _a2, _b;
|
|
3481
|
+
return (_b = (_a2 = project.config.poolOptions) == null ? void 0 : _a2.threads) == null ? void 0 : _b.singleThread;
|
|
3484
3482
|
});
|
|
3485
3483
|
const multipleThreads = specs.filter(([project]) => {
|
|
3486
|
-
var
|
|
3487
|
-
return !((
|
|
3484
|
+
var _a2, _b;
|
|
3485
|
+
return !((_b = (_a2 = project.config.poolOptions) == null ? void 0 : _a2.threads) == null ? void 0 : _b.singleThread);
|
|
3488
3486
|
});
|
|
3489
3487
|
if (multipleThreads.length) {
|
|
3490
3488
|
const filesByEnv = await groupFilesByEnv(multipleThreads);
|
|
3491
3489
|
const files = Object.values(filesByEnv).flat();
|
|
3492
3490
|
const results = [];
|
|
3493
|
-
if (
|
|
3491
|
+
if (isolated) {
|
|
3494
3492
|
results.push(...await Promise.allSettled(files.map(({ file, environment, project }) => runFiles(project, getConfig(project), [file], environment, invalidates))));
|
|
3495
3493
|
} else {
|
|
3496
3494
|
const grouped = groupBy(files, ({ project, environment }) => project.getName() + environment.name + JSON.stringify(environment.options));
|
|
@@ -3690,16 +3688,17 @@ function createWorkerChannel(project) {
|
|
|
3690
3688
|
return { workerPort, port };
|
|
3691
3689
|
}
|
|
3692
3690
|
function createVmThreadsPool(ctx, { execArgv, env, vmPath }) {
|
|
3693
|
-
var _a
|
|
3691
|
+
var _a;
|
|
3694
3692
|
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length;
|
|
3695
3693
|
const threadsCount = ctx.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1);
|
|
3696
|
-
const
|
|
3697
|
-
const
|
|
3694
|
+
const poolOptions = ((_a = ctx.config.poolOptions) == null ? void 0 : _a.vmThreads) ?? {};
|
|
3695
|
+
const maxThreads = poolOptions.maxThreads ?? ctx.config.maxWorkers ?? threadsCount;
|
|
3696
|
+
const minThreads = poolOptions.minThreads ?? ctx.config.minWorkers ?? threadsCount;
|
|
3698
3697
|
const options = {
|
|
3699
3698
|
filename: vmPath,
|
|
3700
3699
|
// TODO: investigate further
|
|
3701
3700
|
// It seems atomics introduced V8 Fatal Error https://github.com/vitest-dev/vitest/issues/1191
|
|
3702
|
-
useAtomics:
|
|
3701
|
+
useAtomics: poolOptions.useAtomics ?? false,
|
|
3703
3702
|
maxThreads,
|
|
3704
3703
|
minThreads,
|
|
3705
3704
|
env,
|
|
@@ -3708,14 +3707,14 @@ function createVmThreadsPool(ctx, { execArgv, env, vmPath }) {
|
|
|
3708
3707
|
"--experimental-vm-modules",
|
|
3709
3708
|
"--require",
|
|
3710
3709
|
suppressWarningsPath,
|
|
3711
|
-
...
|
|
3710
|
+
...poolOptions.execArgv ?? [],
|
|
3712
3711
|
...execArgv
|
|
3713
3712
|
],
|
|
3714
3713
|
terminateTimeout: ctx.config.teardownTimeout,
|
|
3714
|
+
concurrentTasksPerWorker: 1,
|
|
3715
3715
|
maxMemoryLimitBeforeRecycle: getMemoryLimit(ctx.config) || void 0
|
|
3716
3716
|
};
|
|
3717
|
-
if (
|
|
3718
|
-
options.concurrentTasksPerWorker = 1;
|
|
3717
|
+
if (poolOptions.singleThread || !ctx.config.fileParallelism) {
|
|
3719
3718
|
options.maxThreads = 1;
|
|
3720
3719
|
options.minThreads = 1;
|
|
3721
3720
|
}
|
|
@@ -4351,7 +4350,7 @@ function createTypecheckPool(ctx) {
|
|
|
4351
4350
|
setTimeout(() => {
|
|
4352
4351
|
resolve(false);
|
|
4353
4352
|
clearInterval(_i);
|
|
4354
|
-
}, 500);
|
|
4353
|
+
}, 500).unref();
|
|
4355
4354
|
});
|
|
4356
4355
|
const triggered = await _p;
|
|
4357
4356
|
if (project.typechecker && !triggered) {
|
|
@@ -4750,6 +4749,7 @@ const fakeTimersDefaults = {
|
|
|
4750
4749
|
};
|
|
4751
4750
|
const config = {
|
|
4752
4751
|
allowOnly: !isCI,
|
|
4752
|
+
isolate: true,
|
|
4753
4753
|
watch: !isCI,
|
|
4754
4754
|
globals: false,
|
|
4755
4755
|
environment: "node",
|
|
@@ -4978,6 +4978,11 @@ const extraInlineDeps = [
|
|
|
4978
4978
|
// Nuxt
|
|
4979
4979
|
"@nuxt/test-utils"
|
|
4980
4980
|
];
|
|
4981
|
+
function resolvePath(path, root) {
|
|
4982
|
+
return normalize(
|
|
4983
|
+
resolveModule(path, { paths: [root] }) ?? resolve(root, path)
|
|
4984
|
+
);
|
|
4985
|
+
}
|
|
4981
4986
|
function resolveApiServerConfig(options) {
|
|
4982
4987
|
let api;
|
|
4983
4988
|
if (options.ui && !options.api)
|
|
@@ -5040,12 +5045,17 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
5040
5045
|
throw new Error("--shard <index> must be a positive number less then <count>");
|
|
5041
5046
|
resolved.shard = { index, count };
|
|
5042
5047
|
}
|
|
5048
|
+
resolved.fileParallelism ?? (resolved.fileParallelism = true);
|
|
5049
|
+
if (!resolved.fileParallelism) {
|
|
5050
|
+
resolved.maxWorkers = 1;
|
|
5051
|
+
resolved.minWorkers = 1;
|
|
5052
|
+
}
|
|
5043
5053
|
if (resolved.inspect || resolved.inspectBrk) {
|
|
5044
5054
|
const isSingleThread = resolved.pool === "threads" && ((_c = (_b = resolved.poolOptions) == null ? void 0 : _b.threads) == null ? void 0 : _c.singleThread);
|
|
5045
5055
|
const isSingleFork = resolved.pool === "forks" && ((_e = (_d = resolved.poolOptions) == null ? void 0 : _d.forks) == null ? void 0 : _e.singleFork);
|
|
5046
|
-
if (!isSingleThread && !isSingleFork) {
|
|
5056
|
+
if (resolved.fileParallelism && !isSingleThread && !isSingleFork) {
|
|
5047
5057
|
const inspectOption = `--inspect${resolved.inspectBrk ? "-brk" : ""}`;
|
|
5048
|
-
throw new Error(`You cannot use ${inspectOption} without "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"`);
|
|
5058
|
+
throw new Error(`You cannot use ${inspectOption} without "--no-parallelism", "poolOptions.threads.singleThread" or "poolOptions.forks.singleFork"`);
|
|
5049
5059
|
}
|
|
5050
5060
|
}
|
|
5051
5061
|
if (resolved.coverage.provider === "c8")
|
|
@@ -5091,6 +5101,8 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
5091
5101
|
if (resolved.server.deps[option] === void 0)
|
|
5092
5102
|
resolved.server.deps[option] = resolved.deps[option];
|
|
5093
5103
|
});
|
|
5104
|
+
if (resolved.cliExclude)
|
|
5105
|
+
resolved.exclude.push(...resolved.cliExclude);
|
|
5094
5106
|
if (resolved.server.deps.inline !== true) {
|
|
5095
5107
|
const ssrOptions = viteConfig.ssr;
|
|
5096
5108
|
if ((ssrOptions == null ? void 0 : ssrOptions.noExternal) === true && resolved.server.deps.inline == null) {
|
|
@@ -5102,9 +5114,8 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
5102
5114
|
}
|
|
5103
5115
|
(_r = resolved.server.deps).moduleDirectories ?? (_r.moduleDirectories = []);
|
|
5104
5116
|
resolved.server.deps.moduleDirectories.push(...resolved.deps.moduleDirectories);
|
|
5105
|
-
if (resolved.runner)
|
|
5106
|
-
resolved.runner =
|
|
5107
|
-
}
|
|
5117
|
+
if (resolved.runner)
|
|
5118
|
+
resolved.runner = resolvePath(resolved.runner, resolved.root);
|
|
5108
5119
|
resolved.testNamePattern = resolved.testNamePattern ? resolved.testNamePattern instanceof RegExp ? resolved.testNamePattern : new RegExp(resolved.testNamePattern) : void 0;
|
|
5109
5120
|
if (resolved.snapshotFormat && "plugins" in resolved.snapshotFormat)
|
|
5110
5121
|
resolved.snapshotFormat.plugins = [];
|
|
@@ -5164,17 +5175,14 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
5164
5175
|
}
|
|
5165
5176
|
};
|
|
5166
5177
|
}
|
|
5167
|
-
if (
|
|
5168
|
-
resolved.
|
|
5169
|
-
resolveModule(resolved.pool, { paths: [resolved.root] }) ?? resolve(resolved.root, resolved.pool)
|
|
5170
|
-
);
|
|
5178
|
+
if (resolved.workspace) {
|
|
5179
|
+
resolved.workspace = options.workspace && options.workspace[0] === "." ? resolve(process.cwd(), options.workspace) : resolvePath(resolved.workspace, resolved.root);
|
|
5171
5180
|
}
|
|
5181
|
+
if (!builtinPools.includes(resolved.pool))
|
|
5182
|
+
resolved.pool = resolvePath(resolved.pool, resolved.root);
|
|
5172
5183
|
resolved.poolMatchGlobs = (resolved.poolMatchGlobs || []).map(([glob, pool]) => {
|
|
5173
|
-
if (!builtinPools.includes(pool))
|
|
5174
|
-
pool =
|
|
5175
|
-
resolveModule(pool, { paths: [resolved.root] }) ?? resolve(resolved.root, pool)
|
|
5176
|
-
);
|
|
5177
|
-
}
|
|
5184
|
+
if (!builtinPools.includes(pool))
|
|
5185
|
+
pool = resolvePath(pool, resolved.root);
|
|
5178
5186
|
return [glob, pool];
|
|
5179
5187
|
});
|
|
5180
5188
|
if (mode === "benchmark") {
|
|
@@ -5199,14 +5207,10 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
5199
5207
|
resolved.benchmark.outputFile = options.outputFile;
|
|
5200
5208
|
}
|
|
5201
5209
|
resolved.setupFiles = toArray(resolved.setupFiles || []).map(
|
|
5202
|
-
(file) =>
|
|
5203
|
-
resolveModule(file, { paths: [resolved.root] }) ?? resolve(resolved.root, file)
|
|
5204
|
-
)
|
|
5210
|
+
(file) => resolvePath(file, resolved.root)
|
|
5205
5211
|
);
|
|
5206
5212
|
resolved.globalSetup = toArray(resolved.globalSetup || []).map(
|
|
5207
|
-
(file) =>
|
|
5208
|
-
resolveModule(file, { paths: [resolved.root] }) ?? resolve(resolved.root, file)
|
|
5209
|
-
)
|
|
5213
|
+
(file) => resolvePath(file, resolved.root)
|
|
5210
5214
|
);
|
|
5211
5215
|
resolved.coverage.exclude.push(...resolved.setupFiles.map((file) => `${resolved.coverage.allowExternal ? "**/" : ""}${relative(resolved.root, file)}`));
|
|
5212
5216
|
resolved.forceRerunTriggers = [
|
|
@@ -5214,9 +5218,7 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
5214
5218
|
...resolved.setupFiles
|
|
5215
5219
|
];
|
|
5216
5220
|
if (resolved.diff) {
|
|
5217
|
-
resolved.diff =
|
|
5218
|
-
resolveModule(resolved.diff, { paths: [resolved.root] }) ?? resolve(resolved.root, resolved.diff)
|
|
5219
|
-
);
|
|
5221
|
+
resolved.diff = resolvePath(resolved.diff, resolved.root);
|
|
5220
5222
|
resolved.forceRerunTriggers.push(resolved.diff);
|
|
5221
5223
|
}
|
|
5222
5224
|
resolved.api = resolveApiServerConfig(options);
|
|
@@ -5281,15 +5283,7 @@ const ESC$1 = '\u001B[';
|
|
|
5281
5283
|
const OSC = '\u001B]';
|
|
5282
5284
|
const BEL = '\u0007';
|
|
5283
5285
|
const SEP = ';';
|
|
5284
|
-
|
|
5285
|
-
/* global window */
|
|
5286
|
-
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
5287
|
-
|
|
5288
|
-
const isTerminalApp = !isBrowser && process$2.env.TERM_PROGRAM === 'Apple_Terminal';
|
|
5289
|
-
const isWindows = !isBrowser && process$2.platform === 'win32';
|
|
5290
|
-
const cwdFunction = isBrowser ? () => {
|
|
5291
|
-
throw new Error('`process.cwd()` only works in Node.js, not the browser.');
|
|
5292
|
-
} : process$2.cwd;
|
|
5286
|
+
const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
|
|
5293
5287
|
|
|
5294
5288
|
const ansiEscapes = {};
|
|
5295
5289
|
|
|
@@ -5302,7 +5296,7 @@ ansiEscapes.cursorTo = (x, y) => {
|
|
|
5302
5296
|
return ESC$1 + (x + 1) + 'G';
|
|
5303
5297
|
}
|
|
5304
5298
|
|
|
5305
|
-
return ESC$1 + (y + 1) +
|
|
5299
|
+
return ESC$1 + (y + 1) + ';' + (x + 1) + 'H';
|
|
5306
5300
|
};
|
|
5307
5301
|
|
|
5308
5302
|
ansiEscapes.cursorMove = (x, y) => {
|
|
@@ -5366,33 +5360,32 @@ ansiEscapes.scrollDown = ESC$1 + 'T';
|
|
|
5366
5360
|
|
|
5367
5361
|
ansiEscapes.clearScreen = '\u001Bc';
|
|
5368
5362
|
|
|
5369
|
-
ansiEscapes.clearTerminal =
|
|
5370
|
-
|
|
5363
|
+
ansiEscapes.clearTerminal = process.platform === 'win32' ?
|
|
5364
|
+
`${ansiEscapes.eraseScreen}${ESC$1}0f` :
|
|
5371
5365
|
// 1. Erases the screen (Only done in case `2` is not supported)
|
|
5372
5366
|
// 2. Erases the whole screen including scrollback buffer
|
|
5373
5367
|
// 3. Moves cursor to the top-left position
|
|
5374
5368
|
// More info: https://www.real-world-systems.com/docs/ANSIcode.html
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
ansiEscapes.enterAlternativeScreen = ESC$1 + '?1049h';
|
|
5378
|
-
ansiEscapes.exitAlternativeScreen = ESC$1 + '?1049l';
|
|
5369
|
+
`${ansiEscapes.eraseScreen}${ESC$1}3J${ESC$1}H`;
|
|
5379
5370
|
|
|
5380
5371
|
ansiEscapes.beep = BEL;
|
|
5381
5372
|
|
|
5382
|
-
ansiEscapes.link = (text, url) =>
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5373
|
+
ansiEscapes.link = (text, url) => {
|
|
5374
|
+
return [
|
|
5375
|
+
OSC,
|
|
5376
|
+
'8',
|
|
5377
|
+
SEP,
|
|
5378
|
+
SEP,
|
|
5379
|
+
url,
|
|
5380
|
+
BEL,
|
|
5381
|
+
text,
|
|
5382
|
+
OSC,
|
|
5383
|
+
'8',
|
|
5384
|
+
SEP,
|
|
5385
|
+
SEP,
|
|
5386
|
+
BEL
|
|
5387
|
+
].join('');
|
|
5388
|
+
};
|
|
5396
5389
|
|
|
5397
5390
|
ansiEscapes.image = (buffer, options = {}) => {
|
|
5398
5391
|
let returnValue = `${OSC}1337;File=inline=1`;
|
|
@@ -5413,9 +5406,9 @@ ansiEscapes.image = (buffer, options = {}) => {
|
|
|
5413
5406
|
};
|
|
5414
5407
|
|
|
5415
5408
|
ansiEscapes.iTerm = {
|
|
5416
|
-
setCwd: (cwd =
|
|
5409
|
+
setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
|
|
5417
5410
|
|
|
5418
|
-
annotation(message, options = {}) {
|
|
5411
|
+
annotation: (message, options = {}) => {
|
|
5419
5412
|
let returnValue = `${OSC}1337;`;
|
|
5420
5413
|
|
|
5421
5414
|
const hasX = typeof options.x !== 'undefined';
|
|
@@ -5429,17 +5422,16 @@ ansiEscapes.iTerm = {
|
|
|
5429
5422
|
returnValue += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';
|
|
5430
5423
|
|
|
5431
5424
|
if (options.length > 0) {
|
|
5432
|
-
returnValue +=
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
).join('|');
|
|
5425
|
+
returnValue +=
|
|
5426
|
+
(hasX ?
|
|
5427
|
+
[message, options.length, options.x, options.y] :
|
|
5428
|
+
[options.length, message]).join('|');
|
|
5437
5429
|
} else {
|
|
5438
5430
|
returnValue += message;
|
|
5439
5431
|
}
|
|
5440
5432
|
|
|
5441
5433
|
return returnValue + BEL;
|
|
5442
|
-
}
|
|
5434
|
+
}
|
|
5443
5435
|
};
|
|
5444
5436
|
|
|
5445
5437
|
var onetime$2 = {exports: {}};
|
|
@@ -5821,7 +5813,382 @@ cliCursor.toggle = (force, writableStream) => {
|
|
|
5821
5813
|
}
|
|
5822
5814
|
};
|
|
5823
5815
|
|
|
5824
|
-
|
|
5816
|
+
var eastasianwidth = {exports: {}};
|
|
5817
|
+
|
|
5818
|
+
(function (module) {
|
|
5819
|
+
var eaw = {};
|
|
5820
|
+
|
|
5821
|
+
{
|
|
5822
|
+
module.exports = eaw;
|
|
5823
|
+
}
|
|
5824
|
+
|
|
5825
|
+
eaw.eastAsianWidth = function(character) {
|
|
5826
|
+
var x = character.charCodeAt(0);
|
|
5827
|
+
var y = (character.length == 2) ? character.charCodeAt(1) : 0;
|
|
5828
|
+
var codePoint = x;
|
|
5829
|
+
if ((0xD800 <= x && x <= 0xDBFF) && (0xDC00 <= y && y <= 0xDFFF)) {
|
|
5830
|
+
x &= 0x3FF;
|
|
5831
|
+
y &= 0x3FF;
|
|
5832
|
+
codePoint = (x << 10) | y;
|
|
5833
|
+
codePoint += 0x10000;
|
|
5834
|
+
}
|
|
5835
|
+
|
|
5836
|
+
if ((0x3000 == codePoint) ||
|
|
5837
|
+
(0xFF01 <= codePoint && codePoint <= 0xFF60) ||
|
|
5838
|
+
(0xFFE0 <= codePoint && codePoint <= 0xFFE6)) {
|
|
5839
|
+
return 'F';
|
|
5840
|
+
}
|
|
5841
|
+
if ((0x20A9 == codePoint) ||
|
|
5842
|
+
(0xFF61 <= codePoint && codePoint <= 0xFFBE) ||
|
|
5843
|
+
(0xFFC2 <= codePoint && codePoint <= 0xFFC7) ||
|
|
5844
|
+
(0xFFCA <= codePoint && codePoint <= 0xFFCF) ||
|
|
5845
|
+
(0xFFD2 <= codePoint && codePoint <= 0xFFD7) ||
|
|
5846
|
+
(0xFFDA <= codePoint && codePoint <= 0xFFDC) ||
|
|
5847
|
+
(0xFFE8 <= codePoint && codePoint <= 0xFFEE)) {
|
|
5848
|
+
return 'H';
|
|
5849
|
+
}
|
|
5850
|
+
if ((0x1100 <= codePoint && codePoint <= 0x115F) ||
|
|
5851
|
+
(0x11A3 <= codePoint && codePoint <= 0x11A7) ||
|
|
5852
|
+
(0x11FA <= codePoint && codePoint <= 0x11FF) ||
|
|
5853
|
+
(0x2329 <= codePoint && codePoint <= 0x232A) ||
|
|
5854
|
+
(0x2E80 <= codePoint && codePoint <= 0x2E99) ||
|
|
5855
|
+
(0x2E9B <= codePoint && codePoint <= 0x2EF3) ||
|
|
5856
|
+
(0x2F00 <= codePoint && codePoint <= 0x2FD5) ||
|
|
5857
|
+
(0x2FF0 <= codePoint && codePoint <= 0x2FFB) ||
|
|
5858
|
+
(0x3001 <= codePoint && codePoint <= 0x303E) ||
|
|
5859
|
+
(0x3041 <= codePoint && codePoint <= 0x3096) ||
|
|
5860
|
+
(0x3099 <= codePoint && codePoint <= 0x30FF) ||
|
|
5861
|
+
(0x3105 <= codePoint && codePoint <= 0x312D) ||
|
|
5862
|
+
(0x3131 <= codePoint && codePoint <= 0x318E) ||
|
|
5863
|
+
(0x3190 <= codePoint && codePoint <= 0x31BA) ||
|
|
5864
|
+
(0x31C0 <= codePoint && codePoint <= 0x31E3) ||
|
|
5865
|
+
(0x31F0 <= codePoint && codePoint <= 0x321E) ||
|
|
5866
|
+
(0x3220 <= codePoint && codePoint <= 0x3247) ||
|
|
5867
|
+
(0x3250 <= codePoint && codePoint <= 0x32FE) ||
|
|
5868
|
+
(0x3300 <= codePoint && codePoint <= 0x4DBF) ||
|
|
5869
|
+
(0x4E00 <= codePoint && codePoint <= 0xA48C) ||
|
|
5870
|
+
(0xA490 <= codePoint && codePoint <= 0xA4C6) ||
|
|
5871
|
+
(0xA960 <= codePoint && codePoint <= 0xA97C) ||
|
|
5872
|
+
(0xAC00 <= codePoint && codePoint <= 0xD7A3) ||
|
|
5873
|
+
(0xD7B0 <= codePoint && codePoint <= 0xD7C6) ||
|
|
5874
|
+
(0xD7CB <= codePoint && codePoint <= 0xD7FB) ||
|
|
5875
|
+
(0xF900 <= codePoint && codePoint <= 0xFAFF) ||
|
|
5876
|
+
(0xFE10 <= codePoint && codePoint <= 0xFE19) ||
|
|
5877
|
+
(0xFE30 <= codePoint && codePoint <= 0xFE52) ||
|
|
5878
|
+
(0xFE54 <= codePoint && codePoint <= 0xFE66) ||
|
|
5879
|
+
(0xFE68 <= codePoint && codePoint <= 0xFE6B) ||
|
|
5880
|
+
(0x1B000 <= codePoint && codePoint <= 0x1B001) ||
|
|
5881
|
+
(0x1F200 <= codePoint && codePoint <= 0x1F202) ||
|
|
5882
|
+
(0x1F210 <= codePoint && codePoint <= 0x1F23A) ||
|
|
5883
|
+
(0x1F240 <= codePoint && codePoint <= 0x1F248) ||
|
|
5884
|
+
(0x1F250 <= codePoint && codePoint <= 0x1F251) ||
|
|
5885
|
+
(0x20000 <= codePoint && codePoint <= 0x2F73F) ||
|
|
5886
|
+
(0x2B740 <= codePoint && codePoint <= 0x2FFFD) ||
|
|
5887
|
+
(0x30000 <= codePoint && codePoint <= 0x3FFFD)) {
|
|
5888
|
+
return 'W';
|
|
5889
|
+
}
|
|
5890
|
+
if ((0x0020 <= codePoint && codePoint <= 0x007E) ||
|
|
5891
|
+
(0x00A2 <= codePoint && codePoint <= 0x00A3) ||
|
|
5892
|
+
(0x00A5 <= codePoint && codePoint <= 0x00A6) ||
|
|
5893
|
+
(0x00AC == codePoint) ||
|
|
5894
|
+
(0x00AF == codePoint) ||
|
|
5895
|
+
(0x27E6 <= codePoint && codePoint <= 0x27ED) ||
|
|
5896
|
+
(0x2985 <= codePoint && codePoint <= 0x2986)) {
|
|
5897
|
+
return 'Na';
|
|
5898
|
+
}
|
|
5899
|
+
if ((0x00A1 == codePoint) ||
|
|
5900
|
+
(0x00A4 == codePoint) ||
|
|
5901
|
+
(0x00A7 <= codePoint && codePoint <= 0x00A8) ||
|
|
5902
|
+
(0x00AA == codePoint) ||
|
|
5903
|
+
(0x00AD <= codePoint && codePoint <= 0x00AE) ||
|
|
5904
|
+
(0x00B0 <= codePoint && codePoint <= 0x00B4) ||
|
|
5905
|
+
(0x00B6 <= codePoint && codePoint <= 0x00BA) ||
|
|
5906
|
+
(0x00BC <= codePoint && codePoint <= 0x00BF) ||
|
|
5907
|
+
(0x00C6 == codePoint) ||
|
|
5908
|
+
(0x00D0 == codePoint) ||
|
|
5909
|
+
(0x00D7 <= codePoint && codePoint <= 0x00D8) ||
|
|
5910
|
+
(0x00DE <= codePoint && codePoint <= 0x00E1) ||
|
|
5911
|
+
(0x00E6 == codePoint) ||
|
|
5912
|
+
(0x00E8 <= codePoint && codePoint <= 0x00EA) ||
|
|
5913
|
+
(0x00EC <= codePoint && codePoint <= 0x00ED) ||
|
|
5914
|
+
(0x00F0 == codePoint) ||
|
|
5915
|
+
(0x00F2 <= codePoint && codePoint <= 0x00F3) ||
|
|
5916
|
+
(0x00F7 <= codePoint && codePoint <= 0x00FA) ||
|
|
5917
|
+
(0x00FC == codePoint) ||
|
|
5918
|
+
(0x00FE == codePoint) ||
|
|
5919
|
+
(0x0101 == codePoint) ||
|
|
5920
|
+
(0x0111 == codePoint) ||
|
|
5921
|
+
(0x0113 == codePoint) ||
|
|
5922
|
+
(0x011B == codePoint) ||
|
|
5923
|
+
(0x0126 <= codePoint && codePoint <= 0x0127) ||
|
|
5924
|
+
(0x012B == codePoint) ||
|
|
5925
|
+
(0x0131 <= codePoint && codePoint <= 0x0133) ||
|
|
5926
|
+
(0x0138 == codePoint) ||
|
|
5927
|
+
(0x013F <= codePoint && codePoint <= 0x0142) ||
|
|
5928
|
+
(0x0144 == codePoint) ||
|
|
5929
|
+
(0x0148 <= codePoint && codePoint <= 0x014B) ||
|
|
5930
|
+
(0x014D == codePoint) ||
|
|
5931
|
+
(0x0152 <= codePoint && codePoint <= 0x0153) ||
|
|
5932
|
+
(0x0166 <= codePoint && codePoint <= 0x0167) ||
|
|
5933
|
+
(0x016B == codePoint) ||
|
|
5934
|
+
(0x01CE == codePoint) ||
|
|
5935
|
+
(0x01D0 == codePoint) ||
|
|
5936
|
+
(0x01D2 == codePoint) ||
|
|
5937
|
+
(0x01D4 == codePoint) ||
|
|
5938
|
+
(0x01D6 == codePoint) ||
|
|
5939
|
+
(0x01D8 == codePoint) ||
|
|
5940
|
+
(0x01DA == codePoint) ||
|
|
5941
|
+
(0x01DC == codePoint) ||
|
|
5942
|
+
(0x0251 == codePoint) ||
|
|
5943
|
+
(0x0261 == codePoint) ||
|
|
5944
|
+
(0x02C4 == codePoint) ||
|
|
5945
|
+
(0x02C7 == codePoint) ||
|
|
5946
|
+
(0x02C9 <= codePoint && codePoint <= 0x02CB) ||
|
|
5947
|
+
(0x02CD == codePoint) ||
|
|
5948
|
+
(0x02D0 == codePoint) ||
|
|
5949
|
+
(0x02D8 <= codePoint && codePoint <= 0x02DB) ||
|
|
5950
|
+
(0x02DD == codePoint) ||
|
|
5951
|
+
(0x02DF == codePoint) ||
|
|
5952
|
+
(0x0300 <= codePoint && codePoint <= 0x036F) ||
|
|
5953
|
+
(0x0391 <= codePoint && codePoint <= 0x03A1) ||
|
|
5954
|
+
(0x03A3 <= codePoint && codePoint <= 0x03A9) ||
|
|
5955
|
+
(0x03B1 <= codePoint && codePoint <= 0x03C1) ||
|
|
5956
|
+
(0x03C3 <= codePoint && codePoint <= 0x03C9) ||
|
|
5957
|
+
(0x0401 == codePoint) ||
|
|
5958
|
+
(0x0410 <= codePoint && codePoint <= 0x044F) ||
|
|
5959
|
+
(0x0451 == codePoint) ||
|
|
5960
|
+
(0x2010 == codePoint) ||
|
|
5961
|
+
(0x2013 <= codePoint && codePoint <= 0x2016) ||
|
|
5962
|
+
(0x2018 <= codePoint && codePoint <= 0x2019) ||
|
|
5963
|
+
(0x201C <= codePoint && codePoint <= 0x201D) ||
|
|
5964
|
+
(0x2020 <= codePoint && codePoint <= 0x2022) ||
|
|
5965
|
+
(0x2024 <= codePoint && codePoint <= 0x2027) ||
|
|
5966
|
+
(0x2030 == codePoint) ||
|
|
5967
|
+
(0x2032 <= codePoint && codePoint <= 0x2033) ||
|
|
5968
|
+
(0x2035 == codePoint) ||
|
|
5969
|
+
(0x203B == codePoint) ||
|
|
5970
|
+
(0x203E == codePoint) ||
|
|
5971
|
+
(0x2074 == codePoint) ||
|
|
5972
|
+
(0x207F == codePoint) ||
|
|
5973
|
+
(0x2081 <= codePoint && codePoint <= 0x2084) ||
|
|
5974
|
+
(0x20AC == codePoint) ||
|
|
5975
|
+
(0x2103 == codePoint) ||
|
|
5976
|
+
(0x2105 == codePoint) ||
|
|
5977
|
+
(0x2109 == codePoint) ||
|
|
5978
|
+
(0x2113 == codePoint) ||
|
|
5979
|
+
(0x2116 == codePoint) ||
|
|
5980
|
+
(0x2121 <= codePoint && codePoint <= 0x2122) ||
|
|
5981
|
+
(0x2126 == codePoint) ||
|
|
5982
|
+
(0x212B == codePoint) ||
|
|
5983
|
+
(0x2153 <= codePoint && codePoint <= 0x2154) ||
|
|
5984
|
+
(0x215B <= codePoint && codePoint <= 0x215E) ||
|
|
5985
|
+
(0x2160 <= codePoint && codePoint <= 0x216B) ||
|
|
5986
|
+
(0x2170 <= codePoint && codePoint <= 0x2179) ||
|
|
5987
|
+
(0x2189 == codePoint) ||
|
|
5988
|
+
(0x2190 <= codePoint && codePoint <= 0x2199) ||
|
|
5989
|
+
(0x21B8 <= codePoint && codePoint <= 0x21B9) ||
|
|
5990
|
+
(0x21D2 == codePoint) ||
|
|
5991
|
+
(0x21D4 == codePoint) ||
|
|
5992
|
+
(0x21E7 == codePoint) ||
|
|
5993
|
+
(0x2200 == codePoint) ||
|
|
5994
|
+
(0x2202 <= codePoint && codePoint <= 0x2203) ||
|
|
5995
|
+
(0x2207 <= codePoint && codePoint <= 0x2208) ||
|
|
5996
|
+
(0x220B == codePoint) ||
|
|
5997
|
+
(0x220F == codePoint) ||
|
|
5998
|
+
(0x2211 == codePoint) ||
|
|
5999
|
+
(0x2215 == codePoint) ||
|
|
6000
|
+
(0x221A == codePoint) ||
|
|
6001
|
+
(0x221D <= codePoint && codePoint <= 0x2220) ||
|
|
6002
|
+
(0x2223 == codePoint) ||
|
|
6003
|
+
(0x2225 == codePoint) ||
|
|
6004
|
+
(0x2227 <= codePoint && codePoint <= 0x222C) ||
|
|
6005
|
+
(0x222E == codePoint) ||
|
|
6006
|
+
(0x2234 <= codePoint && codePoint <= 0x2237) ||
|
|
6007
|
+
(0x223C <= codePoint && codePoint <= 0x223D) ||
|
|
6008
|
+
(0x2248 == codePoint) ||
|
|
6009
|
+
(0x224C == codePoint) ||
|
|
6010
|
+
(0x2252 == codePoint) ||
|
|
6011
|
+
(0x2260 <= codePoint && codePoint <= 0x2261) ||
|
|
6012
|
+
(0x2264 <= codePoint && codePoint <= 0x2267) ||
|
|
6013
|
+
(0x226A <= codePoint && codePoint <= 0x226B) ||
|
|
6014
|
+
(0x226E <= codePoint && codePoint <= 0x226F) ||
|
|
6015
|
+
(0x2282 <= codePoint && codePoint <= 0x2283) ||
|
|
6016
|
+
(0x2286 <= codePoint && codePoint <= 0x2287) ||
|
|
6017
|
+
(0x2295 == codePoint) ||
|
|
6018
|
+
(0x2299 == codePoint) ||
|
|
6019
|
+
(0x22A5 == codePoint) ||
|
|
6020
|
+
(0x22BF == codePoint) ||
|
|
6021
|
+
(0x2312 == codePoint) ||
|
|
6022
|
+
(0x2460 <= codePoint && codePoint <= 0x24E9) ||
|
|
6023
|
+
(0x24EB <= codePoint && codePoint <= 0x254B) ||
|
|
6024
|
+
(0x2550 <= codePoint && codePoint <= 0x2573) ||
|
|
6025
|
+
(0x2580 <= codePoint && codePoint <= 0x258F) ||
|
|
6026
|
+
(0x2592 <= codePoint && codePoint <= 0x2595) ||
|
|
6027
|
+
(0x25A0 <= codePoint && codePoint <= 0x25A1) ||
|
|
6028
|
+
(0x25A3 <= codePoint && codePoint <= 0x25A9) ||
|
|
6029
|
+
(0x25B2 <= codePoint && codePoint <= 0x25B3) ||
|
|
6030
|
+
(0x25B6 <= codePoint && codePoint <= 0x25B7) ||
|
|
6031
|
+
(0x25BC <= codePoint && codePoint <= 0x25BD) ||
|
|
6032
|
+
(0x25C0 <= codePoint && codePoint <= 0x25C1) ||
|
|
6033
|
+
(0x25C6 <= codePoint && codePoint <= 0x25C8) ||
|
|
6034
|
+
(0x25CB == codePoint) ||
|
|
6035
|
+
(0x25CE <= codePoint && codePoint <= 0x25D1) ||
|
|
6036
|
+
(0x25E2 <= codePoint && codePoint <= 0x25E5) ||
|
|
6037
|
+
(0x25EF == codePoint) ||
|
|
6038
|
+
(0x2605 <= codePoint && codePoint <= 0x2606) ||
|
|
6039
|
+
(0x2609 == codePoint) ||
|
|
6040
|
+
(0x260E <= codePoint && codePoint <= 0x260F) ||
|
|
6041
|
+
(0x2614 <= codePoint && codePoint <= 0x2615) ||
|
|
6042
|
+
(0x261C == codePoint) ||
|
|
6043
|
+
(0x261E == codePoint) ||
|
|
6044
|
+
(0x2640 == codePoint) ||
|
|
6045
|
+
(0x2642 == codePoint) ||
|
|
6046
|
+
(0x2660 <= codePoint && codePoint <= 0x2661) ||
|
|
6047
|
+
(0x2663 <= codePoint && codePoint <= 0x2665) ||
|
|
6048
|
+
(0x2667 <= codePoint && codePoint <= 0x266A) ||
|
|
6049
|
+
(0x266C <= codePoint && codePoint <= 0x266D) ||
|
|
6050
|
+
(0x266F == codePoint) ||
|
|
6051
|
+
(0x269E <= codePoint && codePoint <= 0x269F) ||
|
|
6052
|
+
(0x26BE <= codePoint && codePoint <= 0x26BF) ||
|
|
6053
|
+
(0x26C4 <= codePoint && codePoint <= 0x26CD) ||
|
|
6054
|
+
(0x26CF <= codePoint && codePoint <= 0x26E1) ||
|
|
6055
|
+
(0x26E3 == codePoint) ||
|
|
6056
|
+
(0x26E8 <= codePoint && codePoint <= 0x26FF) ||
|
|
6057
|
+
(0x273D == codePoint) ||
|
|
6058
|
+
(0x2757 == codePoint) ||
|
|
6059
|
+
(0x2776 <= codePoint && codePoint <= 0x277F) ||
|
|
6060
|
+
(0x2B55 <= codePoint && codePoint <= 0x2B59) ||
|
|
6061
|
+
(0x3248 <= codePoint && codePoint <= 0x324F) ||
|
|
6062
|
+
(0xE000 <= codePoint && codePoint <= 0xF8FF) ||
|
|
6063
|
+
(0xFE00 <= codePoint && codePoint <= 0xFE0F) ||
|
|
6064
|
+
(0xFFFD == codePoint) ||
|
|
6065
|
+
(0x1F100 <= codePoint && codePoint <= 0x1F10A) ||
|
|
6066
|
+
(0x1F110 <= codePoint && codePoint <= 0x1F12D) ||
|
|
6067
|
+
(0x1F130 <= codePoint && codePoint <= 0x1F169) ||
|
|
6068
|
+
(0x1F170 <= codePoint && codePoint <= 0x1F19A) ||
|
|
6069
|
+
(0xE0100 <= codePoint && codePoint <= 0xE01EF) ||
|
|
6070
|
+
(0xF0000 <= codePoint && codePoint <= 0xFFFFD) ||
|
|
6071
|
+
(0x100000 <= codePoint && codePoint <= 0x10FFFD)) {
|
|
6072
|
+
return 'A';
|
|
6073
|
+
}
|
|
6074
|
+
|
|
6075
|
+
return 'N';
|
|
6076
|
+
};
|
|
6077
|
+
|
|
6078
|
+
eaw.characterLength = function(character) {
|
|
6079
|
+
var code = this.eastAsianWidth(character);
|
|
6080
|
+
if (code == 'F' || code == 'W' || code == 'A') {
|
|
6081
|
+
return 2;
|
|
6082
|
+
} else {
|
|
6083
|
+
return 1;
|
|
6084
|
+
}
|
|
6085
|
+
};
|
|
6086
|
+
|
|
6087
|
+
// Split a string considering surrogate-pairs.
|
|
6088
|
+
function stringToArray(string) {
|
|
6089
|
+
return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
6090
|
+
}
|
|
6091
|
+
|
|
6092
|
+
eaw.length = function(string) {
|
|
6093
|
+
var characters = stringToArray(string);
|
|
6094
|
+
var len = 0;
|
|
6095
|
+
for (var i = 0; i < characters.length; i++) {
|
|
6096
|
+
len = len + this.characterLength(characters[i]);
|
|
6097
|
+
}
|
|
6098
|
+
return len;
|
|
6099
|
+
};
|
|
6100
|
+
|
|
6101
|
+
eaw.slice = function(text, start, end) {
|
|
6102
|
+
textLen = eaw.length(text);
|
|
6103
|
+
start = start ? start : 0;
|
|
6104
|
+
end = end ? end : 1;
|
|
6105
|
+
if (start < 0) {
|
|
6106
|
+
start = textLen + start;
|
|
6107
|
+
}
|
|
6108
|
+
if (end < 0) {
|
|
6109
|
+
end = textLen + end;
|
|
6110
|
+
}
|
|
6111
|
+
var result = '';
|
|
6112
|
+
var eawLen = 0;
|
|
6113
|
+
var chars = stringToArray(text);
|
|
6114
|
+
for (var i = 0; i < chars.length; i++) {
|
|
6115
|
+
var char = chars[i];
|
|
6116
|
+
var charLen = eaw.length(char);
|
|
6117
|
+
if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
|
|
6118
|
+
if (eawLen + charLen <= end) {
|
|
6119
|
+
result += char;
|
|
6120
|
+
} else {
|
|
6121
|
+
break;
|
|
6122
|
+
}
|
|
6123
|
+
}
|
|
6124
|
+
eawLen += charLen;
|
|
6125
|
+
}
|
|
6126
|
+
return result;
|
|
6127
|
+
};
|
|
6128
|
+
} (eastasianwidth));
|
|
6129
|
+
|
|
6130
|
+
var eastasianwidthExports = eastasianwidth.exports;
|
|
6131
|
+
var eastAsianWidth = /*@__PURE__*/getDefaultExportFromCjs(eastasianwidthExports);
|
|
6132
|
+
|
|
6133
|
+
var emojiRegex = function () {
|
|
6134
|
+
// https://mths.be/emoji
|
|
6135
|
+
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
6136
|
+
};
|
|
6137
|
+
|
|
6138
|
+
var emojiRegex$1 = /*@__PURE__*/getDefaultExportFromCjs(emojiRegex);
|
|
6139
|
+
|
|
6140
|
+
function stringWidth(string, options = {}) {
|
|
6141
|
+
if (typeof string !== 'string' || string.length === 0) {
|
|
6142
|
+
return 0;
|
|
6143
|
+
}
|
|
6144
|
+
|
|
6145
|
+
options = {
|
|
6146
|
+
ambiguousIsNarrow: true,
|
|
6147
|
+
...options
|
|
6148
|
+
};
|
|
6149
|
+
|
|
6150
|
+
string = stripAnsi(string);
|
|
6151
|
+
|
|
6152
|
+
if (string.length === 0) {
|
|
6153
|
+
return 0;
|
|
6154
|
+
}
|
|
6155
|
+
|
|
6156
|
+
string = string.replace(emojiRegex$1(), ' ');
|
|
6157
|
+
|
|
6158
|
+
const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
|
|
6159
|
+
let width = 0;
|
|
6160
|
+
|
|
6161
|
+
for (const character of string) {
|
|
6162
|
+
const codePoint = character.codePointAt(0);
|
|
6163
|
+
|
|
6164
|
+
// Ignore control characters
|
|
6165
|
+
if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {
|
|
6166
|
+
continue;
|
|
6167
|
+
}
|
|
6168
|
+
|
|
6169
|
+
// Ignore combining characters
|
|
6170
|
+
if (codePoint >= 0x300 && codePoint <= 0x36F) {
|
|
6171
|
+
continue;
|
|
6172
|
+
}
|
|
6173
|
+
|
|
6174
|
+
const code = eastAsianWidth.eastAsianWidth(character);
|
|
6175
|
+
switch (code) {
|
|
6176
|
+
case 'F':
|
|
6177
|
+
case 'W':
|
|
6178
|
+
width += 2;
|
|
6179
|
+
break;
|
|
6180
|
+
case 'A':
|
|
6181
|
+
width += ambiguousCharacterWidth;
|
|
6182
|
+
break;
|
|
6183
|
+
default:
|
|
6184
|
+
width += 1;
|
|
6185
|
+
}
|
|
6186
|
+
}
|
|
6187
|
+
|
|
6188
|
+
return width;
|
|
6189
|
+
}
|
|
6190
|
+
|
|
6191
|
+
const ESCAPES = new Set([
|
|
5825
6192
|
'\u001B',
|
|
5826
6193
|
'\u009B',
|
|
5827
6194
|
]);
|
|
@@ -5833,8 +6200,8 @@ const ANSI_OSC = ']';
|
|
|
5833
6200
|
const ANSI_SGR_TERMINATOR = 'm';
|
|
5834
6201
|
const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
5835
6202
|
|
|
5836
|
-
const wrapAnsiCode = code => `${ESCAPES
|
|
5837
|
-
const wrapAnsiHyperlink =
|
|
6203
|
+
const wrapAnsiCode = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
6204
|
+
const wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;
|
|
5838
6205
|
|
|
5839
6206
|
// Calculate the length of words split on ' ', ignoring
|
|
5840
6207
|
// the extra characters added by ansi escape codes
|
|
@@ -5847,7 +6214,7 @@ const wrapWord = (rows, word, columns) => {
|
|
|
5847
6214
|
|
|
5848
6215
|
let isInsideEscape = false;
|
|
5849
6216
|
let isInsideLinkEscape = false;
|
|
5850
|
-
let visible = stringWidth(stripAnsi(rows.
|
|
6217
|
+
let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
|
|
5851
6218
|
|
|
5852
6219
|
for (const [index, character] of characters.entries()) {
|
|
5853
6220
|
const characterLength = stringWidth(character);
|
|
@@ -5859,11 +6226,9 @@ const wrapWord = (rows, word, columns) => {
|
|
|
5859
6226
|
visible = 0;
|
|
5860
6227
|
}
|
|
5861
6228
|
|
|
5862
|
-
if (ESCAPES
|
|
6229
|
+
if (ESCAPES.has(character)) {
|
|
5863
6230
|
isInsideEscape = true;
|
|
5864
|
-
|
|
5865
|
-
const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join('');
|
|
5866
|
-
isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
|
|
6231
|
+
isInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK);
|
|
5867
6232
|
}
|
|
5868
6233
|
|
|
5869
6234
|
if (isInsideEscape) {
|
|
@@ -5889,7 +6254,7 @@ const wrapWord = (rows, word, columns) => {
|
|
|
5889
6254
|
|
|
5890
6255
|
// It's possible that the last row we copy over is only
|
|
5891
6256
|
// ansi escape characters, handle this edge-case
|
|
5892
|
-
if (!visible && rows.
|
|
6257
|
+
if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
|
|
5893
6258
|
rows[rows.length - 2] += rows.pop();
|
|
5894
6259
|
}
|
|
5895
6260
|
};
|
|
@@ -5914,11 +6279,11 @@ const stringVisibleTrimSpacesRight = string => {
|
|
|
5914
6279
|
return words.slice(0, last).join(' ') + words.slice(last).join('');
|
|
5915
6280
|
};
|
|
5916
6281
|
|
|
5917
|
-
// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode
|
|
6282
|
+
// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode
|
|
5918
6283
|
//
|
|
5919
|
-
// 'hard' will never allow a string to take up more than columns characters
|
|
6284
|
+
// 'hard' will never allow a string to take up more than columns characters
|
|
5920
6285
|
//
|
|
5921
|
-
// 'soft' allows long words to expand past the column length
|
|
6286
|
+
// 'soft' allows long words to expand past the column length
|
|
5922
6287
|
const exec = (string, columns, options = {}) => {
|
|
5923
6288
|
if (options.trim !== false && string.trim() === '') {
|
|
5924
6289
|
return '';
|
|
@@ -5933,10 +6298,10 @@ const exec = (string, columns, options = {}) => {
|
|
|
5933
6298
|
|
|
5934
6299
|
for (const [index, word] of string.split(' ').entries()) {
|
|
5935
6300
|
if (options.trim !== false) {
|
|
5936
|
-
rows[rows.length - 1] = rows.
|
|
6301
|
+
rows[rows.length - 1] = rows[rows.length - 1].trimStart();
|
|
5937
6302
|
}
|
|
5938
6303
|
|
|
5939
|
-
let rowLength = stringWidth(rows.
|
|
6304
|
+
let rowLength = stringWidth(rows[rows.length - 1]);
|
|
5940
6305
|
|
|
5941
6306
|
if (index !== 0) {
|
|
5942
6307
|
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
@@ -5985,17 +6350,13 @@ const exec = (string, columns, options = {}) => {
|
|
|
5985
6350
|
rows = rows.map(row => stringVisibleTrimSpacesRight(row));
|
|
5986
6351
|
}
|
|
5987
6352
|
|
|
5988
|
-
const
|
|
5989
|
-
const pre = [...preString];
|
|
5990
|
-
|
|
5991
|
-
// We need to keep a separate index as `String#slice()` works on Unicode code units, while `pre` is an array of codepoints.
|
|
5992
|
-
let preStringIndex = 0;
|
|
6353
|
+
const pre = [...rows.join('\n')];
|
|
5993
6354
|
|
|
5994
6355
|
for (const [index, character] of pre.entries()) {
|
|
5995
6356
|
returnValue += character;
|
|
5996
6357
|
|
|
5997
|
-
if (ESCAPES
|
|
5998
|
-
const {groups} = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(
|
|
6358
|
+
if (ESCAPES.has(character)) {
|
|
6359
|
+
const {groups} = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}};
|
|
5999
6360
|
if (groups.code !== undefined) {
|
|
6000
6361
|
const code = Number.parseFloat(groups.code);
|
|
6001
6362
|
escapeCode = code === END_CODE ? undefined : code;
|
|
@@ -6023,8 +6384,6 @@ const exec = (string, columns, options = {}) => {
|
|
|
6023
6384
|
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
6024
6385
|
}
|
|
6025
6386
|
}
|
|
6026
|
-
|
|
6027
|
-
preStringIndex += character.length;
|
|
6028
6387
|
}
|
|
6029
6388
|
|
|
6030
6389
|
return returnValue;
|
|
@@ -6034,185 +6393,12 @@ const exec = (string, columns, options = {}) => {
|
|
|
6034
6393
|
function wrapAnsi(string, columns, options) {
|
|
6035
6394
|
return String(string)
|
|
6036
6395
|
.normalize()
|
|
6037
|
-
.
|
|
6396
|
+
.replace(/\r\n/g, '\n')
|
|
6038
6397
|
.split('\n')
|
|
6039
6398
|
.map(line => exec(line, columns, options))
|
|
6040
6399
|
.join('\n');
|
|
6041
6400
|
}
|
|
6042
6401
|
|
|
6043
|
-
function isFullwidthCodePoint(codePoint) {
|
|
6044
|
-
if (!Number.isInteger(codePoint)) {
|
|
6045
|
-
return false;
|
|
6046
|
-
}
|
|
6047
|
-
|
|
6048
|
-
return eastAsianWidth(codePoint) === 2;
|
|
6049
|
-
}
|
|
6050
|
-
|
|
6051
|
-
// \x1b and \x9b
|
|
6052
|
-
const ESCAPES = new Set([27, 155]);
|
|
6053
|
-
|
|
6054
|
-
const CODE_POINT_0 = '0'.codePointAt(0);
|
|
6055
|
-
const CODE_POINT_9 = '9'.codePointAt(0);
|
|
6056
|
-
|
|
6057
|
-
const endCodesSet = new Set();
|
|
6058
|
-
const endCodesMap = new Map();
|
|
6059
|
-
for (const [start, end] of ansiStyles.codes) {
|
|
6060
|
-
endCodesSet.add(ansiStyles.color.ansi(end));
|
|
6061
|
-
endCodesMap.set(ansiStyles.color.ansi(start), ansiStyles.color.ansi(end));
|
|
6062
|
-
}
|
|
6063
|
-
|
|
6064
|
-
function getEndCode(code) {
|
|
6065
|
-
if (endCodesSet.has(code)) {
|
|
6066
|
-
return code;
|
|
6067
|
-
}
|
|
6068
|
-
|
|
6069
|
-
if (endCodesMap.has(code)) {
|
|
6070
|
-
return endCodesMap.get(code);
|
|
6071
|
-
}
|
|
6072
|
-
|
|
6073
|
-
code = code.slice(2);
|
|
6074
|
-
if (code.includes(';')) {
|
|
6075
|
-
code = code[0] + '0';
|
|
6076
|
-
}
|
|
6077
|
-
|
|
6078
|
-
const returnValue = ansiStyles.codes.get(Number.parseInt(code, 10));
|
|
6079
|
-
if (returnValue) {
|
|
6080
|
-
return ansiStyles.color.ansi(returnValue);
|
|
6081
|
-
}
|
|
6082
|
-
|
|
6083
|
-
return ansiStyles.reset.open;
|
|
6084
|
-
}
|
|
6085
|
-
|
|
6086
|
-
function findNumberIndex(string) {
|
|
6087
|
-
for (let index = 0; index < string.length; index++) {
|
|
6088
|
-
const codePoint = string.codePointAt(index);
|
|
6089
|
-
if (codePoint >= CODE_POINT_0 && codePoint <= CODE_POINT_9) {
|
|
6090
|
-
return index;
|
|
6091
|
-
}
|
|
6092
|
-
}
|
|
6093
|
-
|
|
6094
|
-
return -1;
|
|
6095
|
-
}
|
|
6096
|
-
|
|
6097
|
-
function parseAnsiCode(string, offset) {
|
|
6098
|
-
string = string.slice(offset, offset + 19);
|
|
6099
|
-
const startIndex = findNumberIndex(string);
|
|
6100
|
-
if (startIndex !== -1) {
|
|
6101
|
-
let endIndex = string.indexOf('m', startIndex);
|
|
6102
|
-
if (endIndex === -1) {
|
|
6103
|
-
endIndex = string.length;
|
|
6104
|
-
}
|
|
6105
|
-
|
|
6106
|
-
return string.slice(0, endIndex + 1);
|
|
6107
|
-
}
|
|
6108
|
-
}
|
|
6109
|
-
|
|
6110
|
-
function tokenize(string, endCharacter = Number.POSITIVE_INFINITY) {
|
|
6111
|
-
const returnValue = [];
|
|
6112
|
-
|
|
6113
|
-
let index = 0;
|
|
6114
|
-
let visibleCount = 0;
|
|
6115
|
-
while (index < string.length) {
|
|
6116
|
-
const codePoint = string.codePointAt(index);
|
|
6117
|
-
|
|
6118
|
-
if (ESCAPES.has(codePoint)) {
|
|
6119
|
-
const code = parseAnsiCode(string, index);
|
|
6120
|
-
if (code) {
|
|
6121
|
-
returnValue.push({
|
|
6122
|
-
type: 'ansi',
|
|
6123
|
-
code,
|
|
6124
|
-
endCode: getEndCode(code),
|
|
6125
|
-
});
|
|
6126
|
-
index += code.length;
|
|
6127
|
-
continue;
|
|
6128
|
-
}
|
|
6129
|
-
}
|
|
6130
|
-
|
|
6131
|
-
const isFullWidth = isFullwidthCodePoint(codePoint);
|
|
6132
|
-
const character = String.fromCodePoint(codePoint);
|
|
6133
|
-
|
|
6134
|
-
returnValue.push({
|
|
6135
|
-
type: 'character',
|
|
6136
|
-
value: character,
|
|
6137
|
-
isFullWidth,
|
|
6138
|
-
});
|
|
6139
|
-
|
|
6140
|
-
index += character.length;
|
|
6141
|
-
visibleCount += isFullWidth ? 2 : character.length;
|
|
6142
|
-
|
|
6143
|
-
if (visibleCount >= endCharacter) {
|
|
6144
|
-
break;
|
|
6145
|
-
}
|
|
6146
|
-
}
|
|
6147
|
-
|
|
6148
|
-
return returnValue;
|
|
6149
|
-
}
|
|
6150
|
-
|
|
6151
|
-
function reduceAnsiCodes(codes) {
|
|
6152
|
-
let returnValue = [];
|
|
6153
|
-
|
|
6154
|
-
for (const code of codes) {
|
|
6155
|
-
if (code.code === ansiStyles.reset.open) {
|
|
6156
|
-
// Reset code, disable all codes
|
|
6157
|
-
returnValue = [];
|
|
6158
|
-
} else if (endCodesSet.has(code.code)) {
|
|
6159
|
-
// This is an end code, disable all matching start codes
|
|
6160
|
-
returnValue = returnValue.filter(returnValueCode => returnValueCode.endCode !== code.code);
|
|
6161
|
-
} else {
|
|
6162
|
-
// This is a start code. Disable all styles this "overrides", then enable it
|
|
6163
|
-
returnValue = returnValue.filter(returnValueCode => returnValueCode.endCode !== code.endCode);
|
|
6164
|
-
returnValue.push(code);
|
|
6165
|
-
}
|
|
6166
|
-
}
|
|
6167
|
-
|
|
6168
|
-
return returnValue;
|
|
6169
|
-
}
|
|
6170
|
-
|
|
6171
|
-
function undoAnsiCodes(codes) {
|
|
6172
|
-
const reduced = reduceAnsiCodes(codes);
|
|
6173
|
-
const endCodes = reduced.map(({endCode}) => endCode);
|
|
6174
|
-
return endCodes.reverse().join('');
|
|
6175
|
-
}
|
|
6176
|
-
|
|
6177
|
-
function sliceAnsi(string, start, end) {
|
|
6178
|
-
const tokens = tokenize(string, end);
|
|
6179
|
-
let activeCodes = [];
|
|
6180
|
-
let position = 0;
|
|
6181
|
-
let returnValue = '';
|
|
6182
|
-
let include = false;
|
|
6183
|
-
|
|
6184
|
-
for (const token of tokens) {
|
|
6185
|
-
if (end !== undefined && position >= end) {
|
|
6186
|
-
break;
|
|
6187
|
-
}
|
|
6188
|
-
|
|
6189
|
-
if (token.type === 'ansi') {
|
|
6190
|
-
activeCodes.push(token);
|
|
6191
|
-
if (include) {
|
|
6192
|
-
returnValue += token.code;
|
|
6193
|
-
}
|
|
6194
|
-
} else {
|
|
6195
|
-
// Character
|
|
6196
|
-
if (!include && position >= start) {
|
|
6197
|
-
include = true;
|
|
6198
|
-
// Simplify active codes
|
|
6199
|
-
activeCodes = reduceAnsiCodes(activeCodes);
|
|
6200
|
-
returnValue = activeCodes.map(({code}) => code).join('');
|
|
6201
|
-
}
|
|
6202
|
-
|
|
6203
|
-
if (include) {
|
|
6204
|
-
returnValue += token.value;
|
|
6205
|
-
}
|
|
6206
|
-
|
|
6207
|
-
position += token.isFullWidth ? 2 : token.value.length;
|
|
6208
|
-
}
|
|
6209
|
-
}
|
|
6210
|
-
|
|
6211
|
-
// Disable active codes at the end
|
|
6212
|
-
returnValue += undoAnsiCodes(activeCodes);
|
|
6213
|
-
return returnValue;
|
|
6214
|
-
}
|
|
6215
|
-
|
|
6216
6402
|
const defaultTerminalHeight = 24;
|
|
6217
6403
|
|
|
6218
6404
|
const getWidth = stream => {
|
|
@@ -6226,7 +6412,7 @@ const getWidth = stream => {
|
|
|
6226
6412
|
};
|
|
6227
6413
|
|
|
6228
6414
|
const fitToTerminalHeight = (stream, text) => {
|
|
6229
|
-
const terminalHeight = stream.rows
|
|
6415
|
+
const terminalHeight = stream.rows || defaultTerminalHeight;
|
|
6230
6416
|
const lines = text.split('\n');
|
|
6231
6417
|
|
|
6232
6418
|
const toRemove = lines.length - terminalHeight;
|
|
@@ -6292,7 +6478,7 @@ createLogUpdate(process$2.stdout);
|
|
|
6292
6478
|
|
|
6293
6479
|
createLogUpdate(process$2.stderr);
|
|
6294
6480
|
|
|
6295
|
-
var version = "1.0
|
|
6481
|
+
var version = "1.1.0";
|
|
6296
6482
|
|
|
6297
6483
|
async function printError(error, project, options) {
|
|
6298
6484
|
const { showCodeFrame = true, fullStack = false, type } = options;
|
|
@@ -7156,7 +7342,7 @@ function WorkspaceVitestPlugin(project, options) {
|
|
|
7156
7342
|
let name = testConfig.name;
|
|
7157
7343
|
if (!name) {
|
|
7158
7344
|
if (typeof options.workspacePath === "string")
|
|
7159
|
-
name =
|
|
7345
|
+
name = basename(options.workspacePath.endsWith("/") ? options.workspacePath.slice(0, -1) : dirname(options.workspacePath));
|
|
7160
7346
|
else
|
|
7161
7347
|
name = options.workspacePath.toString();
|
|
7162
7348
|
}
|
|
@@ -7277,16 +7463,17 @@ async function loadGlobalSetupFile(file, runner) {
|
|
|
7277
7463
|
}
|
|
7278
7464
|
|
|
7279
7465
|
async function initializeProject(workspacePath, ctx, options) {
|
|
7466
|
+
var _a;
|
|
7280
7467
|
const project = new WorkspaceProject(workspacePath, ctx);
|
|
7281
7468
|
const configFile = options.extends ? resolve(dirname(options.workspaceConfigPath), options.extends) : typeof workspacePath === "number" || workspacePath.endsWith("/") ? false : workspacePath;
|
|
7282
|
-
const root = options.root || (typeof workspacePath === "number" ? void 0 : dirname(workspacePath));
|
|
7469
|
+
const root = options.root || (typeof workspacePath === "number" ? void 0 : workspacePath.endsWith("/") ? workspacePath : dirname(workspacePath));
|
|
7283
7470
|
const config = {
|
|
7284
7471
|
...options,
|
|
7285
7472
|
root,
|
|
7286
7473
|
logLevel: "error",
|
|
7287
7474
|
configFile,
|
|
7288
7475
|
// this will make "mode": "test" | "benchmark" inside defineConfig
|
|
7289
|
-
mode: options.mode || ctx.config.mode,
|
|
7476
|
+
mode: ((_a = options.test) == null ? void 0 : _a.mode) || options.mode || ctx.config.mode,
|
|
7290
7477
|
plugins: [
|
|
7291
7478
|
...options.plugins || [],
|
|
7292
7479
|
WorkspaceVitestPlugin(project, { ...options, root, workspacePath })
|
|
@@ -7555,9 +7742,8 @@ ${c.red(divider(c.bold(c.inverse(" Error during global setup "))))}`);
|
|
|
7555
7742
|
this.closingPromise = Promise.all([
|
|
7556
7743
|
this.server.close(),
|
|
7557
7744
|
(_a = this.typechecker) == null ? void 0 : _a.stop(),
|
|
7558
|
-
(_b = this.browser) == null ? void 0 : _b.close()
|
|
7559
|
-
|
|
7560
|
-
].filter(Boolean));
|
|
7745
|
+
(_b = this.browser) == null ? void 0 : _b.close()
|
|
7746
|
+
].filter(Boolean)).then(() => this._provided = {});
|
|
7561
7747
|
}
|
|
7562
7748
|
return this.closingPromise;
|
|
7563
7749
|
}
|
|
@@ -7698,15 +7884,22 @@ class Vitest {
|
|
|
7698
7884
|
const projectName = task.projectName || ((_a = task == null ? void 0 : task.file) == null ? void 0 : _a.projectName);
|
|
7699
7885
|
return this.projects.find((p) => p.getName() === projectName) || this.getCoreWorkspaceProject() || this.projects[0];
|
|
7700
7886
|
}
|
|
7701
|
-
async
|
|
7887
|
+
async getWorkspaceConfigPath() {
|
|
7888
|
+
if (this.config.workspace)
|
|
7889
|
+
return this.config.workspace;
|
|
7702
7890
|
const configDir = this.server.config.configFile ? dirname(this.server.config.configFile) : this.config.root;
|
|
7703
7891
|
const rootFiles = await promises.readdir(configDir);
|
|
7704
7892
|
const workspaceConfigName = workspacesFiles.find((configFile) => {
|
|
7705
7893
|
return rootFiles.includes(configFile);
|
|
7706
7894
|
});
|
|
7707
7895
|
if (!workspaceConfigName)
|
|
7896
|
+
return null;
|
|
7897
|
+
return join(configDir, workspaceConfigName);
|
|
7898
|
+
}
|
|
7899
|
+
async resolveWorkspace(cliOptions) {
|
|
7900
|
+
const workspaceConfigPath = await this.getWorkspaceConfigPath();
|
|
7901
|
+
if (!workspaceConfigPath)
|
|
7708
7902
|
return [await this.createCoreProject()];
|
|
7709
|
-
const workspaceConfigPath = join(configDir, workspaceConfigName);
|
|
7710
7903
|
const workspaceModule = await this.runner.executeFile(workspaceConfigPath);
|
|
7711
7904
|
if (!workspaceModule.default || !Array.isArray(workspaceModule.default))
|
|
7712
7905
|
throw new Error(`Workspace config file ${workspaceConfigPath} must export a default array of project paths.`);
|
|
@@ -7745,7 +7938,7 @@ class Vitest {
|
|
|
7745
7938
|
return filepath;
|
|
7746
7939
|
}));
|
|
7747
7940
|
const workspacesByFolder = resolvedWorkspacesPaths.reduce((configByFolder, filepath) => {
|
|
7748
|
-
const dir = dirname(filepath);
|
|
7941
|
+
const dir = filepath.endsWith("/") ? filepath.slice(0, -1) : dirname(filepath);
|
|
7749
7942
|
configByFolder[dir] ?? (configByFolder[dir] = []);
|
|
7750
7943
|
configByFolder[dir].push(filepath);
|
|
7751
7944
|
return configByFolder;
|
|
@@ -7763,8 +7956,12 @@ class Vitest {
|
|
|
7763
7956
|
"testTimeout",
|
|
7764
7957
|
"pool",
|
|
7765
7958
|
"globals",
|
|
7766
|
-
"
|
|
7767
|
-
"
|
|
7959
|
+
"expandSnapshotDiff",
|
|
7960
|
+
"retry",
|
|
7961
|
+
"testNamePattern",
|
|
7962
|
+
"passWithNoTests",
|
|
7963
|
+
"bail",
|
|
7964
|
+
"isolate"
|
|
7768
7965
|
];
|
|
7769
7966
|
const cliOverrides = overridesOptions.reduce((acc, name) => {
|
|
7770
7967
|
if (name in cliOptions)
|
|
@@ -8249,7 +8446,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
|
|
|
8249
8446
|
this.meta.watchMode = false;
|
|
8250
8447
|
},
|
|
8251
8448
|
async config(viteConfig) {
|
|
8252
|
-
var _a, _b, _c, _d;
|
|
8449
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
8253
8450
|
if (options.watch) {
|
|
8254
8451
|
options = deepMerge({}, userConfig);
|
|
8255
8452
|
}
|
|
@@ -8260,13 +8457,18 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
|
|
|
8260
8457
|
removeUndefinedValues(viteConfig.test ?? {})
|
|
8261
8458
|
);
|
|
8262
8459
|
testConfig.api = resolveApiServerConfig(testConfig);
|
|
8460
|
+
testConfig.poolOptions ?? (testConfig.poolOptions = {});
|
|
8461
|
+
(_a = testConfig.poolOptions).threads ?? (_a.threads = {});
|
|
8462
|
+
(_b = testConfig.poolOptions).forks ?? (_b.forks = {});
|
|
8463
|
+
testConfig.poolOptions.threads.isolate = ((_d = (_c = options.poolOptions) == null ? void 0 : _c.threads) == null ? void 0 : _d.isolate) ?? options.isolate ?? testConfig.poolOptions.threads.isolate ?? ((_e = viteConfig.test) == null ? void 0 : _e.isolate);
|
|
8464
|
+
testConfig.poolOptions.forks.isolate = ((_g = (_f = options.poolOptions) == null ? void 0 : _f.forks) == null ? void 0 : _g.isolate) ?? options.isolate ?? testConfig.poolOptions.forks.isolate ?? ((_h = viteConfig.test) == null ? void 0 : _h.isolate);
|
|
8263
8465
|
const defines = deleteDefineConfig(viteConfig);
|
|
8264
8466
|
options.defines = defines;
|
|
8265
8467
|
let open = false;
|
|
8266
8468
|
if (testConfig.ui && testConfig.open)
|
|
8267
8469
|
open = testConfig.uiBase ?? "/__vitest__/";
|
|
8268
8470
|
const config = {
|
|
8269
|
-
root: ((
|
|
8471
|
+
root: ((_i = viteConfig.test) == null ? void 0 : _i.root) || options.root,
|
|
8270
8472
|
esbuild: viteConfig.esbuild === false ? false : {
|
|
8271
8473
|
sourcemap: "external",
|
|
8272
8474
|
// Enables using ignore hint for coverage providers with @preserve keyword
|
|
@@ -8290,16 +8492,19 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
|
|
|
8290
8492
|
fs: {
|
|
8291
8493
|
allow: resolveFsAllow(getRoot(), testConfig.config)
|
|
8292
8494
|
}
|
|
8495
|
+
},
|
|
8496
|
+
test: {
|
|
8497
|
+
poolOptions: testConfig.poolOptions
|
|
8293
8498
|
}
|
|
8294
8499
|
};
|
|
8295
8500
|
if (process.platform === "darwin" && process.env.VITE_TEST_WATCHER_DEBUG) {
|
|
8296
8501
|
config.server.watch.useFsEvents = false;
|
|
8297
8502
|
config.server.watch.usePolling = false;
|
|
8298
8503
|
}
|
|
8299
|
-
const classNameStrategy = typeof testConfig.css !== "boolean" && ((
|
|
8504
|
+
const classNameStrategy = typeof testConfig.css !== "boolean" && ((_k = (_j = testConfig.css) == null ? void 0 : _j.modules) == null ? void 0 : _k.classNameStrategy) || "stable";
|
|
8300
8505
|
if (classNameStrategy !== "scoped") {
|
|
8301
8506
|
config.css ?? (config.css = {});
|
|
8302
|
-
(
|
|
8507
|
+
(_l = config.css).modules ?? (_l.modules = {});
|
|
8303
8508
|
if (config.css.modules) {
|
|
8304
8509
|
config.css.modules.generateScopedName = (name, filename) => {
|
|
8305
8510
|
const root = getRoot();
|
|
@@ -14686,7 +14891,7 @@ function registerConsoleShortcuts(ctx) {
|
|
|
14686
14891
|
}
|
|
14687
14892
|
return ctx.exit(true);
|
|
14688
14893
|
}
|
|
14689
|
-
if (!isWindows
|
|
14894
|
+
if (!isWindows && key && key.ctrl && key.name === "z") {
|
|
14690
14895
|
process.kill(process.ppid, "SIGTSTP");
|
|
14691
14896
|
process.kill(process.pid, "SIGTSTP");
|
|
14692
14897
|
return;
|