@kubohiroya/turbowarp-aframe 0.7.0 → 0.8.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/README.ja.md +6 -1
- package/README.md +6 -1
- package/dist/turbowarp-aframe.js +16548 -7926
- package/docs/editor-schema-ci-fix-20261018.ja.md +25 -0
- package/docs/editor-schema-ci-fix-20261018.json +88 -0
- package/docs/editor-schema-publication.ja.md +13 -0
- package/docs/editor-schema-publication.json +100 -0
- package/docs/editor-schema-verification.json +50 -0
- package/docs/editor-schema.ja.md +23 -0
- package/docs/fixed-input-editors.ja.md +52 -0
- package/docs/index.html +56 -1
- package/docs/source-editor.ja.md +13 -0
- package/docs/stage-2-publication.ja.md +34 -0
- package/docs/stage-2-publication.json +67 -0
- package/lib-editor/schemas/block-editor-template-compat.schema.json +48 -0
- package/lib-editor/src/editor-schema.d.ts +44 -0
- package/lib-editor/src/editor-schema.js +100 -0
- package/lib-editor/src/template-validation.d.ts +10 -0
- package/lib-editor/src/template-validation.js +69 -0
- package/package.json +29 -6
- package/schemas/block-editor-fixed-inputs.schema.json +229 -0
- package/schemas/block-editor-template-compat.schema.json +48 -0
- package/src/editor-schema.ts +111 -0
- package/src/extension.ts +22 -78
- package/src/fixed-input-editors.ts +142 -0
- package/src/fixed-input-schema.ts +14 -0
- package/src/source-editors.ts +30 -0
- package/src/template-validation.ts +79 -0
- package/schemas/extension-manifest.schema.json +0 -49
- package/src/extension-manifest.ts +0 -149
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# 段階2の安定版公開と検証
|
|
2
|
+
|
|
3
|
+
対象: `@kubohiroya/turbowarp-aframe@0.8.0`。追跡Issueは https://github.com/kubohiroya/turbowarp-aframe/issues/21 です。Issue本文は変更せず、PRではRefsを使って自動closeを避けます。
|
|
4
|
+
|
|
5
|
+
loadTemplate.SOURCEを互換SchemaのSource/Form編集へ接続します。空id/type、class重複、属性のarray/object/null/数値を保持し、参照用の厳格Schemaへ置き換えません。
|
|
6
|
+
|
|
7
|
+
## 正本・UI・互換性
|
|
8
|
+
|
|
9
|
+
Schemaの正本、対象入力、pure owner検証は [Source/Form接続](source-editor.ja.md) に記載します。固定Schemaに基づくJSON/YAML編集を提供し、形式・variant・未編集値を保存rawに保持します。保存候補を一度だけ作り、検査成功した同じ候補をcommitします。旧GUIはoptional API不在なら登録せず、通常実行を継続します。
|
|
10
|
+
|
|
11
|
+
GUIの `src/lib/tw-feature-flags.js` で起動時固定の `blockEditorSourceForms` は既定OFFです。`blockEditorDialogs` と両方が有効な場合にだけ新APIを公開し、信頼する拡張をunsandboxedで読み込みます。Schema自体の編集・動的Schema・候補enumの新規作成は対象外です。
|
|
12
|
+
|
|
13
|
+
## 公開依存と配布境界
|
|
14
|
+
|
|
15
|
+
- `@kubohiroya/turbowarp-extension-data-editor`: `git+https://github.com/kubohiroya/turbowarp-extension-data-editor.git#76fa1d50a3c188082ceef723ea018a9d8769ea6e`
|
|
16
|
+
|
|
17
|
+
共通は [PR #32](https://github.com/kubohiroya/turbowarp-extension-data-editor/pull/32) と [fast-uri修正 #33](https://github.com/kubohiroya/turbowarp-extension-data-editor/pull/33) を含む `76fa1d50a3c188082ceef723ea018a9d8769ea6e`(0.2.0)へ固定します。manifest・lock・allowBuilds・fresh Git prepareの実解決を一致させ、common直下とAJV経由を含めfast-uriを3.1.8へ揃えました。他の既存依存版は維持し、結合テストが使うoptional ReactDOM peerだけをdevDependency 18.3.1 exactで明示しました。
|
|
18
|
+
|
|
19
|
+
commonの検証済みmain tarball SHA-256は `f51d14a502442336d6803009e3f6780fb03f7c3c51203287fed83073551a9194`、source hashは `912efc0438710958698527aa5c26a33b0b1c2da280f91d36b048f6f2389a48f0`。Git prepareのbuild-infoはsourceState=`archive`、main tarballは`commit`です。採取方法を同一と扱わず、同じrevision/source hashを照合します。
|
|
20
|
+
|
|
21
|
+
## 検証と受け入れ基準
|
|
22
|
+
|
|
23
|
+
- Node22.23.3 / pnpm@11.11.0、scripts有効のfresh frozen installで全60テストが成功しました。
|
|
24
|
+
- 型・lint・README生成・repository policy・pack検査、該当するSchema/fixture生成が成功し、production auditは0件です。
|
|
25
|
+
- 同一場所で2回buildし、7生成物がSHA-256一致しました。別物理配置でもfresh frozen installとbuildを行い、同じ全生成物が一致しました。
|
|
26
|
+
- Viteのregionコメントに含まれる依存の物理パスだけを除去します。実行コード・licenseを保持し、CIとローカルで配布先が異なっても同じ生成物になります。
|
|
27
|
+
- `check-dist`/docsのGit差分検査はcommit後に確認します。各PRのHEAD/CIとmerge結果、main tarballの実体・registry integrityは公開時の集約記録で区別して確認します。
|
|
28
|
+
- 過去の関連659テスト・実GUI5ケース×8手順、段階1の66/1,106件・135生成物は保存した採取履歴です。今回の全件結果へ加算しません。
|
|
29
|
+
|
|
30
|
+
## 実施順・ロールバック
|
|
31
|
+
|
|
32
|
+
共通artifact→Scene Graph/Camera Source等のproducer→consumerの依存順でPRを確認し、HEAD/CI再確認後にsquash mergeします。npm公開はmerge済みmainの同一tarballを使って別途実施し、公開後のintegrityも確認します。既存Pages/CI設定は維持します。
|
|
33
|
+
|
|
34
|
+
切戻しは `blockEditorSourceForms` OFFでGUIを再起動します。必要ならconsumer→producer→共通の逆順でrevertし、manifest・lock・allowBuildsを一緒に戻します。rawを自動変換せず、公開済みnpm版を削除せずに修正版を新しいversionで公開します。
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scope": "stage-2-stable-release",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"previousVersion": "0.7.0",
|
|
5
|
+
"baseHead": "224775e7207e221d4c91b2ee4a7229d61c44c94f",
|
|
6
|
+
"issue": "https://github.com/kubohiroya/turbowarp-aframe/issues/21",
|
|
7
|
+
"issueWrites": "not performed in this release; Ref only, no automatic close",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@kubohiroya/turbowarp-extension-data-editor": "git+https://github.com/kubohiroya/turbowarp-extension-data-editor.git#76fa1d50a3c188082ceef723ea018a9d8769ea6e"
|
|
10
|
+
},
|
|
11
|
+
"commonBuildInfo": {
|
|
12
|
+
"name": "@kubohiroya/turbowarp-extension-data-editor",
|
|
13
|
+
"version": "0.2.0",
|
|
14
|
+
"repository": "https://github.com/kubohiroya/turbowarp-extension-data-editor",
|
|
15
|
+
"revision": "76fa1d50a3c188082ceef723ea018a9d8769ea6e",
|
|
16
|
+
"sourceState": "archive",
|
|
17
|
+
"sourceSha256": "912efc0438710958698527aa5c26a33b0b1c2da280f91d36b048f6f2389a48f0",
|
|
18
|
+
"capabilities": {
|
|
19
|
+
"preparedSource": 1
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"commonMainTarballSha256": "f51d14a502442336d6803009e3f6780fb03f7c3c51203287fed83073551a9194",
|
|
23
|
+
"commonMainTarballBuildInfo": {
|
|
24
|
+
"name": "@kubohiroya/turbowarp-extension-data-editor",
|
|
25
|
+
"version": "0.2.0",
|
|
26
|
+
"repository": "https://github.com/kubohiroya/turbowarp-extension-data-editor",
|
|
27
|
+
"revision": "76fa1d50a3c188082ceef723ea018a9d8769ea6e",
|
|
28
|
+
"sourceState": "commit",
|
|
29
|
+
"sourceSha256": "912efc0438710958698527aa5c26a33b0b1c2da280f91d36b048f6f2389a48f0",
|
|
30
|
+
"capabilities": {
|
|
31
|
+
"preparedSource": 1
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"commonProvenance": "Git prepare archive and main pack commit identify the same revision/sourceSha256; provenance sourceState is intentionally distinguished",
|
|
35
|
+
"fastUri": "3.1.8 across direct/common-AJV and all lock nodes",
|
|
36
|
+
"reactDomTestPeer": "devDependency 18.3.1 exact; no production API/permission change",
|
|
37
|
+
"node": "22.23.3",
|
|
38
|
+
"packageManager": "pnpm@11.11.0",
|
|
39
|
+
"fullTests": 60,
|
|
40
|
+
"fullTestFiles": 6,
|
|
41
|
+
"generatedFiles": 7,
|
|
42
|
+
"generatedSha256": {
|
|
43
|
+
"dist/extension-manifest.json": "8eac539f8ac68b78207e43ebc928834d66b694996db8acde47d916b34652988a",
|
|
44
|
+
"dist/turbowarp-aframe.js": "34c3555fcb97134f5d5028c39c2174230181ea4f851276f124ae98317fe94f97",
|
|
45
|
+
"lib-editor/schemas/block-editor-template-compat.schema.json": "10d385bedffe4133c374059278ed7393023055af23d2a26d49099d5ffaac0e75",
|
|
46
|
+
"lib-editor/src/editor-schema.d.ts": "cbe86a73ec3f2673da0c4d6bc48ff4d9152faaebd0bb4b5807b48b8d6ad09bd7",
|
|
47
|
+
"lib-editor/src/template-validation.js": "9726e75a5f5d2f8d9e75627b2a131245a8bc9fc84da0d23b4b3035eca7a0e2b1",
|
|
48
|
+
"lib-editor/src/editor-schema.js": "c04b24e30465589b35b53ff4d3e682b40b429452885011e58b16ed828838c935",
|
|
49
|
+
"lib-editor/src/template-validation.d.ts": "dec81b820da071d823a9909dd65a0a6b36d08391ddce5a0bd7c50f7b686ee021"
|
|
50
|
+
},
|
|
51
|
+
"samePathTwoBuildsMatch": true,
|
|
52
|
+
"freshCrossPathBuildMatches": true,
|
|
53
|
+
"productionAudit": "0 vulnerabilities",
|
|
54
|
+
"historicalStage2Subset": {
|
|
55
|
+
"count": 659,
|
|
56
|
+
"note": "prior whole-cohort related cases; not added to current full suite",
|
|
57
|
+
"guiCases": 5,
|
|
58
|
+
"stepsPerCase": 8
|
|
59
|
+
},
|
|
60
|
+
"flags": {
|
|
61
|
+
"blockEditorSourceForms": false,
|
|
62
|
+
"blockEditorDialogsRequired": true
|
|
63
|
+
},
|
|
64
|
+
"postCommitChecks": "repository check-dist/docs Git guards run after commit; CI outcome recorded in PR and aggregate",
|
|
65
|
+
"publication": "user-authorized commit/push/PR/squash merge and npm release; npm publisher is coordinated separately",
|
|
66
|
+
"rollback": "flag OFF; reverse dependency revert package/lock/allowBuilds; retain published npm versions and publish fixes under new versions"
|
|
67
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kubohiroya.github.io/turbowarp-aframe/schemas/block-editor-template-compat.schema.json",
|
|
4
|
+
"title": "A-Frame existing parser compatible template",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"type": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"id": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"class": {
|
|
15
|
+
"oneOf": [
|
|
16
|
+
{
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"classes": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": {
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"data": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": true
|
|
36
|
+
},
|
|
37
|
+
"attributes": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": true
|
|
40
|
+
},
|
|
41
|
+
"children": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": {
|
|
44
|
+
"$ref": "#"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { SchemaValidationContext } from '@kubohiroya/turbowarp-extension-data-editor/schema';
|
|
2
|
+
import type { SchemaBundle, SyncOwnerValidator } from '@kubohiroya/turbowarp-extension-data-editor/schema';
|
|
3
|
+
export { validateTemplateNode } from './template-validation.js';
|
|
4
|
+
/** Parser-compatible gate; the older strict public schema is reference material only. */
|
|
5
|
+
export declare const templateSchemaBundle: SchemaBundle;
|
|
6
|
+
export declare const validateTemplateInput: SyncOwnerValidator;
|
|
7
|
+
export declare function decodeTemplateSource(source: string): {
|
|
8
|
+
source: string;
|
|
9
|
+
format: "json";
|
|
10
|
+
variantId: "template-json";
|
|
11
|
+
data: unknown;
|
|
12
|
+
};
|
|
13
|
+
/** Safe source boundary: preserve raw input separately from diagnostics and normalized values. */
|
|
14
|
+
export declare function validateTemplateSource(source: string, context: SchemaValidationContext): {
|
|
15
|
+
source: string;
|
|
16
|
+
result: {
|
|
17
|
+
kind: "invalid";
|
|
18
|
+
diagnostics: readonly [import("@kubohiroya/turbowarp-extension-data-editor/schema").SchemaDiagnosticBase & {
|
|
19
|
+
readonly phase: "decode";
|
|
20
|
+
readonly code: "input-format-invalid" | "variant-unrecognized";
|
|
21
|
+
readonly dataPath: import("@kubohiroya/turbowarp-extension-data-editor/schema").JsonPointer;
|
|
22
|
+
} & {
|
|
23
|
+
phase: "decode";
|
|
24
|
+
}];
|
|
25
|
+
};
|
|
26
|
+
} | {
|
|
27
|
+
result: {
|
|
28
|
+
readonly kind: "schema-error";
|
|
29
|
+
readonly diagnostics: import("@kubohiroya/turbowarp-extension-data-editor/schema").NonEmpty<import("@kubohiroya/turbowarp-extension-data-editor/schema").CompileDiagnostic>;
|
|
30
|
+
} | {
|
|
31
|
+
readonly kind: "execution-error";
|
|
32
|
+
readonly diagnostics: import("@kubohiroya/turbowarp-extension-data-editor/schema").NonEmpty<import("@kubohiroya/turbowarp-extension-data-editor/schema").CompileExecutionDiagnostic>;
|
|
33
|
+
};
|
|
34
|
+
source: string;
|
|
35
|
+
format: "json";
|
|
36
|
+
variantId: "template-json";
|
|
37
|
+
data: unknown;
|
|
38
|
+
} | {
|
|
39
|
+
result: import("@kubohiroya/turbowarp-extension-data-editor/schema").SchemaInputValidationResult;
|
|
40
|
+
source: string;
|
|
41
|
+
format: "json";
|
|
42
|
+
variantId: "template-json";
|
|
43
|
+
data: unknown;
|
|
44
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { compileSchemaBundle, validateSchemaInput, } from '@kubohiroya/turbowarp-extension-data-editor/schema';
|
|
2
|
+
import document from '../schemas/block-editor-template-compat.schema.json' with { type: 'json' };
|
|
3
|
+
import { validateTemplateNode } from './template-validation.js';
|
|
4
|
+
export { validateTemplateNode } from './template-validation.js';
|
|
5
|
+
const source = {
|
|
6
|
+
repository: 'turbowarp-aframe',
|
|
7
|
+
path: 'schemas/block-editor-template-compat.schema.json',
|
|
8
|
+
};
|
|
9
|
+
/** Parser-compatible gate; the older strict public schema is reference material only. */
|
|
10
|
+
export const templateSchemaBundle = {
|
|
11
|
+
identity: {
|
|
12
|
+
ownerId: 'turbowarp-aframe',
|
|
13
|
+
contractId: 'aframe-template',
|
|
14
|
+
revision: 'parser-v0.7.0',
|
|
15
|
+
variantId: 'template-json',
|
|
16
|
+
},
|
|
17
|
+
dialect: '2020-12',
|
|
18
|
+
root: {
|
|
19
|
+
retrievalUri: document.$id,
|
|
20
|
+
document: document,
|
|
21
|
+
artifact: { role: 'canonical-schema', source },
|
|
22
|
+
},
|
|
23
|
+
resources: [],
|
|
24
|
+
provenance: {
|
|
25
|
+
canonicalSources: [
|
|
26
|
+
source,
|
|
27
|
+
{
|
|
28
|
+
repository: 'turbowarp-aframe',
|
|
29
|
+
path: 'src/template-validation.ts',
|
|
30
|
+
symbol: 'validateTemplateNode',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
generatedFiles: [],
|
|
34
|
+
referenceSchemas: [
|
|
35
|
+
{ repository: 'turbowarp-aframe', path: 'schemas/aframe-template.schema.json' },
|
|
36
|
+
],
|
|
37
|
+
generationSources: [],
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const validateTemplateInput = (data) => {
|
|
41
|
+
try {
|
|
42
|
+
validateTemplateNode(data, 'template');
|
|
43
|
+
return { kind: 'valid', issues: [] };
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return { kind: 'invalid', issues: [{ dataPath: '', ruleId: 'existing-template-parser' }] };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
export function decodeTemplateSource(source) {
|
|
50
|
+
return {
|
|
51
|
+
source,
|
|
52
|
+
format: 'json',
|
|
53
|
+
variantId: 'template-json',
|
|
54
|
+
data: JSON.parse(source),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const sourceCompilation = compileSchemaBundle(templateSchemaBundle);
|
|
58
|
+
/** Safe source boundary: preserve raw input separately from diagnostics and normalized values. */
|
|
59
|
+
export function validateTemplateSource(source, context) {
|
|
60
|
+
let consumerId;
|
|
61
|
+
try {
|
|
62
|
+
const descriptor = Object.getOwnPropertyDescriptor(context, 'consumerId');
|
|
63
|
+
if (descriptor && 'value' in descriptor && typeof descriptor.value === 'string')
|
|
64
|
+
consumerId = descriptor.value;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
/* Leave the consumer unspecified when context cannot be inspected safely. */
|
|
68
|
+
}
|
|
69
|
+
let decoded;
|
|
70
|
+
try {
|
|
71
|
+
decoded = decodeTemplateSource(source);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
const code = error instanceof TypeError && error.message === 'Unrecognized camera profile variant.'
|
|
75
|
+
? 'variant-unrecognized'
|
|
76
|
+
: 'input-format-invalid';
|
|
77
|
+
const diagnostics = [
|
|
78
|
+
{
|
|
79
|
+
scope: {
|
|
80
|
+
identity: templateSchemaBundle.identity,
|
|
81
|
+
...(consumerId === undefined ? {} : { consumerId }),
|
|
82
|
+
},
|
|
83
|
+
phase: 'decode',
|
|
84
|
+
code,
|
|
85
|
+
dataPath: '',
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
return { source, result: { kind: 'invalid', diagnostics } };
|
|
89
|
+
}
|
|
90
|
+
const compilation = sourceCompilation;
|
|
91
|
+
if (compilation.kind !== 'compiled')
|
|
92
|
+
return { ...decoded, result: compilation };
|
|
93
|
+
return {
|
|
94
|
+
...decoded,
|
|
95
|
+
result: validateSchemaInput(compilation.validator, decoded.data, {
|
|
96
|
+
context,
|
|
97
|
+
ownerValidate: validateTemplateInput,
|
|
98
|
+
}),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface TemplateNode {
|
|
2
|
+
type?: string;
|
|
3
|
+
id?: string;
|
|
4
|
+
class?: string | string[];
|
|
5
|
+
classes?: string[];
|
|
6
|
+
data?: Record<string, unknown>;
|
|
7
|
+
attributes?: Record<string, unknown>;
|
|
8
|
+
children?: TemplateNode[];
|
|
9
|
+
}
|
|
10
|
+
export declare function validateTemplateNode(value: unknown, path: string): asserts value is TemplateNode;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const TEMPLATE_NODE_KEYS = new Set([
|
|
2
|
+
'attributes',
|
|
3
|
+
'children',
|
|
4
|
+
'class',
|
|
5
|
+
'classes',
|
|
6
|
+
'data',
|
|
7
|
+
'id',
|
|
8
|
+
'type'
|
|
9
|
+
]);
|
|
10
|
+
export function validateTemplateNode(value, path) {
|
|
11
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
12
|
+
throw new TypeError(`A-Frame ${path} must be an object.`);
|
|
13
|
+
}
|
|
14
|
+
const node = value;
|
|
15
|
+
for (const key of Object.keys(node)) {
|
|
16
|
+
if (!TEMPLATE_NODE_KEYS.has(key)) {
|
|
17
|
+
throw new TypeError(`A-Frame ${path}.${key} is not supported.`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
validateOptionalString(node['type'], `${path}.type`);
|
|
21
|
+
validateOptionalString(node['id'], `${path}.id`);
|
|
22
|
+
validateTemplateClass(node['class'], `${path}.class`);
|
|
23
|
+
validateOptionalStringArray(node['classes'], `${path}.classes`);
|
|
24
|
+
validateStringRecord(node['data'], `${path}.data`);
|
|
25
|
+
validateStringRecord(node['attributes'], `${path}.attributes`);
|
|
26
|
+
const children = node['children'];
|
|
27
|
+
if (children === undefined)
|
|
28
|
+
return;
|
|
29
|
+
if (!Array.isArray(children)) {
|
|
30
|
+
throw new TypeError(`A-Frame ${path}.children must be an array.`);
|
|
31
|
+
}
|
|
32
|
+
children.forEach((child, index) => {
|
|
33
|
+
validateTemplateNode(child, `${path}.children[${index}]`);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function validateTemplateClass(value, path) {
|
|
37
|
+
if (value === undefined || typeof value === 'string')
|
|
38
|
+
return;
|
|
39
|
+
if (Array.isArray(value) && value.every((item) => typeof item === 'string'))
|
|
40
|
+
return;
|
|
41
|
+
throw new TypeError(`A-Frame ${path} must be a string or string array.`);
|
|
42
|
+
}
|
|
43
|
+
function validateOptionalStringArray(value, path) {
|
|
44
|
+
if (value === undefined)
|
|
45
|
+
return;
|
|
46
|
+
if (Array.isArray(value) && value.every((item) => typeof item === 'string'))
|
|
47
|
+
return;
|
|
48
|
+
throw new TypeError(`A-Frame ${path} must be a string array.`);
|
|
49
|
+
}
|
|
50
|
+
function validateOptionalString(value, path) {
|
|
51
|
+
if (value === undefined || typeof value === 'string')
|
|
52
|
+
return;
|
|
53
|
+
throw new TypeError(`A-Frame ${path} must be a string.`);
|
|
54
|
+
}
|
|
55
|
+
function validateStringRecord(value, path) {
|
|
56
|
+
if (value === undefined)
|
|
57
|
+
return;
|
|
58
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
59
|
+
throw new TypeError(`A-Frame ${path} must be an object.`);
|
|
60
|
+
}
|
|
61
|
+
for (const [key, recordValue] of Object.entries(value)) {
|
|
62
|
+
if (key.trim().length === 0) {
|
|
63
|
+
throw new TypeError(`A-Frame ${path} keys must be non-empty strings.`);
|
|
64
|
+
}
|
|
65
|
+
if (recordValue === undefined) {
|
|
66
|
+
throw new TypeError(`A-Frame ${path}.${key} must not be undefined.`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubohiroya/turbowarp-aframe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "A TurboWarp extension for declarative A-Frame scene graphs.",
|
|
5
5
|
"author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -32,7 +32,10 @@
|
|
|
32
32
|
"README.md",
|
|
33
33
|
"README.ja.md",
|
|
34
34
|
"LICENSE",
|
|
35
|
-
"THIRD_PARTY_NOTICES.md"
|
|
35
|
+
"THIRD_PARTY_NOTICES.md",
|
|
36
|
+
"lib-editor/",
|
|
37
|
+
"schemas/",
|
|
38
|
+
"docs/fixed-input-editors.ja.md"
|
|
36
39
|
],
|
|
37
40
|
"publishConfig": {
|
|
38
41
|
"access": "public",
|
|
@@ -45,7 +48,7 @@
|
|
|
45
48
|
"scripts": {
|
|
46
49
|
"dev": "vite build --watch",
|
|
47
50
|
"typecheck": "tsc --noEmit",
|
|
48
|
-
"build": "vite build",
|
|
51
|
+
"build": "vite build && npm run build:editor",
|
|
49
52
|
"lint": "eslint src tests vite.config.ts",
|
|
50
53
|
"format": "eslint src tests vite.config.ts --fix",
|
|
51
54
|
"test": "vitest run",
|
|
@@ -54,11 +57,14 @@
|
|
|
54
57
|
"repo:check": "node scripts/check-repo.ts",
|
|
55
58
|
"pack:check": "npm pack --dry-run --ignore-scripts",
|
|
56
59
|
"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",
|
|
57
|
-
"check:dist": "pnpm run build && node scripts/check-dist.ts"
|
|
60
|
+
"check:dist": "pnpm run build && node scripts/check-dist.ts",
|
|
61
|
+
"build:editor": "tsc -p tsconfig.editor.json",
|
|
62
|
+
"prepare": "npm run build"
|
|
58
63
|
},
|
|
59
64
|
"devDependencies": {
|
|
60
65
|
"@eslint/js": "^9.39.5",
|
|
61
|
-
"@kubohiroya/
|
|
66
|
+
"@kubohiroya/turbowarp-extension-manifest": "0.3.2",
|
|
67
|
+
"@kubohiroya/vite-plugin-turbowarp-extension": "0.6.1",
|
|
62
68
|
"@pixiv/three-vrm": "3.5.5",
|
|
63
69
|
"@types/node": "^24.13.3",
|
|
64
70
|
"@types/three": "0.184.0",
|
|
@@ -67,6 +73,23 @@
|
|
|
67
73
|
"typescript": "^5.9.3",
|
|
68
74
|
"typescript-eslint": "^8.66.0",
|
|
69
75
|
"vite": "^8.2.2",
|
|
70
|
-
"vitest": "^4.1.10"
|
|
76
|
+
"vitest": "^4.1.10",
|
|
77
|
+
"react-dom": "18.3.1"
|
|
78
|
+
},
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@kubohiroya/turbowarp-extension-data-editor": "0.2.1"
|
|
81
|
+
},
|
|
82
|
+
"exports": {
|
|
83
|
+
"./*": "./*",
|
|
84
|
+
"./editor-schema": {
|
|
85
|
+
"types": "./lib-editor/src/editor-schema.d.ts",
|
|
86
|
+
"import": "./lib-editor/src/editor-schema.js"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"gitHead": "1b4afdb67ae4d5237ba8e115e4b80b5fc28efff0",
|
|
90
|
+
"x-turbowarp-source": {
|
|
91
|
+
"revision": "1b4afdb67ae4d5237ba8e115e4b80b5fc28efff0",
|
|
92
|
+
"revisionRole": "base-commit",
|
|
93
|
+
"sourceState": "local-release-overlay"
|
|
71
94
|
}
|
|
72
95
|
}
|