@swc/core 1.2.155 → 1.2.158
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 +165 -0
- package/binding.d.ts +1 -0
- package/binding.js +2 -1
- package/index.d.ts +11 -0
- package/index.js +15 -1
- package/package.json +28 -15
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,171 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
- **(css/prefixer)** Reduce the number of vars in debug build (#4078) ([4af5e6d](https://github.com/swc-project/swc/commit/4af5e6d77bff7bf6bf247b18185b22754c3ceceb))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
- **(es/helpers)** Fix decorator helper script (#4072) ([55cfad1](https://github.com/swc-project/swc/commit/55cfad152d52e7f818fc4e71913e94ce84ab91a2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- **(es/modules)** Fix sourcemap, really (#4074) ([22d005e](https://github.com/swc-project/swc/commit/22d005e2246505ad01ee1aef0be714f98ff7b577))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
- **(es/react)** Fix `_createElement` (#4070) ([bb08354](https://github.com/swc-project/swc/commit/bb08354950beb8155fbe27abcc391e43e1c15e2b))
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
- **(es/modules)** Support namespaced reexports (#4073) ([9458f08](https://github.com/swc-project/swc/commit/9458f08092e544cf051a88001b195f8543035d1c))
|
|
24
|
+
|
|
25
|
+
### Miscellaneous Tasks
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
- **(repo)** Auto-lock outdated issues and PRs (#4066) ([ed7a5e5](https://github.com/swc-project/swc/commit/ed7a5e54ccdf7f6835082286fa9892f0cf3ac270))
|
|
30
|
+
|
|
31
|
+
## [1.2.157] - 2022-03-17
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
- **(es/ast)** Revert removal of `definite` in `PrivateProp` (#4051) ([bbe8f3d](https://github.com/swc-project/swc/commit/bbe8f3d8fe0a5a62fa2624c5cbe46980ad6264ac))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
- **(es/codegen)** Fix codegen of string literals (#4037) ([bd444c0](https://github.com/swc-project/swc/commit/bd444c0ceb1bfdc8582e15dec439917474b55b25))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
- **(es/codegen)** Fix sourcemap (#4062) ([9310c39](https://github.com/swc-project/swc/commit/9310c39fe922283b4bea46c30b08f8768cda577d))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
- **(es/helpers)** Add missing `export` for `classPrivateFieldLooseKey` (#4045) ([3125bba](https://github.com/swc-project/swc/commit/3125bbacbe1dc9afa9e2c809146dcf42ab5c82de))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
- **(es/helpers)** Export `classPrivateFieldLooseKey` as `default` (#4047) ([025c921](https://github.com/swc-project/swc/commit/025c921409caa53131bdacd3db2d4adeb1806d52))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
- **(es/helpers)** Fix the name of `_classPrivateFieldLooseBase` (#4061) ([f8a3849](https://github.com/swc-project/swc/commit/f8a3849299e666e1b6543fec953732ed9c88a225))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
- **(es/parser)** Allow nested ambient context in `.d.ts` files (#4060) ([ffcb6ce](https://github.com/swc-project/swc/commit/ffcb6ce523fb4ffba8531d5194f69e62c63d3d9a))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
- **(plugin/runner)** Make build pass for `wasm32` (#4056) ([5c84fe5](https://github.com/swc-project/swc/commit/5c84fe525f336064eaa5b383cb4606f1b3cd8df2))
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
- **(cli)** Enable plugins for `swc_cli` (#4059) ([fefb587](https://github.com/swc-project/swc/commit/fefb5870c7ed9bb4a97be778bf3be1eee74aa344))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
- **(css/prefixer)** Support more properties (#4055) ([f2517a3](https://github.com/swc-project/swc/commit/f2517a345bcae30ebb4f0b2910a8db31e944648d))
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
- **(es/lints)** Implement `yoda` rule (#3886) ([833958b](https://github.com/swc-project/swc/commit/833958bd7469993e756c24dcd1263ef2c5ef9eb9))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
- **(node-swc)** Add `libc` field in Linux platform packages (#4046) ([db9b988](https://github.com/swc-project/swc/commit/db9b9888459c0394209f68bad421eb31a491547a))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
- **(node-swc)** Embed target triple string (#4058) ([5a2a603](https://github.com/swc-project/swc/commit/5a2a6037d442d76d557d07795def5653aff91f2a))
|
|
77
|
+
|
|
78
|
+
## [1.2.156] - 2022-03-16
|
|
79
|
+
|
|
80
|
+
### Bug Fixes
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
- **(es)** Sort spans while preserving comments (#4011) ([b337c2e](https://github.com/swc-project/swc/commit/b337c2e2d4716520c3cf718b2037d299d9654bc5))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
- **(es/compat)** Change pass ordering of `es2015` (#4029) ([e19a60a](https://github.com/swc-project/swc/commit/e19a60aad44318d9752f790c913bf010423e7f7c))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
- **(es/decorator)** Remove `noop_fold_type` (#4022) ([0c8c3d7](https://github.com/swc-project/swc/commit/0c8c3d7d51e49ad9050224a8647ebc55a0262b35))
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
- **(es/decorator)** Insert initializer to constructor with body (#4028) ([0c76696](https://github.com/swc-project/swc/commit/0c76696ed2d8cbf00a18fd9506b8c09f1be9cdd3))
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
- **(es/helpers)** Inject helpers for scripts (#4025) ([73c91d3](https://github.com/swc-project/swc/commit/73c91d34d5c6fcd869e99db02b0cf82f8e159224))
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
- **(es/lints)** Fix false-positive of `duplicate-exports` (#4041) ([ba1c854](https://github.com/swc-project/swc/commit/ba1c854fb1685e581599da3e9f25a4e35a9279bc))
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
- **(es/modules)** Use correct span for `ExportAll`s (#4038) ([834cd4f](https://github.com/swc-project/swc/commit/834cd4f7b6866729b345fe68ce6386dc94b202d7))
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
- **(es/parser)** Report an error if `LeftHandSideExpression` is invalid (#4001) ([f8d6127](https://github.com/swc-project/swc/commit/f8d6127dd1a064e2d4b255dfc1894a1b9eb89f71))
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
- **(es/parser)** Allow building with stable `rustc` (#4024) ([25e5ccc](https://github.com/swc-project/swc/commit/25e5ccc548260823c9ad78b607617440e04950d3))
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
- **(es/parser)** Emit an error for multiple constructors with body (#4031) ([120d2a5](https://github.com/swc-project/swc/commit/120d2a534e76003e726848f3fc9f6c648a837dbb))
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
- **(node-swc)** Disable logging of `warn` level by default (#4033) ([bba5a33](https://github.com/swc-project/swc/commit/bba5a33415b6420c9e7b85f50da4df6c11ac9e6d))
|
|
115
|
+
|
|
116
|
+
### Features
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
- **(cli/compile)** Support `out-file` (#4016) ([629709e](https://github.com/swc-project/swc/commit/629709e1b14bb6c5a6b9963fec234fb9c6911786))
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
- **(css)** Supports more color notations (#4009) ([a4bc092](https://github.com/swc-project/swc/commit/a4bc0927a0c44ba9d3219964d8548a0cf11d24ce))
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
- **(css/prefixer)** Implement more rules for prefixer (#4013) ([4f6f244](https://github.com/swc-project/swc/commit/4f6f244170f2059e1b5a3765560b91c102e00a1b))
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
- **(es/minifier)** Drop noop calls (#4019) ([be09ea6](https://github.com/swc-project/swc/commit/be09ea6991165162fd9fa4cfce2ead4cdba0b0cf))
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
- **(es/transforms/base)** Add `paren_remover` (#4034) ([3a4704f](https://github.com/swc-project/swc/commit/3a4704fe77d3d3533e2f1dc438c63c8058a1df51))
|
|
133
|
+
|
|
134
|
+
### Miscellaneous Tasks
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
- **(ci)** Make bump-command check lazy (#4018) ([c27b84c](https://github.com/swc-project/swc/commit/c27b84c3f693ecae73cb0da74dd6f6178d8ab45e))
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
- **(ci)** Fix auto-rebase script ([9b8b111](https://github.com/swc-project/swc/commit/9b8b11126480ae9b1160f3b5722fc4e27a05b025))
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
- **(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))
|
|
145
|
+
|
|
146
|
+
### Refactor
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
- **(es/minifier)** Cleanup (#4020) ([3173047](https://github.com/swc-project/swc/commit/3173047f589128c429d02b7cb128d80f0fd6e011))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
- **(plugin/runner)** Split modules and introduce feature flags (#4035) ([dab2002](https://github.com/swc-project/swc/commit/dab2002a2eebefde1db545fd8f388fa528079f33))
|
|
154
|
+
|
|
155
|
+
### Testing
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
- **(es)** Add tests for fixed issues (#4036) ([71f7cf2](https://github.com/swc-project/swc/commit/71f7cf2011fd948a0c1d7c4268316f3c0103f2f3))
|
|
160
|
+
|
|
161
|
+
### Build
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
- **(tsconfig)** Set `tsbuildinfo` filename (#4042) ([a1308c9](https://github.com/swc-project/swc/commit/a1308c9a16c651555acb2c6e082ce95519fda88e))
|
|
166
|
+
|
|
167
|
+
## [1.2.155] - 2022-03-14
|
|
168
|
+
|
|
169
|
+
### Bug Fixes
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
8
173
|
- **(common)** Don't use `None` as source while generating source maps (#4007) ([0ad13d9](https://github.com/swc-project/swc/commit/0ad13d93f288e54f245b249920d74cfe13d1e969))
|
|
9
174
|
|
|
10
175
|
|
package/binding.d.ts
CHANGED
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.
|
|
3
|
+
"version": "1.2.158",
|
|
4
4
|
"description": "Super-fast alternative for babel",
|
|
5
5
|
"homepage": "https://swc.rs",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -56,12 +56,22 @@
|
|
|
56
56
|
"prepare": "husky install && git config feature.manyFiles true && node ./crates/swc_ecma_preset_env/scripts/copy-data.js",
|
|
57
57
|
"artifacts": "napi artifacts --dist scripts/npm",
|
|
58
58
|
"prepublishOnly": "tsc -d && napi prepublish -p scripts/npm --tagstyle npm",
|
|
59
|
+
"pack": "wasm-pack",
|
|
60
|
+
"build:ts": "tsc -d",
|
|
61
|
+
"build:wasm": "npm-run-all \"pack -- build ./crates/wasm --scope swc {1} -t {2} --features plugin\" --",
|
|
59
62
|
"build": "tsc -d && napi build --platform --cargo-name node --js ./node-swc/src/binding.js --dts ./node-swc/src/binding.d.ts -p node --release",
|
|
60
63
|
"build:dev": "tsc -d && napi build --platform --cargo-name node --js ./node-swc/src/binding.js --dts ./node-swc/src/binding.d.ts -p node",
|
|
61
|
-
"build:ts": "tsc -d",
|
|
62
64
|
"test": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest node-swc/__tests__",
|
|
63
65
|
"version": "napi version -p scripts/npm"
|
|
64
66
|
},
|
|
67
|
+
"lint-staged": {
|
|
68
|
+
"*.toml": [
|
|
69
|
+
"taplo format"
|
|
70
|
+
],
|
|
71
|
+
"*.rs": [
|
|
72
|
+
"cargo fmt --"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
65
75
|
"devDependencies": {
|
|
66
76
|
"@babel/compat-data": "^7.17.0",
|
|
67
77
|
"@babel/core": "^7.13.16",
|
|
@@ -74,6 +84,7 @@
|
|
|
74
84
|
"@babel/types": "^7.14.0",
|
|
75
85
|
"@napi-rs/cli": "^2.4.5",
|
|
76
86
|
"@swc/helpers": "^0.2.10",
|
|
87
|
+
"@taplo/cli": "^0.3.2",
|
|
77
88
|
"@types/jest": "^26.0.23",
|
|
78
89
|
"@types/node": "^14.14.41",
|
|
79
90
|
"acorn": "^8.6.0",
|
|
@@ -89,8 +100,10 @@
|
|
|
89
100
|
"expect": "^27.4.2",
|
|
90
101
|
"husky": "^7.0.2",
|
|
91
102
|
"jest": "^27.0.1",
|
|
103
|
+
"lint-staged": "^12.3.6",
|
|
92
104
|
"lodash": "^4.17.21",
|
|
93
105
|
"mocha": "^9.1.3",
|
|
106
|
+
"npm-run-all": "^4.1.5",
|
|
94
107
|
"progress": "^2.0.3",
|
|
95
108
|
"prop-types": "^15.7.2",
|
|
96
109
|
"react": "^17.0.2",
|
|
@@ -108,18 +121,18 @@
|
|
|
108
121
|
"url": "https://opencollective.com/swc"
|
|
109
122
|
},
|
|
110
123
|
"optionalDependencies": {
|
|
111
|
-
"@swc/core-win32-x64-msvc": "1.2.
|
|
112
|
-
"@swc/core-darwin-x64": "1.2.
|
|
113
|
-
"@swc/core-linux-x64-gnu": "1.2.
|
|
114
|
-
"@swc/core-linux-x64-musl": "1.2.
|
|
115
|
-
"@swc/core-freebsd-x64": "1.2.
|
|
116
|
-
"@swc/core-win32-ia32-msvc": "1.2.
|
|
117
|
-
"@swc/core-linux-arm64-gnu": "1.2.
|
|
118
|
-
"@swc/core-linux-arm-gnueabihf": "1.2.
|
|
119
|
-
"@swc/core-darwin-arm64": "1.2.
|
|
120
|
-
"@swc/core-android-arm64": "1.2.
|
|
121
|
-
"@swc/core-linux-arm64-musl": "1.2.
|
|
122
|
-
"@swc/core-win32-arm64-msvc": "1.2.
|
|
123
|
-
"@swc/core-android-arm-eabi": "1.2.
|
|
124
|
+
"@swc/core-win32-x64-msvc": "1.2.158",
|
|
125
|
+
"@swc/core-darwin-x64": "1.2.158",
|
|
126
|
+
"@swc/core-linux-x64-gnu": "1.2.158",
|
|
127
|
+
"@swc/core-linux-x64-musl": "1.2.158",
|
|
128
|
+
"@swc/core-freebsd-x64": "1.2.158",
|
|
129
|
+
"@swc/core-win32-ia32-msvc": "1.2.158",
|
|
130
|
+
"@swc/core-linux-arm64-gnu": "1.2.158",
|
|
131
|
+
"@swc/core-linux-arm-gnueabihf": "1.2.158",
|
|
132
|
+
"@swc/core-darwin-arm64": "1.2.158",
|
|
133
|
+
"@swc/core-android-arm64": "1.2.158",
|
|
134
|
+
"@swc/core-linux-arm64-musl": "1.2.158",
|
|
135
|
+
"@swc/core-win32-arm64-msvc": "1.2.158",
|
|
136
|
+
"@swc/core-android-arm-eabi": "1.2.158"
|
|
124
137
|
}
|
|
125
138
|
}
|