@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 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
- visitExportAllDeclration(n: ExportAllDeclaration): ModuleDeclaration;
14
+ visitExportAllDeclaration(n: ExportAllDeclaration): ModuleDeclaration;
15
15
  visitExportDefaultExpression(n: ExportDefaultExpression): ModuleDeclaration;
16
- visitExportNamedDeclration(n: ExportNamedDeclaration): ModuleDeclaration;
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
- visitClassDeclartion(decl: ClassDeclaration): Declaration;
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.visitExportNamedDeclration(n);
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.visitExportAllDeclration(n);
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
- visitExportAllDeclration(n) {
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
- visitExportNamedDeclration(n) {
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.visitClassDeclartion(decl);
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
- visitClassDeclartion(decl) {
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
@@ -78,6 +78,8 @@ allow = [
78
78
  "BSD-3-Clause",
79
79
  "CC0-1.0",
80
80
  "ISC",
81
+ "Zlib",
82
+ "MPL-2.0",
81
83
  ]
82
84
  # List of explictly disallowed licenses
83
85
  # See https://spdx.org/licenses/ for list of possible licenses
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 = (0, helper_1.loadBinding)(__dirname, "swc", "@swc/core");
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 (0, spack_1.compileBundleOptions)(options);
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.103",
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.103",
54
- "@swc/core-darwin-x64": "1.2.103",
55
- "@swc/core-linux-x64-gnu": "1.2.103",
56
- "@swc/core-linux-x64-musl": "1.2.103",
57
- "@swc/core-win32-ia32-msvc": "1.2.103",
58
- "@swc/core-linux-arm64-gnu": "1.2.103",
59
- "@swc/core-linux-arm-gnueabihf": "1.2.103",
60
- "@swc/core-darwin-arm64": "1.2.103",
61
- "@swc/core-android-arm64": "1.2.103",
62
- "@swc/core-freebsd-x64": "1.2.103",
63
- "@swc/core-linux-arm64-musl": "1.2.103",
64
- "@swc/core-win32-arm64-msvc": "1.2.103"
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
  }