Skip to main content

Module scaffold

Module scaffold 

Source
Expand description

File generation for luxid new and luxid make:model.

Generation is split into planning and writing. A Plan is a pure value — which files, with what contents, and which lines to insert into existing ones — so the interesting logic is testable without touching a disk.

Writing never overwrites. A generator that clobbers hand-written code once is a generator nobody runs again.

Structs§

Insertion
A line to insert after a marker in an existing file.
ModelFlags
Which artefacts make:model should produce.
NewFile
A file to create.
Plan

Enums§

Client
The client framework an Inertia app is built with.
Dependency
How the generated app should depend on Luxid.
Stack
What kind of application luxid new produces.

Constants§

MARK_FIELDS_CLOSE
MARK_FIELDS_OPEN
MARK_MIGRATIONS
MARK_MIGRATION_MODULES
MARK_MODULES
MARK_ROUTES

Functions§

apply
Insert line immediately above marker, matching the marker’s indentation.
field_attributes
Attributes a user wrote above each field inside the markers.
make_model
new_app
refresh_fields
Replace the body between the field markers, preserving everything else.
write
Write a plan to disk.