@delance/builder 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +0 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +65 -67
- package/dist/transform/delance/antifeature.d.ts +19 -0
- package/dist/transform/delance/index.d.ts +5 -0
- package/dist/transform/delance/stringaes.d.ts +11 -0
- package/dist/transform/esmodule/esmodule-flag.d.ts +17 -0
- package/dist/transform/esmodule/index.d.ts +5 -0
- package/dist/transform/esmodule/indirect-call.d.ts +20 -0
- package/dist/transform/esmodule/module-helper.d.ts +12 -0
- package/dist/transform/index.d.ts +2 -0
- package/dist/transform/syntactic/early-init.d.ts +11 -0
- package/dist/transform/syntactic/index.d.ts +5 -0
- package/dist/transform/syntactic/template-literal.d.ts +8 -0
- package/dist/transform/webcrack/index.d.ts +5 -0
- package/dist/utils/ast.d.ts +12 -0
- package/dist/utils/colors.d.ts +26 -0
- package/dist/utils/crypto.d.ts +4 -0
- package/dist/utils/matchers/chunk.d.ts +9 -0
- package/dist/utils/matchers/createBinding.d.ts +39 -0
- package/dist/utils/matchers/exportStar.d.ts +12 -0
- package/dist/utils/matchers/importDefault.d.ts +24 -0
- package/dist/utils/matchers/importStar.d.ts +16 -0
- package/dist/utils/matchers/setModuleDefault.d.ts +15 -0
- package/package.json +41 -46
- package/dist/cli.js.map +0 -18
- package/dist/index.js.map +0 -191
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
/**
|
|
3
|
+
* Simplify function calls between modules that discard reference bindings
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* `(0, someModule.someFunction)(args)` -> `someModule.someFunction(args)`
|
|
7
|
+
*
|
|
8
|
+
* @link <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_operator#discarding_reference_binding>
|
|
9
|
+
* @link <https://github.com/pionxzh/wakaru/blob/main/packages/unminify/src/transformations/un-indirect-call.ts>
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: {
|
|
12
|
+
name: string;
|
|
13
|
+
tags: "unsafe"[];
|
|
14
|
+
visitor: () => {
|
|
15
|
+
CallExpression: {
|
|
16
|
+
exit(this: import("webcrack/src/ast-utils").TransformState, $: import("@babel/traverse").NodePath<t.CallExpression>): void;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TraverseOptions } from '@babel/traverse';
|
|
2
|
+
import type { TransformState } from 'webcrack/ast-utils';
|
|
3
|
+
/** Rename webpack RequireJS shims and tsc esmodule helpers.
|
|
4
|
+
* @link <https://www.typescriptlang.org/tsconfig#esModuleInterop>
|
|
5
|
+
*/
|
|
6
|
+
declare const _default: {
|
|
7
|
+
name: string;
|
|
8
|
+
tags: "safe"[];
|
|
9
|
+
scope: true;
|
|
10
|
+
visitor: () => TraverseOptions<TransformState>;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NodePath } from '@babel/traverse';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
name: string;
|
|
4
|
+
tags: "unsafe"[];
|
|
5
|
+
visitor(): {
|
|
6
|
+
BinaryExpression: {
|
|
7
|
+
exit(this: import("webcrack/src/ast-utils").TransformState, $: NodePath<import("@babel/types").BinaryExpression>): void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as t from '@babel/types';
|
|
2
|
+
import { type Node } from '@babel/traverse';
|
|
3
|
+
import type { TransformState, Transform, AsyncTransform } from 'webcrack/ast-utils';
|
|
4
|
+
export declare function parse(code: string): import("@babel/parser").ParseResult<t.File>;
|
|
5
|
+
export declare function generate(ast: t.Node): string;
|
|
6
|
+
export declare function applyTransformAsync<TOptions>(ast: Node, transform: AsyncTransform<TOptions>, options?: TOptions): Promise<TransformState>;
|
|
7
|
+
export declare function applyTransform<TOptions>(ast: Node, transform: Transform<TOptions>, options?: TOptions, noScopeOverride?: boolean): TransformState;
|
|
8
|
+
export declare function applyTransforms(ast: Node, transforms: Transform[], options?: {
|
|
9
|
+
noScope?: boolean;
|
|
10
|
+
name?: string;
|
|
11
|
+
log?: boolean;
|
|
12
|
+
}): TransformState;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*! modified from picocolors v1.0.0 | ISC License | github.com/alexeyraspopov/picocolors */
|
|
2
|
+
export declare const reset: (s: string) => string;
|
|
3
|
+
export declare const bold: (input: string) => string;
|
|
4
|
+
export declare const dim: (input: string) => string;
|
|
5
|
+
export declare const italic: (input: string) => string;
|
|
6
|
+
export declare const underline: (input: string) => string;
|
|
7
|
+
export declare const inverse: (input: string) => string;
|
|
8
|
+
export declare const hidden: (input: string) => string;
|
|
9
|
+
export declare const strikethrough: (input: string) => string;
|
|
10
|
+
export declare const black: (input: string) => string;
|
|
11
|
+
export declare const red: (input: string) => string;
|
|
12
|
+
export declare const green: (input: string) => string;
|
|
13
|
+
export declare const yellow: (input: string) => string;
|
|
14
|
+
export declare const blue: (input: string) => string;
|
|
15
|
+
export declare const magenta: (input: string) => string;
|
|
16
|
+
export declare const cyan: (input: string) => string;
|
|
17
|
+
export declare const white: (input: string) => string;
|
|
18
|
+
export declare const gray: (input: string) => string;
|
|
19
|
+
export declare const bgBlack: (input: string) => string;
|
|
20
|
+
export declare const bgRed: (input: string) => string;
|
|
21
|
+
export declare const bgGreen: (input: string) => string;
|
|
22
|
+
export declare const bgYellow: (input: string) => string;
|
|
23
|
+
export declare const bgBlue: (input: string) => string;
|
|
24
|
+
export declare const bgMagenta: (input: string) => string;
|
|
25
|
+
export declare const bgCyan: (input: string) => string;
|
|
26
|
+
export declare const bgWhite: (input: string) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as t from '@babel/types';
|
|
2
|
+
import * as m from '@codemod/matchers';
|
|
3
|
+
/** Match a module chunk, optionally by ID. */
|
|
4
|
+
export declare function chunk(id?: number): m.Matcher<t.ObjectProperty>;
|
|
5
|
+
/** Match a list of module chunks. */
|
|
6
|
+
export declare const chunks: m.Matcher<t.ObjectExpression>;
|
|
7
|
+
/** Match any module chunk. */
|
|
8
|
+
declare const _default: m.Matcher<t.ObjectProperty>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as m from '@codemod/matchers';
|
|
2
|
+
export declare const __createBinding: import("@babel/types").Expression;
|
|
3
|
+
/** Match `__createBinding`.
|
|
4
|
+
* @example
|
|
5
|
+
* ```javascript
|
|
6
|
+
* var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
* if (k2 === undefined) k2 = k;
|
|
8
|
+
* var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
* if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
* desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
* }
|
|
12
|
+
* Object.defineProperty(o, k2, desc);
|
|
13
|
+
* }) : (function(o, m, k, k2) {
|
|
14
|
+
* if (k2 === undefined) k2 = k;
|
|
15
|
+
* o[k2] = m[k];
|
|
16
|
+
* }));
|
|
17
|
+
* ```
|
|
18
|
+
* @example
|
|
19
|
+
* ```javascript
|
|
20
|
+
* var _v183 = this && this.__createBinding || (Object.create ? function (_a171, _a172, _a173, _a174) {
|
|
21
|
+
* if (_a174 === undefined) {
|
|
22
|
+
* _a174 = _a173;
|
|
23
|
+
* }
|
|
24
|
+
* Object.defineProperty(_a171, _a174, {
|
|
25
|
+
* enumerable: true,
|
|
26
|
+
* get: function () {
|
|
27
|
+
* return _a172[_a173];
|
|
28
|
+
* }
|
|
29
|
+
* });
|
|
30
|
+
* } : function (_a175, _a176, _a177, _a178) {
|
|
31
|
+
* if (_a178 === undefined) {
|
|
32
|
+
* _a178 = _a177;
|
|
33
|
+
* }
|
|
34
|
+
* _a175[_a178] = _a176[_a177];
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare const _default: m.Matcher<import("@babel/types").VariableDeclaration>;
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as m from '@codemod/matchers';
|
|
2
|
+
export declare const __exportStar: import("@babel/types").Expression;
|
|
3
|
+
/** Match `__exportStar`.
|
|
4
|
+
* @example
|
|
5
|
+
* ```javascript
|
|
6
|
+
* var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
7
|
+
* for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
8
|
+
* };
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: m.Matcher<import("@babel/types").VariableDeclaration>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as m from '@codemod/matchers';
|
|
2
|
+
export declare const __importDefault: import("@babel/types").Expression;
|
|
3
|
+
/** Match `__importDefault`.
|
|
4
|
+
* @example
|
|
5
|
+
* ```javascript
|
|
6
|
+
* var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
* return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
* };
|
|
9
|
+
* ```
|
|
10
|
+
* @example
|
|
11
|
+
* ```javascript
|
|
12
|
+
* var data_55311B = this && this.__importDefault || function (_a1) {
|
|
13
|
+
* if (_a1 && _a1.__esModule) {
|
|
14
|
+
* return _a1;
|
|
15
|
+
* } else {
|
|
16
|
+
* return {
|
|
17
|
+
* default: _a1
|
|
18
|
+
* };
|
|
19
|
+
* }
|
|
20
|
+
* };
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const _default: m.Matcher<import("@babel/types").VariableDeclaration>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as m from '@codemod/matchers';
|
|
2
|
+
export declare const __importStar: import("@babel/types").Expression;
|
|
3
|
+
/** Match `__importStar`.
|
|
4
|
+
* @example
|
|
5
|
+
* ```javascript
|
|
6
|
+
* var __importStar = (this && this.__importStar) || function (mod) {
|
|
7
|
+
* if (mod && mod.__esModule) return mod;
|
|
8
|
+
* var result = {};
|
|
9
|
+
* if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
10
|
+
* __setModuleDefault(result, mod);
|
|
11
|
+
* return result;
|
|
12
|
+
* };
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare const _default: m.Matcher<import("@babel/types").VariableDeclaration>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as m from '@codemod/matchers';
|
|
2
|
+
export declare const __setModuleDefault: import("@babel/types").Expression;
|
|
3
|
+
/** Match `__setModuleDefault`.
|
|
4
|
+
* @example
|
|
5
|
+
* ```javascript
|
|
6
|
+
* var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
7
|
+
* // this inline ObjectExpression could be emitted as an isolated VariableDeclarator in the scope
|
|
8
|
+
* Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
9
|
+
* }) : function(o, v) {
|
|
10
|
+
* o["default"] = v;
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare const _default: m.Matcher<import("@babel/types").VariableDeclaration>;
|
|
15
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delance/builder",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
|
+
"description": "A spear to the Python language server built with black magic",
|
|
5
|
+
"license": "0BSD",
|
|
4
6
|
"author": "mochaaP <npm@mochaa.ws>",
|
|
7
|
+
"type": "module",
|
|
5
8
|
"main": "dist/index.js",
|
|
6
9
|
"bin": {
|
|
7
10
|
"delance-builder": "dist/cli.js"
|
|
@@ -9,34 +12,15 @@
|
|
|
9
12
|
"files": [
|
|
10
13
|
"dist"
|
|
11
14
|
],
|
|
12
|
-
"packageManager": "pnpm@8.12.1",
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"@codemod/core": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/core&commit=f7526b4223cf97415c635b445271dee907d1401e&scripts.postinstall=rimraf%20tsconfig.json",
|
|
15
|
-
"@codemod/matchers": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/matchers&commit=f7526b4223cf97415c635b445271dee907d1401e&scripts.postinstall=rimraf%20tsconfig.json",
|
|
16
|
-
"@codemod/parser": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/parser&commit=f7526b4223cf97415c635b445271dee907d1401e&scripts.postinstall=rimraf%20tsconfig.json",
|
|
17
|
-
"@codemod/utils": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/utils&commit=f7526b4223cf97415c635b445271dee907d1401e&scripts.postinstall=rimraf%20tsconfig.json",
|
|
18
|
-
"@types/babel__core": "^7.20.5",
|
|
19
|
-
"@types/babel__generator": "^7",
|
|
20
|
-
"@types/babel__helper-validator-identifier": "^7",
|
|
21
|
-
"@types/babel__template": "^7",
|
|
22
|
-
"@types/babel__traverse": "^7",
|
|
23
|
-
"@types/bun": "^1.0.0",
|
|
24
|
-
"@types/debug": "^4",
|
|
25
|
-
"bun": "^1.0.20",
|
|
26
|
-
"rimraf": "^5.0.5",
|
|
27
|
-
"typescript": "^5.3",
|
|
28
|
-
"webcrack": "https://gitpkg.vercel.app/api/pkg.tgz?url=j4k0xb/webcrack/packages/webcrack&commit=fdf21377287e6b492a152c3c588e6614d59af212&scripts.postinstall=rimraf%20tsconfig.json",
|
|
29
|
-
"xo": "^0.56.0"
|
|
30
|
-
},
|
|
31
|
-
"description": "A spear to the Python language server built with black magic",
|
|
32
|
-
"engines": {
|
|
33
|
-
"node": ">=18"
|
|
34
|
-
},
|
|
35
15
|
"eslintConfig": {
|
|
36
16
|
"env": {
|
|
37
17
|
"es2024": true,
|
|
38
18
|
"node": true
|
|
39
19
|
},
|
|
20
|
+
"parserOptions": {
|
|
21
|
+
"ecmaVersion": "latest",
|
|
22
|
+
"sourceType": "module"
|
|
23
|
+
},
|
|
40
24
|
"extends": "./node_modules/xo/config/plugins.cjs",
|
|
41
25
|
"overrides": [
|
|
42
26
|
{
|
|
@@ -48,8 +32,8 @@
|
|
|
48
32
|
"xo-typescript"
|
|
49
33
|
],
|
|
50
34
|
"rules": {
|
|
51
|
-
"@typescript-eslint/naming-convention": "off",
|
|
52
35
|
"@typescript-eslint/consistent-type-definitions": "warn",
|
|
36
|
+
"@typescript-eslint/naming-convention": "off",
|
|
53
37
|
"import/extensions": "off",
|
|
54
38
|
"import/no-named-as-default-member": "off",
|
|
55
39
|
"unicorn/prefer-regexp-test": "off",
|
|
@@ -61,24 +45,15 @@
|
|
|
61
45
|
"utils/matchers/*.ts"
|
|
62
46
|
],
|
|
63
47
|
"rules": {
|
|
64
|
-
"unicorn/
|
|
65
|
-
"unicorn/
|
|
48
|
+
"unicorn/filename-case": "off",
|
|
49
|
+
"unicorn/prevent-abbreviations": "off"
|
|
66
50
|
}
|
|
67
51
|
}
|
|
68
52
|
],
|
|
69
|
-
"parserOptions": {
|
|
70
|
-
"ecmaVersion": "latest",
|
|
71
|
-
"sourceType": "module"
|
|
72
|
-
},
|
|
73
53
|
"ignorePatterns": [
|
|
74
54
|
"dist"
|
|
75
55
|
]
|
|
76
56
|
},
|
|
77
|
-
"license": "0BSD",
|
|
78
|
-
"type": "module",
|
|
79
|
-
"peerDependencies": {
|
|
80
|
-
"debug": "^4"
|
|
81
|
-
},
|
|
82
57
|
"dependencies": {
|
|
83
58
|
"@babel/code-frame": "esm",
|
|
84
59
|
"@babel/core": "esm",
|
|
@@ -90,6 +65,31 @@
|
|
|
90
65
|
"@babel/types": "esm",
|
|
91
66
|
"quickjs-emscripten": "^0.25.1"
|
|
92
67
|
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@codemod/core": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/core&commit=f7526b4223cf97415c635b445271dee907d1401e&scripts.postinstall=rimraf tsconfig.json",
|
|
70
|
+
"@codemod/matchers": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/matchers&commit=f7526b4223cf97415c635b445271dee907d1401e&scripts.postinstall=rimraf tsconfig.json",
|
|
71
|
+
"@codemod/parser": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/parser&commit=f7526b4223cf97415c635b445271dee907d1401e&scripts.postinstall=rimraf tsconfig.json",
|
|
72
|
+
"@codemod/utils": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/utils&commit=f7526b4223cf97415c635b445271dee907d1401e&scripts.postinstall=rimraf tsconfig.json",
|
|
73
|
+
"@types/babel__core": "^7",
|
|
74
|
+
"@types/babel__generator": "^7",
|
|
75
|
+
"@types/babel__helper-validator-identifier": "^7",
|
|
76
|
+
"@types/babel__template": "^7",
|
|
77
|
+
"@types/babel__traverse": "^7",
|
|
78
|
+
"@types/bun": "^1.0.0",
|
|
79
|
+
"@types/debug": "^4",
|
|
80
|
+
"bun": "^1.0.20",
|
|
81
|
+
"rimraf": "^5.0.5",
|
|
82
|
+
"typescript": "^5.3",
|
|
83
|
+
"webcrack": "https://gitpkg.vercel.app/api/pkg.tgz?url=j4k0xb/webcrack/packages/webcrack&commit=fdf21377287e6b492a152c3c588e6614d59af212&scripts.postinstall=rimraf tsconfig.json",
|
|
84
|
+
"xo": "^0.56.0"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"debug": "^4"
|
|
88
|
+
},
|
|
89
|
+
"packageManager": "pnpm@8.12.1",
|
|
90
|
+
"engines": {
|
|
91
|
+
"node": ">=18"
|
|
92
|
+
},
|
|
93
93
|
"overrides": {
|
|
94
94
|
"webcrack": {
|
|
95
95
|
"@codemod/matchers": "$@codemod/matchers",
|
|
@@ -107,16 +107,11 @@
|
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
|
-
"build": "bun build index.ts cli.ts --target=node --splitting -e=isolated-vm -e=quickjs-emscripten -e=@babel -e=debug --
|
|
110
|
+
"build": "bun build index.ts cli.ts --target=node --splitting -e=isolated-vm -e=quickjs-emscripten -e=@babel -e=debug --outdir=dist",
|
|
111
111
|
"build:minify": "bun run build --minify --entry-naming [dir]/[name].min.[ext]",
|
|
112
|
-
"
|
|
113
|
-
"prepare": "rimraf dist && bun run build",
|
|
112
|
+
"build:types": "tsc -p tsconfig.build.json || exit 0",
|
|
114
113
|
"lint": "eslint .",
|
|
115
|
-
"lint:fix": "eslint . --fix"
|
|
116
|
-
|
|
117
|
-
"pnpm": {
|
|
118
|
-
"patchedDependencies": {
|
|
119
|
-
"webcrack@2.11.1": "patches/webcrack@2.11.1.patch"
|
|
120
|
-
}
|
|
114
|
+
"lint:fix": "eslint . --fix",
|
|
115
|
+
"start": "bun cli.ts"
|
|
121
116
|
}
|
|
122
|
-
}
|
|
117
|
+
}
|
package/dist/cli.js.map
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|