A package's names, and watching a linked checkout
How a name written through a package is told apart from the app's own,
and how jadpo dev and jadpo test --watch follow a package you have
linked to a checkout you are working on.
- Where a package's name must be unique. In its package only. Two
declarations of one package can't share a name
(
semantic.duplicate_declaration), but none clashes with the app's, of any kind and wherever it is declared (a domain,shared/, public or not), nor with another package's:Postcodes.uk.tidybeside the app's actiontidy, orPostcodes.UkPostcodebeside the app'sUkPostcodeandZipCodes.UkPostcode, are three things. Their file names never fold together either, since each package is its own folder. A package's library may be named as an app's library or domain is, since it is always written through its package. - Which one a name means. In the app, a bare name is always the
app's and
Postcodes.<name>always the package's, so returningPostcodes.UkPostcodewhere the app'sUkPostcodeis declared istype.mismatch. Inside a package, a bare name is the package's own. Failures keep their package too:fails Postcodes.InvalidPostcodeand the app'sfails InvalidPostcodeare told apart in tests and at runtime. - What a watch watches. The files every load reads: for a linked
package, its checkout's sources and data, each at its path in the
package's folder (
packages/postcodes/v2/libraries/uk.jadpo), and not the installed copy, which stays as it was. The watcher reads the lock at every look, sojadpo package linkorunlinkwhilejadpo devorjadpo test --watchruns moves the watch, andtest --watchreads the whole folder again from where it now lives. A save in the checkout gets the watcher's guard for a file emptied mid-save.jadpo devloads the project afresh on each save, so it needs nothing more. - Where its problems show. At the checkout's paths in
jadpo test,test --watchandjadpo dev, asjadpo checkshows them, since that is where they are fixed; the rule line still names the save at the package's path, as the project reads it.
PreviousHow connections to packages are readNextTwo versions side by side, lazy loading and the package cache
Markdown for agents: /docs/package-names-and-linked-checkouts.md.Built from Jadpo main at a707efb.