casual-simulation / casualos

Casual Open Simulation for the Web
https://ab1.bot
MIT License
48 stars 9 forks source link

Add package records #527

Open KallynGowdy opened 1 month ago

KallynGowdy commented 1 month ago

Package records are like NPM packages or ABs, but as an official record type. Like ABs, they are a way of easily sharing AUX files around. Unlike ABs, they are designed primarily around the use-case of sharing reusable library code. Every package is contained in a record, and every package has a name. Like other record types, packages can have markers which determine what can be done with them. Additionally, packages have versions which cannot be overwritten. Packages should also be able to mark scripts as "entry points", which are the scripts that should be called for different kinds of requests. For example, a script could be marked as the entry point for all web requests, while another script could be marked as the entry point for all RPC requests.

Finally, packages are designed to be used by scripts. Scripts can request that packages are loaded and get package metadata. However, the CasualOS player doesn't automatically load packages. Instead, that will be left up to user scripts.

Finally, because these will be a separate record type, it will be easier for us to provide global search across all packages.