@swc/core 1.3.23 → 1.3.25
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 +197 -1
- package/package.json +12 -16
- package/run_swcx.js +0 -85
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,201 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
-
## [
|
|
2
|
+
## [1.3.25] - 2023-01-05
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- **(bindings/cli)** Skip empty stdin in non tty environments (#6714) ([0076418](https://github.com/swc-project/swc/commit/00764188195c63af1e5a8e34ce29dcf650b20f04))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
- **(cli)** Use the `--source-maps` option (#6708) ([24cd384](https://github.com/swc-project/swc/commit/24cd384c20abc9bacdc89b50cd6a9a9df243b687))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- **(es)** Preserve license comments by default (#6703) ([58700f2](https://github.com/swc-project/swc/commit/58700f2bec696d0d2b2466ab6b4641f0a7017808))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
- **(es)** Remove import statement canonicalization (#6716) ([b451fa9](https://github.com/swc-project/swc/commit/b451fa9e88aee33368759a67913e7c6eb9c3898f))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
- **(es)** Fix wasm (#6755) ([b46815a](https://github.com/swc-project/swc/commit/b46815a684a13ff3b364b2913c18acf57afbbac7))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
- **(es/compat)** Fix syntax context of `async-to-generator` (#6741) ([206c0db](https://github.com/swc-project/swc/commit/206c0dbebe5eecaa8a5c1846189b26cb5517d84c))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
- **(es/minifier)** Fix usage counter to fix infinite loop (#6744) ([88d40e8](https://github.com/swc-project/swc/commit/88d40e8ab899976c123b5b5f74f0ad02ec9d7868))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
- **(es/parser)** Fix priority of `>>>` (#6748) ([65a0d3a](https://github.com/swc-project/swc/commit/65a0d3a3109f3d32818f7bf2c8ebbeb863c62060))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
- **(es/plugin)** Fix plugin starter template (#6723) ([082dc21](https://github.com/swc-project/swc/commit/082dc2101b8f3c05b103cf59484355ef87016a57))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
- **(es/react)** Force refresh if code contains `@refresh reset` (#6749) ([36b26d3](https://github.com/swc-project/swc/commit/36b26d3496fd9ad7e3ccb41c164600657476a8a3))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
- **(es/utils)** Fix detection of hoisting (#6738) ([b5d31cc](https://github.com/swc-project/swc/commit/b5d31cc2dabcf79886606946c75d0a15f2fe4091))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
- **(preset-env)** Update data (#6719) ([d506c96](https://github.com/swc-project/swc/commit/d506c9680577173e5abb1dd0f75456145fda60c9))
|
|
42
|
+
|
|
43
|
+
### Documentation
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
- **(es)** Fix example (#6743) ([79afcb5](https://github.com/swc-project/swc/commit/79afcb5d81cb5cca89c48d39b950ddc24f31d434))
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
- **(bindings)** Remove `swcx` from `@swc/core` (#6720) ([30dd65b](https://github.com/swc-project/swc/commit/30dd65bb83a3159ca9d569af6b29aed03796056f))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
- **(css/parser)** Normalize urange (#6704) ([8af627d](https://github.com/swc-project/swc/commit/8af627d5c4720644246f99012b6f49b419066eef))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
- **(css/prefixer)** Support page break (#6693) ([27a8b7e](https://github.com/swc-project/swc/commit/27a8b7e50b67de076089ca8b05d6e44944182b31))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
- **(css/prefixer)** Support `clamp` (#6695) ([1722428](https://github.com/swc-project/swc/commit/1722428909ba380fec114be1e2a75f0d2462a645))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
- **(es/jest)** Support chaining of jest function calls (#6747) ([72fb606](https://github.com/swc-project/swc/commit/72fb606eb204fddad5df284afda0955fd6e760ff))
|
|
66
|
+
|
|
67
|
+
### Performance
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
- **(es/preset-env)** Use `VisitMut` instead of `Fold` for polyfill (#6734) ([98da644](https://github.com/swc-project/swc/commit/98da6444b6499d3b3d895d3f81941c778340cf3b))
|
|
72
|
+
|
|
73
|
+
### Refactor
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
- **(css/codegen)** Do not use `raw` (#6674) ([ebebd60](https://github.com/swc-project/swc/commit/ebebd608750bf63d6f715350835a1a5349efdb68))
|
|
78
|
+
|
|
79
|
+
## [1.3.24] - 2022-12-21
|
|
80
|
+
|
|
81
|
+
### Bug Fixes
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
- **(css/minifier)** Don't remove custom variables with different case (#6655) ([dd7280d](https://github.com/swc-project/swc/commit/dd7280d5bda960292bf5f4e12816d5a340277222))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
- **(css/minifier)** Fix a bug with a modern hash (#6664) ([1d3e06a](https://github.com/swc-project/swc/commit/1d3e06aa886ffd8b18044c42a899fc3c780a6179))
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
- **(es/helpers)** Fix loose mode (#6691) ([5016ebe](https://github.com/swc-project/swc/commit/5016ebed8f68ed1afb40d5d86c13d5e787e9cc13))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
- **(es/minifier)** Abort IIFE invoker completely on eval (#6659) ([bb9fab8](https://github.com/swc-project/swc/commit/bb9fab8d0358262b8236c372d62660a50b5b3417))
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
- **(es/minifier)** Don't inline invalid LHS into an update argument (#6680) ([7e6ec8d](https://github.com/swc-project/swc/commit/7e6ec8d587471dba1dde44ebcfd6af6d03247955))
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
- **(es/preset-env)** Align polyfills with `@babel/plugin-polyfill-corejs3` (#6673) ([5fed222](https://github.com/swc-project/swc/commit/5fed22282971c62af3be8bf0b858684ca90ec7fc))
|
|
101
|
+
|
|
102
|
+
### Features
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
- **(css/compat)** Support function notation (#6651) ([39afc46](https://github.com/swc-project/swc/commit/39afc4627e2a1e6ca397bc22cd3d9abe68c45fe2))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
- **(css/compat)** Support `not` with multiple arguments (#6668) ([352896f](https://github.com/swc-project/swc/commit/352896f4cb627c1a006ea82780f993915af7e8b1))
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
- **(css/compat)** Support `hwb` color (#6687) ([b23cf50](https://github.com/swc-project/swc/commit/b23cf50f4ff58a2c6d434cb03f2388e75a35d510))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
- **(css/minifier)** Compress alpha in a hex (#6653) ([f6292e6](https://github.com/swc-project/swc/commit/f6292e63b51e5ad5a8d1fcc253e8342438098898))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
- **(css/minifier)** Improve compression of media at-rules (#6665) ([2fd3ced](https://github.com/swc-project/swc/commit/2fd3ced40c97fbac162f70e49c76c775e66a4552))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
- **(css/parser)** Normalize hex colors (#6652) ([b257d5d](https://github.com/swc-project/swc/commit/b257d5d591c04feedf2f5997a984bf2f843b9d19))
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
- **(css/parser)** Normalize selector AST (#6657) ([649438b](https://github.com/swc-project/swc/commit/649438b76a8ea61f2ddb2160a212d318d9d05267))
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
- **(css/parser)** Normalize declaration and important (#6663) ([1fc97a7](https://github.com/swc-project/swc/commit/1fc97a7cea4ddf5b70f3b9193388e481caa60731))
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
- **(css/parser)** Normalize dimension (#6654) ([3d3863d](https://github.com/swc-project/swc/commit/3d3863dc1f80a7a1dc141cc9fb0ed9277537a3d0))
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
- **(css/parser)** Normalize URL functions (#6675) ([c01464e](https://github.com/swc-project/swc/commit/c01464e4525cb8c7d4b9f000d8b76d72e8e7531a))
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
- **(css/parser)** Normalize at-rule names (#6676) ([7f8ba9c](https://github.com/swc-project/swc/commit/7f8ba9c22c9910e03a3b6122dd4ca4324314bbb5))
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
- **(css/parser)** Normalize keyframe selectors (#6688) ([d7a0524](https://github.com/swc-project/swc/commit/d7a0524fb64c97facf067281ae3a2fc4afae68fe))
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
- **(css/parser)** Normalize and improve function name (#6667) ([2571070](https://github.com/swc-project/swc/commit/257107014801e892a78ec68c2c0ec0899a083053))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
- **(css/prefixer)** Support font-face format (#6644) ([199ac74](https://github.com/swc-project/swc/commit/199ac7461814553bab97c1f0f7b1c89f34897122))
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
- **(css/prefixer)** Support `word-wrap` (#6679) ([46241b4](https://github.com/swc-project/swc/commit/46241b4e554b7a6ee090db8e35acd0151e8caf2b))
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
- **(css/prefixer)** Support `place-*` properties (#6685) ([d8df1b5](https://github.com/swc-project/swc/commit/d8df1b53d13cb25aa8f513f9dc3baeb535fd714e))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
- **(css/prefixer)** Support `overflow` (#6678) ([1c7f003](https://github.com/swc-project/swc/commit/1c7f003779fd17d3d2c372ce502cbbaabb49ed48))
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
- **(es/minifier)** Improve simplification of `?.` (#6681) ([707b1e3](https://github.com/swc-project/swc/commit/707b1e3cd203be22eccc60367dc3c84f62105de5))
|
|
158
|
+
|
|
159
|
+
### Miscellaneous Tasks
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
- **(ci)** Fix upload of cli binaries (#6701) ([025d626](https://github.com/swc-project/swc/commit/025d6268cdcbdb2cf280ccbef7b15a6f3daf00a5))
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
- **(helpers)** Fix license (#6690) ([8a71dbc](https://github.com/swc-project/swc/commit/8a71dbca6d94af76c3bf7317390dd1da835cacae))
|
|
167
|
+
|
|
168
|
+
### Performance
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
- **(css/prefixer)** Use `JsWord` instead of `&str` (#6658) ([d27a270](https://github.com/swc-project/swc/commit/d27a270fec7f08895c5a9ab2b56da6d77f52d5af))
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
- **(es/minifier)** Use rope-like structure for the name mangler (#6661) ([cb4173a](https://github.com/swc-project/swc/commit/cb4173aa73fbfd95f2411ceb97cec95e408f59ee))
|
|
176
|
+
|
|
177
|
+
### Refactor
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
- **(css/compat)** Merge nesting into the compiler (#6686) ([1840e74](https://github.com/swc-project/swc/commit/1840e748af8334d244a1455a25325625b06fff93))
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
- **(css/prefixer)** Use `eq_ignore_span` (#6656) ([d4660a4](https://github.com/swc-project/swc/commit/d4660a4673e19d628b7720e1352fa905bdc4456a))
|
|
185
|
+
|
|
186
|
+
### Testing
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
- **(css/parser)** Add a test (#6666) ([87e1efd](https://github.com/swc-project/swc/commit/87e1efd98ce3c58325ee047c2b01b0df575e921f))
|
|
191
|
+
|
|
192
|
+
### Build
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
- **(bindings)** Crash in GraalVM (#6689) ([e7849db](https://github.com/swc-project/swc/commit/e7849dbc6a68274ec5f177f061da80bdf8788902))
|
|
197
|
+
|
|
198
|
+
## [1.3.23] - 2022-12-14
|
|
3
199
|
|
|
4
200
|
### Bug Fixes
|
|
5
201
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swc/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.25",
|
|
4
4
|
"description": "Super-fast alternative for babel",
|
|
5
5
|
"homepage": "https://swc.rs",
|
|
6
6
|
"main": "./index.js",
|
|
7
|
-
"bin": {
|
|
8
|
-
"swcx": "run_swcx.js"
|
|
9
|
-
},
|
|
10
7
|
"author": "강동윤 <kdy1997.dev@gmail.com>",
|
|
11
8
|
"license": "Apache-2.0",
|
|
12
9
|
"keywords": [
|
|
@@ -94,7 +91,7 @@
|
|
|
94
91
|
"@babel/preset-react": "^7.13.13",
|
|
95
92
|
"@babel/preset-typescript": "^7.13.0",
|
|
96
93
|
"@babel/types": "^7.14.0",
|
|
97
|
-
"@napi-rs/cli": "^2.
|
|
94
|
+
"@napi-rs/cli": "^2.14.1",
|
|
98
95
|
"@swc/core": "=1.2.220",
|
|
99
96
|
"@swc/helpers": "^0.4.2",
|
|
100
97
|
"@swc/plugin-jest": "1.5.25",
|
|
@@ -141,16 +138,16 @@
|
|
|
141
138
|
"url": "https://opencollective.com/swc"
|
|
142
139
|
},
|
|
143
140
|
"optionalDependencies": {
|
|
144
|
-
"@swc/core-win32-x64-msvc": "1.3.
|
|
145
|
-
"@swc/core-darwin-x64": "1.3.
|
|
146
|
-
"@swc/core-linux-x64-gnu": "1.3.
|
|
147
|
-
"@swc/core-linux-x64-musl": "1.3.
|
|
148
|
-
"@swc/core-win32-ia32-msvc": "1.3.
|
|
149
|
-
"@swc/core-linux-arm64-gnu": "1.3.
|
|
150
|
-
"@swc/core-linux-arm-gnueabihf": "1.3.
|
|
151
|
-
"@swc/core-darwin-arm64": "1.3.
|
|
152
|
-
"@swc/core-linux-arm64-musl": "1.3.
|
|
153
|
-
"@swc/core-win32-arm64-msvc": "1.3.
|
|
141
|
+
"@swc/core-win32-x64-msvc": "1.3.25",
|
|
142
|
+
"@swc/core-darwin-x64": "1.3.25",
|
|
143
|
+
"@swc/core-linux-x64-gnu": "1.3.25",
|
|
144
|
+
"@swc/core-linux-x64-musl": "1.3.25",
|
|
145
|
+
"@swc/core-win32-ia32-msvc": "1.3.25",
|
|
146
|
+
"@swc/core-linux-arm64-gnu": "1.3.25",
|
|
147
|
+
"@swc/core-linux-arm-gnueabihf": "1.3.25",
|
|
148
|
+
"@swc/core-darwin-arm64": "1.3.25",
|
|
149
|
+
"@swc/core-linux-arm64-musl": "1.3.25",
|
|
150
|
+
"@swc/core-win32-arm64-msvc": "1.3.25"
|
|
154
151
|
},
|
|
155
152
|
"files": [
|
|
156
153
|
"CHANGELOG.md",
|
|
@@ -162,7 +159,6 @@
|
|
|
162
159
|
"Visitor.js",
|
|
163
160
|
"binding.d.ts",
|
|
164
161
|
"index.js",
|
|
165
|
-
"run_swcx.js",
|
|
166
162
|
"types.d.ts",
|
|
167
163
|
"util.js",
|
|
168
164
|
"README.md",
|
package/run_swcx.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
-
};
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
/**
|
|
17
|
-
* Lightweight entrypoint to native swc cli binary.
|
|
18
|
-
*
|
|
19
|
-
* This is to locate corresponding per-platform executables correctly, as well as
|
|
20
|
-
* let npm links binary to `node_modules/.bin` allows npm-related ecosystem (`npx swcx`, etcs)
|
|
21
|
-
* works correctly. However, it means spawning native binary still requires warmup from node.js
|
|
22
|
-
* process.
|
|
23
|
-
*
|
|
24
|
-
* NOTE: THIS IS NOT A PERMANENT APPROACH.
|
|
25
|
-
* Distribution of native cli binary is not fully concluded yet. This allows easier
|
|
26
|
-
* opt-in while implementation is in progress to collect feedback.
|
|
27
|
-
*/
|
|
28
|
-
const child_process_1 = require("child_process");
|
|
29
|
-
const path_1 = __importDefault(require("path"));
|
|
30
|
-
const fs_1 = require("fs");
|
|
31
|
-
const { platform, arch } = process;
|
|
32
|
-
const isMusl = () => (() => {
|
|
33
|
-
function isMusl() {
|
|
34
|
-
if (!process.report || typeof process.report.getReport !== "function") {
|
|
35
|
-
try {
|
|
36
|
-
return (0, fs_1.readFileSync)("/usr/bin/ldd", "utf8").includes("musl");
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
const { glibcVersionRuntime } = process.report.getReport().header;
|
|
44
|
-
return !glibcVersionRuntime;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return isMusl();
|
|
48
|
-
})();
|
|
49
|
-
const platformPackagesMap = {
|
|
50
|
-
"android": {
|
|
51
|
-
"arm64": "@swc/core-android-arm64",
|
|
52
|
-
"arm": "@swc/core-android-arm-eabi",
|
|
53
|
-
},
|
|
54
|
-
"win32": {
|
|
55
|
-
"x64": "@swc/core-win32-x64-msvc",
|
|
56
|
-
"ia32": "@swc/core-win32-ia32-msvc",
|
|
57
|
-
"arm64": "@swc/core-win32-arm64-msvc"
|
|
58
|
-
},
|
|
59
|
-
"darwin": {
|
|
60
|
-
"x64": "@swc/core-darwin-x64",
|
|
61
|
-
"arm64": "@swc/core-darwin-arm64",
|
|
62
|
-
},
|
|
63
|
-
"freebsd": {
|
|
64
|
-
"x64": "@swc/core-freebsd-x64",
|
|
65
|
-
},
|
|
66
|
-
"linux": {
|
|
67
|
-
"x64": `@swc/core-linux-x64-${isMusl() ? 'musl' : 'gnu'}`,
|
|
68
|
-
"arm64": `@swc/core-linux-arm64-${isMusl() ? 'musl' : 'gnu'}`,
|
|
69
|
-
"arm": "@swc/core-linux-arm64-gnu"
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
const inferBinaryName = () => {
|
|
73
|
-
const packageName = platformPackagesMap[platform][arch];
|
|
74
|
-
if (!packageName) {
|
|
75
|
-
throw new Error(`Unsupported platform: binary for '${platform} ${arch}' is not available`);
|
|
76
|
-
}
|
|
77
|
-
return path_1.default.join(path_1.default.dirname(require.resolve(packageName)), platform === 'win32' ? 'swc.exe' : 'swc');
|
|
78
|
-
};
|
|
79
|
-
const executeBinary = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
-
const binary = inferBinaryName();
|
|
81
|
-
const [, , ...args] = process.argv;
|
|
82
|
-
const options = { cwd: process.cwd(), stdio: "inherit" };
|
|
83
|
-
return (0, child_process_1.spawn)(binary, args, options);
|
|
84
|
-
});
|
|
85
|
-
executeBinary().catch((e) => console.error(e));
|