@markuplint/alpine-spec 5.0.0-rc.2 → 5.0.0-rc.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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.5](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.4...v5.0.0-rc.5) (2026-08-28)
7
+
8
+ **Note:** Version bump only for package @markuplint/alpine-spec
9
+
10
+ # [5.0.0-rc.4](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.3...v5.0.0-rc.4) (2026-04-19)
11
+
12
+ **Note:** Version bump only for package @markuplint/alpine-spec
13
+
14
+ # [5.0.0-rc.3](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.2...v5.0.0-rc.3) (2026-04-19)
15
+
16
+ **Note:** Version bump only for package @markuplint/alpine-spec
17
+
6
18
  # [5.0.0-rc.2](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.1...v5.0.0-rc.2) (2026-04-15)
7
19
 
8
20
  **Note:** Version bump only for package @markuplint/alpine-spec
package/lib/index.d.ts CHANGED
@@ -10,6 +10,12 @@
10
10
  * Alpine.js is a lightweight JavaScript framework that provides
11
11
  * reactive and declarative features directly in HTML markup.
12
12
  *
13
+ * This package is merged into the base HTML spec by `schemaToSpec`
14
+ * in `@markuplint/ml-spec`. It intentionally has no test suite:
15
+ * conformance is enforced at build time by the `ExtendedSpec` type,
16
+ * and the merged spec is exercised by the downstream
17
+ * `@markuplint/ml-spec` and `@markuplint/ml-core` tests.
18
+ *
13
19
  * @see https://alpinejs.dev/
14
20
  */
15
21
  import type { ExtendedSpec } from '@markuplint/ml-spec';
package/lib/index.js CHANGED
@@ -10,6 +10,12 @@
10
10
  * Alpine.js is a lightweight JavaScript framework that provides
11
11
  * reactive and declarative features directly in HTML markup.
12
12
  *
13
+ * This package is merged into the base HTML spec by `schemaToSpec`
14
+ * in `@markuplint/ml-spec`. It intentionally has no test suite:
15
+ * conformance is enforced at build time by the `ExtendedSpec` type,
16
+ * and the merged spec is exercised by the downstream
17
+ * `@markuplint/ml-spec` and `@markuplint/ml-core` tests.
18
+ *
13
19
  * @see https://alpinejs.dev/
14
20
  */
15
21
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/alpine-spec",
3
- "version": "5.0.0-rc.2",
3
+ "version": "5.0.0-rc.5",
4
4
  "description": "Extended specification for tags and attributes in Alpine.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,7 +10,7 @@
10
10
  "author": "Yusuke Hirao <yusukehirao@me.com>",
11
11
  "license": "MIT",
12
12
  "engines": {
13
- "node": ">=22"
13
+ "node": ">=24"
14
14
  },
15
15
  "type": "module",
16
16
  "exports": {
@@ -28,7 +28,7 @@
28
28
  "clean": "tsc --build --clean tsconfig.build.json"
29
29
  },
30
30
  "dependencies": {
31
- "@markuplint/ml-spec": "5.0.0-rc.2"
31
+ "@markuplint/ml-spec": "5.0.0-rc.5"
32
32
  },
33
- "gitHead": "e43763858d9234c417053becc73dbd088c1e7ea6"
33
+ "gitHead": "8d87463af2ff3f1b83fb28da20f1819362cf3555"
34
34
  }
