diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9a7a173bc..3d304bc72 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -315,6 +315,8 @@ jobs: - name: Install toolchain uses: moonrepo/setup-rust@v1 with: + components: rustfmt + bins: taplo-cli cache-base: main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -327,18 +329,16 @@ jobs: run: command -v tree-sitter || cargo install tree-sitter-cli - name: Ensure RustFMT on nightly toolchain run: rustup component add rustfmt --toolchain nightly - - name: echo toolchain - run: rustup show - - name: Run the analyser codegen - run: cargo run -p xtask_codegen -- analyser - - name: Run the configuration codegen - run: cargo run -p xtask_codegen -- configuration - - name: Run the bindings codegen - run: cargo run -p xtask_codegen -- bindings - - name: Run the splinter codegen - run: cargo run -p xtask_codegen -- splinter - - name: Run the docs codegen - run: cargo run -p docs_codegen + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: "1.2.17" + - name: Install JS dependencies + run: bun install + - name: Setup Just + uses: extractions/setup-just@v3 + - name: Run codegen + run: just gen-lint - name: Check for git diff -- run "just ready" if you see an error run: | if [[ $(git status --porcelain) ]]; then diff --git a/Cargo.lock b/Cargo.lock index 0b4912776..ce04024ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,27 +4,27 @@ version = 4 [[package]] name = "addr2line" -version = "0.24.2" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" dependencies = [ "gimli", ] [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom 0.2.15", + "getrandom 0.3.4", "once_cell", "version_check", "zerocopy", @@ -32,9 +32,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] @@ -53,9 +53,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", @@ -68,43 +68,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", - "windows-sys 0.59.0", + "once_cell_polyfill", + "windows-sys 0.61.2", ] [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" [[package]] name = "arrayref" @@ -120,13 +121,12 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "assert_cmd" -version = "2.0.16" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d" +checksum = "9c5bcfa8749ac45dd12cb11055aeeb6b27a3895560d60d71e3c23bf979e60514" dependencies = [ "anstyle", "bstr", - "doc-comment", "libc", "predicates", "predicates-core", @@ -239,7 +239,7 @@ version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.4.1", "event-listener-strategy", "pin-project-lite", ] @@ -278,13 +278,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -304,26 +304,26 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "auto_impl" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" dependencies = [ "addr2line", "cfg-if", @@ -331,7 +331,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -348,9 +348,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.6.0" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "beef" @@ -360,318 +360,24 @@ checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" [[package]] name = "bindgen" -version = "0.72.0" +version = "0.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f72209734318d0b619a5e0f5129918b848c416e122a3c4ce054e03cb87b726f" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.10.0", "cexpr", "clang-sys", - "itertools 0.10.5", + "itertools 0.13.0", "log", "prettyplease", "proc-macro2", "quote", "regex", - "rustc-hash 2.1.0", + "rustc-hash", "shlex", - "syn 2.0.90", -] - -[[package]] -name = "biome_console" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c672a9e31e47f8df74549a570ea3245a93ce3404115c724bb16762fcbbfe17e1" -dependencies = [ - "biome_markup", - "biome_text_size", - "schemars", - "serde", - "termcolor", - "unicode-segmentation", - "unicode-width", -] - -[[package]] -name = "biome_deserialize" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b4443260d505148169f5fb35634c2a60d8489882f8c9c3f1db8b7cf0cb57632" -dependencies = [ - "biome_console", - "biome_deserialize_macros 0.5.7", - "biome_diagnostics", - "biome_json_parser", - "biome_json_syntax", - "biome_rowan", - "bitflags 2.6.0", - "indexmap 1.9.3", - "serde", - "serde_json", - "tracing", -] - -[[package]] -name = "biome_deserialize" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f619dc8ca0595ed8850d729ebc71722d4233aba68c5aec7d9993a53e59f3fe" -dependencies = [ - "biome_console", - "biome_deserialize_macros 0.6.0", - "biome_diagnostics", - "biome_json_parser", - "biome_json_syntax", - "biome_rowan", - "bitflags 2.6.0", - "indexmap 2.7.0", - "schemars", - "serde", -] - -[[package]] -name = "biome_deserialize_macros" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fc1244cc5f0cc267bd26b601e9ccd6851c6a4d395bba07e27c2de641dc84479" -dependencies = [ - "convert_case", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "biome_deserialize_macros" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c12826fff87ac09f63bbacf8bdf5225dfdf890da04d426f758cbcacf068e3e" -dependencies = [ - "biome_string_case", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "biome_diagnostics" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe1317b6d610541c4e6a0e1f803a946f153ace3468bbc77a8f273dcb04ee526f" -dependencies = [ - "backtrace", - "biome_console", - "biome_diagnostics_categories", - "biome_diagnostics_macros", - "biome_rowan", - "biome_text_edit", - "biome_text_size", - "bitflags 2.6.0", - "bpaf", - "oxc_resolver", - "serde", - "termcolor", - "unicode-width", + "syn 2.0.114", ] -[[package]] -name = "biome_diagnostics_categories" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "832080d68a2ee2f198d98ff5d26fc0f5c2566907f773d105a4a049ee07664d19" -dependencies = [ - "quote", - "serde", -] - -[[package]] -name = "biome_diagnostics_macros" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "540fec04d2e789fb992128c63d111b650733274afffff1cb3f26c8dff5167d3b" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "biome_formatter" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d351a9dc49ae024220a83c44329ab14a9e66887a7ca51fc7ae875e9e56f626c" -dependencies = [ - "biome_console", - "biome_deserialize 0.5.7", - "biome_deserialize_macros 0.5.7", - "biome_diagnostics", - "biome_rowan", - "cfg-if", - "countme", - "drop_bomb", - "indexmap 1.9.3", - "rustc-hash 1.1.0", - "tracing", - "unicode-width", -] - -[[package]] -name = "biome_js_factory" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c9847f4dfd16ee242d12b90f96f6b2eb33238dfc4eac7b5c045e14eebe717b7" -dependencies = [ - "biome_js_syntax", - "biome_rowan", -] - -[[package]] -name = "biome_js_formatter" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc1f8b67a8fa45555a7a9ea1004eca73c159b7f1941050311d35e312cff3bb8" -dependencies = [ - "biome_console", - "biome_deserialize 0.5.7", - "biome_deserialize_macros 0.5.7", - "biome_diagnostics_categories", - "biome_formatter", - "biome_js_factory", - "biome_js_syntax", - "biome_json_syntax", - "biome_rowan", - "biome_text_size", - "biome_unicode_table", - "cfg-if", - "smallvec", - "tracing", - "unicode-width", -] - -[[package]] -name = "biome_js_syntax" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38a524bd8b1f5f7b3355dfe2744196227ee15e9aa3446d562deb9ed511cf2015" -dependencies = [ - "biome_console", - "biome_diagnostics", - "biome_rowan", - "serde", -] - -[[package]] -name = "biome_json_factory" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e409eb289040f3660689dad178b00b6ac8cfa9a7fffd8225f35cb6b3d36437cf" -dependencies = [ - "biome_json_syntax", - "biome_rowan", -] - -[[package]] -name = "biome_json_parser" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c6d23fb9b683e6356c094b4a0cb38f8aa0acee60ce9c3ef24628d21a204de4d" -dependencies = [ - "biome_console", - "biome_diagnostics", - "biome_json_factory", - "biome_json_syntax", - "biome_parser", - "biome_rowan", - "biome_unicode_table", - "tracing", - "unicode-bom", -] - -[[package]] -name = "biome_json_syntax" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2645ca57f75680d3d390b2482c35db5850b1d849e1f96151a12f15f4abdb097" -dependencies = [ - "biome_rowan", - "serde", -] - -[[package]] -name = "biome_markup" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a7f11cf91599594528e97d216044ef4e410a103327212d909f215cbafe2fd9c" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", -] - -[[package]] -name = "biome_parser" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955dd999f32c086371d5c0e64b4ea1a50f50c98f1f31a3b9fe17ef47198de19b" -dependencies = [ - "biome_console", - "biome_diagnostics", - "biome_rowan", - "bitflags 2.6.0", - "drop_bomb", -] - -[[package]] -name = "biome_rowan" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c2dc25a7ba6ae89526340034abed6c89fac35b79060786771e32ed4aac77e7" -dependencies = [ - "biome_text_edit", - "biome_text_size", - "countme", - "hashbrown 0.12.3", - "memoffset", - "rustc-hash 1.1.0", - "tracing", -] - -[[package]] -name = "biome_string_case" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5868798da491b19a5b27a0bad5d8727e1e65060fa2dac360b382df00ff520774" - -[[package]] -name = "biome_text_edit" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d486fdd96d5dad6428213ce64e6b9eb5bfb2fce6387fe901e844d386283de509" -dependencies = [ - "biome_text_size", - "serde", - "similar", -] - -[[package]] -name = "biome_text_size" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ec604d15cefdced636255400359aeacfdea5d1e79445efc7aa32a0de7f0319b" -dependencies = [ - "serde", -] - -[[package]] -name = "biome_unicode_table" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e8604d34b02180a58af1dbdaac166f1805f27f5370934142a3246f83870952" - [[package]] name = "bitflags" version = "1.3.2" @@ -680,11 +386,11 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -722,9 +428,9 @@ dependencies = [ [[package]] name = "bpaf" -version = "0.9.15" +version = "0.9.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50fd5174866dc2fa2ddc96e8fb800852d37f064f32a45c7b7c2f8fa2c64c77fa" +checksum = "22a59e5c2bac9ccb280150ef4b58e07e4169d8c5c6ce0f70170e3c0b7c7b6124" dependencies = [ "bpaf_derive", "owo-colors", @@ -733,31 +439,31 @@ dependencies = [ [[package]] name = "bpaf_derive" -version = "0.5.13" +version = "0.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf95d9c7e6aba67f8fc07761091e93254677f4db9e27197adecebc7039a58722" +checksum = "549ca9c364fdc06f9f36d1356980193d930abc80db848193c2dd4d0e9a83de1b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "bstr" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" +checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" dependencies = [ "memchr", - "regex-automata 0.4.13", + "regex-automata", "serde", ] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "byteorder" @@ -767,9 +473,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.9.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "camino" @@ -785,10 +491,11 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.27" +version = "1.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" dependencies = [ + "find-msvc-tools", "shlex", ] @@ -803,15 +510,15 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" dependencies = [ "num-traits", ] @@ -856,9 +563,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.23" +version = "4.5.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "6899ea499e3fb9305a65d5ebf6e3d2248c5fab291f300ad0a704fbe142eae31a" dependencies = [ "clap_builder", "clap_derive", @@ -866,9 +573,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "7b12c8b680195a62a8364d16b8447b01b6c2c8f9aaf68bee653be34d4245e238" dependencies = [ "anstream", "anstyle", @@ -878,21 +585,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" [[package]] name = "clippy" @@ -905,9 +612,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "concurrent-queue" @@ -920,14 +627,14 @@ dependencies = [ [[package]] name = "console" -version = "0.15.8" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", - "lazy_static", "libc", - "windows-sys 0.52.0", + "once_cell", + "windows-sys 0.59.0", ] [[package]] @@ -951,26 +658,20 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "countme" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636" - [[package]] name = "cpufeatures" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.2.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" dependencies = [ "crc-catalog", ] @@ -983,9 +684,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] @@ -1041,18 +742,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -1069,30 +770,30 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "typenum", @@ -1127,9 +828,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", "pem-rfc7468", @@ -1138,9 +839,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" dependencies = [ "powerfmt", ] @@ -1181,7 +882,7 @@ dependencies = [ "glob", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -1224,22 +925,16 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - [[package]] name = "docs_codegen" version = "0.0.0" dependencies = [ "anyhow", - "biome_string_case", "bpaf", + "convert_case", "pgls_analyse", "pgls_analyser", "pgls_cli", @@ -1271,12 +966,6 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" -[[package]] -name = "drop_bomb" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bda8e21c04aca2ae33ffc2fd8c23134f3cac46db123ba97bd9d3f3b8a4a85e1" - [[package]] name = "dunce" version = "1.0.5" @@ -1285,9 +974,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "easy-parallel" @@ -1297,53 +986,53 @@ checksum = "2afbb9b0aef60e4f0d2b18129b6c0dff035a6f7dbbd17c2f38c1432102ee223c" [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" dependencies = [ "serde", ] [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "enumflags2" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "env_filter" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" dependencies = [ "log", ] [[package]] name = "env_logger" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" dependencies = [ "anstream", "anstyle", @@ -1353,18 +1042,18 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1386,9 +1075,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "5.3.1" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" dependencies = [ "concurrent-queue", "parking", @@ -1401,7 +1090,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.4.1", "pin-project-lite", ] @@ -1420,17 +1109,23 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ "crc32fast", "miniz_oxide", @@ -1470,9 +1165,9 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] @@ -1578,7 +1273,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -1642,11 +1337,11 @@ dependencies = [ [[package]] name = "getopts" -version = "0.2.21" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" +checksum = "cfe4fbac503b8d1f88e6676011885f34b7174f46e59956bba534ba83abded4df" dependencies = [ - "unicode-width", + "unicode-width 0.2.2", ] [[package]] @@ -1662,50 +1357,63 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.3.3" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" dependencies = [ "cfg-if", "libc", "r-efi", - "wasi 0.14.7+wasi-0.2.4", + "wasip2", + "wasip3", ] [[package]] name = "gimli" -version = "0.31.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" [[package]] name = "globset" -version = "0.4.16" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" +checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.13", - "regex-syntax 0.8.5", + "regex-automata", + "regex-syntax", ] [[package]] @@ -1714,7 +1422,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.10.0", "ignore", "walkdir", ] @@ -1733,12 +1441,13 @@ dependencies = [ [[package]] name = "half" -version = "2.6.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" dependencies = [ "cfg-if", "crunchy", + "zerocopy", ] [[package]] @@ -1752,29 +1461,31 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", "foldhash", ] +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + [[package]] name = "hashlink" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.5", ] [[package]] @@ -1801,9 +1512,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hermit-abi" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hex" @@ -1831,18 +1542,18 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "humansize" @@ -1855,21 +1566,22 @@ dependencies = [ [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ "displaydoc", "litemap", @@ -1878,104 +1590,72 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ - "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ - "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", + "icu_locale_core", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] [[package]] -name = "icu_provider_macros" -version = "1.5.0" +name = "id-arena" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", -] +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -1984,9 +1664,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -1994,15 +1674,15 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.23" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" +checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" dependencies = [ "crossbeam-deque", "globset", "log", "memchr", - "regex-automata 0.4.13", + "regex-automata", "same-file", "walkdir", "winapi-util", @@ -2021,27 +1701,27 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.16.1", "serde", + "serde_core", ] [[package]] name = "insta" -version = "1.42.1" +version = "1.46.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71c1b125e30d93896b365e156c33dadfffab45ee8400afcbba4752f59de08a86" +checksum = "e82db8c87c7f1ccecb34ce0c24399b8a73081427f3c7c50a5d597925356115e4" dependencies = [ "console", - "linked-hash-map", "once_cell", - "pin-project", "serde", "similar", + "tempfile", ] [[package]] @@ -2066,13 +1746,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ - "hermit-abi 0.5.0", + "hermit-abi 0.5.2", "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -2083,9 +1763,9 @@ checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" @@ -2096,6 +1776,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.14.0" @@ -2107,15 +1796,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "js-sys" -version = "0.3.81" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" dependencies = [ "once_cell", "wasm-bindgen", @@ -2157,33 +1846,39 @@ dependencies = [ "spin", ] +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "libc" -version = "0.2.180" +version = "0.2.181" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +checksum = "459427e2af2b9c839b132acb702a1c654d95e10f8c326bfc2ad11310e458b1c5" [[package]] name = "libloading" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-link", ] [[package]] name = "libm" -version = "0.2.11" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libmimalloc-sys" -version = "0.1.39" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44" +checksum = "667f4fec20f29dfc6bc7357c582d91796c169ad7e2fce709468aefeb2c099870" dependencies = [ "cc", "libc", @@ -2191,12 +1886,13 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.10.0", "libc", + "redox_syscall 0.7.0", ] [[package]] @@ -2205,17 +1901,10 @@ version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ - "cc", "pkg-config", "vcpkg", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -2224,9 +1913,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" @@ -2236,59 +1925,58 @@ checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.22" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" dependencies = [ "value-bag", ] [[package]] name = "logos" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab6f536c1af4c7cc81edf73da1f8029896e7e1e16a219ef09b184e76a296f3db" +checksum = "ff472f899b4ec2d99161c51f60ff7075eeb3097069a36050d8037a6325eb8154" dependencies = [ "logos-derive", ] [[package]] name = "logos-codegen" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "189bbfd0b61330abea797e5e9276408f2edbe4f822d7ad08685d67419aafb34e" +checksum = "192a3a2b90b0c05b27a0b2c43eecdb7c415e29243acc3f89cc8247a5b693045c" dependencies = [ "beef", "fnv", "lazy_static", "proc-macro2", "quote", - "regex-syntax 0.8.5", + "regex-syntax", "rustc_version", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "logos-derive" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebfe8e1a19049ddbfccbd14ac834b215e11b85b90bab0c2dba7c7b92fb5d5cba" +checksum = "605d9697bcd5ef3a42d38efc51541aa3d6a4a25f7ab6d1ed0da5ac632a26b470" dependencies = [ "logos-codegen", ] @@ -2299,7 +1987,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.2", + "hashbrown 0.15.5", ] [[package]] @@ -2330,11 +2018,11 @@ dependencies = [ [[package]] name = "matchers" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" dependencies = [ - "regex-automata 0.1.10", + "regex-automata", ] [[package]] @@ -2349,18 +2037,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" - -[[package]] -name = "memoffset" -version = "0.8.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "miette" @@ -2370,7 +2049,7 @@ checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "cfg-if", "miette-derive", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] @@ -2381,14 +2060,14 @@ checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "mimalloc" -version = "0.1.43" +version = "0.1.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633" +checksum = "e1ee66a4b64c74f4ef288bcbb9192ad9c3feaad75193129ac8509af543894fd8" dependencies = [ "libmimalloc-sys", ] @@ -2401,35 +2080,36 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", + "simd-adler32", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.61.2", ] [[package]] name = "multimap" -version = "0.8.3" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" [[package]] name = "newtype-uuid" -version = "1.1.3" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8781e2ef64806278a55ad223f0bc875772fd40e1fe6e73e8adbf027817229d" +checksum = "5c012d14ef788ab066a347d19e3dda699916c92293b05b85ba2c76b8c82d2830" dependencies = [ "uuid", ] @@ -2446,9 +2126,9 @@ dependencies = [ [[package]] name = "ntest" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb183f0a1da7a937f672e5ee7b7edb727bf52b8a52d531374ba8ebb9345c0330" +checksum = "54d1aa56874c2152c24681ed0df95ee155cc06c5c61b78e2d1e8c0cae8bc5326" dependencies = [ "ntest_test_cases", "ntest_timeout", @@ -2456,9 +2136,9 @@ dependencies = [ [[package]] name = "ntest_test_cases" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d0d3f2a488592e5368ebbe996e7f1d44aa13156efad201f5b4d84e150eaa93" +checksum = "6913433c6319ef9b2df316bb8e3db864a41724c2bb8f12555e07dc4ec69d3db1" dependencies = [ "proc-macro2", "quote", @@ -2467,9 +2147,9 @@ dependencies = [ [[package]] name = "ntest_timeout" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc7c92f190c97f79b4a332f5e81dcf68c8420af2045c936c9be0bc9de6f63b5" +checksum = "9224be3459a0c1d6e9b0f42ab0e76e98b29aef5aba33c0487dfcf47ea08b5150" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2479,30 +2159,19 @@ dependencies = [ [[package]] name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "nu-ansi-term" -version = "0.50.1" +version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "num-bigint-dig" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" dependencies = [ - "byteorder", "lazy_static", "libm", "num-integer", @@ -2515,9 +2184,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" [[package]] name = "num-integer" @@ -2560,18 +2229,24 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "oorandom" @@ -2585,17 +2260,11 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - [[package]] name = "owo-colors" -version = "4.1.0" +version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" +checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" [[package]] name = "oxc_resolver" @@ -2606,10 +2275,10 @@ dependencies = [ "cfg-if", "dashmap 6.1.0", "dunce", - "indexmap 2.7.0", + "indexmap 2.13.0", "json-strip-comments 1.0.4", "once_cell", - "rustc-hash 2.1.0", + "rustc-hash", "serde", "serde_json", "simdutf8", @@ -2625,9 +2294,9 @@ checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", @@ -2635,23 +2304,17 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.7", + "redox_syscall 0.5.18", "smallvec", - "windows-targets 0.52.6", + "windows-link", ] -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - [[package]] name = "path-absolutize" version = "3.1.1" @@ -2681,33 +2344,31 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "petgraph" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", - "indexmap 2.7.0", + "indexmap 2.13.0", ] [[package]] name = "pgls_analyse" version = "0.0.0" dependencies = [ - "biome_deserialize 0.6.0", - "biome_deserialize_macros 0.6.0", "enumflags2", "pgls_console", "pgls_diagnostics", "pgls_query", "pgls_schema_cache", "pgls_text_size", - "rustc-hash 2.1.0", + "rustc-hash", "schemars", "serde", ] @@ -2726,7 +2387,7 @@ dependencies = [ "pgls_statement_splitter", "pgls_test_macros", "pgls_text_size", - "rustc-hash 2.1.0", + "rustc-hash", "serde", "termcolor", ] @@ -2737,8 +2398,6 @@ version = "0.0.0" dependencies = [ "anyhow", "assert_cmd", - "biome_deserialize 0.6.0", - "biome_deserialize_macros 0.6.0", "bpaf", "crossbeam", "dashmap 5.5.3", @@ -2760,7 +2419,7 @@ dependencies = [ "pgls_workspace", "quick-junit", "rayon", - "rustc-hash 2.1.0", + "rustc-hash", "serde", "serde_json", "sqlx", @@ -2799,25 +2458,34 @@ dependencies = [ name = "pgls_configuration" version = "0.0.0" dependencies = [ - "biome_deserialize 0.6.0", - "biome_deserialize_macros 0.6.0", "bpaf", - "indexmap 2.7.0", + "indexmap 2.13.0", "oxc_resolver", "pgls_analyse", "pgls_analyser", + "pgls_configuration_macros", "pgls_console", "pgls_diagnostics", "pgls_env", "pgls_matcher", "pgls_pretty_print", "pgls_text_size", - "rustc-hash 2.1.0", + "rustc-hash", "schemars", "serde", "serde_json", ] +[[package]] +name = "pgls_configuration_macros" +version = "0.0.0" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "pgls_console" version = "0.0.0" @@ -2829,7 +2497,7 @@ dependencies = [ "termcolor", "trybuild", "unicode-segmentation", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] @@ -2849,7 +2517,7 @@ dependencies = [ "serde", "serde_json", "termcolor", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] @@ -2890,7 +2558,7 @@ dependencies = [ "parking_lot", "pgls_diagnostics", "rayon", - "rustc-hash 2.1.0", + "rustc-hash", "schemars", "serde", "smallvec", @@ -2946,7 +2614,6 @@ name = "pgls_lsp" version = "0.0.0" dependencies = [ "anyhow", - "biome_deserialize 0.6.0", "futures", "pgls_analyse", "pgls_completions", @@ -2958,7 +2625,7 @@ dependencies = [ "pgls_text_edit", "pgls_text_size", "pgls_workspace", - "rustc-hash 2.1.0", + "rustc-hash", "serde", "serde_json", "sqlx", @@ -2985,7 +2652,7 @@ version = "0.0.0" dependencies = [ "pgls_console", "pgls_diagnostics", - "rustc-hash 2.1.0", + "rustc-hash", ] [[package]] @@ -2999,7 +2666,7 @@ dependencies = [ "pgls_diagnostics_categories", "pgls_schema_cache", "pgls_test_utils", - "rustc-hash 2.1.0", + "rustc-hash", "serde", "serde_json", "sqlx", @@ -3110,7 +2777,6 @@ dependencies = [ name = "pgls_splinter" version = "0.0.0" dependencies = [ - "biome_deserialize 0.6.0", "insta", "pgls_analyse", "pgls_configuration", @@ -3279,10 +2945,6 @@ dependencies = [ name = "pgls_workspace" version = "0.0.0" dependencies = [ - "biome_deserialize 0.6.0", - "biome_js_factory", - "biome_js_syntax", - "biome_rowan", "futures", "globset", "ignore", @@ -3316,7 +2978,7 @@ dependencies = [ "pgls_typecheck", "pgls_workspace_macros", "regex", - "rustc-hash 2.1.0", + "rustc-hash", "schemars", "serde", "serde_json", @@ -3340,29 +3002,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -3404,9 +3066,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "plotters" @@ -3460,12 +3122,21 @@ checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi 0.5.0", + "hermit-abi 0.5.2", "pin-project-lite", "rustix 1.1.3", "windows-sys 0.61.2", ] +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -3474,9 +3145,9 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ "zerocopy", ] @@ -3510,19 +3181,19 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ "toml_edit", ] @@ -3553,9 +3224,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] @@ -3586,7 +3257,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.90", + "syn 2.0.114", "tempfile", ] @@ -3600,7 +3271,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -3636,7 +3307,7 @@ dependencies = [ "prost-reflect", "prost-types", "protox-parse", - "thiserror 2.0.6", + "thiserror 2.0.18", ] [[package]] @@ -3648,7 +3319,7 @@ dependencies = [ "logos", "miette", "prost-types", - "thiserror 2.0.6", + "thiserror 2.0.18", ] [[package]] @@ -3657,7 +3328,7 @@ version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f86ba2052aebccc42cbbb3ed234b8b13ce76f75c3551a303cb2bcffcff12bb14" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.10.0", "getopts", "memchr", "pulldown-cmark-escape", @@ -3672,33 +3343,33 @@ checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae" [[package]] name = "quick-junit" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed1a693391a16317257103ad06a88c6529ac640846021da7c435a06fffdacd7" +checksum = "6ee9342d671fae8d66b3ae9fd7a9714dfd089c04d2a8b1ec0436ef77aee15e5f" dependencies = [ "chrono", - "indexmap 2.7.0", + "indexmap 2.13.0", "newtype-uuid", "quick-xml", "strip-ansi-escapes", - "thiserror 2.0.6", + "thiserror 2.0.18", "uuid", ] [[package]] name = "quick-xml" -version = "0.37.1" +version = "0.38.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22f29bdff3987b4d8632ef95fd6424ec7e4e0a57e2f4fc63e489e75357f6a03" +checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] @@ -3736,14 +3407,14 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.17", ] [[package]] name = "rayon" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" dependencies = [ "either", "rayon-core", @@ -3751,9 +3422,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -3767,11 +3438,20 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "redox_syscall" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.10.0", ] [[package]] @@ -3791,54 +3471,39 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.17", "libredox", "thiserror 1.0.69", ] [[package]] name = "regex" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.13", - "regex-syntax 0.8.5", + "regex-automata", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" [[package]] name = "ring" @@ -3848,7 +3513,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.17", "libc", "untrusted", "windows-sys 0.52.0", @@ -3856,9 +3521,9 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.7" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c75d7c5c6b673e58bf54d8544a9f432e3a925b0e80f7cd3602ab5c50c55519" +checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d" dependencies = [ "const-oid", "digest", @@ -3904,21 +3569,15 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "1.1.0" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" [[package]] name = "rustc-hash" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc_version" @@ -3945,14 +3604,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.10.0", "errno", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys 0.4.15", "windows-sys 0.59.0", ] @@ -3962,18 +3621,18 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.10.0", "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "rustls" -version = "0.23.31" +version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ "log", "once_cell", @@ -3986,18 +3645,18 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ "zeroize", ] [[package]] name = "rustls-webpki" -version = "0.103.4" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "ring", "rustls-pki-types", @@ -4006,15 +3665,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "same-file" @@ -4033,7 +3692,7 @@ checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" dependencies = [ "dyn-clone", "indexmap 1.9.3", - "indexmap 2.7.0", + "indexmap 2.13.0", "schemars_derive", "serde", "serde_json", @@ -4049,7 +3708,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -4060,15 +3719,15 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "serde" -version = "1.0.225" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6c24dee235d0da097043389623fb913daddf92c76e9f5a1db88607a0bcbd1d" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ "serde_core", "serde_derive", @@ -4076,22 +3735,22 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.225" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "659356f9a0cb1e529b24c01e43ad2bdf520ec4ceaf83047b83ddcc2251f96383" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.225" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea936adf78b1f766949a4977b91d2f5595825bd6ec079aa9543ad2685fc4516" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -4102,41 +3761,41 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "serde_json" -version = "1.0.145" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.13.0", "itoa", "memchr", - "ryu", "serde", "serde_core", + "zmij", ] [[package]] name = "serde_repr" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "serde_spanned" -version = "0.6.8" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -4173,9 +3832,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -4199,10 +3858,11 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ + "errno", "libc", ] @@ -4216,6 +3876,12 @@ dependencies = [ "rand_core", ] +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + [[package]] name = "simdutf8" version = "0.1.5" @@ -4224,9 +3890,9 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "similar" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" dependencies = [ "bstr", "unicode-segmentation", @@ -4234,18 +3900,15 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "slotmap" -version = "1.0.7" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" dependencies = [ "serde", "version_check", @@ -4253,9 +3916,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" dependencies = [ "serde", ] @@ -4272,12 +3935,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.8" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -4299,21 +3962,11 @@ dependencies = [ "der", ] -[[package]] -name = "sqlformat" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" -dependencies = [ - "nom", - "unicode_categories", -] - [[package]] name = "sqlx" -version = "0.8.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" +checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc" dependencies = [ "sqlx-core", "sqlx-macros", @@ -4324,39 +3977,34 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.8.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" +checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6" dependencies = [ "async-io 1.13.0", "async-std", - "atoi", - "byteorder", + "base64 0.22.1", "bytes", "crc", "crossbeam-queue", "either", - "event-listener 5.3.1", - "futures-channel", + "event-listener 5.4.1", "futures-core", "futures-intrusive", "futures-io", "futures-util", - "hashbrown 0.14.5", + "hashbrown 0.15.5", "hashlink", - "hex", - "indexmap 2.7.0", + "indexmap 2.13.0", "log", "memchr", "once_cell", - "paste", "percent-encoding", "serde", "serde_json", "sha2", "smallvec", - "sqlformat", - "thiserror 1.0.69", + "thiserror 2.0.18", "tokio", "tokio-stream", "tracing", @@ -4365,22 +4013,22 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.8.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" +checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d" dependencies = [ "proc-macro2", "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "sqlx-macros-core" -version = "0.8.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" +checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b" dependencies = [ "async-std", "dotenvy", @@ -4397,21 +4045,20 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.90", - "tempfile", + "syn 2.0.114", "tokio", "url", ] [[package]] name = "sqlx-mysql" -version = "0.8.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" +checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.6.0", + "bitflags 2.10.0", "byteorder", "bytes", "crc", @@ -4440,27 +4087,26 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 1.0.69", + "thiserror 2.0.18", "tracing", "whoami", ] [[package]] name = "sqlx-postgres" -version = "0.8.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" +checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.6.0", + "bitflags 2.10.0", "byteorder", "crc", "dotenvy", "etcetera", "futures-channel", "futures-core", - "futures-io", "futures-util", "hex", "hkdf", @@ -4478,16 +4124,16 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 1.0.69", + "thiserror 2.0.18", "tracing", "whoami", ] [[package]] name = "sqlx-sqlite" -version = "0.8.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" +checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea" dependencies = [ "atoi", "flume", @@ -4502,15 +4148,16 @@ dependencies = [ "serde", "serde_urlencoded", "sqlx-core", + "thiserror 2.0.18", "tracing", "url", ] [[package]] name = "stable_deref_trait" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "static_assertions" @@ -4537,9 +4184,9 @@ dependencies = [ [[package]] name = "strip-ansi-escapes" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ff8ef943b384c414f54aefa961dd2bd853add74ec75e7ac74cf91dba62bcfa" +checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" dependencies = [ "vte", ] @@ -4552,24 +4199,23 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" dependencies = [ "heck", "proc-macro2", "quote", - "rustversion", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -4600,9 +4246,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -4611,33 +4257,32 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "target-triple" -version = "0.1.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" +checksum = "591ef38edfb78ca4771ee32cf494cb8771944bee237a9b91fc9c1424ac4b777b" [[package]] name = "tempfile" -version = "3.15.0" +version = "3.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" dependencies = [ - "cfg-if", "fastrand 2.3.0", - "getrandom 0.2.15", + "getrandom 0.4.1", "once_cell", - "rustix 0.38.42", - "windows-sys 0.59.0", + "rustix 1.1.3", + "windows-sys 0.61.2", ] [[package]] @@ -4668,9 +4313,9 @@ checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "test-log" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f46083d221181166e5b6f6b1e5f1d499f3a76888826e6cb1d057554157cd0f" +checksum = "37d53ac171c92a39e4769491c4b4dde7022c60042254b5fc044ae409d34a24d4" dependencies = [ "env_logger", "test-log-macros", @@ -4679,13 +4324,13 @@ dependencies = [ [[package]] name = "test-log-macros" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "888d0c3c6db53c0fdab160d2ed5e12ba745383d3e85813f2ea0f2b1475ab553f" +checksum = "be35209fd0781c5401458ab66e4f98accf63553e8fae7425503e92fdd319783b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -4699,11 +4344,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.6" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "thiserror-impl 2.0.6", + "thiserror-impl 2.0.18", ] [[package]] @@ -4714,35 +4359,34 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "thiserror-impl" -version = "2.0.6" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] name = "tikv-jemalloc-sys" -version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" +version = "0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d" +checksum = "cd8aa5b2ab86a2cefa406d889139c162cbb230092f7d1d7cbc1716405d852a3b" dependencies = [ "cc", "libc", @@ -4750,9 +4394,9 @@ dependencies = [ [[package]] name = "tikv-jemallocator" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865" +checksum = "0359b4327f954e0567e69fb191cf1436617748813819c94b8cd4a431422d053a" dependencies = [ "libc", "tikv-jemalloc-sys", @@ -4760,9 +4404,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" dependencies = [ "deranged", "itoa", @@ -4770,22 +4414,22 @@ dependencies = [ "num-conv", "num_threads", "powerfmt", - "serde", + "serde_core", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" dependencies = [ "num-conv", "time-core", @@ -4793,9 +4437,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" dependencies = [ "displaydoc", "zerovec", @@ -4813,9 +4457,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -4828,38 +4472,37 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.42.0" +version = "1.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" dependencies = [ - "backtrace", "bytes", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.8", + "socket2 0.6.2", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "tokio-stream" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" dependencies = [ "futures-core", "pin-project-lite", @@ -4868,9 +4511,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", @@ -4881,38 +4524,55 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.9.11+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46" dependencies = [ - "serde", + "indexmap 2.13.0", + "serde_core", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_parser", + "toml_writer", + "winnow", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ - "serde", + "serde_core", ] [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.23.10+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" dependencies = [ - "indexmap 2.7.0", - "serde", - "serde_spanned", + "indexmap 2.13.0", "toml_datetime", + "toml_parser", "winnow", ] +[[package]] +name = "toml_parser" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" + [[package]] name = "tower" version = "0.4.13" @@ -4966,7 +4626,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -4977,9 +4637,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "log", "pin-project-lite", @@ -4989,25 +4649,25 @@ dependencies = [ [[package]] name = "tracing-appender" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" +checksum = "786d480bce6247ab75f005b14ae1624ad978d3029d9113f0a22fa1ac773faeaf" dependencies = [ "crossbeam-channel", - "thiserror 1.0.69", + "thiserror 2.0.18", "time", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -5030,9 +4690,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", "valuable", @@ -5072,14 +4732,14 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.19" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" dependencies = [ "matchers", - "nu-ansi-term 0.46.0", + "nu-ansi-term", "once_cell", - "regex", + "regex-automata", "serde", "serde_json", "sharded-slab", @@ -5093,11 +4753,11 @@ dependencies = [ [[package]] name = "tracing-tree" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f459ca79f1b0d5f71c54ddfde6debfc59c8b6eeb46808ae492077f739dc7b49c" +checksum = "ac87aa03b6a4d5a7e4810d1a80c19601dbe0f8a837e9177f23af721c7ba7beec" dependencies = [ - "nu-ansi-term 0.50.1", + "nu-ansi-term", "time", "tracing-core", "tracing-log 0.2.0", @@ -5106,13 +4766,13 @@ dependencies = [ [[package]] name = "tree-sitter" -version = "0.25.9" +version = "0.25.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd2a058a86cfece0bf96f7cce1021efef9c8ed0e892ab74639173e5ed7a34fa" +checksum = "78f873475d258561b06f1c595d93308a7ed124d9977cb26b148c2084a4a3cc87" dependencies = [ "cc", "regex", - "regex-syntax 0.8.5", + "regex-syntax", "serde_json", "streaming-iterator", "tree-sitter-language", @@ -5120,15 +4780,15 @@ dependencies = [ [[package]] name = "tree-sitter-language" -version = "0.1.5" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4013970217383f67b18aef68f6fb2e8d409bc5755227092d32efb0422ba24b8" +checksum = "009994f150cc0cd50ff54917d5bc8bffe8cad10ca10d81c34da2ec421ae61782" [[package]] name = "trybuild" -version = "1.0.101" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dcd332a5496c026f1e14b7f3d2b7bd98e509660c04239c58b0ba38a12daded4" +checksum = "5f614c21bd3a61bad9501d75cbb7686f00386c806d7f456778432c25cf86948a" dependencies = [ "glob", "serde", @@ -5141,48 +4801,42 @@ dependencies = [ [[package]] name = "typenum" -version = "1.17.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "unicase" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" [[package]] name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - -[[package]] -name = "unicode-bom" -version = "2.0.3" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e" [[package]] name = "unicode-normalization" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" dependencies = [ "tinyvec", ] [[package]] name = "unicode-properties" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" +checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" [[package]] name = "unicode-segmentation" @@ -5197,10 +4851,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] -name = "unicode_categories" -version = "0.1.1" +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "unindent" @@ -5234,22 +4894,17 @@ dependencies = [ [[package]] name = "url" -version = "2.5.4" +version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ "form_urlencoded", "idna", "percent-encoding", "serde", + "serde_derive", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -5264,20 +4919,20 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.18.1" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.4", "js-sys", "wasm-bindgen", ] [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "value-bag" @@ -5299,22 +4954,11 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vte" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197" -dependencies = [ - "utf8parse", - "vte_generate_state_changes", -] - -[[package]] -name = "vte_generate_state_changes" -version = "0.1.2" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" +checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" dependencies = [ - "proc-macro2", - "quote", + "memchr", ] [[package]] @@ -5350,24 +4994,24 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] -name = "wasi" -version = "0.14.7+wasi-0.2.4" +name = "wasip2" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ - "wasip2", + "wit-bindgen", ] [[package]] -name = "wasip2" -version = "1.0.1+wasi-0.2.4" +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ "wit-bindgen", ] @@ -5380,9 +5024,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.104" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ "cfg-if", "once_cell", @@ -5391,27 +5035,14 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.90", - "wasm-bindgen-shared", -] - [[package]] name = "wasm-bindgen-futures" -version = "0.4.54" +version = "0.4.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" +checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" dependencies = [ "cfg-if", + "futures-util", "js-sys", "once_cell", "wasm-bindgen", @@ -5420,9 +5051,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.104" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5430,31 +5061,65 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.104" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" dependencies = [ + "bumpalo", "proc-macro2", "quote", - "syn 2.0.90", - "wasm-bindgen-backend", + "syn 2.0.114", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.104" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap 2.13.0", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags 2.10.0", + "hashbrown 0.15.5", + "indexmap 2.13.0", + "semver", +] + [[package]] name = "web-sys" -version = "0.3.81" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" dependencies = [ "js-sys", "wasm-bindgen", @@ -5466,14 +5131,14 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "webpki-roots 1.0.2", + "webpki-roots 1.0.6", ] [[package]] name = "webpki-roots" -version = "1.0.2" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2" +checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" dependencies = [ "rustls-pki-types", ] @@ -5486,17 +5151,17 @@ checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" dependencies = [ "either", "home", - "rustix 0.38.42", + "rustix 0.38.44", "winsafe", ] [[package]] name = "whoami" -version = "1.5.2" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" +checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d" dependencies = [ - "redox_syscall 0.5.7", + "libredox", "wasite", ] @@ -5518,11 +5183,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -5564,6 +5229,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + [[package]] name = "windows-sys" version = "0.61.2" @@ -5597,13 +5271,30 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5616,6 +5307,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -5628,6 +5325,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -5640,12 +5343,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -5658,6 +5373,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -5670,6 +5391,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -5682,6 +5409,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -5694,11 +5427,17 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + [[package]] name = "winnow" -version = "0.6.20" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ "memchr", ] @@ -5711,27 +5450,103 @@ checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" [[package]] name = "wit-bindgen" -version = "0.46.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] [[package]] -name = "write-json" -version = "0.1.4" +name = "wit-bindgen-core" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23f6174b2566cc4a74f95e1367ec343e7fa80c93cc8087f5c4a3d6a1088b2118" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] [[package]] -name = "write16" -version = "1.0.0" +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap 2.13.0", + "prettyplease", + "syn 2.0.114", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.114", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags 2.10.0", + "indexmap 2.13.0", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.13.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "write-json" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "23f6174b2566cc4a74f95e1367ec343e7fa80c93cc8087f5c4a3d6a1088b2118" [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "xflags" @@ -5781,12 +5596,8 @@ name = "xtask_codegen" version = "0.0.0" dependencies = [ "anyhow", - "biome_js_factory", - "biome_js_formatter", - "biome_js_syntax", - "biome_rowan", - "biome_string_case", "bpaf", + "convert_case", "pgls_analyse", "pgls_analyser", "pgls_diagnostics", @@ -5803,11 +5614,10 @@ dependencies = [ [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" dependencies = [ - "serde", "stable_deref_trait", "yoke-derive", "zerofrom", @@ -5815,69 +5625,79 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", "synstructure", ] [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", "synstructure", ] [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" dependencies = [ "yoke", "zerofrom", @@ -5886,13 +5706,13 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.114", ] [[package]] @@ -5907,3 +5727,9 @@ dependencies = [ "flate2", "time", ] + +[[package]] +name = "zmij" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4de98dfa5d5b7fef4ee834d0073d560c9ca7b6c46a71d058c48db7960f8cfaf7" diff --git a/Cargo.toml b/Cargo.toml index 252cf5aa6..6cfcda72d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,36 +14,29 @@ rust-version = "1.86.0" [workspace.dependencies] # supporting crates unrelated to postgres -anyhow = "1.0.92" -biome_deserialize = "0.6.0" -biome_deserialize_macros = "0.6.0" -biome_js_factory = "0.5.7" -biome_js_formatter = "0.5.7" -biome_js_syntax = "0.5.7" -biome_rowan = "0.5.7" -biome_string_case = "0.5.8" -bpaf = { version = "0.9.15", features = ["derive"] } -criterion = "0.5" -crossbeam = "0.8.4" -enumflags2 = "0.7.11" -ignore = "0.4.23" -indexmap = { version = "2.6.0", features = ["serde"] } -insta = "1.31.0" -json-strip-comments = "3.1.0" -oxc_resolver = "1.12.0" -pg_query = "6.1.0" -proc-macro2 = "1.0.66" -quote = "1.0.33" -rayon = "1.10.0" -regex = "1.11.1" -rustc-hash = "2.0.0" -schemars = { version = "0.8.22", features = ["indexmap2", "smallvec"] } -serde = { version = "1.0.195", features = ["rc"] } -serde_json = "1.0.114" -similar = "2.6.0" -slotmap = "1.0.7" -smallvec = { version = "1.13.2", features = ["union", "const_new", "serde"] } -strum = { version = "0.27.1", features = ["derive"] } +anyhow = "1.0.92" +bpaf = { version = "0.9.15", features = ["derive"] } +criterion = "0.5" +crossbeam = "0.8.4" +enumflags2 = "0.7.11" +ignore = "0.4.23" +indexmap = { version = "2.6.0", features = ["serde"] } +insta = "1.31.0" +json-strip-comments = "3.1.0" +oxc_resolver = "1.12.0" +pg_query = "6.1.0" +proc-macro2 = "1.0.66" +quote = "1.0.33" +rayon = "1.10.0" +regex = "1.11.1" +rustc-hash = "2.0.0" +schemars = { version = "0.8.22", features = ["indexmap2", "smallvec"] } +serde = { version = "1.0.195", features = ["rc"] } +serde_json = "1.0.114" +similar = "2.6.0" +slotmap = "1.0.7" +smallvec = { version = "1.13.2", features = ["union", "const_new", "serde"] } +strum = { version = "0.27.1", features = ["derive"] } # this will use tokio if available, otherwise async-std camino = "1.1.9" convert_case = "0.6.0" @@ -69,6 +62,7 @@ pgls_analyser = { path = "./crates/pgls_analyser", version = "0.0. pgls_cli = { path = "./crates/pgls_cli", version = "0.0.0" } pgls_completions = { path = "./crates/pgls_completions", version = "0.0.0" } pgls_configuration = { path = "./crates/pgls_configuration", version = "0.0.0" } +pgls_configuration_macros = { path = "./crates/pgls_configuration_macros" } pgls_console = { path = "./crates/pgls_console", version = "0.0.0" } pgls_diagnostics = { path = "./crates/pgls_diagnostics", version = "0.0.0" } pgls_diagnostics_categories = { path = "./crates/pgls_diagnostics_categories", version = "0.0.0" } diff --git a/biome.jsonc b/biome.jsonc index 582bee9b2..a18e17106 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -8,7 +8,7 @@ "files": { "ignoreUnknown": false, "ignore": [], - "include": ["/packages/**/*"] + "include": ["packages/**/*"] }, "formatter": { "enabled": true, @@ -27,5 +27,17 @@ "formatter": { "quoteStyle": "double" } - } + }, + "overrides": [ + { + "include": ["**/e2e/**", "**/tests/**"], + "linter": { + "rules": { + "suspicious": { + "noExplicitAny": "off" + } + } + } + } + ] } diff --git a/crates/pgls_analyse/Cargo.toml b/crates/pgls_analyse/Cargo.toml index 6f24c40d9..7a36cb93e 100644 --- a/crates/pgls_analyse/Cargo.toml +++ b/crates/pgls_analyse/Cargo.toml @@ -19,8 +19,6 @@ pgls_query.workspace = true pgls_schema_cache = { workspace = true, default-features = false } rustc-hash = { workspace = true } -biome_deserialize = { workspace = true, optional = true } -biome_deserialize_macros = { workspace = true, optional = true } enumflags2.workspace = true pgls_text_size.workspace = true schemars = { workspace = true, optional = true } @@ -28,4 +26,4 @@ serde = { workspace = true, features = ["derive"], optional = [features] schema = ["dep:schemars"] -serde = ["dep:serde", "dep:biome_deserialize", "dep:biome_deserialize_macros"] +serde = ["dep:serde"] diff --git a/crates/pgls_cli/Cargo.toml b/crates/pgls_cli/Cargo.toml index c92c03805..824835b83 100644 --- a/crates/pgls_cli/Cargo.toml +++ b/crates/pgls_cli/Cargo.toml @@ -13,8 +13,6 @@ version = "0.0.0" [dependencies] anyhow = { workspace = true } -biome_deserialize = { workspace = true } -biome_deserialize_macros = { workspace = true } bpaf = { workspace = true, features = ["bright-color"] } crossbeam = { workspace = true } dashmap = "5.5.3" diff --git a/crates/pgls_cli/src/lib.rs b/crates/pgls_cli/src/lib.rs index 1990b57f4..65017c94d 100644 --- a/crates/pgls_cli/src/lib.rs +++ b/crates/pgls_cli/src/lib.rs @@ -4,10 +4,10 @@ //! to parse commands and arguments, redirect the execution of the commands and //! execute the traversal of directory and files, based on the command that was passed. -use biome_deserialize::Merge; use cli_options::CliOptions; use commands::check::{self, CheckArgs}; use commands::format::{self, FormatArgs}; +use pgls_configuration::Merge; use pgls_configuration::PartialConfiguration; use pgls_console::{ColorMode, Console, ConsoleExt, markup}; use pgls_fs::{ConfigName, FileSystem, OsFileSystem}; diff --git a/crates/pgls_configuration/Cargo.toml b/crates/pgls_configuration/Cargo.toml index 2ae86d677..6beecbe8d 100644 --- a/crates/pgls_configuration/Cargo.toml +++ b/crates/pgls_configuration/Cargo.toml @@ -12,23 +12,22 @@ version = "0.0.0" [dependencies] -biome_deserialize = { workspace = true, features = ["schema"] } -biome_deserialize_macros = { workspace = true } -bpaf = { workspace = true } -indexmap = { workspace = true } -oxc_resolver = { workspace = true } -pgls_analyse = { workspace = true } -pgls_analyser = { workspace = true } -pgls_console = { workspace = true } -pgls_diagnostics = { workspace = true } -pgls_env = { workspace = true } -pgls_matcher = { workspace = true } -pgls_pretty_print = { workspace = true } -pgls_text_size = { workspace = true } -rustc-hash = { workspace = true } -schemars = { workspace = true, features = ["indexmap1"], optional = true } -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, features = ["raw_value"] } +bpaf = { workspace = true } +indexmap = { workspace = true } +oxc_resolver = { workspace = true } +pgls_analyse = { workspace = true } +pgls_analyser = { workspace = true } +pgls_configuration_macros = { workspace = true } +pgls_console = { workspace = true } +pgls_diagnostics = { workspace = true } +pgls_env = { workspace = true } +pgls_matcher = { workspace = true } +pgls_pretty_print = { workspace = true } +pgls_text_size = { workspace = true } +rustc-hash = { workspace = true } +schemars = { workspace = true, features = ["indexmap1"], optional = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true, features = ["raw_value"] } [lib] doctest = false diff --git a/crates/pgls_configuration/src/database.rs b/crates/pgls_configuration/src/database.rs index bde807d0b..d5c1bfb45 100644 --- a/crates/pgls_configuration/src/database.rs +++ b/crates/pgls_configuration/src/database.rs @@ -1,6 +1,6 @@ -use biome_deserialize::StringSet; -use biome_deserialize_macros::{Merge, Partial}; +use crate::StringSet; use bpaf::Bpaf; +use pgls_configuration_macros::{Merge, Partial}; use serde::{Deserialize, Serialize}; /// The configuration of the database connection. diff --git a/crates/pgls_configuration/src/files.rs b/crates/pgls_configuration/src/files.rs index c8e3cde29..0bc3e63f8 100644 --- a/crates/pgls_configuration/src/files.rs +++ b/crates/pgls_configuration/src/files.rs @@ -1,8 +1,8 @@ use std::num::NonZeroU64; -use biome_deserialize::StringSet; -use biome_deserialize_macros::{Merge, Partial}; +use crate::StringSet; use bpaf::Bpaf; +use pgls_configuration_macros::{Merge, Partial}; use serde::{Deserialize, Serialize}; /// Limit the size of files to 1.0 MiB by default diff --git a/crates/pgls_configuration/src/format.rs b/crates/pgls_configuration/src/format.rs index 022341f7c..7855571cd 100644 --- a/crates/pgls_configuration/src/format.rs +++ b/crates/pgls_configuration/src/format.rs @@ -1,13 +1,11 @@ -use biome_deserialize::StringSet; -use biome_deserialize_macros::{Deserializable, Merge, Partial}; +use crate::StringSet; use bpaf::Bpaf; +use pgls_configuration_macros::{Merge, Partial}; use serde::{Deserialize, Serialize}; use std::str::FromStr; /// Indentation style for the formatter. -#[derive( - Clone, Copy, Debug, Default, Deserialize, Deserializable, Eq, Merge, PartialEq, Serialize, -)] +#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Merge, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(rename_all = "camelCase")] pub enum IndentStyle { @@ -40,9 +38,7 @@ impl From for pgls_pretty_print::renderer::IndentStyle { } /// Keyword casing style for the formatter. -#[derive( - Clone, Copy, Debug, Default, Deserialize, Deserializable, Eq, Merge, PartialEq, Serialize, -)] +#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Merge, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(rename_all = "camelCase")] pub enum KeywordCase { diff --git a/crates/pgls_configuration/src/lib.rs b/crates/pgls_configuration/src/lib.rs index 324e394b3..3a04ae30d 100644 --- a/crates/pgls_configuration/src/lib.rs +++ b/crates/pgls_configuration/src/lib.rs @@ -2,6 +2,10 @@ //! //! The configuration is divided by "tool". +// Allow the crate to reference itself by name, needed by pgls_configuration_macros +// which generates `pgls_configuration::Merge` paths. +extern crate self as pgls_configuration; + pub mod database; pub mod diagnostics; pub mod files; @@ -13,15 +17,17 @@ pub mod plpgsql_check; pub mod rules; pub mod splinter; pub mod typecheck; +pub mod utils; pub mod vcs; +pub use utils::merge::Merge; +pub use utils::string_set::StringSet; + pub use crate::diagnostics::ConfigurationDiagnostic; use std::path::PathBuf; use crate::vcs::{PartialVcsConfiguration, VcsConfiguration, partial_vcs_configuration}; -use biome_deserialize::StringSet; -use biome_deserialize_macros::{Merge, Partial}; use bpaf::Bpaf; use database::{ DatabaseConfiguration, PartialDatabaseConfiguration, partial_database_configuration, @@ -41,6 +47,7 @@ use migrations::{ use pglinter::{ PartialPglinterConfiguration, PglinterConfiguration, partial_pglinter_configuration, }; +use pgls_configuration_macros::{Merge, Partial}; use pgls_env::PGLS_WEBSITE; use plpgsql_check::{ PartialPlPgSqlCheckConfiguration, PlPgSqlCheckConfiguration, diff --git a/crates/pgls_configuration/src/linter/mod.rs b/crates/pgls_configuration/src/linter/mod.rs index c3c9fdfc3..ca122f49b 100644 --- a/crates/pgls_configuration/src/linter/mod.rs +++ b/crates/pgls_configuration/src/linter/mod.rs @@ -2,9 +2,9 @@ #![doc = r" Generated file, do not edit by hand, see `xtask/codegen`"] mod rules; -use biome_deserialize::StringSet; -use biome_deserialize_macros::{Merge, Partial}; +use crate::StringSet; use bpaf::Bpaf; +use pgls_configuration_macros::{Merge, Partial}; pub use rules::*; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Deserialize, Eq, Partial, PartialEq, Serialize)] diff --git a/crates/pgls_configuration/src/linter/rules.rs b/crates/pgls_configuration/src/linter/rules.rs index a78cf28c9..8b5fb768b 100644 --- a/crates/pgls_configuration/src/linter/rules.rs +++ b/crates/pgls_configuration/src/linter/rules.rs @@ -2,9 +2,9 @@ #![doc = r" Generated file, do not edit by hand, see `xtask/codegen`"] use crate::rules::{RuleConfiguration, RulePlainConfiguration}; -use biome_deserialize_macros::Merge; use pgls_analyse::RuleFilter; use pgls_analyser::RuleOptions; +use pgls_configuration_macros::Merge; use pgls_diagnostics::{Category, Severity}; use rustc_hash::FxHashSet; #[cfg(feature = "schema")] diff --git a/crates/pgls_configuration/src/migrations.rs b/crates/pgls_configuration/src/migrations.rs index c134e1a41..3ad72e289 100644 --- a/crates/pgls_configuration/src/migrations.rs +++ b/crates/pgls_configuration/src/migrations.rs @@ -1,5 +1,5 @@ -use biome_deserialize_macros::{Merge, Partial}; use bpaf::Bpaf; +use pgls_configuration_macros::{Merge, Partial}; use serde::{Deserialize, Serialize}; /// The configuration of the filesystem diff --git a/crates/pgls_configuration/src/pglinter/mod.rs b/crates/pgls_configuration/src/pglinter/mod.rs index f676abf1f..31f2ad06d 100644 --- a/crates/pgls_configuration/src/pglinter/mod.rs +++ b/crates/pgls_configuration/src/pglinter/mod.rs @@ -2,8 +2,8 @@ #![doc = r" Generated file, do not edit by hand, see `xtask/codegen`"] mod rules; -use biome_deserialize_macros::{Merge, Partial}; use bpaf::Bpaf; +use pgls_configuration_macros::{Merge, Partial}; pub use rules::*; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Deserialize, Eq, Partial, PartialEq, Serialize)] diff --git a/crates/pgls_configuration/src/pglinter/rules.rs b/crates/pgls_configuration/src/pglinter/rules.rs index b22721a80..49373fe03 100644 --- a/crates/pgls_configuration/src/pglinter/rules.rs +++ b/crates/pgls_configuration/src/pglinter/rules.rs @@ -2,9 +2,9 @@ #![doc = r" Generated file, do not edit by hand, see `xtask/codegen`"] use crate::rules::{RuleConfiguration, RulePlainConfiguration}; -use biome_deserialize_macros::Merge; use pgls_analyse::RuleFilter; use pgls_analyser::RuleOptions; +use pgls_configuration_macros::Merge; use pgls_diagnostics::{Category, Severity}; use rustc_hash::FxHashSet; #[cfg(feature = "schema")] diff --git a/crates/pgls_configuration/src/plpgsql_check.rs b/crates/pgls_configuration/src/plpgsql_check.rs index fd2fcfd9b..8c2bfcfc1 100644 --- a/crates/pgls_configuration/src/plpgsql_check.rs +++ b/crates/pgls_configuration/src/plpgsql_check.rs @@ -1,5 +1,5 @@ -use biome_deserialize_macros::{Merge, Partial}; use bpaf::Bpaf; +use pgls_configuration_macros::{Merge, Partial}; use serde::{Deserialize, Serialize}; /// The configuration for type checking. diff --git a/crates/pgls_configuration/src/rules/configuration.rs b/crates/pgls_configuration/src/rules/configuration.rs index f6a1ea662..1f7f13f96 100644 --- a/crates/pgls_configuration/src/rules/configuration.rs +++ b/crates/pgls_configuration/src/rules/configuration.rs @@ -1,5 +1,4 @@ -use biome_deserialize::Merge; -use biome_deserialize_macros::Deserializable; +use crate::Merge; use pgls_analyser::RuleOptions; use pgls_diagnostics::Severity; #[cfg(feature = "schema")] @@ -164,7 +163,7 @@ impl From for Severity { } } -#[derive(Clone, Copy, Debug, Default, Deserialize, Deserializable, Eq, PartialEq, Serialize)] +#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase")] pub enum RulePlainConfiguration { @@ -233,7 +232,7 @@ impl Default for RuleAssistConfiguration { } } -#[derive(Clone, Copy, Debug, Default, Deserialize, Deserializable, Eq, PartialEq, Serialize)] +#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase")] pub enum RuleAssistPlainConfiguration { @@ -256,7 +255,7 @@ impl Merge for RuleAssistPlainConfiguration { } } -#[derive(Clone, Debug, Default, Deserialize, Deserializable, Eq, PartialEq, Serialize)] +#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RuleAssistWithOptions { @@ -272,7 +271,7 @@ impl Merge for RuleAssistWithOptions { } } -#[derive(Clone, Debug, Default, Deserialize, Deserializable, Eq, PartialEq, Serialize)] +#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RuleWithOptions { @@ -288,7 +287,7 @@ impl Merge for RuleWithOptions { } } -#[derive(Clone, Debug, Default, Deserialize, Deserializable, Eq, PartialEq, Serialize)] +#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RuleWithFixOptions { diff --git a/crates/pgls_configuration/src/splinter/mod.rs b/crates/pgls_configuration/src/splinter/mod.rs index 9ef7abfe8..23e489dc8 100644 --- a/crates/pgls_configuration/src/splinter/mod.rs +++ b/crates/pgls_configuration/src/splinter/mod.rs @@ -4,9 +4,9 @@ mod options; pub use options::SplinterRuleOptions; mod rules; -use biome_deserialize::StringSet; -use biome_deserialize_macros::{Merge, Partial}; +use crate::StringSet; use bpaf::Bpaf; +use pgls_configuration_macros::{Merge, Partial}; pub use rules::*; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Deserialize, Eq, Partial, PartialEq, Serialize)] diff --git a/crates/pgls_configuration/src/splinter/options.rs b/crates/pgls_configuration/src/splinter/options.rs index aead42670..8f6582926 100644 --- a/crates/pgls_configuration/src/splinter/options.rs +++ b/crates/pgls_configuration/src/splinter/options.rs @@ -1,4 +1,3 @@ -use biome_deserialize_macros::Deserializable; #[cfg(feature = "schema")] use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -6,7 +5,7 @@ use serde::{Deserialize, Serialize}; /// Shared options for all splinter rules. /// /// These options allow configuring per-rule filtering of database objects. -#[derive(Clone, Debug, Default, Deserialize, Deserializable, Eq, PartialEq, Serialize)] +#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SplinterRuleOptions { diff --git a/crates/pgls_configuration/src/splinter/rules.rs b/crates/pgls_configuration/src/splinter/rules.rs index 74a16e1e3..9ec948e87 100644 --- a/crates/pgls_configuration/src/splinter/rules.rs +++ b/crates/pgls_configuration/src/splinter/rules.rs @@ -2,9 +2,9 @@ #![doc = r" Generated file, do not edit by hand, see `xtask/codegen`"] use crate::rules::{RuleConfiguration, RulePlainConfiguration}; -use biome_deserialize_macros::Merge; use pgls_analyse::RuleFilter; use pgls_analyser::RuleOptions; +use pgls_configuration_macros::Merge; use pgls_diagnostics::{Category, Severity}; use rustc_hash::FxHashSet; #[cfg(feature = "schema")] diff --git a/crates/pgls_configuration/src/typecheck.rs b/crates/pgls_configuration/src/typecheck.rs index bff96d81f..0a43eec20 100644 --- a/crates/pgls_configuration/src/typecheck.rs +++ b/crates/pgls_configuration/src/typecheck.rs @@ -1,6 +1,6 @@ -use biome_deserialize::StringSet; -use biome_deserialize_macros::{Merge, Partial}; +use crate::StringSet; use bpaf::Bpaf; +use pgls_configuration_macros::{Merge, Partial}; use serde::{Deserialize, Serialize}; /// The configuration for type checking. diff --git a/crates/pgls_configuration/src/utils/merge.rs b/crates/pgls_configuration/src/utils/merge.rs new file mode 100644 index 000000000..f26eb28f5 --- /dev/null +++ b/crates/pgls_configuration/src/utils/merge.rs @@ -0,0 +1,49 @@ +use std::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64}; + +/// Trait that allows deep merging of types, including injection of defaults. +pub trait Merge { + /// Merges `other` into `self`. + /// + /// Values that are non-`None` in `other` will take precedence over values + /// in `self`. Complex types may get recursively merged instead of + /// overwritten. + fn merge_with(&mut self, other: Self); +} + +impl Merge for Option { + fn merge_with(&mut self, other: Self) { + if let Some(other) = other { + match self.as_mut() { + Some(this) => this.merge_with(other), + None => *self = Some(other), + } + } + } +} + +/// This macro is used to implement [Merge] for all (primitive) types where +/// merging can simply be implemented through overwriting the value. +macro_rules! overwrite_on_merge { + ( $ty:ident ) => { + impl Merge for $ty { + fn merge_with(&mut self, other: Self) { + *self = other + } + } + }; +} + +overwrite_on_merge!(bool); +overwrite_on_merge!(u8); +overwrite_on_merge!(u16); +overwrite_on_merge!(u32); +overwrite_on_merge!(u64); +overwrite_on_merge!(i8); +overwrite_on_merge!(i16); +overwrite_on_merge!(i32); +overwrite_on_merge!(i64); +overwrite_on_merge!(NonZeroU8); +overwrite_on_merge!(NonZeroU16); +overwrite_on_merge!(NonZeroU32); +overwrite_on_merge!(NonZeroU64); +overwrite_on_merge!(String); diff --git a/crates/pgls_configuration/src/utils/mod.rs b/crates/pgls_configuration/src/utils/mod.rs new file mode 100644 index 000000000..fdb2f253a --- /dev/null +++ b/crates/pgls_configuration/src/utils/mod.rs @@ -0,0 +1,2 @@ +pub mod merge; +pub mod string_set; diff --git a/crates/pgls_configuration/src/utils/string_set.rs b/crates/pgls_configuration/src/utils/string_set.rs new file mode 100644 index 000000000..44f95c0c9 --- /dev/null +++ b/crates/pgls_configuration/src/utils/string_set.rs @@ -0,0 +1,90 @@ +use crate::Merge; +use indexmap::IndexSet; +use indexmap::set::IntoIter; +use std::ops::{Deref, DerefMut}; +use std::str::FromStr; + +// To implement schemars trait, we encapsulate `IndexSet` in a new type `StringSet`. + +#[derive(Clone, Default, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)] +pub struct StringSet(IndexSet); + +impl StringSet { + pub fn new(index_set: IndexSet) -> Self { + Self(index_set) + } + + pub fn into_index_set(self) -> IndexSet { + self.0 + } + + pub fn clear(&mut self) { + self.0.clear(); + } + + pub fn extend(&mut self, iter: I) + where + I: IntoIterator, + { + self.0.extend(iter) + } +} + +#[cfg(feature = "schema")] +impl schemars::JsonSchema for StringSet { + fn schema_name() -> String { + String::from("StringSet") + } + + fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema { + >::json_schema(generator) + } +} + +impl Deref for StringSet { + type Target = IndexSet; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for StringSet { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +impl FromStr for StringSet { + type Err = std::convert::Infallible; + + fn from_str(s: &str) -> Result { + let items: IndexSet = s + .split(',') + .map(|item| item.trim().to_string()) + .filter(|item| !item.is_empty()) + .collect(); + Ok(StringSet(items)) + } +} + +impl FromIterator for StringSet { + fn from_iter>(iter: T) -> Self { + StringSet::new(IndexSet::from_iter(iter)) + } +} + +impl IntoIterator for StringSet { + type Item = String; + type IntoIter = IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } +} + +impl Merge for StringSet { + fn merge_with(&mut self, other: Self) { + self.extend(other) + } +} diff --git a/crates/pgls_configuration/src/vcs.rs b/crates/pgls_configuration/src/vcs.rs index 1dfc5245a..0fc15be24 100644 --- a/crates/pgls_configuration/src/vcs.rs +++ b/crates/pgls_configuration/src/vcs.rs @@ -1,6 +1,5 @@ -use biome_deserialize::{DeserializableValidator, DeserializationDiagnostic}; -use biome_deserialize_macros::{Deserializable, Merge, Partial}; use bpaf::Bpaf; +use pgls_configuration_macros::{Merge, Partial}; use serde::{Deserialize, Serialize}; use std::str::FromStr; @@ -8,8 +7,7 @@ const GIT_IGNORE_FILE_NAME: &str = ".gitignore"; /// Set of properties to integrate with a VCS software. #[derive(Clone, Debug, Deserialize, Eq, Partial, PartialEq, Serialize)] -#[partial(derive(Bpaf, Clone, Deserializable, Eq, Merge, PartialEq))] -#[partial(deserializable(with_validator))] +#[partial(derive(Bpaf, Clone, Eq, Merge, PartialEq))] #[partial(cfg_attr(feature = "schema", derive(schemars::JsonSchema)))] #[partial(serde(deny_unknown_fields, rename_all = "camelCase"))] pub struct VcsConfiguration { @@ -19,7 +17,6 @@ pub struct VcsConfiguration { /// The kind of client. #[partial(bpaf(long("vcs-client-kind"), argument("git"), optional))] - #[partial(deserializable(bail_on_error))] pub client_kind: VcsClientKind, /// Whether we should use the VCS ignore file. When [true], we will ignore the files @@ -65,31 +62,7 @@ impl PartialVcsConfiguration { } } -impl DeserializableValidator for PartialVcsConfiguration { - fn validate( - &mut self, - _name: &str, - range: biome_deserialize::TextRange, - diagnostics: &mut Vec, - ) -> bool { - if self.client_kind.is_none() && self.is_enabled() { - diagnostics.push( - DeserializationDiagnostic::new( - "You enabled the VCS integration, but you didn't specify a client.", - ) - .with_range(range) - .with_note("We will disable the VCS integration until the issue is fixed."), - ); - return false; - } - - true - } -} - -#[derive( - Clone, Copy, Debug, Default, Deserialize, Deserializable, Eq, Merge, PartialEq, Serialize, -)] +#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Merge, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(rename_all = "camelCase")] pub enum VcsClientKind { diff --git a/crates/pgls_configuration_macros/Cargo.toml b/crates/pgls_configuration_macros/Cargo.toml new file mode 100644 index 000000000..383ed08f4 --- /dev/null +++ b/crates/pgls_configuration_macros/Cargo.toml @@ -0,0 +1,20 @@ +[package] +authors.workspace = true +categories.workspace = true +description = "Proc macros for pgls_configuration (Merge, Partial derives)" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pgls_configuration_macros" +repository.workspace = true +version = "0.0.0" + +[lib] +proc-macro = true + +[dependencies] +proc-macro-error = { version = "1.0.4", default-features = false } +proc-macro2 = { workspace = true } +quote = { workspace = true } +syn = { workspace = true, features = ["extra-traits"] } diff --git a/crates/pgls_configuration_macros/src/lib.rs b/crates/pgls_configuration_macros/src/lib.rs new file mode 100644 index 000000000..4be0db85e --- /dev/null +++ b/crates/pgls_configuration_macros/src/lib.rs @@ -0,0 +1,39 @@ +mod merge_derive; +mod partial_derive; +mod util; + +use proc_macro::TokenStream; +use proc_macro_error::*; +use syn::{DeriveInput, parse_macro_input}; + +/// Derives the `pgls_configuration::Merge` trait for a custom enum or struct. +#[proc_macro_derive(Merge)] +#[proc_macro_error] +pub fn derive_mergeable(input: TokenStream) -> TokenStream { + let input = parse_macro_input!(input as DeriveInput); + + let input = merge_derive::DeriveInput::parse(input); + + let tokens = merge_derive::generate_merge(input); + + TokenStream::from(tokens) +} + +/// Generates a "partial" struct from another. +/// +/// A partial struct has the same shape as the struct it is derived from (the +/// "full" struct), but with all its fields wrapped in `Option`. Fields that +/// were already wrapped in an `Option` don't get wrapped again. +/// +/// The name of the generated partial struct is `Partial{FullStruct}`. +#[proc_macro_derive(Partial, attributes(partial))] +#[proc_macro_error] +pub fn derive_partial(input: TokenStream) -> TokenStream { + let input = parse_macro_input!(input as DeriveInput); + + let input = partial_derive::DeriveInput::parse(input); + + let tokens = partial_derive::generate_partial(input); + + TokenStream::from(tokens) +} diff --git a/crates/pgls_configuration_macros/src/merge_derive.rs b/crates/pgls_configuration_macros/src/merge_derive.rs new file mode 100644 index 000000000..169dd3ef6 --- /dev/null +++ b/crates/pgls_configuration_macros/src/merge_derive.rs @@ -0,0 +1,75 @@ +use proc_macro_error::*; +use proc_macro2::{Ident, TokenStream}; +use quote::quote; +use syn::{Data, Fields}; + +pub enum MergeableData { + Enum, + Newtype, + Struct(Fields), +} + +pub(crate) struct DeriveInput { + pub ident: Ident, + pub data: MergeableData, +} + +impl DeriveInput { + pub fn parse(input: syn::DeriveInput) -> Self { + let data = match input.data { + Data::Enum(_) => MergeableData::Enum, + Data::Struct(data) => { + if data.fields.iter().all(|field| field.ident.is_some()) { + MergeableData::Struct(data.fields) + } else { + MergeableData::Newtype + } + } + Data::Union(_) => abort!(input, "Merge can only be derived for enums and structs"), + }; + + Self { + ident: input.ident, + data, + } + } +} + +pub(crate) fn generate_merge(input: DeriveInput) -> TokenStream { + match input.data { + MergeableData::Enum => generate_merge_enum(input.ident), + MergeableData::Newtype => generate_merge_newtype(input.ident), + MergeableData::Struct(fields) => generate_merge_struct(input.ident, fields), + } +} + +fn generate_merge_enum(ident: Ident) -> TokenStream { + quote! { + impl pgls_configuration::Merge for #ident { + fn merge_with(&mut self, other: Self) { + *self = other; + } + } + } +} + +fn generate_merge_newtype(ident: Ident) -> TokenStream { + quote! { + impl pgls_configuration::Merge for #ident { + fn merge_with(&mut self, other: Self) { + self.0 = other.0; + } + } + } +} + +fn generate_merge_struct(ident: Ident, fields: Fields) -> TokenStream { + let field_idents = fields.into_iter().filter_map(|field| field.ident); + quote! { + impl pgls_configuration::Merge for #ident { + fn merge_with(&mut self, other: Self) { + #( pgls_configuration::Merge::merge_with(&mut self.#field_idents, other.#field_idents); )* + } + } + } +} diff --git a/crates/pgls_configuration_macros/src/partial_derive/attrs.rs b/crates/pgls_configuration_macros/src/partial_derive/attrs.rs new file mode 100644 index 000000000..b73e3f8ba --- /dev/null +++ b/crates/pgls_configuration_macros/src/partial_derive/attrs.rs @@ -0,0 +1,104 @@ +use proc_macro2::TokenStream; +use quote::ToTokens; +use std::collections::HashSet; +use syn::{AttrStyle, Attribute, Error, Lit, Meta, MetaNameValue, Path, Type, parse_quote}; + +use crate::util::parse_meta_list; + +#[derive(Clone, Debug)] +pub struct Attrs { + pub derives: HashSet, + pub doc_lines: Vec, + pub nested_attrs: Vec, +} + +impl Default for Attrs { + fn default() -> Self { + Self { + derives: HashSet::from([ + parse_quote!(Debug), + parse_quote!(Default), + parse_quote!(serde::Deserialize), + parse_quote!(serde::Serialize), + ]), + doc_lines: Default::default(), + nested_attrs: Default::default(), + } + } +} + +impl TryFrom<&Vec> for Attrs { + type Error = Error; + + fn try_from(attrs: &Vec) -> Result { + let mut opts = Self::default(); + for attr in attrs { + if attr.path.is_ident("partial") { + parse_meta_list(&attr.parse_meta()?, |meta| { + match meta { + Meta::List(_) if meta.path().is_ident("derive") => { + parse_meta_list(meta, |meta| { + opts.derives.insert(meta.path().clone()); + Ok(()) + })?; + } + _ => { + opts.nested_attrs.push(meta.into_token_stream()); + } + } + Ok(()) + })?; + } else if attr.style == AttrStyle::Outer && attr.path.is_ident("doc") { + opts.doc_lines.push(attr.tokens.clone()); + } + } + Ok(opts) + } +} + +#[derive(Clone, Debug, Default)] +pub struct FieldAttrs { + pub ty: Option, + pub doc_lines: Vec, + pub nested_attrs: Vec, +} + +impl TryFrom<&Vec> for FieldAttrs { + type Error = Error; + + fn try_from(attrs: &Vec) -> Result { + let mut opts = Self::default(); + for attr in attrs { + if attr.path.is_ident("partial") { + parse_meta_list(&attr.parse_meta()?, |meta| { + match meta { + syn::Meta::Path(path) if opts.ty.is_none() && path.is_ident("type") => { + opts.ty = Some(PartialType::Prefixed); + } + syn::Meta::NameValue(MetaNameValue { + path, + lit: Lit::Str(s), + .. + }) if opts.ty.is_none() && path.is_ident("type") => { + opts.ty = Some(PartialType::Literal(s.parse()?)); + } + _ => { + opts.nested_attrs.push(meta.into_token_stream()); + } + } + Ok(()) + })?; + } else if attr.style == AttrStyle::Outer && attr.path.is_ident("doc") { + opts.doc_lines.push(attr.tokens.clone()); + } + } + Ok(opts) + } +} + +#[derive(Clone, Debug, Default)] +pub enum PartialType { + #[default] + Prefixed, + Literal(Type), +} diff --git a/crates/pgls_configuration_macros/src/partial_derive/mod.rs b/crates/pgls_configuration_macros/src/partial_derive/mod.rs new file mode 100644 index 000000000..9b622325b --- /dev/null +++ b/crates/pgls_configuration_macros/src/partial_derive/mod.rs @@ -0,0 +1,176 @@ +mod attrs; + +use crate::partial_derive::attrs::PartialType; +use attrs::{Attrs, FieldAttrs}; +use proc_macro_error::*; +use proc_macro2::{Ident, Span, TokenStream}; +use quote::quote; +use syn::{Data, Field, GenericArgument, PathArguments, Type}; + +pub(crate) struct DeriveInput { + pub ident: Ident, + pub partial_ident: Ident, + pub attrs: Attrs, + pub fields: Vec, +} + +pub(crate) struct FieldData { + ident: Ident, + ty: Type, + should_wrap: bool, + attrs: FieldAttrs, +} + +impl DeriveInput { + pub fn parse(input: syn::DeriveInput) -> Self { + let ident = input.ident.clone(); + let partial_ident = Ident::new(&format!("Partial{}", input.ident), Span::call_site()); + + let attrs = Attrs::try_from(&input.attrs).expect("Could not parse attributes"); + + let fields = match input.data { + Data::Struct(data) => data + .fields + .iter() + .map( + |Field { + ident, ty, attrs, .. + }| { + let Some(ident) = ident else { + abort!(data.fields, "Partial derive requires named fields"); + }; + + let (ty, should_wrap) = match ty { + Type::Path(path) => match path.path.segments.last() { + Some(segment) if segment.ident == "Option" => { + match &segment.arguments { + PathArguments::AngleBracketed(args) => { + match args.args.first() { + Some(GenericArgument::Type(ty)) => (ty, false), + _ => abort!( + segment, + "Expected type argument in Option" + ), + } + } + _ => abort!(segment, "Expected argument in Option type"), + } + } + _ => (ty, true), + }, + _ => (ty, true), + }; + + FieldData { + ident: ident.clone(), + ty: ty.clone(), + should_wrap, + attrs: FieldAttrs::try_from(attrs) + .expect("Could not parse field attributes"), + } + }, + ) + .collect(), + _ => abort!(input, "Partial can only be derived for structs"), + }; + + Self { + ident, + partial_ident, + attrs, + fields, + } + } +} + +pub(crate) fn generate_partial(input: DeriveInput) -> TokenStream { + let ident = input.ident; + let partial_ident = input.partial_ident; + + let derives = input.attrs.derives.iter(); + + let doc_lines = input.attrs.doc_lines.iter().map(|tokens| { + quote! { #[doc #tokens] } + }); + + let attrs = input.attrs.nested_attrs.iter().map(|nested| { + quote! { + #[#nested] + } + }); + + let fields = input.fields.iter().map( + |FieldData { + ident, attrs, ty, .. + }| { + let doc_lines = attrs.doc_lines.iter().map(|tokens| { + quote! { #[doc #tokens] } + }); + + let ty = match attrs.ty.as_ref() { + Some(PartialType::Literal(ty)) => ty.clone(), + Some(PartialType::Prefixed) => { + let mut ty = ty.clone(); + if let Type::Path(type_path) = &mut ty { + if let Some(segment) = type_path.path.segments.first_mut() { + segment.ident = + Ident::new(&format!("Partial{}", segment.ident), Span::call_site()) + } + } + ty + } + None => ty.clone(), + }; + + let attrs = attrs.nested_attrs.iter().map(|nested| { + quote! { + #[#nested] + } + }); + + quote! { + #( #doc_lines )* + #( #attrs )* + #[serde(skip_serializing_if = "Option::is_none")] + pub #ident: Option<#ty> + } + }, + ); + + let from_partial_fields = input.fields.iter().map( + |FieldData { + ident, + ty, + should_wrap, + .. + }| { + if *should_wrap { + quote! { + #ident: partial.#ident.map(#ty::from).unwrap_or(default.#ident) + } + } else { + quote! { + #ident: partial.#ident.map(#ty::from) + } + } + }, + ); + + quote! { + #( #doc_lines )* + #[derive(#(#derives),*)] + #( #attrs )* + pub struct #partial_ident { + #( #fields ),* + } + + impl From<#partial_ident> for #ident { + fn from(partial: #partial_ident) -> Self { + let default = Self::default(); + Self { + #( #from_partial_fields ),* + } + } + } + } +} diff --git a/crates/pgls_configuration_macros/src/util.rs b/crates/pgls_configuration_macros/src/util.rs new file mode 100644 index 000000000..5470435d9 --- /dev/null +++ b/crates/pgls_configuration_macros/src/util.rs @@ -0,0 +1,17 @@ +use syn::{Error, Meta, MetaList, NestedMeta, spanned::Spanned}; + +pub(crate) fn parse_meta_list( + meta: &Meta, + mut consume: impl FnMut(&Meta) -> Result<(), Error>, +) -> Result<(), Error> { + let Meta::List(MetaList { nested, .. }) = meta else { + return Err(Error::new(meta.span(), "A list of attribute is expected")); + }; + for nested_meta in nested { + let NestedMeta::Meta(meta) = nested_meta else { + return Err(Error::new(nested_meta.span(), "Literals are not allowed")); + }; + consume(meta)?; + } + Ok(()) +} diff --git a/crates/pgls_lsp/Cargo.toml b/crates/pgls_lsp/Cargo.toml index 2345c5a35..2889643dc 100644 --- a/crates/pgls_lsp/Cargo.toml +++ b/crates/pgls_lsp/Cargo.toml @@ -13,7 +13,6 @@ version = "0.0.0" [dependencies] anyhow = { workspace = true } -biome_deserialize = { workspace = true } futures = "0.3.31" pgls_analyse = { workspace = true } pgls_completions = { workspace = true } diff --git a/crates/pgls_lsp/src/session.rs b/crates/pgls_lsp/src/session.rs index 432b26833..52dac885b 100644 --- a/crates/pgls_lsp/src/session.rs +++ b/crates/pgls_lsp/src/session.rs @@ -3,10 +3,10 @@ use crate::diagnostics::LspError; use crate::documents::Document; use crate::utils; use anyhow::Result; -use biome_deserialize::Merge; use futures::StreamExt; use futures::stream::FuturesUnordered; use pgls_analyse::RuleCategoriesBuilder; +use pgls_configuration::Merge; use pgls_configuration::{ConfigurationPathHint, PartialConfiguration}; use pgls_diagnostics::{DiagnosticExt, Error}; use pgls_fs::{ConfigName, FileSystem, PgLSPath}; diff --git a/crates/pgls_lsp/tests/server.rs b/crates/pgls_lsp/tests/server.rs index c33ae71e4..08beb1b1f 100644 --- a/crates/pgls_lsp/tests/server.rs +++ b/crates/pgls_lsp/tests/server.rs @@ -2,14 +2,14 @@ use anyhow::Context; use anyhow::Error; use anyhow::Result; use anyhow::bail; -use biome_deserialize::Merge; -use biome_deserialize::StringSet; use futures::Sink; use futures::SinkExt; use futures::Stream; use futures::StreamExt; use futures::channel::mpsc::{Sender, channel}; +use pgls_configuration::Merge; use pgls_configuration::PartialConfiguration; +use pgls_configuration::StringSet; use pgls_configuration::database::PartialDatabaseConfiguration; use pgls_fs::MemoryFileSystem; use pgls_lsp::LSPServer; diff --git a/crates/pgls_splinter/Cargo.toml b/crates/pgls_splinter/Cargo.toml index 5d61f00a7..9047594b3 100644 --- a/crates/pgls_splinter/Cargo.toml +++ b/crates/pgls_splinter/Cargo.toml @@ -21,10 +21,10 @@ serde_json.workspace = true sqlx.workspace = true [dev-dependencies] -biome_deserialize.workspace = true -insta.workspace = true -pgls_console.workspace = true -pgls_test_utils.workspace = true +insta.workspace = true +pgls_configuration.workspace = true +pgls_console.workspace = true +pgls_test_utils.workspace = true [build-dependencies] serde_json = "1" diff --git a/crates/pgls_splinter/tests/diagnostics.rs b/crates/pgls_splinter/tests/diagnostics.rs index 00e978078..f9a872152 100644 --- a/crates/pgls_splinter/tests/diagnostics.rs +++ b/crates/pgls_splinter/tests/diagnostics.rs @@ -1,5 +1,5 @@ -use biome_deserialize::StringSet; use pgls_analyse::AnalysisFilter; +use pgls_configuration::StringSet; use pgls_configuration::rules::RuleConfiguration; use pgls_configuration::splinter::{ Performance, Rules, SplinterConfiguration, SplinterRuleOptions, diff --git a/crates/pgls_workspace/Cargo.toml b/crates/pgls_workspace/Cargo.toml index c06b9e594..468c07c9f 100644 --- a/crates/pgls_workspace/Cargo.toml +++ b/crates/pgls_workspace/Cargo.toml @@ -12,9 +12,8 @@ version = "0.0.0" [dependencies] -biome_deserialize = "0.6.0" -globset = "0.4.16" -lru = "0.12" +globset = "0.4.16" +lru = "0.12" ignore = { workspace = true } json-strip-comments = { workspace = true } @@ -59,10 +58,6 @@ pgls_typecheck = { workspace = true, optional = true } sqlx = { workspace = true, optional = true } tokio = { workspace = true, features = ["rt", "rt-multi-thread"], optional = true } -biome_js_factory = { workspace = true, optional = true } -biome_js_syntax = { workspace = true, optional = true } -biome_rowan = { workspace = true, optional = true } - [features] db = [ "dep:futures", @@ -77,9 +72,6 @@ db = [ default = ["db"] schema = [ "dep:schemars", - "dep:biome_rowan", - "dep:biome_js_syntax", - "dep:biome_js_factory", "pgls_configuration/schema", "pgls_diagnostics/schema", "pgls_fs/schema", diff --git a/crates/pgls_workspace/src/configuration.rs b/crates/pgls_workspace/src/configuration.rs index eb071b6b0..eb529f07c 100644 --- a/crates/pgls_workspace/src/configuration.rs +++ b/crates/pgls_workspace/src/configuration.rs @@ -5,8 +5,8 @@ use std::{ path::{Path, PathBuf}, }; -use biome_deserialize::Merge; use pgls_analyser::LinterRules; +use pgls_configuration::Merge; use pgls_configuration::{ ConfigurationDiagnostic, ConfigurationPathHint, ConfigurationPayload, PartialConfiguration, VERSION, diagnostics::CantLoadExtendFile, push_to_analyser_rules, diff --git a/crates/pgls_workspace/src/settings.rs b/crates/pgls_workspace/src/settings.rs index 0cdf76408..d3f1c40cf 100644 --- a/crates/pgls_workspace/src/settings.rs +++ b/crates/pgls_workspace/src/settings.rs @@ -1,5 +1,5 @@ -use biome_deserialize::StringSet; use globset::Glob; +use pgls_configuration::StringSet; use pgls_diagnostics::Category; #[cfg(feature = "db")] use std::str::FromStr; @@ -831,7 +831,7 @@ impl Default for FilesSettings { #[cfg(test)] mod tests { - use biome_deserialize::StringSet; + use pgls_configuration::StringSet; use pgls_configuration::database::PartialDatabaseConfiguration; use super::DatabaseSettings; diff --git a/crates/pgls_workspace/src/workspace/server.tests.rs b/crates/pgls_workspace/src/workspace/server.tests.rs index 51bf0fa91..33ae76558 100644 --- a/crates/pgls_workspace/src/workspace/server.tests.rs +++ b/crates/pgls_workspace/src/workspace/server.tests.rs @@ -1,7 +1,7 @@ use std::sync::Arc; -use biome_deserialize::{Merge, StringSet}; use pgls_analyse::RuleCategories; +use pgls_configuration::{Merge, StringSet}; use pgls_configuration::{ PartialConfiguration, PartialFormatConfiguration, PartialTypecheckConfiguration, database::PartialDatabaseConfiguration, files::PartialFilesConfiguration, diff --git a/crates/pgls_workspace/src/workspace_types.rs b/crates/pgls_workspace/src/workspace_types.rs index 896109821..020283863 100644 --- a/crates/pgls_workspace/src/workspace_types.rs +++ b/crates/pgls_workspace/src/workspace_types.rs @@ -2,7 +2,6 @@ use std::collections::VecDeque; -use biome_js_syntax::{AnyJsDeclaration, AnyTsTupleTypeElement}; use rustc_hash::FxHashSet; use schemars::{ JsonSchema, @@ -12,11 +11,6 @@ use schemars::{ use serde_json::Value; use crate::{WorkspaceError, workspace::*}; -use biome_js_factory::{ - make, - syntax::{AnyJsObjectMemberName, AnyTsName, AnyTsType, AnyTsTypeMember, T}, -}; -use biome_rowan::AstSeparatedList; /// Manages a queue of type definitions that need to be generated #[derive(Default)] @@ -45,47 +39,30 @@ impl<'a> ModuleQueue<'a> { } } -/// Generate a [TsType] node from the `instance_type` of a [SchemaObject] +/// Generate a TS type string from the `instance_type` of a [SchemaObject] fn instance_type<'a>( queue: &mut ModuleQueue<'a>, root_schema: &'a RootSchema, schema: &'a SchemaObject, ty: InstanceType, -) -> AnyTsType { +) -> String { match ty { // If the instance type is an object, generate a TS object type with the corresponding properties InstanceType::Object => { let object = schema.object.as_deref().unwrap(); - AnyTsType::from(make::ts_object_type( - make::token(T!['{']), - make::ts_type_member_list(object.properties.iter().map(|(property, schema)| { - let (ts_type, optional, description) = schema_type(queue, root_schema, schema); - assert!(!optional, "optional nested types are not supported"); + let mut members = Vec::new(); + for (property, prop_schema) in &object.properties { + let (ts_type, optional, description) = schema_type(queue, root_schema, prop_schema); + assert!(!optional, "optional nested types are not supported"); - let mut property = make::ident(property); - if let Some(description) = description { - let comment = format!("/**\n\t* {description} \n\t */"); - let trivia = vec![ - (biome_js_syntax::TriviaPieceKind::Newline, "\n"), - ( - biome_js_syntax::TriviaPieceKind::MultiLineComment, - comment.as_str(), - ), - (biome_js_syntax::TriviaPieceKind::Newline, "\n"), - ]; - property = property.with_leading_trivia(trivia); - } - - AnyTsTypeMember::from( - make::ts_property_signature_type_member(AnyJsObjectMemberName::from( - make::js_literal_member_name(property), - )) - .with_type_annotation(make::ts_type_annotation(make::token(T![:]), ts_type)) - .build(), - ) - })), - make::token(T!['}']), - )) + let mut member = String::new(); + if let Some(description) = description { + member.push_str(&format!("/**\n\t* {description} \n\t */\n")); + } + member.push_str(&format!("{property}: {ts_type}")); + members.push(member); + } + format!("{{ {} }}", members.join("; ")) } // If the instance type is an array, generate a TS array type with the corresponding item type InstanceType::Array => { @@ -95,87 +72,82 @@ fn instance_type<'a>( SingleOrVec::Single(schema) => { let (ts_type, optional, _) = schema_type(queue, root_schema, schema); assert!(!optional, "optional nested types are not supported"); - - AnyTsType::from(make::ts_array_type( - ts_type, - make::token(T!['[']), - make::token(T![']']), - )) + format!("{ts_type}[]") } - SingleOrVec::Vec(items) => AnyTsType::from(make::ts_tuple_type( - make::token(T!['[']), - make::ts_tuple_type_element_list( - items.iter().map(|schema| { + SingleOrVec::Vec(items) => { + let elements: Vec = items + .iter() + .map(|schema| { let (ts_type, optional, _) = schema_type(queue, root_schema, schema); assert!(!optional, "optional nested types are not supported"); - AnyTsTupleTypeElement::AnyTsType(ts_type) - }), - items.iter().map(|_| make::token(T![,])), - ), - make::token(T![']']), - )), + ts_type + }) + .collect(); + format!("[{}]", elements.join(", ")) + } } } // Map native types to the corresponding TS type - InstanceType::Null => AnyTsType::from(make::ts_null_literal_type(make::token(T![null]))), - InstanceType::Boolean => AnyTsType::from(make::ts_boolean_type(make::token(T![boolean]))), - InstanceType::String => AnyTsType::from(make::ts_string_type(make::token(T![string]))), - InstanceType::Number | InstanceType::Integer => { - AnyTsType::from(make::ts_number_type(make::token(T![number]))) - } + InstanceType::Null => "null".to_string(), + InstanceType::Boolean => "boolean".to_string(), + InstanceType::String => "string".to_string(), + InstanceType::Number | InstanceType::Integer => "number".to_string(), } } -/// Generate a literal [TsType] from a `serde_json` [Value] -fn value_type(value: &Value) -> AnyTsType { +/// Generate a literal TS type string from a `serde_json` [Value] +fn value_type(value: &Value) -> String { match value { - Value::Null => AnyTsType::from(make::ts_null_literal_type(make::token(T![null]))), - Value::Bool(true) => AnyTsType::from(make::ts_boolean_literal_type(make::token(T![true]))), - Value::Bool(false) => { - AnyTsType::from(make::ts_boolean_literal_type(make::token(T![false]))) - } - Value::Number(value) => AnyTsType::from( - make::ts_number_literal_type(make::js_number_literal(value.as_f64().unwrap())).build(), - ), - Value::String(value) => { - AnyTsType::from(make::ts_string_literal_type(make::js_string_literal(value))) - } + Value::Null => "null".to_string(), + Value::Bool(true) => "true".to_string(), + Value::Bool(false) => "false".to_string(), + Value::Number(value) => format!("{}", value.as_f64().unwrap()), + Value::String(value) => format!("\"{value}\""), Value::Array(_) => unimplemented!(), Value::Object(_) => unimplemented!(), } } -/// Generate a union [TsType] node from a list of [TsType]s, -/// flattening any nested union type the iterator may emit -fn make_union_type(items: impl IntoIterator) -> AnyTsType { +/// Generate a union type string from a list of type strings, +/// flattening any nested union types (types containing "\n\t| ") +fn make_union_type(items: impl IntoIterator) -> String { let mut result = Vec::new(); for item in items { - if let AnyTsType::TsUnionType(union_type) = item { - for item in union_type.types().iter() { - result.push(item.unwrap()); + // Flatten nested union types (multi-line format) + if item.contains("\n\t| ") { + for part in item.split("\n\t| ") { + let trimmed = part.trim(); + if !trimmed.is_empty() { + result.push(trimmed.to_string()); + } } } else { - result.push(item); + let trimmed = item.trim(); + if !trimmed.is_empty() { + result.push(trimmed.to_string()); + } } } - let separators = (0..result.len().saturating_sub(1)).map(|_| make::token(T![|])); - AnyTsType::from( - make::ts_union_type(make::ts_union_type_variant_list(result, separators)).build(), - ) + // Format as multi-line union with leading pipe on each line for readability + if result.len() > 1 { + format!("\n\t| {}", result.join("\n\t| ")) + } else { + result.into_iter().next().unwrap_or_default() + } } -/// Generate a [TsType] node from a [SchemaObject], returning the generated +/// Generate a TS type string from a [SchemaObject], returning the generated /// TypeScript type along with a boolean flag indicating whether the type is /// considered "optional" in the schema fn schema_object_type<'a>( queue: &mut ModuleQueue<'a>, root_schema: &'a RootSchema, schema: &'a SchemaObject, -) -> (AnyTsType, bool, Option<&'a String>) { - // Start by detecting enum types by inspecting the `enum_values` field, i +) -> (String, bool, Option<&'a String>) { + // Start by detecting enum types by inspecting the `enum_values` field, if // the field is set return a union type generated from the literal enum values let description = schema .metadata @@ -208,12 +180,7 @@ fn schema_object_type<'a>( None => panic!("definition for type {key:?} not found"), } - Some(AnyTsType::from( - make::ts_reference_type(AnyTsName::from(make::js_reference_identifier( - make::ident(key), - ))) - .build(), - )) + Some(key.to_string()) }) // Finally try to inspect the subschemas for this type .or_else(|| { @@ -224,17 +191,15 @@ fn schema_object_type<'a>( .all_of .as_deref() .map(|all_of| { - AnyTsType::from( - make::ts_intersection_type(make::ts_intersection_type_element_list( - all_of.iter().map(|ty| { - let (ts_type, optional, _) = schema_type(queue, root_schema, ty); - assert!(!optional, "optional nested types are not supported"); - ts_type - }), - (0..all_of.len().saturating_sub(1)).map(|_| make::token(T![&])), - )) - .build(), - ) + let parts: Vec = all_of + .iter() + .map(|ty| { + let (ts_type, optional, _) = schema_type(queue, root_schema, ty); + assert!(!optional, "optional nested types are not supported"); + ts_type + }) + .collect(); + parts.join(" & ") }) // Otherwise try to inspect the `any_of` list of subschemas, and // generate the corresponding union type for it @@ -253,7 +218,7 @@ fn schema_object_type<'a>( }) .unwrap_or_else(|| { // this is temporary workaround to fix the `options` field, which is not used at the moment - AnyTsType::from(make::ts_any_type(make::token(T![any]))) + "any".to_string() }); // Types are considered "optional" in the serialization protocol if they @@ -267,39 +232,31 @@ fn schema_object_type<'a>( (ts_type, is_nullable || has_defaults, description) } -/// Generate a [TsType] node from a [Schema], returning the generated type +/// Generate a TS type string from a [Schema], returning the generated type /// along with a boolean flag indicating whether the type is considered /// "optional" in the schema fn schema_type<'a>( queue: &mut ModuleQueue<'a>, root_schema: &'a RootSchema, schema: &'a Schema, -) -> (AnyTsType, bool, Option<&'a String>) { +) -> (String, bool, Option<&'a String>) { match schema { // Types defined as `true` in the schema always pass validation, // map them to the `any` type - Schema::Bool(true) => ( - AnyTsType::from(make::ts_any_type(make::token(T![any]))), - true, - None, - ), + Schema::Bool(true) => ("any".to_string(), true, None), // Types defined as `false` in the schema never pass validation, // map them to the `never` type - Schema::Bool(false) => ( - AnyTsType::from(make::ts_never_type(make::token(T![never]))), - false, - None, - ), + Schema::Bool(false) => ("never".to_string(), false, None), Schema::Object(schema_object) => schema_object_type(queue, root_schema, schema_object), } } /// Generate and emit all the types defined in `root_schema` into the `module` pub fn generate_type<'a>( - module: &mut Vec<(AnyJsDeclaration, Option<&'a String>)>, + module: &mut Vec<(String, Option<&'a String>)>, queue: &mut ModuleQueue<'a>, root_schema: &'a RootSchema, -) -> AnyTsType { +) -> String { // Read the root type of the schema and push it to the queue let root_name = root_schema .schema @@ -309,11 +266,9 @@ pub fn generate_type<'a>( .unwrap(); match root_name { - "Null" => return AnyTsType::TsVoidType(make::ts_void_type(make::token(T![void]))), - "Boolean" => { - return AnyTsType::TsBooleanType(make::ts_boolean_type(make::token(T![boolean]))); - } - "String" => return AnyTsType::TsStringType(make::ts_string_type(make::token(T![string]))), + "Null" => return "void".to_string(), + "Boolean" => return "boolean".to_string(), + "String" => return "string".to_string(), _ => {} } @@ -339,75 +294,41 @@ pub fn generate_type<'a>( // Create a property signature member in the interface for each // property of the corresponding schema object let object = schema.object.as_deref().unwrap(); - for (property, schema) in &object.properties { - let (ts_type, optional, description) = schema_type(queue, root_schema, schema); + for (property, prop_schema) in &object.properties { + let (ts_type, optional, description) = schema_type(queue, root_schema, prop_schema); - let mut property = make::ident(property); + let mut member = String::new(); if let Some(description) = description { - let comment = format!("/**\n\t* {description} \n\t */"); - let trivia = vec![ - (biome_js_syntax::TriviaPieceKind::Newline, "\n"), - ( - biome_js_syntax::TriviaPieceKind::MultiLineComment, - comment.as_str(), - ), - (biome_js_syntax::TriviaPieceKind::Newline, "\n"), - ]; - property = property.with_leading_trivia(trivia); + member.push_str(&format!("\t/**\n\t * {description}\n\t */\n")); } - - let mut builder = make::ts_property_signature_type_member( - AnyJsObjectMemberName::from(make::js_literal_member_name(property)), - ) - .with_type_annotation(make::ts_type_annotation(make::token(T![:]), ts_type)); - - if optional { - builder = builder.with_optional_token(make::token(T![?])); - } - - members.push(AnyTsTypeMember::from(builder.build())); + let opt = if optional { "?" } else { "" }; + member.push_str(&format!("\t{property}{opt}: {ts_type};")); + members.push(member); } let description = schema .metadata .as_ref() .and_then(|s| s.description.as_ref()); - let current_module = AnyJsDeclaration::from( - make::ts_interface_declaration( - make::token(T![interface]), - make::ts_identifier_binding(make::ident(name)), - make::token(T!['{']), - make::ts_type_member_list(members), - make::token(T!['}']), - ) - .build(), - ); - module.push((current_module, description)); + let decl = format!("interface {name} {{\n{}\n}}", members.join("\n")); + module.push((decl, description)); } else { // If the schema for this type is not an object, emit it as a type alias let (ts_type, optional, description) = schema_object_type(queue, root_schema, schema); assert!(!optional, "optional nested types are not supported"); - let current_module = AnyJsDeclaration::from( - make::ts_type_alias_declaration( - make::token(T![type]), - make::ts_identifier_binding(make::ident(name)), - make::token(T![=]), - ts_type, - ) - .build(), - ); - module.push((current_module, description)); + // For multi-line union types, don't add space after = + let decl = if ts_type.starts_with('\n') { + format!("type {name} ={ts_type};") + } else { + format!("type {name} = {ts_type};") + }; + module.push((decl, description)); } } - AnyTsType::TsReferenceType( - make::ts_reference_type(AnyTsName::JsReferenceIdentifier( - make::js_reference_identifier(make::ident(root_name)), - )) - .build(), - ) + root_name.to_string() } /// Signature metadata for a [Workspace] method diff --git a/docs/codegen/Cargo.toml b/docs/codegen/Cargo.toml index 97619dda0..069c1102e 100644 --- a/docs/codegen/Cargo.toml +++ b/docs/codegen/Cargo.toml @@ -32,5 +32,5 @@ pgls_query_ext = { workspace = true } pgls_workspace = { workspace = true } pgls_statement_splitter = { workspace = true } pgls_console = { workspace = true } -biome_string_case = { workspace = true } +convert_case = { workspace = true } diff --git a/docs/codegen/src/rules_docs.rs b/docs/codegen/src/rules_docs.rs index f68950315..aa8b3aa3f 100644 --- a/docs/codegen/src/rules_docs.rs +++ b/docs/codegen/src/rules_docs.rs @@ -1,5 +1,5 @@ use anyhow::{Result, bail}; -use biome_string_case::Case; +use convert_case::{Case, Casing}; use pgls_analyse::{AnalysisFilter, RuleFilter, RuleMetadata}; use pgls_analyser::{AnalysableStatement, Analyser, AnalyserConfig, LinterOptions}; use pgls_console::StdDisplay; @@ -35,7 +35,7 @@ pub fn generate_rules_docs(docs_dir: &Path) -> anyhow::Result<()> { for (group, rules) in groups { for (rule, metadata) in rules { let content = generate_rule_doc(group, rule, metadata)?; - let dashed_rule = Case::Kebab.convert(rule); + let dashed_rule = rule.to_case(Case::Kebab); fs::write(rules_dir.join(format!("{dashed_rule}.md")), content)?; } } diff --git a/docs/codegen/src/rules_index.rs b/docs/codegen/src/rules_index.rs index b2b983e02..2fc9e386a 100644 --- a/docs/codegen/src/rules_index.rs +++ b/docs/codegen/src/rules_index.rs @@ -1,4 +1,4 @@ -use biome_string_case::Case; +use convert_case::{Case, Casing}; use pgls_analyse::RuleMetadata; use pgls_console::fmt::{Formatter, HTML}; use pgls_console::{Markup, markup}; @@ -58,7 +58,7 @@ fn generate_group( for (rule_name, rule_metadata) in rules { let is_recommended = rule_metadata.recommended; - let dashed_rule = Case::Kebab.convert(rule_name); + let dashed_rule = rule_name.to_case(Case::Kebab); let mut properties = String::new(); if is_recommended { @@ -170,7 +170,7 @@ fn generate_splinter_group( for (rule_name, rule_metadata) in rules { let is_recommended = rule_metadata.metadata.recommended; let requires_supabase = rule_metadata.requires_supabase; - let dashed_rule = Case::Kebab.convert(rule_name); + let dashed_rule = rule_name.to_case(Case::Kebab); let mut properties = String::new(); if is_recommended { diff --git a/docs/codegen/src/rules_sources.rs b/docs/codegen/src/rules_sources.rs index 949c86a3c..a2c92f2bc 100644 --- a/docs/codegen/src/rules_sources.rs +++ b/docs/codegen/src/rules_sources.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use biome_string_case::Case; +use convert_case::{Case, Casing}; use pgls_analyse::RuleMetadata; use std::cmp::Ordering; use std::collections::{BTreeMap, BTreeSet}; @@ -48,7 +48,7 @@ pub fn generate_rule_sources(docs_dir: &Path) -> anyhow::Result<()> { let mut exclusive_rules = BTreeSet::<(String, String)>::new(); for (rule_name, metadata) in rules { - let kebab_rule_name = Case::Kebab.convert(rule_name); + let kebab_rule_name = rule_name.to_case(Case::Kebab); if metadata.sources.is_empty() { exclusive_rules.insert(( rule_name.to_string(), @@ -127,7 +127,7 @@ pub fn generate_database_rule_sources(docs_dir: &Path) -> anyhow::Result<()> { let mut rules_by_source = BTreeMap::<&str, Vec<(&str, &str)>>::new(); for (rule_name, _metadata) in &rules { - let kebab_rule_name = Case::Kebab.convert(rule_name); + let kebab_rule_name = rule_name.to_case(Case::Kebab); rules_by_source .entry("Splinter") .or_default() diff --git a/docs/codegen/src/splinter_docs.rs b/docs/codegen/src/splinter_docs.rs index 8ca275b99..1701ebf32 100644 --- a/docs/codegen/src/splinter_docs.rs +++ b/docs/codegen/src/splinter_docs.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use biome_string_case::Case; +use convert_case::{Case, Casing}; use std::{fs, io::Write as _, path::Path}; use crate::utils::SplinterRuleMetadata; @@ -34,7 +34,7 @@ pub fn generate_splinter_docs(docs_dir: &Path) -> anyhow::Result<()> { for (group, rules) in groups { for (rule, metadata) in rules { let content = generate_splinter_rule_doc(group, rule, metadata)?; - let dashed_rule = Case::Kebab.convert(rule); + let dashed_rule = rule.to_case(Case::Kebab); fs::write(rules_dir.join(format!("{dashed_rule}.md")), content)?; } } diff --git a/packages/@postgres-language-server/backend-jsonrpc/src/command.ts b/packages/@postgres-language-server/backend-jsonrpc/src/command.ts index ed5f9a155..b36677567 100644 --- a/packages/@postgres-language-server/backend-jsonrpc/src/command.ts +++ b/packages/@postgres-language-server/backend-jsonrpc/src/command.ts @@ -6,69 +6,72 @@ import { execSync } from "node:child_process"; * @returns Filesystem path to the binary, or null if no prebuilt distribution exists for the current platform */ export function getCommand(): string | null { - const { platform, arch } = process; + const { platform, arch } = process; - const PLATFORMS: Partial< - Record< - NodeJS.Platform | "linux-musl", - Partial> - > - > = { - win32: { - x64: "@postgres-language-server/cli-x86_64-windows-msvc/postgres-language-server.exe", - arm64: "@postgres-language-server/cli-aarch64-windows-msvc/postgres-language-server.exe", - }, - darwin: { - x64: "@postgres-language-server/cli-x86_64-apple-darwin/postgres-language-server", - arm64: "@postgres-language-server/cli-aarch64-apple-darwin/postgres-language-server", - }, - linux: { - x64: "@postgres-language-server/cli-x86_64-linux-gnu/postgres-language-server", - arm64: "@postgres-language-server/cli-aarch64-linux-gnu/postgres-language-server", - }, - "linux-musl": { - x64: "@postgres-language-server/cli-x86_64-linux-musl/postgres-language-server", - // no arm64 build for musl - }, - }; + const PLATFORMS: Partial< + Record< + NodeJS.Platform | "linux-musl", + Partial> + > + > = { + win32: { + x64: "@postgres-language-server/cli-x86_64-windows-msvc/postgres-language-server.exe", + arm64: + "@postgres-language-server/cli-aarch64-windows-msvc/postgres-language-server.exe", + }, + darwin: { + x64: "@postgres-language-server/cli-x86_64-apple-darwin/postgres-language-server", + arm64: + "@postgres-language-server/cli-aarch64-apple-darwin/postgres-language-server", + }, + linux: { + x64: "@postgres-language-server/cli-x86_64-linux-gnu/postgres-language-server", + arm64: + "@postgres-language-server/cli-aarch64-linux-gnu/postgres-language-server", + }, + "linux-musl": { + x64: "@postgres-language-server/cli-x86_64-linux-musl/postgres-language-server", + // no arm64 build for musl + }, + }; - function isMusl() { - let stderr = ""; - try { - stderr = execSync("ldd --version", { - stdio: [ - "ignore", // stdin - "pipe", // stdout – glibc systems print here - "pipe", // stderr – musl systems print here - ], - }).toString(); - } catch (err: unknown) { - if (hasStdErr(err)) { - stderr = err.stderr; - } - } - if (stderr.indexOf("musl") > -1) { - return true; - } - return false; - } + function isMusl() { + let stderr = ""; + try { + stderr = execSync("ldd --version", { + stdio: [ + "ignore", // stdin + "pipe", // stdout – glibc systems print here + "pipe", // stderr – musl systems print here + ], + }).toString(); + } catch (err: unknown) { + if (hasStdErr(err)) { + stderr = err.stderr; + } + } + if (stderr.indexOf("musl") > -1) { + return true; + } + return false; + } - function getPlatform(): NodeJS.Platform | "linux-musl" { - if (platform === "linux") { - return isMusl() ? "linux-musl" : "linux"; - } + function getPlatform(): NodeJS.Platform | "linux-musl" { + if (platform === "linux") { + return isMusl() ? "linux-musl" : "linux"; + } - return platform; - } + return platform; + } - const binPath = PLATFORMS?.[getPlatform()]?.[arch]; - if (!binPath) { - return null; - } + const binPath = PLATFORMS?.[getPlatform()]?.[arch]; + if (!binPath) { + return null; + } - return require.resolve(binPath); + return require.resolve(binPath); } function hasStdErr(err: unknown): err is { stderr: string } { - return !!(err as any)?.stderr; + return typeof err === "object" && err !== null && "stderr" in err; } diff --git a/packages/@postgres-language-server/backend-jsonrpc/src/workspace.ts b/packages/@postgres-language-server/backend-jsonrpc/src/workspace.ts index 8bd384ab8..2c8c55936 100644 --- a/packages/@postgres-language-server/backend-jsonrpc/src/workspace.ts +++ b/packages/@postgres-language-server/backend-jsonrpc/src/workspace.ts @@ -175,10 +175,10 @@ export type MarkupBuf = MarkupNodeBuf[]; export type Severity = "hint" | "information" | "warning" | "error" | "fatal"; export type DiagnosticTags = DiagnosticTag[]; /** - * Serializable representation of a [Diagnostic](super::Diagnostic) advice + * Serializable representation of a [Diagnostic](super::Diagnostic) advice -See the [Visitor] trait for additional documentation on all the supported advice types. - */ +See the [Visitor] trait for additional documentation on all the supported advice types. + */ export type Advice = | { log: [LogCategory, MarkupBuf] } | { list: MarkupBuf[] } @@ -285,10 +285,10 @@ export interface CompletionItem { sort_text: string; } /** - * The text that the editor should fill in. If `None`, the `label` should be used. Tables, for example, might have different completion_texts: + * The text that the editor should fill in. If `None`, the `label` should be used. Tables, for example, might have different completion_texts: -label: "users", description: "Schema: auth", completion_text: "auth.users". - */ +label: "users", description: "Schema: auth", completion_text: "auth.users". + */ export interface CompletionText { is_snippet: boolean; /** @@ -555,9 +555,9 @@ export interface PartialVcsConfiguration { */ enabled?: boolean; /** - * The folder where we should check for VCS files. By default, we will use the same folder where `postgres-language-server.jsonc` was found. + * The folder where we should check for VCS files. By default, we will use the same folder where `postgres-language-server.jsonc` was found. -If we can't find the configuration, it will attempt to use the current working directory. If no current working directory can't be found, we won't use the VCS integration, and a diagnostic will be emitted +If we can't find the configuration, it will attempt to use the current working directory. If no current working directory can't be found, we won't use the VCS integration, and a diagnostic will be emitted */ root?: string; /** @@ -1012,17 +1012,17 @@ export interface RuleWithOptions_for_SplinterRuleOptions { options: SplinterRuleOptions; } /** - * Shared options for all splinter rules. + * Shared options for all splinter rules. -These options allow configuring per-rule filtering of database objects. - */ +These options allow configuring per-rule filtering of database objects. + */ export interface SplinterRuleOptions { /** - * A list of glob patterns for database objects to ignore. + * A list of glob patterns for database objects to ignore. Patterns use Unix-style globs where: - `*` matches any sequence of characters - `?` matches any single character -Each pattern should be in the format `schema.object_name`, for example: - `"public.my_table"` - ignores a specific table - `"audit.*"` - ignores all objects in the audit schema - `"*.audit_*"` - ignores objects with audit_ prefix in any schema +Each pattern should be in the format `schema.object_name`, for example: - `"public.my_table"` - ignores a specific table - `"audit.*"` - ignores all objects in the audit schema - `"*.audit_*"` - ignores objects with audit_ prefix in any schema */ ignore?: string[]; } diff --git a/packages/@postgres-language-server/cli/package.json b/packages/@postgres-language-server/cli/package.json index fe9b64535..c8855be99 100644 --- a/packages/@postgres-language-server/cli/package.json +++ b/packages/@postgres-language-server/cli/package.json @@ -1,48 +1,44 @@ { - "name": "@postgres-language-server/cli", - "version": "", - "bin": { - "postgres-language-server": "bin/postgres-language-server" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/supabase-community/postgres-language-server.git", - "directory": "packages/@postgres-language-server/cli" - }, - "author": "Supabase Community", - "contributors": [ - { - "name": "Philipp Steinrötter", - "url": "https://github.com/psteinroe" - }, - { - "name": "Julian Domke", - "url": "https://github.com/juleswritescode" - } - ], - "license": "MIT or Apache-2.0", - "description": "A collection of language tools and a Language Server Protocol (LSP) implementation for Postgres, focusing on developer experience and reliable SQL tooling.", - "files": [ - "bin/postgres-language-server", - "schema.json", - "README.md" - ], - "engines": { - "node": ">=20" - }, - "publishConfig": { - "provenance": true - }, - "optionalDependencies": { - "@postgres-language-server/cli-x86_64-windows-msvc": "", - "@postgres-language-server/cli-aarch64-windows-msvc": "", - "@postgres-language-server/cli-x86_64-apple-darwin": "", - "@postgres-language-server/cli-aarch64-apple-darwin": "", - "@postgres-language-server/cli-x86_64-linux-gnu": "", - "@postgres-language-server/cli-aarch64-linux-gnu": "", - "@postgres-language-server/cli-x86_64-linux-musl": "" - }, - "scripts": { - "test": "bun test" - } + "name": "@postgres-language-server/cli", + "version": "", + "bin": { + "postgres-language-server": "bin/postgres-language-server" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/supabase-community/postgres-language-server.git", + "directory": "packages/@postgres-language-server/cli" + }, + "author": "Supabase Community", + "contributors": [ + { + "name": "Philipp Steinrötter", + "url": "https://github.com/psteinroe" + }, + { + "name": "Julian Domke", + "url": "https://github.com/juleswritescode" + } + ], + "license": "MIT or Apache-2.0", + "description": "A collection of language tools and a Language Server Protocol (LSP) implementation for Postgres, focusing on developer experience and reliable SQL tooling.", + "files": ["bin/postgres-language-server", "schema.json", "README.md"], + "engines": { + "node": ">=20" + }, + "publishConfig": { + "provenance": true + }, + "optionalDependencies": { + "@postgres-language-server/cli-x86_64-windows-msvc": "", + "@postgres-language-server/cli-aarch64-windows-msvc": "", + "@postgres-language-server/cli-x86_64-apple-darwin": "", + "@postgres-language-server/cli-aarch64-apple-darwin": "", + "@postgres-language-server/cli-x86_64-linux-gnu": "", + "@postgres-language-server/cli-aarch64-linux-gnu": "", + "@postgres-language-server/cli-x86_64-linux-musl": "" + }, + "scripts": { + "test": "bun test" + } } diff --git a/packages/@postgres-language-server/cli/scripts/generate-packages.mjs b/packages/@postgres-language-server/cli/scripts/generate-packages.mjs index de12134c3..f3fc946d1 100644 --- a/packages/@postgres-language-server/cli/scripts/generate-packages.mjs +++ b/packages/@postgres-language-server/cli/scripts/generate-packages.mjs @@ -1,7 +1,7 @@ import assert from "node:assert"; import * as fs from "node:fs"; -import { pipeline } from "node:stream"; import { resolve } from "node:path"; +import { pipeline } from "node:stream"; import { fileURLToPath } from "node:url"; import { promisify } from "node:util"; const streamPipeline = promisify(pipeline); @@ -53,9 +53,7 @@ async function downloadSchema(releaseTag, githubToken) { } // download to root. - const fileStream = fs.createWriteStream( - resolve(PGLS_ROOT, "schema.json") - ); + const fileStream = fs.createWriteStream(resolve(PGLS_ROOT, "schema.json")); await streamPipeline(response.body, fileStream); @@ -90,7 +88,8 @@ async function downloadWasmAssets(releaseTag, githubToken) { async function downloadBinary(platform, arch, os, releaseTag, githubToken) { const buildName = getBuildName(platform, arch); const ext = getBinaryExt(os); - const assetName = ext && buildName.endsWith(ext) ? buildName : `${buildName}${ext}`; + const assetName = + ext && buildName.endsWith(ext) ? buildName : `${buildName}${ext}`; const assetUrl = `https://github.com/supabase-community/postgres-language-server/releases/download/${releaseTag}/${assetName}`; @@ -104,36 +103,34 @@ async function downloadBinary(platform, arch, os, releaseTag, githubToken) { if (!response.ok) { const error = await response.text(); throw new Error( - `Failed to Fetch Asset from ${assetUrl} (Reason: ${error})` + `Failed to Fetch Asset from ${assetUrl} (Reason: ${error})`, ); } // just download to root. - const fileStream = fs.createWriteStream( - getBinarySource(platform, arch, os) - ); + const fileStream = fs.createWriteStream(getBinarySource(platform, arch, os)); await streamPipeline(response.body, fileStream); console.log(`Downloaded asset for ${buildName} (v${releaseTag})`); } -async function writeManifest(packagePath, version, { versionOnly = false } = {}) { - const manifestPath = resolve( - PACKAGES_PGLS_ROOT, - packagePath, - "package.json" - ); +async function writeManifest( + packagePath, + version, + { versionOnly = false } = {}, +) { + const manifestPath = resolve(PACKAGES_PGLS_ROOT, packagePath, "package.json"); const manifestData = JSON.parse( - fs.readFileSync(manifestPath).toString("utf-8") + fs.readFileSync(manifestPath).toString("utf-8"), ); manifestData.version = version; if (!versionOnly) { const nativePackages = platformArchCombinations().map( - ({ platform, arch }) => [getPackageName(platform, arch), version] + ({ platform, arch }) => [getPackageName(platform, arch), version], ); manifestData.optionalDependencies = Object.fromEntries(nativePackages); } @@ -207,7 +204,7 @@ function copyBinaryToNativePackage(platform, arch, os) { libc, }, null, - 2 + 2, ); const ext = getBinaryExt(os); @@ -221,7 +218,7 @@ function copyBinaryToNativePackage(platform, arch, os) { if (!fs.existsSync(binarySource)) { console.error( - `Source for binary for ${buildName} not found at: ${binarySource}` + `Source for binary for ${buildName} not found at: ${binarySource}`, ); process.exit(1); } @@ -276,7 +273,7 @@ function getBinarySource(platform, arch, os) { } function getBuildName(platform, arch) { - return `postgres-language-server_${arch}-${platform}${platform.includes('windows') ? '.exe' : ''}`; + return `postgres-language-server_${arch}-${platform}${platform.includes("windows") ? ".exe" : ""}`; } function getPackageName(platform, arch) { diff --git a/packages/@postgres-language-server/cli/test/bin.test.js b/packages/@postgres-language-server/cli/test/bin.test.js index 7c743e629..50ca020b5 100644 --- a/packages/@postgres-language-server/cli/test/bin.test.js +++ b/packages/@postgres-language-server/cli/test/bin.test.js @@ -1,65 +1,65 @@ -import { describe, it, expect } from "bun:test"; -import { spawn } from "child_process"; -import { join, dirname } from "path"; -import { fileURLToPath } from "url"; +import { describe, expect, it } from "bun:test"; +import { spawn } from "node:child_process"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; const __dirname = dirname(fileURLToPath(import.meta.url)); const binPath = join(__dirname, "../bin/postgres-language-server"); const testSqlPath = join(__dirname, "test.sql"); describe("postgres-language-server bin", () => { - it("should check a SQL file successfully", async () => { - const result = await new Promise((resolve) => { - const proc = spawn( - "node", - [binPath, "check", "--disable-db", testSqlPath], - { - env: { ...process.env }, - } - ); + it("should check a SQL file successfully", async () => { + const result = await new Promise((resolve) => { + const proc = spawn( + "node", + [binPath, "check", "--disable-db", testSqlPath], + { + env: { ...process.env }, + }, + ); - let stdout = ""; - let stderr = ""; + let stdout = ""; + let stderr = ""; - proc.stdout.on("data", (data) => { - stdout += data.toString(); - }); + proc.stdout.on("data", (data) => { + stdout += data.toString(); + }); - proc.stderr.on("data", (data) => { - stderr += data.toString(); - }); + proc.stderr.on("data", (data) => { + stderr += data.toString(); + }); - proc.on("close", (code) => { - resolve({ code, stdout, stderr }); - }); - }); + proc.on("close", (code) => { + resolve({ code, stdout, stderr }); + }); + }); - expect(result.code).toBe(0); - expect(result.stderr).toBe(""); - }); + expect(result.code).toBe(0); + expect(result.stderr).toBe(""); + }); - it("should fail when file doesn't exist", async () => { - const result = await new Promise((resolve) => { - const proc = spawn("node", [binPath, "check", "nonexistent.sql"], { - env: { ...process.env }, - }); + it("should fail when file doesn't exist", async () => { + const result = await new Promise((resolve) => { + const proc = spawn("node", [binPath, "check", "nonexistent.sql"], { + env: { ...process.env }, + }); - let stdout = ""; - let stderr = ""; + let stdout = ""; + let stderr = ""; - proc.stdout.on("data", (data) => { - stdout += data.toString(); - }); + proc.stdout.on("data", (data) => { + stdout += data.toString(); + }); - proc.stderr.on("data", (data) => { - stderr += data.toString(); - }); + proc.stderr.on("data", (data) => { + stderr += data.toString(); + }); - proc.on("close", (code) => { - resolve({ code, stdout, stderr }); - }); - }); + proc.on("close", (code) => { + resolve({ code, stdout, stderr }); + }); + }); - expect(result.code).not.toBe(0); - }); + expect(result.code).not.toBe(0); + }); }); diff --git a/packages/@postgres-language-server/wasm/e2e/monaco.test.ts b/packages/@postgres-language-server/wasm/e2e/monaco.test.ts index 0d0b3b8ad..93a3711df 100644 --- a/packages/@postgres-language-server/wasm/e2e/monaco.test.ts +++ b/packages/@postgres-language-server/wasm/e2e/monaco.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "@playwright/test"; +import { expect, test } from "@playwright/test"; /** * E2E tests for Monaco Editor with PGLS Language Server (Web Worker). diff --git a/packages/@postgres-language-server/wasm/e2e/server.ts b/packages/@postgres-language-server/wasm/e2e/server.ts index 81c1e5eb0..8364f7d24 100644 --- a/packages/@postgres-language-server/wasm/e2e/server.ts +++ b/packages/@postgres-language-server/wasm/e2e/server.ts @@ -3,8 +3,8 @@ * Serves the test HTML page and WASM files. */ -import { readFileSync, existsSync } from "node:fs"; -import { join, extname } from "node:path"; +import { existsSync, readFileSync } from "node:fs"; +import { extname, join } from "node:path"; const PORT = 3000; const ROOT = join(import.meta.dir, ".."); diff --git a/packages/@postgres-language-server/wasm/package.json b/packages/@postgres-language-server/wasm/package.json index 755f5f3f5..86b87886a 100644 --- a/packages/@postgres-language-server/wasm/package.json +++ b/packages/@postgres-language-server/wasm/package.json @@ -30,11 +30,7 @@ "test:e2e:ui": "playwright test --ui", "test:e2e:install": "playwright install chromium" }, - "files": [ - "dist/", - "wasm/", - "README.md" - ], + "files": ["dist/", "wasm/", "README.md"], "repository": { "type": "git", "url": "git+https://github.com/supabase-community/postgres-language-server.git", @@ -42,13 +38,7 @@ }, "author": "Supabase Community", "bugs": "https://github.com/supabase-community/postgres-language-server/issues", - "keywords": [ - "postgres", - "sql", - "linter", - "wasm", - "language-server" - ], + "keywords": ["postgres", "sql", "linter", "wasm", "language-server"], "license": "MIT", "publishConfig": { "provenance": true diff --git a/packages/@postgres-language-server/wasm/src/common.ts b/packages/@postgres-language-server/wasm/src/common.ts index e85337802..da9dedc6d 100644 --- a/packages/@postgres-language-server/wasm/src/common.ts +++ b/packages/@postgres-language-server/wasm/src/common.ts @@ -11,9 +11,11 @@ let wasmModule: PGLSModule | null = null; * Detect if we're running in Node.js/Bun (vs browser) */ function isNode(): boolean { - return typeof process !== 'undefined' && + return ( + typeof process !== "undefined" && process.versions != null && - (process.versions.node != null || process.versions.bun != null); + (process.versions.node != null || process.versions.bun != null) + ); } /** @@ -28,27 +30,29 @@ export async function loadWasm(): Promise { // Dynamic import of the Emscripten-generated module // @ts-expect-error - Generated JS file without type declarations - const createPGLS = (await import("../wasm/pgls.js")).default as (options?: object) => Promise; + const createPGLS = (await import("../wasm/pgls.js")).default as ( + options?: object, + ) => Promise; // Build options for Emscripten module initialization const moduleOptions: Record = {}; if (isNode()) { // In Node.js/Bun, read the WASM file directly - const { readFileSync } = await import("fs"); - const { fileURLToPath } = await import("url"); - const { dirname, join } = await import("path"); + const { readFileSync } = await import("node:fs"); + const { fileURLToPath } = await import("node:url"); + const { dirname, join } = await import("node:path"); const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); - const wasmPath = join(__dirname, '..', 'wasm', 'pgls.wasm'); + const wasmPath = join(__dirname, "..", "wasm", "pgls.wasm"); moduleOptions.wasmBinary = readFileSync(wasmPath); } else { // In browser, use locateFile to help find the .wasm file moduleOptions.locateFile = (path: string) => { - if (path.endsWith('.wasm')) { - return new URL('./pgls.wasm', import.meta.url).href; + if (path.endsWith(".wasm")) { + return new URL("./pgls.wasm", import.meta.url).href; } return path; }; @@ -80,7 +84,10 @@ export function allocateString(module: PGLSModule, str: string): number { /** * Read and free a string from WASM memory. */ -export function readAndFreeString(module: PGLSModule, ptr: number): string | null { +export function readAndFreeString( + module: PGLSModule, + ptr: number, +): string | null { if (ptr === 0) { return null; } diff --git a/packages/@postgres-language-server/wasm/src/lsp.ts b/packages/@postgres-language-server/wasm/src/lsp.ts index d71072414..7ab986054 100644 --- a/packages/@postgres-language-server/wasm/src/lsp.ts +++ b/packages/@postgres-language-server/wasm/src/lsp.ts @@ -27,9 +27,9 @@ * ``` */ -import type { PGLSModule, JsonRpcMessage } from "./types.js"; +import type { JsonRpcMessage, PGLSModule } from "./types.js"; -import { loadWasm, allocateString, readAndFreeString } from "./common.js"; +import { allocateString, loadWasm, readAndFreeString } from "./common.js"; export type { PGLSModule, JsonRpcMessage }; diff --git a/packages/@postgres-language-server/wasm/src/worker.ts b/packages/@postgres-language-server/wasm/src/worker.ts index 24a383913..e10996092 100644 --- a/packages/@postgres-language-server/wasm/src/worker.ts +++ b/packages/@postgres-language-server/wasm/src/worker.ts @@ -36,7 +36,11 @@ * ``` */ -import { createLanguageServer, type LanguageServer, type JsonRpcMessage } from "./lsp.js"; +import { + type JsonRpcMessage, + type LanguageServer, + createLanguageServer, +} from "./lsp.js"; let languageServer: LanguageServer | null = null; @@ -65,13 +69,15 @@ self.onmessage = async (event: MessageEvent) => { const message: string | JsonRpcMessage = data; // Process the message and get array of outgoing messages - const outgoing = languageServer!.handleMessage(message); + const outgoing = languageServer?.handleMessage(message); // Send EACH message separately via postMessage // This is required by BrowserMessageReader which expects // individual messages, not arrays - for (const msg of outgoing) { - self.postMessage(msg); + if (outgoing) { + for (const msg of outgoing) { + self.postMessage(msg); + } } }; @@ -79,6 +85,3 @@ self.onmessage = async (event: MessageEvent) => { initialize().then(() => { self.postMessage({ type: "ready" }); }); - -// Export for type checking (worker doesn't actually export) -export type {}; diff --git a/packages/@postgres-language-server/wasm/src/workspace.ts b/packages/@postgres-language-server/wasm/src/workspace.ts index a98801f3f..4b6e0dd9e 100644 --- a/packages/@postgres-language-server/wasm/src/workspace.ts +++ b/packages/@postgres-language-server/wasm/src/workspace.ts @@ -17,16 +17,27 @@ */ import type { - Diagnostic, CompletionItem, + Diagnostic, + PGLSModule, SchemaCache, WorkspaceOptions, - PGLSModule, } from "./types.js"; -import { loadWasm, allocateString, readAndFreeString, parseResult } from "./common.js"; +import { + allocateString, + loadWasm, + parseResult, + readAndFreeString, +} from "./common.js"; -export type { Diagnostic, CompletionItem, SchemaCache, WorkspaceOptions, PGLSModule }; +export type { + Diagnostic, + CompletionItem, + SchemaCache, + WorkspaceOptions, + PGLSModule, +}; /** * The Workspace class provides a direct API for SQL parsing, linting, @@ -167,7 +178,9 @@ export class Workspace { /** * Create a new Workspace instance. */ -export async function createWorkspace(options?: WorkspaceOptions): Promise { +export async function createWorkspace( + options?: WorkspaceOptions, +): Promise { const module = await loadWasm(); const workspace = new Workspace(module); diff --git a/packages/@postgres-language-server/wasm/tests/index.test.ts b/packages/@postgres-language-server/wasm/tests/index.test.ts index 2e915e9a4..9e6735fa8 100644 --- a/packages/@postgres-language-server/wasm/tests/index.test.ts +++ b/packages/@postgres-language-server/wasm/tests/index.test.ts @@ -2,9 +2,9 @@ * Tests for the Postgres Language Server WASM bindings. */ -import { expect, test, describe, beforeAll, beforeEach } from "bun:test"; -import { createWorkspace, Workspace } from "../src/workspace"; -import { createLanguageServer, LanguageServer } from "../src/lsp"; +import { beforeAll, beforeEach, describe, expect, test } from "bun:test"; +import { type LanguageServer, createLanguageServer } from "../src/lsp"; +import { type Workspace, createWorkspace } from "../src/workspace"; // ============================================================================= // Workspace API Tests @@ -452,7 +452,7 @@ describe("Schema-based Workspace completions and hover", () => { expect(hover).not.toBeNull(); expect(typeof hover).toBe("string"); // The hover text should mention the table - expect(hover!.toLowerCase()).toContain("users"); + expect(hover?.toLowerCase()).toContain("users"); }); test("hover on column name shows column type", () => { @@ -463,7 +463,7 @@ describe("Schema-based Workspace completions and hover", () => { expect(hover).not.toBeNull(); expect(typeof hover).toBe("string"); // The hover text should mention the type - expect(hover!.toLowerCase()).toContain("text"); + expect(hover?.toLowerCase()).toContain("text"); }); test("clearSchema removes schema and hover returns null", () => { diff --git a/packages/@postgrestools/backend-jsonrpc/src/command.ts b/packages/@postgrestools/backend-jsonrpc/src/command.ts index 881f6d7ba..94f19b721 100644 --- a/packages/@postgrestools/backend-jsonrpc/src/command.ts +++ b/packages/@postgrestools/backend-jsonrpc/src/command.ts @@ -6,69 +6,69 @@ import { execSync } from "node:child_process"; * @returns Filesystem path to the binary, or null if no prebuilt distribution exists for the current platform */ export function getCommand(): string | null { - const { platform, arch } = process; + const { platform, arch } = process; - const PLATFORMS: Partial< - Record< - NodeJS.Platform | "linux-musl", - Partial> - > - > = { - win32: { - x64: "@postgrestools/cli-x86_64-windows-msvc/postgrestools.exe", - arm64: "@postgrestools/cli-aarch64-windows-msvc/postgrestools.exe", - }, - darwin: { - x64: "@postgrestools/cli-x86_64-apple-darwin/postgrestools", - arm64: "@postgrestools/cli-aarch64-apple-darwin/postgrestools", - }, - linux: { - x64: "@postgrestools/cli-x86_64-linux-gnu/postgrestools", - arm64: "@postgrestools/cli-aarch64-linux-gnu/postgrestools", - }, - "linux-musl": { - x64: "@postgrestools/cli-x86_64-linux-musl/postgrestools", - // no arm64 build for musl - }, - }; + const PLATFORMS: Partial< + Record< + NodeJS.Platform | "linux-musl", + Partial> + > + > = { + win32: { + x64: "@postgrestools/cli-x86_64-windows-msvc/postgrestools.exe", + arm64: "@postgrestools/cli-aarch64-windows-msvc/postgrestools.exe", + }, + darwin: { + x64: "@postgrestools/cli-x86_64-apple-darwin/postgrestools", + arm64: "@postgrestools/cli-aarch64-apple-darwin/postgrestools", + }, + linux: { + x64: "@postgrestools/cli-x86_64-linux-gnu/postgrestools", + arm64: "@postgrestools/cli-aarch64-linux-gnu/postgrestools", + }, + "linux-musl": { + x64: "@postgrestools/cli-x86_64-linux-musl/postgrestools", + // no arm64 build for musl + }, + }; - function isMusl() { - let stderr = ""; - try { - stderr = execSync("ldd --version", { - stdio: [ - "ignore", // stdin - "pipe", // stdout – glibc systems print here - "pipe", // stderr – musl systems print here - ], - }).toString(); - } catch (err: unknown) { - if (hasStdErr(err)) { - stderr = err.stderr; - } - } - if (stderr.indexOf("musl") > -1) { - return true; - } - return false; - } + function isMusl() { + let stderr = ""; + try { + stderr = execSync("ldd --version", { + stdio: [ + "ignore", // stdin + "pipe", // stdout – glibc systems print here + "pipe", // stderr – musl systems print here + ], + }).toString(); + } catch (err: unknown) { + if (hasStdErr(err)) { + stderr = err.stderr; + } + } + if (stderr.indexOf("musl") > -1) { + return true; + } + return false; + } - function getPlatform(): NodeJS.Platform | "linux-musl" { - if (platform === "linux") { - return isMusl() ? "linux-musl" : "linux"; - } + function getPlatform(): NodeJS.Platform | "linux-musl" { + if (platform === "linux") { + return isMusl() ? "linux-musl" : "linux"; + } - return platform; - } + return platform; + } - const binPath = PLATFORMS?.[getPlatform()]?.[arch]; - if (!binPath) { - return null; - } + const binPath = PLATFORMS?.[getPlatform()]?.[arch]; + if (!binPath) { + return null; + } - return require.resolve(binPath); + return require.resolve(binPath); } function hasStdErr(err: unknown): err is { stderr: string } { - return !!(err as any)?.stderr; + return typeof err === "object" && err !== null && "stderr" in err; } diff --git a/packages/@postgrestools/backend-jsonrpc/src/workspace.ts b/packages/@postgrestools/backend-jsonrpc/src/workspace.ts index 8bd384ab8..2c8c55936 100644 --- a/packages/@postgrestools/backend-jsonrpc/src/workspace.ts +++ b/packages/@postgrestools/backend-jsonrpc/src/workspace.ts @@ -175,10 +175,10 @@ export type MarkupBuf = MarkupNodeBuf[]; export type Severity = "hint" | "information" | "warning" | "error" | "fatal"; export type DiagnosticTags = DiagnosticTag[]; /** - * Serializable representation of a [Diagnostic](super::Diagnostic) advice + * Serializable representation of a [Diagnostic](super::Diagnostic) advice -See the [Visitor] trait for additional documentation on all the supported advice types. - */ +See the [Visitor] trait for additional documentation on all the supported advice types. + */ export type Advice = | { log: [LogCategory, MarkupBuf] } | { list: MarkupBuf[] } @@ -285,10 +285,10 @@ export interface CompletionItem { sort_text: string; } /** - * The text that the editor should fill in. If `None`, the `label` should be used. Tables, for example, might have different completion_texts: + * The text that the editor should fill in. If `None`, the `label` should be used. Tables, for example, might have different completion_texts: -label: "users", description: "Schema: auth", completion_text: "auth.users". - */ +label: "users", description: "Schema: auth", completion_text: "auth.users". + */ export interface CompletionText { is_snippet: boolean; /** @@ -555,9 +555,9 @@ export interface PartialVcsConfiguration { */ enabled?: boolean; /** - * The folder where we should check for VCS files. By default, we will use the same folder where `postgres-language-server.jsonc` was found. + * The folder where we should check for VCS files. By default, we will use the same folder where `postgres-language-server.jsonc` was found. -If we can't find the configuration, it will attempt to use the current working directory. If no current working directory can't be found, we won't use the VCS integration, and a diagnostic will be emitted +If we can't find the configuration, it will attempt to use the current working directory. If no current working directory can't be found, we won't use the VCS integration, and a diagnostic will be emitted */ root?: string; /** @@ -1012,17 +1012,17 @@ export interface RuleWithOptions_for_SplinterRuleOptions { options: SplinterRuleOptions; } /** - * Shared options for all splinter rules. + * Shared options for all splinter rules. -These options allow configuring per-rule filtering of database objects. - */ +These options allow configuring per-rule filtering of database objects. + */ export interface SplinterRuleOptions { /** - * A list of glob patterns for database objects to ignore. + * A list of glob patterns for database objects to ignore. Patterns use Unix-style globs where: - `*` matches any sequence of characters - `?` matches any single character -Each pattern should be in the format `schema.object_name`, for example: - `"public.my_table"` - ignores a specific table - `"audit.*"` - ignores all objects in the audit schema - `"*.audit_*"` - ignores objects with audit_ prefix in any schema +Each pattern should be in the format `schema.object_name`, for example: - `"public.my_table"` - ignores a specific table - `"audit.*"` - ignores all objects in the audit schema - `"*.audit_*"` - ignores objects with audit_ prefix in any schema */ ignore?: string[]; } diff --git a/packages/@postgrestools/postgrestools/package.json b/packages/@postgrestools/postgrestools/package.json index 22450371e..df94730c3 100644 --- a/packages/@postgrestools/postgrestools/package.json +++ b/packages/@postgrestools/postgrestools/package.json @@ -1,48 +1,44 @@ { - "name": "@postgrestools/postgrestools", - "version": "", - "bin": { - "postgrestools": "bin/postgrestools" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/supabase-community/postgres-language-server.git", - "directory": "packages/@postgrestools/postgrestools" - }, - "author": "Supabase Community", - "contributors": [ - { - "name": "Philipp Steinrötter", - "url": "https://github.com/psteinroe" - }, - { - "name": "Julian Domke", - "url": "https://github.com/juleswritescode" - } - ], - "license": "MIT or Apache-2.0", - "description": "A collection of language tools and a Language Server Protocol (LSP) implementation for Postgres, focusing on developer experience and reliable SQL tooling.", - "files": [ - "bin/postgrestools", - "schema.json", - "README.md" - ], - "engines": { - "node": ">=20" - }, - "publishConfig": { - "provenance": true - }, - "optionalDependencies": { - "@postgrestools/cli-x86_64-windows-msvc": "", - "@postgrestools/cli-aarch64-windows-msvc": "", - "@postgrestools/cli-x86_64-apple-darwin": "", - "@postgrestools/cli-aarch64-apple-darwin": "", - "@postgrestools/cli-x86_64-linux-gnu": "", - "@postgrestools/cli-aarch64-linux-gnu": "", - "@postgrestools/cli-x86_64-linux-musl": "" - }, - "scripts": { - "test": "bun test" - } + "name": "@postgrestools/postgrestools", + "version": "", + "bin": { + "postgrestools": "bin/postgrestools" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/supabase-community/postgres-language-server.git", + "directory": "packages/@postgrestools/postgrestools" + }, + "author": "Supabase Community", + "contributors": [ + { + "name": "Philipp Steinrötter", + "url": "https://github.com/psteinroe" + }, + { + "name": "Julian Domke", + "url": "https://github.com/juleswritescode" + } + ], + "license": "MIT or Apache-2.0", + "description": "A collection of language tools and a Language Server Protocol (LSP) implementation for Postgres, focusing on developer experience and reliable SQL tooling.", + "files": ["bin/postgrestools", "schema.json", "README.md"], + "engines": { + "node": ">=20" + }, + "publishConfig": { + "provenance": true + }, + "optionalDependencies": { + "@postgrestools/cli-x86_64-windows-msvc": "", + "@postgrestools/cli-aarch64-windows-msvc": "", + "@postgrestools/cli-x86_64-apple-darwin": "", + "@postgrestools/cli-aarch64-apple-darwin": "", + "@postgrestools/cli-x86_64-linux-gnu": "", + "@postgrestools/cli-aarch64-linux-gnu": "", + "@postgrestools/cli-x86_64-linux-musl": "" + }, + "scripts": { + "test": "bun test" + } } diff --git a/packages/@postgrestools/postgrestools/scripts/generate-packages.mjs b/packages/@postgrestools/postgrestools/scripts/generate-packages.mjs index e89733c54..004206e29 100644 --- a/packages/@postgrestools/postgrestools/scripts/generate-packages.mjs +++ b/packages/@postgrestools/postgrestools/scripts/generate-packages.mjs @@ -1,7 +1,7 @@ import assert from "node:assert"; import * as fs from "node:fs"; -import { pipeline } from "node:stream"; import { resolve } from "node:path"; +import { pipeline } from "node:stream"; import { fileURLToPath } from "node:url"; import { promisify } from "node:util"; const streamPipeline = promisify(pipeline); @@ -54,7 +54,7 @@ async function downloadSchema(releaseTag, githubToken) { // download to root. const fileStream = fs.createWriteStream( - resolve(POSTGRESTOOLS_ROOT, "schema.json") + resolve(POSTGRESTOOLS_ROOT, "schema.json"), ); await streamPipeline(response.body, fileStream); @@ -78,14 +78,12 @@ async function downloadBinary(platform, arch, os, releaseTag, githubToken) { if (!response.ok) { const error = await response.text(); throw new Error( - `Failed to Fetch Asset from ${assetUrl} (Reason: ${error})` + `Failed to Fetch Asset from ${assetUrl} (Reason: ${error})`, ); } // just download to root. - const fileStream = fs.createWriteStream( - getBinarySource(platform, arch, os) - ); + const fileStream = fs.createWriteStream(getBinarySource(platform, arch, os)); await streamPipeline(response.body, fileStream); @@ -96,15 +94,15 @@ async function writeManifest(packagePath, version) { const manifestPath = resolve( PACKAGES_POSTGRESTOOLS_ROOT, packagePath, - "package.json" + "package.json", ); const manifestData = JSON.parse( - fs.readFileSync(manifestPath).toString("utf-8") + fs.readFileSync(manifestPath).toString("utf-8"), ); const nativePackages = platformArchCombinations().map( - ({ platform, arch }) => [getPackageName(platform, arch), version] + ({ platform, arch }) => [getPackageName(platform, arch), version], ); manifestData.version = version; @@ -179,7 +177,7 @@ function copyBinaryToNativePackage(platform, arch, os) { libc, }, null, - 2 + 2, ); const ext = getBinaryExt(os); @@ -193,7 +191,7 @@ function copyBinaryToNativePackage(platform, arch, os) { if (!fs.existsSync(binarySource)) { console.error( - `Source for binary for ${buildName} not found at: ${binarySource}` + `Source for binary for ${buildName} not found at: ${binarySource}`, ); process.exit(1); } @@ -231,10 +229,10 @@ function copyReadmeToPackage(packagePath) { } console.info(`Copying README.md to ${packagePath}`); - + // Read the original README content - const originalReadme = fs.readFileSync(readmeSrc, 'utf-8'); - + const originalReadme = fs.readFileSync(readmeSrc, "utf-8"); + // Add deprecation notice for @postgrestools packages const deprecationNotice = `> [!WARNING] > **This package is deprecated.** Please use [\`@postgres-language-server/cli\`](https://www.npmjs.com/package/@postgres-language-server/cli) instead. @@ -244,8 +242,8 @@ function copyReadmeToPackage(packagePath) { `; const modifiedReadme = deprecationNotice + originalReadme; - - fs.writeFileSync(readmeTarget, modifiedReadme, 'utf-8'); + + fs.writeFileSync(readmeTarget, modifiedReadme, "utf-8"); fs.chmodSync(readmeTarget, 0o666); } diff --git a/packages/@postgrestools/postgrestools/test/bin.test.js b/packages/@postgrestools/postgrestools/test/bin.test.js index 9b85042e5..23335a0f8 100644 --- a/packages/@postgrestools/postgrestools/test/bin.test.js +++ b/packages/@postgrestools/postgrestools/test/bin.test.js @@ -1,62 +1,61 @@ -import { describe, it, expect } from "bun:test"; -import { spawn } from "child_process"; -import { join, dirname } from "path"; -import { fileURLToPath } from "url"; +import { describe, expect, it } from "bun:test"; +import { spawn } from "node:child_process"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; const __dirname = dirname(fileURLToPath(import.meta.url)); const binPath = join(__dirname, "../bin/postgrestools"); const testSqlPath = join(__dirname, "test.sql"); describe("postgrestools bin", () => { - - it("should check a SQL file successfully", async () => { - const result = await new Promise((resolve) => { - const proc = spawn("node", [binPath, "check", testSqlPath], { - env: { ...process.env }, - }); - - let stdout = ""; - let stderr = ""; - - proc.stdout.on("data", (data) => { - stdout += data.toString(); - }); - - proc.stderr.on("data", (data) => { - stderr += data.toString(); - }); - - proc.on("close", (code) => { - resolve({ code, stdout, stderr }); - }); - }); - - expect(result.code).toBe(0); - expect(result.stderr).toBe(""); - }); - - it("should fail when file doesn't exist", async () => { - const result = await new Promise((resolve) => { - const proc = spawn("node", [binPath, "check", "nonexistent.sql"], { - env: { ...process.env }, - }); - - let stdout = ""; - let stderr = ""; - - proc.stdout.on("data", (data) => { - stdout += data.toString(); - }); - - proc.stderr.on("data", (data) => { - stderr += data.toString(); - }); - - proc.on("close", (code) => { - resolve({ code, stdout, stderr }); - }); - }); - - expect(result.code).not.toBe(0); - }); + it("should check a SQL file successfully", async () => { + const result = await new Promise((resolve) => { + const proc = spawn("node", [binPath, "check", testSqlPath], { + env: { ...process.env }, + }); + + let stdout = ""; + let stderr = ""; + + proc.stdout.on("data", (data) => { + stdout += data.toString(); + }); + + proc.stderr.on("data", (data) => { + stderr += data.toString(); + }); + + proc.on("close", (code) => { + resolve({ code, stdout, stderr }); + }); + }); + + expect(result.code).toBe(0); + expect(result.stderr).toBe(""); + }); + + it("should fail when file doesn't exist", async () => { + const result = await new Promise((resolve) => { + const proc = spawn("node", [binPath, "check", "nonexistent.sql"], { + env: { ...process.env }, + }); + + let stdout = ""; + let stderr = ""; + + proc.stdout.on("data", (data) => { + stdout += data.toString(); + }); + + proc.stderr.on("data", (data) => { + stderr += data.toString(); + }); + + proc.on("close", (code) => { + resolve({ code, stdout, stderr }); + }); + }); + + expect(result.code).not.toBe(0); + }); }); diff --git a/xtask/codegen/Cargo.toml b/xtask/codegen/Cargo.toml index 24898d319..cee4fbe64 100644 --- a/xtask/codegen/Cargo.toml +++ b/xtask/codegen/Cargo.toml @@ -5,22 +5,18 @@ publish = false version = "0.0.0" [dependencies] -anyhow = { workspace = true } -biome_js_factory = { workspace = true } -biome_js_formatter = { workspace = true } -biome_js_syntax = { workspace = true } -biome_rowan = { workspace = true } -biome_string_case = { workspace = true } -bpaf = { workspace = true, features = ["derive"] } -pgls_analyse = { workspace = true } -pgls_analyser = { workspace = true } -pgls_diagnostics = { workspace = true } -pgls_env = { workspace = true } -pgls_pglinter = { workspace = true } -pgls_splinter = { workspace = true } -pgls_workspace = { workspace = true, features = ["schema"] } -proc-macro2 = { workspace = true, features = ["span-locations"] } -pulldown-cmark = { version = "0.12.2" } -quote = "1.0.36" -regex = "1.11" -xtask = { path = '../', version = "0.0" } +anyhow = { workspace = true } +bpaf = { workspace = true, features = ["derive"] } +convert_case = { workspace = true } +pgls_analyse = { workspace = true } +pgls_analyser = { workspace = true } +pgls_diagnostics = { workspace = true } +pgls_env = { workspace = true } +pgls_pglinter = { workspace = true } +pgls_splinter = { workspace = true } +pgls_workspace = { workspace = true, features = ["schema"] } +proc-macro2 = { workspace = true, features = ["span-locations"] } +pulldown-cmark = { version = "0.12.2" } +quote = "1.0.36" +regex = "1.11" +xtask = { path = '../', version = "0.0" } diff --git a/xtask/codegen/src/generate_analyser.rs b/xtask/codegen/src/generate_analyser.rs index 8698795fb..6c79b782f 100644 --- a/xtask/codegen/src/generate_analyser.rs +++ b/xtask/codegen/src/generate_analyser.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; use std::{collections::BTreeMap, path::Path}; use anyhow::{Context, Ok, Result}; -use biome_string_case::Case; +use convert_case::{Case, Casing}; use proc_macro2::TokenStream; use quote::{format_ident, quote}; use xtask::{glue::fs2, project_root}; @@ -36,7 +36,7 @@ fn generate_options(base_path: &Path) -> Result<()> { let group_name = format_ident!("{}", filename(&group_path)?.to_string()); for rule_path in list_entry_paths(&group_path)?.filter(|path| !path.is_dir()) { let rule_filename = filename(&rule_path)?; - let rule_name = Case::Pascal.convert(rule_filename); + let rule_name = rule_filename.to_case(Case::Pascal); let rule_module_name = format_ident!("{}", rule_filename); let rule_name = format_ident!("{}", rule_name); rules_options.insert(rule_filename.to_string(), quote! { @@ -86,7 +86,7 @@ fn generate_category( generate_group(name, file_name, all_rules, base_path)?; let module_name = format_ident!("{}", file_name); - let group_name = format_ident!("{}", Case::Pascal.convert(file_name)); + let group_name = format_ident!("{}", file_name.to_case(Case::Pascal)); groups.insert( file_name.to_string(), @@ -104,7 +104,7 @@ fn generate_category( let key = name; let module_name = format_ident!("{name}"); - let category_name = Case::Pascal.convert(name); + let category_name = name.to_case(Case::Pascal); let category_name = format_ident!("{category_name}"); let kind = match name { @@ -154,7 +154,7 @@ fn generate_group( .to_str() .context("could not convert file name to string")?; - let rule_type = Case::Pascal.convert(file_name); + let rule_type = file_name.to_case(Case::Pascal); let key = rule_type.clone(); let module_name = format_ident!("{}", file_name); @@ -165,7 +165,7 @@ fn generate_group( let category_ident = format_ident!("{}", category); let group_module_ident = format_ident!("{}", group); // Module name (lowercase) all_rules.insert( - Case::Camel.convert(&key), + key.to_case(Case::Camel), ( quote! { crate::#category_ident::#group_module_ident::#module_name::#rule_type_ident @@ -187,7 +187,7 @@ fn generate_group( ); } - let group_name = format_ident!("{}", Case::Pascal.convert(group)); + let group_name = format_ident!("{}", group.to_case(Case::Pascal)); let (rule_imports, rule_names): (Vec<_>, Vec<_>) = rules.into_values().unzip(); diff --git a/xtask/codegen/src/generate_bindings.rs b/xtask/codegen/src/generate_bindings.rs index bfd9e526c..6caf3dd81 100644 --- a/xtask/codegen/src/generate_bindings.rs +++ b/xtask/codegen/src/generate_bindings.rs @@ -1,15 +1,5 @@ use crate::update; -use biome_js_factory::make; -use biome_js_formatter::{context::JsFormatOptions, format_node}; -use biome_js_syntax::{ - AnyJsBinding, AnyJsBindingPattern, AnyJsCallArgument, AnyJsDeclaration, AnyJsDeclarationClause, - AnyJsExportClause, AnyJsExpression, AnyJsFormalParameter, AnyJsImportClause, - AnyJsLiteralExpression, AnyJsModuleItem, AnyJsName, AnyJsNamedImportSpecifier, - AnyJsObjectMember, AnyJsObjectMemberName, AnyJsParameter, AnyJsStatement, AnyTsName, - AnyTsReturnType, AnyTsType, AnyTsTypeMember, JsFileSource, TriviaPieceKind, T, -}; -use biome_rowan::AstNode; -use biome_string_case::Case; +use convert_case::{Case, Casing}; use pgls_workspace::workspace_types::{generate_type, methods, ModuleQueue}; use xtask::{project_root, Mode, Result}; @@ -20,420 +10,68 @@ pub fn generate_bindings(mode: Mode) -> Result<()> { project_root().join("packages/@postgres-language-server/backend-jsonrpc/src/workspace.ts"); let methods = methods(); - let mut declarations = Vec::new(); - let mut member_definitions = Vec::with_capacity(methods.len()); - let mut member_declarations = Vec::with_capacity(methods.len()); + let mut declarations: Vec<(String, Option<&String>)> = Vec::new(); + let mut workspace_members = Vec::new(); + let mut impl_members = Vec::new(); let mut queue = ModuleQueue::default(); for method in &methods { let params = generate_type(&mut declarations, &mut queue, &method.params); let result = generate_type(&mut declarations, &mut queue, &method.result); - let camel_case = Case::Camel.convert(method.name); + let camel_case = method.name.to_case(Case::Camel); - member_definitions.push(AnyTsTypeMember::TsMethodSignatureTypeMember( - make::ts_method_signature_type_member( - AnyJsObjectMemberName::JsLiteralMemberName(make::js_literal_member_name( - make::ident(&camel_case), - )), - make::js_parameters( - make::token(T!['(']), - make::js_parameter_list( - Some(AnyJsParameter::AnyJsFormalParameter( - AnyJsFormalParameter::JsFormalParameter( - make::js_formal_parameter( - make::js_decorator_list([]), - AnyJsBindingPattern::AnyJsBinding( - AnyJsBinding::JsIdentifierBinding( - make::js_identifier_binding(make::ident("params")), - ), - ), - ) - .with_type_annotation(make::ts_type_annotation( - make::token(T![:]), - params, - )) - .build(), - ), - )), - None, - ), - make::token(T![')']), - ), - ) - .with_return_type_annotation(make::ts_return_type_annotation( - make::token(T![:]), - AnyTsReturnType::AnyTsType(AnyTsType::TsReferenceType( - make::ts_reference_type(AnyTsName::JsReferenceIdentifier( - make::js_reference_identifier(make::ident("Promise")), - )) - .with_type_arguments(make::ts_type_arguments( - make::token(T![<]), - make::ts_type_argument_list(Some(result), None), - make::token(T![>]), - )) - .build(), - )), - )) - .build(), + // Workspace interface method signature + workspace_members.push(format!( + "\t{camel_case}(params: {params}): Promise<{result}>;" )); - member_declarations.push(AnyJsObjectMember::JsMethodObjectMember( - make::js_method_object_member( - AnyJsObjectMemberName::JsLiteralMemberName(make::js_literal_member_name( - make::ident(&camel_case), - )), - make::js_parameters( - make::token(T!['(']), - make::js_parameter_list( - Some(AnyJsParameter::AnyJsFormalParameter( - AnyJsFormalParameter::JsFormalParameter( - make::js_formal_parameter(make::js_decorator_list([]),AnyJsBindingPattern::AnyJsBinding( - AnyJsBinding::JsIdentifierBinding(make::js_identifier_binding( - make::ident("params"), - )), - )) - .build(), - ), - )), - None, - ), - make::token(T![')']), - ), - make::js_function_body( - make::token(T!['{']), - make::js_directive_list(None), - make::js_statement_list(Some(AnyJsStatement::JsReturnStatement( - make::js_return_statement(make::token(T![return])) - .with_argument(AnyJsExpression::JsCallExpression( - make::js_call_expression( - AnyJsExpression::JsStaticMemberExpression( - make::js_static_member_expression( - AnyJsExpression::JsIdentifierExpression( - make::js_identifier_expression( - make::js_reference_identifier(make::ident( - "transport", - )), - ), - ), - make::token(T![.]), - AnyJsName::JsName(make::js_name(make::ident( - "request", - ))), - ), - ), - make::js_call_arguments( - make::token(T!['(']), - make::js_call_argument_list( - [ - AnyJsCallArgument::AnyJsExpression( - AnyJsExpression::AnyJsLiteralExpression( - AnyJsLiteralExpression::JsStringLiteralExpression(make::js_string_literal_expression(make::js_string_literal(&format!("pgls/{}", method.name)))), - ), - ), - AnyJsCallArgument::AnyJsExpression( - AnyJsExpression::JsIdentifierExpression( - make::js_identifier_expression( - make::js_reference_identifier(make::ident( - "params", - )), - ), - ), - ), - ], - Some(make::token(T![,])), - ), - make::token(T![')']), - ), - ) - .build(), - )) - .build(), - ))), - make::token(T!['}']), - ), - ) - .build(), + // createWorkspace implementation method + impl_members.push(format!( + "\t\t{camel_case}(params) {{\n\t\t\treturn transport.request(\"pgls/{}\", params);\n\t\t}}", + method.name )); } - let leading_comment = [ - ( - TriviaPieceKind::SingleLineComment, - "// Generated file, do not edit by hand, see `xtask/codegen`", - ), - (TriviaPieceKind::Newline, "\n"), - ]; + // Build the full output + let mut output = String::new(); - let mut items = vec![AnyJsModuleItem::JsImport( - make::js_import( - make::token(T![import]).with_leading_trivia(leading_comment.into_iter()), - AnyJsImportClause::JsImportNamedClause( - make::js_import_named_clause( - make::js_named_import_specifiers( - make::token(T!['{']), - make::js_named_import_specifier_list( - Some(AnyJsNamedImportSpecifier::JsShorthandNamedImportSpecifier( - make::js_shorthand_named_import_specifier( - AnyJsBinding::JsIdentifierBinding(make::js_identifier_binding( - make::ident("Transport"), - )), - ) - .build(), - )), - None, - ), - make::token(T!['}']), - ), - make::token(T![from]), - make::js_module_source(make::js_string_literal("./transport")), - ) - .with_type_token(make::token(T![type])) - .build(), - ), - ) - .build(), - )]; + // Header + output.push_str("// Generated file, do not edit by hand, see `xtask/codegen`\n"); + output.push_str("import type { Transport } from \"./transport\";\n"); - items.extend(declarations.into_iter().map(|(decl, description)| { - let mut export = make::token(T![export]); + // Type declarations + for (decl, description) in &declarations { if let Some(description) = description { - let comment = format!("/**\n\t* {description} \n\t */\n"); - let trivia = vec![ - (TriviaPieceKind::Newline, "\n"), - (TriviaPieceKind::MultiLineComment, comment.as_str()), - (TriviaPieceKind::Newline, "\n"), - ]; - export = export.with_leading_trivia(trivia); + output.push_str(&format!("/**\n * {description}\n */\n")); } - AnyJsModuleItem::JsExport(make::js_export( - make::js_decorator_list([]), - export, - AnyJsExportClause::AnyJsDeclarationClause(match decl { - AnyJsDeclaration::JsClassDeclaration(decl) => { - AnyJsDeclarationClause::JsClassDeclaration(decl) - } - AnyJsDeclaration::JsFunctionDeclaration(decl) => { - AnyJsDeclarationClause::JsFunctionDeclaration(decl) - } - AnyJsDeclaration::JsVariableDeclaration(decl) => { - AnyJsDeclarationClause::JsVariableDeclarationClause( - make::js_variable_declaration_clause(decl).build(), - ) - } - AnyJsDeclaration::TsDeclareFunctionDeclaration(decl) => { - AnyJsDeclarationClause::TsDeclareFunctionDeclaration(decl) - } - AnyJsDeclaration::TsEnumDeclaration(decl) => { - AnyJsDeclarationClause::TsEnumDeclaration(decl) - } - AnyJsDeclaration::TsExternalModuleDeclaration(decl) => { - AnyJsDeclarationClause::TsExternalModuleDeclaration(decl) - } - AnyJsDeclaration::TsGlobalDeclaration(decl) => { - AnyJsDeclarationClause::TsGlobalDeclaration(decl) - } - AnyJsDeclaration::TsImportEqualsDeclaration(decl) => { - AnyJsDeclarationClause::TsImportEqualsDeclaration(decl) - } - AnyJsDeclaration::TsInterfaceDeclaration(decl) => { - AnyJsDeclarationClause::TsInterfaceDeclaration(decl) - } - AnyJsDeclaration::TsModuleDeclaration(decl) => { - AnyJsDeclarationClause::TsModuleDeclaration(decl) - } - AnyJsDeclaration::TsTypeAliasDeclaration(decl) => { - AnyJsDeclarationClause::TsTypeAliasDeclaration(decl) - } - }), - )) - })); - - member_definitions.push(AnyTsTypeMember::TsMethodSignatureTypeMember( - make::ts_method_signature_type_member( - AnyJsObjectMemberName::JsLiteralMemberName(make::js_literal_member_name(make::ident( - "destroy", - ))), - make::js_parameters( - make::token(T!['(']), - make::js_parameter_list(None, None), - make::token(T![')']), - ), - ) - .with_return_type_annotation(make::ts_return_type_annotation( - make::token(T![:]), - AnyTsReturnType::AnyTsType(AnyTsType::TsVoidType(make::ts_void_type(make::token(T![ - void - ])))), - )) - .build(), - )); - - member_declarations.push(AnyJsObjectMember::JsMethodObjectMember( - make::js_method_object_member( - AnyJsObjectMemberName::JsLiteralMemberName(make::js_literal_member_name(make::ident( - "destroy", - ))), - make::js_parameters( - make::token(T!['(']), - make::js_parameter_list(None, None), - make::token(T![')']), - ), - make::js_function_body( - make::token(T!['{']), - make::js_directive_list(None), - make::js_statement_list(Some(AnyJsStatement::JsExpressionStatement( - make::js_expression_statement(AnyJsExpression::JsCallExpression( - make::js_call_expression( - AnyJsExpression::JsStaticMemberExpression( - make::js_static_member_expression( - AnyJsExpression::JsIdentifierExpression( - make::js_identifier_expression( - make::js_reference_identifier(make::ident("transport")), - ), - ), - make::token(T![.]), - AnyJsName::JsName(make::js_name(make::ident("destroy"))), - ), - ), - make::js_call_arguments( - make::token(T!['(']), - make::js_call_argument_list(None, None), - make::token(T![')']), - ), - ) - .build(), - )) - .build(), - ))), - make::token(T!['}']), - ), - ) - .build(), - )); - - // Export `PartialConfiguration` as `Configuration` for backwards compatibility. - items.push(AnyJsModuleItem::JsExport(make::js_export( - make::js_decorator_list([]), - make::token(T![export]), - AnyJsExportClause::AnyJsDeclarationClause(AnyJsDeclarationClause::TsTypeAliasDeclaration( - make::ts_type_alias_declaration( - make::token(T![type]), - make::ts_identifier_binding(make::ident("Configuration")), - make::token(T![=]), - AnyTsType::TsReferenceType( - make::ts_reference_type(AnyTsName::JsReferenceIdentifier( - make::js_reference_identifier(make::ident("PartialConfiguration")), - )) - .build(), - ), - ) - .build(), - )), - ))); - - items.push(AnyJsModuleItem::JsExport(make::js_export( - make::js_decorator_list([]), - make::token(T![export]), - AnyJsExportClause::AnyJsDeclarationClause(AnyJsDeclarationClause::TsInterfaceDeclaration( - make::ts_interface_declaration( - make::token(T![interface]), - make::ts_identifier_binding(make::ident("Workspace")), - make::token(T!['{']), - make::ts_type_member_list(member_definitions), - make::token(T!['}']), - ) - .build(), - )), - ))); - - let member_separators = (0..member_declarations.len()).map(|_| make::token(T![,])); + output.push_str(&format!("export {decl}\n")); + } - items.push(AnyJsModuleItem::JsExport(make::js_export( - make::js_decorator_list([]), - make::token(T![export]), - AnyJsExportClause::AnyJsDeclarationClause(AnyJsDeclarationClause::JsFunctionDeclaration( - make::js_function_declaration( - make::token(T![function]), - AnyJsBinding::JsIdentifierBinding(make::js_identifier_binding(make::ident( - "createWorkspace", - ))), - make::js_parameters( - make::token(T!['(']), - make::js_parameter_list( - Some(AnyJsParameter::AnyJsFormalParameter( - AnyJsFormalParameter::JsFormalParameter( - make::js_formal_parameter( - make::js_decorator_list([]), - AnyJsBindingPattern::AnyJsBinding( - AnyJsBinding::JsIdentifierBinding( - make::js_identifier_binding(make::ident("transport")), - ), - ), - ) - .with_type_annotation(make::ts_type_annotation( - make::token(T![:]), - AnyTsType::TsReferenceType( - make::ts_reference_type(AnyTsName::JsReferenceIdentifier( - make::js_reference_identifier(make::ident("Transport")), - )) - .build(), - ), - )) - .build(), - ), - )), - None, - ), - make::token(T![')']), - ), - make::js_function_body( - make::token(T!['{']), - make::js_directive_list(None), - make::js_statement_list(Some(AnyJsStatement::JsReturnStatement( - make::js_return_statement(make::token(T![return])) - .with_argument(AnyJsExpression::JsObjectExpression( - make::js_object_expression( - make::token(T!['{']), - make::js_object_member_list( - member_declarations, - member_separators, - ), - make::token(T!['}']), - ), - )) - .build(), - ))), - make::token(T!['}']), - ), - ) - .with_return_type_annotation(make::ts_return_type_annotation( - make::token(T![:]), - AnyTsReturnType::AnyTsType(AnyTsType::TsReferenceType( - make::ts_reference_type(AnyTsName::JsReferenceIdentifier( - make::js_reference_identifier(make::ident("Workspace")), - )) - .build(), - )), - )) - .build(), - )), - ))); + // Configuration type alias + output.push_str("export type Configuration = PartialConfiguration;\n"); - let module = make::js_module( - make::js_directive_list(None), - make::js_module_item_list(items), - make::eof(), - ) - .build(); + // Workspace interface + workspace_members.push("\tdestroy(): void;".to_string()); + output.push_str("export interface Workspace {\n"); + for member in &workspace_members { + output.push_str(member); + output.push('\n'); + } + output.push_str("}\n"); - let formatted = format_node(JsFormatOptions::new(JsFileSource::ts()), module.syntax()).unwrap(); - let printed = formatted.print().unwrap(); - let code = printed.into_code(); + // createWorkspace function + impl_members.push("\t\tdestroy() {\n\t\t\ttransport.destroy();\n\t\t}".to_string()); + output.push_str("export function createWorkspace(transport: Transport): Workspace {\n"); + output.push_str("\treturn {\n"); + output.push_str(&impl_members.join(",\n")); + output.push_str(",\n"); + output.push_str("\t};\n"); + output.push_str("}\n"); // Generate for both packages (dual publishing) - update(&bindings_path_postgrestools, &code, &mode)?; - update(&bindings_path_postgres_language_server, &code, &mode)?; + update(&bindings_path_postgrestools, &output, &mode)?; + update(&bindings_path_postgres_language_server, &output, &mode)?; Ok(()) } diff --git a/xtask/codegen/src/generate_configuration.rs b/xtask/codegen/src/generate_configuration.rs index ad5b21159..e8c00b1a3 100644 --- a/xtask/codegen/src/generate_configuration.rs +++ b/xtask/codegen/src/generate_configuration.rs @@ -1,5 +1,5 @@ -use crate::{to_capitalized, update}; -use biome_string_case::Case; +use crate::{to_capitalized, to_snake_case, update}; +use convert_case::{Case, Casing}; use pgls_analyse::{ GroupCategory, RegistryVisitor, RuleCategory, RuleGroup, RuleMeta, RuleMetadata, }; @@ -216,7 +216,7 @@ fn generate_lint_mod_file(tool: &ToolConfig) -> String { }; let string_set_import = if handles_files || tool.name == "splinter" { - quote! { use biome_deserialize::StringSet; } + quote! { use crate::StringSet; } } else { quote! {} }; @@ -271,7 +271,7 @@ fn generate_lint_mod_file(tool: &ToolConfig) -> String { mod #generated_file_ident; #string_set_import - use biome_deserialize_macros::{Merge, Partial}; + use pgls_configuration_macros::{Merge, Partial}; use bpaf::Bpaf; pub use #generated_file_ident::*; use serde::{Deserialize, Serialize}; @@ -340,7 +340,7 @@ fn generate_lint_rules_file( let mut group_as_disabled_rules = Vec::with_capacity(groups.len()); for (group, rules) in groups { - let group_pascal_ident = quote::format_ident!("{}", &Case::Pascal.convert(group)); + let group_pascal_ident = quote::format_ident!("{}", &group.to_case(Case::Pascal)); let group_ident = quote::format_ident!("{}", group); let (global_all, global_recommended) = { @@ -415,7 +415,7 @@ fn generate_lint_rules_file( //! Generated file, do not edit by hand, see `xtask/codegen` use crate::rules::{RuleConfiguration, RulePlainConfiguration}; - use biome_deserialize_macros::Merge; + use pgls_configuration_macros::Merge; use pgls_analyse::RuleFilter; use pgls_analyser::RuleOptions; use pgls_diagnostics::{Category, Severity}; @@ -608,7 +608,7 @@ fn generate_lint_group_struct( for (index, (rule, metadata)) in rules.iter().enumerate() { let summary = extract_summary_from_docs(metadata.docs); let rule_position = Literal::u8_unsuffixed(index as u8); - let rule_identifier = quote::format_ident!("{}", Case::Snake.convert(rule)); + let rule_identifier = quote::format_ident!("{}", to_snake_case(rule)); let rule_name = Ident::new(&to_capitalized(rule), Span::call_site()); if metadata.recommended { @@ -898,14 +898,14 @@ fn generate_action_mod_file(tool: &ToolConfig) -> String { mod #generated_file_ident; - use biome_deserialize::StringSet; - use biome_deserialize_macros::{Deserializable, Merge, Partial}; + use crate::StringSet; + use pgls_configuration_macros::{Merge, Partial}; use bpaf::Bpaf; pub use #generated_file_ident::*; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Deserialize, Eq, Partial, PartialEq, Serialize)] - #[partial(derive(Bpaf, Clone, Deserializable, Eq, Merge, PartialEq))] + #[partial(derive(Bpaf, Clone, Eq, Merge, PartialEq))] #[partial(cfg_attr(feature = "schema", derive(schemars::JsonSchema)))] #[partial(serde(deny_unknown_fields, rename_all = "camelCase"))] pub struct #config_struct { @@ -965,7 +965,7 @@ fn generate_action_actions_file( let mut group_as_enabled_rules = Vec::with_capacity(groups.len()); for (group, rules) in groups { - let group_pascal_ident = quote::format_ident!("{}", &Case::Pascal.convert(group)); + let group_pascal_ident = quote::format_ident!("{}", &group.to_case(Case::Pascal)); let group_ident = quote::format_ident!("{}", group); group_as_enabled_rules.push(quote! { @@ -984,7 +984,7 @@ fn generate_action_actions_file( //! Generated file, do not edit by hand, see `xtask/codegen` use crate::rules::{RuleAssistConfiguration, RuleAssistPlainConfiguration}; - use biome_deserialize_macros::{Deserializable, Merge}; + use pgls_configuration_macros::Merge; use pgls_analyse::RuleFilter; use pgls_analyser::RuleOptions; use pgls_diagnostics::{Category, Severity}; @@ -997,7 +997,6 @@ fn generate_action_actions_file( Clone, Copy, Debug, - Deserializable, Eq, Hash, Merge, @@ -1031,12 +1030,11 @@ fn generate_action_actions_file( } } - #[derive(Clone, Debug, Default, Deserialize, Deserializable, Eq, Merge, PartialEq, Serialize)] + #[derive(Clone, Debug, Default, Deserialize, Eq, Merge, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Actions { #( - #[deserializable(rename = #group_strings)] #[serde(skip_serializing_if = "Option::is_none")] pub #group_idents: Option<#group_pascal_idents>, )* @@ -1121,7 +1119,7 @@ fn generate_action_group_struct( for (index, (rule, metadata)) in rules.iter().enumerate() { let summary = extract_summary_from_docs(metadata.docs); let rule_position = Literal::u8_unsuffixed(index as u8); - let rule_identifier = quote::format_ident!("{}", Case::Snake.convert(rule)); + let rule_identifier = quote::format_ident!("{}", to_snake_case(rule)); let rule_name = Ident::new(&to_capitalized(rule), Span::call_site()); lines_rule.push(quote! { @@ -1158,7 +1156,7 @@ fn generate_action_group_struct( let group_pascal_ident = Ident::new(&to_capitalized(group), Span::call_site()); quote! { - #[derive(Clone, Debug, Default, Deserialize, Deserializable, Eq, Merge, PartialEq, Serialize)] + #[derive(Clone, Debug, Default, Deserialize, Eq, Merge, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", default, deny_unknown_fields)] /// A list of rules that belong to this group diff --git a/xtask/codegen/src/generate_new_analyser_rule.rs b/xtask/codegen/src/generate_new_analyser_rule.rs index 7e7d7b04e..63164f7e7 100644 --- a/xtask/codegen/src/generate_new_analyser_rule.rs +++ b/xtask/codegen/src/generate_new_analyser_rule.rs @@ -1,5 +1,5 @@ -use biome_string_case::Case; use bpaf::Bpaf; +use convert_case::{Case, Casing}; use pgls_diagnostics::Severity; use pgls_env::PGLS_WEBSITE; use std::str::FromStr; @@ -96,7 +96,7 @@ pub fn generate_new_analyser_rule( group: &str, severity: Severity, ) { - let rule_name_camel = Case::Camel.convert(rule_name); + let rule_name_camel = rule_name.to_case(Case::Camel); let crate_folder = project_root().join("crates/pgls_analyser"); let rule_folder = match &category { Category::Lint => crate_folder.join(format!("src/lint/{group}")), @@ -108,14 +108,14 @@ pub fn generate_new_analyser_rule( // Generate rule code let code = generate_rule_template( &category, - Case::Pascal.convert(rule_name).as_str(), + rule_name.to_case(Case::Pascal).as_str(), rule_name_camel.as_str(), severity, ); let file_name = format!( "{}/{}.rs", rule_folder.display(), - Case::Snake.convert(rule_name) + crate::to_snake_case(rule_name) ); std::fs::write(file_name.clone(), code).unwrap_or_else(|_| panic!("To write {}", &file_name)); @@ -123,7 +123,7 @@ pub fn generate_new_analyser_rule( let mut categories = std::fs::read_to_string(categories_path).unwrap(); if !categories.contains(&rule_name_camel) { - let kebab_case_rule = Case::Kebab.convert(&rule_name_camel); + let kebab_case_rule = rule_name_camel.to_case(Case::Kebab); // We sort rules to reduce conflicts between contributions made in parallel. let rule_line = match category { Category::Lint => format!( diff --git a/xtask/codegen/src/generate_pglinter.rs b/xtask/codegen/src/generate_pglinter.rs index a0880e617..b4f91c3a1 100644 --- a/xtask/codegen/src/generate_pglinter.rs +++ b/xtask/codegen/src/generate_pglinter.rs @@ -1,5 +1,6 @@ +use crate::to_snake_case; use anyhow::{Context, Result}; -use biome_string_case::Case; +use convert_case::{Case, Casing}; use quote::{format_ident, quote}; use regex::Regex; use std::collections::BTreeMap; @@ -88,7 +89,7 @@ fn parse_rules_sql(content: &str) -> Result> // Parse fixes array let fixes: Vec = parse_fixes_array(fixes_str); - let snake_name = Case::Snake.convert(&name); + let snake_name = to_snake_case(&name); let camel_name = to_camel_case(&name); let meta = PglinterRuleMeta { @@ -342,7 +343,7 @@ fn generate_category_mod( ) -> Result<()> { let mod_file = category_dir.join("mod.rs"); - let category_title = Case::Pascal.convert(category); + let category_title = category.to_case(Case::Pascal); let category_struct = format_ident!("{}", category_title); // Generate mod declarations @@ -402,7 +403,7 @@ fn generate_rules_mod( .keys() .map(|cat| { let mod_name = format_ident!("{}", cat); - let group_name = format_ident!("{}", Case::Pascal.convert(cat)); + let group_name = format_ident!("{}", cat.to_case(Case::Pascal)); quote! { self::#mod_name::#group_name } }) .collect(); @@ -612,7 +613,7 @@ fn update_categories_file(rules: &BTreeMap) -> Result< current_category = category.clone(); all_entries.push(format!( " // {} rules ({}-series)", - Case::Pascal.convert(category), + category.to_case(Case::Pascal), match category.as_str() { "base" => "B", "schema" => "S", diff --git a/xtask/codegen/src/generate_splinter.rs b/xtask/codegen/src/generate_splinter.rs index 65cb0d0e1..00e36c860 100644 --- a/xtask/codegen/src/generate_splinter.rs +++ b/xtask/codegen/src/generate_splinter.rs @@ -1,5 +1,5 @@ use anyhow::{Context, Result}; -use biome_string_case::Case; +use convert_case::{Case, Casing}; use quote::{format_ident, quote}; use std::collections::BTreeMap; use std::fs; @@ -244,7 +244,7 @@ fn generate_rule_files(rules: &BTreeMap) -> Result<()> fn generate_rule_file(category_dir: &Path, metadata: &SqlRuleMetadata) -> Result<()> { let rule_file = category_dir.join(format!("{}.rs", metadata.snake_name)); - let struct_name = Case::Pascal.convert(&metadata.snake_name); + let struct_name = metadata.snake_name.to_case(Case::Pascal); let struct_name = format_ident!("{}", struct_name); // These will be used as string literals in the quote! @@ -342,7 +342,7 @@ fn generate_category_mod( ) -> Result<()> { let mod_file = category_dir.join("mod.rs"); - let category_title = Case::Pascal.convert(category); + let category_title = category.to_case(Case::Pascal); let category_struct = format_ident!("{}", category_title); // Generate mod declarations @@ -356,7 +356,7 @@ fn generate_category_mod( .iter() .map(|r| { let mod_name = format_ident!("{}", r.snake_name); - let struct_name = format_ident!("{}", Case::Pascal.convert(&r.snake_name)); + let struct_name = format_ident!("{}", r.snake_name.to_case(Case::Pascal)); quote! { self::#mod_name::#struct_name } }) .collect(); @@ -402,7 +402,7 @@ fn generate_rules_mod( .keys() .map(|cat| { let mod_name = format_ident!("{}", cat); - let group_name = format_ident!("{}", Case::Pascal.convert(cat)); + let group_name = format_ident!("{}", cat.to_case(Case::Pascal)); quote! { self::#mod_name::#group_name } }) .collect(); @@ -511,7 +511,7 @@ fn generate_registry(rules: &BTreeMap) -> Result<()> { let camel_name = &rule.name; let category_ident = format_ident!("{}", rule.category.to_lowercase()); let module_name = format_ident!("{}", &rule.snake_name); - let struct_name = format_ident!("{}", Case::Pascal.convert(&rule.snake_name)); + let struct_name = format_ident!("{}", rule.snake_name.to_case(Case::Pascal)); quote! { #camel_name => Some(( diff --git a/xtask/codegen/src/lib.rs b/xtask/codegen/src/lib.rs index 268439e05..cdfc2d276 100644 --- a/xtask/codegen/src/lib.rs +++ b/xtask/codegen/src/lib.rs @@ -1,5 +1,7 @@ //! Codegen tools. Derived from Biome's codegen +use convert_case::{Boundary, Case, Converter}; + mod generate_analyser; mod generate_bindings; mod generate_configuration; @@ -48,6 +50,21 @@ pub fn update(path: &Path, contents: &str, mode: &Mode) -> Result Ok(UpdateResult::Updated) } +/// Convert to snake_case without splitting on digit boundaries. +/// +/// `convert_case` treats digit-letter boundaries as word separators +/// (e.g. "Md5" → "md_5"), but we want digits attached to the preceding +/// word (e.g. "Md5" → "md5") to match the old biome_string_case behavior. +pub fn to_snake_case(s: &str) -> String { + Converter::new() + .to_case(Case::Snake) + .remove_boundary(Boundary::DigitUpper) + .remove_boundary(Boundary::DigitLower) + .remove_boundary(Boundary::UpperDigit) + .remove_boundary(Boundary::LowerDigit) + .convert(s) +} + pub fn to_capitalized(s: &str) -> String { let mut c = s.chars(); match c.next() {