@delance/builder 0.2.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 +15 -0
- package/README.md +93 -0
- package/dist/cli.js +119 -0
- package/dist/cli.js.map +18 -0
- package/dist/index.js +2577 -0
- package/dist/index.js.map +99 -0
- package/package.json +94 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
BSD Zero Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Zephyr Lykos
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
[][@delance/builder]
|
|
2
|
+
[][license]
|
|
3
|
+
[][builds]
|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
[@delance/builder]
|
|
7
|
+
==================
|
|
8
|
+
A spear to the Python language server built with black magic.
|
|
9
|
+
|
|
10
|
+
**If you were trying to run the language server, see [@delance/runtime].**
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
- API
|
|
15
|
+
|
|
16
|
+
import run from '@delance/builder';
|
|
17
|
+
|
|
18
|
+
- CLI
|
|
19
|
+
|
|
20
|
+
bunx @delance/builder /path/to/extension/dist
|
|
21
|
+
|
|
22
|
+
## Contributing
|
|
23
|
+
|
|
24
|
+
This project is developed using the [Bun](https://bun.sh/) toolkit.
|
|
25
|
+
See <https://bun.sh/docs/installation> for installation instructions.
|
|
26
|
+
|
|
27
|
+
Ensure linting and type checking passes,
|
|
28
|
+
and send your patches to <~self/delance-devel@lists.sr.ht>.
|
|
29
|
+
|
|
30
|
+
You shall sign off your contribution with a `Signed-off-by` tag appended to
|
|
31
|
+
the log message of the patch or the tip of a Git branch containing
|
|
32
|
+
your contribution.
|
|
33
|
+
|
|
34
|
+
By contributing, you agree to both the [license] and the terms below:
|
|
35
|
+
|
|
36
|
+
Developer's Certificate of Origin 1.1
|
|
37
|
+
|
|
38
|
+
By making a contribution to this project, I certify that:
|
|
39
|
+
|
|
40
|
+
(a) The contribution was created in whole or in part by me and I
|
|
41
|
+
have the right to submit it under the open source license
|
|
42
|
+
indicated in the file; or
|
|
43
|
+
|
|
44
|
+
(b) The contribution is based upon previous work that, to the best
|
|
45
|
+
of my knowledge, is covered under an appropriate open source
|
|
46
|
+
license and I have the right under that license to submit that
|
|
47
|
+
work with modifications, whether created in whole or in part
|
|
48
|
+
by me, under the same open source license (unless I am
|
|
49
|
+
permitted to submit under a different license), as indicated
|
|
50
|
+
in the file; or
|
|
51
|
+
|
|
52
|
+
(c) The contribution was provided directly to me by some other
|
|
53
|
+
person who certified (a), (b) or (c) and I have not modified
|
|
54
|
+
it.
|
|
55
|
+
|
|
56
|
+
(d) I understand and agree that this project and the contribution
|
|
57
|
+
are public and that a record of the contribution (including all
|
|
58
|
+
personal information I submit with it, including my sign-off) is
|
|
59
|
+
maintained indefinitely and may be redistributed consistent with
|
|
60
|
+
this project or the open source license(s) involved.
|
|
61
|
+
|
|
62
|
+
## But wait…
|
|
63
|
+
|
|
64
|
+
> Isn't this against the original LICENSE?
|
|
65
|
+
|
|
66
|
+
**tl;dr: yes.** You choose to break the binding agreement of the original
|
|
67
|
+
software, but this repo itself does not violate any rights of its corresponding
|
|
68
|
+
copyright authors: it's a standalone piece of software that is not tied to,
|
|
69
|
+
nor redistributes any other particular project in the question.
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
SPDX-License-Identifier: 0BSD
|
|
74
|
+
|
|
75
|
+
BSD Zero Clause License
|
|
76
|
+
|
|
77
|
+
Copyright (c) 2023 Zephyr Lykos
|
|
78
|
+
|
|
79
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
80
|
+
purpose with or without fee is hereby granted.
|
|
81
|
+
|
|
82
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
83
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
84
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
85
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
86
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
87
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
88
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
89
|
+
|
|
90
|
+
[@delance/runtime]: https://npm.im/@delance/runtime
|
|
91
|
+
[@delance/builder]: https://npm.im/@delance/builder
|
|
92
|
+
[builds]: https://builds.sr.ht/~self/delance-builder?
|
|
93
|
+
[license]: ./LICENSE
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
import {
|
|
4
|
+
delance_builder_default
|
|
5
|
+
} from "./index.js";
|
|
6
|
+
|
|
7
|
+
// cli.ts
|
|
8
|
+
import {spawnSync} from "child_process";
|
|
9
|
+
import debug from "debug";
|
|
10
|
+
|
|
11
|
+
// utils/colors.ts
|
|
12
|
+
import {isatty} from "tty";
|
|
13
|
+
/*! modified from picocolors v1.0.0 | ISC License | github.com/alexeyraspopov/picocolors */
|
|
14
|
+
var argv = process.argv || [];
|
|
15
|
+
var { env } = process;
|
|
16
|
+
var enabled = !(("NO_COLOR" in env) || argv.includes("--no-color")) && (("FORCE_COLOR" in env) || argv.includes("--color") || process.platform === "win32" || isatty(1) && env.TERM !== "dumb" || ("CI" in env));
|
|
17
|
+
var formatter = (open, close, replace = open) => enabled ? (input) => {
|
|
18
|
+
const string = String(input);
|
|
19
|
+
const index = string.indexOf(close, open.length);
|
|
20
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
21
|
+
} : String;
|
|
22
|
+
var replaceClose = (string, close, replace, index) => {
|
|
23
|
+
const start = string.slice(0, Math.max(0, index)) + replace;
|
|
24
|
+
const end = string.slice(Math.max(0, index + close.length));
|
|
25
|
+
const nextIndex = end.indexOf(close);
|
|
26
|
+
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
27
|
+
};
|
|
28
|
+
var bold = formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m");
|
|
29
|
+
var dim = formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m");
|
|
30
|
+
var underline = formatter("\x1B[4m", "\x1B[24m");
|
|
31
|
+
var red = formatter("\x1B[31m", "\x1B[39m");
|
|
32
|
+
var green = formatter("\x1B[32m", "\x1B[39m");
|
|
33
|
+
var yellow = formatter("\x1B[33m", "\x1B[39m");
|
|
34
|
+
var magenta = formatter("\x1B[35m", "\x1B[39m");
|
|
35
|
+
var cyan = formatter("\x1B[36m", "\x1B[39m");
|
|
36
|
+
var white = formatter("\x1B[37m", "\x1B[39m");
|
|
37
|
+
var bgBlack = formatter("\x1B[40m", "\x1B[49m");
|
|
38
|
+
var bgBlue = formatter("\x1B[44m", "\x1B[49m");
|
|
39
|
+
|
|
40
|
+
// cli.ts
|
|
41
|
+
var hl = function(...args) {
|
|
42
|
+
return bgBlack(` ${dim(magenta("$"))} ${[...function* () {
|
|
43
|
+
for (let i = 0;i < args.length; i++) {
|
|
44
|
+
const arg = args[i];
|
|
45
|
+
if (i === 0) {
|
|
46
|
+
yield yellow(arg);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (arg === "|") {
|
|
50
|
+
yield green("|");
|
|
51
|
+
yield yellow(args[++i]);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (arg.startsWith("-")) {
|
|
55
|
+
yield cyan(arg);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (arg.startsWith("#")) {
|
|
59
|
+
yield dim(args.slice(i).join(" "));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (true) {
|
|
63
|
+
if (arg.startsWith('"') && arg.endsWith('"') || arg.startsWith("\'") && arg.endsWith("\'")) {
|
|
64
|
+
yield arg[0] + magenta(arg.slice(1, -1)) + arg[0];
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
yield arg;
|
|
69
|
+
}
|
|
70
|
+
}()].join(" ")} `);
|
|
71
|
+
};
|
|
72
|
+
async function main(argv2) {
|
|
73
|
+
debug.enable("*,-babel");
|
|
74
|
+
const cwd = argv2.pop();
|
|
75
|
+
for await (const x of new Bun.Glob("{!browser,*}.bundle.js").scan({ absolute: true, cwd })) {
|
|
76
|
+
console.group(`${magenta("> build")} ${dim(x)}`);
|
|
77
|
+
const label = `${bgBlue(white(" Processed "))} ${dim(x)}`;
|
|
78
|
+
console.time(label);
|
|
79
|
+
try {
|
|
80
|
+
const file = Bun.file(x);
|
|
81
|
+
await Bun.write(file, await delance_builder_default(await file.text()));
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error(`Error while processing file ${x} `);
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
console.timeEnd(label);
|
|
87
|
+
console.groupEnd();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
var errorMessage = `
|
|
91
|
+
${red("Uh-oh")}. ${bold(yellow("@delance/builder"))} CLI requires Bun to run.
|
|
92
|
+
If you were trying to run the language server, use ${bold(magenta("npm i @delance/runtime"))}.
|
|
93
|
+
|
|
94
|
+
\u2022 To install Bun:
|
|
95
|
+
${hl("npm", "i", "-d", "bun", "#", "locally")}
|
|
96
|
+
${hl("curl", "-fsSL", "https://bun.sh/install", "|", "bash", "#", "globally")}
|
|
97
|
+
\u2022 More info: ${underline(cyan("https://bun.sh/docs/installation"))}
|
|
98
|
+
|
|
99
|
+
${"\u2500".repeat(80)}
|
|
100
|
+
`;
|
|
101
|
+
if (!process.isBun) {
|
|
102
|
+
const { status, error } = spawnSync("bun", ["run", ...process.argv.slice(1)], { stdio: "inherit" });
|
|
103
|
+
if (status) {
|
|
104
|
+
process.exit(status);
|
|
105
|
+
} else {
|
|
106
|
+
if (error && error.code === "ENOENT") {
|
|
107
|
+
console.error(errorMessage);
|
|
108
|
+
}
|
|
109
|
+
throw error;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (import.meta.main) {
|
|
113
|
+
await main(process.argv);
|
|
114
|
+
}
|
|
115
|
+
export {
|
|
116
|
+
main
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
//# debugId=0E11DD9D5AAF722A64756e2164756e21
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../cli.ts", "../utils/colors.ts", "../utils/colors.ts", "../utils/colors.ts", "../utils/colors.ts", "../utils/colors.ts", "../utils/colors.ts", "../utils/colors.ts", "../cli.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"#!/usr/bin/env bun\nimport {spawnSync} from 'node:child_process';\nimport debug from 'debug';\nimport run from '.';\nimport * as pc from '~colors';\n\nfunction hl(...args: string[]) {\n\treturn pc.bgBlack(` ${pc.dim(pc.magenta('$'))} ${(\n\t\t[...(function* () {\n\t\t\tfor (let i = 0; i < args.length; i++) {\n\t\t\t\tconst arg = args[i];\n\t\t\t\tif (i === 0) {\n\t\t\t\t\tyield pc.yellow(arg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (arg === '|') {\n\t\t\t\t\tyield pc.green('|');\n\t\t\t\t\tyield pc.yellow(args[++i]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (arg.startsWith('-')) {\n\t\t\t\t\tyield pc.cyan(arg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (arg.startsWith('#')) {\n\t\t\t\t\tyield pc.dim(args.slice(i).join(' '));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Not used yet, discard at tree shaking stage\n\t\t\t\tif (process.env.NODE_ENV === 'development') {\n\t\t\t\t\t// eslint-disable-next-line unicorn/no-lonely-if\n\t\t\t\t\tif (\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\targ.startsWith('\"')\n\t\t\t\t\t\t\t&& arg.endsWith('\"')\n\t\t\t\t\t\t) || (\n\t\t\t\t\t\t\targ.startsWith('\\'')\n\t\t\t\t\t\t\t&& arg.endsWith('\\'')\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tyield arg[0] + pc.magenta(arg.slice(1, -1)) + arg[0];\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tyield arg;\n\t\t\t}\n\t\t})()]\n\t).join(' ')} `);\n}\n\nconst errorMessage\n\t= `\n ${pc.red('Uh-oh')}. ${pc.bold(pc.yellow('@delance/builder'))} CLI requires Bun to run.\n If you were trying to run the language server, use ${pc.bold(pc.magenta('npm i @delance/runtime'))}.\n\n • To install Bun:\n ${hl('npm', 'i', '-d', 'bun', '#', 'locally')}\n ${hl('curl', '-fsSL', 'https://bun.sh/install', '|', 'bash', '#', 'globally')}\n • More info: ${pc.underline(pc.cyan('https://bun.sh/docs/installation'))}\n\n${'─'.repeat(80)}\n`;\n\nif (!process.isBun) {\n\tconst {status, error} = spawnSync(\n\t\t'bun',\n\t\t['run', ...process.argv.slice(1)],\n\t\t{stdio: 'inherit'},\n\t);\n\tif (status) {\n\t\tprocess.exit(status);\n\t} else {\n\t\t// @ts-expect-error Node.js errors has `.code`\n\t\tif (error && error.code === 'ENOENT') {\n\t\t\tconsole.error(errorMessage);\n\t\t}\n\n\t\tthrow error!;\n\t}\n}\n\nexport async function main(argv: string[]) {\n\tdebug.enable('*,-babel');\n\tconst cwd = argv.pop()!;\n\n\tfor await (\n\t\tconst x of new Bun.Glob('{!browser,*}.bundle.js')\n\t\t\t.scan({absolute: true, cwd})\n\t) {\n\t\tconsole.group(`${pc.magenta('> build')} ${pc.dim(x)}`);\n\t\tconst label = `${pc.bgBlue(pc.white(' Processed '))} ${pc.dim(x)}`;\n\t\tconsole.time(label);\n\n\t\ttry {\n\t\t\tconst file = Bun.file(x);\n\t\t\tawait Bun.write(file, (\n\t\t\t\tawait run(await file.text())),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error while processing file ${x} `);\n\t\t\tthrow error;\n\t\t}\n\n\t\tconsole.timeEnd(label);\n\t\tconsole.groupEnd();\n\t}\n}\n\nif (import.meta.main) {\n\tawait main(process.argv);\n}\n",
|
|
6
|
+
"/*! modified from picocolors v1.0.0 | ISC License | github.com/alexeyraspopov/picocolors */\n/*\nCopyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n*/\n\nimport {isatty} from 'node:tty';\n\nconst argv = process.argv || [];\nconst {env} = process;\nconst enabled\n\t= !('NO_COLOR' in env || argv.includes('--no-color'))\n\t&& ('FORCE_COLOR' in env\n\t\t|| argv.includes('--color')\n\t\t|| process.platform === 'win32'\n\t\t|| (isatty(1) && env.TERM !== 'dumb')\n\t\t|| 'CI' in env);\n\nconst formatter = (open: string, close: string, replace = open) =>\n\tenabled ? (input: string) => {\n\t\tconst string = String(input);\n\t\tconst index = string.indexOf(close, open.length);\n\t\treturn ~index\n\t\t\t? open + replaceClose(string, close, replace, index) + close\n\t\t\t: open + string + close;\n\t} : String;\n\nconst replaceClose = (string: string, close: string, replace: string, index: number): string => {\n\tconst start = string.slice(0, Math.max(0, index)) + replace;\n\tconst end = string.slice(Math.max(0, index + close.length));\n\tconst nextIndex = end.indexOf(close);\n\treturn ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\n\nexport const reset = enabled ? (s: string) => `\\u001B[0m${s}\\u001B[0m` : String;\nexport const bold = /* #__PURE__ */ formatter('\\u001B[1m', '\\u001B[22m', '\\u001B[22m\\u001B[1m');\nexport const dim = /* #__PURE__ */ formatter('\\u001B[2m', '\\u001B[22m', '\\u001B[22m\\u001B[2m');\nexport const italic = /* #__PURE__ */ formatter('\\u001B[3m', '\\u001B[23m');\nexport const underline = /* #__PURE__ */ formatter('\\u001B[4m', '\\u001B[24m');\nexport const inverse = /* #__PURE__ */ formatter('\\u001B[7m', '\\u001B[27m');\nexport const hidden = /* #__PURE__ */ formatter('\\u001B[8m', '\\u001B[28m');\nexport const strikethrough = /* #__PURE__ */ formatter('\\u001B[9m', '\\u001B[29m');\nexport const black = /* #__PURE__ */ formatter('\\u001B[30m', '\\u001B[39m');\nexport const red = /* #__PURE__ */ formatter('\\u001B[31m', '\\u001B[39m');\nexport const green = /* #__PURE__ */ formatter('\\u001B[32m', '\\u001B[39m');\nexport const yellow = /* #__PURE__ */ formatter('\\u001B[33m', '\\u001B[39m');\nexport const blue = /* #__PURE__ */ formatter('\\u001B[34m', '\\u001B[39m');\nexport const magenta = /* #__PURE__ */ formatter('\\u001B[35m', '\\u001B[39m');\nexport const cyan = /* #__PURE__ */ formatter('\\u001B[36m', '\\u001B[39m');\nexport const white = /* #__PURE__ */ formatter('\\u001B[37m', '\\u001B[39m');\nexport const gray = /* #__PURE__ */ formatter('\\u001B[90m', '\\u001B[39m');\nexport const bgBlack = /* #__PURE__ */ formatter('\\u001B[40m', '\\u001B[49m');\nexport const bgRed = /* #__PURE__ */ formatter('\\u001B[41m', '\\u001B[49m');\nexport const bgGreen = /* #__PURE__ */ formatter('\\u001B[42m', '\\u001B[49m');\nexport const bgYellow = /* #__PURE__ */ formatter('\\u001B[43m', '\\u001B[49m');\nexport const bgBlue = /* #__PURE__ */ formatter('\\u001B[44m', '\\u001B[49m');\nexport const bgMagenta = /* #__PURE__ */ formatter('\\u001B[45m', '\\u001B[49m');\nexport const bgCyan = /* #__PURE__ */ formatter('\\u001B[46m', '\\u001B[49m');\nexport const bgWhite = /* #__PURE__ */ formatter('\\u001B[47m', '\\u001B[49m');\n",
|
|
7
|
+
"/*! modified from picocolors v1.0.0 | ISC License | github.com/alexeyraspopov/picocolors */\n/*\nCopyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n*/\n\nimport {isatty} from 'node:tty';\n\nconst argv = process.argv || [];\nconst {env} = process;\nconst enabled\n\t= !('NO_COLOR' in env || argv.includes('--no-color'))\n\t&& ('FORCE_COLOR' in env\n\t\t|| argv.includes('--color')\n\t\t|| process.platform === 'win32'\n\t\t|| (isatty(1) && env.TERM !== 'dumb')\n\t\t|| 'CI' in env);\n\nconst formatter = (open: string, close: string, replace = open) =>\n\tenabled ? (input: string) => {\n\t\tconst string = String(input);\n\t\tconst index = string.indexOf(close, open.length);\n\t\treturn ~index\n\t\t\t? open + replaceClose(string, close, replace, index) + close\n\t\t\t: open + string + close;\n\t} : String;\n\nconst replaceClose = (string: string, close: string, replace: string, index: number): string => {\n\tconst start = string.slice(0, Math.max(0, index)) + replace;\n\tconst end = string.slice(Math.max(0, index + close.length));\n\tconst nextIndex = end.indexOf(close);\n\treturn ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\n\nexport const reset = enabled ? (s: string) => `\\u001B[0m${s}\\u001B[0m` : String;\nexport const bold = /* #__PURE__ */ formatter('\\u001B[1m', '\\u001B[22m', '\\u001B[22m\\u001B[1m');\nexport const dim = /* #__PURE__ */ formatter('\\u001B[2m', '\\u001B[22m', '\\u001B[22m\\u001B[2m');\nexport const italic = /* #__PURE__ */ formatter('\\u001B[3m', '\\u001B[23m');\nexport const underline = /* #__PURE__ */ formatter('\\u001B[4m', '\\u001B[24m');\nexport const inverse = /* #__PURE__ */ formatter('\\u001B[7m', '\\u001B[27m');\nexport const hidden = /* #__PURE__ */ formatter('\\u001B[8m', '\\u001B[28m');\nexport const strikethrough = /* #__PURE__ */ formatter('\\u001B[9m', '\\u001B[29m');\nexport const black = /* #__PURE__ */ formatter('\\u001B[30m', '\\u001B[39m');\nexport const red = /* #__PURE__ */ formatter('\\u001B[31m', '\\u001B[39m');\nexport const green = /* #__PURE__ */ formatter('\\u001B[32m', '\\u001B[39m');\nexport const yellow = /* #__PURE__ */ formatter('\\u001B[33m', '\\u001B[39m');\nexport const blue = /* #__PURE__ */ formatter('\\u001B[34m', '\\u001B[39m');\nexport const magenta = /* #__PURE__ */ formatter('\\u001B[35m', '\\u001B[39m');\nexport const cyan = /* #__PURE__ */ formatter('\\u001B[36m', '\\u001B[39m');\nexport const white = /* #__PURE__ */ formatter('\\u001B[37m', '\\u001B[39m');\nexport const gray = /* #__PURE__ */ formatter('\\u001B[90m', '\\u001B[39m');\nexport const bgBlack = /* #__PURE__ */ formatter('\\u001B[40m', '\\u001B[49m');\nexport const bgRed = /* #__PURE__ */ formatter('\\u001B[41m', '\\u001B[49m');\nexport const bgGreen = /* #__PURE__ */ formatter('\\u001B[42m', '\\u001B[49m');\nexport const bgYellow = /* #__PURE__ */ formatter('\\u001B[43m', '\\u001B[49m');\nexport const bgBlue = /* #__PURE__ */ formatter('\\u001B[44m', '\\u001B[49m');\nexport const bgMagenta = /* #__PURE__ */ formatter('\\u001B[45m', '\\u001B[49m');\nexport const bgCyan = /* #__PURE__ */ formatter('\\u001B[46m', '\\u001B[49m');\nexport const bgWhite = /* #__PURE__ */ formatter('\\u001B[47m', '\\u001B[49m');\n",
|
|
8
|
+
"/*! modified from picocolors v1.0.0 | ISC License | github.com/alexeyraspopov/picocolors */\n/*\nCopyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n*/\n\nimport {isatty} from 'node:tty';\n\nconst argv = process.argv || [];\nconst {env} = process;\nconst enabled\n\t= !('NO_COLOR' in env || argv.includes('--no-color'))\n\t&& ('FORCE_COLOR' in env\n\t\t|| argv.includes('--color')\n\t\t|| process.platform === 'win32'\n\t\t|| (isatty(1) && env.TERM !== 'dumb')\n\t\t|| 'CI' in env);\n\nconst formatter = (open: string, close: string, replace = open) =>\n\tenabled ? (input: string) => {\n\t\tconst string = String(input);\n\t\tconst index = string.indexOf(close, open.length);\n\t\treturn ~index\n\t\t\t? open + replaceClose(string, close, replace, index) + close\n\t\t\t: open + string + close;\n\t} : String;\n\nconst replaceClose = (string: string, close: string, replace: string, index: number): string => {\n\tconst start = string.slice(0, Math.max(0, index)) + replace;\n\tconst end = string.slice(Math.max(0, index + close.length));\n\tconst nextIndex = end.indexOf(close);\n\treturn ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\n\nexport const reset = enabled ? (s: string) => `\\u001B[0m${s}\\u001B[0m` : String;\nexport const bold = /* #__PURE__ */ formatter('\\u001B[1m', '\\u001B[22m', '\\u001B[22m\\u001B[1m');\nexport const dim = /* #__PURE__ */ formatter('\\u001B[2m', '\\u001B[22m', '\\u001B[22m\\u001B[2m');\nexport const italic = /* #__PURE__ */ formatter('\\u001B[3m', '\\u001B[23m');\nexport const underline = /* #__PURE__ */ formatter('\\u001B[4m', '\\u001B[24m');\nexport const inverse = /* #__PURE__ */ formatter('\\u001B[7m', '\\u001B[27m');\nexport const hidden = /* #__PURE__ */ formatter('\\u001B[8m', '\\u001B[28m');\nexport const strikethrough = /* #__PURE__ */ formatter('\\u001B[9m', '\\u001B[29m');\nexport const black = /* #__PURE__ */ formatter('\\u001B[30m', '\\u001B[39m');\nexport const red = /* #__PURE__ */ formatter('\\u001B[31m', '\\u001B[39m');\nexport const green = /* #__PURE__ */ formatter('\\u001B[32m', '\\u001B[39m');\nexport const yellow = /* #__PURE__ */ formatter('\\u001B[33m', '\\u001B[39m');\nexport const blue = /* #__PURE__ */ formatter('\\u001B[34m', '\\u001B[39m');\nexport const magenta = /* #__PURE__ */ formatter('\\u001B[35m', '\\u001B[39m');\nexport const cyan = /* #__PURE__ */ formatter('\\u001B[36m', '\\u001B[39m');\nexport const white = /* #__PURE__ */ formatter('\\u001B[37m', '\\u001B[39m');\nexport const gray = /* #__PURE__ */ formatter('\\u001B[90m', '\\u001B[39m');\nexport const bgBlack = /* #__PURE__ */ formatter('\\u001B[40m', '\\u001B[49m');\nexport const bgRed = /* #__PURE__ */ formatter('\\u001B[41m', '\\u001B[49m');\nexport const bgGreen = /* #__PURE__ */ formatter('\\u001B[42m', '\\u001B[49m');\nexport const bgYellow = /* #__PURE__ */ formatter('\\u001B[43m', '\\u001B[49m');\nexport const bgBlue = /* #__PURE__ */ formatter('\\u001B[44m', '\\u001B[49m');\nexport const bgMagenta = /* #__PURE__ */ formatter('\\u001B[45m', '\\u001B[49m');\nexport const bgCyan = /* #__PURE__ */ formatter('\\u001B[46m', '\\u001B[49m');\nexport const bgWhite = /* #__PURE__ */ formatter('\\u001B[47m', '\\u001B[49m');\n",
|
|
9
|
+
"/*! modified from picocolors v1.0.0 | ISC License | github.com/alexeyraspopov/picocolors */\n/*\nCopyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n*/\n\nimport {isatty} from 'node:tty';\n\nconst argv = process.argv || [];\nconst {env} = process;\nconst enabled\n\t= !('NO_COLOR' in env || argv.includes('--no-color'))\n\t&& ('FORCE_COLOR' in env\n\t\t|| argv.includes('--color')\n\t\t|| process.platform === 'win32'\n\t\t|| (isatty(1) && env.TERM !== 'dumb')\n\t\t|| 'CI' in env);\n\nconst formatter = (open: string, close: string, replace = open) =>\n\tenabled ? (input: string) => {\n\t\tconst string = String(input);\n\t\tconst index = string.indexOf(close, open.length);\n\t\treturn ~index\n\t\t\t? open + replaceClose(string, close, replace, index) + close\n\t\t\t: open + string + close;\n\t} : String;\n\nconst replaceClose = (string: string, close: string, replace: string, index: number): string => {\n\tconst start = string.slice(0, Math.max(0, index)) + replace;\n\tconst end = string.slice(Math.max(0, index + close.length));\n\tconst nextIndex = end.indexOf(close);\n\treturn ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\n\nexport const reset = enabled ? (s: string) => `\\u001B[0m${s}\\u001B[0m` : String;\nexport const bold = /* #__PURE__ */ formatter('\\u001B[1m', '\\u001B[22m', '\\u001B[22m\\u001B[1m');\nexport const dim = /* #__PURE__ */ formatter('\\u001B[2m', '\\u001B[22m', '\\u001B[22m\\u001B[2m');\nexport const italic = /* #__PURE__ */ formatter('\\u001B[3m', '\\u001B[23m');\nexport const underline = /* #__PURE__ */ formatter('\\u001B[4m', '\\u001B[24m');\nexport const inverse = /* #__PURE__ */ formatter('\\u001B[7m', '\\u001B[27m');\nexport const hidden = /* #__PURE__ */ formatter('\\u001B[8m', '\\u001B[28m');\nexport const strikethrough = /* #__PURE__ */ formatter('\\u001B[9m', '\\u001B[29m');\nexport const black = /* #__PURE__ */ formatter('\\u001B[30m', '\\u001B[39m');\nexport const red = /* #__PURE__ */ formatter('\\u001B[31m', '\\u001B[39m');\nexport const green = /* #__PURE__ */ formatter('\\u001B[32m', '\\u001B[39m');\nexport const yellow = /* #__PURE__ */ formatter('\\u001B[33m', '\\u001B[39m');\nexport const blue = /* #__PURE__ */ formatter('\\u001B[34m', '\\u001B[39m');\nexport const magenta = /* #__PURE__ */ formatter('\\u001B[35m', '\\u001B[39m');\nexport const cyan = /* #__PURE__ */ formatter('\\u001B[36m', '\\u001B[39m');\nexport const white = /* #__PURE__ */ formatter('\\u001B[37m', '\\u001B[39m');\nexport const gray = /* #__PURE__ */ formatter('\\u001B[90m', '\\u001B[39m');\nexport const bgBlack = /* #__PURE__ */ formatter('\\u001B[40m', '\\u001B[49m');\nexport const bgRed = /* #__PURE__ */ formatter('\\u001B[41m', '\\u001B[49m');\nexport const bgGreen = /* #__PURE__ */ formatter('\\u001B[42m', '\\u001B[49m');\nexport const bgYellow = /* #__PURE__ */ formatter('\\u001B[43m', '\\u001B[49m');\nexport const bgBlue = /* #__PURE__ */ formatter('\\u001B[44m', '\\u001B[49m');\nexport const bgMagenta = /* #__PURE__ */ formatter('\\u001B[45m', '\\u001B[49m');\nexport const bgCyan = /* #__PURE__ */ formatter('\\u001B[46m', '\\u001B[49m');\nexport const bgWhite = /* #__PURE__ */ formatter('\\u001B[47m', '\\u001B[49m');\n",
|
|
10
|
+
"/*! modified from picocolors v1.0.0 | ISC License | github.com/alexeyraspopov/picocolors */\n/*\nCopyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n*/\n\nimport {isatty} from 'node:tty';\n\nconst argv = process.argv || [];\nconst {env} = process;\nconst enabled\n\t= !('NO_COLOR' in env || argv.includes('--no-color'))\n\t&& ('FORCE_COLOR' in env\n\t\t|| argv.includes('--color')\n\t\t|| process.platform === 'win32'\n\t\t|| (isatty(1) && env.TERM !== 'dumb')\n\t\t|| 'CI' in env);\n\nconst formatter = (open: string, close: string, replace = open) =>\n\tenabled ? (input: string) => {\n\t\tconst string = String(input);\n\t\tconst index = string.indexOf(close, open.length);\n\t\treturn ~index\n\t\t\t? open + replaceClose(string, close, replace, index) + close\n\t\t\t: open + string + close;\n\t} : String;\n\nconst replaceClose = (string: string, close: string, replace: string, index: number): string => {\n\tconst start = string.slice(0, Math.max(0, index)) + replace;\n\tconst end = string.slice(Math.max(0, index + close.length));\n\tconst nextIndex = end.indexOf(close);\n\treturn ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\n\nexport const reset = enabled ? (s: string) => `\\u001B[0m${s}\\u001B[0m` : String;\nexport const bold = /* #__PURE__ */ formatter('\\u001B[1m', '\\u001B[22m', '\\u001B[22m\\u001B[1m');\nexport const dim = /* #__PURE__ */ formatter('\\u001B[2m', '\\u001B[22m', '\\u001B[22m\\u001B[2m');\nexport const italic = /* #__PURE__ */ formatter('\\u001B[3m', '\\u001B[23m');\nexport const underline = /* #__PURE__ */ formatter('\\u001B[4m', '\\u001B[24m');\nexport const inverse = /* #__PURE__ */ formatter('\\u001B[7m', '\\u001B[27m');\nexport const hidden = /* #__PURE__ */ formatter('\\u001B[8m', '\\u001B[28m');\nexport const strikethrough = /* #__PURE__ */ formatter('\\u001B[9m', '\\u001B[29m');\nexport const black = /* #__PURE__ */ formatter('\\u001B[30m', '\\u001B[39m');\nexport const red = /* #__PURE__ */ formatter('\\u001B[31m', '\\u001B[39m');\nexport const green = /* #__PURE__ */ formatter('\\u001B[32m', '\\u001B[39m');\nexport const yellow = /* #__PURE__ */ formatter('\\u001B[33m', '\\u001B[39m');\nexport const blue = /* #__PURE__ */ formatter('\\u001B[34m', '\\u001B[39m');\nexport const magenta = /* #__PURE__ */ formatter('\\u001B[35m', '\\u001B[39m');\nexport const cyan = /* #__PURE__ */ formatter('\\u001B[36m', '\\u001B[39m');\nexport const white = /* #__PURE__ */ formatter('\\u001B[37m', '\\u001B[39m');\nexport const gray = /* #__PURE__ */ formatter('\\u001B[90m', '\\u001B[39m');\nexport const bgBlack = /* #__PURE__ */ formatter('\\u001B[40m', '\\u001B[49m');\nexport const bgRed = /* #__PURE__ */ formatter('\\u001B[41m', '\\u001B[49m');\nexport const bgGreen = /* #__PURE__ */ formatter('\\u001B[42m', '\\u001B[49m');\nexport const bgYellow = /* #__PURE__ */ formatter('\\u001B[43m', '\\u001B[49m');\nexport const bgBlue = /* #__PURE__ */ formatter('\\u001B[44m', '\\u001B[49m');\nexport const bgMagenta = /* #__PURE__ */ formatter('\\u001B[45m', '\\u001B[49m');\nexport const bgCyan = /* #__PURE__ */ formatter('\\u001B[46m', '\\u001B[49m');\nexport const bgWhite = /* #__PURE__ */ formatter('\\u001B[47m', '\\u001B[49m');\n",
|
|
11
|
+
"/*! modified from picocolors v1.0.0 | ISC License | github.com/alexeyraspopov/picocolors */\n/*\nCopyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n*/\n\nimport {isatty} from 'node:tty';\n\nconst argv = process.argv || [];\nconst {env} = process;\nconst enabled\n\t= !('NO_COLOR' in env || argv.includes('--no-color'))\n\t&& ('FORCE_COLOR' in env\n\t\t|| argv.includes('--color')\n\t\t|| process.platform === 'win32'\n\t\t|| (isatty(1) && env.TERM !== 'dumb')\n\t\t|| 'CI' in env);\n\nconst formatter = (open: string, close: string, replace = open) =>\n\tenabled ? (input: string) => {\n\t\tconst string = String(input);\n\t\tconst index = string.indexOf(close, open.length);\n\t\treturn ~index\n\t\t\t? open + replaceClose(string, close, replace, index) + close\n\t\t\t: open + string + close;\n\t} : String;\n\nconst replaceClose = (string: string, close: string, replace: string, index: number): string => {\n\tconst start = string.slice(0, Math.max(0, index)) + replace;\n\tconst end = string.slice(Math.max(0, index + close.length));\n\tconst nextIndex = end.indexOf(close);\n\treturn ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\n\nexport const reset = enabled ? (s: string) => `\\u001B[0m${s}\\u001B[0m` : String;\nexport const bold = /* #__PURE__ */ formatter('\\u001B[1m', '\\u001B[22m', '\\u001B[22m\\u001B[1m');\nexport const dim = /* #__PURE__ */ formatter('\\u001B[2m', '\\u001B[22m', '\\u001B[22m\\u001B[2m');\nexport const italic = /* #__PURE__ */ formatter('\\u001B[3m', '\\u001B[23m');\nexport const underline = /* #__PURE__ */ formatter('\\u001B[4m', '\\u001B[24m');\nexport const inverse = /* #__PURE__ */ formatter('\\u001B[7m', '\\u001B[27m');\nexport const hidden = /* #__PURE__ */ formatter('\\u001B[8m', '\\u001B[28m');\nexport const strikethrough = /* #__PURE__ */ formatter('\\u001B[9m', '\\u001B[29m');\nexport const black = /* #__PURE__ */ formatter('\\u001B[30m', '\\u001B[39m');\nexport const red = /* #__PURE__ */ formatter('\\u001B[31m', '\\u001B[39m');\nexport const green = /* #__PURE__ */ formatter('\\u001B[32m', '\\u001B[39m');\nexport const yellow = /* #__PURE__ */ formatter('\\u001B[33m', '\\u001B[39m');\nexport const blue = /* #__PURE__ */ formatter('\\u001B[34m', '\\u001B[39m');\nexport const magenta = /* #__PURE__ */ formatter('\\u001B[35m', '\\u001B[39m');\nexport const cyan = /* #__PURE__ */ formatter('\\u001B[36m', '\\u001B[39m');\nexport const white = /* #__PURE__ */ formatter('\\u001B[37m', '\\u001B[39m');\nexport const gray = /* #__PURE__ */ formatter('\\u001B[90m', '\\u001B[39m');\nexport const bgBlack = /* #__PURE__ */ formatter('\\u001B[40m', '\\u001B[49m');\nexport const bgRed = /* #__PURE__ */ formatter('\\u001B[41m', '\\u001B[49m');\nexport const bgGreen = /* #__PURE__ */ formatter('\\u001B[42m', '\\u001B[49m');\nexport const bgYellow = /* #__PURE__ */ formatter('\\u001B[43m', '\\u001B[49m');\nexport const bgBlue = /* #__PURE__ */ formatter('\\u001B[44m', '\\u001B[49m');\nexport const bgMagenta = /* #__PURE__ */ formatter('\\u001B[45m', '\\u001B[49m');\nexport const bgCyan = /* #__PURE__ */ formatter('\\u001B[46m', '\\u001B[49m');\nexport const bgWhite = /* #__PURE__ */ formatter('\\u001B[47m', '\\u001B[49m');\n",
|
|
12
|
+
"/*! modified from picocolors v1.0.0 | ISC License | github.com/alexeyraspopov/picocolors */\n/*\nCopyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n*/\n\nimport {isatty} from 'node:tty';\n\nconst argv = process.argv || [];\nconst {env} = process;\nconst enabled\n\t= !('NO_COLOR' in env || argv.includes('--no-color'))\n\t&& ('FORCE_COLOR' in env\n\t\t|| argv.includes('--color')\n\t\t|| process.platform === 'win32'\n\t\t|| (isatty(1) && env.TERM !== 'dumb')\n\t\t|| 'CI' in env);\n\nconst formatter = (open: string, close: string, replace = open) =>\n\tenabled ? (input: string) => {\n\t\tconst string = String(input);\n\t\tconst index = string.indexOf(close, open.length);\n\t\treturn ~index\n\t\t\t? open + replaceClose(string, close, replace, index) + close\n\t\t\t: open + string + close;\n\t} : String;\n\nconst replaceClose = (string: string, close: string, replace: string, index: number): string => {\n\tconst start = string.slice(0, Math.max(0, index)) + replace;\n\tconst end = string.slice(Math.max(0, index + close.length));\n\tconst nextIndex = end.indexOf(close);\n\treturn ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\n\nexport const reset = enabled ? (s: string) => `\\u001B[0m${s}\\u001B[0m` : String;\nexport const bold = /* #__PURE__ */ formatter('\\u001B[1m', '\\u001B[22m', '\\u001B[22m\\u001B[1m');\nexport const dim = /* #__PURE__ */ formatter('\\u001B[2m', '\\u001B[22m', '\\u001B[22m\\u001B[2m');\nexport const italic = /* #__PURE__ */ formatter('\\u001B[3m', '\\u001B[23m');\nexport const underline = /* #__PURE__ */ formatter('\\u001B[4m', '\\u001B[24m');\nexport const inverse = /* #__PURE__ */ formatter('\\u001B[7m', '\\u001B[27m');\nexport const hidden = /* #__PURE__ */ formatter('\\u001B[8m', '\\u001B[28m');\nexport const strikethrough = /* #__PURE__ */ formatter('\\u001B[9m', '\\u001B[29m');\nexport const black = /* #__PURE__ */ formatter('\\u001B[30m', '\\u001B[39m');\nexport const red = /* #__PURE__ */ formatter('\\u001B[31m', '\\u001B[39m');\nexport const green = /* #__PURE__ */ formatter('\\u001B[32m', '\\u001B[39m');\nexport const yellow = /* #__PURE__ */ formatter('\\u001B[33m', '\\u001B[39m');\nexport const blue = /* #__PURE__ */ formatter('\\u001B[34m', '\\u001B[39m');\nexport const magenta = /* #__PURE__ */ formatter('\\u001B[35m', '\\u001B[39m');\nexport const cyan = /* #__PURE__ */ formatter('\\u001B[36m', '\\u001B[39m');\nexport const white = /* #__PURE__ */ formatter('\\u001B[37m', '\\u001B[39m');\nexport const gray = /* #__PURE__ */ formatter('\\u001B[90m', '\\u001B[39m');\nexport const bgBlack = /* #__PURE__ */ formatter('\\u001B[40m', '\\u001B[49m');\nexport const bgRed = /* #__PURE__ */ formatter('\\u001B[41m', '\\u001B[49m');\nexport const bgGreen = /* #__PURE__ */ formatter('\\u001B[42m', '\\u001B[49m');\nexport const bgYellow = /* #__PURE__ */ formatter('\\u001B[43m', '\\u001B[49m');\nexport const bgBlue = /* #__PURE__ */ formatter('\\u001B[44m', '\\u001B[49m');\nexport const bgMagenta = /* #__PURE__ */ formatter('\\u001B[45m', '\\u001B[49m');\nexport const bgCyan = /* #__PURE__ */ formatter('\\u001B[46m', '\\u001B[49m');\nexport const bgWhite = /* #__PURE__ */ formatter('\\u001B[47m', '\\u001B[49m');\n",
|
|
13
|
+
"#!/usr/bin/env bun\nimport {spawnSync} from 'node:child_process';\nimport debug from 'debug';\nimport run from '.';\nimport * as pc from '~colors';\n\nfunction hl(...args: string[]) {\n\treturn pc.bgBlack(` ${pc.dim(pc.magenta('$'))} ${(\n\t\t[...(function* () {\n\t\t\tfor (let i = 0; i < args.length; i++) {\n\t\t\t\tconst arg = args[i];\n\t\t\t\tif (i === 0) {\n\t\t\t\t\tyield pc.yellow(arg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (arg === '|') {\n\t\t\t\t\tyield pc.green('|');\n\t\t\t\t\tyield pc.yellow(args[++i]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (arg.startsWith('-')) {\n\t\t\t\t\tyield pc.cyan(arg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (arg.startsWith('#')) {\n\t\t\t\t\tyield pc.dim(args.slice(i).join(' '));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Not used yet, discard at tree shaking stage\n\t\t\t\tif (process.env.NODE_ENV === 'development') {\n\t\t\t\t\t// eslint-disable-next-line unicorn/no-lonely-if\n\t\t\t\t\tif (\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\targ.startsWith('\"')\n\t\t\t\t\t\t\t&& arg.endsWith('\"')\n\t\t\t\t\t\t) || (\n\t\t\t\t\t\t\targ.startsWith('\\'')\n\t\t\t\t\t\t\t&& arg.endsWith('\\'')\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tyield arg[0] + pc.magenta(arg.slice(1, -1)) + arg[0];\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tyield arg;\n\t\t\t}\n\t\t})()]\n\t).join(' ')} `);\n}\n\nconst errorMessage\n\t= `\n ${pc.red('Uh-oh')}. ${pc.bold(pc.yellow('@delance/builder'))} CLI requires Bun to run.\n If you were trying to run the language server, use ${pc.bold(pc.magenta('npm i @delance/runtime'))}.\n\n • To install Bun:\n ${hl('npm', 'i', '-d', 'bun', '#', 'locally')}\n ${hl('curl', '-fsSL', 'https://bun.sh/install', '|', 'bash', '#', 'globally')}\n • More info: ${pc.underline(pc.cyan('https://bun.sh/docs/installation'))}\n\n${'─'.repeat(80)}\n`;\n\nif (!process.isBun) {\n\tconst {status, error} = spawnSync(\n\t\t'bun',\n\t\t['run', ...process.argv.slice(1)],\n\t\t{stdio: 'inherit'},\n\t);\n\tif (status) {\n\t\tprocess.exit(status);\n\t} else {\n\t\t// @ts-expect-error Node.js errors has `.code`\n\t\tif (error && error.code === 'ENOENT') {\n\t\t\tconsole.error(errorMessage);\n\t\t}\n\n\t\tthrow error!;\n\t}\n}\n\nexport async function main(argv: string[]) {\n\tdebug.enable('*,-babel');\n\tconst cwd = argv.pop()!;\n\n\tfor await (\n\t\tconst x of new Bun.Glob('{!browser,*}.bundle.js')\n\t\t\t.scan({absolute: true, cwd})\n\t) {\n\t\tconsole.group(`${pc.magenta('> build')} ${pc.dim(x)}`);\n\t\tconst label = `${pc.bgBlue(pc.white(' Processed '))} ${pc.dim(x)}`;\n\t\tconsole.time(label);\n\n\t\ttry {\n\t\t\tconst file = Bun.file(x);\n\t\t\tawait Bun.write(file, (\n\t\t\t\tawait run(await file.text())),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error while processing file ${x} `);\n\t\t\tthrow error;\n\t\t}\n\n\t\tconsole.timeEnd(label);\n\t\tconsole.groupEnd();\n\t}\n}\n\nif (import.meta.main) {\n\tawait main(process.argv);\n}\n"
|
|
14
|
+
],
|
|
15
|
+
"mappings": ";;;;;;;AA/////fACA;AACA;;;ACjgggggBAiBA;AAAA;AAEA,IAAM,OAAO,QAAQ,QAAQ,CAAC;AAC9B,MAAO,QAAO;AACd,IAAM,aACD,cAAc,QAAO,KAAK,SAAS,YAAY,QAC/C,iBAAiB,QACjB,KAAK,SAAS,SAAS,KACvB,QAAQ,aAAa,WACpB,OAAO,CAAC,KAAK,IAAI,SAAS,WAC3B,QAAQ;AAEb,IAAM,YAAY,CAAC,MAAc,OAAe,UAAU,SACzD,UAAU,CAAC,UAAkB;AAC5B,QAAM,SAAS,OAAO,KAAK;AAC3B,QAAM,QAAQ,OAAO,QAAQ,OAAO,KAAK,MAAM;AAC/C,UAAQ,QACL,OAAO,aAAa,QAAQ,OAAO,SAAS,KAAK,IAAI,QACrD,OAAO,SAAS;AAAA,IAChB;AAEL,IAAM,eAAe,CAAC,QAAgB,OAAe,SAAiB,UAA0B;AAC/F,QAAM,QAAQ,OAAO,MAAM,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC,IAAI;AACpD,QAAM,MAAM,OAAO,MAAM,KAAK,IAAI,GAAG,QAAQ,MAAM,MAAM,CAAC;AAC1D,QAAM,YAAY,IAAI,QAAQ,KAAK;AACnC,UAAQ,YAAY,QAAQ,aAAa,KAAK,OAAO,SAAS,SAAS,IAAI,QAAQ;AAAA;",
|
|
16
|
+
"debugId": "0E11DD9D5AAF722A64756e2164756e21",
|
|
17
|
+
"names": []
|
|
18
|
+
}
|