Merge branch 'main' into feature/std-buffer

This commit is contained in:
Erica Marigold 2024-04-19 13:55:48 +05:30 committed by GitHub
commit a35c7fc3c4
Signed by: DevComp
GPG key ID: B5690EEEBB952194
10 changed files with 214 additions and 122 deletions

View file

@ -64,9 +64,13 @@ jobs:
cargo-target: x86_64-unknown-linux-gnu cargo-target: x86_64-unknown-linux-gnu
- name: macOS x86_64 - name: macOS x86_64
runner-os: macos-latest runner-os: macos-13
cargo-target: x86_64-apple-darwin cargo-target: x86_64-apple-darwin
timeout-minutes: 10
- name: macOS aarch64
runner-os: macos-14
cargo-target: aarch64-apple-darwin
name: CI - ${{ matrix.name }} name: CI - ${{ matrix.name }}
runs-on: ${{ matrix.runner-os }} runs-on: ${{ matrix.runner-os }}
steps: steps:

View file

@ -8,6 +8,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## `0.8.3` - April 15th, 2024
### Fixed
- Fixed `require` not throwing syntax errors ([#168])
- Fixed `require` caching not working correctly ([#171])
- Fixed case-sensitivity issue in `require` with aliases ([#173])
- Fixed `itertools` dependency being marked optional even though it is mandatory ([#176])
- Fixed test cases for the `net` built-in library on Windows ([#177])
[#168]: https://github.com/lune-org/lune/pull/168
[#171]: https://github.com/lune-org/lune/pull/171
[#173]: https://github.com/lune-org/lune/pull/173
[#176]: https://github.com/lune-org/lune/pull/176
[#177]: https://github.com/lune-org/lune/pull/177
## `0.8.2` - March 12th, 2024 ## `0.8.2` - March 12th, 2024
### Fixed ### Fixed

156
Cargo.lock generated
View file

@ -106,9 +106,9 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.81" version = "1.0.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519"
[[package]] [[package]]
name = "arrayref" name = "arrayref"
@ -130,9 +130,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]] [[package]]
name = "async-channel" name = "async-channel"
version = "2.2.0" version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928"
dependencies = [ dependencies = [
"concurrent-queue", "concurrent-queue",
"event-listener 5.3.0", "event-listener 5.3.0",
@ -157,11 +157,10 @@ dependencies = [
[[package]] [[package]]
name = "async-executor" name = "async-executor"
version = "1.10.0" version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f98c37cf288e302c16ef6c8472aad1e034c6c84ce5ea7b8101c98eb4a802fee" checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a"
dependencies = [ dependencies = [
"async-lock",
"async-task", "async-task",
"concurrent-queue", "concurrent-queue",
"fastrand", "fastrand",
@ -188,13 +187,13 @@ checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799"
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.79" version = "0.1.80"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
] ]
[[package]] [[package]]
@ -360,9 +359,9 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.92" version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41" checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
@ -387,7 +386,7 @@ dependencies = [
"js-sys", "js-sys",
"num-traits", "num-traits",
"wasm-bindgen", "wasm-bindgen",
"windows-targets 0.52.4", "windows-targets 0.52.5",
] ]
[[package]] [[package]]
@ -436,7 +435,7 @@ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
] ]
[[package]] [[package]]
@ -663,9 +662,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b"
[[package]] [[package]]
name = "either" name = "either"
version = "1.10.0" version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2"
[[package]] [[package]]
name = "encode_unicode" name = "encode_unicode"
@ -675,9 +674,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
[[package]] [[package]]
name = "encoding_rs" name = "encoding_rs"
version = "0.8.33" version = "0.8.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
] ]
@ -868,7 +867,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
] ]
[[package]] [[package]]
@ -938,9 +937,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]] [[package]]
name = "glam" name = "glam"
version = "0.25.0" version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" checksum = "9e05e7e6723e3455f4818c7b26e855439f7546cf617ef669d1adedb8669e5cb9"
[[package]] [[package]]
name = "glob" name = "glob"
@ -1113,9 +1112,9 @@ dependencies = [
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "1.2.0" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" checksum = "9f24ce812868d86d19daa79bf3bf9175bc44ea323391147a5e3abde2a283871b"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-channel", "futures-channel",
@ -1153,7 +1152,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a343d17fe7885302ed7252767dc7bb83609a874b6ff581142241ec4b73957ad" checksum = "7a343d17fe7885302ed7252767dc7bb83609a874b6ff581142241ec4b73957ad"
dependencies = [ dependencies = [
"http-body-util", "http-body-util",
"hyper 1.2.0", "hyper 1.3.0",
"hyper-util", "hyper-util",
"pin-project-lite", "pin-project-lite",
"tokio", "tokio",
@ -1172,7 +1171,7 @@ dependencies = [
"futures-util", "futures-util",
"http 1.1.0", "http 1.1.0",
"http-body 1.0.0", "http-body 1.0.0",
"hyper 1.2.0", "hyper 1.3.0",
"pin-project-lite", "pin-project-lite",
"socket2", "socket2",
"tokio", "tokio",
@ -1293,7 +1292,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"windows-targets 0.52.4", "windows-targets 0.52.5",
] ]
[[package]] [[package]]
@ -1345,7 +1344,7 @@ dependencies = [
[[package]] [[package]]
name = "lune" name = "lune"
version = "0.8.2" version = "0.8.3"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-compression", "async-compression",
@ -1363,7 +1362,7 @@ dependencies = [
"glam", "glam",
"http 1.1.0", "http 1.1.0",
"http-body-util", "http-body-util",
"hyper 1.2.0", "hyper 1.3.0",
"hyper-tungstenite", "hyper-tungstenite",
"hyper-util", "hyper-util",
"include_dir", "include_dir",
@ -1695,7 +1694,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
] ]
[[package]] [[package]]
@ -1738,7 +1737,7 @@ dependencies = [
"line-wrap", "line-wrap",
"quick-xml", "quick-xml",
"serde", "serde",
"time 0.3.34", "time 0.3.36",
] ]
[[package]] [[package]]
@ -1761,9 +1760,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.79" version = "1.0.80"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@ -1784,7 +1783,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
] ]
[[package]] [[package]]
@ -1798,9 +1797,9 @@ dependencies = [
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.35" version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
@ -2314,7 +2313,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
] ]
[[package]] [[package]]
@ -2533,9 +2532,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.58" version = "2.0.59"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -2598,7 +2597,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
] ]
[[package]] [[package]]
@ -2628,9 +2627,9 @@ dependencies = [
[[package]] [[package]]
name = "time" name = "time"
version = "0.3.34" version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [ dependencies = [
"deranged", "deranged",
"itoa", "itoa",
@ -2638,7 +2637,7 @@ dependencies = [
"powerfmt", "powerfmt",
"serde", "serde",
"time-core", "time-core",
"time-macros 0.2.17", "time-macros 0.2.18",
] ]
[[package]] [[package]]
@ -2659,9 +2658,9 @@ dependencies = [
[[package]] [[package]]
name = "time-macros" name = "time-macros"
version = "0.2.17" version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
dependencies = [ dependencies = [
"num-conv", "num-conv",
"time-core", "time-core",
@ -2723,7 +2722,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
] ]
[[package]] [[package]]
@ -2860,7 +2859,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
] ]
[[package]] [[package]]
@ -3083,7 +3082,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -3117,7 +3116,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.58", "syn 2.0.59",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -3190,7 +3189,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [ dependencies = [
"windows-targets 0.52.4", "windows-targets 0.52.5",
] ]
[[package]] [[package]]
@ -3208,7 +3207,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [ dependencies = [
"windows-targets 0.52.4", "windows-targets 0.52.5",
] ]
[[package]] [[package]]
@ -3228,17 +3227,18 @@ dependencies = [
[[package]] [[package]]
name = "windows-targets" name = "windows-targets"
version = "0.52.4" version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
dependencies = [ dependencies = [
"windows_aarch64_gnullvm 0.52.4", "windows_aarch64_gnullvm 0.52.5",
"windows_aarch64_msvc 0.52.4", "windows_aarch64_msvc 0.52.5",
"windows_i686_gnu 0.52.4", "windows_i686_gnu 0.52.5",
"windows_i686_msvc 0.52.4", "windows_i686_gnullvm",
"windows_x86_64_gnu 0.52.4", "windows_i686_msvc 0.52.5",
"windows_x86_64_gnullvm 0.52.4", "windows_x86_64_gnu 0.52.5",
"windows_x86_64_msvc 0.52.4", "windows_x86_64_gnullvm 0.52.5",
"windows_x86_64_msvc 0.52.5",
] ]
[[package]] [[package]]
@ -3249,9 +3249,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]] [[package]]
name = "windows_aarch64_gnullvm" name = "windows_aarch64_gnullvm"
version = "0.52.4" version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
@ -3261,9 +3261,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.52.4" version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
@ -3273,9 +3273,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.52.4" version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
@ -3285,9 +3291,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.52.4" version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
@ -3297,9 +3303,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.52.4" version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
[[package]] [[package]]
name = "windows_x86_64_gnullvm" name = "windows_x86_64_gnullvm"
@ -3309,9 +3315,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]] [[package]]
name = "windows_x86_64_gnullvm" name = "windows_x86_64_gnullvm"
version = "0.52.4" version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
@ -3321,15 +3327,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.52.4" version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.6.5" version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]

