@swc/core 1.2.103 → 1.2.107
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/Visitor.d.ts +3 -3
- package/Visitor.js +6 -6
- package/cspell.json +3 -0
- package/deny.toml +2 -0
- package/index.js +2 -2
- package/package.json +15 -14
- package/types.d.ts +4 -1
package/Visitor.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ export declare class Visitor {
|
|
|
11
11
|
visitTsImportEqualsDeclaration(n: TsImportEqualsDeclaration): ModuleDeclaration;
|
|
12
12
|
visitTsModuleReference(n: TsModuleReference): TsModuleReference;
|
|
13
13
|
visitTsExternalModuleReference(n: TsExternalModuleReference): TsExternalModuleReference;
|
|
14
|
-
|
|
14
|
+
visitExportAllDeclaration(n: ExportAllDeclaration): ModuleDeclaration;
|
|
15
15
|
visitExportDefaultExpression(n: ExportDefaultExpression): ModuleDeclaration;
|
|
16
|
-
|
|
16
|
+
visitExportNamedDeclaration(n: ExportNamedDeclaration): ModuleDeclaration;
|
|
17
17
|
visitExportSpecifiers(nodes: ExportSpecifier[]): ExportSpecifier[];
|
|
18
18
|
visitExportSpecifier(n: ExportSpecifier): ExportSpecifier;
|
|
19
19
|
visitNamedExportSpecifier(n: NamedExportSpecifier): ExportSpecifier;
|
|
@@ -73,7 +73,7 @@ export declare class Visitor {
|
|
|
73
73
|
visitTsEnumMember(n: TsEnumMember): TsEnumMember;
|
|
74
74
|
visitTsEnumMemberId(n: TsEnumMemberId): TsEnumMemberId;
|
|
75
75
|
visitFunctionDeclaration(decl: FunctionDeclaration): Declaration;
|
|
76
|
-
|
|
76
|
+
visitClassDeclaration(decl: ClassDeclaration): Declaration;
|
|
77
77
|
visitClassBody(members: ClassMember[]): ClassMember[];
|
|
78
78
|
visitClassMember(member: ClassMember): ClassMember;
|
|
79
79
|
visitTsIndexSignature(n: TsIndexSignature): ClassMember;
|
package/Visitor.js
CHANGED
|
@@ -44,13 +44,13 @@ class Visitor {
|
|
|
44
44
|
case "ExportDefaultDeclaration":
|
|
45
45
|
return this.visitExportDefaultDeclaration(n);
|
|
46
46
|
case "ExportNamedDeclaration":
|
|
47
|
-
return this.
|
|
47
|
+
return this.visitExportNamedDeclaration(n);
|
|
48
48
|
case "ExportDefaultExpression":
|
|
49
49
|
return this.visitExportDefaultExpression(n);
|
|
50
50
|
case "ImportDeclaration":
|
|
51
51
|
return this.visitImportDeclaration(n);
|
|
52
52
|
case "ExportAllDeclaration":
|
|
53
|
-
return this.
|
|
53
|
+
return this.visitExportAllDeclaration(n);
|
|
54
54
|
case "TsImportEqualsDeclaration":
|
|
55
55
|
return this.visitTsImportEqualsDeclaration(n);
|
|
56
56
|
case "TsExportAssignment":
|
|
@@ -86,7 +86,7 @@ class Visitor {
|
|
|
86
86
|
n.expression = this.visitExpression(n.expression);
|
|
87
87
|
return n;
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
visitExportAllDeclaration(n) {
|
|
90
90
|
n.source = this.visitStringLiteral(n.source);
|
|
91
91
|
return n;
|
|
92
92
|
}
|
|
@@ -94,7 +94,7 @@ class Visitor {
|
|
|
94
94
|
n.expression = this.visitExpression(n.expression);
|
|
95
95
|
return n;
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
visitExportNamedDeclaration(n) {
|
|
98
98
|
n.specifiers = this.visitExportSpecifiers(n.specifiers);
|
|
99
99
|
n.source = this.visitOptionalStringLiteral(n.source);
|
|
100
100
|
return n;
|
|
@@ -381,7 +381,7 @@ class Visitor {
|
|
|
381
381
|
visitDeclaration(decl) {
|
|
382
382
|
switch (decl.type) {
|
|
383
383
|
case "ClassDeclaration":
|
|
384
|
-
return this.
|
|
384
|
+
return this.visitClassDeclaration(decl);
|
|
385
385
|
case "FunctionDeclaration":
|
|
386
386
|
return this.visitFunctionDeclaration(decl);
|
|
387
387
|
case "TsEnumDeclaration":
|
|
@@ -496,7 +496,7 @@ class Visitor {
|
|
|
496
496
|
decl = this.visitFunction(decl);
|
|
497
497
|
return decl;
|
|
498
498
|
}
|
|
499
|
-
|
|
499
|
+
visitClassDeclaration(decl) {
|
|
500
500
|
decl = this.visitClass(decl);
|
|
501
501
|
decl.identifier = this.visitIdentifier(decl.identifier);
|
|
502
502
|
return decl;
|
package/cspell.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"ahash",
|
|
8
8
|
"anonymized",
|
|
9
9
|
"ANONYMIZED",
|
|
10
|
+
"ansi",
|
|
10
11
|
"Ansi",
|
|
11
12
|
"armv",
|
|
12
13
|
"arrayvec",
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
"LPCSTR",
|
|
76
77
|
"LPSECURITY",
|
|
77
78
|
"mbcs",
|
|
79
|
+
"memchr",
|
|
78
80
|
"mimalloc",
|
|
79
81
|
"minifier",
|
|
80
82
|
"miri",
|
|
@@ -91,6 +93,7 @@
|
|
|
91
93
|
"prec",
|
|
92
94
|
"PREC",
|
|
93
95
|
"proto",
|
|
96
|
+
"proxied",
|
|
94
97
|
"punct",
|
|
95
98
|
"putc",
|
|
96
99
|
"qself",
|
package/deny.toml
CHANGED
package/index.js
CHANGED
|
@@ -34,7 +34,7 @@ exports.DEFAULT_EXTENSIONS = exports.minifySync = exports.minify = exports.bundl
|
|
|
34
34
|
__exportStar(require("./types"), exports);
|
|
35
35
|
const spack_1 = require("./spack");
|
|
36
36
|
const helper_1 = require("@node-rs/helper");
|
|
37
|
-
const bindings =
|
|
37
|
+
const bindings = helper_1.loadBinding(__dirname, "swc", "@swc/core");
|
|
38
38
|
/**
|
|
39
39
|
* Version of the swc binding.
|
|
40
40
|
*/
|
|
@@ -166,7 +166,7 @@ class Compiler {
|
|
|
166
166
|
}
|
|
167
167
|
bundle(options) {
|
|
168
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
-
const opts = yield
|
|
169
|
+
const opts = yield spack_1.compileBundleOptions(options);
|
|
170
170
|
if (Array.isArray(opts)) {
|
|
171
171
|
const all = yield Promise.all(opts.map((opt) => __awaiter(this, void 0, void 0, function* () {
|
|
172
172
|
return this.bundle(opt);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swc/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.107",
|
|
4
4
|
"description": "Super-fast alternative for babel",
|
|
5
5
|
"homepage": "https://swc.rs",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"defaults": true,
|
|
32
32
|
"additional": [
|
|
33
33
|
"x86_64-unknown-linux-musl",
|
|
34
|
+
"x86_64-unknown-freebsd",
|
|
34
35
|
"i686-pc-windows-msvc",
|
|
35
36
|
"aarch64-unknown-linux-gnu",
|
|
36
37
|
"armv7-unknown-linux-gnueabihf",
|
|
37
38
|
"aarch64-apple-darwin",
|
|
38
39
|
"aarch64-linux-android",
|
|
39
|
-
"x86_64-unknown-freebsd",
|
|
40
40
|
"aarch64-unknown-linux-musl",
|
|
41
41
|
"aarch64-pc-windows-msvc"
|
|
42
42
|
]
|
|
@@ -50,18 +50,18 @@
|
|
|
50
50
|
"@node-rs/helper": "^1.0.0"
|
|
51
51
|
},
|
|
52
52
|
"optionalDependencies": {
|
|
53
|
-
"@swc/core-win32-x64-msvc": "1.2.
|
|
54
|
-
"@swc/core-darwin-x64": "1.2.
|
|
55
|
-
"@swc/core-linux-x64-gnu": "1.2.
|
|
56
|
-
"@swc/core-linux-x64-musl": "1.2.
|
|
57
|
-
"@swc/core-
|
|
58
|
-
"@swc/core-
|
|
59
|
-
"@swc/core-linux-
|
|
60
|
-
"@swc/core-
|
|
61
|
-
"@swc/core-
|
|
62
|
-
"@swc/core-
|
|
63
|
-
"@swc/core-linux-arm64-musl": "1.2.
|
|
64
|
-
"@swc/core-win32-arm64-msvc": "1.2.
|
|
53
|
+
"@swc/core-win32-x64-msvc": "^1.2.107",
|
|
54
|
+
"@swc/core-darwin-x64": "^1.2.107",
|
|
55
|
+
"@swc/core-linux-x64-gnu": "^1.2.107",
|
|
56
|
+
"@swc/core-linux-x64-musl": "^1.2.107",
|
|
57
|
+
"@swc/core-freebsd-x64": "^1.2.107",
|
|
58
|
+
"@swc/core-win32-ia32-msvc": "^1.2.107",
|
|
59
|
+
"@swc/core-linux-arm64-gnu": "^1.2.107",
|
|
60
|
+
"@swc/core-linux-arm-gnueabihf": "^1.2.107",
|
|
61
|
+
"@swc/core-darwin-arm64": "^1.2.107",
|
|
62
|
+
"@swc/core-android-arm64": "^1.2.107",
|
|
63
|
+
"@swc/core-linux-arm64-musl": "^1.2.107",
|
|
64
|
+
"@swc/core-win32-arm64-msvc": "^1.2.107"
|
|
65
65
|
},
|
|
66
66
|
"types": "./index.d.ts",
|
|
67
67
|
"scripts": {
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"prepublishOnly": "tsc -d && napi prepublish -p scripts/npm --tagstyle npm",
|
|
71
71
|
"build": "tsc -d && napi build --platform --release --cargo-name node --cargo-flags=\"-p node\"",
|
|
72
72
|
"build:dev": "tsc -d && napi build --platform --cargo-name node --cargo-flags=\"-p node\"",
|
|
73
|
+
"build:ts": "tsc -d",
|
|
73
74
|
"test": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest node-swc/__tests__",
|
|
74
75
|
"version": "napi version -p scripts/npm"
|
|
75
76
|
},
|
package/types.d.ts
CHANGED
|
@@ -524,7 +524,7 @@ export interface GlobalPassOption {
|
|
|
524
524
|
*/
|
|
525
525
|
envs?: string[];
|
|
526
526
|
}
|
|
527
|
-
export declare type ModuleConfig = CommonJsConfig | UmdConfig | AmdConfig;
|
|
527
|
+
export declare type ModuleConfig = Es6Config | CommonJsConfig | UmdConfig | AmdConfig;
|
|
528
528
|
export interface BaseModuleConfig {
|
|
529
529
|
/**
|
|
530
530
|
* By default, when using exports with babel a non-enumerable `__esModule`
|
|
@@ -590,6 +590,9 @@ export interface BaseModuleConfig {
|
|
|
590
590
|
*/
|
|
591
591
|
noInterop?: boolean;
|
|
592
592
|
}
|
|
593
|
+
export interface Es6Config extends BaseModuleConfig {
|
|
594
|
+
type: "es6";
|
|
595
|
+
}
|
|
593
596
|
export interface CommonJsConfig extends BaseModuleConfig {
|
|
594
597
|
type: "commonjs";
|
|
595
598
|
}
|