From 006a7c65085e7b4cc9def0c2ec506b8aa772a38e Mon Sep 17 00:00:00 2001 From: rrd108 Date: Wed, 14 Aug 2024 17:36:58 +0200 Subject: [PATCH] chore changes for #134 --- dist/cli.js | 2 + dist/vue-mess-detector.es.js | 1207 +++++++++++++++++---------------- dist/vue-mess-detector.umd.js | 54 +- src/cli.js | 2 + 4 files changed, 660 insertions(+), 605 deletions(-) diff --git a/dist/cli.js b/dist/cli.js index 28030c63..ecd4dccd 100755 --- a/dist/cli.js +++ b/dist/cli.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + import path from 'node:path' import { fileURLToPath } from 'node:url' diff --git a/dist/vue-mess-detector.es.js b/dist/vue-mess-detector.es.js index 2c14a08e..284cfb60 100644 --- a/dist/vue-mess-detector.es.js +++ b/dist/vue-mess-detector.es.js @@ -1,38 +1,38 @@ -import Jt from "yargs"; -import { format as St, inspect as en } from "util"; -import { normalize as tn, resolve as ee, dirname as Ne, basename as nn, extname as sn, relative as on } from "path"; -import { readFileSync as ct, statSync as xt, readdirSync as rn, writeFile as cn } from "fs"; -import { notStrictEqual as an, strictEqual as ln } from "assert"; -import { fileURLToPath as un } from "url"; -import Ce from "node:fs/promises"; -import at from "node:path"; -import { parse as fn } from "@vue/compiler-sfc"; -class oe extends Error { +import tn from "yargs"; +import { format as Ot, inspect as nn } from "util"; +import { normalize as sn, resolve as ne, dirname as Re, basename as on, extname as rn, relative as cn } from "path"; +import { readFileSync as lt, statSync as _t, readdirSync as an, writeFile as ln } from "fs"; +import { notStrictEqual as un, strictEqual as fn } from "assert"; +import { fileURLToPath as hn } from "url"; +import Se from "node:fs/promises"; +import ut from "node:path"; +import { parse as pn } from "@vue/compiler-sfc"; +class ie extends Error { constructor(t) { - super(t || "yargs error"), this.name = "YError", Error.captureStackTrace && Error.captureStackTrace(this, oe); + super(t || "yargs error"), this.name = "YError", Error.captureStackTrace && Error.captureStackTrace(this, ie); } } -function Ot() { - return hn() ? 0 : 1; -} -function hn() { - return mn() && !process.defaultApp; +function Nt() { + return mn() ? 0 : 1; } function mn() { + return dn() && !process.defaultApp; +} +function dn() { return !!process.versions.electron; } -function pn(e) { - return e.slice(Ot() + 1); +function gn(e) { + return e.slice(Nt() + 1); } -function dn() { - return process.argv[Ot()]; +function $n() { + return process.argv[Nt()]; } /** * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */ -function se(e) { +function re(e) { if (e !== e.toLowerCase() && e !== e.toUpperCase() || (e = e.toLowerCase()), e.indexOf("-") === -1 && e.indexOf("_") === -1) return e; { @@ -45,7 +45,7 @@ function se(e) { return n; } } -function _t(e, t) { +function jt(e, t) { const n = e.toLowerCase(); t = t || "-"; let s = ""; @@ -55,7 +55,7 @@ function _t(e, t) { } return s; } -function Nt(e) { +function Rt(e) { return e == null ? !1 : typeof e == "number" || /^0x[0-9a-f]+$/i.test(e) ? !0 : /^0[^.]/.test(e) ? !1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e); } /** @@ -63,7 +63,7 @@ function Nt(e) { * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */ -function gn(e) { +function bn(e) { if (Array.isArray(e)) return e.map((u) => typeof u != "string" ? u + "" : u); e = e.trim(); @@ -83,19 +83,19 @@ function gn(e) { * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */ -var V; +var U; (function(e) { e.BOOLEAN = "boolean", e.STRING = "string", e.NUMBER = "number", e.ARRAY = "array"; -})(V || (V = {})); +})(U || (U = {})); /** * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */ -let K; -class $n { +let Q; +class yn { constructor(t) { - K = t; + Q = t; } parse(t, n) { const s = Object.assign({ @@ -115,7 +115,7 @@ class $n { number: void 0, __: void 0, key: void 0 - }, n), o = gn(t), a = typeof t == "string", u = bn(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), h = Object.assign({ + }, n), o = bn(t), a = typeof t == "string", u = En(Object.assign(/* @__PURE__ */ Object.create(null), s.alias)), h = Object.assign({ "boolean-negation": !0, "camel-case-expansion": !0, "combine-arrays": !1, @@ -134,7 +134,7 @@ class $n { "strip-aliased": !1, "strip-dashed": !1, "unknown-options-as-args": !1 - }, s.configuration), w = Object.assign(/* @__PURE__ */ Object.create(null), s.default), x = s.configObjects || [], C = s.envPrefix, L = h["populate--"], I = L ? "--" : "_", le = /* @__PURE__ */ Object.create(null), lt = /* @__PURE__ */ Object.create(null), Y = s.__ || K.format, f = { + }, s.configuration), y = Object.assign(/* @__PURE__ */ Object.create(null), s.default), x = s.configObjects || [], S = s.envPrefix, L = h["populate--"], B = L ? "--" : "_", he = /* @__PURE__ */ Object.create(null), ft = /* @__PURE__ */ Object.create(null), J = s.__ || Q.format, f = { aliases: /* @__PURE__ */ Object.create(null), arrays: /* @__PURE__ */ Object.create(null), bools: /* @__PURE__ */ Object.create(null), @@ -146,16 +146,16 @@ class $n { nargs: /* @__PURE__ */ Object.create(null), coercions: /* @__PURE__ */ Object.create(null), keys: [] - }, G = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, Ee = new RegExp("^--" + h["negation-prefix"] + "(.+)"); + }, G = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/, ve = new RegExp("^--" + h["negation-prefix"] + "(.+)"); [].concat(s.array || []).filter(Boolean).forEach(function(r) { - const c = typeof r == "object" ? r.key : r, m = Object.keys(r).map(function(l) { + const c = typeof r == "object" ? r.key : r, p = Object.keys(r).map(function(l) { return { boolean: "bools", string: "strings", number: "numbers" }[l]; }).filter(Boolean).pop(); - m && (f[m][c] = !0), f.arrays[c] = !0, f.keys.push(c); + p && (f[p][c] = !0), f.arrays[c] = !0, f.keys.push(c); }), [].concat(s.boolean || []).filter(Boolean).forEach(function(r) { f.bools[r] = !0, f.keys.push(r); }), [].concat(s.string || []).filter(Boolean).forEach(function(r) { @@ -174,337 +174,337 @@ class $n { f.configs[r] = !0; }) : typeof s.config == "object" && Object.entries(s.config).forEach(([r, c]) => { (typeof c == "boolean" || typeof c == "function") && (f.configs[r] = c); - })), qt(s.key, u, s.default, f.arrays), Object.keys(w).forEach(function(r) { + })), Qt(s.key, u, s.default, f.arrays), Object.keys(y).forEach(function(r) { (f.aliases[r] || []).forEach(function(c) { - w[c] = w[r]; + y[c] = y[r]; }); }); - let k = null; - Zt(); - let ue = []; - const j = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), ut = {}; + let z = null; + en(); + let pe = []; + const j = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }), ht = {}; for (let r = 0; r < o.length; r++) { - const c = o[r], m = c.replace(/^-{3,}/, "---"); - let l, i, g, p, $, R; - if (c !== "--" && /^-/.test(c) && pe(c)) - we(c); - else if (m.match(/^---+(=|$)/)) { - we(c); + const c = o[r], p = c.replace(/^-{3,}/, "---"); + let l, i, g, m, $, R; + if (c !== "--" && /^-/.test(c) && $e(c)) + Ae(c); + else if (p.match(/^---+(=|$)/)) { + Ae(c); continue; } else if (c.match(/^--.+=/) || !h["short-option-groups"] && c.match(/^-.+=/)) - p = c.match(/^--?([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && (y(p[1], f.arrays) ? r = he(r, p[1], o, p[2]) : y(p[1], f.nargs) !== !1 ? r = fe(r, p[1], o, p[2]) : O(p[1], p[2], !0)); - else if (c.match(Ee) && h["boolean-negation"]) - p = c.match(Ee), p !== null && Array.isArray(p) && p.length >= 2 && (i = p[1], O(i, y(i, f.arrays) ? [!1] : !1)); + m = c.match(/^--?([^=]+)=([\s\S]*)$/), m !== null && Array.isArray(m) && m.length >= 3 && (w(m[1], f.arrays) ? r = de(r, m[1], o, m[2]) : w(m[1], f.nargs) !== !1 ? r = me(r, m[1], o, m[2]) : _(m[1], m[2], !0)); + else if (c.match(ve) && h["boolean-negation"]) + m = c.match(ve), m !== null && Array.isArray(m) && m.length >= 2 && (i = m[1], _(i, w(i, f.arrays) ? [!1] : !1)); else if (c.match(/^--.+/) || !h["short-option-groups"] && c.match(/^-[^-]+/)) - p = c.match(/^--?(.+)/), p !== null && Array.isArray(p) && p.length >= 2 && (i = p[1], y(i, f.arrays) ? r = he(r, i, o) : y(i, f.nargs) !== !1 ? r = fe(r, i, o) : ($ = o[r + 1], $ !== void 0 && (!$.match(/^-/) || $.match(G)) && !y(i, f.bools) && !y(i, f.counts) || /^(true|false)$/.test($) ? (O(i, $), r++) : O(i, J(i)))); + m = c.match(/^--?(.+)/), m !== null && Array.isArray(m) && m.length >= 2 && (i = m[1], w(i, f.arrays) ? r = de(r, i, o) : w(i, f.nargs) !== !1 ? r = me(r, i, o) : ($ = o[r + 1], $ !== void 0 && (!$.match(/^-/) || $.match(G)) && !w(i, f.bools) && !w(i, f.counts) || /^(true|false)$/.test($) ? (_(i, $), r++) : _(i, te(i)))); else if (c.match(/^-.\..+=/)) - p = c.match(/^-([^=]+)=([\s\S]*)$/), p !== null && Array.isArray(p) && p.length >= 3 && O(p[1], p[2]); + m = c.match(/^-([^=]+)=([\s\S]*)$/), m !== null && Array.isArray(m) && m.length >= 3 && _(m[1], m[2]); else if (c.match(/^-.\..+/) && !c.match(G)) - $ = o[r + 1], p = c.match(/^-(.\..+)/), p !== null && Array.isArray(p) && p.length >= 2 && (i = p[1], $ !== void 0 && !$.match(/^-/) && !y(i, f.bools) && !y(i, f.counts) ? (O(i, $), r++) : O(i, J(i))); + $ = o[r + 1], m = c.match(/^-(.\..+)/), m !== null && Array.isArray(m) && m.length >= 2 && (i = m[1], $ !== void 0 && !$.match(/^-/) && !w(i, f.bools) && !w(i, f.counts) ? (_(i, $), r++) : _(i, te(i))); else if (c.match(/^-[^-]+/) && !c.match(G)) { g = c.slice(1, -1).split(""), l = !1; for (let F = 0; F < g.length; F++) { if ($ = c.slice(F + 2), g[F + 1] && g[F + 1] === "=") { - R = c.slice(F + 3), i = g[F], y(i, f.arrays) ? r = he(r, i, o, R) : y(i, f.nargs) !== !1 ? r = fe(r, i, o, R) : O(i, R), l = !0; + R = c.slice(F + 3), i = g[F], w(i, f.arrays) ? r = de(r, i, o, R) : w(i, f.nargs) !== !1 ? r = me(r, i, o, R) : _(i, R), l = !0; break; } if ($ === "-") { - O(g[F], $); + _(g[F], $); continue; } - if (/[A-Za-z]/.test(g[F]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test($) && y($, f.bools) === !1) { - O(g[F], $), l = !0; + if (/[A-Za-z]/.test(g[F]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test($) && w($, f.bools) === !1) { + _(g[F], $), l = !0; break; } if (g[F + 1] && g[F + 1].match(/\W/)) { - O(g[F], $), l = !0; + _(g[F], $), l = !0; break; } else - O(g[F], J(g[F])); + _(g[F], te(g[F])); } - i = c.slice(-1)[0], !l && i !== "-" && (y(i, f.arrays) ? r = he(r, i, o) : y(i, f.nargs) !== !1 ? r = fe(r, i, o) : ($ = o[r + 1], $ !== void 0 && (!/^(-|--)[^-]/.test($) || $.match(G)) && !y(i, f.bools) && !y(i, f.counts) || /^(true|false)$/.test($) ? (O(i, $), r++) : O(i, J(i)))); - } else if (c.match(/^-[0-9]$/) && c.match(G) && y(c.slice(1), f.bools)) - i = c.slice(1), O(i, J(i)); + i = c.slice(-1)[0], !l && i !== "-" && (w(i, f.arrays) ? r = de(r, i, o) : w(i, f.nargs) !== !1 ? r = me(r, i, o) : ($ = o[r + 1], $ !== void 0 && (!/^(-|--)[^-]/.test($) || $.match(G)) && !w(i, f.bools) && !w(i, f.counts) || /^(true|false)$/.test($) ? (_(i, $), r++) : _(i, te(i)))); + } else if (c.match(/^-[0-9]$/) && c.match(G) && w(c.slice(1), f.bools)) + i = c.slice(1), _(i, te(i)); else if (c === "--") { - ue = o.slice(r + 1); + pe = o.slice(r + 1); break; } else if (h["halt-at-non-option"]) { - ue = o.slice(r); + pe = o.slice(r); break; } else - we(c); + Ae(c); } - ht(j, !0), ht(j, !1), Ut(j), Vt(), mt(j, f.aliases, w, !0), Dt(j), h["set-placeholder-key"] && Gt(j), Object.keys(f.counts).forEach(function(r) { - te(j, r.split(".")) || O(r, 0); - }), L && ue.length && (j[I] = []), ue.forEach(function(r) { - j[I].push(r); + mt(j, !0), mt(j, !1), Vt(j), Gt(), dt(j, f.aliases, y, !0), qt(j), h["set-placeholder-key"] && Kt(j), Object.keys(f.counts).forEach(function(r) { + se(j, r.split(".")) || _(r, 0); + }), L && pe.length && (j[B] = []), pe.forEach(function(r) { + j[B].push(r); }), h["camel-case-expansion"] && h["strip-dashed"] && Object.keys(j).filter((r) => r !== "--" && r.includes("-")).forEach((r) => { delete j[r]; }), h["strip-aliased"] && [].concat(...Object.keys(u).map((r) => u[r])).forEach((r) => { - h["camel-case-expansion"] && r.includes("-") && delete j[r.split(".").map((c) => se(c)).join(".")], delete j[r]; + h["camel-case-expansion"] && r.includes("-") && delete j[r.split(".").map((c) => re(c)).join(".")], delete j[r]; }); - function we(r) { - const c = me("_", r); + function Ae(r) { + const c = ge("_", r); (typeof c == "string" || typeof c == "number") && j._.push(c); } - function fe(r, c, m, l) { - let i, g = y(c, f.nargs); + function me(r, c, p, l) { + let i, g = w(c, f.nargs); if (g = typeof g != "number" || isNaN(g) ? 1 : g, g === 0) - return q(l) || (k = Error(Y("Argument unexpected for: %s", c))), O(c, J(c)), r; - let p = q(l) ? 0 : 1; + return K(l) || (z = Error(J("Argument unexpected for: %s", c))), _(c, te(c)), r; + let m = K(l) ? 0 : 1; if (h["nargs-eats-options"]) - m.length - (r + 1) + p < g && (k = Error(Y("Not enough arguments following: %s", c))), p = g; + p.length - (r + 1) + m < g && (z = Error(J("Not enough arguments following: %s", c))), m = g; else { - for (i = r + 1; i < m.length && (!m[i].match(/^-[^0-9]/) || m[i].match(G) || pe(m[i])); i++) - p++; - p < g && (k = Error(Y("Not enough arguments following: %s", c))); + for (i = r + 1; i < p.length && (!p[i].match(/^-[^0-9]/) || p[i].match(G) || $e(p[i])); i++) + m++; + m < g && (z = Error(J("Not enough arguments following: %s", c))); } - let $ = Math.min(p, g); - for (!q(l) && $ > 0 && (O(c, l), $--), i = r + 1; i < $ + r + 1; i++) - O(c, m[i]); + let $ = Math.min(m, g); + for (!K(l) && $ > 0 && (_(c, l), $--), i = r + 1; i < $ + r + 1; i++) + _(c, p[i]); return r + $; } - function he(r, c, m, l) { - let i = [], g = l || m[r + 1]; - const p = y(c, f.nargs); - if (y(c, f.bools) && !/^(true|false)$/.test(g)) + function de(r, c, p, l) { + let i = [], g = l || p[r + 1]; + const m = w(c, f.nargs); + if (w(c, f.bools) && !/^(true|false)$/.test(g)) i.push(!0); - else if (q(g) || q(l) && /^-/.test(g) && !G.test(g) && !pe(g)) { - if (w[c] !== void 0) { - const $ = w[c]; + else if (K(g) || K(l) && /^-/.test(g) && !G.test(g) && !$e(g)) { + if (y[c] !== void 0) { + const $ = y[c]; i = Array.isArray($) ? $ : [$]; } } else { - q(l) || i.push(ve(c, l, !0)); - for (let $ = r + 1; $ < m.length && !(!h["greedy-arrays"] && i.length > 0 || p && typeof p == "number" && i.length >= p || (g = m[$], /^-/.test(g) && !G.test(g) && !pe(g))); $++) - r = $, i.push(ve(c, g, a)); + K(l) || i.push(Ce(c, l, !0)); + for (let $ = r + 1; $ < p.length && !(!h["greedy-arrays"] && i.length > 0 || m && typeof m == "number" && i.length >= m || (g = p[$], /^-/.test(g) && !G.test(g) && !$e(g))); $++) + r = $, i.push(Ce(c, g, a)); } - return typeof p == "number" && (p && i.length < p || isNaN(p) && i.length === 0) && (k = Error(Y("Not enough arguments following: %s", c))), O(c, i), r; + return typeof m == "number" && (m && i.length < m || isNaN(m) && i.length === 0) && (z = Error(J("Not enough arguments following: %s", c))), _(c, i), r; } - function O(r, c, m = a) { + function _(r, c, p = a) { if (/-/.test(r) && h["camel-case-expansion"]) { - const g = r.split(".").map(function(p) { - return se(p); + const g = r.split(".").map(function(m) { + return re(m); }).join("."); - ft(r, g); + pt(r, g); } - const l = ve(r, c, m), i = r.split("."); - ne(j, i, l), f.aliases[r] && f.aliases[r].forEach(function(g) { - const p = g.split("."); - ne(j, p, l); + const l = Ce(r, c, p), i = r.split("."); + oe(j, i, l), f.aliases[r] && f.aliases[r].forEach(function(g) { + const m = g.split("."); + oe(j, m, l); }), i.length > 1 && h["dot-notation"] && (f.aliases[i[0]] || []).forEach(function(g) { - let p = g.split("."); + let m = g.split("."); const $ = [].concat(i); - $.shift(), p = p.concat($), (f.aliases[r] || []).includes(p.join(".")) || ne(j, p, l); - }), y(r, f.normalize) && !y(r, f.arrays) && [r].concat(f.aliases[r] || []).forEach(function(p) { - Object.defineProperty(ut, p, { + $.shift(), m = m.concat($), (f.aliases[r] || []).includes(m.join(".")) || oe(j, m, l); + }), w(r, f.normalize) && !w(r, f.arrays) && [r].concat(f.aliases[r] || []).forEach(function(m) { + Object.defineProperty(ht, m, { enumerable: !0, get() { return c; }, set($) { - c = typeof $ == "string" ? K.normalize($) : $; + c = typeof $ == "string" ? Q.normalize($) : $; } }); }); } - function ft(r, c) { - f.aliases[r] && f.aliases[r].length || (f.aliases[r] = [c], le[c] = !0), f.aliases[c] && f.aliases[c].length || ft(c, r); + function pt(r, c) { + f.aliases[r] && f.aliases[r].length || (f.aliases[r] = [c], he[c] = !0), f.aliases[c] && f.aliases[c].length || pt(c, r); } - function ve(r, c, m) { - m && (c = yn(c)), (y(r, f.bools) || y(r, f.counts)) && typeof c == "string" && (c = c === "true"); + function Ce(r, c, p) { + p && (c = wn(c)), (w(r, f.bools) || w(r, f.counts)) && typeof c == "string" && (c = c === "true"); let l = Array.isArray(c) ? c.map(function(i) { - return me(r, i); - }) : me(r, c); - return y(r, f.counts) && (q(l) || typeof l == "boolean") && (l = Se()), y(r, f.normalize) && y(r, f.arrays) && (Array.isArray(c) ? l = c.map((i) => K.normalize(i)) : l = K.normalize(c)), l; + return ge(r, i); + }) : ge(r, c); + return w(r, f.counts) && (K(l) || typeof l == "boolean") && (l = Oe()), w(r, f.normalize) && w(r, f.arrays) && (Array.isArray(c) ? l = c.map((i) => Q.normalize(i)) : l = Q.normalize(c)), l; } - function me(r, c) { - return !h["parse-positional-numbers"] && r === "_" || !y(r, f.strings) && !y(r, f.bools) && !Array.isArray(c) && (Nt(c) && h["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${c}`))) || !q(c) && y(r, f.numbers)) && (c = Number(c)), c; + function ge(r, c) { + return !h["parse-positional-numbers"] && r === "_" || !w(r, f.strings) && !w(r, f.bools) && !Array.isArray(c) && (Rt(c) && h["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${c}`))) || !K(c) && w(r, f.numbers)) && (c = Number(c)), c; } - function Ut(r) { + function Vt(r) { const c = /* @__PURE__ */ Object.create(null); - mt(c, f.aliases, w), Object.keys(f.configs).forEach(function(m) { - const l = r[m] || c[m]; + dt(c, f.aliases, y), Object.keys(f.configs).forEach(function(p) { + const l = r[p] || c[p]; if (l) try { let i = null; - const g = K.resolve(K.cwd(), l), p = f.configs[m]; - if (typeof p == "function") { + const g = Q.resolve(Q.cwd(), l), m = f.configs[p]; + if (typeof m == "function") { try { - i = p(g); + i = m(g); } catch ($) { i = $; } if (i instanceof Error) { - k = i; + z = i; return; } } else - i = K.require(g); - Ae(i); + i = Q.require(g); + xe(i); } catch (i) { - i.name === "PermissionDenied" ? k = i : r[m] && (k = Error(Y("Invalid JSON config file: %s", l))); + i.name === "PermissionDenied" ? z = i : r[p] && (z = Error(J("Invalid JSON config file: %s", l))); } }); } - function Ae(r, c) { - Object.keys(r).forEach(function(m) { - const l = r[m], i = c ? c + "." + m : m; - typeof l == "object" && l !== null && !Array.isArray(l) && h["dot-notation"] ? Ae(l, i) : (!te(j, i.split(".")) || y(i, f.arrays) && h["combine-arrays"]) && O(i, l); + function xe(r, c) { + Object.keys(r).forEach(function(p) { + const l = r[p], i = c ? c + "." + p : p; + typeof l == "object" && l !== null && !Array.isArray(l) && h["dot-notation"] ? xe(l, i) : (!se(j, i.split(".")) || w(i, f.arrays) && h["combine-arrays"]) && _(i, l); }); } - function Vt() { + function Gt() { typeof x < "u" && x.forEach(function(r) { - Ae(r); + xe(r); }); } - function ht(r, c) { - if (typeof C > "u") + function mt(r, c) { + if (typeof S > "u") return; - const m = typeof C == "string" ? C : "", l = K.env(); + const p = typeof S == "string" ? S : "", l = Q.env(); Object.keys(l).forEach(function(i) { - if (m === "" || i.lastIndexOf(m, 0) === 0) { - const g = i.split("__").map(function(p, $) { - return $ === 0 && (p = p.substring(m.length)), se(p); + if (p === "" || i.lastIndexOf(p, 0) === 0) { + const g = i.split("__").map(function(m, $) { + return $ === 0 && (m = m.substring(p.length)), re(m); }); - (c && f.configs[g.join(".")] || !c) && !te(r, g) && O(g.join("."), l[i]); + (c && f.configs[g.join(".")] || !c) && !se(r, g) && _(g.join("."), l[i]); } }); } - function Dt(r) { + function qt(r) { let c; - const m = /* @__PURE__ */ new Set(); + const p = /* @__PURE__ */ new Set(); Object.keys(r).forEach(function(l) { - if (!m.has(l) && (c = y(l, f.coercions), typeof c == "function")) + if (!p.has(l) && (c = w(l, f.coercions), typeof c == "function")) try { - const i = me(l, c(r[l])); + const i = ge(l, c(r[l])); [].concat(f.aliases[l] || [], l).forEach((g) => { - m.add(g), r[g] = i; + p.add(g), r[g] = i; }); } catch (i) { - k = i; + z = i; } }); } - function Gt(r) { + function Kt(r) { return f.keys.forEach((c) => { ~c.indexOf(".") || typeof r[c] > "u" && (r[c] = void 0); }), r; } - function mt(r, c, m, l = !1) { - Object.keys(m).forEach(function(i) { - te(r, i.split(".")) || (ne(r, i.split("."), m[i]), l && (lt[i] = !0), (c[i] || []).forEach(function(g) { - te(r, g.split(".")) || ne(r, g.split("."), m[i]); + function dt(r, c, p, l = !1) { + Object.keys(p).forEach(function(i) { + se(r, i.split(".")) || (oe(r, i.split("."), p[i]), l && (ft[i] = !0), (c[i] || []).forEach(function(g) { + se(r, g.split(".")) || oe(r, g.split("."), p[i]); })); }); } - function te(r, c) { - let m = r; + function se(r, c) { + let p = r; h["dot-notation"] || (c = [c.join(".")]), c.slice(0, -1).forEach(function(i) { - m = m[i] || {}; + p = p[i] || {}; }); const l = c[c.length - 1]; - return typeof m != "object" ? !1 : l in m; + return typeof p != "object" ? !1 : l in p; } - function ne(r, c, m) { + function oe(r, c, p) { let l = r; h["dot-notation"] || (c = [c.join(".")]), c.slice(0, -1).forEach(function(R) { - R = dt(R), typeof l == "object" && l[R] === void 0 && (l[R] = {}), typeof l[R] != "object" || Array.isArray(l[R]) ? (Array.isArray(l[R]) ? l[R].push({}) : l[R] = [l[R], {}], l = l[R][l[R].length - 1]) : l = l[R]; + R = $t(R), typeof l == "object" && l[R] === void 0 && (l[R] = {}), typeof l[R] != "object" || Array.isArray(l[R]) ? (Array.isArray(l[R]) ? l[R].push({}) : l[R] = [l[R], {}], l = l[R][l[R].length - 1]) : l = l[R]; }); - const i = dt(c[c.length - 1]), g = y(c.join("."), f.arrays), p = Array.isArray(m); + const i = $t(c[c.length - 1]), g = w(c.join("."), f.arrays), m = Array.isArray(p); let $ = h["duplicate-arguments-array"]; - !$ && y(i, f.nargs) && ($ = !0, (!q(l[i]) && f.nargs[i] === 1 || Array.isArray(l[i]) && l[i].length === f.nargs[i]) && (l[i] = void 0)), m === Se() ? l[i] = Se(l[i]) : Array.isArray(l[i]) ? $ && g && p ? l[i] = h["flatten-duplicate-arrays"] ? l[i].concat(m) : (Array.isArray(l[i][0]) ? l[i] : [l[i]]).concat([m]) : !$ && !!g == !!p ? l[i] = m : l[i] = l[i].concat([m]) : l[i] === void 0 && g ? l[i] = p ? m : [m] : $ && !(l[i] === void 0 || y(i, f.counts) || y(i, f.bools)) ? l[i] = [l[i], m] : l[i] = m; + !$ && w(i, f.nargs) && ($ = !0, (!K(l[i]) && f.nargs[i] === 1 || Array.isArray(l[i]) && l[i].length === f.nargs[i]) && (l[i] = void 0)), p === Oe() ? l[i] = Oe(l[i]) : Array.isArray(l[i]) ? $ && g && m ? l[i] = h["flatten-duplicate-arrays"] ? l[i].concat(p) : (Array.isArray(l[i][0]) ? l[i] : [l[i]]).concat([p]) : !$ && !!g == !!m ? l[i] = p : l[i] = l[i].concat([p]) : l[i] === void 0 && g ? l[i] = m ? p : [p] : $ && !(l[i] === void 0 || w(i, f.counts) || w(i, f.bools)) ? l[i] = [l[i], p] : l[i] = p; } - function qt(...r) { + function Qt(...r) { r.forEach(function(c) { - Object.keys(c || {}).forEach(function(m) { - f.aliases[m] || (f.aliases[m] = [].concat(u[m] || []), f.aliases[m].concat(m).forEach(function(l) { + Object.keys(c || {}).forEach(function(p) { + f.aliases[p] || (f.aliases[p] = [].concat(u[p] || []), f.aliases[p].concat(p).forEach(function(l) { if (/-/.test(l) && h["camel-case-expansion"]) { - const i = se(l); - i !== m && f.aliases[m].indexOf(i) === -1 && (f.aliases[m].push(i), le[i] = !0); + const i = re(l); + i !== p && f.aliases[p].indexOf(i) === -1 && (f.aliases[p].push(i), he[i] = !0); } - }), f.aliases[m].concat(m).forEach(function(l) { + }), f.aliases[p].concat(p).forEach(function(l) { if (l.length > 1 && /[A-Z]/.test(l) && h["camel-case-expansion"]) { - const i = _t(l, "-"); - i !== m && f.aliases[m].indexOf(i) === -1 && (f.aliases[m].push(i), le[i] = !0); + const i = jt(l, "-"); + i !== p && f.aliases[p].indexOf(i) === -1 && (f.aliases[p].push(i), he[i] = !0); } - }), f.aliases[m].forEach(function(l) { - f.aliases[l] = [m].concat(f.aliases[m].filter(function(i) { + }), f.aliases[p].forEach(function(l) { + f.aliases[l] = [p].concat(f.aliases[p].filter(function(i) { return l !== i; })); })); }); }); } - function y(r, c) { - const m = [].concat(f.aliases[r] || [], r), l = Object.keys(c), i = m.find((g) => l.includes(g)); + function w(r, c) { + const p = [].concat(f.aliases[r] || [], r), l = Object.keys(c), i = p.find((g) => l.includes(g)); return i ? c[i] : !1; } - function pt(r) { + function gt(r) { const c = Object.keys(f); return [].concat(c.map((l) => f[l])).some(function(l) { return Array.isArray(l) ? l.includes(r) : l[r]; }); } - function Kt(r, ...c) { + function Ht(r, ...c) { return [].concat(...c).some(function(l) { const i = r.match(l); - return i && pt(i[1]); + return i && gt(i[1]); }); } - function Qt(r) { + function Xt(r) { if (r.match(G) || !r.match(/^-[^-]+/)) return !1; - let c = !0, m; + let c = !0, p; const l = r.slice(1).split(""); for (let i = 0; i < l.length; i++) { - if (m = r.slice(i + 2), !pt(l[i])) { + if (p = r.slice(i + 2), !gt(l[i])) { c = !1; break; } - if (l[i + 1] && l[i + 1] === "=" || m === "-" || /[A-Za-z]/.test(l[i]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(m) || l[i + 1] && l[i + 1].match(/\W/)) + if (l[i + 1] && l[i + 1] === "=" || p === "-" || /[A-Za-z]/.test(l[i]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(p) || l[i + 1] && l[i + 1].match(/\W/)) break; } return c; } - function pe(r) { - return h["unknown-options-as-args"] && Ht(r); + function $e(r) { + return h["unknown-options-as-args"] && Yt(r); } - function Ht(r) { - return r = r.replace(/^-{3,}/, "--"), r.match(G) || Qt(r) ? !1 : !Kt(r, /^-+([^=]+?)=[\s\S]*$/, Ee, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/); + function Yt(r) { + return r = r.replace(/^-{3,}/, "--"), r.match(G) || Xt(r) ? !1 : !Ht(r, /^-+([^=]+?)=[\s\S]*$/, ve, /^-+([^=]+?)$/, /^-+([^=]+?)-$/, /^-+([^=]+?\d+)$/, /^-+([^=]+?)\W+.*$/); } - function J(r) { - return !y(r, f.bools) && !y(r, f.counts) && `${r}` in w ? w[r] : Xt(Yt(r)); + function te(r) { + return !w(r, f.bools) && !w(r, f.counts) && `${r}` in y ? y[r] : Zt(Jt(r)); } - function Xt(r) { + function Zt(r) { return { - [V.BOOLEAN]: !0, - [V.STRING]: "", - [V.NUMBER]: void 0, - [V.ARRAY]: [] + [U.BOOLEAN]: !0, + [U.STRING]: "", + [U.NUMBER]: void 0, + [U.ARRAY]: [] }[r]; } - function Yt(r) { - let c = V.BOOLEAN; - return y(r, f.strings) ? c = V.STRING : y(r, f.numbers) ? c = V.NUMBER : y(r, f.bools) ? c = V.BOOLEAN : y(r, f.arrays) && (c = V.ARRAY), c; + function Jt(r) { + let c = U.BOOLEAN; + return w(r, f.strings) ? c = U.STRING : w(r, f.numbers) ? c = U.NUMBER : w(r, f.bools) ? c = U.BOOLEAN : w(r, f.arrays) && (c = U.ARRAY), c; } - function q(r) { + function K(r) { return r === void 0; } - function Zt() { - Object.keys(f.counts).find((r) => y(r, f.arrays) ? (k = Error(Y("Invalid configuration: %s, opts.count excludes opts.array.", r)), !0) : y(r, f.nargs) ? (k = Error(Y("Invalid configuration: %s, opts.count excludes opts.narg.", r)), !0) : !1); + function en() { + Object.keys(f.counts).find((r) => w(r, f.arrays) ? (z = Error(J("Invalid configuration: %s, opts.count excludes opts.array.", r)), !0) : w(r, f.nargs) ? (z = Error(J("Invalid configuration: %s, opts.count excludes opts.narg.", r)), !0) : !1); } return { aliases: Object.assign({}, f.aliases), - argv: Object.assign(ut, j), + argv: Object.assign(ht, j), configuration: h, - defaulted: Object.assign({}, lt), - error: k, - newAliases: Object.assign({}, le) + defaulted: Object.assign({}, ft), + error: z, + newAliases: Object.assign({}, he) }; } } -function bn(e) { +function En(e) { const t = [], n = /* @__PURE__ */ Object.create(null); let s = !0; for (Object.keys(e).forEach(function(o) { @@ -521,20 +521,20 @@ function bn(e) { } } return t.forEach(function(o) { - o = o.filter(function(u, h, w) { - return w.indexOf(u) === h; + o = o.filter(function(u, h, y) { + return y.indexOf(u) === h; }); const a = o.pop(); a !== void 0 && typeof a == "string" && (n[a] = o); }), n; } -function Se(e) { +function Oe(e) { return e !== void 0 ? e + 1 : 1; } -function dt(e) { +function $t(e) { return e === "__proto__" ? "___proto___" : e; } -function yn(e) { +function wn(e) { return typeof e == "string" && (e[0] === "'" || e[0] === '"') && e[e.length - 1] === e[0] ? e.substring(1, e.length - 1) : e; } /** @@ -545,39 +545,39 @@ function yn(e) { * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */ -var xe, Oe, _e; -const gt = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, $t = (Oe = (xe = process == null ? void 0 : process.versions) === null || xe === void 0 ? void 0 : xe.node) !== null && Oe !== void 0 ? Oe : (_e = process == null ? void 0 : process.version) === null || _e === void 0 ? void 0 : _e.slice(1); -if ($t && Number($t.match(/^([^.]+)/)[1]) < gt) - throw Error(`yargs parser supports a minimum Node.js version of ${gt}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); -const En = process ? process.env : {}, jt = new $n({ +var _e, Ne, je; +const bt = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12, yt = (Ne = (_e = process == null ? void 0 : process.versions) === null || _e === void 0 ? void 0 : _e.node) !== null && Ne !== void 0 ? Ne : (je = process == null ? void 0 : process.version) === null || je === void 0 ? void 0 : je.slice(1); +if (yt && Number(yt.match(/^([^.]+)/)[1]) < bt) + throw Error(`yargs parser supports a minimum Node.js version of ${bt}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); +const vn = process ? process.env : {}, Pt = new yn({ cwd: process.cwd, - env: () => En, - format: St, - normalize: tn, - resolve: ee, + env: () => vn, + format: Ot, + normalize: sn, + resolve: ne, // TODO: figure out a way to combine ESM and CJS coverage, such that // we can exercise all the lines below: require: (e) => { if (typeof require < "u") return require(e); if (e.match(/\.json$/)) - return JSON.parse(ct(e, "utf8")); + return JSON.parse(lt(e, "utf8")); throw Error("only .json config files are supported in ESM"); } -}), ae = function(t, n) { - return jt.parse(t.slice(), n).argv; +}), fe = function(t, n) { + return Pt.parse(t.slice(), n).argv; }; -ae.detailed = function(e, t) { - return jt.parse(e.slice(), t); +fe.detailed = function(e, t) { + return Pt.parse(e.slice(), t); }; -ae.camelCase = se; -ae.decamelize = _t; -ae.looksLikeNumber = Nt; -const wn = { - right: On, - center: _n -}, vn = 0, de = 1, An = 2, ge = 3; -class Cn { +fe.camelCase = re; +fe.decamelize = jt; +fe.looksLikeNumber = Rt; +const An = { + right: Nn, + center: jn +}, Cn = 0, be = 1, xn = 2, ye = 3; +class Sn { constructor(t) { var n; this.width = t.width, this.wrap = (n = t.wrap) !== null && n !== void 0 ? n : !0, this.rows = []; @@ -633,14 +633,14 @@ class Cn { return this.rasterize(t).forEach((s, o) => { let a = ""; s.forEach((u, h) => { - const { width: w } = t[h], x = this.negatePadding(t[h]); - let C = u; - if (x > T.stringWidth(u) && (C += " ".repeat(x - T.stringWidth(u))), t[h].align && t[h].align !== "left" && this.wrap) { - const I = wn[t[h].align]; - C = I(C, x), T.stringWidth(C) < x && (C += " ".repeat((w || 0) - T.stringWidth(C) - 1)); + const { width: y } = t[h], x = this.negatePadding(t[h]); + let S = u; + if (x > T.stringWidth(u) && (S += " ".repeat(x - T.stringWidth(u))), t[h].align && t[h].align !== "left" && this.wrap) { + const B = An[t[h].align]; + S = B(S, x), T.stringWidth(S) < x && (S += " ".repeat((y || 0) - T.stringWidth(S) - 1)); } const L = t[h].padding || [0, 0, 0, 0]; - L[ge] && (a += " ".repeat(L[ge])), a += bt(t[h], C, "| "), a += C, a += bt(t[h], C, " |"), L[de] && (a += " ".repeat(L[de])), o === 0 && n.length > 0 && (a = this.renderInline(a, n[n.length - 1])); + L[ye] && (a += " ".repeat(L[ye])), a += Et(t[h], S, "| "), a += S, a += Et(t[h], S, " |"), L[be] && (a += " ".repeat(L[be])), o === 0 && n.length > 0 && (a = this.renderInline(a, n[n.length - 1])); }), n.push({ text: a.replace(/ +$/, ""), span: t.span @@ -659,18 +659,18 @@ class Cn { return t.forEach((a, u) => { a.width = s[u], this.wrap ? o = T.wrap(a.text, this.negatePadding(a), { hard: !0 }).split(` `) : o = a.text.split(` -`), a.border && (o.unshift("." + "-".repeat(this.negatePadding(a) + 2) + "."), o.push("'" + "-".repeat(this.negatePadding(a) + 2) + "'")), a.padding && (o.unshift(...new Array(a.padding[vn] || 0).fill("")), o.push(...new Array(a.padding[An] || 0).fill(""))), o.forEach((h, w) => { - n[w] || n.push([]); - const x = n[w]; - for (let C = 0; C < u; C++) - x[C] === void 0 && x.push(""); +`), a.border && (o.unshift("." + "-".repeat(this.negatePadding(a) + 2) + "."), o.push("'" + "-".repeat(this.negatePadding(a) + 2) + "'")), a.padding && (o.unshift(...new Array(a.padding[Cn] || 0).fill("")), o.push(...new Array(a.padding[xn] || 0).fill(""))), o.forEach((h, y) => { + n[y] || n.push([]); + const x = n[y]; + for (let S = 0; S < u; S++) + x[S] === void 0 && x.push(""); x.push(h); }); }), n; } negatePadding(t) { let n = t.width || 0; - return t.padding && (n -= (t.padding[ge] || 0) + (t.padding[de] || 0)), t.border && (n -= 4), n; + return t.padding && (n -= (t.padding[ye] || 0) + (t.padding[be] || 0)), t.border && (n -= 4), n; } columnWidths(t) { if (!this.wrap) @@ -680,82 +680,82 @@ class Cn { if (u.width) return n--, s -= u.width, u.width; }), a = n ? Math.floor(s / n) : 0; - return o.map((u, h) => u === void 0 ? Math.max(a, Sn(t[h])) : u); + return o.map((u, h) => u === void 0 ? Math.max(a, On(t[h])) : u); } } -function bt(e, t, n) { +function Et(e, t, n) { return e.border ? /[.']-+[.']/.test(t) ? "" : t.trim().length !== 0 ? n : " " : ""; } -function Sn(e) { - const t = e.padding || [], n = 1 + (t[ge] || 0) + (t[de] || 0); +function On(e) { + const t = e.padding || [], n = 1 + (t[ye] || 0) + (t[be] || 0); return e.border ? n + 4 : n; } -function xn() { +function _n() { return typeof process == "object" && process.stdout && process.stdout.columns ? process.stdout.columns : 80; } -function On(e, t) { +function Nn(e, t) { e = e.trim(); const n = T.stringWidth(e); return n < t ? " ".repeat(t - n) + e : e; } -function _n(e, t) { +function jn(e, t) { e = e.trim(); const n = T.stringWidth(e); return n >= t ? e : " ".repeat(t - n >> 1) + e; } let T; -function Nn(e, t) { - return T = t, new Cn({ - width: e?.width || xn(), +function Rn(e, t) { + return T = t, new Sn({ + width: e?.width || _n(), wrap: e?.wrap }); } -const Rt = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g"); -function Lt(e) { - return e.replace(Rt, ""); +const Lt = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g"); +function Ft(e) { + return e.replace(Lt, ""); } -function jn(e, t) { - const [n, s] = e.match(Rt) || ["", ""]; - e = Lt(e); +function Pn(e, t) { + const [n, s] = e.match(Lt) || ["", ""]; + e = Ft(e); let o = ""; for (let a = 0; a < e.length; a++) a !== 0 && a % t === 0 && (o += ` `), o += e.charAt(a); return n && s && (o = `${n}${o}${s}`), o; } -function Rn(e) { - return Nn(e, { +function Ln(e) { + return Rn(e, { stringWidth: (t) => [...t].length, - stripAnsi: Lt, - wrap: jn + stripAnsi: Ft, + wrap: Pn }); } -function Ln(e, t) { - let n = ee(".", e), s; - for (xt(n).isDirectory() || (n = Ne(n)); ; ) { - if (s = t(n, rn(n)), s) - return ee(n, s); - if (n = Ne(s = n), s === n) +function Fn(e, t) { + let n = ne(".", e), s; + for (_t(n).isDirectory() || (n = Re(n)); ; ) { + if (s = t(n, an(n)), s) + return ne(n, s); + if (n = Re(s = n), s === n) break; } } -const Fn = { +const Tn = { fs: { - readFileSync: ct, - writeFile: cn + readFileSync: lt, + writeFile: ln }, - format: St, - resolve: ee, + format: Ot, + resolve: ne, exists: (e) => { try { - return xt(e).isFile(); + return _t(e).isFile(); } catch { return !1; } } }; -let U; -class Pn { +let D; +class Wn { constructor(t) { t = t || {}, this.directory = t.directory || "./locales", this.updateFiles = typeof t.updateFiles == "boolean" ? t.updateFiles : !0, this.locale = t.locale || "en", this.fallbackToLanguage = typeof t.fallbackToLanguage == "boolean" ? t.fallbackToLanguage : !0, this.cache = /* @__PURE__ */ Object.create(null), this.writeQueue = []; } @@ -770,7 +770,7 @@ class Pn { directory: this.directory, locale: this.locale, cb: s - })) : s(), U.format.apply(U.format, [this.cache[this.locale][n] || n].concat(t)); + })) : s(), D.format.apply(D.format, [this.cache[this.locale][n] || n].concat(t)); } __n() { const t = Array.prototype.slice.call(arguments), n = t.shift(), s = t.shift(), o = t.shift(); @@ -787,7 +787,7 @@ class Pn { cb: a })) : a(); const h = [u]; - return ~u.indexOf("%d") && h.push(o), U.format.apply(U.format, h.concat(t)); + return ~u.indexOf("%d") && h.push(o), D.format.apply(D.format, h.concat(t)); } setLocale(t) { this.locale = t; @@ -812,15 +812,15 @@ class Pn { } _processWriteQueue() { const t = this, n = this.writeQueue[0], s = n.directory, o = n.locale, a = n.cb, u = this._resolveLocaleFile(s, o), h = JSON.stringify(this.cache[o], null, 2); - U.fs.writeFile(u, h, "utf-8", function(w) { - t.writeQueue.shift(), t.writeQueue.length > 0 && t._processWriteQueue(), a(w); + D.fs.writeFile(u, h, "utf-8", function(y) { + t.writeQueue.shift(), t.writeQueue.length > 0 && t._processWriteQueue(), a(y); }); } _readLocaleFile() { let t = {}; const n = this._resolveLocaleFile(this.directory, this.locale); try { - U.fs.readFileSync && (t = JSON.parse(U.fs.readFileSync(n, "utf-8"))); + D.fs.readFileSync && (t = JSON.parse(D.fs.readFileSync(n, "utf-8"))); } catch (s) { if (s instanceof SyntaxError && (s.message = "syntax error in " + n), s.code === "ENOENT") t = {}; @@ -830,20 +830,20 @@ class Pn { this.cache[this.locale] = t; } _resolveLocaleFile(t, n) { - let s = U.resolve(t, "./", n + ".json"); + let s = D.resolve(t, "./", n + ".json"); if (this.fallbackToLanguage && !this._fileExistsSync(s) && ~n.lastIndexOf("_")) { - const o = U.resolve(t, "./", n.split("_")[0] + ".json"); + const o = D.resolve(t, "./", n.split("_")[0] + ".json"); this._fileExistsSync(o) && (s = o); } return s; } _fileExistsSync(t) { - return U.exists(t); + return D.exists(t); } } -function Tn(e, t) { - U = t; - const n = new Pn(e); +function In(e, t) { + D = t; + const n = new Wn(e); return { __: n.__.bind(n), __n: n.__n.bind(n), @@ -853,19 +853,19 @@ function Tn(e, t) { locale: n.locale }; } -const Wn = (e) => Tn(e, Fn), In = "require is not supported by ESM", yt = "loading a directory of commands is not supported yet for ESM"; -let ie; +const Bn = (e) => In(e, Tn), Mn = "require is not supported by ESM", wt = "loading a directory of commands is not supported yet for ESM"; +let ae; try { - ie = un(import.meta.url); + ae = hn(import.meta.url); } catch { - ie = process.cwd(); + ae = process.cwd(); } -const Bn = ie.substring(0, ie.lastIndexOf("node_modules")); -an, ln, en, Bn || process.cwd(), nn, Ne, sn, on, ee, process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, ct, Wn({ - directory: ee(ie, "../../../locales"), +const kn = ae.substring(0, ae.lastIndexOf("node_modules")); +un, fn, nn, kn || process.cwd(), on, Re, rn, cn, ne, process.cwd, process.exit, process.nextTick, typeof process.stdout.columns < "u" && process.stdout.columns, lt, Bn({ + directory: ne(ae, "../../../locales"), updateFiles: !1 }); -const Z = "\x1B[44m", S = "\x1B[43m", H = "\x1B[41m", Mn = "\x1B[42m", E = "\x1B[0m", v = "\x1B[33m", A = "\x1B[36m", d = "\x1B[0m", zn = { +const ee = "\x1B[44m", C = "\x1B[43m", X = "\x1B[41m", zn = "\x1B[42m", E = "\x1B[0m", v = "\x1B[33m", A = "\x1B[36m", d = "\x1B[0m", Dn = { "vue-caution": ["implicitParentChildCommunication", "elementSelectorsWithScoped"], "vue-essential": ["globalStyle", "simpleProp", "singleNameComponent", "vforNoKey", "vifWithVfor"], "vue-recommended": ["topLevelElementOrder", "elementAttributeOrder"], @@ -891,31 +891,32 @@ const Z = "\x1B[44m", S = "\x1B[43m", H = "\x1B[41m", Mn = "\x1B[42m", E = "\x1B "magicNumbers", "parameterCount", "plainScript", + "propsDrilling", "scriptLength", "shortVariableName", "tooManyProps" ] -}, ce = Object.keys(zn), je = [], Re = 100, kn = (e, t) => { +}, le = Object.keys(Dn), Pe = [], Le = 100, Un = (e, t) => { if (!e) return; const n = e.content.split(` `); - n.length > Re && je.push({ filePath: t, message: `${n.length > Re * 2 ? H : S}(${n.length} lines)${E}` }); -}, Un = () => { + n.length > Le && Pe.push({ filePath: t, message: `${n.length > Le * 2 ? X : C}(${n.length} lines)${E}` }); +}, Vn = () => { const e = []; - return je.length > 0 && je.forEach((t) => { + return Pe.length > 0 && Pe.forEach((t) => { e.push({ file: t.filePath, rule: `${A}rrd ~ Long