FPM.ftd
file in any folder:FPM.ftd
marks a folder as fpm
package-- import: fpm -- fpm.package: fpm.dev zip: github.com/fifthtry/fpm.dev/archive/refs/heads/main.zip base: https://raw.githubusercontent.com/fifthtry/fpm.dev/main
fpm.dev
. Packages in FPM are named after the domain where they would be published. Every FPM package is a website.FPM.ftd
file:-- import: fpm -- fpm.package: fpm.dev zip: github.com/fifthtry/fpm.dev/archive/refs/heads/main.zip -- fpm.dependency: fifthtry.github.io/doc-site as ds
Here fpm.dev
has a dependency on fifthtry.github.io/doc-site
.
We have also used “alias” feature to bind the name of this dependency to ds
, so FTD files can write -- import: ds
instead of having to use the full path, e.g. -- import: fifthtry.github.io/doc-site
.
Unlike other package managers like pypi, npm and crates, there is no central package repository in FPM. Since every FPM package is a website, that website acts as the package repository.
What this means is when fpm
sees fifthtry.github.io/doc-site
as a dependency, it fetches the content of fifthtry.github.io/doc-site/FPM.ftd
file which acts as the meta data for the package, and the meta data includes the URL from where the package ZIP can be downloaded.
In our examples we use Github’s zip serving feature to let Github generate and distribute our .zip file. If you are not using Github
, you can store the zip file containing entire package in some other location, like S3, or a server you control, and fpm
will work with that.