View file

@ -1,6 +1,6 @@
[package] [package]
name = "lune" name = "lune"
version = "0.8.2" version = "0.8.3"
edition = "2021" edition = "2021"
license = "MPL-2.0" license = "MPL-2.0"
repository = "https://github.com/lune-org/lune" repository = "https://github.com/lune-org/lune"
@ -139,7 +139,7 @@ rustyline = { optional = true, version = "14.0" }
### ROBLOX ### ROBLOX
glam = { optional = true, version = "0.25" } glam = { optional = true, version = "0.27" }
rand = { optional = true, version = "0.8" } rand = { optional = true, version = "0.8" }
rbx_cookie = { optional = true, version = "0.1.4", default-features = false } rbx_cookie = { optional = true, version = "0.1.4", default-features = false }

View file

@ -1,4 +1,7 @@
use std::{collections::HashMap, net::Ipv4Addr}; use std::{
collections::HashMap,
net::{IpAddr, Ipv4Addr},
};
use mlua::prelude::*; use mlua::prelude::*;
@ -8,7 +11,7 @@ use crate::lune::util::buffer::buf_to_str;
use super::util::table_to_hash_map; use super::util::table_to_hash_map;
const DEFAULT_IP_ADDRESS: Ipv4Addr = Ipv4Addr::new(127, 0, 0, 1); const DEFAULT_IP_ADDRESS: IpAddr = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
const WEB_SOCKET_UPDGRADE_REQUEST_HANDLER: &str = r#" const WEB_SOCKET_UPDGRADE_REQUEST_HANDLER: &str = r#"
return { return {
@ -158,7 +161,7 @@ impl FromLua<'_> for RequestConfig {
#[derive(Debug)] #[derive(Debug)]
pub struct ServeConfig<'a> { pub struct ServeConfig<'a> {
pub address: Ipv4Addr, pub address: IpAddr,
pub handle_request: LuaFunction<'a>, pub handle_request: LuaFunction<'a>,
pub handle_web_socket: Option<LuaFunction<'a>>, pub handle_web_socket: Option<LuaFunction<'a>>,
} }
@ -178,7 +181,7 @@ impl<'lua> FromLua<'lua> for ServeConfig<'lua> {
let handle_request: Option<LuaFunction> = t.get("handleRequest")?; let handle_request: Option<LuaFunction> = t.get("handleRequest")?;
let handle_web_socket: Option<LuaFunction> = t.get("handleWebSocket")?; let handle_web_socket: Option<LuaFunction> = t.get("handleWebSocket")?;
if handle_request.is_some() || handle_web_socket.is_some() { if handle_request.is_some() || handle_web_socket.is_some() {
let address: Ipv4Addr = match &address { let address: IpAddr = match &address {
Some(addr) => { Some(addr) => {
let addr_str = addr.to_str()?; let addr_str = addr.to_str()?;

View file

@ -18,21 +18,30 @@ impl LuaRequest {
let path = self.head.uri.path().to_string(); let path = self.head.uri.path().to_string();
let body = lua.create_string(&self.body)?; let body = lua.create_string(&self.body)?;
let query: HashMap<String, String> = self let query: HashMap<LuaString, LuaString> = self
.head .head
.uri .uri
.query() .query()
.unwrap_or_default() .unwrap_or_default()
.split('&') .split('&')
.filter_map(|q| q.split_once('=')) .filter_map(|q| q.split_once('='))
.map(|(k, v)| (k.to_string(), v.to_string())) .map(|(k, v)| {
.collect(); let k = lua.create_string(k)?;
let headers: HashMap<String, Vec<u8>> = self let v = lua.create_string(v)?;
Ok((k, v))
})
.collect::<LuaResult<_>>()?;
let headers: HashMap<LuaString, LuaString> = self
.head .head
.headers .headers
.iter() .iter()
.map(|(k, v)| (k.as_str().to_string(), v.as_bytes().to_vec())) .map(|(k, v)| {
.collect(); let k = lua.create_string(k.as_str())?;
let v = lua.create_string(v.as_bytes())?;
Ok((k, v))
})
.collect::<LuaResult<_>>()?;
TableBuilder::new(lua)? TableBuilder::new(lua)?
.with_value("method", method)? .with_value("method", method)?

View file

@ -2,7 +2,7 @@ use mlua::prelude::*;
use dialoguer::{theme::ColorfulTheme, Confirm, Input, MultiSelect, Select}; use dialoguer::{theme::ColorfulTheme, Confirm, Input, MultiSelect, Select};
use mlua_luau_scheduler::LuaSpawnExt; use mlua_luau_scheduler::LuaSpawnExt;
use tokio::io::{self, AsyncWriteExt}; use tokio::io::{self, AsyncReadExt, AsyncWriteExt};
use crate::lune::util::{ use crate::lune::util::{
formatting::{ formatting::{
@ -21,6 +21,7 @@ pub fn create(lua: &Lua) -> LuaResult<LuaTable<'_>> {
.with_function("format", stdio_format)? .with_function("format", stdio_format)?
.with_async_function("write", stdio_write)? .with_async_function("write", stdio_write)?
.with_async_function("ewrite", stdio_ewrite)? .with_async_function("ewrite", stdio_ewrite)?
.with_async_function("readToEnd", stdio_read_to_end)?
.with_async_function("prompt", stdio_prompt)? .with_async_function("prompt", stdio_prompt)?
.build_readonly() .build_readonly()
} }
@ -53,6 +54,21 @@ async fn stdio_ewrite(_: &Lua, s: LuaString<'_>) -> LuaResult<()> {
Ok(()) Ok(())
} }
/*
FUTURE: Figure out how to expose some kind of "readLine" function using a buffered reader.
This is a bit tricky since we would want to be able to use **both** readLine and readToEnd
in the same script, doing something like readLine, readLine, readToEnd from lua, and
having that capture the first two lines and then read the rest of the input.
*/
async fn stdio_read_to_end(lua: &Lua, _: ()) -> LuaResult<LuaString> {
let mut input = Vec::new();
let mut stdin = io::stdin();
stdin.read_to_end(&mut input).await?;
lua.create_string(&input)
}
async fn stdio_prompt(lua: &Lua, options: PromptOptions) -> LuaResult<PromptResult> { async fn stdio_prompt(lua: &Lua, options: PromptOptions) -> LuaResult<PromptResult> {
lua.spawn_blocking(move || prompt(options)) lua.spawn_blocking(move || prompt(options))
.await .await

View file

@ -1,6 +1,7 @@
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use mlua::prelude::*; use mlua::prelude::*;
use mlua::Error::ExternalError;
use super::context::*; use super::context::*;
@ -27,26 +28,33 @@ where
'lua: 'ctx, 'lua: 'ctx,
{ {
// 1. Try to require the exact path // 1. Try to require the exact path
if let Ok(res) = require_inner(lua, ctx, &abs_path, &rel_path).await { match require_inner(lua, ctx, &abs_path, &rel_path).await {
return Ok(res); Ok(res) => return Ok(res),
Err(err) => {
if !is_file_not_found_error(&err) {
return Err(err);
}
}
} }
// 2. Try to require the path with an added "luau" extension // 2. Try to require the path with an added "luau" extension
let (luau_abs_path, luau_rel_path) = (
append_extension(&abs_path, "luau"),
append_extension(&rel_path, "luau"),
);
if let Ok(res) = require_inner(lua, ctx, &luau_abs_path, &luau_rel_path).await {
return Ok(res);
}
// 3. Try to require the path with an added "lua" extension // 3. Try to require the path with an added "lua" extension
let (lua_abs_path, lua_rel_path) = ( for extension in ["luau", "lua"] {
append_extension(&abs_path, "lua"), match require_inner(
append_extension(&rel_path, "lua"), lua,
); ctx,
if let Ok(res) = require_inner(lua, ctx, &lua_abs_path, &lua_rel_path).await { &append_extension(&abs_path, extension),
return Ok(res); &append_extension(&rel_path, extension),
)
.await
{
Ok(res) => return Ok(res),
Err(err) => {
if !is_file_not_found_error(&err) {
return Err(err);
}
}
}
} }
// We didn't find any direct file paths, look // We didn't find any direct file paths, look
@ -55,21 +63,23 @@ where
let rel_init = rel_path.join("init"); let rel_init = rel_path.join("init");
// 4. Try to require the init path with an added "luau" extension // 4. Try to require the init path with an added "luau" extension
let (luau_abs_init, luau_rel_init) = (
append_extension(&abs_init, "luau"),
append_extension(&rel_init, "luau"),
);
if let Ok(res) = require_inner(lua, ctx, &luau_abs_init, &luau_rel_init).await {
return Ok(res);
}
// 5. Try to require the init path with an added "lua" extension // 5. Try to require the init path with an added "lua" extension
let (lua_abs_init, lua_rel_init) = ( for extension in ["luau", "lua"] {
append_extension(&abs_init, "lua"), match require_inner(
append_extension(&rel_init, "lua"), lua,
); ctx,
if let Ok(res) = require_inner(lua, ctx, &lua_abs_init, &lua_rel_init).await { &append_extension(&abs_init, extension),
return Ok(res); &append_extension(&rel_init, extension),
)
.await
{
Ok(res) => return Ok(res),
Err(err) => {
if !is_file_not_found_error(&err) {
return Err(err);
}
}
}
} }
// Nothing left to try, throw an error // Nothing left to try, throw an error
@ -109,3 +119,11 @@ fn append_extension(path: impl Into<PathBuf>, ext: &'static str) -> PathBuf {
}; };
new new
} }
fn is_file_not_found_error(err: &LuaError) -> bool {
if let ExternalError(err) = err {
err.as_ref().downcast_ref::<std::io::Error>().is_some()
} else {
false
}
}

View file

@ -130,7 +130,7 @@ pub fn pretty_format_value(
} else if let Some(s) = call_table_tostring_metamethod(tab) { } else if let Some(s) = call_table_tostring_metamethod(tab) {
write!(buffer, "{s}")?; write!(buffer, "{s}")?;
} else if depth >= 1 && parent_table_addr.eq(&table_addr) { } else if depth >= 1 && parent_table_addr.eq(&table_addr) {
write!(buffer, "{}", STYLE_DIM.apply_to("<self>"))? write!(buffer, "{}", STYLE_DIM.apply_to("<self>"))?;
} else { } else {
let mut is_empty = false; let mut is_empty = false;
let depth_indent = INDENT.repeat(depth); let depth_indent = INDENT.repeat(depth);
@ -148,7 +148,12 @@ pub fn pretty_format_value(
)?, )?,
_ => { _ => {
write!(buffer, "\n{depth_indent}{INDENT}[")?; write!(buffer, "\n{depth_indent}{INDENT}[")?;
pretty_format_value(buffer, &key, parent_table_addr.clone(), depth)?; pretty_format_value(
buffer,
&key,
parent_table_addr.clone(),
depth + 1,
)?;
write!(buffer, "] {} ", STYLE_DIM.apply_to("="))?; write!(buffer, "] {} ", STYLE_DIM.apply_to("="))?;
} }
} }

View file

@ -58,6 +58,9 @@ end
stdio.write("World! ") stdio.write("World! ")
stdio.write("All on the same line") stdio.write("All on the same line")
stdio.ewrite("\nAnd some error text, too") stdio.ewrite("\nAnd some error text, too")
-- Reading the entire input from stdin
local input = stdio.readToEnd()
``` ```
]=] ]=]
local stdio = {} local stdio = {}
@ -143,4 +146,16 @@ function stdio.write(s: string) end
]=] ]=]
function stdio.ewrite(s: string) end function stdio.ewrite(s: string) end
--[=[
@within Stdio
@tag must_use
Reads the entire input from stdin.
@return The input from stdin
]=]
function stdio.readToEnd(): string
return nil :: any
end
return stdio return stdio