@swc/core 1.3.25 → 1.3.27

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/binding.js +13 -1
  3. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,4 +1,125 @@
1
1
  # Changelog
2
+ ## [unreleased]
3
+
4
+ ### Bug Fixes
5
+
6
+
7
+
8
+ - **(es/codegen)** Skip space if jsx attrs is empty (#6823) ([e9fdac2](https://github.com/swc-project/swc/commit/e9fdac216c0a578f266a7a16000e2675d722068c))
9
+
10
+
11
+ - **(es/compat)** Ignore `this` in nested scopes in `classes` pass (#6796) ([07676d5](https://github.com/swc-project/swc/commit/07676d5515321c50206b3f0ea9f1473b6b2c3192))
12
+
13
+
14
+ - **(es/plugin)** Fix starter template (#6815) ([38fb70c](https://github.com/swc-project/swc/commit/38fb70c237f122a8d8f8fdf187bd341326e39f22))
15
+
16
+
17
+ - **(es/renamer)** Handle rest params correctly (#6821) ([ebce18b](https://github.com/swc-project/swc/commit/ebce18b221c50dedba9e3a4078148473822be949))
18
+
19
+
20
+ - **(es/transform)** Apply `hygiene` and `resolver` if minify is specified (#6793) ([c145409](https://github.com/swc-project/swc/commit/c14540905f81e1c1677e7c9d723e71b1b6a9740b))
21
+
22
+ ### Features
23
+
24
+
25
+
26
+ - **(css/parser)** Normalize at-rules (#6705) ([43e7519](https://github.com/swc-project/swc/commit/43e75194e546997d6524bbfb7f0a7ff531bb443f))
27
+
28
+
29
+ - **(es/ast)** Add `EsNext` to `EsVersion` (#6816) ([ff78b8f](https://github.com/swc-project/swc/commit/ff78b8f7e077bad599f9b740ca4e831f835a347b))
30
+
31
+
32
+ - **(es/helper)** Use `require` to load polyfills and helpers in Script (#6778) ([ad8d043](https://github.com/swc-project/swc/commit/ad8d043f1d75b2df5a5e2fe43fba1ec843d2fad4))
33
+
34
+
35
+ - **(es/minifier)** Remove noop spreads (#6803) ([8f683e3](https://github.com/swc-project/swc/commit/8f683e3f77fe9f4fd84a5bf64c067ae9526fb330))
36
+
37
+
38
+ - **(es/quote)** Allow using `Str` as a var (#6797) ([224eff9](https://github.com/swc-project/swc/commit/224eff91eb06808e2c79bb4fbe06ccf46121758f))
39
+
40
+
41
+ - **(es/renamer)** Support `safari10` from the name mangler (#6801) ([631dd78](https://github.com/swc-project/swc/commit/631dd7872b78b8698bb4923c1e81a9a8770c1fea))
42
+
43
+
44
+ - **(es/renamer)** Rename synthesized identifiers even on `eval` (#6818) ([82bd5c2](https://github.com/swc-project/swc/commit/82bd5c2041ba95f6d0260e03c446496b7eb37cb4))
45
+
46
+ ### Testing
47
+
48
+
49
+
50
+ - **(es)** Enable execution tests for fixed issues (#6805) ([e7ea054](https://github.com/swc-project/swc/commit/e7ea054c6389b43b0e7b104e9337e11a82bb23f7))
51
+
52
+
53
+ - **(es/compat)** Add a test to verify parameters passs (#6792) ([7dc5ccb](https://github.com/swc-project/swc/commit/7dc5ccb0fc217abdb7ab4e76ac7f646c5087b3a8))
54
+
55
+
56
+ - **(es/minifier)** Add a test for an invalid issue (#6802) ([a299fd0](https://github.com/swc-project/swc/commit/a299fd04180c77a97817d9e817b247efa1973e06))
57
+
58
+
59
+ - **(es/preset-env)** Add a test for a wrong issue (#6794) ([b29aa5b](https://github.com/swc-project/swc/commit/b29aa5b5a0d4f78795eaf3784c84a18ba1b88bfa))
60
+
61
+ ## [1.3.26] - 2023-01-11
62
+
63
+ ### Bug Fixes
64
+
65
+
66
+
67
+ - **(common)** Mark `\r` as a line ending (#6752) ([26a0c13](https://github.com/swc-project/swc/commit/26a0c135896098e1e1a8fbb99a623311828af5b2))
68
+
69
+
70
+ - **(es)** Remove useless context (#6777) ([ae3cfa7](https://github.com/swc-project/swc/commit/ae3cfa7d2d4cff7f3246691d24286bc2470792e1))
71
+
72
+
73
+ - **(es/codegen)** Fix LineCol calculation of printed files (#6763) ([2b503c1](https://github.com/swc-project/swc/commit/2b503c16d5f338c6a786a19c7c0acbc4c06bcfee))
74
+
75
+
76
+ - **(es/codegen)** Skip `lo` of a program if body is not empty (#6773) ([3f0f664](https://github.com/swc-project/swc/commit/3f0f664c488b4f51a12d277b29ad17e28a413a2b))
77
+
78
+
79
+ - **(es/decorator)** Fix type detection for template literal types (#6786) ([bbfa97a](https://github.com/swc-project/swc/commit/bbfa97a475fdfe18fe9e3ea29329ecb39ed2ddac))
80
+
81
+
82
+ - **(es/helpers)** Make `_classPrivateFieldLooseBase ` return receiver (#6770) ([1d14760](https://github.com/swc-project/swc/commit/1d147602c0bfe291408c65b2e444cea0b5ceba89))
83
+
84
+
85
+ - **(es/minifier)** Make name mangler respect `toplevel` (#6774) ([ec7e913](https://github.com/swc-project/swc/commit/ec7e9138158426b83d12dc3a29896098fb4c9ffa))
86
+
87
+
88
+ - **(es/minifier)** Don't inline conditionally initialized vars (#6751) ([336b1d8](https://github.com/swc-project/swc/commit/336b1d8b4d6489da8f78731d9e12fef962a005da))
89
+
90
+
91
+ - **(es/minifier)** Make AST compressor respect `toplevel` (#6775) ([06770cf](https://github.com/swc-project/swc/commit/06770cff047055b9cea27970e7ce882d770257ba))
92
+
93
+
94
+ - **(es/parser)** Allow parsing `import.meta` as an expression (#6783) ([ff8face](https://github.com/swc-project/swc/commit/ff8facef64ffe115936cfc154b35ec08359524f8))
95
+
96
+ ### Features
97
+
98
+
99
+
100
+ - **(es/minifier)** Make name mangler understand block scoping (#6670) ([a1ccc8a](https://github.com/swc-project/swc/commit/a1ccc8afdff1f252210d571907124508cf760694))
101
+
102
+
103
+ - **(es/minifier)** Handle boolean in `Evaluator` (#6756) ([8a6a1cb](https://github.com/swc-project/swc/commit/8a6a1cbcf1279b805e740f4d77ebb9fb72d52d41))
104
+
105
+
106
+ - **(es/typescript)** Support const modifier on type parameters (#6672) ([019cf37](https://github.com/swc-project/swc/commit/019cf371994b87a92fd26fc623959a797f35991b))
107
+
108
+ ### Miscellaneous Tasks
109
+
110
+
111
+
112
+ - **(ci)** Fix CI action (#6772) ([6d365de](https://github.com/swc-project/swc/commit/6d365de9e21d57c785f1634f4c19418765d9ca9b))
113
+
114
+ ### Testing
115
+
116
+
117
+
118
+ - **(es)** Add a test for a fixed source map issue (#6768) ([6c126da](https://github.com/swc-project/swc/commit/6c126da1d42922229e9bb1c7594570f701e083ba))
119
+
120
+
121
+ - **(es/module)** Add a test for invalid issue (#6785) ([0ef84e1](https://github.com/swc-project/swc/commit/0ef84e1c0004ec5282d26e9a84ea5729681ff106))
122
+
2
123
  ## [1.3.25] - 2023-01-05
3
124
 
4
125
  ### Bug Fixes
@@ -64,6 +185,15 @@
64
185
 
65
186
  - **(es/jest)** Support chaining of jest function calls (#6747) ([72fb606](https://github.com/swc-project/swc/commit/72fb606eb204fddad5df284afda0955fd6e760ff))
66
187
 
188
+ ### Miscellaneous Tasks
189
+
190
+
191
+
192
+ - **(ci)** Fix publish action ([ed2277f](https://github.com/swc-project/swc/commit/ed2277fc07bc1be133001eefcee707c8e6f194fd))
193
+
194
+
195
+ - **(ci)** Fix publish action (#6757) ([7e6e7b1](https://github.com/swc-project/swc/commit/7e6e7b107e40b7ca2192f6c04f668a526fc2db35))
196
+
67
197
  ### Performance
68
198
 
69
199
 
package/binding.js CHANGED
@@ -9,7 +9,8 @@ function isMusl() {
9
9
  // For Node 10
10
10
  if (!process.report || typeof process.report.getReport !== 'function') {
11
11
  try {
12
- return readFileSync('/usr/bin/ldd', 'utf8').includes('musl');
12
+ const lddPath = require('child_process').execSync('which ldd').toString().trim();
13
+ return readFileSync(lddPath, 'utf8').includes('musl');
13
14
  }
14
15
  catch (e) {
15
16
  return true;
@@ -104,6 +105,17 @@ switch (platform) {
104
105
  }
105
106
  break;
106
107
  case 'darwin':
108
+ localFileExisted = existsSync(join(__dirname, 'swc.darwin-universal.node'));
109
+ try {
110
+ if (localFileExisted) {
111
+ nativeBinding = require('./swc.darwin-universal.node');
112
+ }
113
+ else {
114
+ nativeBinding = require('@swc/core-darwin-universal');
115
+ }
116
+ break;
117
+ }
118
+ catch (_a) { }
107
119
  switch (arch) {
108
120
  case 'x64':
109
121
  localFileExisted = existsSync(join(__dirname, 'swc.darwin-x64.node'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.3.25",
3
+ "version": "1.3.27",
4
4
  "description": "Super-fast alternative for babel",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./index.js",
@@ -138,16 +138,16 @@
138
138
  "url": "https://opencollective.com/swc"
139
139
  },
140
140
  "optionalDependencies": {
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"
141
+ "@swc/core-win32-x64-msvc": "1.3.27",
142
+ "@swc/core-darwin-x64": "1.3.27",
143
+ "@swc/core-linux-x64-gnu": "1.3.27",
144
+ "@swc/core-linux-x64-musl": "1.3.27",
145
+ "@swc/core-win32-ia32-msvc": "1.3.27",
146
+ "@swc/core-linux-arm64-gnu": "1.3.27",
147
+ "@swc/core-linux-arm-gnueabihf": "1.3.27",
148
+ "@swc/core-darwin-arm64": "1.3.27",
149
+ "@swc/core-linux-arm64-musl": "1.3.27",
150
+ "@swc/core-win32-arm64-msvc": "1.3.27"
151
151
  },
152
152
  "files": [
153
153
  "CHANGELOG.md",