How the package format is read
This is the detail behind The package format: exactly how Jadpo reads a package's folder, its names and the lock. Read it when you write a package by hand or a check refuses one.
- A package's name is its folder's.
packages/acme_couriers/v1/isAcmeCouriers.v1: the folder's name inUpperCamelCaseand its version folder, which the index has to give (package.name_mismatch). A version label isvand digits in groups joined by single underscores,v2orv2024_06_20; the lock sorts the groups as numbers. - What a package's code sees. Only its own declarations, bare, and the
built-ins: not the app's
shared/, domains, connections or other packages, since an installed package is published apart from any app and the app's own integration is written so that it could be. Its files need nouselines. It doesn't read the app'sshared/; whether it should is an open question in the design notes, and allowing it later breaks no package. - Bringing a package in.
use packages/<name>for an installed one anduse shared/providers/<name>for the app's own bring the whole package in, asuse <domain>does; there is no{ ... }form, since its names are always written through it.jadpo fmtsorts these lines after the domains'. - Names through a package. A type (
Postcodes.UkPostcode), a failure (fails Postcodes.InvalidPostcode), a type built from a value (Postcodes.UkPostcode(text)) and a public library's function (Postcodes.uk.parse(text)) are all written through the package's name. - Its failures. A package's failure is known through its package in
every
failslist and outcome, and its code is the package's, not the app's: it isn't checked against the app's failure codes. - The index. A
///description is required, as arelicence:andjadpo:;jadpo:is a major and minor number as text, compared with nothing until Jadpo has a language version to compare it with.Licence.proprietaryis refused for an installed package whose lock line isn't agitsource; the app's own integrations may use it. provider.jadpo. Its top-level keys are checked, withhosts:' (live:,sandbox:),idempotency:'s (withwindow:required) andruns:'s keys; the others' values are read where they are used.protocol:is required, andhosts:withruns:ispackage.provider_invalid.- The kind. A package with
resources/needsprovider.jadpo(package.provider_missing); a provider package carryingtranslations/ispackage.provider_translations. - The digest.
sha256:and the SHA-256 of one line per file,<the SHA-256 of its bytes> <its path>, paths relative to the package's folder in byte order, as Go'sdirhashdoes; every file in the folder counts, hidden ones left out, so a changed, added or removed file ispackage.digest_mismatch. - What isn't compiled. An installed package's tests (run when it is
published, not in the app's
jadpo test), itsrecipes/andsample/are read only for its digest. The app's own integration's tests run with the app's. - Reserved names.
Stripe,TwilioandGitHub, the curated packages this page names, compared by folder without underscores; only the app's own integration is refused one. - A name the app uses. A package's folder name may not be a domain's or
a library's, its name in code may not be a declaration's, and an
installed package and the app's own integration never share a name
(
package.name_taken). - The lock.
jadpo checkreadsjadpo.lockand the committed folders only: each installed package needs its line (package.not_locked), each line other than alinkits package (package.not_installed). Alinkline names a checkout, which every check compiles in the installed folder's place ("How packages are installed and linked").
Capability mappings other than
receiving's andtoolchain.not_built_yetwhere it is declared.
Markdown for agents: /docs/how-the-package-format-is-read.md.Built from Jadpo main at a707efb.