Extracts COSMIC data movements (E/R/X/W) from Salesforce Lightning Web Components and outputs JSON for posting to a COSMIC database. Supports standalone measurement and optional adapter use by other measurers such as FlexiPage.
Produce a COSMIC measurement for one LWC bundle: classify Entry, Read, Write, and Exit movements, merge imported Apex class movements, and emit JSON matching .cursor/skills/cosmic-measurer/reference.md.
<name>.js, <name>.html, optional <name>.js-meta.xml).@wire and known LDS/UI API read calls.@salesforce/apex/Class.method), resolve class files in configured search paths, run cosmic-apex-measurer, and merge returned rows (excluding Apex canonical exit).Errors/notifications).E/R/W/X) for caller contracts.CLI:
python3 .cursor/skills/cosmic-measurer/cosmic-lwc-measurer/scripts/measure_lwc.py --bundle-dir samples/cfp_FunctionalProcessVisualiser --json
python3 .cursor/skills/cosmic-measurer/cosmic-lwc-measurer/scripts/measure_lwc.py --bundle-dir samples/cfp_FunctionalProcessVisualiser --required-type W --apex-search-paths samples
movementType must be one of E, R, W, X.Errors/notifications (dataGroupRef: status/errors/etc).viaArtifact and use implementationType: apex.traversalWarnings.samples/cfp_FunctionalProcessVisualiser against expected/cfp_FunctionalProcessVisualiser.lwc.expected.json.Human summary:
order, movementType, name, dataGroupRef, implementationType, artifactName, isApiCall).JSON:
{
"functionalProcessId": "<Id>",
"artifact": { "type": "LWC", "name": "cfp_FunctionalProcessVisualiser.lwc" },
"dataMovements": [
{ "name": "Receive user interaction", "order": 1, "movementType": "E", "dataGroupRef": "User", "implementationType": "lwc", "isApiCall": false },
{ "name": "Read data via LWC data services", "order": 2, "movementType": "R", "dataGroupRef": "Unknown", "implementationType": "lwc", "isApiCall": false },
{ "name": "Errors/notifications", "order": 3, "movementType": "X", "dataGroupRef": "status/errors/etc", "implementationType": "lwc", "isApiCall": false }
],
"traversalWarnings": []
}