mirror of
https://github.com/pesde-pkg/tooling.git
synced 2025-03-04 02:51:47 +00:00
feat(lib): switch to luau-unzip
(#3)
* chore(bins): bump `asphalt` to v0.8.4 * chore(bins): bump `selene` to v0.28.0 * feat(lib): use luau-unzip * chore(CHANGELOG): add luau-unzip * chore: switch back to CRLF * fix(lib): extracting wrong binary * refactor(lib): use extractEntry function * refactor(lib): make checks explicit and add comments to zip decompressor * chore(lib): remove unused exec util * chore(CHANGELOG): remove trailing full-stop --------- Co-authored-by: Erica Marigold <hi@devcomp.xyz>
This commit is contained in:
parent
e194995f29
commit
3e1876ad43
18 changed files with 343 additions and 284 deletions
|
@ -5,6 +5,8 @@ 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/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
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).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Changed
|
||||||
|
- Use [`luau-unzip`](https://github.com/0x5eal/luau-unzip) to extract archives instead of using an external program
|
||||||
|
|
||||||
## [0.1.7] - 2024-12-28
|
## [0.1.7] - 2024-12-28
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -2,6 +2,29 @@ name = "pesde/argon"
|
||||||
version = "2.0.21"
|
version = "2.0.21"
|
||||||
target = "lune"
|
target = "lune"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau"]
|
||||||
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref]
|
||||||
|
ref_ty = "pesde"
|
||||||
|
name = "0x5eal/unzip"
|
||||||
|
version = "0.1.0"
|
||||||
|
index_url = "https://github.com/daimond113/pesde-index"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.dependencies]
|
||||||
|
asciitable = [{ name = "kimpure/asciitable", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "dev"]
|
||||||
|
frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
luau-lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
[graph."jiwonz/dirs"."0.1.2 lune"]
|
[graph."jiwonz/dirs"."0.1.2 lune"]
|
||||||
resolved_ty = "standard"
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
@ -87,6 +110,7 @@ environment = "lune"
|
||||||
lib = "src/init.luau"
|
lib = "src/init.luau"
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
||||||
|
"0x5eal/unzip" = ["0.1.0 luau", "unzip"]
|
||||||
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
||||||
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
||||||
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
||||||
|
@ -101,6 +125,7 @@ dirs = [{ name = "jiwonz/dirs", version = "^0.1.1", index = "https://github.com/
|
||||||
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
||||||
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
|
unzip = [{ name = "0x5eal/unzip", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index", target = "luau" }, "standard"]
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
||||||
environment = "lune"
|
environment = "lune"
|
||||||
|
|
|
@ -1,7 +1,30 @@
|
||||||
name = "pesde/asphalt"
|
name = "pesde/asphalt"
|
||||||
version = "0.8.3"
|
version = "0.8.4"
|
||||||
target = "lune"
|
target = "lune"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau"]
|
||||||
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref]
|
||||||
|
ref_ty = "pesde"
|
||||||
|
name = "0x5eal/unzip"
|
||||||
|
version = "0.1.0"
|
||||||
|
index_url = "https://github.com/daimond113/pesde-index"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.dependencies]
|
||||||
|
asciitable = [{ name = "kimpure/asciitable", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "dev"]
|
||||||
|
frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
luau-lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
[graph."jiwonz/dirs"."0.1.2 lune"]
|
[graph."jiwonz/dirs"."0.1.2 lune"]
|
||||||
resolved_ty = "standard"
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
@ -87,6 +110,7 @@ environment = "lune"
|
||||||
lib = "src/init.luau"
|
lib = "src/init.luau"
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
||||||
|
"0x5eal/unzip" = ["0.1.0 luau", "unzip"]
|
||||||
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
||||||
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
||||||
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
||||||
|
@ -101,6 +125,7 @@ dirs = [{ name = "jiwonz/dirs", version = "^0.1.1", index = "https://github.com/
|
||||||
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
||||||
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
|
unzip = [{ name = "0x5eal/unzip", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index", target = "luau" }, "standard"]
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
||||||
environment = "lune"
|
environment = "lune"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name = "pesde/asphalt"
|
name = "pesde/asphalt"
|
||||||
version = "0.8.3"
|
version = "0.8.4"
|
||||||
description = "Upload and reference Roblox assets in code"
|
description = "Upload and reference Roblox assets in code"
|
||||||
authors = ["CompeyDev <hi@devcomp.xyz>", "Jack T <jack@jackt.space>"]
|
authors = ["CompeyDev <hi@devcomp.xyz>", "Jack T <jack@jackt.space>"]
|
||||||
repository = "https://github.com/pesde-pkg/tooling/tree/main/bins/asphalt"
|
repository = "https://github.com/pesde-pkg/tooling/tree/main/bins/asphalt"
|
||||||
|
|
|
@ -2,6 +2,29 @@ name = "pesde/blink"
|
||||||
version = "0.15.1"
|
version = "0.15.1"
|
||||||
target = "lune"
|
target = "lune"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau"]
|
||||||
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref]
|
||||||
|
ref_ty = "pesde"
|
||||||
|
name = "0x5eal/unzip"
|
||||||
|
version = "0.1.0"
|
||||||
|
index_url = "https://github.com/daimond113/pesde-index"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.dependencies]
|
||||||
|
asciitable = [{ name = "kimpure/asciitable", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "dev"]
|
||||||
|
frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
luau-lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
[graph."jiwonz/dirs"."0.1.2 lune"]
|
[graph."jiwonz/dirs"."0.1.2 lune"]
|
||||||
resolved_ty = "standard"
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
@ -87,6 +110,7 @@ environment = "lune"
|
||||||
lib = "src/init.luau"
|
lib = "src/init.luau"
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
||||||
|
"0x5eal/unzip" = ["0.1.0 luau", "unzip"]
|
||||||
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
||||||
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
||||||
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
||||||
|
@ -101,6 +125,7 @@ dirs = [{ name = "jiwonz/dirs", version = "^0.1.1", index = "https://github.com/
|
||||||
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
||||||
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
|
unzip = [{ name = "0x5eal/unzip", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index", target = "luau" }, "standard"]
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
||||||
environment = "lune"
|
environment = "lune"
|
||||||
|
|
|
@ -2,6 +2,29 @@ name = "pesde/darklua"
|
||||||
version = "0.15.0"
|
version = "0.15.0"
|
||||||
target = "lune"
|
target = "lune"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau"]
|
||||||
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref]
|
||||||
|
ref_ty = "pesde"
|
||||||
|
name = "0x5eal/unzip"
|
||||||
|
version = "0.1.0"
|
||||||
|
index_url = "https://github.com/daimond113/pesde-index"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.dependencies]
|
||||||
|
asciitable = [{ name = "kimpure/asciitable", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "dev"]
|
||||||
|
frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
luau-lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
[graph."jiwonz/dirs"."0.1.2 lune"]
|
[graph."jiwonz/dirs"."0.1.2 lune"]
|
||||||
resolved_ty = "standard"
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
@ -87,6 +110,7 @@ environment = "lune"
|
||||||
lib = "src/init.luau"
|
lib = "src/init.luau"
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
||||||
|
"0x5eal/unzip" = ["0.1.0 luau", "unzip"]
|
||||||
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
||||||
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
||||||
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
||||||
|
@ -101,6 +125,7 @@ dirs = [{ name = "jiwonz/dirs", version = "^0.1.1", index = "https://github.com/
|
||||||
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
||||||
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
|
unzip = [{ name = "0x5eal/unzip", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index", target = "luau" }, "standard"]
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
||||||
environment = "lune"
|
environment = "lune"
|
||||||
|
|
|
@ -2,6 +2,29 @@ name = "pesde/luau_lsp"
|
||||||
version = "1.38.1"
|
version = "1.38.1"
|
||||||
target = "lune"
|
target = "lune"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau"]
|
||||||
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref]
|
||||||
|
ref_ty = "pesde"
|
||||||
|
name = "0x5eal/unzip"
|
||||||
|
version = "0.1.0"
|
||||||
|
index_url = "https://github.com/daimond113/pesde-index"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.dependencies]
|
||||||
|
asciitable = [{ name = "kimpure/asciitable", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "dev"]
|
||||||
|
frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
luau-lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
[graph."jiwonz/dirs"."0.1.2 lune"]
|
[graph."jiwonz/dirs"."0.1.2 lune"]
|
||||||
resolved_ty = "standard"
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
@ -87,6 +110,7 @@ environment = "lune"
|
||||||
lib = "src/init.luau"
|
lib = "src/init.luau"
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
||||||
|
"0x5eal/unzip" = ["0.1.0 luau", "unzip"]
|
||||||
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
||||||
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
||||||
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
||||||
|
@ -101,6 +125,7 @@ dirs = [{ name = "jiwonz/dirs", version = "^0.1.1", index = "https://github.com/
|
||||||
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
||||||
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
|
unzip = [{ name = "0x5eal/unzip", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index", target = "luau" }, "standard"]
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
||||||
environment = "lune"
|
environment = "lune"
|
||||||
|
|
|
@ -2,6 +2,29 @@ name = "pesde/rojo"
|
||||||
version = "7.4.4"
|
version = "7.4.4"
|
||||||
target = "lune"
|
target = "lune"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau"]
|
||||||
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref]
|
||||||
|
ref_ty = "pesde"
|
||||||
|
name = "0x5eal/unzip"
|
||||||
|
version = "0.1.0"
|
||||||
|
index_url = "https://github.com/daimond113/pesde-index"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.dependencies]
|
||||||
|
asciitable = [{ name = "kimpure/asciitable", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "dev"]
|
||||||
|
frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
luau-lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
[graph."jiwonz/dirs"."0.1.2 lune"]
|
[graph."jiwonz/dirs"."0.1.2 lune"]
|
||||||
resolved_ty = "standard"
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
@ -87,6 +110,7 @@ environment = "lune"
|
||||||
lib = "src/init.luau"
|
lib = "src/init.luau"
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
||||||
|
"0x5eal/unzip" = ["0.1.0 luau", "unzip"]
|
||||||
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
||||||
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
||||||
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
||||||
|
@ -101,6 +125,7 @@ dirs = [{ name = "jiwonz/dirs", version = "^0.1.1", index = "https://github.com/
|
||||||
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
||||||
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
|
unzip = [{ name = "0x5eal/unzip", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index", target = "luau" }, "standard"]
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
||||||
environment = "lune"
|
environment = "lune"
|
||||||
|
|
|
@ -1,7 +1,30 @@
|
||||||
name = "pesde/selene"
|
name = "pesde/selene"
|
||||||
version = "0.27.1"
|
version = "0.28.0"
|
||||||
target = "lune"
|
target = "lune"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau"]
|
||||||
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref]
|
||||||
|
ref_ty = "pesde"
|
||||||
|
name = "0x5eal/unzip"
|
||||||
|
version = "0.1.0"
|
||||||
|
index_url = "https://github.com/daimond113/pesde-index"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.dependencies]
|
||||||
|
asciitable = [{ name = "kimpure/asciitable", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "dev"]
|
||||||
|
frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
luau-lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
[graph."jiwonz/dirs"."0.1.2 lune"]
|
[graph."jiwonz/dirs"."0.1.2 lune"]
|
||||||
resolved_ty = "standard"
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
@ -87,6 +110,7 @@ environment = "lune"
|
||||||
lib = "src/init.luau"
|
lib = "src/init.luau"
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
||||||
|
"0x5eal/unzip" = ["0.1.0 luau", "unzip"]
|
||||||
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
||||||
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
||||||
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
||||||
|
@ -101,6 +125,7 @@ dirs = [{ name = "jiwonz/dirs", version = "^0.1.1", index = "https://github.com/
|
||||||
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
||||||
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
|
unzip = [{ name = "0x5eal/unzip", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index", target = "luau" }, "standard"]
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
||||||
environment = "lune"
|
environment = "lune"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name = "pesde/selene"
|
name = "pesde/selene"
|
||||||
version = "0.27.1"
|
version = "0.28.0"
|
||||||
description = "A blazing-fast modern Lua linter written in Rust"
|
description = "A blazing-fast modern Lua linter written in Rust"
|
||||||
authors = ["CompeyDev <hi@devcomp.xyz>", "Kampfkarren <kampfkarren@gmail.com>"]
|
authors = ["CompeyDev <hi@devcomp.xyz>", "Kampfkarren <kampfkarren@gmail.com>"]
|
||||||
repository = "https://github.com/pesde-pkg/tooling/tree/main/bins/selene"
|
repository = "https://github.com/pesde-pkg/tooling/tree/main/bins/selene"
|
||||||
|
|
|
@ -2,6 +2,29 @@ name = "pesde/stylua"
|
||||||
version = "2.0.2"
|
version = "2.0.2"
|
||||||
target = "lune"
|
target = "lune"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau"]
|
||||||
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref]
|
||||||
|
ref_ty = "pesde"
|
||||||
|
name = "0x5eal/unzip"
|
||||||
|
version = "0.1.0"
|
||||||
|
index_url = "https://github.com/daimond113/pesde-index"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.dependencies]
|
||||||
|
asciitable = [{ name = "kimpure/asciitable", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "dev"]
|
||||||
|
frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
luau-lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
[graph."jiwonz/dirs"."0.1.2 lune"]
|
[graph."jiwonz/dirs"."0.1.2 lune"]
|
||||||
resolved_ty = "standard"
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
@ -87,6 +110,7 @@ environment = "lune"
|
||||||
lib = "src/init.luau"
|
lib = "src/init.luau"
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
||||||
|
"0x5eal/unzip" = ["0.1.0 luau", "unzip"]
|
||||||
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
||||||
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
||||||
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
||||||
|
@ -101,6 +125,7 @@ dirs = [{ name = "jiwonz/dirs", version = "^0.1.1", index = "https://github.com/
|
||||||
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
||||||
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
|
unzip = [{ name = "0x5eal/unzip", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index", target = "luau" }, "standard"]
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
||||||
environment = "lune"
|
environment = "lune"
|
||||||
|
|
|
@ -2,6 +2,29 @@ name = "pesde/zap"
|
||||||
version = "0.6.16"
|
version = "0.6.16"
|
||||||
target = "lune"
|
target = "lune"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau"]
|
||||||
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref]
|
||||||
|
ref_ty = "pesde"
|
||||||
|
name = "0x5eal/unzip"
|
||||||
|
version = "0.1.0"
|
||||||
|
index_url = "https://github.com/daimond113/pesde-index"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.dependencies]
|
||||||
|
asciitable = [{ name = "kimpure/asciitable", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "dev"]
|
||||||
|
frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
luau-lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
[graph."jiwonz/dirs"."0.1.2 lune"]
|
[graph."jiwonz/dirs"."0.1.2 lune"]
|
||||||
resolved_ty = "standard"
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
@ -87,6 +110,7 @@ environment = "lune"
|
||||||
lib = "src/init.luau"
|
lib = "src/init.luau"
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
[graph."pesde/toolchainlib"."0.1.7 lune".dependencies]
|
||||||
|
"0x5eal/unzip" = ["0.1.0 luau", "unzip"]
|
||||||
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
"jiwonz/dirs" = ["0.1.2 lune", "dirs"]
|
||||||
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
"jiwonz/pathfs" = ["0.1.0 lune", "pathfs"]
|
||||||
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
"lukadev_0/option" = ["1.2.0 lune", "option"]
|
||||||
|
@ -101,6 +125,7 @@ dirs = [{ name = "jiwonz/dirs", version = "^0.1.1", index = "https://github.com/
|
||||||
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
option = [{ name = "lukadev_0/option", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
pathfs = [{ name = "jiwonz/pathfs", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index" }, "standard"]
|
||||||
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
result = [{ name = "lukadev_0/result", version = "^1.2.0", index = "https://github.com/daimond113/pesde-index" }, "peer"]
|
||||||
|
unzip = [{ name = "0x5eal/unzip", version = "^0.1.0", index = "https://github.com/daimond113/pesde-index", target = "luau" }, "standard"]
|
||||||
|
|
||||||
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
[graph."pesde/toolchainlib"."0.1.7 lune".pkg_ref.target]
|
||||||
environment = "lune"
|
environment = "lune"
|
||||||
|
|
|
@ -2,6 +2,30 @@ name = "pesde/toolchainlib"
|
||||||
version = "0.1.7"
|
version = "0.1.7"
|
||||||
target = "lune"
|
target = "lune"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau"]
|
||||||
|
direct = ["unzip", { name = "0x5eal/unzip", version = "^0.1.0", target = "luau" }, "standard"]
|
||||||
|
resolved_ty = "standard"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref]
|
||||||
|
ref_ty = "pesde"
|
||||||
|
name = "0x5eal/unzip"
|
||||||
|
version = "0.1.0"
|
||||||
|
index_url = "https://github.com/daimond113/pesde-index"
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.dependencies]
|
||||||
|
asciitable = [{ name = "kimpure/asciitable", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "dev"]
|
||||||
|
frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
luau-lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
|
||||||
|
|
||||||
|
[graph."0x5eal/unzip"."0.1.0 luau".pkg_ref.target]
|
||||||
|
environment = "luau"
|
||||||
|
lib = "lib/init.luau"
|
||||||
|
|
||||||
[graph."jiwonz/dirs"."0.1.2 lune"]
|
[graph."jiwonz/dirs"."0.1.2 lune"]
|
||||||
direct = ["dirs", { name = "jiwonz/dirs", version = "^0.1.1" }, "standard"]
|
direct = ["dirs", { name = "jiwonz/dirs", version = "^0.1.1" }, "standard"]
|
||||||
resolved_ty = "standard"
|
resolved_ty = "standard"
|
||||||
|
|
|
@ -12,6 +12,7 @@ lib = "src/init.luau"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
pathfs = { name = "jiwonz/pathfs", version = "^0.1.0" }
|
pathfs = { name = "jiwonz/pathfs", version = "^0.1.0" }
|
||||||
dirs = { name = "jiwonz/dirs", version = "^0.1.1" }
|
dirs = { name = "jiwonz/dirs", version = "^0.1.1" }
|
||||||
|
unzip = { name = "0x5eal/unzip", version = "^0.1.0", target = "luau" }
|
||||||
|
|
||||||
[peer_dependencies]
|
[peer_dependencies]
|
||||||
result = { name = "lukadev_0/result", version = "^1.2.0" }
|
result = { name = "lukadev_0/result", version = "^1.2.0" }
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
local serde = require("@lune/serde")
|
local unzip = require("../luau_packages/unzip")
|
||||||
local process = require("@lune/process")
|
|
||||||
|
|
||||||
local dirs = require("../lune_packages/dirs")
|
|
||||||
local pathfs = require("../lune_packages/pathfs")
|
|
||||||
|
|
||||||
local Result = require("../lune_packages/result")
|
local Result = require("../lune_packages/result")
|
||||||
local Option = require("../lune_packages/option")
|
local Option = require("../lune_packages/option")
|
||||||
|
@ -10,7 +6,8 @@ type Result<T, E> = Result.Result<T, E>
|
||||||
type Option<T> = Option.Option<T>
|
type Option<T> = Option.Option<T>
|
||||||
|
|
||||||
local revTable = require("./utils/rev_table")
|
local revTable = require("./utils/rev_table")
|
||||||
local CommandBuilder = require("./utils/exec")
|
local eq = require("./utils/eq")
|
||||||
|
local PlatformDescriptor = require("./platform/descriptor")
|
||||||
|
|
||||||
export type CompressionFormat = "TarGz" | "TarXz" | "Zip"
|
export type CompressionFormat = "TarGz" | "TarXz" | "Zip"
|
||||||
|
|
||||||
|
@ -36,70 +33,66 @@ local function detectFormat(fileName: string): Option<CompressionFormat>
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO: Use a type function to make all CompressionFormat lowercase
|
-- TODO: Use a type function to make all CompressionFormat lowercase
|
||||||
local decompress: { [CompressionFormat]: (compressed: buffer) -> Result<pathfs.AsPath, string> } = {
|
local extractBinary: {
|
||||||
Zip = function(compressed: buffer)
|
[CompressionFormat]: (
|
||||||
return (Option.from(dirs.cacheDir()):map(function(cacheDir)
|
compressed: buffer,
|
||||||
local progCacheDir = cacheDir:join("pesde-bin")
|
binaryName: string,
|
||||||
if not pathfs.isDir(progCacheDir) then
|
targetPlatform: PlatformDescriptor.PlatformDescriptor
|
||||||
pathfs.writeDir(progCacheDir)
|
) -> Result<buffer, string>,
|
||||||
|
} =
|
||||||
|
{
|
||||||
|
Zip = function(compressed, binaryName, targetPlatform)
|
||||||
|
-- Load the compressed data into a `ZipReader`
|
||||||
|
local reader = unzip.load(compressed)
|
||||||
|
local binaryContents: buffer?
|
||||||
|
|
||||||
|
--- Extracts a specific entry from the ZIP and validates that its `PlatformDescriptor`
|
||||||
|
--- matches the expected one
|
||||||
|
local function extractEntry(entry: unzip.ZipEntry): buffer?
|
||||||
|
local contents = reader:extract(entry, { type = "binary" }) :: buffer
|
||||||
|
local executablePlatform = PlatformDescriptor.fromExecutable(contents)
|
||||||
|
|
||||||
|
if executablePlatform:isOk() and eq(executablePlatform:unwrap(), targetPlatform) then
|
||||||
|
return contents
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return progCacheDir :: pathfs.Path
|
|
||||||
end)):match({
|
|
||||||
Some = function(dir: pathfs.Path)
|
|
||||||
-- Generate a unique file name and write the contents to the temporary file
|
|
||||||
local tmpFile = dir:join(`{serde.hash("blake3", compressed)}.zip`)
|
|
||||||
local tmpFilePath = tmpFile:toString()
|
|
||||||
pathfs.writeFile(tmpFile, compressed)
|
|
||||||
|
|
||||||
-- Create the directory to decompress into
|
-- Find the entry and attempt to extract it
|
||||||
local decompressedDir = pathfs.Path.from(tmpFile):withExtension("")
|
local binaryEntry = reader:findEntry(binaryName)
|
||||||
pathfs.writeDir(decompressedDir)
|
if binaryEntry then
|
||||||
|
binaryContents = extractEntry(binaryEntry)
|
||||||
-- Run unzip to decompress the file
|
|
||||||
local child = (if process.os == "windows"
|
|
||||||
-- Thanks windows :)
|
|
||||||
then CommandBuilder.new("powershell"):withArgs({
|
|
||||||
"-ExecutionPolicy RemoteSigned",
|
|
||||||
`-c \`"Import-Module Microsoft.PowerShell.Archive; Expand-Archive -LiteralPath '{tmpFilePath}' -DestinationPath '{decompressedDir:toString()}'\`"`,
|
|
||||||
})
|
|
||||||
else CommandBuilder.new("unzip"):withArgs({ tmpFilePath, "-d", decompressedDir:toString() }))
|
|
||||||
:withStdioStrategy({
|
|
||||||
-- Powershell on Windows writes errors to stdout. Bruh
|
|
||||||
stdout = Option.Some(
|
|
||||||
if process.os == "windows" and process.env.PESDE_LOG == "debug"
|
|
||||||
then "forward"
|
|
||||||
else "pipe" :: CommandBuilder.StdioStrategy
|
|
||||||
),
|
|
||||||
stderr = Option.Some(
|
|
||||||
if process.env.PESDE_LOG == "debug"
|
|
||||||
then "forward"
|
|
||||||
else "pipe" :: CommandBuilder.StdioStrategy
|
|
||||||
),
|
|
||||||
} :: CommandBuilder.IoStrategyMapping)
|
|
||||||
:intoChildProcess()
|
|
||||||
|
|
||||||
child:start()
|
|
||||||
local status = child:waitForChild()
|
|
||||||
|
|
||||||
-- Cleanup temporary file and handle errors
|
|
||||||
pathfs.removeFile(tmpFile)
|
|
||||||
if not status.ok then
|
|
||||||
return Result.Err(
|
|
||||||
`DecompressError::CommandFailed(exitCode={status.code})`
|
|
||||||
) :: Result<pathfs.AsPath, string>
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return Result.Ok(decompressedDir) :: Result<pathfs.AsPath, string>
|
-- Fallback for if we cannot find the `ZipEntry`
|
||||||
end,
|
if binaryContents == nil then
|
||||||
|
-- Walk through the entries to find an executable
|
||||||
|
reader:walk(function(entry)
|
||||||
|
if binaryContents ~= nil then
|
||||||
|
-- If we successfully extracted the binary on a previous iteration,
|
||||||
|
-- we skip this entry
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
None = function()
|
if entry.isDirectory then
|
||||||
return Result.Err("DecompressError::NoCacheDir") :: Result<pathfs.AsPath, string>
|
-- Ignore directories
|
||||||
end,
|
return
|
||||||
})
|
end
|
||||||
|
|
||||||
|
binaryContents = extractEntry(entry)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
if binaryContents == nil then
|
||||||
|
-- If both the fallback and the initial attempts did not yield an extracted binary,
|
||||||
|
-- we return an error
|
||||||
|
return Result.Err("ExtractBinaryError::BinaryNotFound" :: string)
|
||||||
|
end
|
||||||
|
|
||||||
|
return Result.Ok(binaryContents)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
-- TODO: Other formats
|
-- TODO: Other formats
|
||||||
}
|
}
|
||||||
|
|
||||||
return { decompress = decompress, detectFormat = detectFormat }
|
return { extractBinary = extractBinary, detectFormat = detectFormat }
|
||||||
|
|
|
@ -45,12 +45,16 @@ local function warn(...)
|
||||||
stdio.ewrite(`{WARN_PREFIX} {stdio.format(...)}\n`)
|
stdio.ewrite(`{WARN_PREFIX} {stdio.format(...)}\n`)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function downloadAndDecompress(asset: {
|
local function downloadAndExtractBinary(
|
||||||
|
binaryName: string,
|
||||||
|
targetPlatform: PlatformDescriptor.PlatformDescriptor,
|
||||||
|
asset: {
|
||||||
name: string,
|
name: string,
|
||||||
browser_download_url: string,
|
browser_download_url: string,
|
||||||
size: number,
|
size: number,
|
||||||
content_type: string,
|
content_type: string,
|
||||||
}): Option<pathfs.Path>
|
}
|
||||||
|
): Option<buffer>
|
||||||
return compression
|
return compression
|
||||||
.detectFormat(asset.name)
|
.detectFormat(asset.name)
|
||||||
:andThen(function(format: compression.CompressionFormat)
|
:andThen(function(format: compression.CompressionFormat)
|
||||||
|
@ -59,8 +63,10 @@ local function downloadAndDecompress(asset: {
|
||||||
return error(`Failed to download asset {asset.name}: HTTP Code {contentsResp.statusCode}`)
|
return error(`Failed to download asset {asset.name}: HTTP Code {contentsResp.statusCode}`)
|
||||||
end
|
end
|
||||||
|
|
||||||
return ResultExt.ok(compression.decompress[format](buffer.fromstring(contentsResp.body)))
|
return ResultExt.ok(
|
||||||
end) :: Option<pathfs.Path>
|
compression.extractBinary[format](buffer.fromstring(contentsResp.body), binaryName, targetPlatform)
|
||||||
|
)
|
||||||
|
end) :: Option<buffer>
|
||||||
end
|
end
|
||||||
|
|
||||||
local function chmod(path: pathfs.Path, mode: number | string)
|
local function chmod(path: pathfs.Path, mode: number | string)
|
||||||
|
@ -195,6 +201,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
|
||||||
|
|
||||||
local currentDesc = PlatformDescriptor.currentSystem()
|
local currentDesc = PlatformDescriptor.currentSystem()
|
||||||
local aliasPath = pathfs.Path.from(toolAlias):withExtension(if currentDesc.os == "windows" then "exe" else "")
|
local aliasPath = pathfs.Path.from(toolAlias):withExtension(if currentDesc.os == "windows" then "exe" else "")
|
||||||
|
local aliasName = aliasPath:toString()
|
||||||
|
|
||||||
for _, asset in assets do
|
for _, asset in assets do
|
||||||
local desc = PlatformDescriptor.fromString(asset.name)
|
local desc = PlatformDescriptor.fromString(asset.name)
|
||||||
|
@ -210,33 +217,28 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
|
||||||
|
|
||||||
barFns.next(bar) -- download
|
barFns.next(bar) -- download
|
||||||
|
|
||||||
local binaryPath: pathfs.Path
|
local binaryContents: buffer
|
||||||
if matchingAsset == nil then
|
if matchingAsset == nil then
|
||||||
stdio.write("\x1b[2K\x1b[0G")
|
stdio.write("\x1b[2K\x1b[0G")
|
||||||
warn("Pesde could not find a matching binary for your system")
|
warn("Pesde could not find a matching binary for your system")
|
||||||
warn("Will now attempt to download all binaries and find a matching one")
|
warn("Will now attempt to download all binaries and find a matching one")
|
||||||
|
|
||||||
for _, asset in assets do
|
for _, asset in assets do
|
||||||
local decompressedPath = downloadAndDecompress(asset)
|
local contents = downloadAndExtractBinary(aliasName, currentDesc, asset)
|
||||||
if decompressedPath:isSome() then
|
if contents:isSome() then
|
||||||
local path = decompressedPath:unwrap()
|
binaryContents = contents:unwrap()
|
||||||
for _, file in pathfs.readDir(path) do
|
|
||||||
local filePath = path:join(file)
|
|
||||||
local nativeDesc = PlatformDescriptor.fromExecutable(filePath:toString())
|
|
||||||
|
|
||||||
if nativeDesc:isOk() and eq(currentDesc, nativeDesc:unwrap()) then
|
|
||||||
binaryPath = filePath
|
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
local decompressedPath = downloadAndDecompress(matchingAsset):unwrap()
|
downloadAndExtractBinary(aliasName, currentDesc, matchingAsset):match({
|
||||||
binaryPath = decompressedPath:join(aliasPath)
|
Some = function(contents: buffer)
|
||||||
if not pathfs.isFile(binaryPath) then
|
binaryContents = contents
|
||||||
error(`No matching binary found in {decompressedPath}`)
|
end,
|
||||||
end
|
None = function()
|
||||||
|
error(`No matching binary found`)
|
||||||
|
end,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
barFns.next(bar) -- install
|
barFns.next(bar) -- install
|
||||||
|
@ -248,7 +250,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
|
||||||
pathfs.writeDir(toolDir)
|
pathfs.writeDir(toolDir)
|
||||||
end
|
end
|
||||||
|
|
||||||
pathfs.move(binaryPath, installPath)
|
pathfs.writeFile(installPath, binaryContents)
|
||||||
|
|
||||||
-- IDEA: In order to eliminate fs read overhead on startup and to disallow
|
-- IDEA: In order to eliminate fs read overhead on startup and to disallow
|
||||||
-- the use of the tool binary when outside a package where it is installed,
|
-- the use of the tool binary when outside a package where it is installed,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
local process = require("@lune/process")
|
local process = require("@lune/process")
|
||||||
local fs = require("@lune/fs")
|
|
||||||
|
|
||||||
local os = require("./os")
|
local os = require("./os")
|
||||||
local arch = require("./arch")
|
local arch = require("./arch")
|
||||||
|
@ -45,9 +44,8 @@ function PlatformDescriptor.fromString(str: string)
|
||||||
} :: PlatformDescriptor)
|
} :: PlatformDescriptor)
|
||||||
end
|
end
|
||||||
|
|
||||||
function PlatformDescriptor.fromExecutable(path: string): result.PlatformResult<PlatformDescriptor>
|
function PlatformDescriptor.fromExecutable(contents: buffer): result.PlatformResult<PlatformDescriptor>
|
||||||
local binaryContents = fs.readFile(path)
|
local detected = Option.from(detectFromExecutable(contents))
|
||||||
local detected = Option.from(detectFromExecutable(buffer.fromstring(binaryContents)))
|
|
||||||
:map(function(inner: detectFromExecutable.ExecutableDetectionResult): ExecutableDetectionResult
|
:map(function(inner: detectFromExecutable.ExecutableDetectionResult): ExecutableDetectionResult
|
||||||
return {
|
return {
|
||||||
os = Option.from(inner.os) :: Option<process.OS>,
|
os = Option.from(inner.os) :: Option<process.OS>,
|
||||||
|
|
|
@ -1,186 +0,0 @@
|
||||||
--> Builder pattern class to spawn, manage and kill child processes
|
|
||||||
|
|
||||||
local process = require("@lune/process")
|
|
||||||
local task = require("@lune/task")
|
|
||||||
|
|
||||||
local Option = require("../../lune_packages/option")
|
|
||||||
type Option<T> = Option.Option<T>
|
|
||||||
|
|
||||||
local CommandBuilder = {}
|
|
||||||
type CommandBuilderFields = {
|
|
||||||
program: string,
|
|
||||||
args: { string },
|
|
||||||
retries: Option<number>,
|
|
||||||
ignoreErrors: Option<boolean>,
|
|
||||||
stdioStrategy: Option<IoStrategyMapping>,
|
|
||||||
}
|
|
||||||
export type CommandBuilder = typeof(setmetatable({} :: CommandBuilderFields, { __index = CommandBuilder }))
|
|
||||||
export type StdioStrategy = "pipe" | "forward" | "none"
|
|
||||||
export type IoStrategyMapping = {
|
|
||||||
stdout: Option<StdioStrategy>,
|
|
||||||
stderr: Option<StdioStrategy>,
|
|
||||||
}
|
|
||||||
export type ChildProcess = {
|
|
||||||
_thread: thread,
|
|
||||||
_pid: string,
|
|
||||||
_status: ChildStatus,
|
|
||||||
start: (self: ChildProcess) -> (),
|
|
||||||
waitForChild: (self: ChildProcess) -> ChildStatus,
|
|
||||||
kill: (self: ChildProcess) -> (),
|
|
||||||
}
|
|
||||||
export type ChildStatus = { ok: boolean, code: number, io: {
|
|
||||||
stdout: string,
|
|
||||||
stderr: string,
|
|
||||||
} }
|
|
||||||
|
|
||||||
local DEFAULT_STDIO_STRATEGY: IoStrategyMapping = {
|
|
||||||
stdout = Option.Some("pipe" :: StdioStrategy),
|
|
||||||
stderr = Option.Some("pipe" :: StdioStrategy),
|
|
||||||
}
|
|
||||||
local DEFAULT_RETRIES = 0
|
|
||||||
local DEFAULT_IGNORE_ERRORS = false
|
|
||||||
|
|
||||||
function CommandBuilder.new(program: string)
|
|
||||||
return setmetatable(
|
|
||||||
{
|
|
||||||
program = program,
|
|
||||||
args = {},
|
|
||||||
retries = Option.None,
|
|
||||||
ignoreErrors = Option.None,
|
|
||||||
stdioStrategy = Option.None :: Option<IoStrategyMapping>,
|
|
||||||
} :: CommandBuilderFields,
|
|
||||||
{
|
|
||||||
__index = CommandBuilder,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
function CommandBuilder.withArg(self: CommandBuilder, arg: string): CommandBuilder
|
|
||||||
table.insert(self.args, arg)
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
function CommandBuilder.withArgs(self: CommandBuilder, args: { string }): CommandBuilder
|
|
||||||
for _, arg in args do
|
|
||||||
self:withArg(arg)
|
|
||||||
end
|
|
||||||
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
function CommandBuilder.withMaxRetries(self: CommandBuilder, retries: number): CommandBuilder
|
|
||||||
self.retries = Option.Some(retries) :: Option<number>
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
function CommandBuilder.withIgnoreErrors(self: CommandBuilder, yes: boolean): CommandBuilder
|
|
||||||
self.ignoreErrors = Option.Some(yes) :: Option<boolean>
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
function CommandBuilder.withStdioStrategy(
|
|
||||||
self: CommandBuilder,
|
|
||||||
strategy: StdioStrategy | IoStrategyMapping
|
|
||||||
): CommandBuilder
|
|
||||||
self.stdioStrategy = Option.Some(if typeof(strategy) == "string"
|
|
||||||
then {
|
|
||||||
stdout = Option.Some(strategy),
|
|
||||||
stderr = Option.Some(strategy),
|
|
||||||
}
|
|
||||||
else strategy) :: Option<IoStrategyMapping>
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
local function intoSpawnOptionsStdioKind(strategy: StdioStrategy): process.SpawnOptionsStdioKind
|
|
||||||
if strategy == "pipe" then
|
|
||||||
return "default"
|
|
||||||
end
|
|
||||||
|
|
||||||
if strategy == "forward" then
|
|
||||||
return "forward"
|
|
||||||
end
|
|
||||||
|
|
||||||
if strategy == "none" then
|
|
||||||
return "none"
|
|
||||||
end
|
|
||||||
|
|
||||||
error(`Non-strategy provided: {strategy}`)
|
|
||||||
end
|
|
||||||
|
|
||||||
function CommandBuilder.intoChildProcess(self: CommandBuilder): ChildProcess
|
|
||||||
local child = {
|
|
||||||
_thread = coroutine.create(function(this: ChildProcess)
|
|
||||||
local retries = self.retries:unwrapOr(DEFAULT_RETRIES)
|
|
||||||
local ignoreErrors = self.ignoreErrors:unwrapOr(DEFAULT_IGNORE_ERRORS)
|
|
||||||
local argsList = table.concat(self.args, " ")
|
|
||||||
|
|
||||||
for _ = 0, retries do
|
|
||||||
local spawned = process.spawn(
|
|
||||||
if process.os == "windows"
|
|
||||||
then `(Start-Process {self.program} -Passthru -Wait -NoNewWindow -ArgumentList \"{argsList}\").Id`
|
|
||||||
else `{self.program} {argsList} & echo $!`,
|
|
||||||
{},
|
|
||||||
{
|
|
||||||
stdio = self.stdioStrategy
|
|
||||||
:orOpt(Option.Some(DEFAULT_STDIO_STRATEGY))
|
|
||||||
:map(function(mappings: IoStrategyMapping)
|
|
||||||
local translatedMappings: process.SpawnOptionsStdio = {}
|
|
||||||
for field, value in mappings do
|
|
||||||
translatedMappings[field] =
|
|
||||||
intoSpawnOptionsStdioKind((value :: Option<StdioStrategy>):unwrap())
|
|
||||||
end
|
|
||||||
|
|
||||||
return translatedMappings
|
|
||||||
end)
|
|
||||||
:unwrap(),
|
|
||||||
shell = true,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
if spawned.ok then
|
|
||||||
local lines = spawned.stdout:split("\n")
|
|
||||||
|
|
||||||
-- TODO: Abstract upvalues here into a channels primitive
|
|
||||||
this._pid = assert(table.remove(lines, 1), "Failed to get PID")
|
|
||||||
this._status = {
|
|
||||||
code = spawned.code,
|
|
||||||
ok = spawned.code == 0 and not ignoreErrors,
|
|
||||||
io = {
|
|
||||||
stdout = table.concat(lines, "\n"),
|
|
||||||
stderr = spawned.stderr,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
|
|
||||||
start = function(self: ChildProcess)
|
|
||||||
coroutine.resume(self._thread, self)
|
|
||||||
end,
|
|
||||||
|
|
||||||
waitForChild = function(self: ChildProcess): ChildStatus
|
|
||||||
while coroutine.status(self._thread) ~= "dead" or self._status == nil do
|
|
||||||
task.wait(0.1)
|
|
||||||
end
|
|
||||||
|
|
||||||
return self._status
|
|
||||||
end,
|
|
||||||
|
|
||||||
kill = function(self: ChildProcess)
|
|
||||||
coroutine.close(self._thread)
|
|
||||||
local killResult = process.spawn(
|
|
||||||
if process.os == "windows" then `Stop-Process -Id {self._pid} -Force` else `kill {self._pid}`,
|
|
||||||
{
|
|
||||||
shell = true,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
assert(killResult.ok, `Failed to kill process with PID {self._pid}`)
|
|
||||||
end,
|
|
||||||
} :: ChildProcess
|
|
||||||
|
|
||||||
return child
|
|
||||||
end
|
|
||||||
|
|
||||||
return CommandBuilder
|
|
Loading…
Add table
Reference in a new issue