compiler
@webda/compiler
The build toolchain for Webda applications. It compiles on TypeScript 7.1 through @webda/content-mapper, generates the module manifest (webda.module.json) and JSON Schemas for all models and service parameters, and can migrate sources written for older Webda versions.
When to use it
- Run
webdac buildonce after making changes to build and generate the module manifest. - Use
webdac build --watchduring development to rebuild on every change. - Use
webdac codeonce when migrating an application from an older Webda version (moved imports, obsolete filter registrations).
Install
npm install --save-dev @webda/compiler
The webdac binary is included.
Commands
webdac build
Compiles the application TypeScript and regenerates webda.module.json and all schemas.
webdac build # one-shot build
webdac build --watch # watch mode: rebuild on every change under src/
webdac build --appPath /path/to/app
What it does:
- Compiles with TypeScript 7.1 through
@webda/content-mapper, which generates accessors,toJSONand behaviours, type-checks the result and emits ES modules tolib/ - Discovers models, services, deployers, and beans with the same type checker
- Generates per-model JSON Schemas (input, output, stored)
- Writes
webda.module.jsonat the project root - Merges dependency modules from
node_modules - Writes
.webda-config-schema.jsonand.webda-deployment-schema.json
webdac code
Migrates application sources written for an older Webda version, in place:
webdac code # run every migration module
webdac code --module updateImports # run a specific module
Migration modules available:
| Module | Description |
|---|---|
updateImports | Moves imports to the packages that now own them |
capabilities | Removes filter registrations the framework now does automatically |
It no longer generates code: webdac build does, without touching your sources.
webda.module.json format
{
"$schema": "https://webda.io/schemas/webda.module.v4.json",
"beans": {
"MyApp/MyBean": {
"Import": "lib/services/mybean:MyBean",
"Schema": { ... }
}
},
"moddas": {
"MyApp/MyService": {
"Import": "lib/services/myservice:MyService",
"Schema": { ... }
}
},
"models": {
"MyApp/Post": {
"Import": "lib/models/post:Post",
"Schema": { ... }
}
},
"deployers": {},
"schemas": {}
}
See also
Classes
Interfaces
- BehaviorMetadata
- ConfigSchemaApplication
- GitInformation
- ModelMetadata
- OperationEntry
- OperationsExportFormat
- PackageDescriptor
- ProjectInformation
- WebdaModule
- WebdaPackageDescriptor
Type Aliases
- CommandArgDefinition
- CommandDefinition
- ModelGraph
- ModelGraphBehaviorDefinition
- ModelGraphBinaryDefinition
- ModelRelation
- PackageDescriptorAuthor
- ServiceMetadata