Commit graph

76 commits

Author SHA1 Message Date
f99a4f787d
chore(lib): prepare for v0.1.10 2025-01-22 12:00:11 +05:30
683d76af65
chore(lib): use non-deprecated include pattern 2025-01-22 11:57:37 +05:30
e90fc8b617
chore(pkg): use new index url 2025-01-22 11:55:28 +05:30
1ae6570d8a
refactor(lib): update installation lock related comments 2025-01-21 22:46:09 +05:30
aef778883e
feat(lib): use structured lock file with metadata
This allows for us to know whether a lock file is too old and hence
invalid, and perform a sanity check to ensure that the resource it is
meant to be protecting is the resource we are trying to access.
2025-01-21 22:39:07 +05:30
57605e87b8
refactor(lib): use declared tool dir and use assert to handle nil 2025-01-21 22:19:56 +05:30
8cea7bef8a
fix(lib): fix directory checking condition for tool dir creation 2025-01-21 22:18:42 +05:30
3757ee3583
fix(lib): make installation lock be tool scoped
Instead of having a global installation lock be held in the tool storage
dir, it is now held on a per-tool basis within the tool's directory.
2025-01-21 22:15:56 +05:30
295023129f
fix(lib): hold on-disk lock for installation attempts
* Fixes an issue to do with multiple installation attempts trying
  to access the same resources concurrently, causing installation
  errors
* Made conditional progress bar a shared state among `__call` metamethod
  shorthand and `installTool`, in order to prevent constructing it in
  two different places
2025-01-21 16:29:09 +05:30
3a5ba527cf
chore(lib): prepare for v0.1.9 2025-01-16 08:52:35 +00:00
14860284da
fix(lib): windows PE format detection offset being a u32 2025-01-16 08:48:48 +00:00
f4f05b8264
fix(lib): TypeError in extractEntry function for zip 2025-01-16 08:48:03 +00:00
4da1e25967
chore(lib): prepare for v0.1.8 2025-01-16 07:48:34 +00:00
Luka
3e1876ad43
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>
2025-01-16 13:08:06 +05:30
08a45703da
chore: update lockfiles 2024-12-28 09:22:53 +00:00
26280ed820
chore(lib): prepare for v0.1.7 2024-12-28 09:21:20 +00:00
472813b41b
style: apply stylua formatter 2024-12-25 16:11:05 +00:00
ed8d5594b9
fix(lib): unhandled error when no gh CLI present
We did not correctly handle the case if the `gh` CLI was not present,
since `process.spawn` errors. We now wrap it in a `Result.try` and
handle that as required.
2024-12-25 15:56:39 +00:00
aba182cea5
fix(lib): handle result conditionally too
Previously, we were calling `:unwrap` while trying to increment the
progress bar even if we were not in an interactive environment. This
fixes that.
2024-12-25 15:48:50 +00:00
35fb2df3a4
chore(lib): prepare for v0.1.6 2024-12-25 05:59:33 +00:00
773cc1b2a1
fix(lib): error while attempting to migrate when new dir exists 2024-12-22 15:59:27 +00:00
76e434ec6d
fix(lib): propagate ProgressBar results and handle them 2024-12-22 15:58:52 +00:00
e6e5debcac
chore: update lockfiles 2024-12-22 14:42:22 +00:00
f0524d036d
chore(lib): bump version 2024-12-22 14:35:20 +00:00
4a26699691
chore(pkg): update pesde lockfiles 2024-12-16 19:39:08 +00:00
7bf8063366
feat(lib): make ProgressBar:nextStage return a result 2024-12-16 19:28:28 +00:00
8a074d0406
chore(lib): bump version 2024-12-16 07:32:58 +00:00
e0a9ca9aa4
fix(lib)!: check if existing tool_storage is dir, not file 2024-12-16 07:28:26 +00:00
db91ef8af5
chore(lib): bump version 2024-12-16 06:33:30 +00:00
9a3f3717de
feat(lib): address type related FIXMEs 2024-12-14 06:18:40 +00:00
bb6278407d
feat(lib): use gh CLI to get token and condition bar start
* Looks for `$GITHUB_TOKEN` env var, and if not found, tries to run `gh
  auth token` to get the token from the GitHub CLI.
