@swc/core 1.3.40 → 1.3.42

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,89 @@
5
5
 
6
6
 
7
7
 
8
+ - **(bindings/node)** Fix loading of `spack.config.js` (#7105) ([a4d1af1](https://github.com/swc-project/swc/commit/a4d1af18deabe79caa959eb654ca1ebc2d9f6867))
9
+
10
+
11
+ - **(es/ast)** Fix `EqIgnoreSpan` impl of `Number` (#7112) ([6a570a3](https://github.com/swc-project/swc/commit/6a570a334c787358d67ae6c590a7fd0e916f35e8))
12
+
13
+
14
+ - **(es/compat)** Don't modify private fields from `reserved_words` pass (#7113) ([2bc631d](https://github.com/swc-project/swc/commit/2bc631df8792d2f1356b5ef2dbf3ee0c46ecbd4f))
15
+
16
+
17
+ - **(es/minifier)** Pass `keep_*` in config to `compress` and `mangle` (#7102) ([6a1201c](https://github.com/swc-project/swc/commit/6a1201cfc44fe5ae3d8599669fd8032c82e6c580))
18
+
19
+
20
+ - **(es/minifier)** Don't inline into arrow heads (#7099) ([610e1bb](https://github.com/swc-project/swc/commit/610e1bb581a04fe9b871dd7afa0cf81ab9ee7fa8))
21
+
22
+
23
+ - **(es/parser)** Fix parsing of static accessors (#7108) ([dd2b16d](https://github.com/swc-project/swc/commit/dd2b16db9ec77e515dcd38f68f8020d70d0f9ac9))
24
+
25
+ ### Features
26
+
27
+
28
+
29
+ - **(es/resolver)** Make scope context identical to the vars (#7095) ([0f09e35](https://github.com/swc-project/swc/commit/0f09e356c38268ac10223d0d44dd253949bcbc59))- **general**: Feat(css/minifier) Follow the CSS spec more rigorously (#6291)
30
+
31
+ **Description:**
32
+
33
+ Full refactor of the "calc" simplification to be more compliant with the spec. ([df09d2f](https://github.com/swc-project/swc/commit/df09d2fd4bef3ab83efbe46f8e3d42d26bbae95d))
34
+
35
+ ### Refactor
36
+
37
+
38
+
39
+ - **(es/fixer)** Move comments with the insertion order (#7097) ([f250f24](https://github.com/swc-project/swc/commit/f250f243cba49b9cdcdc920d37c92662c14941bc))
40
+
41
+
42
+ - **(es/resolver)** Make syntax context for unresolved and top-level stable (#7096) ([c114f00](https://github.com/swc-project/swc/commit/c114f006b4ea388ef9a4503e935d59e92a647ecf))
43
+
44
+ ## [1.3.41] - 2023-03-17
45
+
46
+ ### Bug Fixes
47
+
48
+
49
+
50
+ - **(bindings/cli)** Change order of checking inputs to workaround a Windows issue (#7077) ([7bbec92](https://github.com/swc-project/swc/commit/7bbec92d234ddb47b51a014937d1ec7c1cb571c7))
51
+
52
+
53
+ - **(css/codegen)** Respect `raw` of `Str` (#7078) ([7849a2d](https://github.com/swc-project/swc/commit/7849a2d75d57bf3b6242f5f472a06a30c9fb948d))
54
+
55
+
56
+ - **(css/parser)** Fix parsing of `:global(> *)` (#7082) ([60f74ea](https://github.com/swc-project/swc/commit/60f74ea0769c2be764af8eb5320343f77ea78c1a))
57
+
58
+
59
+ - **(es/codegen)** Emit `type_params` for `TsConstructSignatureDecl` (#7080) ([8353acc](https://github.com/swc-project/swc/commit/8353accb1315a8847e4dabcd36274cde5856e763))
60
+
61
+
62
+ - **(es/minifier)** Preserve `delete` of unresolved variables (#7072) ([86295ba](https://github.com/swc-project/swc/commit/86295ba8f26fbe3829c2c08fd8034975f05f60b5))
63
+
64
+
65
+ - **(es/minifier)** Accept `keep_fnames` and `keep_classnames` (#7090) ([0086914](https://github.com/swc-project/swc/commit/00869147d3ac62db323cdf2a06cc8cc17dcdd1f3))
66
+
67
+
68
+ - **(es/minifier)** Remove wrong optimization of `new RegExp(…)` (#7091) ([493a4f7](https://github.com/swc-project/swc/commit/493a4f7042bad7f883981b10cdc02fe0d36a5fb0))
69
+
70
+
71
+ - **(es/react)** Align to `babel@8` behavior (#7081) ([7b491a6](https://github.com/swc-project/swc/commit/7b491a69a5ea80cd8aace9e7da3e73079c6a259f))
72
+
73
+
74
+ - **(testing)** Ignore `non_snake_case` for generated test names (#7087) ([1c254b1](https://github.com/swc-project/swc/commit/1c254b1c44f72f5e66698f78d76796d5a7f66146))
75
+
76
+ ### Performance
77
+
78
+
79
+
80
+ - **(es/lexer)** Use jump table for `skip_space` (#7073) ([f854d51](https://github.com/swc-project/swc/commit/f854d51343dcbdf43acd87f51e2288a052e39a0b))
81
+
82
+ ### Refactor
83
+ - **general**: Fix lints using clippy from `nightly-2023-03-13` (#6920) ([963c460](https://github.com/swc-project/swc/commit/963c46061321fff3a2893da4953c1fd5ec649311))
84
+
85
+ ## [1.3.40] - 2023-03-13
86
+
87
+ ### Bug Fixes
88
+
89
+
90
+
8
91
  - **(bindings/cli)** Update `swc_ecma_ast` (#7060) ([1b40689](https://github.com/swc-project/swc/commit/1b40689c3a754ce4a038ea98d7e9f41b1e9cf7a7))
9
92
 
10
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.3.40",
3
+ "version": "1.3.42",
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.40",
142
- "@swc/core-darwin-x64": "1.3.40",
143
- "@swc/core-linux-x64-gnu": "1.3.40",
144
- "@swc/core-linux-x64-musl": "1.3.40",
145
- "@swc/core-win32-ia32-msvc": "1.3.40",
146
- "@swc/core-linux-arm64-gnu": "1.3.40",
147
- "@swc/core-linux-arm-gnueabihf": "1.3.40",
148
- "@swc/core-darwin-arm64": "1.3.40",
149
- "@swc/core-linux-arm64-musl": "1.3.40",
150
- "@swc/core-win32-arm64-msvc": "1.3.40"
141
+ "@swc/core-win32-x64-msvc": "1.3.42",
142
+ "@swc/core-darwin-x64": "1.3.42",
143
+ "@swc/core-linux-x64-gnu": "1.3.42",
144
+ "@swc/core-linux-x64-musl": "1.3.42",
145
+ "@swc/core-win32-ia32-msvc": "1.3.42",
146
+ "@swc/core-linux-arm64-gnu": "1.3.42",
147
+ "@swc/core-linux-arm-gnueabihf": "1.3.42",
148
+ "@swc/core-darwin-arm64": "1.3.42",
149
+ "@swc/core-linux-arm64-musl": "1.3.42",
150
+ "@swc/core-win32-arm64-msvc": "1.3.42"
151
151
  },
152
152
  "files": [
153
153
  "CHANGELOG.md",
package/spack.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Options } from "./types";
2
2
  export type BundleInput = BundleOptions | BundleOptions[];
3
+ export declare const isLocalFile: RegExp;
3
4
  export declare function compileBundleOptions(config: BundleInput | string | undefined): Promise<BundleInput>;
4
5
  /**
5
6
  * Usage: In `spack.config.js` / `spack.config.ts`, you can utilize type annotations (to get autocompletions) like
package/spack.js CHANGED
@@ -32,14 +32,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
32
  });
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.config = exports.compileBundleOptions = void 0;
35
+ exports.config = exports.compileBundleOptions = exports.isLocalFile = void 0;
36
36
  const path = __importStar(require("path"));
37
+ exports.isLocalFile = /^\.{0,2}\//; // starts with '/' './' '../'
37
38
  function compileBundleOptions(config) {
38
39
  return __awaiter(this, void 0, void 0, function* () {
39
40
  const f = config === undefined ? '.' : config;
40
41
  try {
41
- const file = typeof f === 'string' ? f : path.resolve('spack.config.js');
42
- let configFromFile = require(file);
42
+ const filepath = typeof f === 'string' ? f : 'spack.config.js';
43
+ const fileModule = exports.isLocalFile.test(filepath) ? path.resolve(filepath) : filepath;
44
+ let configFromFile = require(fileModule);
43
45
  if (configFromFile.default) {
44
46
  configFromFile = configFromFile.default;
45
47
  }
package/types.d.ts CHANGED
@@ -614,6 +614,7 @@ export interface ReactConfig {
614
614
  development?: boolean;
615
615
  /**
616
616
  * Use `Object.assign()` instead of `_extends`. Defaults to false.
617
+ * @deprecated
617
618
  */
618
619
  useBuiltins?: boolean;
619
620
  /**