Publishing to ForgeBox
Package your project, log in, and publish it to ForgeBox with versioning.
Any folder with a box.json is a package. In this lesson you will describe your package, bump its version and publish it to ForgeBox so anyone can install it.
Describe the package
Run package init in the project root to create a box.json. Set the fields ForgeBox needs.
box package init slug=my-package type=modules
{
"name": "My Package",
"slug": "my-package",
"version": "1.0.0",
"type": "modules",
"ignore": [
"**/.*",
"test",
"tests"
]
}
slugis the unique id people use to install it.typetells ForgeBox and CommandBox what kind of package this is, for examplemodules.ignorelists files left out of the published zip.
ForgeBox also reads a readme, instructions and changelog file from your project (.md or .txt) for the package page.
Version, log in, publish
1
Bump the version
box bump --patch
Use --minor or --major for bigger changes. In a clean Git repo this also creates a tag.
2
Log in to ForgeBox
box forgebox login
You need a free account from forgebox.io.
3
Publish
box publish
If the version already exists, its metadata is updated. If it is new, it is added.
Check it
box forgebox show my-package
box install my-package
Add --private to package init to create a package only you can see.
Recap
- A package is a folder with a
box.jsonthat hasname,slug,version,typeandignore. box bumpchanges the version using semantic versioning.box forgebox loginthenbox publishputs your package on ForgeBox.