vue-spec-maintenance
Perform maintenance tasks for @markuplint/vue-spec: add global attributes,
add element-specific overrides, and update Vue extended specifications.
Input
$ARGUMENTS specifies the task. Supported tasks:
| Task | Description |
|---|---|
add-global-attribute | Add a new Vue global attribute |
add-element-override | Add an element-specific attribute override |
If omitted, defaults to add-global-attribute.
Reference
Before executing any task, read docs/maintenance.md (or docs/maintenance.ja.md)
for the full guide. The recipes there are the source of truth for procedures.
Also read:
- •
ARCHITECTURE.md-- Package overview, ExtendedSpec structure, and integration points - •
src/index.ts-- The ExtendedSpec definition (source of truth)
Task: add-global-attribute
Add a new Vue global attribute. Follow recipe #1 in docs/maintenance.md.
Step 1: Identify the attribute
- •Determine the attribute name, type, and description
- •Determine if the attribute is conditional (requires a CSS selector condition)
Step 2: Add the attribute
- •Read
src/index.ts - •Add a new entry under
def['#globalAttrs']['#extends'] - •Set the
typefield (e.g.,'NoEmptyAny') - •Set the
descriptionfield - •If conditional, add a
conditionfield with a CSS selector (e.g.,'[v-for]')
Step 3: Verify
- •Build:
yarn build --scope @markuplint/vue-spec - •Test:
yarn test --scope @markuplint/vue-spec
Task: add-element-override
Add an element-specific attribute override. Follow recipe #2 in docs/maintenance.md.
Step 1: Identify the element
- •Determine the element name and the override properties
- •Check the
ExtendedSpectype in@markuplint/ml-specfor available override fields
Step 2: Add the override
- •Read
src/index.ts - •Add a new entry to the
specsarray with the elementnameand override properties - •Example:
{ name: 'component', possibleToAddProperties: true }
Step 3: Verify
- •Build:
yarn build --scope @markuplint/vue-spec - •Test:
yarn test --scope @markuplint/vue-spec
Rules
- •Only export an ExtendedSpec object — no parsing logic belongs in this package.
- •Global attributes go under
def['#globalAttrs']['#extends']— this is the standard location for framework-specific global attributes. - •Element overrides go under the
specs[]array — each entry must have anamefield identifying the target element. - •Use the
conditionfield with CSS selectors for conditional attributes — e.g.,'[v-for]'restricts an attribute to elements with thev-fordirective. - •Add JSDoc comments to document the purpose of new attributes or overrides.