Table of Contents
Server-side functionality
This is for Argentum 2, which is included with Halyde 3.0.0+. For the original Argentum, see Argentum 1.
Master configuration file
The master configuration file is located at /ag2.json in the repository. It contains the bulk of the package information. It is in JSON format. Here is an example of how it could look like:
{
"test-package-name": {
"type": "package",
"version": "X.X.X",
"description": "Your package description goes here.",
"dependencies": [
"dependency1",
"dependency2=1.2.3"
],
"conflicts": [
"conflict1",
"conflict2"
],
"mainDirectory": "packages/packageName",
"files": [
"file1",
"halyde/apps/file2",
],
"directories": [
"packageDir",
"packageDir/something"
],
"config": [
"/packageDir/something/config.json"
],
"scripts": {
"pre-install": "extra/pre-install.lua",
"post-install": "extra/post-install.lua"
}
}
}
Note that you may only use lowercase letters, numbers and dashes (-) in package names.
test-package-nameis your package's name;typeis the entry's type (in this casepackage);versionis set to your package's version;descriptionis a brief description of your package (optional);dependenciesis a list of packages your package depends on (optional) (Advanced Versioning Syntax may be used here);conflictsis a list of packages your package conflicts with and cannot be installed alongside (optional) (Advanced Versioning Syntax may be used here);mainDirectoryis somewhat like a root directory in which all of your package's files are contained in the repository. For example, when downloadingfile1.txtfor a package that hasmainDirectoryset tosome/directory, the file will be downloaded fromsome/directory/file1.txt, but it will be placed in/file1.txtin the user's system. This is useful for multi-package repositories where two packages can provide different files in the same location. (optional);filesis a list of files that will be downloaded when installing your package relative to themainDirectory(optional);directoriesis a list of directories that will be created when installing your package relative to themainDirectory(optional);configis a list of config files for your package. They will be created upon installation, but not changed upon updating. When removing the package, the user will be asked whether to remove the config files or not (optional);scriptsis for scripts that will be run before/after installation/update of your package (optional):pre-installis the path of the script that will be run before installing/updating your package relative to themainDirectory(optional);post-installis the path of the script that will be run after installing/updating your package relative to themainDirectory(optional).
Multiple such packages can be contained in one master configuration. It is also possible to create package groups like this:
{
"test-group-name": {
"type": "group",
"description": "Your group description goes here.",
"packages": [
"package1",
"package2",
]
}
}
And there are also virtual packages, which act the same as groups except you pick one package instead of installing all of them. They are made the same way as groups, just with type set to virtual-package.
Note that you may only use lowercase letters, numbers and dashes (-) in group names.
test-group-nameis your group's name;typeis the entry's type (in this casegroup);descriptionis a brief description of your package group (optional);packagesis a list of packages in your group (Advanced Versioning Syntax may be used here);
As you can see, package groups are much simpler. They aren't much but a way to install or uninstall many packages at once.
Versioning
It may occur that a certain package depends on a specific version of another package, and the latest version won't do. This is why all versions of a package should ideally be kept available at all times. This is done with some directories in your repository. For each package, there has to be a package-name-here-versions/ directory in your repository's root. If this is not present, only the latest version of your package will be available, and packages that depend on older versions will break.
Inside the package-name-here-versions/ directory, for each version there is another directory (for example, package-name-versions-versions/1.2.3) which has all the files needed for the package and a copy of the master configuration (ag2.json) with only that package. There is also no mainDirectory option, as package-name-here-versions/1.2.3 is set as the main directory and it would be pointless to change it.
Every time a new version is released, the corresponding directory in package-name-here-versions should be made and all the package's files and its config copied into it. If you use GitHub to host your repository, you can use this nifty GitHub Action I've made to automate the process.
