Workflow
Configuration
Every project has an eventvisor.config.js file in its root.
The smallest useful configuration can rely on the defaults:
module.exports = { tags: ["all", "web", "backend"],};Main options#
| Option | Default | Purpose |
|---|---|---|
tags | ["all"] | Nonempty allowlist for entity tags used by Targets and CLI filters |
sets | false | Read independent projects below sets/<set>/ |
parser | "yml" | Built in yml or json parser, or a custom parser object |
prettyDatafile | false | Format generated JSON with indentation |
stringify | true | Stringify supported runtime expressions for compact datafiles |
onValidationFailure | "drop" | Default policy for invalid events |
datafileNamePattern | "eventvisor-%s.json" | Output filename pattern, which must contain %s |
Entity tags are optional. When present, every tag must be declared in tags.
The validation failure policy accepts "drop", "deliverWithWarning", or a quarantine destination:
module.exports = { onValidationFailure: { action: "quarantine", destination: "invalidEvents", },};An event can override the project policy. See Events.
Sets and promotion flows#
Enable Sets when one repository contains isolated authoring trees. promotionFlows can then restrict the allowed promotion directions:
module.exports = { sets: true, promotionFlows: [ { from: "development", to: "staging" }, { from: "staging", to: "production" }, ],};When promotionFlows is omitted, any two different Sets can be used as the source and destination.
Directory paths#
The default authoring directories are events, attributes, destinations, effects, schemas, targets, and tests. Their configuration properties follow the <entity>DirectoryPath naming pattern, such as schemasDirectoryPath.
Generated state, datafiles, Sets, and Catalog output use systemDirectoryPath, datafilesDirectoryPath, setsDirectoryPath, and catalogExportDirectoryPath.
Use <rootDir> in a configured path when it should resolve from the selected project root:
module.exports = { eventsDirectoryPath: "<rootDir>/tracking/events",};Parsers#
Use the built in JSON parser by setting parser: "json". A custom parser provides an extension plus parse and stringify functions:
module.exports = { parser: { extension: "custom", parse(content, filePath) { return parseCustomFormat(content, filePath); }, stringify(value, filePath) { return stringifyCustomFormat(value, filePath); }, },};See Parsers for the complete contract.
Datasource and plugins#
Project configuration can also register typed CLI plugins with definePlugin() from @eventvisor/core. Plugins receive the resolved project, datasource, and parsed options. Command names must not conflict with built-in commands.
Advanced projects can replace the filesystem datasource by providing an adapter constructor. Most projects should keep the default filesystem adapter.
Inspect resolved configuration#
Run npx eventvisor config to inspect the resolved paths and options.
$ npx eventvisor config$ npx eventvisor config --json --pretty
