Config
defineAstroid(config)
Section titled “defineAstroid(config)”function defineAstroid(config: AstroidConfig): AstroidConfig;An identity function in the shape of Astro’s defineConfig: returns the config
verbatim with full inference, and validates the invariants that would otherwise
fail deep inside generation. Throws AstroidConfigError on:
- an empty
key(it names every generated binding) - a missing
theme.nameortheme.colors.brand - a commerce provider assigned to a role its client can’t serve
portal.gated, which is not implemented and refused rather than silently wiring no guardeditor: falsealongside an option that configures the editor, such assections,media,settings,inquiries: trueor aninquiriesobject, or therealtimemodule- an
inquiriesthat isn’t a boolean or an object, or aninquiries.publicFormthat isn’t a boolean editor: falsewith theauthRateLimitmodule and no portal, since nothing signs in for the limiter to guard- a
creditwith noname, anhrefthat isn’t an absolutehttporhttpsURL, or alogothat isn’t a root-relative path or anhttpsURL - a
businessfact thatIntldoesn’t accept: a time zone that isn’t IANA, a currency that isn’t an uppercase ISO 4217 code, a country that isn’t an uppercase ISO 3166-1 alpha-2 code, or a locale that isn’t a BCP 47 tag in canonical form commercewithoutbusiness.currency, or with a currency whose minor units aren’t 2 digits
Key types: AstroidConfig, Archetype (marketing | storefront | wholesale | portfolio), ModuleKind (map | pwa | wholesaleInquiry), SectionKind,
Theme, Portal, CommerceConfig, BusinessConfig, CreditConfig, InquiriesConfig, SeoConfig, SecurityConfig, PwaConfig.
ASTROID_ARCHETYPE_SECTIONS maps each archetype to its default home sections.
business
Section titled “business”interface BusinessConfig { timeZone?: string; // IANA, for example, "Europe/Berlin" currency?: string; // ISO 4217, for example, "EUR" country?: string; // ISO 3166-1 alpha-2, for example, "DE" locale?: string; // BCP 47, for example, "de-DE"}The facts louise-toolkit takes as parameters: louise-toolkit/dates needs the
time zone, formatMoney the currency and locale, and the Square wallet sheet
the country and currency. None has a default. commerce requires currency,
and the others stay unset until the site states them.
inquiries
Section titled “inquiries”inquiries?: boolean | InquiriesConfig;
interface InquiriesConfig { publicForm?: boolean; // default true}Omitted, inquiries are on for a site with a contact section or the
wholesaleInquiry module. true and false force them on or off. An object
turns them on, and publicForm: false keeps the inquiries table, the
Inquiries tab, and the inbox count while leaving out the public form route,
POST /api/louise/forms/inquiries, and the imports only it uses. Set it when
the site’s own endpoint writes the inquiries table. See
Inquiries.
capturesInquiries(config) reports whether the project has inquiries, and
servesInquiryForm(config) whether its worker mounts the public form route.
astroidBusiness(config, fact?)
Section titled “astroidBusiness(config, fact?)”function astroidBusiness(config: AstroidConfig): AstroidBusiness;function astroidBusiness(config: AstroidConfig, fact: AstroidBusinessFact): string;With no fact, returns all four, each undefined where the config states
none. With a fact, such as "currency", returns it as a string, or throws
an AstroidConfigError that names business.<fact> when it’s missing.
Generated code uses the second form.
astroidSeoLocale(config)
Section titled “astroidSeoLocale(config)”Returns seo.locale when it’s set, and otherwise business.locale in Open
Graph form: de-DE becomes de_DE. Returns undefined for a locale with no
region, such as de, rather than choosing a territory. The scaffold’s layouts
pass it to <Seo>.
Other exports
Section titled “Other exports”astroidHasEditor(config) reports whether the project has a Louise editor,
which is true unless the config sets editor: false. ASTROID_API_PREFIX is
/api/v1, the prefix an editor-free app’s rate rule covers.