Component check
A lint check that fails when a frontend layer or its backend names a DMS component that neither the installed DMS, its renderer nor the layer registers.
Vue renders a tag it cannot resolve as an empty element, so a DMS component that a release renamed leaves its place empty with no error. assertDmsComponents from @antelopejs/dms/checks/dms-components fails on each Dms* or dms-* component a frontend layer names that neither the installed @antelopejs/dms, the installed @antelopejs/dms-frontend nor the layer registers. Call it from the layer's lint script, with the module's backend sources, and declare the packages it resolves from the layer:
{
"scripts": {
"lint": "node --input-type=module -e \"import { assertDmsComponents } from '@antelopejs/dms/checks/dms-components'; await assertDmsComponents({ layer: '.', sources: ['../src'] });\""
},
"devDependencies": {
"@antelopejs/dms": ">=0.20.1 <0.21.0",
"@antelopejs/dms-frontend": ">=0.11.4 <0.12.0",
"typescript": ">=5.8.0 <7.0.0",
"vue": "^3.5.0"
}
}
A layer with other lint steps chains them with &&. A layer that already lists vue under dependencies keeps it there.
@antelopejs/dmsships the check and the names its own components register under.typescriptandvueparse the layer's files. The check resolves them from the layer, then from where@antelopejs/dmsis installed. When neither has one, it fails before it reads a file, and the message gives the command that adds it.@antelopejs/dms-frontendonly lists the components its renderer registers itself, such asDmsLinkandDmsClientOnly, and the check resolves it from the layer alone. Without it the check still runs, and those components count as unknown. A failing run then ends with a line that names the package and the command that adds it.
Each failure names the file, the line and the component. The check reads:
- each tag and static
isof the layer's.vuefiles, except a name the file's script imports or declares at its top level; - each string the layer passes to
resolveComponent; - each string of the layer or of
sourcesthat an@antelopejs/interface-dmsbuilder takes as a component name: the argument ofCustomComponent(...)andnew ComponentBuilder(...), acomponentNameproperty, and thecomponentof a layout banner.
A string counts when it is written in place, or when the name it is passed by refers to a const of the same file holding it. A name built at run time, such as a template literal with a substitution, is not checked.
The layer registers its componentPrefix before the file name of each component under app/components/ or app/build/components/, before the path of each custom page, and before each string it passes to registerComponent without { prefix: false }. The check reads the first componentPrefix written as a string, or as a const of dms.frontend.ts holding one. A layer without a componentPrefix registers its names as given; the check fails only when every componentPrefix it finds is written another way. Its layouts are the paths below app/custom-layouts/ and the strings it passes to registerLayout.
A tag and a resolveComponent string resolve as Vue resolves them, so dms-card-panel and DmsCardPanel name the component DmsCardPanel, and DmsCardpanel names none. A builder string resolves as the registry looks it up, letters and digits compared without case. A componentName may also name a layout.
Directories whose name starts with a dot or is node_modules, dist, test, tests or fixtures are skipped, and so are .test, .spec and .d.ts files.