Naming
How one Noun is spelled in a file name, in code, in a route, in an id and in an Event, and which names a project cannot use.
One Noun has one name, spelled six ways by where it appears. The compiler derives every spelling from the file name.
One Noun, six spellings
Leaseline declares a Lease Noun, and the platform ships CreditGrant:
| Where | Rule | Lease | CreditGrant |
|---|---|---|---|
| File name and code | PascalCase, singular | nouns/, $.Lease | nouns/, $.CreditGrant |
| Route | kebab-case, plural | /leases | /credit-grants |
| Record id | snake_case prefix and a number | lease_1 | credit_grant_1 |
| A property that references it | camelCase | lease | creditGrant |
| Verb | Noun.verb, the Verb in camelCase | Lease.renew | CreditGrant.apply |
| Event | Noun.pastTense | Lease.renewed | CreditGrant.applied |
A Verb's Function takes both names in its file name: nouns/. In a route the Verb is a path segment, /leases/, never :renew or .renew (routing).
Everything else
| Name | Rule | Example |
|---|---|---|
| Properties, inputs, keys and Settings | camelCase | endsOn, refundWindow, approvalHours |
| Folders for a Team, Role, Process, Site or App | kebab-case | agents/, workflows/ |
| Components | PascalCase | components/ |
| Offers, Products, Plays and Evaluators | kebab-case | offers/, evaluators/ |
| Domains | the hostname | domains/ |
| Enum values | camelCase | atBound:, signup: |
| Stripe's own fields | snake_case, only in the mapping tables | tax_ids beside taxIds (Stripe) |
Names a project cannot use
| Name | Why |
|---|---|
| A record or Collection named like a declared Verb | A Verb is a path segment, so /leases/ would mean two things; the write is refused |
One Verb declared in a Noun file and in verbs/ | It would have two definitions; the parse check fails |
| A Noun file named for an inherited Noun | Allowed: it refines the inherited Noun, adding properties and Verbs |
generated/ and .sb/ | The platform writes them; a push to either is refused |
A folder starting with _ | Unmanaged: the compiler skips it and it never reaches db.sb |
| Two root files in one folder | startup.ts, startup.mdx and startup.json are one Startup; pick one |