* Made a conditional `start` method for the bar, which was previously
  missed.
2024-12-14 06:13:17 +00:00
0726169df8
feat(lib): rename tool_storage dir
Tools are now stored in the `~/.pesde/bin/.tool_storage` directory, in
order to prevent naming conflicts with other tool linkers. An old
tool_storage directory gets migrated to the new path if present.
2024-12-13 18:20:29 +00:00
202dc85147
feat(lib): add a touch of color to progress bar
Also moves bar stopping logic for errors into pcall handler.
2024-12-13 18:04:42 +00:00
2f79159f95
fix(lib): progress bar interfering with warns
* Fixed overlapping warns and progress bar.
* Removed unnecessary `resume` and `stop` bar methods.
2024-12-13 17:52:28 +00:00
f377116271
refactor(lib): minor structure improvements for progress bar
* Made bar related conditional operations get constructed by a
  `makeCondBar` which returns a table of functions to conditionally handle
  a progress bar.
* Moved progress bar boolean out of function args for `installTool` into
  global state.
2024-12-13 16:34:36 +00:00
c69a7417a0
feat(lib): include optional progress bar
Includes an optional progress bar which gets enabled when lib is called
using the default convenience `__call` metamethod.
2024-12-13 16:25:42 +00:00
ead60c003e
refactor(lib): use extension pattern for result<->option
Formerly, we used metatables to get custom `Option` and `Result` objects
which were difficult to type properly, leading to a lot of `unknown` and
`any` casts.

This refactor fixes it by making extensions opt-in, where we import the
extension methods separately from the original implementations, thereby
allowing us to not have to typecast things everywhere.
2024-12-13 14:33:05 +00:00
45627ea4a9
feat(lib): only download asset when it is of a valid format
Small optimization to not fetch an asset if its need of a supported
compression format.
2024-12-13 13:51:38 +00:00
1613737c26
chore(toolchainlib): remove token param from README 2024-12-10 22:12:47 +05:30
940ceea50f style: apply stylua formatter 2024-12-09 04:43:15 +00:00
80882fc173 feat(lib): remove reliance on semver parsing
Previously, we assumed that the tools followed semver, and hence parsed
their versions for comparison. Some tools may not follow semver, and we
should not impose such a requirement as a toolchain management library.

Therefore, we now only check if the requested version string matches an
asset version tag. In order to ensure backwards compatibility, we strip
the leading `v` from the version if present.
2024-12-09 03:34:05 +00:00
daimond113
c8488f169f
docs: symlink toolchainlib LICENSE 2024-12-08 18:21:06 +01:00
daimond113
e9c78bd0d5
chore: rename LICENSE.md to LICENSE 2024-12-08 18:10:04 +01:00
21d1b04ad4 chore(toolchainlib): fix grammar mistake in README 2024-12-01 12:19:19 +00:00
e46bb0f3ca feat(lib): make manifest decoding and access type-safe
Includes types to describe the shape of a pesde manifest and its
components.
2024-12-01 12:15:57 +00:00
be9790e590 chore(lib): include description in package manifest 2024-12-01 05:38:40 +00:00
cca939e355 fix(lib): remove duplicate version defaulting code 2024-12-01 05:35:58 +00:00
97cc64bc81 fix(lib): don't panic on bad descriptor for binary 2024-12-01 05:34:29 +00:00
039b4619a4 chore(bins): bump toolchainlib and update luau-lsp 2024-12-01 05:30:59 +00:00
46df227f26 chore(lib): bump version 2024-12-01 05:29:59 +00:00