Skip to content

Commit 3837cf0

Browse files
authored
chore: use forked ast-grep with reduced language support (#321)
reduce build binary size before ``` 57M vite-plus.darwin-arm64.node ``` after ``` # bash + typescript 25M vite-plus.darwin-arm64.node # bash only 22M vite-plus.darwin-arm64.node ```
1 parent 77e867b commit 3837cf0

2 files changed

Lines changed: 13 additions & 277 deletions

File tree

Cargo.lock

Lines changed: 3 additions & 270 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ cargo_common_metadata = "allow"
3333

3434
[workspace.dependencies]
3535
anyhow = "1.0.98"
36+
# Temporary fork of ast-grep dependencies using a specific commit from https://github.com/fengmk2/ast-grep.git.
37+
# Reason: Waiting for upstream PR #2359 (https://github.com/ast-grep/ast-grep/pull/2359) to be merged.
38+
# The commit 2f4c6924438a72e136485f0e14cd136b2e17d8d3 includes necessary fixes/features not yet available in the official release.
39+
# Safe to migrate back to the official ast-grep release once PR #2359 is merged and a new version is published.
40+
ast-grep-config = { git = "https://github.com/fengmk2/ast-grep.git", rev = "2f4c6924438a72e136485f0e14cd136b2e17d8d3" }
41+
ast-grep-core = { git = "https://github.com/fengmk2/ast-grep.git", rev = "2f4c6924438a72e136485f0e14cd136b2e17d8d3" }
42+
ast-grep-language = { git = "https://github.com/fengmk2/ast-grep.git", rev = "2f4c6924438a72e136485f0e14cd136b2e17d8d3", default-features = false, features = ["lang-bash"] }
3643
backon = "1.3.0"
3744
bincode = "2.0.1"
3845
bstr = { version = "1.12.0", default-features = false, features = ["alloc", "std"] }
@@ -46,6 +53,9 @@ futures-util = "0.3.31"
4653
hex = "0.4.3"
4754
httpmock = "0.7"
4855
indoc = "2.0.5"
56+
napi = { version = "3.0.0", default-features = false, features = ["async", "error_anyhow"] }
57+
napi-build = "2"
58+
napi-derive = { version = "3.0.0", default-features = false, features = ["type-def", "strict"] }
4959
nix = { version = "0.30.1", features = ["dir"] }
5060
pathdiff = "0.2.3"
5161
petgraph = "0.8.2"
@@ -77,13 +87,6 @@ vite_workspace = { git = "https://github.com/voidzero-dev/vite-task", rev = "edf
7787
wax = "0.6.0"
7888
which = "8.0.0"
7989

80-
ast-grep-config = "0.40.0"
81-
ast-grep-core = "0.40.0"
82-
ast-grep-language = "0.40.0"
83-
napi = { version = "3.0.0", default-features = false, features = ["async", "error_anyhow"] }
84-
napi-build = "2"
85-
napi-derive = { version = "3.0.0", default-features = false, features = ["type-def", "strict"] }
86-
8790
[profile.dev]
8891
# Disabling debug info speeds up local and CI builds,
8992
# and we don't rely on it for debugging that much.

0 commit comments

Comments
 (0)