CLI hooks
Learn more about CLI hooks to add custom component properties.
Scanning with a hook script
npx @omlet/cli analyze --hook-script ./path/to/hook-script.jsyarn dlx @omlet/cli analyze --hook-script ./path/to/hook-script.jspnpm dlx @omlet/cli analyze --hook-script ./path/to/hook-script.jsafterScan hook
afterScan hookmodule.exports = {
async afterScan(components) {
for (const component of components) {
component.setMetadata("hasStories", await hasStories(component.filePath));
component.setMetadata("hasTests", await hasTests(component.filePath));
}
}
}Component object properties
Component object propertiesProperty
Type
Description
Analyzing custom component properties


Next up
Tutorial 1: Team/code owner usageTutorial 2: Package version trackingOther example scriptsLast updated