package/ARCHITECTURE.md DELETED
@@ -1,123 +0,0 @@
1
- # @markuplint/alpine-spec
2
-
3
- ## Overview
4
-
5
- `@markuplint/alpine-spec` is a spec extension package that provides Alpine.js-specific directive definitions for markuplint. It exports a single `ExtendedSpec` object that registers global Alpine.js directives (such as `x-data`, `x-show`, `x-bind`, `x-on`, `x-model`, `x-text`, `x-html`, `x-ref`, `x-if`, `x-for`, `x-transition`, `x-effect`, `x-ignore`, `x-cloak`, etc.) available on every HTML element.
6
-
7
- This package contains no parsing logic -- it is purely a data definition consumed by `@markuplint/ml-spec` to extend the base HTML specification with Alpine.js-specific attributes.
8
-
9
- ## ExtendedSpec Content
10
-
11
- ### Global Attributes
12
-
13
- Global attributes are defined under `def['#globalAttrs']['#extends']` and are available on every HTML element:
14
-
15
- #### Component Initialization
16
-
17
- | Attribute | Type | Description |
18
- | --------- | ----- | ---------------------------------------------------------------- |
19
- | `x-data` | `Any` | Declares an Alpine component and defines its reactive data scope |
20
- | `x-init` | `Any` | Hooks into the initialization phase |
21
-
22
- #### Rendering & Visibility
23
-
24
- | Attribute | Type | Description |
25
- | --------- | ----- | --------------------------------------------------- |
26
- | `x-show` | `Any` | Toggles element visibility via CSS display property |
27
- | `x-if` | `Any` | Conditionally adds/removes elements from the DOM |
28
- | `x-for` | `Any` | Renders elements by iterating over collections |
29
-
30
- #### Content Binding
31
-
32
- | Attribute | Type | Description |
33
- | --------- | ----- | ----------------------------------- |
34
- | `x-text` | `Any` | Sets the textContent of the element |
35
- | `x-html` | `Any` | Sets the innerHTML of the element |
36
-
37
- #### Data Binding
38
-
39
- | Attribute | Type | Description |
40
- | ------------- | ----- | ----------------------------------------------------------- |
41
- | `x-model` | `Any` | Creates two-way data binding between form elements and data |
42
- | `x-modelable` | `Any` | Exposes a property as the target of an outer x-model |
43
-
44
- #### Reactivity
45
-
46
- | Attribute | Type | Description |
47
- | ---------- | ----- | -------------------------------------------------------------- |
48
- | `x-effect` | `Any` | Reactively re-evaluates an expression when dependencies change |
49
-
50
- #### DOM Manipulation & References
51
-
52
- | Attribute | Type | Description |
53
- | ------------ | ----- | ------------------------------------------------- |
54
- | `x-ref` | `Any` | Marks an element for access via $refs |
55
- | `x-teleport` | `Any` | Moves DOM content to another location in the page |
56
- | `x-id` | `Any` | Declares a scope for auto-generated IDs via $id() |
57
-
58
- #### Transitions
59
-
60
- | Attribute | Type | Description |
61
- | -------------------------- | ----- | ------------------------------------- |
62
- | `x-transition` | `Any` | Applies CSS transition animations |
63
- | `x-transition:enter` | `Any` | CSS classes for the entering phase |
64
- | `x-transition:enter-start` | `Any` | CSS classes before element insertion |
65
- | `x-transition:enter-end` | `Any` | CSS classes after element insertion |
66
- | `x-transition:leave` | `Any` | CSS classes for the leaving phase |
67
- | `x-transition:leave-start` | `Any` | CSS classes when leaving is triggered |
68
- | `x-transition:leave-end` | `Any` | CSS classes after leave starts |
69
-
70
- #### Processing Control
71
-
72
- | Attribute | Type | Description |
73
- | ---------- | --------- | ------------------------------------------------------------------- |
74
- | `x-ignore` | `Boolean` | Prevents Alpine from initializing the element |
75
- | `x-cloak` | `Boolean` | Hidden until Alpine initializes; prevents flash of unstyled content |
76
-
77
- ## Directory Structure
78
-
79
- ```
80
- src/
81
- └── index.ts — Exports the ExtendedSpec object with Alpine.js-specific attributes
82
- ```
83
-
84
- ## Key Source Files
85
-
86
- | File | Purpose |
87
- | ---------- | ------------------------------------------------------------------- |
88
- | `index.ts` | Defines and exports the `ExtendedSpec` object as the default export |
89
-
90
- ## Integration Points
91
-
92
- ```mermaid
93
- flowchart LR
94
- subgraph upstream ["Upstream"]
95
- htmlSpec["@markuplint/html-spec\n(Base HTML spec)"]
96
- end
97
-
98
- subgraph pkg ["@markuplint/alpine-spec"]
99
- spec["ExtendedSpec\n(Alpine.js directives)"]
100
- end
101
-
102
- subgraph downstream ["Downstream"]
103
- mlSpec["@markuplint/ml-spec\n(Spec resolution)"]
104
- mlCore["@markuplint/ml-core\n(Linting engine)"]
105
- end
106
-
107
- htmlSpec -->|"Base spec"| mlSpec
108
- spec -->|"Extends"| mlSpec
109
- mlSpec -->|"Resolved spec"| mlCore
110
- ```
111
-
112
- ### Upstream
113
-
114
- - **`@markuplint/ml-spec`** -- Provides the `ExtendedSpec` type that this package implements
115
-
116
- ### Downstream
117
-
118
- - **`@markuplint/ml-spec`** -- Consumes the `ExtendedSpec` object to merge Alpine.js-specific attributes into the resolved specification
119
- - **`@markuplint/ml-core`** -- Uses the resolved spec (including Alpine.js extensions) during linting
120
-
121
- ## Documentation Map
122
-
123
- - [Maintenance Guide](docs/maintenance.md) -- Commands, recipes, and ExtendedSpec type reference
package/SKILL.md DELETED
@@ -1,64 +0,0 @@
1
- ---
2
- description: Maintenance tasks for @markuplint/alpine-spec
3
- globs:
4
- - packages/@markuplint/alpine-spec/src/**/*.ts
5
- alwaysApply: false
6
- ---
7
-
8
- # alpine-spec-maintenance
9
-
10
- Perform maintenance tasks for `@markuplint/alpine-spec`: add global attributes
11
- and modify the ExtendedSpec object.
12
-
13
- ## Input
14
-
15
- `$ARGUMENTS` specifies the task. Supported tasks:
16
-
17
- | Task | Description |
18
- | ---------------------- | ---------------------------------------------- |
19
- | `add-global-attribute` | Add a new global attribute to the ExtendedSpec |
20
-
21
- If omitted, defaults to `add-global-attribute`.
22
-
23
- ## Reference
24
-
25
- Before executing any task, read `docs/maintenance.md` (or `docs/maintenance.ja.md`)
26
- for the full guide. The recipes there are the source of truth for procedures.
27
-
28
- Also read:
29
-
30
- - `ARCHITECTURE.md` -- Package overview, ExtendedSpec content, and integration points
31
- - `src/index.ts` -- ExtendedSpec object definition (source of truth)
32
-
33
- ## Task: add-global-attribute
34
-
35
- Add a new global Alpine.js directive available on every HTML element. Follow recipe #1 in `docs/maintenance.md`.
36
-
37
- ### Step 1: Identify the attribute
38
-
39
- 1. Determine the directive name, type (`Any`, `Boolean`, or a specific type), and description
40
- 2. Check the Alpine.js documentation to confirm the directive is valid
41
-
42
- ### Step 2: Add the attribute
43
-
44
- 1. Read `src/index.ts`
45
- 2. Add a new entry under `def['#globalAttrs']['#extends']`:
46
- ```ts
47
- 'x-directiveName': {
48
- type: 'Any', // or 'Boolean'
49
- },
50
- ```
51
- 3. Add a JSDoc comment above the entry describing its purpose
52
-
53
- ### Step 3: Verify
54
-
55
- 1. Build: `yarn build --scope @markuplint/alpine-spec`
56
- 2. Confirm the attribute appears in the exported spec object
57
-
58
- ## Rules
59
-
60
- 1. **Only export an ExtendedSpec object** -- this package contains no parsing logic.
61
- 2. **All Alpine.js directives are global** -- they go under `def['#globalAttrs']['#extends']`.
62
- 3. **Alpine.js directives are prefixed with `x-`** -- follow this naming convention.
63
- 4. **Each attribute needs at minimum a `type` field** -- valid types include `Any`, `Boolean`, and specific type strings.
64
- 5. **Add JSDoc comments** to all new attribute entries describing their purpose.
@@ -1,76 +0,0 @@
1
- # メンテナンスガイド
2
-
3
- ## コマンド
4
-
5
- | コマンド | 説明 |
6
- | -------------------------------------------- | ---------------------- |
7
- | `yarn build --scope @markuplint/alpine-spec` | このパッケージをビルド |
8
- | `yarn dev --scope @markuplint/alpine-spec` | ウォッチモードでビルド |
9
- | `yarn clean --scope @markuplint/alpine-spec` | ビルド成果物を削除 |
10
-
11
- ## テスト
12
-
13
- このパッケージには専用のテストスイートはありません。`ExtendedSpec` オブジェクトは、`@markuplint/ml-spec` の `ExtendedSpec` 型に対する TypeScript 型チェックにより、ビルド時に検証されます。エクスポートされたオブジェクトが型に適合しない場合、ビルドが失敗します。
14
-
15
- 統合テストは下流で行われます:
16
-
17
- - `@markuplint/ml-spec` が拡張仕様を解決し、基本 HTML 仕様とマージ
18
- - `@markuplint/ml-core` がリント時に解決済み仕様を使用し、属性定義を実行
19
-
20
- 変更を検証するには、パッケージをビルドして下流のテストを実行します:
21
-
22
- ```shell
23
- yarn build --scope @markuplint/alpine-spec
24
- yarn test --scope @markuplint/ml-spec --scope @markuplint/ml-core
25
- ```
26
-
27
- ## レシピ
28
-
29
- ### 1. グローバル属性の追加
30
-
31
- Alpine.js のディレクティブはすべてグローバルです -- すべての HTML 要素で利用可能です。
32
-
33
- 1. `src/index.ts` を開く
34
- 2. `def['#globalAttrs']['#extends']` の下に新しいエントリを追加:
35
- ```ts
36
- /** ディレクティブの説明 */
37
- 'x-directiveName': {
38
- type: 'Any', // または 'Boolean'
39
- },
40
- ```
41
- 3. 適切な型を選択:
42
- - `'Any'` -- 任意の値を受け付ける(文字列、式など)
43
- - `'Boolean'` -- ブール属性(存在が `true` を意味する)
44
- 4. ビルド: `yarn build --scope @markuplint/alpine-spec`
45
-
46
- ## ExtendedSpec 型リファレンス
47
-
48
- `ExtendedSpec` 型(`@markuplint/ml-spec` から)は、このパッケージに関連する以下の構造を持ちます:
49
-
50
- ```ts
51
- interface ExtendedSpec {
52
- cites?: string[];
53
- def?: {
54
- '#globalAttrs'?: {
55
- '#extends': Record<string, AttributeSpec>;
56
- };
57
- };
58
- specs?: Array<{
59
- name: string;
60
- attributes: Record<string, AttributeSpec>;
61
- }>;
62
- }
63
- ```
64
-
65
- ### AttributeSpec のフィールド
66
-
67
- | フィールド | 型 | 必須 | 説明 |
68
- | --------------- | ---------- | ------ | --------------------------------------- |
69
- | `type` | `string` | はい | 属性値の型(`'Any'`、`'Boolean'` など) |
70
- | `caseSensitive` | `boolean` | いいえ | 属性名の大文字小文字を区別するかどうか |
71
- | `condition` | `string[]` | いいえ | 属性が適用される CSS セレクタ条件 |
72
-
73
- ### 型の値
74
-
75
- - `'Any'` -- 属性は任意の値を受け付ける
76
- - `'Boolean'` -- 属性はブール値(存在が `true` を示す)
@@ -1,76 +0,0 @@
1
- # Maintenance Guide
2
-
3
- ## Commands
4
-
5
- | Command | Description |
6
- | -------------------------------------------- | ---------------------- |
7
- | `yarn build --scope @markuplint/alpine-spec` | Build this package |
8
- | `yarn dev --scope @markuplint/alpine-spec` | Watch mode build |
9
- | `yarn clean --scope @markuplint/alpine-spec` | Remove build artifacts |
10
-
11
- ## Testing
12
-
13
- This package has no dedicated test suite. The `ExtendedSpec` object is validated at build time through TypeScript type checking against the `ExtendedSpec` type from `@markuplint/ml-spec`. If the exported object does not conform to the type, the build will fail.
14
-
15
- Integration testing occurs downstream:
16
-
17
- - `@markuplint/ml-spec` resolves the extended spec and merges it with the base HTML spec
18
- - `@markuplint/ml-core` uses the resolved spec during linting, which exercises the attribute definitions
19
-
20
- To verify changes, build the package and run downstream tests:
21
-
22
- ```shell
23
- yarn build --scope @markuplint/alpine-spec
24
- yarn test --scope @markuplint/ml-spec --scope @markuplint/ml-core
25
- ```
26
-
27
- ## Recipes
28
-
29
- ### 1. Adding a Global Attribute
30
-
31
- All Alpine.js directives are global -- they are available on every HTML element.
32
-
33
- 1. Open `src/index.ts`
34
- 2. Add a new entry under `def['#globalAttrs']['#extends']`:
35
- ```ts
36
- /** Description of the directive */
37
- 'x-directiveName': {
38
- type: 'Any', // or 'Boolean'
39
- },
40
- ```
41
- 3. Choose the appropriate type:
42
- - `'Any'` -- accepts any value (strings, expressions, etc.)
43
- - `'Boolean'` -- boolean attribute (presence indicates `true`)
44
- 4. Build: `yarn build --scope @markuplint/alpine-spec`
45
-
46
- ## ExtendedSpec Type Reference
47
-
48
- The `ExtendedSpec` type (from `@markuplint/ml-spec`) has the following structure relevant to this package:
49
-
50
- ```ts
51
- interface ExtendedSpec {
52
- cites?: string[];
53
- def?: {
54
- '#globalAttrs'?: {
55
- '#extends': Record<string, AttributeSpec>;
56
- };
57
- };
58
- specs?: Array<{
59
- name: string;
60
- attributes: Record<string, AttributeSpec>;
61
- }>;
62
- }
63
- ```
64
-
65
- ### AttributeSpec Fields
66
-
67
- | Field | Type | Required | Description |
68
- | --------------- | ---------- | -------- | ------------------------------------------------------ |
69
- | `type` | `string` | Yes | The attribute value type (`'Any'`, `'Boolean'`, etc.) |
70
- | `caseSensitive` | `boolean` | No | Whether the attribute name is case-sensitive |
71
- | `condition` | `string[]` | No | CSS selector conditions for when the attribute applies |
72
-
73
- ### Type Values
74
-
75
- - `'Any'` -- The attribute accepts any value
76
- - `'Boolean'` -- The attribute is a boolean (presence indicates `true`)