12345678Build a ball pit · Step 8 of 8
Share it
You'll learn
- Choose a title and a license
- Check a package with
pkg check - Pack it with
pkg pack
- Time
- 10 min
- Builds on
- Step 7: Test it
Your ball pit is ready for other people. In this step you give it a title and a license, check it, and pack it into one file that anyone with DatumHue can run.
Give it a title and a license
People see a package by its title. Without one, DatumHue makes a title
from the name: @alice/ball-pit reads Ball Pit. A title can say more
than a name can, with capitals, spaces and punctuation.
The license says what others may do with your package. List the
licenses DatumHue accepts with
pkg license:
$ datumhue pkg license
pkg new chose 0BSD: anyone may use the package for anything. To let
anyone play your pit while you keep every other right, pick
LicenseRef-DatumHue-Freeware. Package licenses
holds the full text of each.
Open ballpit/package.kdl, add a title and a description, and change
the license:
name "@alice/ball-pit"
New line: title "Alice's Ball Pit"
New line: description "Balls that fall, bounce and pile up."
version "0.1.0"
api_version "*"
kind "app"
New line: license "LicenseRef-DatumHue-Freeware"
titleis one line of at most 40 characters.descriptionsays in a sentence what the package is.
Check and pack it
Check the package, then pack it:
$ datumhue pkg check ballpit
$ datumhue pkg pack ballpit
pkg checkreads the manifest and the package's files. It prints a line that starts withOK, or each problem it finds.pkg packwrites the package into one file, an archive, next to the folder. Its name comes from the package's name and version:alice-ball-pit-0.1.0.dhpkg. It holds the manifest,init.luaandlib/; the tests, the README and the editor files stay behind.
Run the archive as the people you send it to will:
$ datumhue run alice-ball-pit-0.1.0.dhpkg
The pit starts with the balls you left in it. Run from its folder or from its archive, it is the same package, with the same store.
Publish it
Publishing puts your package in the registry that serves its
namespace, where everyone who uses the deployment can install it. Sign in with
datumhue login, then push the package's folder
with pkg push:
$ datumhue login
$ datumhue pkg push ballpit
Your sign-in must own the package's scope, so before you push, change
@alice in the manifest's name to your own scope.
Publish and maintain a release
covers dependencies, new versions and retiring a release.
Try this
- Raise
versionto0.2.0and pack again. What is the new archive called? - List what the archive holds with
datumhue pkg ls alice-ball-pit-0.1.0.dhpkg. - Unpack the archive into a new folder with
datumhue pkg unpack, and run that folder.
Recap
titleis the name people see.licensesays what they may do with your package.datumhue pkg checkchecks a package without packing it.datumhue pkg packmakes a.dhpkgarchive, whichdatumhue runruns as it runs a folder.