@markuplint/vue-spec 4.5.23 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,23 @@
6
6
 
7
7
  ## ExtendedSpec の内容
8
8
 
9
+ ### `directivePatterns`
10
+
11
+ この spec は Vue ディレクティブ属性を解決するための `directivePatterns` 配列を宣言します。パターンは順番に評価されます(最初のマッチが優先):
12
+
13
+ | パターン | 結果 |
14
+ | --------------------------------- | ---------------------------------------------------------------------------- |
15
+ | `^\\.(.+)$` | `.prop` ショートハンド (Vue 3.2+) → `isDirective`、`isDynamicValue` |
16
+ | `^(?:v-bind:\|:)([^.]+)\\..+$` | `v-bind` + 修飾子(`.prop`、`.camel`)→ `isDirective`、`isDynamicValue` |
17
+ | `^(?:v-bind:\|:\|v-on:\|@)\\[` | 動的属性/イベント名(`:[expr]`、`@[expr]`)→ `isDirective`、`isDynamicValue` |
18
+ | `^(?:v-bind:\|:)([^.]+)$` | `v-bind:attr` / `:attr` → `potentialName=$1`、`isDynamicValue` |
19
+ | `^(?:v-on:\|@)([^.]+)(?:\\..+)?$` | `v-on:event` / `@event` → `potentialName=on$1`、`isDynamicValue` |
20
+ | `^v-model(?:$\|\\.)` | `v-model` → `isDirective`、`isDynamicValue` |
21
+ | `^(?:v-slot:\|#)` | `v-slot` / `#` ショートハンド → `isDirective`、`isDynamicValue` |
22
+ | `^v-` | その他の `v-*` ディレクティブ → `isDirective`、`isDynamicValue` |
23
+
24
+ `v-bind:attr` パターンは `isDuplicatable: ['class', 'style']` も設定しており、これらの属性がバインドされた同等物と並んで出現できるようにします。
25
+
9
26
  ### グローバル属性
10
27
 
11
28
  以下のグローバル属性が `def['#globalAttrs']['#extends']` 配下に登録されています:
package/ARCHITECTURE.md CHANGED
@@ -6,6 +6,23 @@
6
6
 
7
7
  ## ExtendedSpec Content
8
8
 
9
+ ### `directivePatterns`
10
+
11
+ The spec declares a `directivePatterns` array that the core engine uses to resolve Vue directive attributes. Patterns are evaluated in order (first match wins):
12
+
13
+ | Pattern | Result |
14
+ | --------------------------------- | -------------------------------------------------------------------------------------- |
15
+ | `^\\.(.+)$` | `.prop` shorthand (Vue 3.2+) -> `isDirective`, `isDynamicValue` |
16
+ | `^(?:v-bind:\|:)([^.]+)\\..+$` | `v-bind` with modifier (`.prop`, `.camel`) -> `isDirective`, `isDynamicValue` |
17
+ | `^(?:v-bind:\|:\|v-on:\|@)\\[` | Dynamic attribute/event name (`:[expr]`, `@[expr]`) -> `isDirective`, `isDynamicValue` |
18
+ | `^(?:v-bind:\|:)([^.]+)$` | `v-bind:attr` / `:attr` -> `potentialName=$1`, `isDynamicValue` |
19
+ | `^(?:v-on:\|@)([^.]+)(?:\\..+)?$` | `v-on:event` / `@event` -> `potentialName=on$1`, `isDynamicValue` |
20
+ | `^v-model(?:$\|\\.)` | `v-model` -> `isDirective`, `isDynamicValue` |
21
+ | `^(?:v-slot:\|#)` | `v-slot` / `#` shorthand -> `isDirective`, `isDynamicValue` |
22
+ | `^v-` | Other `v-*` directives -> `isDirective`, `isDynamicValue` |
23
+
24
+ The `v-bind:attr` pattern also sets `isDuplicatable: ['class', 'style']`, allowing these attributes to appear alongside their bound equivalents.
25
+
9
26
  ### Global Attributes
10
27
 
