@markuplint/astro-parser 5.0.0-dev.5 → 5.0.0-rc.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.
- package/ARCHITECTURE.ja.md +36 -62
- package/ARCHITECTURE.md +44 -70
- package/CHANGELOG.md +19 -0
- package/SKILL.md +30 -6
- package/docs/maintenance.ja.md +10 -21
- package/docs/maintenance.md +10 -21
- package/lib/component-scanner.d.ts +37 -0
- package/lib/component-scanner.js +88 -0
- package/lib/parser.js +2 -2
- package/package.json +10 -6
package/ARCHITECTURE.ja.md
CHANGED
|
@@ -2,17 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## 概要
|
|
4
4
|
|
|
5
|
-
`@markuplint/astro-parser` は markuplint における Astro コンポーネントファイル(`.astro`)のパーサーです。`astro-eslint-parser`(`@astrojs/compiler` をラップ)を使用して Astro ソースコードをトークン化し、その結果の AST を markuplint の統一 AST 形式(`MLASTDocument`)に変換します。フロントマターブロック(`---...---`)、式コンテナ(`{expression}`)、テンプレートディレクティブ(例: `class:list`、`set:html`)、ショートハンド属性(`{prop}
|
|
5
|
+
`@markuplint/astro-parser` は markuplint における Astro コンポーネントファイル(`.astro`)のパーサーです。`astro-eslint-parser`(`@astrojs/compiler` をラップ)を使用して Astro ソースコードをトークン化し、その結果の AST を markuplint の統一 AST 形式(`MLASTDocument`)に変換します。フロントマターブロック(`---...---`)、式コンテナ(`{expression}`)、テンプレートディレクティブ(例: `class:list`、`set:html`、`client:load`)、ショートハンド属性(`{prop}`)など、Astro 固有の構文を処理します。
|
|
6
6
|
|
|
7
7
|
## ディレクトリ構成
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
src/
|
|
11
|
-
├── index.ts
|
|
12
|
-
├── parser.ts
|
|
13
|
-
├── astro-parser.ts
|
|
14
|
-
├──
|
|
15
|
-
|
|
11
|
+
├── index.ts — parser インスタンスを再エクスポート
|
|
12
|
+
├── parser.ts — Parser<Node> を拡張する AstroParser クラス
|
|
13
|
+
├── astro-parser.ts — astro-eslint-parser ラッパーと型の再エクスポート
|
|
14
|
+
├── detect-block-behavior.ts — .map()/.filter() のブロック動作検出
|
|
15
|
+
├── component-scanner.ts — pretenders 自動スキャン用コンポーネントスキャナー(サブパスエクスポート)
|
|
16
|
+
├── parser.spec.ts — AstroParser 統合テスト
|
|
17
|
+
├── astro-parser.spec.ts — astro-eslint-parser ラッパーテスト
|
|
18
|
+
└── component-scanner.spec.ts — コンポーネントスキャナーのテスト
|
|
16
19
|
```
|
|
17
20
|
|
|
18
21
|
## アーキテクチャ図
|
|
@@ -27,12 +30,15 @@ flowchart TD
|
|
|
27
30
|
end
|
|
28
31
|
|
|
29
32
|
subgraph pkg ["@markuplint/astro-parser"]
|
|
30
|
-
astroParser["AstroParser\nextends Parser‹Node
|
|
33
|
+
astroParser["AstroParser\nextends Parser‹Node›"]
|
|
31
34
|
astroParseFn["astroParse()\nastro-eslint-parser ラッパー"]
|
|
35
|
+
detectBlock["detectBlockBehavior()\n.map()/.filter() 検出"]
|
|
36
|
+
compScanner["componentScanner\n(サブパス: ./component-scanner)"]
|
|
32
37
|
end
|
|
33
38
|
|
|
34
39
|
subgraph downstream ["下流"]
|
|
35
40
|
mlCore["@markuplint/ml-core\n(MLASTDocument → MLDOM)"]
|
|
41
|
+
pretenders["@markuplint/pretenders\n(自動スキャン)"]
|
|
36
42
|
end
|
|
37
43
|
|
|
38
44
|
mlAst -->|"AST 型"| astroParser
|
|
@@ -40,7 +46,10 @@ flowchart TD
|
|
|
40
46
|
astroEslintParser -->|"parseTemplate()"| astroParseFn
|
|
41
47
|
astroCompiler -->|"Node 型"| astroParseFn
|
|
42
48
|
astroParseFn -->|"RootNode.children"| astroParser
|
|
49
|
+
detectBlock -->|"blockBehavior"| astroParser
|
|
43
50
|
astroParser -->|"MLASTDocument を生成"| mlCore
|
|
51
|
+
astroParser -->|"parse()"| compScanner
|
|
52
|
+
compScanner -->|"ComponentScanResult"| pretenders
|
|
44
53
|
```
|
|
45
54
|
|
|
46
55
|
## AstroParser クラス
|
|
@@ -48,7 +57,7 @@ flowchart TD
|
|
|
48
57
|
### 継承関係
|
|
49
58
|
|
|
50
59
|
```
|
|
51
|
-
Parser<Node
|
|
60
|
+
Parser<Node> (@markuplint/parser-utils)
|
|
52
61
|
└── AstroParser (このパッケージ)
|
|
53
62
|
```
|
|
54
63
|
|
|
@@ -62,16 +71,6 @@ Parser<Node, State> (@markuplint/parser-utils)
|
|
|
62
71
|
| `selfCloseType` | `'html+xml'` | HTML void 要素と XML スタイルの自己閉じ(`<Component />`)の両方を受け入れる |
|
|
63
72
|
| `tagNameCaseSensitive` | `true` | コンポーネント(`<MyComp>`)と HTML 要素(`<div>`)を区別 |
|
|
64
73
|
|
|
65
|
-
### State 型
|
|
66
|
-
|
|
67
|
-
パーサーは `State` 型を通じて内部状態を管理します:
|
|
68
|
-
|
|
69
|
-
| フィールド | 型 | 用途 |
|
|
70
|
-
| ---------- | -------- | --------------------------------------------------------------- |
|
|
71
|
-
| `scopeNS` | `string` | 現在の名前空間 URI、デフォルトは `http://www.w3.org/1999/xhtml` |
|
|
72
|
-
|
|
73
|
-
`scopeNS` 状態は `#updateScopeNS()` によってパーサーが要素を走査する際に更新され、`<svg>` 要素内で SVG 名前空間に切り替わり、`<foreignObject>` 内で XHTML に戻ります。
|
|
74
|
-
|
|
75
74
|
### オーバーライドメソッド
|
|
76
75
|
|
|
77
76
|
| メソッド | 用途 |
|
|
@@ -79,7 +78,7 @@ Parser<Node, State> (@markuplint/parser-utils)
|
|
|
79
78
|
| `tokenize()` | `astroParse()` を呼び出して Astro AST を取得し、`{ ast: rootNode.children, isFragment: true }` を返す |
|
|
80
79
|
| `nodeize()` | Astro AST ノードを markuplint ノードに変換。ノードタイプ(frontmatter, doctype, text, comment, element, expression)で振り分け |
|
|
81
80
|
| `afterFlattenNodes()` | `{ exposeInvalidNode: false }` で親に委譲 |
|
|
82
|
-
| `visitElement()` | `parseCodeFragment()` で `namelessFragment: true` として生の HTML
|
|
81
|
+
| `visitElement()` | `parseCodeFragment()` で `namelessFragment: true` として生の HTML フラグメントをパースし、終了タグ処理で親に委譲 |
|
|
83
82
|
| `visitChildren()` | 親に委譲した後、予期しない兄弟ノードが残っていないことをアサート |
|
|
84
83
|
| `visitAttr()` | 波括弧式の値、ショートハンド属性、テンプレートディレクティブを処理 |
|
|
85
84
|
| `detectElementType()` | `/^[A-Z]/` パターンでコンポーネントと HTML 要素を検出(大文字始まりの名前はコンポーネント) |
|
|
@@ -119,35 +118,6 @@ Astro の式(`{expression}`)は Astro AST で `type: 'expression'` ノード
|
|
|
119
118
|
- 最後の子の開始から式の終了までの領域が終了フラグメントになる
|
|
120
119
|
- 間の子は開始フラグメントの psblock 内で通常通り訪問される
|
|
121
120
|
|
|
122
|
-
## 名前空間スコーピング
|
|
123
|
-
|
|
124
|
-
`#updateScopeNS()` プライベートメソッドは、パーサーが要素を走査する際に名前空間コンテキストを管理します:
|
|
125
|
-
|
|
126
|
-
| 条件 | アクション |
|
|
127
|
-
| ----------------------------------------------------- | ---------------------------------------------------- |
|
|
128
|
-
| 現在の名前空間が XHTML で、ノードが `<svg>` 要素 | `scopeNS` を `http://www.w3.org/2000/svg` に切り替え |
|
|
129
|
-
| 現在の名前空間が SVG で、親ノードが `<foreignObject>` | `scopeNS` を `http://www.w3.org/1999/xhtml` に戻す |
|
|
130
|
-
|
|
131
|
-
これは `nodeize()` のノードタイプ switch の前に呼び出されるため、すべての子ノードが正しい名前空間を継承します。名前空間は `visitElement()` 内で `overwriteProps: { namespace: this.state.scopeNS }` を通じて要素に適用されます。
|
|
132
|
-
|
|
133
|
-
名前空間解決の例:
|
|
134
|
-
|
|
135
|
-
```html
|
|
136
|
-
<div>
|
|
137
|
-
<!-- XHTML -->
|
|
138
|
-
<svg>
|
|
139
|
-
<!-- SVG -->
|
|
140
|
-
<text />
|
|
141
|
-
<!-- SVG -->
|
|
142
|
-
<foreignObject>
|
|
143
|
-
<!-- SVG -->
|
|
144
|
-
<div />
|
|
145
|
-
<!-- XHTML(リセット) -->
|
|
146
|
-
</foreignObject>
|
|
147
|
-
</svg>
|
|
148
|
-
</div>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
121
|
## 属性処理
|
|
152
122
|
|
|
153
123
|
### クォートセット
|
|
@@ -173,15 +143,18 @@ Astro の式(`{expression}`)は Astro AST で `type: 'expression'` ノード
|
|
|
173
143
|
|
|
174
144
|
Astro テンプレートディレクティブは `name:modifier` 構文を使用します。パーサーは正規表現 `/^([^:]+):([^:]+)$/` でこれらを検出します:
|
|
175
145
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
| `class
|
|
179
|
-
| `
|
|
180
|
-
| `
|
|
181
|
-
| `
|
|
182
|
-
| `
|
|
146
|
+
| ディレクティブプレフィックス | `potentialName` | `isDirective` | 動作 |
|
|
147
|
+
| ---------------------------- | --------------- | ------------- | ----------------------------------------------------- |
|
|
148
|
+
| `class:` | `'class'` | `false` | 標準の `class` 属性にマッピング |
|
|
149
|
+
| `client:` | — | `true` | Astro クライアントディレクティブ(load, idle 等) |
|
|
150
|
+
| `server:` | — | `true` | Astro サーバーディレクティブ(defer) |
|
|
151
|
+
| `set:` | — | `true` | コンテンツディレクティブ(html, text) |
|
|
152
|
+
| `is:` | — | `true` | プロパティディレクティブ(inline, raw) |
|
|
153
|
+
| `define:` | — | `true` | スタイルディレクティブ(vars) |
|
|
154
|
+
| `transition:` | — | `true` | View Transition ディレクティブ(animate, name) |
|
|
155
|
+
| _(その他すべて)_ | — | `true` | キャッチオール: すべての `prefix:name` パターンに適用 |
|
|
183
156
|
|
|
184
|
-
`class
|
|
157
|
+
`class:` プレフィックスは特別扱いで、`potentialName: 'class'` を取得するため、`class` 属性に対する markuplint ルールが適用されます。その他のコロン区切りプレフィックスは `default` ケースに該当し `isDirective: true` を取得します。これはフレームワーク固有であり標準 HTML 属性として検証すべきでないことを markuplint に伝えます。
|
|
185
158
|
|
|
186
159
|
### 動的な値
|
|
187
160
|
|
|
@@ -199,7 +172,7 @@ Astro テンプレートディレクティブは `name:modifier` 構文を使用
|
|
|
199
172
|
| **フロントマター** | サポート(`---...---` psblock) | 該当なし |
|
|
200
173
|
| **式の構文** | `{expr}` を MustacheTag psblock として | `{expr}` を JSXExpressionContainer psblock として |
|
|
201
174
|
| **テンプレートディレクティブ** | `class:list`、`set:html` 等 | 該当なし |
|
|
202
|
-
| **名前空間管理** |
|
|
175
|
+
| **名前空間管理** | 基底 `Parser` に委譲 | html-parser の `getNamespace()` に委譲 |
|
|
203
176
|
| **コンポーネント検出** | `/^[A-Z]/` パターン | `/^[A-Z]/` パターン |
|
|
204
177
|
| **自己閉じタイプ** | `html+xml` | デフォルト(XML のみ) |
|
|
205
178
|
| **booleanish 属性** | 未設定 | `booleanish: true` |
|
|
@@ -218,11 +191,12 @@ astro-eslint-parser → @astrojs/compiler → Astro 構文サポート
|
|
|
218
191
|
|
|
219
192
|
## 主要ソースファイル
|
|
220
193
|
|
|
221
|
-
| ファイル
|
|
222
|
-
|
|
|
223
|
-
| `parser.ts`
|
|
224
|
-
| `astro-parser.ts`
|
|
225
|
-
| `index.ts`
|
|
194
|
+
| ファイル | 用途 |
|
|
195
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
196
|
+
| `parser.ts` | `AstroParser` クラス — 全オーバーライドメソッドと名前空間スコーピング |
|
|
197
|
+
| `astro-parser.ts` | `astroParse()` ラッパー — `astro-eslint-parser` に委譲し、診断を `ParserError` に変換 |
|
|
198
|
+
| `index.ts` | 公開 API — シングルトン `parser` インスタンスを再エクスポート |
|
|
199
|
+
| `component-scanner.ts` | `@markuplint/pretenders` 自動スキャン用コンポーネントスキャナー(サブパスエクスポート `./component-scanner`) |
|
|
226
200
|
|
|
227
201
|
## ドキュメントマップ
|
|
228
202
|
|
package/ARCHITECTURE.md
CHANGED
|
@@ -2,17 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
`@markuplint/astro-parser` is a parser for Astro component files (`.astro`) in markuplint. It uses `astro-eslint-parser` (which wraps `@astrojs/compiler`) to tokenize Astro source code, then converts the resulting AST into markuplint's unified AST format (`MLASTDocument`). The parser handles Astro-specific syntax including frontmatter blocks (`---...---`), expression containers (`{expression}`), template directives (e.g., `class:list`, `set:html`), shorthand attributes (`{prop}`)
|
|
5
|
+
`@markuplint/astro-parser` is a parser for Astro component files (`.astro`) in markuplint. It uses `astro-eslint-parser` (which wraps `@astrojs/compiler`) to tokenize Astro source code, then converts the resulting AST into markuplint's unified AST format (`MLASTDocument`). The parser handles Astro-specific syntax including frontmatter blocks (`---...---`), expression containers (`{expression}`), template directives (e.g., `class:list`, `set:html`, `client:load`), and shorthand attributes (`{prop}`).
|
|
6
6
|
|
|
7
7
|
## Directory Structure
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
src/
|
|
11
|
-
├── index.ts
|
|
12
|
-
├── parser.ts
|
|
13
|
-
├── astro-parser.ts
|
|
14
|
-
├──
|
|
15
|
-
|
|
11
|
+
├── index.ts — Re-exports parser instance
|
|
12
|
+
├── parser.ts — AstroParser class extending Parser<Node>
|
|
13
|
+
├── astro-parser.ts — astro-eslint-parser wrapper and type re-exports
|
|
14
|
+
├── detect-block-behavior.ts — Detects .map()/.filter() for block behavior
|
|
15
|
+
├── component-scanner.ts — Component scanner for pretenders auto scan (subpath export)
|
|
16
|
+
├── parser.spec.ts — AstroParser integration tests
|
|
17
|
+
├── astro-parser.spec.ts — astro-eslint-parser wrapper tests
|
|
18
|
+
└── component-scanner.spec.ts — Tests for component scanner
|
|
16
19
|
```
|
|
17
20
|
|
|
18
21
|
## Architecture Diagram
|
|
@@ -27,12 +30,15 @@ flowchart TD
|
|
|
27
30
|
end
|
|
28
31
|
|
|
29
32
|
subgraph pkg ["@markuplint/astro-parser"]
|
|
30
|
-
astroParser["AstroParser\nextends Parser‹Node
|
|
33
|
+
astroParser["AstroParser\nextends Parser‹Node›"]
|
|
31
34
|
astroParseFn["astroParse()\nastro-eslint-parser wrapper"]
|
|
35
|
+
detectBlock["detectBlockBehavior()\n.map()/.filter() detection"]
|
|
36
|
+
compScanner["componentScanner\n(subpath: ./component-scanner)"]
|
|
32
37
|
end
|
|
33
38
|
|
|
34
39
|
subgraph downstream ["Downstream"]
|
|
35
40
|
mlCore["@markuplint/ml-core\n(MLASTDocument → MLDOM)"]
|
|
41
|
+
pretenders["@markuplint/pretenders\n(auto scan)"]
|
|
36
42
|
end
|
|
37
43
|
|
|
38
44
|
mlAst -->|"AST types"| astroParser
|
|
@@ -40,7 +46,10 @@ flowchart TD
|
|
|
40
46
|
astroEslintParser -->|"parseTemplate()"| astroParseFn
|
|
41
47
|
astroCompiler -->|"Node types"| astroParseFn
|
|
42
48
|
astroParseFn -->|"RootNode.children"| astroParser
|
|
49
|
+
detectBlock -->|"blockBehavior"| astroParser
|
|
43
50
|
astroParser -->|"produces MLASTDocument"| mlCore
|
|
51
|
+
astroParser -->|"parse()"| compScanner
|
|
52
|
+
compScanner -->|"ComponentScanResult"| pretenders
|
|
44
53
|
```
|
|
45
54
|
|
|
46
55
|
## AstroParser Class
|
|
@@ -48,7 +57,7 @@ flowchart TD
|
|
|
48
57
|
### Inheritance
|
|
49
58
|
|
|
50
59
|
```
|
|
51
|
-
Parser<Node
|
|
60
|
+
Parser<Node> (from @markuplint/parser-utils)
|
|
52
61
|
└── AstroParser (this package)
|
|
53
62
|
```
|
|
54
63
|
|
|
@@ -62,27 +71,17 @@ The constructor configures the base `Parser` with Astro-specific options:
|
|
|
62
71
|
| `selfCloseType` | `'html+xml'` | Accepts both HTML void elements and XML-style self-closing (`<Component />`) |
|
|
63
72
|
| `tagNameCaseSensitive` | `true` | Distinguishes components (`<MyComp>`) from HTML elements (`<div>`) |
|
|
64
73
|
|
|
65
|
-
### State Type
|
|
66
|
-
|
|
67
|
-
The parser maintains internal state through the `State` type:
|
|
68
|
-
|
|
69
|
-
| Field | Type | Purpose |
|
|
70
|
-
| --------- | -------- | ----------------------------------------------------------------- |
|
|
71
|
-
| `scopeNS` | `string` | Current namespace URI, defaults to `http://www.w3.org/1999/xhtml` |
|
|
72
|
-
|
|
73
|
-
The `scopeNS` state is updated by `#updateScopeNS()` as the parser traverses elements, switching to SVG namespace inside `<svg>` elements and back to XHTML inside `<foreignObject>`.
|
|
74
|
-
|
|
75
74
|
### Override Methods
|
|
76
75
|
|
|
77
|
-
| Method | Purpose
|
|
78
|
-
| --------------------- |
|
|
79
|
-
| `tokenize()` | Calls `astroParse()` to get the Astro AST, returns `{ ast: rootNode.children, isFragment: true }`
|
|
80
|
-
| `nodeize()` | Converts Astro AST nodes to markuplint nodes, dispatching by node type (frontmatter, doctype, text, comment, element, expression)
|
|
81
|
-
| `afterFlattenNodes()` | Delegates to parent with `{ exposeInvalidNode: false }`
|
|
82
|
-
| `visitElement()` | Parses the raw HTML fragment via `parseCodeFragment()` with `namelessFragment: true`, then delegates to parent with
|
|
83
|
-
| `visitChildren()` | Delegates to parent, then asserts no unexpected sibling nodes remain
|
|
84
|
-
| `visitAttr()` | Handles curly-brace expression values, shorthand attributes, and template directives
|
|
85
|
-
| `detectElementType()` | Detects component vs HTML element using `/^[A-Z]/` pattern (capitalized names are components)
|
|
76
|
+
| Method | Purpose |
|
|
77
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
78
|
+
| `tokenize()` | Calls `astroParse()` to get the Astro AST, returns `{ ast: rootNode.children, isFragment: true }` |
|
|
79
|
+
| `nodeize()` | Converts Astro AST nodes to markuplint nodes, dispatching by node type (frontmatter, doctype, text, comment, element, expression) |
|
|
80
|
+
| `afterFlattenNodes()` | Delegates to parent with `{ exposeInvalidNode: false }` |
|
|
81
|
+
| `visitElement()` | Parses the raw HTML fragment via `parseCodeFragment()` with `namelessFragment: true`, then delegates to parent with end tag handling |
|
|
82
|
+
| `visitChildren()` | Delegates to parent, then asserts no unexpected sibling nodes remain |
|
|
83
|
+
| `visitAttr()` | Handles curly-brace expression values, shorthand attributes, and template directives |
|
|
84
|
+
| `detectElementType()` | Detects component vs HTML element using `/^[A-Z]/` pattern (capitalized names are components) |
|
|
86
85
|
|
|
87
86
|
## Frontmatter Handling
|
|
88
87
|
|
|
@@ -119,35 +118,6 @@ The splitting logic checks whether `firstChild !== lastChild` in the expression'
|
|
|
119
118
|
- The region from the last child's start to the expression end becomes the closing fragment
|
|
120
119
|
- The children between are visited normally within the opening fragment's psblock
|
|
121
120
|
|
|
122
|
-
## Namespace Scoping
|
|
123
|
-
|
|
124
|
-
The `#updateScopeNS()` private method manages namespace context as the parser traverses elements:
|
|
125
|
-
|
|
126
|
-
| Condition | Action |
|
|
127
|
-
| ------------------------------------------------------------- | ------------------------------------------------------- |
|
|
128
|
-
| Current namespace is XHTML and node is `<svg>` element | Switch `scopeNS` to `http://www.w3.org/2000/svg` |
|
|
129
|
-
| Current namespace is SVG and parent node is `<foreignObject>` | Switch `scopeNS` back to `http://www.w3.org/1999/xhtml` |
|
|
130
|
-
|
|
131
|
-
This is called at the beginning of `nodeize()` before the node type switch, so all child nodes inherit the correct namespace. The namespace is applied to elements via `overwriteProps: { namespace: this.state.scopeNS }` in `visitElement()`.
|
|
132
|
-
|
|
133
|
-
Example namespace resolution:
|
|
134
|
-
|
|
135
|
-
```html
|
|
136
|
-
<div>
|
|
137
|
-
<!-- XHTML -->
|
|
138
|
-
<svg>
|
|
139
|
-
<!-- SVG -->
|
|
140
|
-
<text />
|
|
141
|
-
<!-- SVG -->
|
|
142
|
-
<foreignObject>
|
|
143
|
-
<!-- SVG -->
|
|
144
|
-
<div />
|
|
145
|
-
<!-- XHTML (reset) -->
|
|
146
|
-
</foreignObject>
|
|
147
|
-
</svg>
|
|
148
|
-
</div>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
121
|
## Attribute Processing
|
|
152
122
|
|
|
153
123
|
### Quote Set
|
|
@@ -173,15 +143,18 @@ When an attribute token starts with `{` (e.g., `{prop}`), the parser sets `start
|
|
|
173
143
|
|
|
174
144
|
Astro template directives use the `name:modifier` syntax. The parser detects these with the regex `/^([^:]+):([^:]+)$/`:
|
|
175
145
|
|
|
176
|
-
| Directive
|
|
177
|
-
|
|
|
178
|
-
| `class
|
|
179
|
-
| `
|
|
180
|
-
| `
|
|
181
|
-
| `
|
|
182
|
-
| `
|
|
146
|
+
| Directive prefix | `potentialName` | `isDirective` | Behavior |
|
|
147
|
+
| ---------------- | --------------- | ------------- | ----------------------------------------------- |
|
|
148
|
+
| `class:` | `'class'` | `false` | Maps to standard `class` attribute |
|
|
149
|
+
| `client:` | — | `true` | Astro client directive (load, idle, visible...) |
|
|
150
|
+
| `server:` | — | `true` | Astro server directive (defer) |
|
|
151
|
+
| `set:` | — | `true` | Content directive (html, text) |
|
|
152
|
+
| `is:` | — | `true` | Property directive (inline, raw) |
|
|
153
|
+
| `define:` | — | `true` | Style directive (vars) |
|
|
154
|
+
| `transition:` | — | `true` | View Transition directive (animate, name) |
|
|
155
|
+
| _(any other)_ | — | `true` | Catch-all: any `prefix:name` pattern |
|
|
183
156
|
|
|
184
|
-
The `class
|
|
157
|
+
The `class:` prefix is special-cased: it gets `potentialName: 'class'` so markuplint rules for the `class` attribute apply. All other colon-separated prefixes hit the `default` case and get `isDirective: true`, which tells markuplint they are framework-specific and should not be validated as standard HTML attributes.
|
|
185
158
|
|
|
186
159
|
### Dynamic Values
|
|
187
160
|
|
|
@@ -199,7 +172,7 @@ Any attribute whose start quote is `{` gets `isDynamicValue: true`. This applies
|
|
|
199
172
|
| **Frontmatter** | Supported (`---...---` psblock) | Not applicable |
|
|
200
173
|
| **Expression syntax** | `{expr}` as MustacheTag psblock | `{expr}` as JSXExpressionContainer psblock |
|
|
201
174
|
| **Template directives** | `class:list`, `set:html`, etc. | Not applicable |
|
|
202
|
-
| **Namespace management** |
|
|
175
|
+
| **Namespace management** | Delegates to base `Parser` | Delegates to `getNamespace()` from html-parser |
|
|
203
176
|
| **Component detection** | `/^[A-Z]/` pattern | `/^[A-Z]/` pattern |
|
|
204
177
|
| **Self-close type** | `html+xml` | Default (XML-only) |
|
|
205
178
|
| **Booleanish attributes** | Not configured | `booleanish: true` |
|
|
@@ -218,11 +191,12 @@ astro-eslint-parser → @astrojs/compiler → Astro syntax support
|
|
|
218
191
|
|
|
219
192
|
## Key Source Files
|
|
220
193
|
|
|
221
|
-
| File
|
|
222
|
-
|
|
|
223
|
-
| `parser.ts`
|
|
224
|
-
| `astro-parser.ts`
|
|
225
|
-
| `index.ts`
|
|
194
|
+
| File | Purpose |
|
|
195
|
+
| ---------------------- | -------------------------------------------------------------------------------------------------- |
|
|
196
|
+
| `parser.ts` | `AstroParser` class — all override methods and namespace scoping |
|
|
197
|
+
| `astro-parser.ts` | `astroParse()` wrapper — delegates to `astro-eslint-parser`, converts diagnostics to `ParserError` |
|
|
198
|
+
| `index.ts` | Public API — re-exports the singleton `parser` instance |
|
|
199
|
+
| `component-scanner.ts` | Component scanner for `@markuplint/pretenders` auto scan (subpath export `./component-scanner`) |
|
|
226
200
|
|
|
227
201
|
## Documentation Map
|
|
228
202
|
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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-rc.1](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.0...v5.0.0-rc.1) (2026-03-27)
|
|
7
|
+
|
|
8
|
+
- feat!: adapt framework parsers to UUID-based node references ([6d543b8](https://github.com/markuplint/markuplint/commit/6d543b8c11506fe113d0ceeae3526f552f4ee26d))
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
- **astro-parser:** add component-scanner subpath export for pretenders auto scan ([3d85bc5](https://github.com/markuplint/markuplint/commit/3d85bc5f5904c0157415de175227eedf89539cda))
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
- Parser output no longer contains parentNode/pairNode
|
|
17
|
+
object references. Use parentNodeUuid/pairNodeUuid string fields instead.
|
|
18
|
+
|
|
19
|
+
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
20
|
+
|
|
21
|
+
# [5.0.0-rc.0](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.3...v5.0.0-rc.0) (2026-03-12)
|
|
22
|
+
|
|
23
|
+
**Note:** Version bump only for package @markuplint/astro-parser
|
|
24
|
+
|
|
6
25
|
# [5.0.0-alpha.3](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.2...v5.0.0-alpha.3) (2026-02-26)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @markuplint/astro-parser
|
package/SKILL.md
CHANGED
|
@@ -19,6 +19,7 @@ modify namespace scoping, update expression handling, and manage astro-eslint-pa
|
|
|
19
19
|
| `add-directive` | Add a new Astro template directive |
|
|
20
20
|
| `modify-namespace-scoping` | Modify SVG/XHTML namespace scoping logic |
|
|
21
21
|
| `update-expression-handling` | Update expression splitting or MustacheTag handling |
|
|
22
|
+
| `update-component-scanner` | Update component-scanner for pretenders auto scan |
|
|
22
23
|
|
|
23
24
|
If omitted, defaults to `add-directive`.
|
|
24
25
|
|
|
@@ -29,7 +30,7 @@ for the full guide. The recipes there are the source of truth for procedures.
|
|
|
29
30
|
|
|
30
31
|
Also read:
|
|
31
32
|
|
|
32
|
-
- `ARCHITECTURE.md` -- Package overview, attribute processing,
|
|
33
|
+
- `ARCHITECTURE.md` -- Package overview, attribute processing, directive handling
|
|
33
34
|
- `src/parser.ts` -- AstroParser class (source of truth for override methods)
|
|
34
35
|
- `src/astro-parser.ts` -- astro-eslint-parser wrapper
|
|
35
36
|
|
|
@@ -62,14 +63,14 @@ Modify the SVG/XHTML namespace scoping logic. Follow recipe #2 in `docs/maintena
|
|
|
62
63
|
|
|
63
64
|
### Step 1: Understand the current logic
|
|
64
65
|
|
|
65
|
-
1.
|
|
66
|
-
2.
|
|
67
|
-
3.
|
|
66
|
+
1. Namespace resolution is handled by the base `Parser` class from `@markuplint/parser-utils`
|
|
67
|
+
2. The Astro parser does **not** override namespace logic — there is no `#updateScopeNS()` method
|
|
68
|
+
3. Any namespace changes require modifications in the base `Parser` class or adding an override in `AstroParser`
|
|
68
69
|
|
|
69
70
|
### Step 2: Make the change
|
|
70
71
|
|
|
71
|
-
1.
|
|
72
|
-
2. For new namespaces (e.g., MathML), add a
|
|
72
|
+
1. If adding namespace handling to the Astro parser, override the relevant method from the base `Parser`
|
|
73
|
+
2. For new namespaces (e.g., MathML), add a condition checking `originNode.name`
|
|
73
74
|
3. Ensure the namespace URI constant is correct
|
|
74
75
|
|
|
75
76
|
### Step 3: Verify
|
|
@@ -100,6 +101,29 @@ Update expression splitting or MustacheTag handling. Follow recipe #3 in `docs/m
|
|
|
100
101
|
2. Test with expressions containing nested HTML (e.g., `{list.map(item => <li>{item}</li>)}`)
|
|
101
102
|
3. Test: `yarn test --scope @markuplint/astro-parser`
|
|
102
103
|
|
|
104
|
+
## Task: update-component-scanner
|
|
105
|
+
|
|
106
|
+
Update `src/component-scanner.ts` when Astro slot syntax or frontmatter handling changes.
|
|
107
|
+
|
|
108
|
+
### When to update
|
|
109
|
+
|
|
110
|
+
- New slot-like syntax is added to Astro
|
|
111
|
+
- Frontmatter delimiter handling needs to change
|
|
112
|
+
- The `extractComponentInfo` shared logic needs a fix (also update vue-parser and svelte-parser)
|
|
113
|
+
|
|
114
|
+
### Step 1: Make the change
|
|
115
|
+
|
|
116
|
+
1. Read `src/component-scanner.ts`
|
|
117
|
+
2. Modify `detectSlots()` for new slot patterns, or `extractAstroFrontmatter()` for frontmatter changes
|
|
118
|
+
3. If modifying `extractComponentInfo()`, apply the same change to all three parsers (vue, svelte, astro)
|
|
119
|
+
|
|
120
|
+
### Step 2: Verify
|
|
121
|
+
|
|
122
|
+
1. Update tests in `src/component-scanner.spec.ts`
|
|
123
|
+
2. Build: `yarn build --scope @markuplint/astro-parser`
|
|
124
|
+
3. Test: `npx vitest run packages/@markuplint/astro-parser/src/component-scanner.spec.ts`
|
|
125
|
+
4. Run pretenders integration tests: `npx vitest run packages/@markuplint/pretenders`
|
|
126
|
+
|
|
103
127
|
## Rules
|
|
104
128
|
|
|
105
129
|
1. **Delegate tokenization to astro-eslint-parser** — never parse Astro syntax manually; always use `astroParse()`.
|
package/docs/maintenance.ja.md
CHANGED
|
@@ -61,22 +61,12 @@ expect(debugMaps).toStrictEqual([
|
|
|
61
61
|
|
|
62
62
|
### 2. 名前空間スコーピングの変更
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
3.
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
parentNS === 'http://www.w3.org/1999/xhtml' &&
|
|
72
|
-
originNode.type === 'element' &&
|
|
73
|
-
originNode.name?.toLowerCase() === 'math'
|
|
74
|
-
) {
|
|
75
|
-
this.state.scopeNS = 'http://www.w3.org/1998/Math/MathML';
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
4. ビルドとテスト: `yarn build --scope @markuplint/astro-parser && yarn test --scope @markuplint/astro-parser`
|
|
79
|
-
5. `src/parser.spec.ts` に名前空間テストケースを追加:
|
|
64
|
+
名前空間の解決は現在 `@markuplint/parser-utils` の基底 `Parser` クラスが処理しています。Astro パーサーは名前空間ロジックをオーバーライドしていません。
|
|
65
|
+
|
|
66
|
+
1. カスタム名前空間処理が必要な場合は、`src/parser.ts` の `AstroParser` で該当メソッドをオーバーライド
|
|
67
|
+
2. 新しい名前空間(例: MathML)の場合、要素名を検出して名前空間を切り替えるオーバーライドが必要
|
|
68
|
+
3. ビルドとテスト: `yarn build --scope @markuplint/astro-parser && yarn test --scope @markuplint/astro-parser`
|
|
69
|
+
4. `src/parser.spec.ts` に名前空間テストケースを追加:
|
|
80
70
|
```ts
|
|
81
71
|
test('MathML namespace', () => {
|
|
82
72
|
const doc = parse('<div><math><mi>x</mi></math></div>');
|
|
@@ -161,14 +151,13 @@ yarn build --scope @markuplint/astro-parser && yarn test --scope @markuplint/ast
|
|
|
161
151
|
|
|
162
152
|
**症状:** `<svg>` 内の要素が XHTML 名前空間を持つ、または `<foreignObject>` 内の要素が SVG 名前空間を持つ。
|
|
163
153
|
|
|
164
|
-
**原因:**
|
|
154
|
+
**原因:** 名前空間の解決は `@markuplint/parser-utils` の基底 `Parser` クラスが処理します。Astro パーサーは名前空間ロジックをオーバーライドしていません。
|
|
165
155
|
|
|
166
156
|
**解決策:**
|
|
167
157
|
|
|
168
|
-
1. `
|
|
169
|
-
2. `
|
|
170
|
-
3.
|
|
171
|
-
4. 特定のネストパターンのテストケースを `src/parser.spec.ts` に追加
|
|
158
|
+
1. 問題が `@markuplint/parser-utils` の基底 `Parser` クラスにあるかどうかを確認
|
|
159
|
+
2. 特定のネストパターンのテストケースを `src/parser.spec.ts` に追加して期待される動作を確認
|
|
160
|
+
3. 問題が上流にある場合は、基底 `Parser` の名前空間処理を調査
|
|
172
161
|
|
|
173
162
|
### テンプレートディレクティブが検出されない
|
|
174
163
|
|
package/docs/maintenance.md
CHANGED
|
@@ -61,22 +61,12 @@ The second argument `true` to `nodeListToDebugMaps` includes attribute details i
|
|
|
61
61
|
|
|
62
62
|
### 2. Modifying Namespace Scoping
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
3.
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
parentNS === 'http://www.w3.org/1999/xhtml' &&
|
|
72
|
-
originNode.type === 'element' &&
|
|
73
|
-
originNode.name?.toLowerCase() === 'math'
|
|
74
|
-
) {
|
|
75
|
-
this.state.scopeNS = 'http://www.w3.org/1998/Math/MathML';
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
4. Build and test: `yarn build --scope @markuplint/astro-parser && yarn test --scope @markuplint/astro-parser`
|
|
79
|
-
5. Add namespace test cases to `src/parser.spec.ts`:
|
|
64
|
+
Namespace resolution is currently handled by the base `Parser` class from `@markuplint/parser-utils`. The Astro parser does not override namespace logic.
|
|
65
|
+
|
|
66
|
+
1. If you need to add custom namespace handling, you would override the relevant method in `AstroParser` in `src/parser.ts`
|
|
67
|
+
2. For new namespaces (e.g., MathML), the override would need to detect the element name and switch the namespace
|
|
68
|
+
3. Build and test: `yarn build --scope @markuplint/astro-parser && yarn test --scope @markuplint/astro-parser`
|
|
69
|
+
4. Add namespace test cases to `src/parser.spec.ts`:
|
|
80
70
|
```ts
|
|
81
71
|
test('MathML namespace', () => {
|
|
82
72
|
const doc = parse('<div><math><mi>x</mi></math></div>');
|
|
@@ -161,14 +151,13 @@ yarn build --scope @markuplint/astro-parser && yarn test --scope @markuplint/ast
|
|
|
161
151
|
|
|
162
152
|
**Symptom:** Elements inside `<svg>` have XHTML namespace, or elements inside `<foreignObject>` have SVG namespace.
|
|
163
153
|
|
|
164
|
-
**Cause:**
|
|
154
|
+
**Cause:** Namespace resolution is handled by the base `Parser` class from `@markuplint/parser-utils`. The Astro parser does not override namespace logic.
|
|
165
155
|
|
|
166
156
|
**Solution:**
|
|
167
157
|
|
|
168
|
-
1. Check
|
|
169
|
-
2.
|
|
170
|
-
3.
|
|
171
|
-
4. Add a test case with the specific nesting pattern to `src/parser.spec.ts`
|
|
158
|
+
1. Check whether the issue is in the base `Parser` class in `@markuplint/parser-utils`
|
|
159
|
+
2. Add a test case with the specific nesting pattern to `src/parser.spec.ts` to confirm expected behavior
|
|
160
|
+
3. If the issue is upstream, investigate the base `Parser` namespace handling
|
|
172
161
|
|
|
173
162
|
### Template directive not detected
|
|
174
163
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result of scanning a single component file for its root element information.
|
|
3
|
+
*/
|
|
4
|
+
export interface ComponentScanResult {
|
|
5
|
+
readonly rootElement: string | null;
|
|
6
|
+
readonly attrs: readonly ComponentScanAttr[];
|
|
7
|
+
readonly hasSlots: boolean;
|
|
8
|
+
readonly scriptSource?: ComponentScanScriptSource;
|
|
9
|
+
readonly namespace?: 'svg';
|
|
10
|
+
readonly line?: number;
|
|
11
|
+
readonly col?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A static attribute extracted from a component's root element.
|
|
15
|
+
*/
|
|
16
|
+
export interface ComponentScanAttr {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly value?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A script/ESM source block extracted from a component file.
|
|
22
|
+
*/
|
|
23
|
+
export interface ComponentScanScriptSource {
|
|
24
|
+
readonly content: string;
|
|
25
|
+
readonly offset: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Component scanner for Astro component files.
|
|
29
|
+
*
|
|
30
|
+
* Parses an Astro component using markuplint's Astro parser, extracts the root
|
|
31
|
+
* element at depth=0, detects static attributes, slot usage, and the
|
|
32
|
+
* frontmatter block for import analysis.
|
|
33
|
+
*/
|
|
34
|
+
export declare const componentScanner: {
|
|
35
|
+
scanComponent(sourceCode: string): ComponentScanResult | null;
|
|
36
|
+
extractScriptSource(sourceCode: string): ComponentScanScriptSource | null;
|
|
37
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { parser } from './parser.js';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts root element information from a parsed MLAST document.
|
|
4
|
+
*/
|
|
5
|
+
function extractComponentInfo(doc) {
|
|
6
|
+
const root = doc.nodeList.find((n) => n.type === 'starttag' && n.depth === 0 && !n.isFragment);
|
|
7
|
+
if (!root) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
const attrs = [];
|
|
11
|
+
for (const attr of root.attributes) {
|
|
12
|
+
if (attr.type !== 'attr') {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const value = attr.value.raw;
|
|
16
|
+
if (value === '') {
|
|
17
|
+
attrs.push({ name: attr.nodeName });
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
attrs.push({ name: attr.nodeName, value });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
rootElement: root.nodeName,
|
|
25
|
+
attrs,
|
|
26
|
+
namespace: root.namespace === 'http://www.w3.org/2000/svg' ? 'svg' : undefined,
|
|
27
|
+
line: root.line,
|
|
28
|
+
col: root.col,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Detects whether the parsed Astro template contains `<slot>` elements.
|
|
33
|
+
*/
|
|
34
|
+
function detectSlots(doc) {
|
|
35
|
+
return doc.nodeList.some(n => n.type === 'starttag' && n.nodeName === 'slot');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Extracts the frontmatter block (`---...---`) from an Astro component source.
|
|
39
|
+
*/
|
|
40
|
+
function extractAstroFrontmatter(source) {
|
|
41
|
+
const re = /^(?:\s*\n)?---\r?\n/;
|
|
42
|
+
const startMatch = re.exec(source);
|
|
43
|
+
if (!startMatch) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const contentStart = startMatch[0].length;
|
|
47
|
+
const afterStart = source.slice(contentStart);
|
|
48
|
+
const endRe = /\r?\n---\r?\n/;
|
|
49
|
+
const endMatch = endRe.exec(afterStart);
|
|
50
|
+
if (!endMatch) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
content: afterStart.slice(0, endMatch.index),
|
|
55
|
+
offset: contentStart,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Component scanner for Astro component files.
|
|
60
|
+
*
|
|
61
|
+
* Parses an Astro component using markuplint's Astro parser, extracts the root
|
|
62
|
+
* element at depth=0, detects static attributes, slot usage, and the
|
|
63
|
+
* frontmatter block for import analysis.
|
|
64
|
+
*/
|
|
65
|
+
export const componentScanner = {
|
|
66
|
+
scanComponent(sourceCode) {
|
|
67
|
+
let doc;
|
|
68
|
+
try {
|
|
69
|
+
doc = parser.parse(sourceCode);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
if (error instanceof SyntaxError || (error instanceof Error && error.constructor.name === 'ParserError')) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
const info = extractComponentInfo(doc);
|
|
78
|
+
if (!info) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const hasSlots = detectSlots(doc);
|
|
82
|
+
const scriptSource = extractAstroFrontmatter(sourceCode) ?? undefined;
|
|
83
|
+
return { ...info, hasSlots, scriptSource };
|
|
84
|
+
},
|
|
85
|
+
extractScriptSource(sourceCode) {
|
|
86
|
+
return extractAstroFrontmatter(sourceCode);
|
|
87
|
+
},
|
|
88
|
+
};
|
package/lib/parser.js
CHANGED
|
@@ -160,7 +160,7 @@ class AstroParser extends Parser {
|
|
|
160
160
|
if (!startTagNode || startTagNode.type !== 'starttag') {
|
|
161
161
|
throw new ParserError('Not found start tag', startTagNode ?? token);
|
|
162
162
|
}
|
|
163
|
-
return super.visitElement(startTagNode, childNodes, {
|
|
163
|
+
return super.visitElement({ ...startTagNode, parentNode: startTagNode.parentNode ?? null }, childNodes, {
|
|
164
164
|
// https://docs.astro.build/en/basics/astro-syntax/#fragments
|
|
165
165
|
namelessFragment: true,
|
|
166
166
|
createEndTagToken: () => {
|
|
@@ -171,7 +171,7 @@ class AstroParser extends Parser {
|
|
|
171
171
|
if (endTagNode?.type !== 'endtag') {
|
|
172
172
|
return null;
|
|
173
173
|
}
|
|
174
|
-
return endTagNode ?? null;
|
|
174
|
+
return { ...endTagNode, parentNode: endTagNode.parentNode ?? null };
|
|
175
175
|
},
|
|
176
176
|
});
|
|
177
177
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/astro-parser",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-rc.1",
|
|
4
4
|
"description": "astro parser for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"import": "./lib/index.js",
|
|
15
15
|
"types": "./lib/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./component-scanner": {
|
|
18
|
+
"import": "./lib/component-scanner.js",
|
|
19
|
+
"types": "./lib/component-scanner.d.ts"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"publishConfig": {
|
|
@@ -24,12 +28,12 @@
|
|
|
24
28
|
"clean": "tsc --build --clean tsconfig.build.json"
|
|
25
29
|
},
|
|
26
30
|
"dependencies": {
|
|
27
|
-
"@markuplint/ml-ast": "5.0.0-
|
|
28
|
-
"@markuplint/parser-utils": "5.0.0-
|
|
29
|
-
"astro-eslint-parser": "1.
|
|
31
|
+
"@markuplint/ml-ast": "5.0.0-rc.1",
|
|
32
|
+
"@markuplint/parser-utils": "5.0.0-rc.1",
|
|
33
|
+
"astro-eslint-parser": "1.4.0"
|
|
30
34
|
},
|
|
31
35
|
"devDependencies": {
|
|
32
|
-
"@astrojs/compiler": "
|
|
36
|
+
"@astrojs/compiler": "3.0.1"
|
|
33
37
|
},
|
|
34
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "0d6b4324d9a7d6b9e1ba57d4a57e45d36975cba9"
|
|
35
39
|
}
|