diff --git a/src/strip/.cargo/config.toml b/src/strip/.cargo/config.toml deleted file mode 100644 index 96460d1..0000000 --- a/src/strip/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[target.x86_64-pc-windows-gnu] -rustflags = ["-C", "link-arg=-lkernel32"] diff --git a/src/strip/Cargo.lock b/src/strip/Cargo.lock deleted file mode 100644 index 3a8e2cb..0000000 --- a/src/strip/Cargo.lock +++ /dev/null @@ -1,959 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bitflags" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "castaway" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" -dependencies = [ - "rustversion", -] - -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] -name = "cobs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" -dependencies = [ - "thiserror", -] - -[[package]] -name = "compact_str" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb1325a1cece981e8a296ab8f0f9b63ae357bd0784a9faaf548cc7b480707a" -dependencies = [ - "castaway", - "cfg-if", - "itoa", - "rustversion", - "ryu", - "static_assertions", -] - -[[package]] -name = "cow-utils" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "417bef24afe1460300965a25ff4a24b8b45ad011948302ec221e8a0a81eb2c79" - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "deranged" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "dragonbox_ecma" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a5577f010d4e1bb3f3c4d6081e05718eb6992cf20119cab4d3abadff198b5ae" - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "embedded-io" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - -[[package]] -name = "flate2" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "hashbrown" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" -dependencies = [ - "allocator-api2", -] - -[[package]] -name = "indexmap" -version = "2.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" - -[[package]] -name = "libc" -version = "0.2.180" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" - -[[package]] -name = "memchr" -version = "2.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "nom" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" -dependencies = [ - "memchr", -] - -[[package]] -name = "nonmax" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "610a5acd306ec67f907abe5567859a3c693fb9886eb1f012ab8f2a47bef3db51" - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "owo-colors" -version = "4.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" - -[[package]] -name = "oxc" -version = "0.0.0" -dependencies = [ - "oxc_allocator", - "oxc_codegen", - "oxc_parser", - "oxc_semantic", - "oxc_span", - "oxc_transformer", -] - -[[package]] -name = "oxc-browserslist" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d55ecaab3af16fee2d0195f2e7d26f27cab0044d0b6d74073514c7feee6beb" -dependencies = [ - "flate2", - "nom", - "postcard", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "time", -] - -[[package]] -name = "oxc-miette" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a7ba54c704edefead1f44e9ef09c43e5cfae666bdc33516b066011f0e6ebf7" -dependencies = [ - "cfg-if", - "owo-colors", - "oxc-miette-derive", - "textwrap", - "thiserror", - "unicode-segmentation", - "unicode-width", -] - -[[package]] -name = "oxc-miette-derive" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4faecb54d0971f948fbc1918df69b26007e6f279a204793669542e1e8b75eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "oxc_allocator" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2174c7c8f77137b1bd1c653d7a5a531ae41f3b8fec1dd0251c801689784e7a2e" -dependencies = [ - "allocator-api2", - "hashbrown", - "oxc_data_structures", - "rustc-hash", -] - -[[package]] -name = "oxc_ast" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f1902f97a5cac8767b76a1d8a1b3124e9db80c176ebbc98f75143dcc124a15" -dependencies = [ - "bitflags", - "oxc_allocator", - "oxc_ast_macros", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_estree", - "oxc_regular_expression", - "oxc_span", - "oxc_syntax", -] - -[[package]] -name = "oxc_ast_macros" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a31bd55516a98a35b2d99fa5813a3d3a5b798bad3262c819dfe7344bc6f390" -dependencies = [ - "phf", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "oxc_ast_visit" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c520a488c04ba5267223edd0bb245fb7f10e2358e8955802a5d962bb95b50a" -dependencies = [ - "oxc_allocator", - "oxc_ast", - "oxc_span", - "oxc_syntax", -] - -[[package]] -name = "oxc_codegen" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfd3d146e6e0d340c183aa0e98f29ab1bba876c282350e5e06ab9d6f536eacd" -dependencies = [ - "bitflags", - "cow-utils", - "dragonbox_ecma", - "itoa", - "oxc_allocator", - "oxc_ast", - "oxc_data_structures", - "oxc_index", - "oxc_semantic", - "oxc_span", - "oxc_syntax", - "rustc-hash", -] - -[[package]] -name = "oxc_compat" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7319f12eb8d4a05737a7f71642d7a97aee210488dc4041a7a452352a31ac0fe6" -dependencies = [ - "cow-utils", - "oxc-browserslist", - "oxc_syntax", - "rustc-hash", - "serde", -] - -[[package]] -name = "oxc_data_structures" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a42840ce8d83a08a92823dda6189e4d97359feca24a4fa732f3256c4614bb5a4" -dependencies = [ - "ropey", -] - -[[package]] -name = "oxc_diagnostics" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f7b09c1563a67ede53af131f717b31ba89a992959ebad188b5158c21d4dc0a" -dependencies = [ - "cow-utils", - "oxc-miette", - "percent-encoding", -] - -[[package]] -name = "oxc_ecmascript" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4813b352bd5b0b05badf0c9e6c5ec7ea58a6a7ab49bec8d18ead262624c6ef8d" -dependencies = [ - "cow-utils", - "num-bigint", - "num-traits", - "oxc_allocator", - "oxc_ast", - "oxc_regular_expression", - "oxc_span", - "oxc_syntax", -] - -[[package]] -name = "oxc_estree" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54fb3effe995e6538d68070bf0a450b5ffd11dd41b62f11a4d01efa1f40e278" - -[[package]] -name = "oxc_index" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3e6120999627ec9703025eab7c9f410ebb7e95557632a8902ca48210416c2b" -dependencies = [ - "nonmax", - "serde", -] - -[[package]] -name = "oxc_parser" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5592bf8b64743944eb46528f9eabdde2b2435c8293cd502f5c183f9dff644e16" -dependencies = [ - "bitflags", - "cow-utils", - "memchr", - "num-bigint", - "num-traits", - "oxc_allocator", - "oxc_ast", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_ecmascript", - "oxc_span", - "oxc_syntax", - "rustc-hash", - "seq-macro", -] - -[[package]] -name = "oxc_regular_expression" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09de7f7e0fb82f54750e3a95346a828fd354b9aeac00f131719008733e66a18d" -dependencies = [ - "bitflags", - "oxc_allocator", - "oxc_ast_macros", - "oxc_diagnostics", - "oxc_span", - "phf", - "rustc-hash", - "unicode-id-start", -] - -[[package]] -name = "oxc_semantic" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2269186b4f1510a76daf02914cb70e82a78549de451b8276bba0a419c62ac3" -dependencies = [ - "itertools", - "memchr", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_ecmascript", - "oxc_index", - "oxc_span", - "oxc_syntax", - "rustc-hash", - "self_cell", - "smallvec", -] - -[[package]] -name = "oxc_span" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a42c0759b745eca0fe776890af46ce12e79e61796995e51a8eb9dcdf5516ab0" -dependencies = [ - "compact_str", - "oxc-miette", - "oxc_allocator", - "oxc_ast_macros", - "oxc_estree", -] - -[[package]] -name = "oxc_syntax" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63eac2e04a75a10c5714aeb753cdfa06b1abc66bbaa748b7994700f52c9b184" -dependencies = [ - "bitflags", - "cow-utils", - "dragonbox_ecma", - "nonmax", - "oxc_allocator", - "oxc_ast_macros", - "oxc_data_structures", - "oxc_estree", - "oxc_index", - "oxc_span", - "phf", - "unicode-id-start", -] - -[[package]] -name = "oxc_transformer" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e394bc5221c9e228fc06f54b7f7a3e2d63ed135a50b8678e8485b5b49222bb5" -dependencies = [ - "base64", - "compact_str", - "indexmap", - "itoa", - "memchr", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_compat", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_ecmascript", - "oxc_regular_expression", - "oxc_semantic", - "oxc_span", - "oxc_syntax", - "oxc_traverse", - "rustc-hash", - "serde", - "serde_json", - "sha1", -] - -[[package]] -name = "oxc_traverse" -version = "0.110.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4473bf963b351d5b744b75aee9ff6aa41d62f8ca662012b03dc315cac9f1f2e5" -dependencies = [ - "itoa", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_data_structures", - "oxc_ecmascript", - "oxc_semantic", - "oxc_span", - "oxc_syntax", - "rustc-hash", -] - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - -[[package]] -name = "phf" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" -dependencies = [ - "phf_macros", - "phf_shared", - "serde", -] - -[[package]] -name = "phf_generator" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" -dependencies = [ - "fastrand", - "phf_shared", -] - -[[package]] -name = "phf_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "phf_shared" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" -dependencies = [ - "siphasher", -] - -[[package]] -name = "postcard" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" -dependencies = [ - "cobs", - "embedded-io 0.4.0", - "embedded-io 0.6.1", - "serde", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "proc-macro2" -version = "1.0.105" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "ropey" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93411e420bcd1a75ddd1dc3caf18c23155eda2c090631a85af21ba19e97093b5" -dependencies = [ - "smallvec", - "str_indices", -] - -[[package]] -name = "rustc-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "ryu" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" - -[[package]] -name = "self_cell" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12e76d157a900eb52e81bc6e9f3069344290341720e9178cde2407113ac8d89" - -[[package]] -name = "seq-macro" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.149" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "simd-adler32" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" - -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" -dependencies = [ - "serde", -] - -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "str_indices" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08889ec5408683408db66ad89e0e1f93dff55c73a4ccc71c427d5b277ee47e6" - -[[package]] -name = "syn" -version = "2.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "textwrap" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" -dependencies = [ - "smawk", - "unicode-linebreak", - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "2.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "time" -version = "0.3.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" -dependencies = [ - "deranged", - "num-conv", - "powerfmt", - "serde", - "time-core", -] - -[[package]] -name = "time-core" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" - -[[package]] -name = "typenum" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" - -[[package]] -name = "unicode-id-start" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b79ad29b5e19de4260020f8919b443b2ef0277d242ce532ec7b7a2cc8b6007" - -[[package]] -name = "unicode-ident" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" - -[[package]] -name = "unicode-linebreak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" - -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - -[[package]] -name = "unicode-width" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "zmij" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc5a66a20078bf1251bde995aa2fdcc4b800c70b5d92dd2c62abc5c60f679f8" diff --git a/src/strip/Cargo.toml b/src/strip/Cargo.toml deleted file mode 100644 index c74615e..0000000 --- a/src/strip/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "oxc" -edition = "2024" - -[lib] -crate-type = ["staticlib"] - -[dependencies] -oxc_allocator = "0.110.0" -oxc_span = "0.110.0" -oxc_transformer = "0.110.0" -oxc_semantic = "0.110.0" -oxc_codegen = { version = "0.110.0", default-features = false } -oxc_parser = { version = "0.110.0", default-features = false } - -[profile.release] -lto = true -codegen-units = 1 -panic = "abort" -opt-level = "z" -strip = true diff --git a/src/strip/src/ffi.rs b/src/strip/src/ffi.rs deleted file mode 100644 index 3a13def..0000000 --- a/src/strip/src/ffi.rs +++ /dev/null @@ -1,107 +0,0 @@ -use std::ffi::{CStr, c_char, c_int}; -use std::ptr; - -use crate::strip::strip_types_internal; - -pub const OXC_ERR_NULL_INPUT: c_int = -1; -pub const OXC_ERR_INVALID_UTF8: c_int = -2; -pub const OXC_ERR_PARSE_FAILED: c_int = -3; -pub const OXC_ERR_TRANSFORM_FAILED: c_int = -4; -pub const OXC_ERR_OUTPUT_TOO_LARGE: c_int = -5; - -fn classify_strip_error(err: &str) -> c_int { - match ["Parse errors:", "Semantic errors:"].iter().any(|p| err.starts_with(p)) { - true => OXC_ERR_PARSE_FAILED, - false => OXC_ERR_TRANSFORM_FAILED, - } -} - -unsafe extern "C" { - fn malloc(size: usize) -> *mut core::ffi::c_void; -} - -unsafe fn write_error(output: *mut c_char, output_len: usize, msg: &str) { - if output.is_null() || output_len == 0 { - return; - } - - let bytes = msg.as_bytes(); - let copy_len = bytes.len().min(output_len.saturating_sub(1)); - - unsafe { - ptr::copy_nonoverlapping(bytes.as_ptr(), output as *mut u8, copy_len); - *output.add(copy_len) = 0; - } -} - -#[unsafe(no_mangle)] -pub unsafe extern "C" fn OXC_strip_types_owned( - input: *const c_char, filename: *const c_char, is_module: c_int, out_len: *mut usize, out_error: *mut c_int, error_output: *mut c_char, error_output_len: usize, -) -> *mut c_char { - if !out_error.is_null() { - unsafe { *out_error = OXC_ERR_NULL_INPUT }; - } - - if !out_len.is_null() { - unsafe { *out_len = 0 }; - } - - if input.is_null() || filename.is_null() || out_len.is_null() { - unsafe { write_error(error_output, error_output_len, "null input/output passed") }; - return ptr::null_mut(); - } - - let filename_str = match unsafe { CStr::from_ptr(filename).to_str() } { - Ok(s) => s, - Err(_) => { - unsafe { write_error(error_output, error_output_len, "filename is not valid UTF-8") }; - if !out_error.is_null() { - unsafe { *out_error = OXC_ERR_INVALID_UTF8 }; - } - return ptr::null_mut(); - } - }; - - let input_str = match unsafe { CStr::from_ptr(input).to_str() } { - Ok(s) => s, - Err(_) => { - unsafe { write_error(error_output, error_output_len, "source input is not valid UTF-8") }; - if !out_error.is_null() { - unsafe { *out_error = OXC_ERR_INVALID_UTF8 }; - } - return ptr::null_mut(); - } - }; - - match strip_types_internal(input_str, filename_str, is_module != 0) { - Ok(result) => { - let bytes = result.as_bytes(); - let alloc_len = bytes.len() + 1; - let out_ptr = unsafe { malloc(alloc_len) as *mut c_char }; - if out_ptr.is_null() { - unsafe { write_error(error_output, error_output_len, "out of memory allocating strip output") }; - if !out_error.is_null() { - unsafe { *out_error = OXC_ERR_OUTPUT_TOO_LARGE }; - } - return ptr::null_mut(); - } - - unsafe { - ptr::copy_nonoverlapping(bytes.as_ptr(), out_ptr as *mut u8, bytes.len()); - *out_ptr.add(bytes.len()) = 0; - *out_len = bytes.len(); - } - if !out_error.is_null() { - unsafe { *out_error = 0 }; - } - out_ptr - } - Err(err) => { - unsafe { write_error(error_output, error_output_len, &err) }; - if !out_error.is_null() { - unsafe { *out_error = classify_strip_error(&err) }; - } - ptr::null_mut() - } - } -} diff --git a/src/strip/src/lib.rs b/src/strip/src/lib.rs deleted file mode 100644 index 8296843..0000000 --- a/src/strip/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod ffi; -mod strip; - -pub use ffi::*; -pub use strip::strip_types_internal; diff --git a/src/strip/src/strip.rs b/src/strip/src/strip.rs deleted file mode 100644 index 69beb92..0000000 --- a/src/strip/src/strip.rs +++ /dev/null @@ -1,48 +0,0 @@ -use std::path::Path; - -use oxc_allocator::Allocator; -use oxc_codegen::Codegen; -use oxc_parser::Parser; -use oxc_semantic::SemanticBuilder; -use oxc_span::SourceType; -use oxc_transformer::{TransformOptions, Transformer, TypeScriptOptions}; - -pub fn strip_types_internal(source: &str, filename: &str, is_module: bool) -> Result { - let allocator = Allocator::default(); - let source_type = SourceType::from_path(filename).unwrap_or_else(|_| SourceType::ts()).with_module(is_module); - let parser_ret = Parser::new(&allocator, source, source_type).parse(); - - if !parser_ret.errors.is_empty() { - let errors: Vec = parser_ret.errors.iter().map(|e| e.to_string()).collect(); - return Err(format!("Parse errors: {}", errors.join("; "))); - } - - let mut program = parser_ret.program; - let semantic_ret = SemanticBuilder::new().build(&program); - - if !semantic_ret.errors.is_empty() { - let errors: Vec = semantic_ret.errors.iter().map(|e| e.to_string()).collect(); - return Err(format!("Semantic errors: {}", errors.join("; "))); - } - - let scoping = semantic_ret.semantic.into_scoping(); - let transform_options = TransformOptions { - typescript: TypeScriptOptions { - only_remove_type_imports: false, - ..Default::default() - }, - ..Default::default() - }; - - let source_path = Path::new(filename); - let transformer = Transformer::new(&allocator, source_path, &transform_options); - let ret = transformer.build_with_scoping(scoping, &mut program); - - if !ret.errors.is_empty() { - let errors: Vec = ret.errors.iter().map(|e| e.to_string()).collect(); - return Err(format!("Transform errors: {}", errors.join("; "))); - } - - let output = Codegen::new().build(&program).code; - Ok(output) -}