11
28
  The following global attributes are registered under `def['#globalAttrs']['#extends']`:
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.0.0-alpha.1](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.0...v5.0.0-alpha.1) (2026-02-22)
7
+
8
+ **Note:** Version bump only for package @markuplint/vue-spec
9
+
10
+ # [5.0.0-alpha.0](https://github.com/markuplint/markuplint/compare/v4.14.1...v5.0.0-alpha.0) (2026-02-20)
11
+
12
+ ### Features
13
+
14
+ - **vue-spec:** add directivePatterns for Vue directive resolution ([2873205](https://github.com/markuplint/markuplint/commit/2873205cff7a7f0c2cc945e008a27e9592bcc876))
15
+
6
16
  ## [4.5.23](https://github.com/markuplint/markuplint/compare/@markuplint/vue-spec@4.5.22...@markuplint/vue-spec@4.5.23) (2026-02-10)
7
17
 
8
18
  **Note:** Version bump only for package @markuplint/vue-spec
package/lib/index.js CHANGED
@@ -16,6 +16,57 @@
16
16
  * element is marked as allowing additional dynamic properties.
17
17
  */
18
18
  const spec = {
19
+ directivePatterns: [
20
+ // .propName shorthand (Vue 3.2+, equivalent to v-bind:propName.prop)
21
+ {
22
+ pattern: '^\\.(.+)$',
23
+ isDirective: true,
24
+ isDynamicValue: true,
25
+ },
26
+ // v-bind/: with .prop or .camel modifier → isDirective
27
+ {
28
+ pattern: '^(?:v-bind:|:)([^.]+)\\..+$',
29
+ isDirective: true,
30
+ isDynamicValue: true,
31
+ },
32
+ // Dynamic attribute/event names with brackets (e.g., :[dynamicAttr], @[dynamicEvent])
33
+ {
34
+ pattern: '^(?:v-bind:|:|v-on:|@)\\[',
35
+ isDirective: true,
36
+ isDynamicValue: true,
37
+ },
38
+ // v-bind:attr or :attr (no modifier) → potentialName=attr, isDynamicValue
39
+ {
40
+ pattern: '^(?:v-bind:|:)([^.]+)$',
41
+ potentialName: '$1',
42
+ isDynamicValue: true,
43
+ isDuplicatable: ['class', 'style'],
44
+ },
45
+ // v-on:event or @event (with optional modifiers)
46
+ {
47
+ pattern: '^(?:v-on:|@)([^.]+)(?:\\..+)?$',
48
+ potentialName: 'on$1',
49
+ isDynamicValue: true,
50
+ },
51
+ // v-model (with optional modifiers)
52
+ {
53
+ pattern: '^v-model(?:$|\\.)',
54
+ isDirective: true,
55
+ isDynamicValue: true,
56
+ },
57
+ // v-slot:name or #name shorthand
58
+ {
59
+ pattern: '^(?:v-slot:|#)',
60
+ isDirective: true,
61
+ isDynamicValue: true,
62
+ },
63
+ // Other v-* directives (v-show, v-if, v-for, v-text, v-html, etc.)
64
+ {
65
+ pattern: '^v-',
66
+ isDirective: true,
67
+ isDynamicValue: true,
68
+ },
69
+ ],
19
70
  def: {
20
71
  '#globalAttrs': {
21
72
  '#extends': {
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@markuplint/vue-spec",
3
- "version": "4.5.23",
3
+ "version": "5.0.0-alpha.1",
4
4
  "description": "Extended specification for tags and attributes in Vue",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
7
7
  "license": "MIT",
8
+ "engines": {
9
+ "node": ">=22"
10
+ },
8
11
  "type": "module",
9
12
  "exports": {
10
13
  ".": {
@@ -21,7 +24,7 @@
21
24
  "clean": "tsc --build --clean tsconfig.build.json"
22
25
  },
23
26
  "dependencies": {
24
- "@markuplint/ml-spec": "4.10.2"
27
+ "@markuplint/ml-spec": "5.0.0-alpha.1"
25
28
  },
26
- "gitHead": "193ee7c1262bbed95424e38efdf1a8e56ff049f4"
29
+ "gitHead": "78a295e73a097a1ce09c777c06fa21ab68136387"
27
30
  }