Uses
Write down which systems each system may use, and shot check catches every link you didn't plan and every pair of systems that would use each other.
One uses line in a system's Types.shot names the systems its files may reach through use, require and imports. A system without one isn't checked, so you can add them one system at a time.
The line
Market/Types.shot
uses Wallet, Utils
import Signal from @shot.Utils.Signal- A system's Types.shot has one
usesline. It covers every file of the folder. - Names are folders from the project root, and a name covers the folders under it:
Utilsmeans any util,Utils/Signaljust that one. - A system may always use its own folder.
uses nothing: only its own folder.uses everything: anything, for a system like Init that starts all the others.- No
usesline: the system isn't checked, and a project without any gets nouseserrors at all. - Utils are systems too. Utils/Gate/Types.shot says
uses Utils/Signaland Utils/Signal/Types.shot saysuses nothing, so copying a util into another game shows exactly what comes with it. - The
usesline only allows a link. A Market file still reaches Signal withuse @shot.Utils.Signal(a bareuse Signallooks only in Market and the folders above it), and a Signal in a Market signature needsimport Signal from @shot.Utils.Signalin Market/Types.shot (Types, IMPORTING FROM ANOTHER SYSTEM).
What counts
Links are use and require lines, and imports in Types.shot. A declared event is imported like a type (import CoinsGiven from Wallet), so hearing another system's event counts as using that system (see Events). EventBus topics that are not declared events don't count.
What shot check reports
A link the line doesn't allow, two systems that would use each other, and a uses line in the wrong place or written wrong:
Market/MarketServer.shot:3:1 Market may use Wallet and Utils (Market/Types.shot:1), not Prizes: add Prizes there (calling it and hearing its declared events both count as using it)
Wallet/Types.shot:1:1 Wallet and Market would use each other (Market/Types.shot:1 lets Market use Wallet): drop one direction, e.g. turn a call into an event the caller declares in its Types.shot and the other imports, which reverses that link
uses goes in the system's Types.shot, where it covers every file of the folder
uses Wallet Utils: give folders from the project root, like uses Wallet, Market, Utils/Signal (or uses nothing, uses everything)Seeing it
shot wiring, and the wiring part of shot overview, list each system's uses line under SYSTEM DEPENDENCIES. A system without one shows what it really depends on, marked (not declared) once any system of the project has a uses line. shot docs, run without a name, starts with how many uses lines the project has.
