@delance/builder 0.2.16 → 0.3.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/package.json CHANGED
@@ -1,119 +1,62 @@
1
1
  {
2
2
  "name": "@delance/builder",
3
- "version": "0.2.16",
3
+ "type": "module",
4
+ "version": "0.3.0",
4
5
  "description": "A spear to the Python language server built with black magic",
5
- "license": "0BSD",
6
6
  "author": "mochaaP <npm@mochaa.ws>",
7
- "type": "module",
7
+ "license": "0BSD",
8
+ "exports": {
9
+ "types": "./types.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
8
12
  "main": "dist/index.js",
9
13
  "bin": {
10
14
  "delance-builder": "dist/cli.js"
11
15
  },
12
16
  "files": [
17
+ "./types.d.ts",
13
18
  "dist"
14
19
  ],
15
- "eslintConfig": {
16
- "env": {
17
- "es2024": true,
18
- "node": true
19
- },
20
- "parserOptions": {
21
- "ecmaVersion": "latest",
22
- "sourceType": "module"
23
- },
24
- "extends": [
25
- "xo",
26
- "./node_modules/xo/config/plugins.cjs"
27
- ],
28
- "overrides": [
29
- {
30
- "files": [
31
- "*.ts",
32
- "*.tsx"
33
- ],
34
- "extends": [
35
- "xo-typescript"
36
- ],
37
- "rules": {
38
- "@typescript-eslint/consistent-type-definitions": "warn",
39
- "@typescript-eslint/naming-convention": "off",
40
- "import/extensions": "off",
41
- "import/no-named-as-default-member": "off",
42
- "unicorn/prefer-regexp-test": "off",
43
- "unicorn/no-anonymous-default-export": "off",
44
- "n/prefer-global/process": "off",
45
- "n/file-extension-in-import": "off"
46
- }
47
- },
48
- {
49
- "files": [
50
- "utils/matchers/*.ts"
51
- ],
52
- "rules": {
53
- "unicorn/filename-case": "off",
54
- "unicorn/prevent-abbreviations": "off"
55
- }
56
- }
57
- ],
58
- "ignorePatterns": [
59
- "dist"
60
- ]
20
+ "engines": {
21
+ "node": ">=18"
22
+ },
23
+ "peerDependencies": {
24
+ "debug": "^4"
61
25
  },
62
26
  "dependencies": {
63
- "@babel/code-frame": "esm",
64
- "@babel/core": "esm",
65
- "@babel/generator": "esm",
66
- "@babel/helper-validator-identifier": "esm",
67
- "@babel/parser": "esm",
68
- "@babel/template": "esm",
69
- "@babel/traverse": "esm",
70
- "@babel/types": "esm",
27
+ "@babel/code-frame": "^7.26.2",
28
+ "@babel/core": "^7.26.0",
29
+ "@babel/generator": "^7.26.3",
30
+ "@babel/helper-validator-identifier": "^7.25.9",
31
+ "@babel/parser": "^7.26.3",
32
+ "@babel/template": "^7.25.9",
33
+ "@babel/traverse": "^7.26.4",
34
+ "@babel/types": "^7.26.3",
71
35
  "quickjs-emscripten": "^0.29.2"
72
36
  },
73
37
  "devDependencies": {
74
- "@codemod/core": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/core&commit=e6be3de6d36b144f07d7bfea05e919357d3852fb&scripts.postinstall=rimraf tsconfig.json",
75
- "@codemod/matchers": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/matchers&commit=e6be3de6d36b144f07d7bfea05e919357d3852fb&scripts.postinstall=rimraf tsconfig.json",
76
- "@codemod/parser": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/parser&commit=e6be3de6d36b144f07d7bfea05e919357d3852fb&scripts.postinstall=rimraf tsconfig.json",
77
- "@codemod/utils": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/utils&commit=e6be3de6d36b144f07d7bfea05e919357d3852fb&scripts.postinstall=rimraf tsconfig.json",
38
+ "@codemod/core": "npm:@codemod-esm/core@^2.2.1",
39
+ "@codemod/matchers": "npm:@codemod-esm/matchers@^1.7.1",
40
+ "@codemod/parser": "npm:@codemod-esm/parser@^1.4.2",
41
+ "@codemod/utils": "npm:@codemod-esm/utils@^1.1.1",
42
+ "@mochaa/eslintrc": "^0.1.8",
78
43
  "@types/babel__core": "^7.20.5",
79
44
  "@types/babel__generator": "^7.6.8",
80
45
  "@types/babel__helper-validator-identifier": "^7.15.2",
81
46
  "@types/babel__template": "^7.4.4",
82
47
  "@types/babel__traverse": "^7.20.6",
83
- "@types/bun": "^1.1.13",
48
+ "@types/bun": "^1.1.14",
84
49
  "@types/debug": "^4.1.12",
85
- "bun": "^1.1.34",
50
+ "bun": "^1.1.38",
51
+ "eslint": "^9.16.0",
86
52
  "rimraf": "^6.0.1",
87
- "typescript": "^5.6.3",
88
- "webcrack": "https://gitpkg.vercel.app/api/pkg.tgz?url=j4k0xb/webcrack/packages/webcrack&commit=f49c737e78a0b2dfd0b05059ad9dad92647ca76b&scripts.postinstall=rimraf tsconfig.json",
89
- "xo": "^0.59.3"
90
- },
91
- "peerDependencies": {
92
- "debug": "^4"
93
- },
94
- "engines": {
95
- "node": ">=18"
96
- },
97
- "overrides": {
98
- "webcrack": {
99
- "@codemod/matchers": "$@codemod/matchers",
100
- "@codemod/utils": "$@codemod/utils",
101
- "@codemod/core": "$@codemod/core",
102
- "@codemod/parser": "$@codemod/parser",
103
- "@babel/generator": "$@babel/generator",
104
- "@babel/helper-validator-identifier": "$@babel/helper-validator-identifier",
105
- "@babel/parser": "$@babel/parser",
106
- "@babel/template": "$@babel/template",
107
- "@babel/traverse": "$@babel/traverse",
108
- "@babel/types": "$@babel/types",
109
- "@babel/code-frame": "$@babel/code-frame",
110
- "@babel/core": "$@babel/core"
111
- }
53
+ "typescript": "^5.7.2",
54
+ "webcrack": "github:j4k0xb/webcrack"
112
55
  },
113
56
  "scripts": {
114
57
  "build": "bun build index.ts cli.ts --target=node --splitting -e=isolated-vm -e=quickjs-emscripten -e=@babel -e=debug --outdir=dist",
115
- "build:minify": "bun run build --minify --entry-naming [dir]/[name].min.[ext]",
116
- "build:types": "tsc -p tsconfig.build.json || exit 0",
58
+ "build:minify": "pnpm run build --minify --entry-naming [dir]/[name].min.[ext]",
59
+ "build:webcrack": "tsc -p ./tsconfig.webcrack.json",
117
60
  "lint": "eslint .",
118
61
  "lint:fix": "eslint . --fix",
119
62
  "start": "bun cli.ts"
package/types.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type * as t from '@babel/types';
2
+
3
+ export default function (code: string): Promise<string>;
4
+ export function transform(ast: t.Node): Promise<t.Node>;
package/dist/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env bun
2
- export declare function main(argv: string[]): Promise<void>;
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export default function (code: string): Promise<string>;
2
- export { default as transform } from './transform';
@@ -1,19 +0,0 @@
1
- import type { NodePath } from '@babel/traverse';
2
- import * as t from '@babel/types';
3
- /** Remove unwanted features e.g. License check and Telemetry */
4
- declare const _default: {
5
- name: string;
6
- tags: "unsafe"[];
7
- visitor: () => {
8
- CallExpression: {
9
- exit(this: import("webcrack/src/ast-utils").TransformState, $: NodePath<t.CallExpression>): void;
10
- };
11
- AssignmentExpression: {
12
- exit(this: import("webcrack/src/ast-utils").TransformState, $: NodePath<t.AssignmentExpression>): void;
13
- };
14
- IfStatement: {
15
- exit(this: import("webcrack/src/ast-utils").TransformState, $: NodePath<t.IfStatement>): void;
16
- };
17
- };
18
- };
19
- export default _default;
@@ -1,5 +0,0 @@
1
- import type * as t from '@babel/types';
2
- /**
3
- * Delance specific transforms.
4
- */
5
- export default function transform(ast: t.Node): t.Node;
@@ -1,11 +0,0 @@
1
- import { type TraverseOptions } from '@babel/traverse';
2
- import type { TransformState } from 'webcrack/ast-utils';
3
- import * as t from '@babel/types';
4
- /** Decrypt AES encrypted string constants. */
5
- declare const _default: {
6
- name: string;
7
- tags: "safe"[];
8
- run(ast: t.Node): void;
9
- visitor(): TraverseOptions<TransformState>;
10
- };
11
- export default _default;
@@ -1,17 +0,0 @@
1
- import type { TraverseOptions } from '@babel/traverse';
2
- import type { TransformState } from 'webcrack/ast-utils';
3
- /**
4
- * Removes the `__esModule` flag from the module.
5
- *
6
- * @example
7
- * ```diff
8
- * - Object.defineProperty(exports, '__esModule', { value: true })
9
- * ```
10
- * @link <https://github.com/pionxzh/wakaru/tree/main/packages/unminify/src/transformations/un-esmodule-flag.ts>
11
- */
12
- declare const _default: {
13
- name: string;
14
- tags: "unsafe"[];
15
- visitor(): TraverseOptions<TransformState>;
16
- };
17
- export default _default;
@@ -1,5 +0,0 @@
1
- import type * as t from '@babel/types';
2
- /**
3
- * Restore minified webpack-style ESM helpers.
4
- */
5
- export default function transform(ast: t.Node): t.Node;
@@ -1,20 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- import type * as t from '@babel/types';
2
- export default function transform(ast: t.Node): Promise<t.Node>;
@@ -1,11 +0,0 @@
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;
@@ -1,5 +0,0 @@
1
- import type * as t from '@babel/types';
2
- /**
3
- * Restore common transpiled syntax sugar
4
- */
5
- export default function transform(ast: t.Node): t.Node;
@@ -1,8 +0,0 @@
1
- import type { TransformState } from 'webcrack/ast-utils';
2
- import type { TraverseOptions } from '@babel/traverse';
3
- declare const _default: {
4
- name: string;
5
- tags: "safe"[];
6
- visitor(): TraverseOptions<TransformState>;
7
- };
8
- export default _default;
@@ -1,5 +0,0 @@
1
- import type * as t from '@babel/types';
2
- /**
3
- * Run webcrack passes.
4
- */
5
- export default function transform(ast: t.Node): Promise<t.Node>;
@@ -1,12 +0,0 @@
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;
@@ -1,26 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- export declare function salt(x?: string): string;
2
- export declare function lic(x?: string): string;
3
- export declare function decrypt(m: string): string;
4
- export declare function encrypt(m: string): string;
@@ -1,9 +0,0 @@
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;
@@ -1,39 +0,0 @@
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;
@@ -1,12 +0,0 @@
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;
@@ -1,24 +0,0 @@
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;
@@ -1,16 +0,0 @@
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;
@@ -1,15 +0,0 @@
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;