@swc/core 1.2.129 → 1.2.135
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 +302 -0
- package/binding.js +94 -71
- package/clippy.toml +2 -0
- package/docs/adr/00000-whats-the-big-idea.md +1 -0
- package/docs/adr/00001-support-transformation-plugin-native.md +94 -0
- package/docs/adr/README.md +13 -0
- package/docs/adr/template.md +72 -0
- package/package.json +16 -18
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,308 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
- **(css)** Fix the type definition of `@support` at-rules (#3330) ([34943ff](https://github.com/swc-project/swc/commit/34943ffa15ddecb56ee0889a598dfd3d0aa4025c))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
- **(css)** Fix `@keyframes` at-rule (#3331) ([f89ffa6](https://github.com/swc-project/swc/commit/f89ffa67aea6c99ec61a961754001e7fa85b86b5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- **(css)** Fix `@supports` at-rule (#3329) ([9f38060](https://github.com/swc-project/swc/commit/9f3806029c4aa47944f38e1b1c4c8feac4ace4c1))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
- **(css/parser)** Fix parsing of at rules (#3328) ([506a310](https://github.com/swc-project/swc/commit/506a31078aaebf50129658f096bbd5929995205f))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
- **(es/block-scoping)** Pop scope correctly on early returns (#3360) ([b1a8db6](https://github.com/swc-project/swc/commit/b1a8db61943d022bcbed583eb3562510d1ed727c))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
- **(es/compat)** Fix regression of `destructuring` (#3326) ([6d1ad36](https://github.com/swc-project/swc/commit/6d1ad368aca53ee64a63ae565cd015909f2f4458))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
- **(es/compat)** Handle nested functions in `private_field` (#3355) ([29aaac1](https://github.com/swc-project/swc/commit/29aaac1f15f747ea3f938bcab1d536168e9d36a6))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
- **(es/loader)** Add an option to resolve symlinks with `true` as a default (#3340) ([afdb168](https://github.com/swc-project/swc/commit/afdb168aad9096e4653580a52cc7736915cd2b69))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
- **(es/minifier)** Consider capturing while inlining (#3322) ([4f23d65](https://github.com/swc-project/swc/commit/4f23d651d1a8855f9383c5306d5e417c273c5c22))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
- **(es/minifier)** Don't inline a var if the initializer is reassigned (#3333) ([d52a1f3](https://github.com/swc-project/swc/commit/d52a1f3899d7d782917ea1c8701e951fcd6c214f))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
- **(es/minifier)** Respect block scoping while negating if statements (#3344) ([6921ffb](https://github.com/swc-project/swc/commit/6921ffbbda110384524114dc2d3230b8432e34cc))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
- **(es/minifier)** Prepend/append correctly (#3367) ([703972d](https://github.com/swc-project/swc/commit/703972dc296fbdfc319d48d43ef3841ebfa56eb3))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
- **(es/minifier)** Improve minifier (#3350) ([68e9017](https://github.com/swc-project/swc/commit/68e90173762feb2aa6744ca46f5d1185a89da271))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
- **(es/module)** Remove `.jsx` file extension (#3334) ([b2bf38d](https://github.com/swc-project/swc/commit/b2bf38d025064a42c398ab321fc2e69401a3f74b))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
- **(es/typescript)** Handle typescript enums with string values (#3339) ([da709fe](https://github.com/swc-project/swc/commit/da709fe3d351f76b51b526cfd0718d8e6cb8f2a0))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
- **(swc)** Respect `jsc.experimental.keepImportAssertions` (#3352) ([d9dc2b9](https://github.com/swc-project/swc/commit/d9dc2b99dde69792db4f5a31ffc983f8b04c0bef))
|
|
54
|
+
|
|
55
|
+
### Documentation
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
- **(contributing)** Fix formatting (#3376) ([90cf073](https://github.com/swc-project/swc/commit/90cf073ab91d44718235d8e0bc38953f7a4c1970))
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
- **(css/ast)** Add `Ratio`, which is defined by spec (#3335) ([c7e5fae](https://github.com/swc-project/swc/commit/c7e5faea5c49333a3141111f92e3b36e29f6202c))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
- **(css/ast)** Add types for dashed identifiers and `@color-profile` at-rules (#3364) ([dfa0286](https://github.com/swc-project/swc/commit/dfa0286aca8aeca49820ebb6a3b0e4461d30fe29))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
- **(css/parser)** Improve parsing of urls (#3362) ([50521d8](https://github.com/swc-project/swc/commit/50521d8ffa3425ad26eb4630698f06b69c41ef2b))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
- **(es/bugfix)** Add `bugfix-safari-id-destructuring-collision-in-function-expression` (#3109) ([d1c90a4](https://github.com/swc-project/swc/commit/d1c90a4e5f2ddfc71c6143ef07e16af352da25fa))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
- **(es/codegen)** Emit comments of `Module` and `Script` (#3358) ([fcb7288](https://github.com/swc-project/swc/commit/fcb7288eb66e027fa7278b8f028e4486059241cd))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
- **(es/lints)** Implement "no-console" rule (#3269) ([9872137](https://github.com/swc-project/swc/commit/987213797f71f9b5e0a0ac19edfbd18fe96a7ce5))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
- **(es/minifier)** Handle array literals in `sequences` (#3348) ([8007b2d](https://github.com/swc-project/swc/commit/8007b2dc9338e34a1e9780606fd35181890af990))
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
- **(es/preset-env)** Upgrade `browserslist-rs` (#3375) ([d3d754b](https://github.com/swc-project/swc/commit/d3d754bd174bfbd0f6fc25276c40e46e3a3da01f))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
- **(plugin)** Pass host context to plugins for diagnostics emission (#3359) ([a8debc1](https://github.com/swc-project/swc/commit/a8debc17f6082c033d3734a8e2c0cccc598c1d08))
|
|
90
|
+
|
|
91
|
+
### Miscellaneous Tasks
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
- **(ci)** Update `thread_local` (#3357) ([a635e9f](https://github.com/swc-project/swc/commit/a635e9f35bb2a718abad56286d7b6fcecdfe4e58))
|
|
96
|
+
|
|
97
|
+
### Performance
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
- **(node)** Avoid cloning options (#3325) ([8a76935](https://github.com/swc-project/swc/commit/8a76935ca261579f23519d1e2c3b7849ba75a6e0))
|
|
102
|
+
|
|
103
|
+
### Refactor
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
- **(css/ast)** Merge several kinds of blocks into a single type (#3336) ([c664eaf](https://github.com/swc-project/swc/commit/c664eafdefe2b8a65d3d745e4538063a33f93346))
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
- **(css/ast)** Fix type definitions related to `@import` at-rule (#3351) ([7787f90](https://github.com/swc-project/swc/commit/7787f90da02d198b26bc2236229446a19628c794))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
- **(css/ast)** Rename `PercentValue` to `Percent` (#3363) ([6fc7562](https://github.com/swc-project/swc/commit/6fc7562686b0915c7a1280620ffe183de66e113f))
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
- **(plugin)** Remove multivalue polyfill (#3346) ([4386498](https://github.com/swc-project/swc/commit/438649818fb7e7b1ef6cddf5ba244f80cf7e69a9))
|
|
117
|
+
|
|
118
|
+
## [1.2.133] - 2022-01-20
|
|
119
|
+
|
|
120
|
+
### Bug Fixes
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
- **(css)** Fix parsing of media queries (#3318) ([0723ee2](https://github.com/swc-project/swc/commit/0723ee282861a1e648490989c122d5f4e683dc35))
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
- **(es/minifier)** Don't inline functions used as arguments (#3320) ([57204e3](https://github.com/swc-project/swc/commit/57204e39cd24ecdb190a671bd3e163ff0c2ab983))
|
|
128
|
+
|
|
129
|
+
### Documentation
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
- **(repo)** Update contributing docs (#3298) ([5af79f6](https://github.com/swc-project/swc/commit/5af79f634b7431e886b254992e7fbdbe044d1e9d))
|
|
134
|
+
|
|
135
|
+
### Miscellaneous Tasks
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
- **(rustc)** Downgrade rustc ([041bf00](https://github.com/swc-project/swc/commit/041bf003627e55cdef2839a31cbb3149e161eb6e))
|
|
140
|
+
|
|
141
|
+
### Build
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
- **(node-swc)** Fix GLIBC < 2.18 compatible issues and android arm binary loading issue (#3314) ([9608605](https://github.com/swc-project/swc/commit/9608605772351a2406870e19ed8738adf2147374))
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
- **(node-swc)** Fix Windows arm64 build OOM (#3324) ([c069c78](https://github.com/swc-project/swc/commit/c069c78b21b9b4bf150d22e8ff333053f2039e3b))
|
|
149
|
+
|
|
150
|
+
## [1.2.131] - 2022-01-19
|
|
151
|
+
|
|
152
|
+
### Bug Fixes
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
- **(common)** Use `siphasher` directly and upgrade transitive dependencies to avoid UB (#3299) ([641265b](https://github.com/swc-project/swc/commit/641265b147da9478f5d205ddc0c7c16ed94b8676))
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
- **(es/compat)** Apply `static_blocks` before `class_properties` (#3292) ([89235b8](https://github.com/swc-project/swc/commit/89235b8294dedb4dd50c85e2a3b3ce41bddac85e))
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
- **(es/minifier)** Fix analysis of unary expressions (#3286) ([b55ae4b](https://github.com/swc-project/swc/commit/b55ae4b312b5677efeb9f3e9697dc2bcff81e322))
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
- **(es/minifier)** Inline into interpolations in tagged template literals (#3287) ([fa5c063](https://github.com/swc-project/swc/commit/fa5c063144246ce634305399787e08498765eb8f))
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
- **(es/minifier)** Remove more side-effect-free expressions. (#3301) ([18a11d7](https://github.com/swc-project/swc/commit/18a11d7c8f6582df2a486ef8fdafca85d323bee7))
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
- **(es/minifier)** Don't emit invalid code (#3302) ([8e796cd](https://github.com/swc-project/swc/commit/8e796cdc0ac59d7cab7e9e845afc2f98ee89c3ae))
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
- **(es/minifier)** Fix logic for checking `arguments` (#3313) ([1aa494b](https://github.com/swc-project/swc/commit/1aa494b1c0d26151c56500dd2bab283b7a4222c5))
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
- **(es/minifier)** Prevent infinite loop due to negation (#3310) ([b4d21bf](https://github.com/swc-project/swc/commit/b4d21bf0778d973d651b6f1825c4eb27dc150ea2))
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
- **(es/resolver)** Ignore names of jsx attributes (#3289) ([9a89895](https://github.com/swc-project/swc/commit/9a898951bc14e96af926e8a47a87d9220eaf4826))
|
|
181
|
+
|
|
182
|
+
### Documentation
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
- **(swc)** Document `typescript::strip` (#3305) ([18cd98e](https://github.com/swc-project/swc/commit/18cd98e54cdd3c651fc12815aa59a6640a1c0dcb))
|
|
187
|
+
|
|
188
|
+
### Features
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
- **(es/compat)** Use remove useless source map entries generated by `classes` (#3242) ([2352920](https://github.com/swc-project/swc/commit/2352920889c217be41dd5d18c2af6088e1cd0473))
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
- **(es/minifier)** Drop more expressions from parallel optimizer (#3303) ([210ecf8](https://github.com/swc-project/swc/commit/210ecf83bb2d23d72f903243c173a249cf4ffccb))
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
- **(plugin)** Add `PluginError` (#3300) ([c6ffdc8](https://github.com/swc-project/swc/commit/c6ffdc87172e504adff5757ebbb6ec2014136cf1))
|
|
199
|
+
|
|
200
|
+
### Refactor
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
- **(es)** Add `visit_obj_and_computed` macro (#3304) ([9e636c7](https://github.com/swc-project/swc/commit/9e636c7e582ff898ca2e374f0b3938dda98a5b67))
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
- **(es/minifier)** Fix clippy warnings (#3312) ([2891220](https://github.com/swc-project/swc/commit/289122009bff1e8d57178ca2cc1706f52335d1c5))
|
|
208
|
+
|
|
209
|
+
### Testing
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
- **(plugin/runner)** Pin dependencies for the integration test (#3306) ([7ba8a83](https://github.com/swc-project/swc/commit/7ba8a838819ae40f54801808a41af3d5334421b6))
|
|
214
|
+
|
|
215
|
+
## [1.2.130] - 2022-01-17
|
|
216
|
+
|
|
217
|
+
### Bug Fixes
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
- **(css/lexer)** Resolve a `TODO` (#3260) ([ade8ab8](https://github.com/swc-project/swc/commit/ade8ab8c35b9d1c61d740f42672fb4d27977346d))
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
- **(es/ast)** Update `EsVersion::latest()` (#3261) ([6997851](https://github.com/swc-project/swc/commit/69978518c9f6be3797f401dcaf9a429de88e8ce1))
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
- **(es/minifier)** Preserve side effects in correct position (#3263) ([efd8671](https://github.com/swc-project/swc/commit/efd86715c9827197278914df5dbc9f4fab1a35d9))
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
- **(es/parser)** Throw an error when function body has use strict and paramaters is not simple (#3278) ([6406b49](https://github.com/swc-project/swc/commit/6406b49df259eb10424ecbcc7fbbc9e4acdd37db))
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
- **(es/react)** Fix `createElement` (#3277) ([88a258a](https://github.com/swc-project/swc/commit/88a258a5fb91a58feb571096c4a73d6779b3128d))
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
- **(es/resolver)** Treat a switch statement as a block scope (#3275) ([f4b3cb7](https://github.com/swc-project/swc/commit/f4b3cb714aac1f936523f4d95467b67e554e583d))
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
- **(es/transforms)** Fix `this` in async arrow class properties (#3252) ([7c19e26](https://github.com/swc-project/swc/commit/7c19e26d0f41002a35c1695c259172916e578eab))
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
- **(es/transforms)** Remove unsafe `new String("...")` optimization (#3284) ([162c1fe](https://github.com/swc-project/swc/commit/162c1fe047631c35f8b8105c1a40ad6728e6edff))
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
- **(es/transforms)** Handle template literals within `jsonify` pass (#3282) ([b76d1da](https://github.com/swc-project/swc/commit/b76d1da699ab0475d349a0c9d5b06ffdd7a6b48f))
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
- **(swc)** Remove `wrong-target` (#3251) ([0843f74](https://github.com/swc-project/swc/commit/0843f742c5db3e0a8dc2fc2767b96fe0fad76bd1))
|
|
249
|
+
|
|
250
|
+
### Documentation
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
- **(adr)** Configure adr and add `00001-plugin` (#3249) ([8652b2d](https://github.com/swc-project/swc/commit/8652b2df99c37527fcd973bd8f0cd3c54bfa9485))
|
|
255
|
+
|
|
256
|
+
### Features
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
- **(css)** Support `@layer` at-rule (#3258) ([c195335](https://github.com/swc-project/swc/commit/c1953350121a0703f6b71474e348bc9408de085c))
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
- **(es/ast)** Improve AST api for plugin authors (#3281) ([9dd0647](https://github.com/swc-project/swc/commit/9dd0647e3ae6c00a4fcea3bdb82c269ebb1e61ca))
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
- **(es/compat)** Use `var` for `_len` and `args` in rest parameters (#3267) ([d3cc488](https://github.com/swc-project/swc/commit/d3cc488ac1f41bc752903a3e15a123a909a2b765))
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
- **(plugin/runner)** Free allocated memory on errors (#3270) ([66d1a92](https://github.com/swc-project/swc/commit/66d1a92635c4e04041af1c106dbda8b4d692ba8a))
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
- **(plugin/runnner)** Support `wasm32-wasi` targets (#3271) ([a4c4974](https://github.com/swc-project/swc/commit/a4c497464da5691fee1aff1246d3d36d1b3579af))
|
|
273
|
+
|
|
274
|
+
### Miscellaneous Tasks
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
- **(ci)** Configure `clippy` (#3250) ([978de59](https://github.com/swc-project/swc/commit/978de5943e60a09b5596b20b9c96596d392393c9))
|
|
279
|
+
|
|
280
|
+
### Refactor
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
- **(*)** Fix some clippy warnings (#3257) ([15b604b](https://github.com/swc-project/swc/commit/15b604b6d6f55353a0df13293333367851962f6c))
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
- **(*)** Cleanup (#3274) ([357a350](https://github.com/swc-project/swc/commit/357a35039082c79ba698ce64a69e9022d790632d))
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
- **(es)** More fix for clippy (#3280) ([e8670b3](https://github.com/swc-project/swc/commit/e8670b3383b4baf02a94702bc92a6dcdcd647755))
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
- **(es/transforms)** Cleanup (#3273) ([2690742](https://github.com/swc-project/swc/commit/2690742db0bf59246d0d9b96dfc5f6248fcbb3a0))
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
- **(es/utils)** Merge the super field visitor with `FnEnvHoister` (#3279) ([90a62bb](https://github.com/swc-project/swc/commit/90a62bb21528035eef02fe7fa99de6f6e014d0ca))
|
|
297
|
+
|
|
298
|
+
### Build
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
- **(node)** Fix glibc issue on linux gnu arm (#3255) ([2144271](https://github.com/swc-project/swc/commit/214427157ddf155da14b2bede3b315d3f6ce1e77))
|
|
303
|
+
|
|
304
|
+
## [1.2.129] - 2022-01-13
|
|
305
|
+
|
|
306
|
+
### Bug Fixes
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
8
310
|
- **(es/compat)** Transform `&&=` operator (#3225) ([2e5150d](https://github.com/swc-project/swc/commit/2e5150d2b714ba86bd228506eb0f008d9f5859e1))
|
|
9
311
|
|
|
10
312
|
|
package/binding.js
CHANGED
|
@@ -1,75 +1,98 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const { existsSync, readFileSync } = require(
|
|
3
|
-
const { join } = require(
|
|
2
|
+
const { existsSync, readFileSync } = require("fs");
|
|
3
|
+
const { join } = require("path");
|
|
4
4
|
const { platform, arch } = process;
|
|
5
5
|
let nativeBinding = null;
|
|
6
6
|
let localFileExisted = false;
|
|
7
7
|
let loadError = null;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return isMusl;
|
|
12
|
-
}
|
|
13
|
-
catch (e) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
switch (platform) {
|
|
18
|
-
case 'android':
|
|
19
|
-
if (arch !== 'arm64') {
|
|
20
|
-
throw new Error(`Unsupported architecture on Android ${arch}`);
|
|
21
|
-
}
|
|
22
|
-
localFileExisted = existsSync(join(__dirname, 'swc.android-arm64.node'));
|
|
8
|
+
function isMusl() {
|
|
9
|
+
// For Node 10
|
|
10
|
+
if (!process.report || typeof process.report.getReport !== "function") {
|
|
23
11
|
try {
|
|
24
|
-
|
|
25
|
-
nativeBinding = require('./swc.android-arm64.node');
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
nativeBinding = require('@swc/core-android-arm64');
|
|
29
|
-
}
|
|
12
|
+
return readFileSync("/usr/bin/ldd", "utf8").includes("musl");
|
|
30
13
|
}
|
|
31
14
|
catch (e) {
|
|
32
|
-
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const { glibcVersionRuntime } = process.report.getReport().header;
|
|
20
|
+
return !glibcVersionRuntime;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
switch (platform) {
|
|
24
|
+
case "android":
|
|
25
|
+
switch (arch) {
|
|
26
|
+
case "arm64":
|
|
27
|
+
localFileExisted = existsSync(join(__dirname, "swc.android-arm64.node"));
|
|
28
|
+
try {
|
|
29
|
+
if (localFileExisted) {
|
|
30
|
+
nativeBinding = require("./swc.android-arm64.node");
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
nativeBinding = require("@swc/core-android-arm64");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
loadError = e;
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
case "arm":
|
|
41
|
+
localFileExisted = existsSync(join(__dirname, "swc.android-arm-eabi.node"));
|
|
42
|
+
try {
|
|
43
|
+
if (localFileExisted) {
|
|
44
|
+
nativeBinding = require("./swc.android-arm-eabi.node");
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
nativeBinding = require("@swc/core-android-arm-eabi");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
loadError = e;
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
throw new Error(`Unsupported architecture on Android ${arch}`);
|
|
33
56
|
}
|
|
34
57
|
break;
|
|
35
|
-
case
|
|
58
|
+
case "win32":
|
|
36
59
|
switch (arch) {
|
|
37
|
-
case
|
|
38
|
-
localFileExisted = existsSync(join(__dirname,
|
|
60
|
+
case "x64":
|
|
61
|
+
localFileExisted = existsSync(join(__dirname, "swc.win32-x64-msvc.node"));
|
|
39
62
|
try {
|
|
40
63
|
if (localFileExisted) {
|
|
41
|
-
nativeBinding = require(
|
|
64
|
+
nativeBinding = require("./swc.win32-x64-msvc.node");
|
|
42
65
|
}
|
|
43
66
|
else {
|
|
44
|
-
nativeBinding = require(
|
|
67
|
+
nativeBinding = require("@swc/core-win32-x64-msvc");
|
|
45
68
|
}
|
|
46
69
|
}
|
|
47
70
|
catch (e) {
|
|
48
71
|
loadError = e;
|
|
49
72
|
}
|
|
50
73
|
break;
|
|
51
|
-
case
|
|
52
|
-
localFileExisted = existsSync(join(__dirname,
|
|
74
|
+
case "ia32":
|
|
75
|
+
localFileExisted = existsSync(join(__dirname, "swc.win32-ia32-msvc.node"));
|
|
53
76
|
try {
|
|
54
77
|
if (localFileExisted) {
|
|
55
|
-
nativeBinding = require(
|
|
78
|
+
nativeBinding = require("./swc.win32-ia32-msvc.node");
|
|
56
79
|
}
|
|
57
80
|
else {
|
|
58
|
-
nativeBinding = require(
|
|
81
|
+
nativeBinding = require("@swc/core-win32-ia32-msvc");
|
|
59
82
|
}
|
|
60
83
|
}
|
|
61
84
|
catch (e) {
|
|
62
85
|
loadError = e;
|
|
63
86
|
}
|
|
64
87
|
break;
|
|
65
|
-
case
|
|
66
|
-
localFileExisted = existsSync(join(__dirname,
|
|
88
|
+
case "arm64":
|
|
89
|
+
localFileExisted = existsSync(join(__dirname, "swc.win32-arm64-msvc.node"));
|
|
67
90
|
try {
|
|
68
91
|
if (localFileExisted) {
|
|
69
|
-
nativeBinding = require(
|
|
92
|
+
nativeBinding = require("./swc.win32-arm64-msvc.node");
|
|
70
93
|
}
|
|
71
94
|
else {
|
|
72
|
-
nativeBinding = require(
|
|
95
|
+
nativeBinding = require("@swc/core-win32-arm64-msvc");
|
|
73
96
|
}
|
|
74
97
|
}
|
|
75
98
|
catch (e) {
|
|
@@ -80,30 +103,30 @@ switch (platform) {
|
|
|
80
103
|
throw new Error(`Unsupported architecture on Windows: ${arch}`);
|
|
81
104
|
}
|
|
82
105
|
break;
|
|
83
|
-
case
|
|
106
|
+
case "darwin":
|
|
84
107
|
switch (arch) {
|
|
85
|
-
case
|
|
86
|
-
localFileExisted = existsSync(join(__dirname,
|
|
108
|
+
case "x64":
|
|
109
|
+
localFileExisted = existsSync(join(__dirname, "swc.darwin-x64.node"));
|
|
87
110
|
try {
|
|
88
111
|
if (localFileExisted) {
|
|
89
|
-
nativeBinding = require(
|
|
112
|
+
nativeBinding = require("./swc.darwin-x64.node");
|
|
90
113
|
}
|
|
91
114
|
else {
|
|
92
|
-
nativeBinding = require(
|
|
115
|
+
nativeBinding = require("@swc/core-darwin-x64");
|
|
93
116
|
}
|
|
94
117
|
}
|
|
95
118
|
catch (e) {
|
|
96
119
|
loadError = e;
|
|
97
120
|
}
|
|
98
121
|
break;
|
|
99
|
-
case
|
|
100
|
-
localFileExisted = existsSync(join(__dirname,
|
|
122
|
+
case "arm64":
|
|
123
|
+
localFileExisted = existsSync(join(__dirname, "swc.darwin-arm64.node"));
|
|
101
124
|
try {
|
|
102
125
|
if (localFileExisted) {
|
|
103
|
-
nativeBinding = require(
|
|
126
|
+
nativeBinding = require("./swc.darwin-arm64.node");
|
|
104
127
|
}
|
|
105
128
|
else {
|
|
106
|
-
nativeBinding = require(
|
|
129
|
+
nativeBinding = require("@swc/core-darwin-arm64");
|
|
107
130
|
}
|
|
108
131
|
}
|
|
109
132
|
catch (e) {
|
|
@@ -114,34 +137,34 @@ switch (platform) {
|
|
|
114
137
|
throw new Error(`Unsupported architecture on macOS: ${arch}`);
|
|
115
138
|
}
|
|
116
139
|
break;
|
|
117
|
-
case
|
|
118
|
-
if (arch !==
|
|
140
|
+
case "freebsd":
|
|
141
|
+
if (arch !== "x64") {
|
|
119
142
|
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
|
|
120
143
|
}
|
|
121
|
-
localFileExisted = existsSync(join(__dirname,
|
|
144
|
+
localFileExisted = existsSync(join(__dirname, "swc.freebsd-x64.node"));
|
|
122
145
|
try {
|
|
123
146
|
if (localFileExisted) {
|
|
124
|
-
nativeBinding = require(
|
|
147
|
+
nativeBinding = require("./swc.freebsd-x64.node");
|
|
125
148
|
}
|
|
126
149
|
else {
|
|
127
|
-
nativeBinding = require(
|
|
150
|
+
nativeBinding = require("@swc/core-freebsd-x64");
|
|
128
151
|
}
|
|
129
152
|
}
|
|
130
153
|
catch (e) {
|
|
131
154
|
loadError = e;
|
|
132
155
|
}
|
|
133
156
|
break;
|
|
134
|
-
case
|
|
157
|
+
case "linux":
|
|
135
158
|
switch (arch) {
|
|
136
|
-
case
|
|
159
|
+
case "x64":
|
|
137
160
|
if (isMusl()) {
|
|
138
|
-
localFileExisted = existsSync(join(__dirname,
|
|
161
|
+
localFileExisted = existsSync(join(__dirname, "swc.linux-x64-musl.node"));
|
|
139
162
|
try {
|
|
140
163
|
if (localFileExisted) {
|
|
141
|
-
nativeBinding = require(
|
|
164
|
+
nativeBinding = require("./swc.linux-x64-musl.node");
|
|
142
165
|
}
|
|
143
166
|
else {
|
|
144
|
-
nativeBinding = require(
|
|
167
|
+
nativeBinding = require("@swc/core-linux-x64-musl");
|
|
145
168
|
}
|
|
146
169
|
}
|
|
147
170
|
catch (e) {
|
|
@@ -149,13 +172,13 @@ switch (platform) {
|
|
|
149
172
|
}
|
|
150
173
|
}
|
|
151
174
|
else {
|
|
152
|
-
localFileExisted = existsSync(join(__dirname,
|
|
175
|
+
localFileExisted = existsSync(join(__dirname, "swc.linux-x64-gnu.node"));
|
|
153
176
|
try {
|
|
154
177
|
if (localFileExisted) {
|
|
155
|
-
nativeBinding = require(
|
|
178
|
+
nativeBinding = require("./swc.linux-x64-gnu.node");
|
|
156
179
|
}
|
|
157
180
|
else {
|
|
158
|
-
nativeBinding = require(
|
|
181
|
+
nativeBinding = require("@swc/core-linux-x64-gnu");
|
|
159
182
|
}
|
|
160
183
|
}
|
|
161
184
|
catch (e) {
|
|
@@ -163,15 +186,15 @@ switch (platform) {
|
|
|
163
186
|
}
|
|
164
187
|
}
|
|
165
188
|
break;
|
|
166
|
-
case
|
|
189
|
+
case "arm64":
|
|
167
190
|
if (isMusl()) {
|
|
168
|
-
localFileExisted = existsSync(join(__dirname,
|
|
191
|
+
localFileExisted = existsSync(join(__dirname, "swc.linux-arm64-musl.node"));
|
|
169
192
|
try {
|
|
170
193
|
if (localFileExisted) {
|
|
171
|
-
nativeBinding = require(
|
|
194
|
+
nativeBinding = require("./swc.linux-arm64-musl.node");
|
|
172
195
|
}
|
|
173
196
|
else {
|
|
174
|
-
nativeBinding = require(
|
|
197
|
+
nativeBinding = require("@swc/core-linux-arm64-musl");
|
|
175
198
|
}
|
|
176
199
|
}
|
|
177
200
|
catch (e) {
|
|
@@ -179,13 +202,13 @@ switch (platform) {
|
|
|
179
202
|
}
|
|
180
203
|
}
|
|
181
204
|
else {
|
|
182
|
-
localFileExisted = existsSync(join(__dirname,
|
|
205
|
+
localFileExisted = existsSync(join(__dirname, "swc.linux-arm64-gnu.node"));
|
|
183
206
|
try {
|
|
184
207
|
if (localFileExisted) {
|
|
185
|
-
nativeBinding = require(
|
|
208
|
+
nativeBinding = require("./swc.linux-arm64-gnu.node");
|
|
186
209
|
}
|
|
187
210
|
else {
|
|
188
|
-
nativeBinding = require(
|
|
211
|
+
nativeBinding = require("@swc/core-linux-arm64-gnu");
|
|
189
212
|
}
|
|
190
213
|
}
|
|
191
214
|
catch (e) {
|
|
@@ -193,14 +216,14 @@ switch (platform) {
|
|
|
193
216
|
}
|
|
194
217
|
}
|
|
195
218
|
break;
|
|
196
|
-
case
|
|
197
|
-
localFileExisted = existsSync(join(__dirname,
|
|
219
|
+
case "arm":
|
|
220
|
+
localFileExisted = existsSync(join(__dirname, "swc.linux-arm-gnueabihf.node"));
|
|
198
221
|
try {
|
|
199
222
|
if (localFileExisted) {
|
|
200
|
-
nativeBinding = require(
|
|
223
|
+
nativeBinding = require("./swc.linux-arm-gnueabihf.node");
|
|
201
224
|
}
|
|
202
225
|
else {
|
|
203
|
-
nativeBinding = require(
|
|
226
|
+
nativeBinding = require("@swc/core-linux-arm-gnueabihf");
|
|
204
227
|
}
|
|
205
228
|
}
|
|
206
229
|
catch (e) {
|
|
@@ -220,7 +243,7 @@ if (!nativeBinding) {
|
|
|
220
243
|
}
|
|
221
244
|
throw new Error(`Failed to load native binding`);
|
|
222
245
|
}
|
|
223
|
-
const { bundle, minify, minifySync, parse, parseSync, parseFileSync, parseFile, print, printSync, transform, transformSync, transformFile, transformFileSync, Compiler } = nativeBinding;
|
|
246
|
+
const { bundle, minify, minifySync, parse, parseSync, parseFileSync, parseFile, print, printSync, transform, transformSync, transformFile, transformFileSync, Compiler, } = nativeBinding;
|
|
224
247
|
module.exports.bundle = bundle;
|
|
225
248
|
module.exports.minify = minify;
|
|
226
249
|
module.exports.minifySync = minifySync;
|
package/clippy.toml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
### This adr attempts to describe 10,000ft view for the swc project itself. To be filled gradually.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Support transform plugin in native rust binaries
|
|
2
|
+
|
|
3
|
+
- Status: accepted <!-- optional -->
|
|
4
|
+
- Deciders: @kdy1, @kwonoj <!-- optional -->
|
|
5
|
+
- Date: 2021-01-01 <!-- optional -->
|
|
6
|
+
|
|
7
|
+
Technical Story: [Issue](https://github.com/swc-project/swc/issues/2635) <!-- optional -->
|
|
8
|
+
|
|
9
|
+
## Context and Problem Statement
|
|
10
|
+
|
|
11
|
+
SWC wants to support load, run plugins in the native binary for the custom transform behavior. SWC already have priliminary support to load plugins in its node.js JS bindings but it has known limitations.
|
|
12
|
+
|
|
13
|
+
## Decision Drivers <!-- optional -->
|
|
14
|
+
|
|
15
|
+
- Allow to write a plugin binary can be loaded in the SWC's native binary without involving JS binding interop.
|
|
16
|
+
- Provide good, satisfactory performance while loading, running plugin's custom transformation.
|
|
17
|
+
- Keep abi stability as much, plugin binary should work across different versions of SWC host binary except intended breaking changes.
|
|
18
|
+
- Allow to write a plugin without caring much around the native platform targets binaries.
|
|
19
|
+
|
|
20
|
+
## Considered Options
|
|
21
|
+
|
|
22
|
+
- [option 1] JS-based plugins, including babel plugins
|
|
23
|
+
|
|
24
|
+
- [option 2] Plugins based on `abi_stable` and native dynamic libraries
|
|
25
|
+
|
|
26
|
+
- [option 3] Wasm plugins based on `wasmtime`
|
|
27
|
+
|
|
28
|
+
- **[option 4]** Wasm plugins based on `wasmer`
|
|
29
|
+
|
|
30
|
+
## Decision Outcome
|
|
31
|
+
|
|
32
|
+
Chosen option: **[option 4] Wasm plugins based on `wasmer`**
|
|
33
|
+
|
|
34
|
+
This decision is taken because
|
|
35
|
+
|
|
36
|
+
- It was relatively easy plugin author to generate single binary works across most of platforms SWC's host binary supports, without concern of cross-target compilations.
|
|
37
|
+
- It was relatively easy to achieve abi-stable between SWC host to plugin binaries.
|
|
38
|
+
- It doesn't require to have separate, specialized AST struct (named `plugin_ast`) to pass into ffi boundary of the plugin.
|
|
39
|
+
- Its serialization / deserialization performance is near identical or faster than `abi_stable` based ffi
|
|
40
|
+
|
|
41
|
+
## Pros and Cons of the Options <!-- optional -->
|
|
42
|
+
|
|
43
|
+
### [option 1] JS-based plugins, including babel plugins
|
|
44
|
+
|
|
45
|
+
SWC allow implementing plugins using javascript, and call it from worker threads as required.
|
|
46
|
+
This includes babel plugins, to make migration from babel more convenient.
|
|
47
|
+
|
|
48
|
+
- Good, because users can use rich ecosystem of babel.
|
|
49
|
+
- Good, because users are used to javascript.
|
|
50
|
+
- Good, because all platforms are supported.
|
|
51
|
+
- Bad, because passing data to and from javascript is very costly. ([SWC issue: Speed up `parse`](https://github.com/swc-project/swc/issues/2175))
|
|
52
|
+
- Bad, because js plugins require and block the main javascript thread.
|
|
53
|
+
- Bad, because the main javascript is singled threaded and be bottleneck.
|
|
54
|
+
- Bad, because `napi` (renamed to `node-api`) does not provide a way to get the return value of a function called from other thread than js thread. To workaround this, we should implement a complex request-response system based using lots of mutex.
|
|
55
|
+
- Bad, because node js worker thread is not an event loop. This means worker we cannot `yield` from a worker thread when we need to call js plugin. As a result, the when main js thread is busy because of js plugins, worker threads are also blocked without doing any task.
|
|
56
|
+
|
|
57
|
+
### [option 2] Plugins based on `abi_stable` and native dynamic libraries
|
|
58
|
+
|
|
59
|
+
Plugins are written in rust, and built as native libraries for each platforms. SWC pass data to plugin using special form of AST, which has stable memory representation regardless of the version of `rustc`.
|
|
60
|
+
|
|
61
|
+
- Good, because it's fast, even on the first run.
|
|
62
|
+
- Good, because it does not require very complex request-response system.
|
|
63
|
+
- Good, because plugin authors can use all features of rust.
|
|
64
|
+
- Bad, because configuring CI for publishing plugins is very hard.
|
|
65
|
+
- Bad, because plugin developer cannot publish a plugin from a single machine.
|
|
66
|
+
- Bad, because loading of plugins is complex. Path for dynamic libraries are platform-dependant.
|
|
67
|
+
- Bad, because we have to handle quirks of each platforms.
|
|
68
|
+
- Bad, because `@swc/wasm` has no way to support plugins.
|
|
69
|
+
|
|
70
|
+
### [option 3] Wasm plugins based on `wasmtime`
|
|
71
|
+
|
|
72
|
+
SWC embeds `wasmtime`, loads plugin built as web assembly.
|
|
73
|
+
|
|
74
|
+
- Good, because it's fast except the first run.
|
|
75
|
+
- Good, because configuring CI is simple.
|
|
76
|
+
- Good, because plugin authors can publish a plugin without CI, even with a single machine.
|
|
77
|
+
- Bad, because `@swc/wasm` has no way to support plugins.
|
|
78
|
+
- Bad, because first run is slow.
|
|
79
|
+
- Bad, because we have to manage the cache of compiled wasm files.
|
|
80
|
+
- Bad, because `wasmtime` does not support all platforms.
|
|
81
|
+
|
|
82
|
+
### [option 4] Wasm plugins based on `wasmer`
|
|
83
|
+
|
|
84
|
+
SWC embeds web assembly runtime (https://wasmer.io/), loads plugin built as web assembly.
|
|
85
|
+
|
|
86
|
+
- Good, because it's fast except the first run.
|
|
87
|
+
- Good, because configuring CI is simple.
|
|
88
|
+
- Good, because plugin authors can publish a plugin without CI, even with a single machine.
|
|
89
|
+
- Good, because `@swc/wasm` can support plugins in future as `wasmer` officially supports using it within a wasm file.
|
|
90
|
+
- Bad, because first run is slow.
|
|
91
|
+
- Bad, because we have to manage the cache of compiled wasm files.
|
|
92
|
+
- Bad, because `wasmer` does not support all platforms.
|
|
93
|
+
|
|
94
|
+
## Links
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Architectural Decision Records
|
|
2
|
+
|
|
3
|
+
This directory contains a series of [Architectural Decision Records](https://adr.github.io/)
|
|
4
|
+
or "ADRs" for the `swc` project. We're going to try to use it as a kind of collective
|
|
5
|
+
memory of the decisions we've made and the path we've taken to get the project to its current
|
|
6
|
+
point.
|
|
7
|
+
|
|
8
|
+
Note that these are *historical references* that do not supersede (but might enhance) the living
|
|
9
|
+
documentation of the project itself, which you can find inline in the source code.
|
|
10
|
+
|
|
11
|
+
Proposing a non-trivial change to the way `swc` works? You might like to start with an ADR
|
|
12
|
+
by copying `template.md` into a new file, filling out a first version of the proposal, and
|
|
13
|
+
posting it as a PR on the github repo for discussion.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# [short title of solved problem and solution]
|
|
2
|
+
|
|
3
|
+
* Status: [proposed | rejected | accepted | deprecated | … | superseded by [ADR-0005](0005-example.md)] <!-- optional -->
|
|
4
|
+
* Deciders: [list everyone involved in the decision] <!-- optional -->
|
|
5
|
+
* Date: [YYYY-MM-DD when the decision was last updated] <!-- optional -->
|
|
6
|
+
|
|
7
|
+
Technical Story: [description | ticket/issue URL] <!-- optional -->
|
|
8
|
+
|
|
9
|
+
## Context and Problem Statement
|
|
10
|
+
|
|
11
|
+
[Describe the context and problem statement, e.g., in free form using two to three sentences. You may want to articulate the problem in form of a question.]
|
|
12
|
+
|
|
13
|
+
## Decision Drivers <!-- optional -->
|
|
14
|
+
|
|
15
|
+
* [driver 1, e.g., a force, facing concern, …]
|
|
16
|
+
* [driver 2, e.g., a force, facing concern, …]
|
|
17
|
+
* … <!-- numbers of drivers can vary -->
|
|
18
|
+
|
|
19
|
+
## Considered Options
|
|
20
|
+
|
|
21
|
+
* [option 1]
|
|
22
|
+
* [option 2]
|
|
23
|
+
* [option 3]
|
|
24
|
+
* … <!-- numbers of options can vary -->
|
|
25
|
+
|
|
26
|
+
## Decision Outcome
|
|
27
|
+
|
|
28
|
+
Chosen option: "[option 1]", because [justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | … | comes out best (see below)].
|
|
29
|
+
|
|
30
|
+
### Positive Consequences <!-- optional -->
|
|
31
|
+
|
|
32
|
+
* [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …]
|
|
33
|
+
* …
|
|
34
|
+
|
|
35
|
+
### Negative Consequences <!-- optional -->
|
|
36
|
+
|
|
37
|
+
* [e.g., compromising quality attribute, follow-up decisions required, …]
|
|
38
|
+
* …
|
|
39
|
+
|
|
40
|
+
## Pros and Cons of the Options <!-- optional -->
|
|
41
|
+
|
|
42
|
+
### [option 1]
|
|
43
|
+
|
|
44
|
+
[example | description | pointer to more information | …] <!-- optional -->
|
|
45
|
+
|
|
46
|
+
* Good, because [argument a]
|
|
47
|
+
* Good, because [argument b]
|
|
48
|
+
* Bad, because [argument c]
|
|
49
|
+
* … <!-- numbers of pros and cons can vary -->
|
|
50
|
+
|
|
51
|
+
### [option 2]
|
|
52
|
+
|
|
53
|
+
[example | description | pointer to more information | …] <!-- optional -->
|
|
54
|
+
|
|
55
|
+
* Good, because [argument a]
|
|
56
|
+
* Good, because [argument b]
|
|
57
|
+
* Bad, because [argument c]
|
|
58
|
+
* … <!-- numbers of pros and cons can vary -->
|
|
59
|
+
|
|
60
|
+
### [option 3]
|
|
61
|
+
|
|
62
|
+
[example | description | pointer to more information | …] <!-- optional -->
|
|
63
|
+
|
|
64
|
+
* Good, because [argument a]
|
|
65
|
+
* Good, because [argument b]
|
|
66
|
+
* Bad, because [argument c]
|
|
67
|
+
* … <!-- numbers of pros and cons can vary -->
|
|
68
|
+
|
|
69
|
+
## Links <!-- optional -->
|
|
70
|
+
|
|
71
|
+
* [Link type] [Link to ADR] <!-- example: Refined by [ADR-0005](0005-example.md) -->
|
|
72
|
+
* … <!-- numbers of links can vary -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swc/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.135",
|
|
4
4
|
"description": "Super-fast alternative for babel",
|
|
5
5
|
"homepage": "https://swc.rs",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -47,23 +47,21 @@
|
|
|
47
47
|
"registry": "https://registry.npmjs.org/",
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"@node-rs/helper": "^1.0.0"
|
|
52
|
-
},
|
|
50
|
+
"dependencies": {},
|
|
53
51
|
"optionalDependencies": {
|
|
54
|
-
"@swc/core-win32-x64-msvc": "1.2.
|
|
55
|
-
"@swc/core-darwin-x64": "1.2.
|
|
56
|
-
"@swc/core-linux-x64-gnu": "1.2.
|
|
57
|
-
"@swc/core-linux-x64-musl": "1.2.
|
|
58
|
-
"@swc/core-freebsd-x64": "1.2.
|
|
59
|
-
"@swc/core-win32-ia32-msvc": "1.2.
|
|
60
|
-
"@swc/core-linux-arm64-gnu": "1.2.
|
|
61
|
-
"@swc/core-linux-arm-gnueabihf": "1.2.
|
|
62
|
-
"@swc/core-darwin-arm64": "1.2.
|
|
63
|
-
"@swc/core-android-arm64": "1.2.
|
|
64
|
-
"@swc/core-linux-arm64-musl": "1.2.
|
|
65
|
-
"@swc/core-win32-arm64-msvc": "1.2.
|
|
66
|
-
"@swc/core-android-arm-eabi": "1.2.
|
|
52
|
+
"@swc/core-win32-x64-msvc": "1.2.135",
|
|
53
|
+
"@swc/core-darwin-x64": "1.2.135",
|
|
54
|
+
"@swc/core-linux-x64-gnu": "1.2.135",
|
|
55
|
+
"@swc/core-linux-x64-musl": "1.2.135",
|
|
56
|
+
"@swc/core-freebsd-x64": "1.2.135",
|
|
57
|
+
"@swc/core-win32-ia32-msvc": "1.2.135",
|
|
58
|
+
"@swc/core-linux-arm64-gnu": "1.2.135",
|
|
59
|
+
"@swc/core-linux-arm-gnueabihf": "1.2.135",
|
|
60
|
+
"@swc/core-darwin-arm64": "1.2.135",
|
|
61
|
+
"@swc/core-android-arm64": "1.2.135",
|
|
62
|
+
"@swc/core-linux-arm64-musl": "1.2.135",
|
|
63
|
+
"@swc/core-win32-arm64-msvc": "1.2.135",
|
|
64
|
+
"@swc/core-android-arm-eabi": "1.2.135"
|
|
67
65
|
},
|
|
68
66
|
"types": "./index.d.ts",
|
|
69
67
|
"scripts": {
|
|
@@ -87,7 +85,7 @@
|
|
|
87
85
|
"@babel/preset-react": "^7.13.13",
|
|
88
86
|
"@babel/preset-typescript": "^7.13.0",
|
|
89
87
|
"@babel/types": "^7.14.0",
|
|
90
|
-
"@napi-rs/cli": "^2.
|
|
88
|
+
"@napi-rs/cli": "^2.4.2",
|
|
91
89
|
"@swc/helpers": "^0.2.10",
|
|
92
90
|
"@types/jest": "^26.0.23",
|
|
93
91
|
"@types/node": "^14.14.41",
|