@swc/core 1.11.21 → 1.11.22

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/README.md +109 -0
  2. package/binding.d.ts +2 -2
  3. package/package.json +12 -12
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ <p align="center">
2
+ <a href="https://swc.rs/">
3
+ <img alt="swc" src="https://raw.githubusercontent.com/swc-project/logo/master/swc.png" width="546">
4
+ </a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ Make the web (development) faster.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@swc/core">
13
+ <img alt="downloads (@swc/core)" src="https://img.shields.io/npm/dm/@swc/core?label=downloads%20%28%40swc%2Fcore%29">
14
+ </a>
15
+ <a href="https://www.npmjs.com/package/@swc/counter?activeTab=dependents">
16
+ <img alt="downloads (3rd party)" src="https://img.shields.io/npm/dm/@swc/counter?label=downloads%20%283rd%20party%29">
17
+ </a>
18
+ </p>
19
+ <p align="center">
20
+ <a href="https://crates.io/crates/swc_ecma_parser">
21
+ <img alt="undefined" src="https://img.shields.io/crates/d/swc_ecma_parser.svg?label=crates.io%20downloads">
22
+ </a>
23
+ <a href="https://github.com/swc-project/swc/releases/latest">
24
+ <img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/swc-project/swc">
25
+ </a>
26
+ </p>
27
+
28
+ <p align="center">
29
+ <img alt="GitHub code size in bytes" src="https://img.shields.io/github/languages/code-size/swc-project/swc">
30
+ <a href="https://github.com/swc-project/swc/blob/main/package.json#L22">
31
+ <img alt="node-current (scoped)" src="https://img.shields.io/node/v/@swc/core">
32
+ </a>
33
+ </p>
34
+
35
+ <p align="center">
36
+ <a href="https://discord.com/invite/GnHbXTdZz6">
37
+ <img alt="Discord" src="https://img.shields.io/discord/889779439272075314">
38
+ </a>
39
+ </p>
40
+
41
+ SWC (stands for `Speedy Web Compiler`) is a super-fast TypeScript / JavaScript compiler written in Rust. It's a library for Rust and JavaScript at the same time. If you are using SWC from Rust, see [rustdoc](https://rustdoc.swc.rs/swc/) and for most users, your entry point for using the library will be [parser](https://rustdoc.swc.rs/swc_ecma_parser/).
42
+
43
+ Also, SWC tries to ensure that
44
+
45
+ > If you select the latest version of each crates, it will work
46
+
47
+ for rust users.
48
+
49
+ MSRV of crates is currently `1.73`.
50
+
51
+ To update all SWC crates you use, you can run `curl https://raw.githubusercontent.com/swc-project/swc/main/scripts/update-all-swc-crates.sh | bash -s`. This script will update all dependencies to the latest version and run `cargo build` to ensure that everything works.
52
+ Note that you need
53
+
54
+ - `jq`
55
+ - `cargo upgrade`
56
+
57
+ command to run the script.
58
+
59
+ ---
60
+
61
+ If you are using SWC from JavaScript, please refer to [docs on the website](https://swc.rs/docs/installation/).
62
+
63
+ # Documentation
64
+
65
+ Check out the documentation [in the website](https://swc.rs/docs/installation/).
66
+
67
+ # Features
68
+
69
+ Please see [comparison with babel](https://swc.rs/docs/migrating-from-babel).
70
+
71
+ # Performance
72
+
73
+ Please see [benchmark results](https://swc.rs/docs/benchmark-transform) on the website.
74
+
75
+ # Supporting development
76
+
77
+ <h2 align="center">Supporting swc</h2>
78
+
79
+ ## Star History
80
+
81
+ [![Star History Chart](https://api.star-history.com/svg?repos=swc-project/swc&type=Timeline)](https://www.star-history.com/#swc-project/swc&Timeline)
82
+
83
+ ## Powered by
84
+
85
+ [![JetBrains logo.](https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg)](https://jb.gg/OpenSourceSupport)
86
+
87
+ ## Sponsors
88
+
89
+ <p align="center">
90
+ <a href="https://opencollective.com/swc">
91
+ <img src="https://raw.githubusercontent.com/swc-project/swc-sponsor-images/main/sponsors.svg" alt="Sponsors">
92
+ </a>
93
+ </p>
94
+
95
+ SWC is a community-driven project, and is maintained by a group of [volunteers](https://swc.rs/docs/team). If you'd like to help support the future of the project, please consider:
96
+
97
+ - Giving developer time on the project. (Message us on [Discord](https://discord.gg/GnHbXTdZz6) (preferred) or [Github discussions](https://github.com/swc-project/swc/discussions) for guidance!)
98
+ - Giving funds by becoming a sponsor (see https://opencollective.com/swc)!
99
+
100
+ ## Contributing
101
+
102
+ See [CONTRIBUTING.md](CONTRIBUTING.md). You may also find the architecture
103
+ documentation useful ([ARCHITECTURE.md](ARCHITECTURE.md)).
104
+
105
+ ## License
106
+
107
+ SWC is primarily distributed under the terms of the Apache License (Version 2.0).
108
+
109
+ See [LICENSE](LICENSE) for details.
package/binding.d.ts CHANGED
@@ -24,13 +24,13 @@ export interface NapiMinifyExtra {
24
24
 
25
25
  export declare function newMangleNameCache(): object
26
26
 
27
- export declare function parse(src: string, options: Buffer, filename?: string | undefined | null, signal?: AbortSignal | undefined | null): Promise<string>
27
+ export declare function parse(src: Buffer | string, options: Buffer, filename?: string | undefined | null, signal?: AbortSignal | undefined | null): Promise<string>
28
28
 
29
29
  export declare function parseFile(path: string, options: Buffer, signal?: AbortSignal | undefined | null): Promise<string>
30
30
 
31
31
  export declare function parseFileSync(path: string, opts: Buffer): string
32
32
 
33
- export declare function parseSync(src: string, opts: Buffer, filename?: string | undefined | null): string
33
+ export declare function parseSync(src: Buffer | string, opts: Buffer, filename?: string | undefined | null): string
34
34
 
35
35
  export declare function print(programJson: string, options: Buffer, signal?: AbortSignal | undefined | null): Promise<TransformOutput>
36
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.11.21",
3
+ "version": "1.11.22",
4
4
  "description": "Super-fast alternative for babel",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./index.js",
@@ -48,7 +48,7 @@
48
48
  "scripts": {
49
49
  "postinstall": "node postinstall.js",
50
50
  "artifacts": "napi artifacts --npm-dir scripts/npm",
51
- "prepack": "tsc -d && napi prepublish -p scripts/npm --tag-style npm",
51
+ "prepack": "tsc -d && napi prepublish -p scripts/npm --tag-style npm && node scripts/copy-readme.js",
52
52
  "pack": "wasm-pack",
53
53
  "build:ts": "tsc -d",
54
54
  "build:wasm": "npm-run-all \"pack -- build ../../bindings/binding_core_wasm --scope swc {1} -t {2} --features plugin\" --",
@@ -100,15 +100,15 @@
100
100
  "typescript": "^5.3.3"
101
101
  },
102
102
  "optionalDependencies": {
103
- "@swc/core-darwin-x64": "1.11.21",
104
- "@swc/core-win32-x64-msvc": "1.11.21",
105
- "@swc/core-linux-x64-gnu": "1.11.21",
106
- "@swc/core-linux-x64-musl": "1.11.21",
107
- "@swc/core-win32-ia32-msvc": "1.11.21",
108
- "@swc/core-linux-arm-gnueabihf": "1.11.21",
109
- "@swc/core-darwin-arm64": "1.11.21",
110
- "@swc/core-linux-arm64-gnu": "1.11.21",
111
- "@swc/core-linux-arm64-musl": "1.11.21",
112
- "@swc/core-win32-arm64-msvc": "1.11.21"
103
+ "@swc/core-darwin-x64": "1.11.22",
104
+ "@swc/core-win32-x64-msvc": "1.11.22",
105
+ "@swc/core-linux-x64-gnu": "1.11.22",
106
+ "@swc/core-linux-x64-musl": "1.11.22",
107
+ "@swc/core-win32-ia32-msvc": "1.11.22",
108
+ "@swc/core-linux-arm-gnueabihf": "1.11.22",
109
+ "@swc/core-darwin-arm64": "1.11.22",
110
+ "@swc/core-linux-arm64-gnu": "1.11.22",
111
+ "@swc/core-linux-arm64-musl": "1.11.22",
112
+ "@swc/core-win32-arm64-msvc": "1.11.22"
113
113
  }
114
114
  }