@kubohiroya/turbowarp-aframe 0.2.0
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/LICENSE +373 -0
- package/README.ja.md +131 -0
- package/README.md +462 -0
- package/dist/extension-manifest.json +517 -0
- package/dist/turbowarp-aframe.js +1422 -0
- package/docs/architecture.ja.md +136 -0
- package/docs/architecture.md +136 -0
- package/docs/index.html +50 -0
- package/package.json +66 -0
- package/schemas/aframe-template.schema.json +40 -0
- package/schemas/extension-manifest.schema.json +49 -0
- package/src/block-definitions.json +329 -0
- package/src/config.ts +12 -0
- package/src/extension-manifest.ts +149 -0
- package/src/extension.ts +1226 -0
- package/src/globals.d.ts +25 -0
- package/src/index.ts +8 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# アーキテクチャ
|
|
2
|
+
|
|
3
|
+
[English](architecture.md)
|
|
4
|
+
|
|
5
|
+
## 目的
|
|
6
|
+
|
|
7
|
+
TurboWarp-A-Frame は、TurboWarp プロジェクトから A-Frame ベースの宣言型 3D シーングラフを構築・操作するための拡張です。Scratch スプライトの 3D 互換レイヤーではありません。
|
|
8
|
+
|
|
9
|
+
スプライトと背景は script の置き場所として扱います。3D 側の identity は、この拡張が管理する node id、class、`data-*` 属性、A-Frame component 属性、template、selector、instance id、event で表します。
|
|
10
|
+
|
|
11
|
+
## ビルド出力
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
src/index.ts + src/extension.ts
|
|
15
|
+
-> vite-plugin-turbowarp-extension
|
|
16
|
+
-> dist/turbowarp-aframe.js
|
|
17
|
+
|
|
18
|
+
src/config.ts + src/block-definitions.json
|
|
19
|
+
-> extension-api-manifest Viteプラグイン
|
|
20
|
+
-> dist/extension-manifest.json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
生成される JavaScript は unsandboxed TurboWarp 拡張です。manifest は block API contract として互換性確認に使います。
|
|
24
|
+
|
|
25
|
+
## シーン初期化
|
|
26
|
+
|
|
27
|
+
`createScene` は root の `#scene` ノードを作り、ブラウザ DOM がある場合は `#tw-aframe-root > a-scene` を作成します。host は最初に検出できた TurboWarp stage wrapper または canvas の親へ mount し、stage らしい要素が見つからない場合だけ `document.body` に fallback します。
|
|
28
|
+
|
|
29
|
+
初期 layer は文字列です。Book/API 側で語彙を調整しても block shape を変えずに済むようにしています。
|
|
30
|
+
|
|
31
|
+
- `above-stage`: A-Frame を TurboWarp stage の上に重ねます。
|
|
32
|
+
- `below-stage`: host CSS が許す場合に A-Frame を stage の背面へ置きます。
|
|
33
|
+
- `camera-under-3d`: camera/video を 3D layer の下に置く想定です。
|
|
34
|
+
|
|
35
|
+
初期 mode も文字列です。
|
|
36
|
+
|
|
37
|
+
- `3d`: 通常の埋め込み 3D シーンです。
|
|
38
|
+
- `camera`: camera 合成を想定します。
|
|
39
|
+
- `ar-fallback`: AR 非対応端末向けの tracking なし 3D 代替表示です。
|
|
40
|
+
- `ar`: 将来の marker または WebXR ベース AR 用に予約します。
|
|
41
|
+
|
|
42
|
+
初期化後、`when 3D scene ready` が 1 回だけ発火します。
|
|
43
|
+
|
|
44
|
+
## シーングラフ
|
|
45
|
+
|
|
46
|
+
グラフは拡張内で管理します。対応する node kind は A-Frame tag に対応します。
|
|
47
|
+
|
|
48
|
+
- primitive: `box`, `sphere`, `plane`, `circle`, `cone`, `cylinder`
|
|
49
|
+
- media: `image`, `image-plane`, `text`, `model`
|
|
50
|
+
- scene service: `light`, `camera`
|
|
51
|
+
- structure: `group`, `empty`, `primitive`
|
|
52
|
+
|
|
53
|
+
`position`、`rotation`、その他 attribute は親 node に対する local attribute です。world 座標 helper は初期実装の外に置きます。
|
|
54
|
+
|
|
55
|
+
## セレクタ
|
|
56
|
+
|
|
57
|
+
初期 selector subset は意図的に限定します。
|
|
58
|
+
|
|
59
|
+
- `#id`
|
|
60
|
+
- `.class`
|
|
61
|
+
- `[data-key=value]`
|
|
62
|
+
- `*`
|
|
63
|
+
- event ハット実行後の `@event` または `event target`
|
|
64
|
+
|
|
65
|
+
command は一致したすべての node に適用します。1 node が必要な block は、グラフ挿入順の first match を使います。複数一致の挙動を決定的にし、Book 2 で説明しやすくするためです。
|
|
66
|
+
|
|
67
|
+
## テンプレートとインスタンス
|
|
68
|
+
|
|
69
|
+
template は次の形の JSON object です。
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"type": "group",
|
|
74
|
+
"id": "optional-child-id",
|
|
75
|
+
"class": "monster",
|
|
76
|
+
"data": {"zone": "field"},
|
|
77
|
+
"attributes": {"position": "0 1 -3"},
|
|
78
|
+
"children": []
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`create template [TEMPLATE] as [INSTANCE] under [PARENT]` は template root id を明示された instance id に置き換え、子孫 id には instance id prefix を付けます。また root に `data-template` と `data-instance` を追加します。instance id の衝突は error です。親 node を削除すると子孫も削除します。
|
|
83
|
+
|
|
84
|
+
## イベント
|
|
85
|
+
|
|
86
|
+
runtime は hat polling 用の小さな event queue を持ちます。
|
|
87
|
+
|
|
88
|
+
- `scene-ready`
|
|
89
|
+
- `emit 3D event [TYPE] from selector [SELECTOR] with data [DATA]` による user event
|
|
90
|
+
|
|
91
|
+
`when event [TYPE] on selector [SELECTOR]` は一致する最初の queued event を消費します。`event target id` は直近に処理された event target を返します。
|
|
92
|
+
|
|
93
|
+
ブラウザ DOM element が存在する場合、`click`、`tap`、`pointerenter`、`pointerleave` は同じ queue に変換します。hat が指定した custom event type も既存 node と将来作成される node に listener を張ります。`emit 3D event` が dispatch する DOM `CustomEvent` は、自分自身を二重に queue へ積まないようにしています。
|
|
94
|
+
|
|
95
|
+
## キーフレームアニメーション
|
|
96
|
+
|
|
97
|
+
animation clip 定義はシーングラフとは別に保持します。clip は name、seconds 単位の duration、typed keyframe tracks を持ちます。初期対応する track type は次の通りです。
|
|
98
|
+
|
|
99
|
+
- `.position` と `.scale` 用の `VectorKeyframeTrack`
|
|
100
|
+
- `.quaternion` 用の `QuaternionKeyframeTrack`
|
|
101
|
+
|
|
102
|
+
track の `times` と `values` は comma または whitespace 区切りの number list として受け取ります。Vector track は keyframe ごとに 3 値、Quaternion track は keyframe ごとに 4 値を必要とします。Euler rotation 補助ブロックは `degrees` または `radians` の x/y/z triples を受け取り、track 保存前に quaternion values へ変換します。
|
|
103
|
+
|
|
104
|
+
single-keyframe helper block はブロック優先の authoring path です。`.position`、`.scale`、`.quaternion` の keyframe を 1 つずつ挿入し、time 順に並べ、同じ clip、path、time の keyframe は後から追加した値で置き換えます。comma-separated full-track block は、Three.js 形式の配列をすでに持っている advanced user 向けに残します。
|
|
105
|
+
|
|
106
|
+
再生は Scratch sprite ではなく一致した node に紐づきます。browser DOM、A-Frame、`AFRAME.THREE` が利用可能な場合、`play 3D animation clip` は対象 node の root `object3D` ごとに `AnimationMixer` を作成し、clip action を開始し、scene 上の小さな A-Frame bridge component から active mixer を更新します。glTF bone、child object path、material property、blending、cross-fade control は初期実装の外に置きます。DOM のない test environment では、Three.js object を作らず registry と validation を検証できます。
|
|
107
|
+
|
|
108
|
+
既存の `rotation` ブロックは A-Frame attribute を書くため degree-based のまま維持します。Quaternion animation は Three.js object state を使うため、A-Frame Euler attribute rotation とは別の機能として扱います。
|
|
109
|
+
|
|
110
|
+
## 当たり判定スコープ
|
|
111
|
+
|
|
112
|
+
この初期コード slice では当たり判定は未実装です。最初の production model は次を想定します。
|
|
113
|
+
|
|
114
|
+
- selector または collision group の明示登録
|
|
115
|
+
- AABB または bounding sphere 判定
|
|
116
|
+
- octree より先に spatial hash または grid broad phase を検討
|
|
117
|
+
- `enters`、`touches`、`leaves` の event state
|
|
118
|
+
- カード、盤面 zone、monster、effect 程度の教材規模に合わせた更新頻度上限
|
|
119
|
+
|
|
120
|
+
## AR スコープ
|
|
121
|
+
|
|
122
|
+
AR tracking は将来の feature flag 対象です。評価順は次を想定します。
|
|
123
|
+
|
|
124
|
+
- WebXR: 対応 browser/device で信頼できる場合
|
|
125
|
+
- AR.js: marker ベース教材
|
|
126
|
+
- MindAR: image target 実験
|
|
127
|
+
|
|
128
|
+
非対応端末、camera 拒否、marker lost、位置 jitter、認識失敗では、通常 3D mode または `ar-fallback` に縮退し、授業の進行を止めない方針です。
|
|
129
|
+
|
|
130
|
+
## Book 2 API 境界
|
|
131
|
+
|
|
132
|
+
Book 2 では、scene 作成、template 読み込み、instance 作成、selector 操作、event、将来の collision group、将来の AR anchor attach までを小さな block set として扱います。A-Frame と Three.js の詳細は、発展課題または開発者向けドキュメントへ分離します。
|
|
133
|
+
|
|
134
|
+
## ロールバック
|
|
135
|
+
|
|
136
|
+
A-Frame 統合が重すぎる場合は、graph core を残したまま DOM backend を薄い Three.js renderer に置き換えられます。AR 認識が不安定な場合は AR を実験機能に留め、通常の 3D カードゲーム表現を主経路にします。当たり判定が重い場合は明示登録された group だけに限定し、更新頻度を落とします。
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
[日本語](architecture.ja.md)
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
TurboWarp-A-Frame lets TurboWarp projects construct and operate a declarative 3D scene graph backed by A-Frame. It is not a 3D compatibility layer for Scratch sprites.
|
|
8
|
+
|
|
9
|
+
Sprites and backdrops remain script containers. The extension-owned graph uses node ids, classes, `data-*` attributes, A-Frame component attributes, templates, selectors, instance ids, and events as its identity model.
|
|
10
|
+
|
|
11
|
+
## Build outputs
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
src/index.ts + src/extension.ts
|
|
15
|
+
-> vite-plugin-turbowarp-extension
|
|
16
|
+
-> dist/turbowarp-aframe.js
|
|
17
|
+
|
|
18
|
+
src/config.ts + src/block-definitions.json
|
|
19
|
+
-> extension-api-manifest Vite plugin
|
|
20
|
+
-> dist/extension-manifest.json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The generated JavaScript bundle is an unsandboxed TurboWarp extension. The manifest records the block API contract for compatibility checks.
|
|
24
|
+
|
|
25
|
+
## Scene initialization
|
|
26
|
+
|
|
27
|
+
`createScene` creates a root `#scene` node and, when a browser DOM exists, a `#tw-aframe-root > a-scene` host. The host is mounted inside the first detected TurboWarp stage wrapper or canvas parent, falling back to `document.body` only when no stage-like element is found.
|
|
28
|
+
|
|
29
|
+
The initial layer values are strings so the book/API can refine the vocabulary without changing the block shape:
|
|
30
|
+
|
|
31
|
+
- `above-stage`: A-Frame overlays the TurboWarp stage.
|
|
32
|
+
- `below-stage`: A-Frame stays behind the stage when the host CSS allows it.
|
|
33
|
+
- `camera-under-3d`: camera/video should sit below the 3D layer.
|
|
34
|
+
|
|
35
|
+
The initial mode values are also open strings:
|
|
36
|
+
|
|
37
|
+
- `3d`: ordinary embedded 3D scene.
|
|
38
|
+
- `camera`: camera-backed composition.
|
|
39
|
+
- `ar-fallback`: non-tracking 3D fallback for unsupported AR devices.
|
|
40
|
+
- `ar`: reserved for future marker or WebXR-backed AR.
|
|
41
|
+
|
|
42
|
+
After initialization, `when 3D scene ready` fires once.
|
|
43
|
+
|
|
44
|
+
## Scene graph
|
|
45
|
+
|
|
46
|
+
The graph is local to the extension. Supported node kinds map to A-Frame tags:
|
|
47
|
+
|
|
48
|
+
- primitives: `box`, `sphere`, `plane`, `circle`, `cone`, `cylinder`
|
|
49
|
+
- media: `image`, `image-plane`, `text`, `model`
|
|
50
|
+
- scene services: `light`, `camera`
|
|
51
|
+
- structure: `group`, `empty`, `primitive`
|
|
52
|
+
|
|
53
|
+
`position`, `rotation`, and other attributes are local attributes relative to each node parent. World-coordinate helpers are deliberately outside the first implementation.
|
|
54
|
+
|
|
55
|
+
## Selectors
|
|
56
|
+
|
|
57
|
+
The first selector subset is intentionally small:
|
|
58
|
+
|
|
59
|
+
- `#id`
|
|
60
|
+
- `.class`
|
|
61
|
+
- `[data-key=value]`
|
|
62
|
+
- `*`
|
|
63
|
+
- `@event` or `event target` after an event hat runs
|
|
64
|
+
|
|
65
|
+
Commands apply to all matches. Blocks that need one node use the first match in insertion order. This keeps multi-match behavior deterministic and easy to explain in Book 2.
|
|
66
|
+
|
|
67
|
+
## Templates and instances
|
|
68
|
+
|
|
69
|
+
Templates are JSON objects with this shape:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"type": "group",
|
|
74
|
+
"id": "optional-child-id",
|
|
75
|
+
"class": "monster",
|
|
76
|
+
"data": {"zone": "field"},
|
|
77
|
+
"attributes": {"position": "0 1 -3"},
|
|
78
|
+
"children": []
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`create template [TEMPLATE] as [INSTANCE] under [PARENT]` replaces the template root id with the explicit instance id and prefixes descendant ids with that instance id. It also adds `data-template` and `data-instance` values to the root. Instance id collisions are rejected. Deleting a parent deletes its descendants.
|
|
83
|
+
|
|
84
|
+
## Events
|
|
85
|
+
|
|
86
|
+
The runtime stores a small event queue for hat polling:
|
|
87
|
+
|
|
88
|
+
- `scene-ready`
|
|
89
|
+
- user events emitted by `emit 3D event [TYPE] from selector [SELECTOR] with data [DATA]`
|
|
90
|
+
|
|
91
|
+
`when event [TYPE] on selector [SELECTOR]` consumes the first matching queued event. `event target id` reports the most recently handled target.
|
|
92
|
+
|
|
93
|
+
Browser `click`, `tap`, `pointerenter`, and `pointerleave` events are converted into the same queue when their target node matches the selector watched by a hat block. Custom event types requested by hats are also attached to existing and future nodes. Events emitted by `emit 3D event` dispatch a DOM `CustomEvent` without re-queuing themselves.
|
|
94
|
+
|
|
95
|
+
## Keyframe Animations
|
|
96
|
+
|
|
97
|
+
Animation clip definitions are stored separately from the scene graph. A clip has a name, duration in seconds, and typed keyframe tracks. The first supported track types are:
|
|
98
|
+
|
|
99
|
+
- `VectorKeyframeTrack` for `.position` and `.scale`
|
|
100
|
+
- `QuaternionKeyframeTrack` for `.quaternion`
|
|
101
|
+
|
|
102
|
+
Track `times` and `values` are passed as comma- or whitespace-separated number lists. Vector tracks require three values per keyframe. Quaternion tracks require four values per keyframe. Euler rotation helper blocks accept x/y/z triples in `degrees` or `radians` and convert them into quaternion values before storing the track.
|
|
103
|
+
|
|
104
|
+
Single-keyframe helper blocks provide the block-first authoring path. They insert one `.position`, `.scale`, or `.quaternion` keyframe at a time, keep keyframes sorted, and replace an existing keyframe when the clip, path, and time match. The comma-separated full-track blocks remain available for advanced users who already have Three.js-style arrays.
|
|
105
|
+
|
|
106
|
+
Playback is attached to matching nodes, not Scratch sprites. When browser DOM, A-Frame, and `AFRAME.THREE` are available, `play 3D animation clip` creates an `AnimationMixer` for each target node root `object3D`, starts a clip action, and updates active mixers through a small A-Frame bridge component on the scene. glTF bones, child object paths, material properties, blending, and cross-fade controls are left outside the first implementation. In non-DOM test environments, the registry and validation behavior remain testable without constructing Three.js objects.
|
|
107
|
+
|
|
108
|
+
The existing `rotation` block remains degree-based because it writes A-Frame attributes. Quaternion animation uses Three.js object state and should be documented as separate from A-Frame Euler attribute rotation.
|
|
109
|
+
|
|
110
|
+
## Collision Scope
|
|
111
|
+
|
|
112
|
+
Collision detection is not implemented in this first code slice. The intended first production model is:
|
|
113
|
+
|
|
114
|
+
- explicit selector or collision-group registration
|
|
115
|
+
- AABB or bounding sphere checks
|
|
116
|
+
- spatial hash or grid broad phase before considering octree complexity
|
|
117
|
+
- `enters`, `touches`, and `leaves` event states
|
|
118
|
+
- capped update frequency for classroom-scale card, zone, monster, and effect counts
|
|
119
|
+
|
|
120
|
+
## AR Scope
|
|
121
|
+
|
|
122
|
+
AR tracking is reserved for a later feature flag. The planned evaluation order is:
|
|
123
|
+
|
|
124
|
+
- WebXR for devices with reliable browser support
|
|
125
|
+
- AR.js for marker-based lessons
|
|
126
|
+
- MindAR for image-target experiments
|
|
127
|
+
|
|
128
|
+
Unsupported devices, camera denial, marker loss, jitter, and recognition failure must fall back to ordinary 3D mode or `ar-fallback` without breaking the lesson flow.
|
|
129
|
+
|
|
130
|
+
## Book 2 API Boundary
|
|
131
|
+
|
|
132
|
+
Book 2 should teach a small block set: scene creation, template loading, instance creation, selector operations, events, future collision groups, and future AR anchor attachment. A-Frame and Three.js internals stay in developer documentation unless the lesson explicitly moves into an advanced section.
|
|
133
|
+
|
|
134
|
+
## Rollback
|
|
135
|
+
|
|
136
|
+
If A-Frame integration becomes too heavy, the graph core can remain while the DOM backend is replaced with a thinner Three.js renderer. If AR recognition is unstable, AR remains experimental and the ordinary 3D card-game path stays the default. If collision checks are expensive, checks are limited to explicitly registered groups with lower update frequency.
|
package/docs/index.html
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<title>TurboWarp-A-Frame documentation</title>
|
|
7
|
+
<style>
|
|
8
|
+
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;max-width:900px;margin:0 auto;padding:2rem;line-height:1.6;color:#222}
|
|
9
|
+
code{background:#f3f3f3;padding:.1em .3em;border-radius:.25em}
|
|
10
|
+
pre{background:#f6f8fa;padding:1rem;overflow:auto;border-radius:.5rem}
|
|
11
|
+
</style>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<h1>TurboWarp-A-Frame</h1>
|
|
15
|
+
<p>TurboWarp-A-Frame is an unsandboxed TurboWarp extension for building declarative A-Frame scene graphs from blocks.</p>
|
|
16
|
+
|
|
17
|
+
<h2>Scene model</h2>
|
|
18
|
+
<p>Scratch sprites and backdrops are script containers. The 3D graph is addressed through node ids, classes, data attributes, A-Frame attributes, templates, selectors, and events.</p>
|
|
19
|
+
|
|
20
|
+
<h2>Core blocks</h2>
|
|
21
|
+
<ul>
|
|
22
|
+
<li><code>create 3D scene with layer [LAYER] mode [MODE]</code></li>
|
|
23
|
+
<li><code>load template [ID] from JSON [SOURCE]</code></li>
|
|
24
|
+
<li><code>create [TYPE] node id [ID] under [PARENT]</code></li>
|
|
25
|
+
<li><code>create template [TEMPLATE] as [INSTANCE] under [PARENT]</code></li>
|
|
26
|
+
<li><code>set selector [SELECTOR] position x [X] y [Y] z [Z]</code></li>
|
|
27
|
+
<li><code>emit 3D event [TYPE] from selector [SELECTOR] with data [DATA]</code></li>
|
|
28
|
+
<li><code>when 3D scene ready</code></li>
|
|
29
|
+
<li><code>when event [TYPE] on selector [SELECTOR]</code></li>
|
|
30
|
+
</ul>
|
|
31
|
+
|
|
32
|
+
<h2>Animation blocks</h2>
|
|
33
|
+
<ul>
|
|
34
|
+
<li><code>create 3D animation clip [NAME] duration [DURATION]</code></li>
|
|
35
|
+
<li><code>add vector keyframe track to clip [CLIP] path [PATH] times [TIMES] values [VALUES]</code></li>
|
|
36
|
+
<li><code>add quaternion keyframe track to clip [CLIP] path [PATH] times [TIMES] values [VALUES]</code></li>
|
|
37
|
+
<li><code>add euler rotation keyframe track to clip [CLIP] path [PATH] times [TIMES] values [VALUES] unit [UNIT]</code></li>
|
|
38
|
+
<li><code>add position keyframe to clip [CLIP] at [TIME] x [X] y [Y] z [Z]</code></li>
|
|
39
|
+
<li><code>add scale keyframe to clip [CLIP] at [TIME] x [X] y [Y] z [Z]</code></li>
|
|
40
|
+
<li><code>add euler rotation keyframe to clip [CLIP] at [TIME] x [X] y [Y] z [Z] unit [UNIT]</code></li>
|
|
41
|
+
<li><code>play 3D animation clip [CLIP] on selector [SELECTOR] loop [LOOP]</code></li>
|
|
42
|
+
<li><code>stop 3D animation clip [CLIP] on selector [SELECTOR]</code></li>
|
|
43
|
+
<li><code>pause 3D animation clip [CLIP] on selector [SELECTOR]</code></li>
|
|
44
|
+
<li><code>resume 3D animation clip [CLIP] on selector [SELECTOR]</code></li>
|
|
45
|
+
</ul>
|
|
46
|
+
|
|
47
|
+
<h2>Development</h2>
|
|
48
|
+
<p>See the repository README and architecture documentation for build, test, release, compatibility, rollback, collision, and AR fallback details.</p>
|
|
49
|
+
</body>
|
|
50
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kubohiroya/turbowarp-aframe",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A TurboWarp extension for declarative A-Frame scene graphs.",
|
|
5
|
+
"author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
|
|
6
|
+
"license": "MPL-2.0",
|
|
7
|
+
"homepage": "https://github.com/kubohiroya/turbowarp-aframe#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/kubohiroya/turbowarp-aframe.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/kubohiroya/turbowarp-aframe/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"turbowarp",
|
|
17
|
+
"scratch",
|
|
18
|
+
"extension",
|
|
19
|
+
"aframe",
|
|
20
|
+
"3d",
|
|
21
|
+
"ar",
|
|
22
|
+
"scene-graph",
|
|
23
|
+
"vite",
|
|
24
|
+
"typescript"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist/",
|
|
29
|
+
"docs/",
|
|
30
|
+
"schemas/",
|
|
31
|
+
"src/",
|
|
32
|
+
"README.md",
|
|
33
|
+
"README.ja.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public",
|
|
38
|
+
"registry": "https://registry.npmjs.org/"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=22.18.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@eslint/js": "^9.39.5",
|
|
45
|
+
"@kubohiroya/vite-plugin-turbowarp-extension": "0.4.0",
|
|
46
|
+
"@types/node": "^24.13.3",
|
|
47
|
+
"eslint": "^9.39.5",
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"typescript-eslint": "^8.66.0",
|
|
50
|
+
"vite": "^8.2.2",
|
|
51
|
+
"vitest": "^4.1.10"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "vite build --watch",
|
|
55
|
+
"typecheck": "tsc --noEmit",
|
|
56
|
+
"build": "vite build",
|
|
57
|
+
"lint": "eslint src tests vite.config.ts",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"docs": "node scripts/generate-readme.ts",
|
|
60
|
+
"docs:check": "pnpm run docs && git diff --exit-code -- README.md",
|
|
61
|
+
"repo:check": "node scripts/check-repo.ts",
|
|
62
|
+
"pack:check": "npm pack --dry-run --ignore-scripts",
|
|
63
|
+
"check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run docs:check && pnpm run check:dist && pnpm run repo:check && pnpm run pack:check",
|
|
64
|
+
"check:dist": "pnpm run build && node scripts/check-dist.ts"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/kubohiroya/turbowarp-aframe/main/schemas/aframe-template.schema.json",
|
|
4
|
+
"title": "TurboWarp-A-Frame Template Node",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"type": {"type": "string", "minLength": 1},
|
|
9
|
+
"id": {"type": "string", "minLength": 1},
|
|
10
|
+
"class": {
|
|
11
|
+
"oneOf": [
|
|
12
|
+
{"type": "string"},
|
|
13
|
+
{
|
|
14
|
+
"type": "array",
|
|
15
|
+
"items": {"type": "string"},
|
|
16
|
+
"uniqueItems": true
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"classes": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {"type": "string"},
|
|
23
|
+
"uniqueItems": true
|
|
24
|
+
},
|
|
25
|
+
"data": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"propertyNames": {"type": "string", "minLength": 1},
|
|
28
|
+
"additionalProperties": {"type": ["string", "number", "boolean", "null"]}
|
|
29
|
+
},
|
|
30
|
+
"attributes": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"propertyNames": {"type": "string", "minLength": 1},
|
|
33
|
+
"additionalProperties": {"type": ["string", "number", "boolean", "null"]}
|
|
34
|
+
},
|
|
35
|
+
"children": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": {"$ref": "#"}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/kubohiroya/turbowarp-aframe/main/schemas/extension-manifest.schema.json",
|
|
4
|
+
"title": "TurboWarp Extension API Manifest",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["formatVersion", "id", "blocks", "menus"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"formatVersion": {"const": 1},
|
|
10
|
+
"id": {"type": "string", "pattern": "^[a-z0-9]+$"},
|
|
11
|
+
"blocks": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"items": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["opcode", "blockType", "arguments"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"opcode": {"type": "string", "minLength": 1},
|
|
19
|
+
"blockType": {"type": "string", "minLength": 1},
|
|
20
|
+
"arguments": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": ["id", "type"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"id": {"type": "string", "minLength": 1},
|
|
28
|
+
"type": {"type": "string", "minLength": 1},
|
|
29
|
+
"menu": {"type": "string", "minLength": 1}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"menus": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["id", "acceptReporters"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"id": {"type": "string", "minLength": 1},
|
|
44
|
+
"acceptReporters": {"type": "boolean"}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|