@swc/core 1.2.156 → 1.2.159

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/CHANGELOG.md CHANGED
@@ -5,6 +5,120 @@
5
5
 
6
6
 
7
7
 
8
+ - **(api/rust)** Exclude test files from rust packages (#4091) ([533f756](https://github.com/swc-project/swc/commit/533f75627405fbb05fcebf42a49105d019093ffe))
9
+
10
+
11
+ - **(common)** Fix handling of input source maps (#4086) ([b716210](https://github.com/swc-project/swc/commit/b716210de1495d11f45f74bdc3941826a9dd5d6a))
12
+
13
+
14
+ - **(es/compat)** Visit generated codes from `arrow` (#4090) ([cb0881c](https://github.com/swc-project/swc/commit/cb0881cc3dd4ea8fb880e7cbd9eb6a11031a8e9b))
15
+
16
+
17
+ - **(es/compat)** Revert wrong fix of `arrow` (#4093) ([0d6bd81](https://github.com/swc-project/swc/commit/0d6bd813b209155fcf45baa6f0195657ee383845))
18
+
19
+
20
+ - **(es/module/cjs)** Fix conflict of a local export and exports-alls (#4089) ([6ac7934](https://github.com/swc-project/swc/commit/6ac793401769028f7e18b642303de46592d39598))
21
+
22
+
23
+ - **(es/resolver)** Fix handling of decorators (#4084) ([f662298](https://github.com/swc-project/swc/commit/f66229822c2e44d35854cd9a1ecbdae82242a08c))
24
+
25
+ ### Features
26
+
27
+
28
+
29
+ - **(es/lints)** Implement `no-new-symbol` rule (#4076) ([b39e345](https://github.com/swc-project/swc/commit/b39e345d8e43c3e6c1491f7b75448e3b091d7b0d))
30
+
31
+
32
+ - **(es/module/cjs)** Support `import.meta.url` (#4087) ([d0f687b](https://github.com/swc-project/swc/commit/d0f687bf44862e737e189dc585e9f1b789291685))
33
+
34
+ ### Testing
35
+
36
+
37
+
38
+ - **(es/parser)** Add a test for a fixed issue (#4085) ([792ab2c](https://github.com/swc-project/swc/commit/792ab2ca251eadd5a85e496a35af31acada7cf9f))
39
+
40
+ ## [1.2.158] - 2022-03-18
41
+
42
+ ### Bug Fixes
43
+
44
+
45
+
46
+ - **(css/prefixer)** Reduce the number of vars in debug build (#4078) ([4af5e6d](https://github.com/swc-project/swc/commit/4af5e6d77bff7bf6bf247b18185b22754c3ceceb))
47
+
48
+
49
+ - **(es/helpers)** Fix decorator helper script (#4072) ([55cfad1](https://github.com/swc-project/swc/commit/55cfad152d52e7f818fc4e71913e94ce84ab91a2))
50
+
51
+
52
+ - **(es/modules)** Fix sourcemap, really (#4074) ([22d005e](https://github.com/swc-project/swc/commit/22d005e2246505ad01ee1aef0be714f98ff7b577))
53
+
54
+
55
+ - **(es/react)** Fix `_createElement` (#4070) ([bb08354](https://github.com/swc-project/swc/commit/bb08354950beb8155fbe27abcc391e43e1c15e2b))
56
+
57
+ ### Features
58
+
59
+
60
+
61
+ - **(es/modules)** Support namespaced reexports (#4073) ([9458f08](https://github.com/swc-project/swc/commit/9458f08092e544cf051a88001b195f8543035d1c))
62
+
63
+ ### Miscellaneous Tasks
64
+
65
+
66
+
67
+ - **(repo)** Auto-lock outdated issues and PRs (#4066) ([ed7a5e5](https://github.com/swc-project/swc/commit/ed7a5e54ccdf7f6835082286fa9892f0cf3ac270))
68
+
69
+ ## [1.2.157] - 2022-03-17
70
+
71
+ ### Bug Fixes
72
+
73
+
74
+
75
+ - **(es/ast)** Revert removal of `definite` in `PrivateProp` (#4051) ([bbe8f3d](https://github.com/swc-project/swc/commit/bbe8f3d8fe0a5a62fa2624c5cbe46980ad6264ac))
76
+
77
+
78
+ - **(es/codegen)** Fix codegen of string literals (#4037) ([bd444c0](https://github.com/swc-project/swc/commit/bd444c0ceb1bfdc8582e15dec439917474b55b25))
79
+
80
+
81
+ - **(es/codegen)** Fix sourcemap (#4062) ([9310c39](https://github.com/swc-project/swc/commit/9310c39fe922283b4bea46c30b08f8768cda577d))
82
+
83
+
84
+ - **(es/helpers)** Add missing `export` for `classPrivateFieldLooseKey` (#4045) ([3125bba](https://github.com/swc-project/swc/commit/3125bbacbe1dc9afa9e2c809146dcf42ab5c82de))
85
+
86
+
87
+ - **(es/helpers)** Export `classPrivateFieldLooseKey` as `default` (#4047) ([025c921](https://github.com/swc-project/swc/commit/025c921409caa53131bdacd3db2d4adeb1806d52))
88
+
89
+
90
+ - **(es/helpers)** Fix the name of `_classPrivateFieldLooseBase` (#4061) ([f8a3849](https://github.com/swc-project/swc/commit/f8a3849299e666e1b6543fec953732ed9c88a225))
91
+
92
+
93
+ - **(es/parser)** Allow nested ambient context in `.d.ts` files (#4060) ([ffcb6ce](https://github.com/swc-project/swc/commit/ffcb6ce523fb4ffba8531d5194f69e62c63d3d9a))
94
+
95
+
96
+ - **(plugin/runner)** Make build pass for `wasm32` (#4056) ([5c84fe5](https://github.com/swc-project/swc/commit/5c84fe525f336064eaa5b383cb4606f1b3cd8df2))
97
+
98
+ ### Features
99
+
100
+
101
+
102
+ - **(cli)** Enable plugins for `swc_cli` (#4059) ([fefb587](https://github.com/swc-project/swc/commit/fefb5870c7ed9bb4a97be778bf3be1eee74aa344))
103
+
104
+
105
+ - **(css/prefixer)** Support more properties (#4055) ([f2517a3](https://github.com/swc-project/swc/commit/f2517a345bcae30ebb4f0b2910a8db31e944648d))
106
+
107
+
108
+ - **(es/lints)** Implement `yoda` rule (#3886) ([833958b](https://github.com/swc-project/swc/commit/833958bd7469993e756c24dcd1263ef2c5ef9eb9))
109
+
110
+
111
+ - **(node-swc)** Add `libc` field in Linux platform packages (#4046) ([db9b988](https://github.com/swc-project/swc/commit/db9b9888459c0394209f68bad421eb31a491547a))
112
+
113
+
114
+ - **(node-swc)** Embed target triple string (#4058) ([5a2a603](https://github.com/swc-project/swc/commit/5a2a6037d442d76d557d07795def5653aff91f2a))
115
+
116
+ ## [1.2.156] - 2022-03-16
117
+
118
+ ### Bug Fixes
119
+
120
+
121
+
8
122
  - **(es)** Sort spans while preserving comments (#4011) ([b337c2e](https://github.com/swc-project/swc/commit/b337c2e2d4716520c3cf718b2037d299d9654bc5))
9
123
 
10
124
 
@@ -65,7 +179,7 @@
65
179
  - **(ci)** Fix auto-rebase script ([9b8b111](https://github.com/swc-project/swc/commit/9b8b11126480ae9b1160f3b5722fc4e27a05b025))
66
180
 
67
181
 
68
- - **(ci)** Revert package scripts to fix publish action (#4039) ([eee8e0f](https://github.com/swc-project/swc/commit/eee8e0f7bb025fea83c6ba44a506799be061c2f6))
182
+ - **(ci)** Revert package scripts to fix publish action (#4039) ([eee8e0f](https://github.com/swc-project/swc/commit/eee8e0f7bb025fea83c6ba44a506799be061c2f6))- **general**: Fix CI ([da1fd03](https://github.com/swc-project/swc/commit/da1fd033b846696dec555d2e7cfb2b62b0f4d7eb))
69
183
 
70
184
  ### Refactor
71
185
 
package/binding.d.ts CHANGED
@@ -11,5 +11,6 @@ export const transform: any;
11
11
  export const transformSync: any;
12
12
  export const transformFile: any;
13
13
  export const transformFileSync: any;
14
+ export const getTargetTriple: any;
14
15
  export const initCustomTraceSubscriber: any;
15
16
  export const Compiler: any;
package/binding.js CHANGED
@@ -243,7 +243,7 @@ if (!nativeBinding) {
243
243
  }
244
244
  throw new Error(`Failed to load native binding`);
245
245
  }
246
- const { bundle, minify, minifySync, parse, parseSync, parseFileSync, parseFile, print, printSync, transform, transformSync, transformFile, transformFileSync, initCustomTraceSubscriber, Compiler } = nativeBinding;
246
+ const { bundle, minify, minifySync, parse, parseSync, parseFileSync, parseFile, print, printSync, transform, transformSync, transformFile, transformFileSync, getTargetTriple, initCustomTraceSubscriber, Compiler } = nativeBinding;
247
247
  module.exports.bundle = bundle;
248
248
  module.exports.minify = minify;
249
249
  module.exports.minifySync = minifySync;
@@ -257,5 +257,6 @@ module.exports.transform = transform;
257
257
  module.exports.transformSync = transformSync;
258
258
  module.exports.transformFile = transformFile;
259
259
  module.exports.transformFileSync = transformFileSync;
260
+ module.exports.getTargetTriple = getTargetTriple;
260
261
  module.exports.initCustomTraceSubscriber = initCustomTraceSubscriber;
261
262
  module.exports.Compiler = Compiler;
package/index.d.ts CHANGED
@@ -92,4 +92,15 @@ export declare function __experimental_registerGlobalTraceConfig(traceConfig: {
92
92
  type: 'traceEvent';
93
93
  fileName?: string;
94
94
  }): void;
95
+ /**
96
+ * @ignore
97
+ *
98
+ * Returns current binary's metadata to determine which binary is actually loaded.
99
+ *
100
+ * This is undocumented interface, does not gaurantee stability across `@swc/core`'s semver
101
+ * as internal representation may change anytime. Use it with caution.
102
+ */
103
+ export declare function getBinaryMetadata(): {
104
+ target: any;
105
+ };
95
106
  export declare const DEFAULT_EXTENSIONS: readonly string[];
package/index.js CHANGED
@@ -30,7 +30,7 @@ var __rest = (this && this.__rest) || function (s, e) {
30
30
  return t;
31
31
  };
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.DEFAULT_EXTENSIONS = exports.__experimental_registerGlobalTraceConfig = exports.minifySync = exports.minify = exports.bundle = exports.transformFileSync = exports.transformFile = exports.transformSync = exports.transform = exports.printSync = exports.print = exports.parseFileSync = exports.parseFile = exports.parseSync = exports.parse = exports.Compiler = exports.plugins = exports.version = void 0;
33
+ exports.DEFAULT_EXTENSIONS = exports.getBinaryMetadata = exports.__experimental_registerGlobalTraceConfig = exports.minifySync = exports.minify = exports.bundle = exports.transformFileSync = exports.transformFile = exports.transformSync = exports.transform = exports.printSync = exports.print = exports.parseFileSync = exports.parseFile = exports.parseSync = exports.parse = exports.Compiler = exports.plugins = exports.version = void 0;
34
34
  const path_1 = require("path");
35
35
  __exportStar(require("./types"), exports);
36
36
  const spack_1 = require("./spack");
@@ -263,6 +263,20 @@ function __experimental_registerGlobalTraceConfig(traceConfig) {
263
263
  }
264
264
  }
265
265
  exports.__experimental_registerGlobalTraceConfig = __experimental_registerGlobalTraceConfig;
266
+ /**
267
+ * @ignore
268
+ *
269
+ * Returns current binary's metadata to determine which binary is actually loaded.
270
+ *
271
+ * This is undocumented interface, does not gaurantee stability across `@swc/core`'s semver
272
+ * as internal representation may change anytime. Use it with caution.
273
+ */
274
+ function getBinaryMetadata() {
275
+ return {
276
+ target: bindings.getTargetTriple()
277
+ };
278
+ }
279
+ exports.getBinaryMetadata = getBinaryMetadata;
266
280
  exports.DEFAULT_EXTENSIONS = Object.freeze([
267
281
  ".js",
268
282
  ".jsx",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.2.156",
3
+ "version": "1.2.159",
4
4
  "description": "Super-fast alternative for babel",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./index.js",
@@ -64,6 +64,14 @@
64
64
  "test": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest node-swc/__tests__",
65
65
  "version": "napi version -p scripts/npm"
66
66
  },
67
+ "lint-staged": {
68
+ "*.toml": [
69
+ "taplo format"
70
+ ],
71
+ "*.rs": [
72
+ "cargo fmt --"
73
+ ]
74
+ },
67
75
  "devDependencies": {
68
76
  "@babel/compat-data": "^7.17.0",
69
77
  "@babel/core": "^7.13.16",
@@ -76,6 +84,7 @@
76
84
  "@babel/types": "^7.14.0",
77
85
  "@napi-rs/cli": "^2.4.5",
78
86
  "@swc/helpers": "^0.2.10",
87
+ "@taplo/cli": "^0.3.2",
79
88
  "@types/jest": "^26.0.23",
80
89
  "@types/node": "^14.14.41",
81
90
  "acorn": "^8.6.0",
@@ -91,6 +100,7 @@
91
100
  "expect": "^27.4.2",
92
101
  "husky": "^7.0.2",
93
102
  "jest": "^27.0.1",
103
+ "lint-staged": "^12.3.6",
94
104
  "lodash": "^4.17.21",
95
105
  "mocha": "^9.1.3",
96
106
  "npm-run-all": "^4.1.5",
@@ -111,18 +121,18 @@
111
121
  "url": "https://opencollective.com/swc"
112
122
  },
113
123
  "optionalDependencies": {
114
- "@swc/core-win32-x64-msvc": "1.2.156",
115
- "@swc/core-darwin-x64": "1.2.156",
116
- "@swc/core-linux-x64-gnu": "1.2.156",
117
- "@swc/core-linux-x64-musl": "1.2.156",
118
- "@swc/core-freebsd-x64": "1.2.156",
119
- "@swc/core-win32-ia32-msvc": "1.2.156",
120
- "@swc/core-linux-arm64-gnu": "1.2.156",
121
- "@swc/core-linux-arm-gnueabihf": "1.2.156",
122
- "@swc/core-darwin-arm64": "1.2.156",
123
- "@swc/core-android-arm64": "1.2.156",
124
- "@swc/core-linux-arm64-musl": "1.2.156",
125
- "@swc/core-win32-arm64-msvc": "1.2.156",
126
- "@swc/core-android-arm-eabi": "1.2.156"
124
+ "@swc/core-win32-x64-msvc": "1.2.159",
125
+ "@swc/core-darwin-x64": "1.2.159",
126
+ "@swc/core-linux-x64-gnu": "1.2.159",
127
+ "@swc/core-linux-x64-musl": "1.2.159",
128
+ "@swc/core-freebsd-x64": "1.2.159",
129
+ "@swc/core-win32-ia32-msvc": "1.2.159",
130
+ "@swc/core-linux-arm64-gnu": "1.2.159",
131
+ "@swc/core-linux-arm-gnueabihf": "1.2.159",
132
+ "@swc/core-darwin-arm64": "1.2.159",
133
+ "@swc/core-android-arm64": "1.2.159",
134
+ "@swc/core-linux-arm64-musl": "1.2.159",
135
+ "@swc/core-win32-arm64-msvc": "1.2.159",
136
+ "@swc/core-android-arm-eabi": "1.2.159"
127
137
  }
128
138
  }