Commit graph

306 commits

Author SHA1 Message Date
daimond113
7043f3a499
refactor: impose additional limits on aliases
Aliases didn't have a maximum length before, and
they could've been made with reserved Windows file
names which could've caused issues. This commit
imposes a limit of 24 characters on aliases and
forbids the reserved file names.
2025-04-30 22:05:28 +02:00
daimond113
7fdea814d8
fix: support multiple aliases for one package
Previously, if 2 or more aliases resolved to the
same package only one would get picked. With this
commit, the aliases will now all correctly point
to the package.
2025-04-30 21:48:42 +02:00
daimond113
ef8a7cf9b3
fix: rewrite dependency type system
Previously, a naive dependency type was used. This
had 2 fields in a dependency graph node:
resolved_ty and is_peer. These fields were
incorrect, since the dependency can be dependended
on as multiple types. Now, the dependency type is
stored in the dependencies fields. This change
makes old lockfiles incompatible since the old
format had data loss when it comes to dependency
types.

Fixes #33.
2025-04-30 20:02:41 +02:00
daimond113
0f63044fa6
refactor: remove hack in x command 2025-04-28 22:31:24 +02:00
daimond113
e4f496ffab
feat: add engines when initing project
When initializing a project, the `engines` section
will now be copied over from the scripts package.
2025-04-28 21:55:36 +02:00
daimond113
a99420e05d
feat: scan for engines without version management 2025-04-28 21:40:01 +02:00
daimond113
8f185d70e3
fix: require files in run & x commands correctly
Previously, absolute paths were used. These are
not currently supported by Luau and so have been
changed to being relative paths. Additionally,
fixes engines installed but not used by the
current project being undetected. Adds a target
argument to the x command & rewords its argument's
description.
2025-04-27 01:05:51 +02:00
daimond113
a127e2fcbb
refactor: remove unused imports 2025-04-26 23:59:29 +02:00
daimond113
91229d92be
refactor: use async version of Path::canonicalize 2025-04-26 23:53:51 +02:00
daimond113
5c74a3762b
feat: add cross runtime script execution
Adds a new mechanism which simplifies executing
scripts for different runtimes. Additionally,
supports Lune's 0.9.0 change of removing "--" from
the args.
2025-04-26 23:46:56 +02:00
daimond113
6aeedd8602
feat: add PESDE_HOME variable
Adds the PESDE_HOME env variable to allow changing
where pesde will store data like engines, bins,
etc. to support e.g. small OS disks & large
data disks.
2025-04-26 20:45:27 +02:00
daimond113
398763a171
fix: download engines eagerly
Previously, to download an engine pesde would
require its linker to be executed. This caused
issues if called concurrently, such as with
scripts & required the user to manually execute
the engine before usage. This change makes it so
it is downloaded in the install step before any
scripts which solves the issue.
2025-04-26 19:31:05 +02:00
Stefan
debff41488
feat: add dev-only installs (#32)
* feat: add dev flag

* fix: do not download dev/prod dependencies at all

* fix: only remove direct non-dev dependencies

* refactor: formatting

* fix: check sub dependencies

* fix: remove arc

Co-authored-by: dai <contact@daimond113.com>

* chore: grammar fixes

Co-authored-by: dai <contact@daimond113.com>

* chore: remove eagerly implemented traits

Co-authored-by: dai <contact@daimond113.com>

* refactor: use method over partialeq

* chore: use owned type for `DependencyType`

Co-authored-by: dai <contact@daimond113.com>

* refactor: simplify and improve logic

* chore: formatting

* fix: install mode works with force mode

* chore: remove cow

* chore: fits method takes owned self

* chore: fix needless borrow

* refactor: improve code structure

* refactor: avoid manually recreating graph

---------

Co-authored-by: dai <contact@daimond113.com>
2025-04-25 21:41:59 +02:00
daimond113
fbcc836064
perf: remove unnecessary Arcs 2025-04-21 13:21:14 +02:00
daimond113
74f364ee32
chore: update dependencies 2025-04-21 12:20:48 +02:00
daimond113
3bc1f0fa5c
fix: make bin linkers only for bin packages
Fixes binary linkers being made for non-binary
direct dependencies.
2025-03-14 08:58:45 +01:00
daimond113
412ce90e7f
feat: add proper versioning to lockfiles
Lockfiles now store a format field which is used
to migrate the them easily without brute forcing
the version it's at.
2025-03-09 18:57:20 +01:00
daimond113
b8c4f7486b
refactor: switch from sync Path::exists() method
This commit disallows the method through clippy
and switches to the async equivalents, as to not
block the async runtime.
2025-03-09 17:41:38 +01:00
daimond113
af93b7d584
fix: correctly get aliases for bin linkers
Fixes two issues with getting the aliases. The
first was that direct dependency aliases weren't
collected. The second is that these aliases would
be handled in a case-insensitive matter which is
incorrect.
2025-03-09 17:13:23 +01:00
daimond113
292565b647
feat: add @generated to lockfiles
Adds the @generated marker to lockfiles to make
them easily recognizable as auto-generated.
2025-03-09 16:16:44 +01:00
daimond113
e6ee935c11
feat: show available targets when none fit
This will help prevent user confusion with
targets. Instead of a cryptic "no matching
versions available" error, it'll now list the
available targets (if the source decides to output
them, so if the specifier has a target option)
2025-03-09 16:01:54 +01:00
daimond113
0e73db2831
fix: add missing run alias behaviour
The `run <alias>` behaviour was documented yet
missing. This commit adds it.
2025-03-09 14:53:22 +01:00
daimond113
19d6a07851
fix: make bin linkers for non-direct dependencies
Previously, binary linkers weren't made for
non-direct dependencies despite this being the
documented & expected behaviour.
2025-03-09 01:33:41 +01:00
daimond113
9a75ebf637
refactor: handle bin linkers in rust
Previously, binary linkers were handled by a Luau
script. This was not cross-runtime portable, and
forced us to do many "hacks" in order to be able
to implement them. To solve these issues, they are
now handled with Rust, which allows us to use our
existing infrastructure.
2025-03-09 01:18:12 +01:00
daimond113
41337ac96a
fix: dont inherit workspace by path dependencies 2025-03-08 23:24:35 +01:00
daimond113
9ad691ee94
refactor: undo send archive changes 2025-03-08 23:15:36 +01:00
daimond113
c7a8f919e2
refactor: apply clippy lints 2025-03-08 22:37:42 +01:00
daimond113
ff5c2e5d61
refactor: specify many new clippy lints
Adds quite a lot of Clippy lints which fit with my
personal taste for how pesde's codebase should
look like. Stylistic lints are mostly warns, and
behavioural lints are mostly denied.
2025-03-08 22:00:52 +01:00
daimond113
ef471069d8
fix: don't panic on SIGINT exits
Unwrapping the process code caused panics on
SIGINTs. Now we default to code 1 if there is
none.
2025-02-17 00:33:49 +01:00
daimond113
aa4f283e4c
refactor: allow publishing other packages on error
Previously, if a package failed to publish the
whole publishing process would halt. Then, if
a re-ran publishing got to an already published
package it'd error, which would require users to
manually publish the missing packages. This commit
fixes that by printing errors, but allowing other
members to still get published.
2025-02-16 11:32:16 +01:00
daimond113
ff6449a340
chore: fix formatting 2025-02-15 00:08:47 +01:00
daimond113
509838bb08
fix: remove typo in duplicate key error
The message previously contained "at line", but
we don't have a way of knowing the line number so
there was nothing after that. This commit removes
the "at line" part of the message.
2025-02-15 00:03:05 +01:00
daimond113
d6e2f611d8
perf: use or_else variants for expensive errors
This commit changes the error construction in
multiple places from the `*_or` to the `*_or_else`
variants. This is done to avoid the heap
allocation (for example, `to_string`) when there
is no need to.
2025-02-14 23:42:33 +01:00
daimond113
a4f2829db2
refactor: remove unused trait 2025-02-14 23:09:44 +01:00
daimond113
5c43e3cb95
refactor: improve outdated command output
Adds some colour to the outdated command which
fits in with other places such as the CLI's update
checker. Also, switches `->` to `→` which also
fits in with the CLI's update checker.
2025-02-13 20:16:42 +01:00
daimond113
82e0d38483
fix: print update available message to stderr
Previously, the update available message was
printed to stdout, which is not the correct
place for such messages. This commit changes
the message to be printed to stderr instead,
which will prevent potential issues with
piping the output of the command to another
command.
2025-02-13 20:10:08 +01:00
daimond113
ae3530126f
feat: add i alias to install command
Adds an alias `i` to the `install` command, which
is common in a few other package managers.
2025-02-12 23:15:01 +01:00
daimond113
4786adf187
refactor: make aliases case-insensitive
Previously, aliases: `foo` and `Foo` were treated
as different aliases. This could cause issues with
linking on case-insensitive filesystems. This
commit makes aliases case-insensitive, but they
will be stored in the case they were defined in.
2025-02-12 23:14:05 +01:00
daimond113
04aaa40c69
refactor: make specifier index not an option
Instead, we use the `default` serde attribute
to deserialize the index as `DEFAULT_INDEX_NAME`
if it is not present. This removes a lot of
redundancy around the codebase about getting
the index name.
2025-02-12 17:41:49 +01:00
daimond113
c6e7e74a53
fix: fix double long prefix paths on windows
Our previous attempt at fixing the long path issue
on Windows has caused a regression. This commit
attempts to fix both issues by simply
canonicalizing the path.
2025-02-10 22:52:00 +01:00
daimond113
ea9c7e6b39
fix: compile out patches without feature 2025-02-10 09:01:26 +01:00
daimond113
b6799e7400
fix: compile out patches without feature 2025-02-10 08:55:41 +01:00
daimond113
faaa76cf0d
fix: include new files in patches
Previously, newly created files would not be
included in patches. This commit fixes that.
Additionally, removes some left over dbg! calls.
2025-02-10 08:43:48 +01:00
daimond113
1d131e98c6
refactor: patch improvements
Patches now work much better with incremental
installs. They use a Git repository to reset
the patch to the original state before applying
it. They are now also properly cleaned up after
being removed. Also, to allow more flexability
the patching process is now done before type
extracting, so that types can be patched. Lastly,
the patch-commit command now doesn't delete the
patch directory until it has done everything else
to prevent data loss.
2025-02-10 00:35:51 +01:00
daimond113
8bb8888de8
fix: correct windows script linker require paths
The pathdiff crate doesn't behave properly when
one path begins with a long path prefix
and the other doesn't, so we always put the
prefix on paths.
2025-02-09 20:10:55 +01:00
daimond113
1a79326ebf
fix: refresh sources before reading from them
Previously, if a package was modified in a way
that the index hasn't been cloned (for example,
through a remote Git change) pesde would be unable
to read the package's metadata, whether it be
because the index was outdated or because it
wasn't cloned at all. These are now refreshed
as needed like everywhere else.
2025-02-08 14:03:43 +01:00
daimond113
a4927bf4be
fix: fix types not being re-exported
Code responsible for removing the file at the
destination has been removed which broke the
re-exporting of types. This commit reverts
that change, but also silences Windows errors
when removing the file.
2025-02-08 00:48:42 +01:00
daimond113
4d39ddae04
fix: point to the right path when fresh installing engines 2025-02-08 00:29:55 +01:00
daimond113
c71e879bfd
fix: fix linux zbus panicking
Fixes zbus on Linux panicking due to the crate
spawning a runtime inside of our own runtime. This
is avoided by using the sync mode of the crate
instead of async. Additionally, keyring operations
have been wrapped in spawn_blocking to avoid
blocking the async runtime.
2025-02-07 20:53:31 +01:00
daimond113
daf0861eb3
feat: colour deprecation message
Colours the text in the deprecation message to
match the yank command's UI.
2025-02-07 11:26:59 +01:00