create-aura3d 1.3.2 → 1.3.3

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.
Files changed (110) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +9 -2
  4. package/dist/index.js.map +1 -1
  5. package/package.json +10 -2
  6. package/templates/animation-channel/package.json +1 -1
  7. package/templates/animation-channel/tests/screenshot.spec.ts +16 -0
  8. package/templates/animation-studio/dist/episodes/prompt-to-scene-proof/two-robots-fixing-a-car.document.json +680 -0
  9. package/templates/animation-studio/dist/episodes/scene/episode-3d.webm +0 -0
  10. package/templates/animation-studio/dist/episodes/scene/frames/action.png +0 -0
  11. package/templates/animation-studio/dist/episodes/scene/frames/dialogue.png +0 -0
  12. package/templates/animation-studio/dist/episodes/scene/frames/final.png +0 -0
  13. package/templates/animation-studio/dist/episodes/scene/frames/first.png +0 -0
  14. package/templates/animation-studio/dist/episodes/scene/frames/mouth-closed.png +0 -0
  15. package/templates/animation-studio/dist/episodes/scene/frames/mouth-open.png +0 -0
  16. package/templates/animation-studio/dist/episodes/scene/render-live-summary.json +4829 -682
  17. package/templates/animation-studio/dist/episodes/scene/skeleton-overlays/friend-1.png +0 -0
  18. package/templates/animation-studio/dist/episodes/scene/skeleton-overlays/friend-2.png +0 -0
  19. package/templates/animation-studio/dist/scene/working.document.json +95 -16
  20. package/templates/animation-studio/index.html +12 -0
  21. package/templates/animation-studio/node_modules.publish-aside/.vite/deps/_metadata.json +8 -0
  22. package/templates/animation-studio/node_modules.publish-aside/.vite/deps/package.json +3 -0
  23. package/templates/animation-studio/package.json +1 -1
  24. package/templates/animation-studio/scripts/asset-motion-probe.ts +7 -1
  25. package/templates/animation-studio/scripts/render-live.ts +24 -0
  26. package/templates/animation-studio/src/director/prompt-to-scene.ts +73 -5
  27. package/templates/animation-studio/studio/dist/assets/index-C7f8tHfi.css +1 -0
  28. package/templates/animation-studio/studio/dist/assets/index-CLo3GXyN.js +43 -0
  29. package/templates/animation-studio/studio/dist/index.html +2 -2
  30. package/templates/animation-studio/studio/src/App.tsx +146 -78
  31. package/templates/animation-studio/studio/src/components/Console.tsx +8 -2
  32. package/templates/animation-studio/studio/src/components/Inspector.tsx +57 -1
  33. package/templates/animation-studio/studio/src/components/Stage.tsx +10 -5
  34. package/templates/animation-studio/studio/src/components/Timeline.tsx +49 -2
  35. package/templates/animation-studio/studio/src/state/mapDocument.ts +13 -2
  36. package/templates/animation-studio/studio/src/state/sceneTool.ts +20 -9
  37. package/templates/animation-studio/studio/src/state/types.ts +8 -0
  38. package/templates/animation-studio/tests/route-health.spec.ts +33 -0
  39. package/templates/animation-studio/tests/screenshot.spec.ts +30 -0
  40. package/templates/character-controller/package.json +1 -1
  41. package/templates/character-controller/src/main.ts +18 -1
  42. package/templates/cinematic-scene/package.json +1 -1
  43. package/templates/cinematic-scene/tests/screenshot.spec.ts +3 -1
  44. package/templates/episode-builder/package.json +1 -1
  45. package/templates/episode-builder/tests/screenshot.spec.ts +15 -0
  46. package/templates/fighting-game/package.json +1 -1
  47. package/templates/fighting-game/tests/screenshot.spec.ts +15 -0
  48. package/templates/mini-game/package.json +1 -1
  49. package/templates/product-viewer/package.json +1 -1
  50. package/templates/product-viewer/tests/screenshot.spec.ts +3 -1
  51. package/templates/prompt-animation-channel/package.json +1 -1
  52. package/templates/prompt-animation-channel/tests/screenshot.spec.ts +15 -0
  53. package/templates/three-compat-architecture-interior/index.html +16 -0
  54. package/templates/three-compat-architecture-interior/package.json +21 -0
  55. package/templates/three-compat-architecture-interior/playwright.config.ts +14 -0
  56. package/templates/three-compat-architecture-interior/src/main.ts +27 -0
  57. package/templates/three-compat-architecture-interior/tests/route-health.spec.ts +16 -0
  58. package/templates/three-compat-architecture-interior/tests/screenshot.spec.ts +15 -0
  59. package/templates/three-compat-architecture-interior/tsconfig.json +19 -0
  60. package/templates/three-compat-asset-inspector/index.html +16 -0
  61. package/templates/three-compat-asset-inspector/package.json +21 -0
  62. package/templates/three-compat-asset-inspector/playwright.config.ts +14 -0
  63. package/templates/three-compat-asset-inspector/src/main.ts +17 -0
  64. package/templates/three-compat-asset-inspector/tests/route-health.spec.ts +16 -0
  65. package/templates/three-compat-asset-inspector/tests/screenshot.spec.ts +15 -0
  66. package/templates/three-compat-asset-inspector/tsconfig.json +19 -0
  67. package/templates/three-compat-character-viewer/index.html +16 -0
  68. package/templates/three-compat-character-viewer/package.json +21 -0
  69. package/templates/three-compat-character-viewer/playwright.config.ts +14 -0
  70. package/templates/three-compat-character-viewer/src/main.ts +17 -0
  71. package/templates/three-compat-character-viewer/tests/route-health.spec.ts +16 -0
  72. package/templates/three-compat-character-viewer/tests/screenshot.spec.ts +15 -0
  73. package/templates/three-compat-character-viewer/tsconfig.json +19 -0
  74. package/templates/three-compat-custom-threejs-migration/index.html +16 -0
  75. package/templates/three-compat-custom-threejs-migration/package.json +21 -0
  76. package/templates/three-compat-custom-threejs-migration/playwright.config.ts +14 -0
  77. package/templates/three-compat-custom-threejs-migration/src/main.ts +16 -0
  78. package/templates/three-compat-custom-threejs-migration/tests/route-health.spec.ts +16 -0
  79. package/templates/three-compat-custom-threejs-migration/tests/screenshot.spec.ts +15 -0
  80. package/templates/three-compat-custom-threejs-migration/tsconfig.json +19 -0
  81. package/templates/three-compat-large-scene/index.html +16 -0
  82. package/templates/three-compat-large-scene/package.json +21 -0
  83. package/templates/three-compat-large-scene/playwright.config.ts +14 -0
  84. package/templates/three-compat-large-scene/src/main.ts +31 -0
  85. package/templates/three-compat-large-scene/tests/route-health.spec.ts +16 -0
  86. package/templates/three-compat-large-scene/tests/screenshot.spec.ts +15 -0
  87. package/templates/three-compat-large-scene/tsconfig.json +19 -0
  88. package/templates/three-compat-material-authoring/index.html +16 -0
  89. package/templates/three-compat-material-authoring/package.json +21 -0
  90. package/templates/three-compat-material-authoring/playwright.config.ts +14 -0
  91. package/templates/three-compat-material-authoring/src/main.ts +33 -0
  92. package/templates/three-compat-material-authoring/tests/route-health.spec.ts +16 -0
  93. package/templates/three-compat-material-authoring/tests/screenshot.spec.ts +15 -0
  94. package/templates/three-compat-material-authoring/tsconfig.json +19 -0
  95. package/templates/three-compat-postprocess-scene/index.html +16 -0
  96. package/templates/three-compat-postprocess-scene/package.json +21 -0
  97. package/templates/three-compat-postprocess-scene/playwright.config.ts +14 -0
  98. package/templates/three-compat-postprocess-scene/src/main.ts +17 -0
  99. package/templates/three-compat-postprocess-scene/tests/route-health.spec.ts +16 -0
  100. package/templates/three-compat-postprocess-scene/tests/screenshot.spec.ts +15 -0
  101. package/templates/three-compat-postprocess-scene/tsconfig.json +19 -0
  102. package/templates/three-compat-premium-product-viewer/index.html +16 -0
  103. package/templates/three-compat-premium-product-viewer/package.json +21 -0
  104. package/templates/three-compat-premium-product-viewer/playwright.config.ts +14 -0
  105. package/templates/three-compat-premium-product-viewer/src/main.ts +18 -0
  106. package/templates/three-compat-premium-product-viewer/tests/route-health.spec.ts +16 -0
  107. package/templates/three-compat-premium-product-viewer/tests/screenshot.spec.ts +15 -0
  108. package/templates/three-compat-premium-product-viewer/tsconfig.json +19 -0
  109. package/templates/animation-studio/studio/dist/assets/index-i8URxOOt.css +0 -1
  110. package/templates/animation-studio/studio/dist/assets/index-pC9hdZ-B.js +0 -11
@@ -0,0 +1,15 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { expect, test } from "@playwright/test";
4
+
5
+ test.setTimeout(60_000);
6
+
7
+ test("Aura3D three-compat template screenshot shows content", async ({ page }) => {
8
+ await page.goto("/");
9
+ await expect.poll(() => page.locator("body").getAttribute("data-aura3d-ready"), { timeout: 45_000 }).toBe("true");
10
+ const screenshot = await page.screenshot({ fullPage: false });
11
+ mkdirSync(resolve("tests/reports"), { recursive: true });
12
+ writeFileSync(resolve("tests/reports/screenshot.png"), screenshot);
13
+ writeFileSync(resolve("tests/reports/screenshot.json"), `${JSON.stringify({ bytes: screenshot.byteLength }, null, 2)}\n`);
14
+ expect(screenshot.byteLength).toBeGreaterThan(1000);
15
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "allowJs": false,
8
+ "skipLibCheck": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "strict": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "moduleResolution": "Bundler",
14
+ "resolveJsonModule": true,
15
+ "isolatedModules": true,
16
+ "noEmit": true
17
+ },
18
+ "include": ["src", "tests"]
19
+ }
@@ -0,0 +1,16 @@
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.0">
6
+ <title>Aura3D Three-Compat Custom Three.js Migration</title>
7
+ <style>
8
+ html, body, #app { margin: 0; width: 100%; height: 100%; background: #080d15; }
9
+ body { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <div id="app"></div>
14
+ <script type="module" src="/src/main.ts"></script>
15
+ </body>
16
+ </html>
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "aura3d-three-compat-custom-threejs-migration",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite --host 127.0.0.1",
8
+ "typecheck": "tsc --noEmit",
9
+ "build": "npm run typecheck && vite build",
10
+ "preview": "vite preview --host 127.0.0.1",
11
+ "test": "playwright test tests/route-health.spec.ts tests/screenshot.spec.ts --workers=1"
12
+ },
13
+ "dependencies": {
14
+ "@aura3d/engine": "1.3.3"
15
+ },
16
+ "devDependencies": {
17
+ "@playwright/test": "^1.52.0",
18
+ "typescript": "^5.8.3",
19
+ "vite": "^7.3.2"
20
+ }
21
+ }
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from "@playwright/test";
2
+
3
+ export default defineConfig({
4
+ testDir: "./tests",
5
+ use: {
6
+ baseURL: "http://127.0.0.1:4194"
7
+ },
8
+ webServer: {
9
+ command: "npm exec vite -- --host 127.0.0.1 --port 4194 --strictPort",
10
+ url: "http://127.0.0.1:4194",
11
+ reuseExistingServer: !process.env.CI,
12
+ timeout: 120_000
13
+ }
14
+ });
@@ -0,0 +1,16 @@
1
+ // Three-compat migration example: the classic hand-rolled three.js starter
2
+ // (ground plane + a few lit primitives) rebuilt with the public
3
+ // @aura3d/engine API — no manual renderer, scene graph, or render loop.
4
+ import { camera, createAuraApp, lights, material, primitives, scene } from "@aura3d/engine";
5
+
6
+ createAuraApp("#app", {
7
+ scene: scene()
8
+ .background("#101521")
9
+ .camera(camera.orbit({ target: [0, 0.7, 0], distance: 6 }))
10
+ .add(primitives.plane({ name: "ground", size: [10, 1, 10], material: material.pbr({ color: "#1b2334", roughness: 0.9 }), receiveShadow: true }))
11
+ .add(primitives.box({ name: "migrated box mesh", size: 1, position: [-1.6, 0.5, 0], rotation: [0, 0.6, 0], material: material.pbr({ color: "#e2674a", roughness: 0.5 }), castShadow: true }))
12
+ .add(primitives.sphere({ name: "migrated sphere mesh", size: 1.1, position: [0.2, 0.55, -0.4], material: material.metal({ color: "#bcd0e6", roughness: 0.18 }), castShadow: true }))
13
+ .add(primitives.torus({ name: "migrated torus mesh", size: 0.9, position: [1.9, 0.75, 0.6], rotation: [0.9, 0, 0.4], material: material.pbr({ color: "#5dbb8d", roughness: 0.4 }), castShadow: true }))
14
+ .add(lights.ambient({ intensity: 0.3 }))
15
+ .add(lights.directional({ name: "sun", position: [4, 6, 3], intensity: 1.5 }))
16
+ });
@@ -0,0 +1,16 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { expect, test } from "@playwright/test";
4
+
5
+ test.setTimeout(60_000);
6
+
7
+ test("Aura3D three-compat template reaches ready state", async ({ page }) => {
8
+ await page.goto("/");
9
+ await expect.poll(() => page.locator("body").getAttribute("data-aura3d-ready"), { timeout: 45_000 }).toBe("true");
10
+ const drawCalls = Number(await page.locator("body").getAttribute("data-aura3d-draw-calls"));
11
+ const diagnostics = await page.evaluate(() => (window as unknown as { __AURA3D_ROUTE_READY__?: { diagnostics?: { backend?: string } } }).__AURA3D_ROUTE_READY__?.diagnostics);
12
+ expect(diagnostics?.backend).toBe("webgl2");
13
+ expect(drawCalls).toBeGreaterThan(0);
14
+ mkdirSync(resolve("tests/reports"), { recursive: true });
15
+ writeFileSync(resolve("tests/reports/route-health.json"), `${JSON.stringify({ ready: true, backend: diagnostics?.backend, drawCalls }, null, 2)}\n`);
16
+ });
@@ -0,0 +1,15 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { expect, test } from "@playwright/test";
4
+
5
+ test.setTimeout(60_000);
6
+
7
+ test("Aura3D three-compat template screenshot shows content", async ({ page }) => {
8
+ await page.goto("/");
9
+ await expect.poll(() => page.locator("body").getAttribute("data-aura3d-ready"), { timeout: 45_000 }).toBe("true");
10
+ const screenshot = await page.screenshot({ fullPage: false });
11
+ mkdirSync(resolve("tests/reports"), { recursive: true });
12
+ writeFileSync(resolve("tests/reports/screenshot.png"), screenshot);
13
+ writeFileSync(resolve("tests/reports/screenshot.json"), `${JSON.stringify({ bytes: screenshot.byteLength }, null, 2)}\n`);
14
+ expect(screenshot.byteLength).toBeGreaterThan(1000);
15
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "allowJs": false,
8
+ "skipLibCheck": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "strict": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "moduleResolution": "Bundler",
14
+ "resolveJsonModule": true,
15
+ "isolatedModules": true,
16
+ "noEmit": true
17
+ },
18
+ "include": ["src", "tests"]
19
+ }
@@ -0,0 +1,16 @@
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.0">
6
+ <title>Aura3D Three-Compat Large Scene</title>
7
+ <style>
8
+ html, body, #app { margin: 0; width: 100%; height: 100%; background: #080d15; }
9
+ body { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <div id="app"></div>
14
+ <script type="module" src="/src/main.ts"></script>
15
+ </body>
16
+ </html>
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "aura3d-three-compat-large-scene",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite --host 127.0.0.1",
8
+ "typecheck": "tsc --noEmit",
9
+ "build": "npm run typecheck && vite build",
10
+ "preview": "vite preview --host 127.0.0.1",
11
+ "test": "playwright test tests/route-health.spec.ts tests/screenshot.spec.ts --workers=1"
12
+ },
13
+ "dependencies": {
14
+ "@aura3d/engine": "1.3.3"
15
+ },
16
+ "devDependencies": {
17
+ "@playwright/test": "^1.52.0",
18
+ "typescript": "^5.8.3",
19
+ "vite": "^7.3.2"
20
+ }
21
+ }
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from "@playwright/test";
2
+
3
+ export default defineConfig({
4
+ testDir: "./tests",
5
+ use: {
6
+ baseURL: "http://127.0.0.1:4195"
7
+ },
8
+ webServer: {
9
+ command: "npm exec vite -- --host 127.0.0.1 --port 4195 --strictPort",
10
+ url: "http://127.0.0.1:4195",
11
+ reuseExistingServer: !process.env.CI,
12
+ timeout: 120_000
13
+ }
14
+ });
@@ -0,0 +1,31 @@
1
+ // Three-compat large scene: a deterministic grid of many boxes (a city-block
2
+ // style stress layout) authored through the public @aura3d/engine API.
3
+ import { camera, createAuraApp, lights, material, primitives, scene } from "@aura3d/engine";
4
+
5
+ const palette = ["#39465e", "#46587a", "#54688f", "#62799f", "#4d5a74"] as const;
6
+ const grid = scene()
7
+ .background("#0a0e15")
8
+ .camera(camera.orbit({ target: [0, 1, 0], distance: 16 }))
9
+ .add(primitives.box({ name: "large scene ground", size: [22, 0.1, 22], position: [0, -0.05, 0], material: material.pbr({ color: "#141b28", roughness: 0.95 }), receiveShadow: true }));
10
+
11
+ const span = 9; // 9 x 9 = 81 boxes
12
+ for (let row = 0; row < span; row += 1) {
13
+ for (let col = 0; col < span; col += 1) {
14
+ const index = row * span + col;
15
+ const height = 0.5 + ((index * 37) % 23) / 23 * 2.6;
16
+ grid.add(primitives.box({
17
+ name: `block r${row} c${col}`,
18
+ size: [1.1, height, 1.1],
19
+ position: [(col - (span - 1) / 2) * 2.2, height / 2, (row - (span - 1) / 2) * 2.2],
20
+ material: material.pbr({ color: palette[index % palette.length], roughness: 0.62 }),
21
+ castShadow: true,
22
+ receiveShadow: true
23
+ }));
24
+ }
25
+ }
26
+
27
+ grid
28
+ .add(lights.ambient({ intensity: 0.3 }))
29
+ .add(lights.directional({ name: "low sun", position: [8, 10, 6], intensity: 1.4, color: "#ffe7c8" }));
30
+
31
+ createAuraApp("#app", { scene: grid });
@@ -0,0 +1,16 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { expect, test } from "@playwright/test";
4
+
5
+ test.setTimeout(60_000);
6
+
7
+ test("Aura3D three-compat template reaches ready state", async ({ page }) => {
8
+ await page.goto("/");
9
+ await expect.poll(() => page.locator("body").getAttribute("data-aura3d-ready"), { timeout: 45_000 }).toBe("true");
10
+ const drawCalls = Number(await page.locator("body").getAttribute("data-aura3d-draw-calls"));
11
+ const diagnostics = await page.evaluate(() => (window as unknown as { __AURA3D_ROUTE_READY__?: { diagnostics?: { backend?: string } } }).__AURA3D_ROUTE_READY__?.diagnostics);
12
+ expect(diagnostics?.backend).toBe("webgl2");
13
+ expect(drawCalls).toBeGreaterThan(0);
14
+ mkdirSync(resolve("tests/reports"), { recursive: true });
15
+ writeFileSync(resolve("tests/reports/route-health.json"), `${JSON.stringify({ ready: true, backend: diagnostics?.backend, drawCalls }, null, 2)}\n`);
16
+ });
@@ -0,0 +1,15 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { expect, test } from "@playwright/test";
4
+
5
+ test.setTimeout(60_000);
6
+
7
+ test("Aura3D three-compat template screenshot shows content", async ({ page }) => {
8
+ await page.goto("/");
9
+ await expect.poll(() => page.locator("body").getAttribute("data-aura3d-ready"), { timeout: 45_000 }).toBe("true");
10
+ const screenshot = await page.screenshot({ fullPage: false });
11
+ mkdirSync(resolve("tests/reports"), { recursive: true });
12
+ writeFileSync(resolve("tests/reports/screenshot.png"), screenshot);
13
+ writeFileSync(resolve("tests/reports/screenshot.json"), `${JSON.stringify({ bytes: screenshot.byteLength }, null, 2)}\n`);
14
+ expect(screenshot.byteLength).toBeGreaterThan(1000);
15
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "allowJs": false,
8
+ "skipLibCheck": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "strict": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "moduleResolution": "Bundler",
14
+ "resolveJsonModule": true,
15
+ "isolatedModules": true,
16
+ "noEmit": true
17
+ },
18
+ "include": ["src", "tests"]
19
+ }
@@ -0,0 +1,16 @@
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.0">
6
+ <title>Aura3D Three-Compat Material Authoring</title>
7
+ <style>
8
+ html, body, #app { margin: 0; width: 100%; height: 100%; background: #080d15; }
9
+ body { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <div id="app"></div>
14
+ <script type="module" src="/src/main.ts"></script>
15
+ </body>
16
+ </html>
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "aura3d-three-compat-material-authoring",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite --host 127.0.0.1",
8
+ "typecheck": "tsc --noEmit",
9
+ "build": "npm run typecheck && vite build",
10
+ "preview": "vite preview --host 127.0.0.1",
11
+ "test": "playwright test tests/route-health.spec.ts tests/screenshot.spec.ts --workers=1"
12
+ },
13
+ "dependencies": {
14
+ "@aura3d/engine": "1.3.3"
15
+ },
16
+ "devDependencies": {
17
+ "@playwright/test": "^1.52.0",
18
+ "typescript": "^5.8.3",
19
+ "vite": "^7.3.2"
20
+ }
21
+ }
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from "@playwright/test";
2
+
3
+ export default defineConfig({
4
+ testDir: "./tests",
5
+ use: {
6
+ baseURL: "http://127.0.0.1:4196"
7
+ },
8
+ webServer: {
9
+ command: "npm exec vite -- --host 127.0.0.1 --port 4196 --strictPort",
10
+ url: "http://127.0.0.1:4196",
11
+ reuseExistingServer: !process.env.CI,
12
+ timeout: 120_000
13
+ }
14
+ });
@@ -0,0 +1,33 @@
1
+ // Three-compat material authoring: a row of spheres showcasing the public
2
+ // @aura3d/engine material presets (pbr, metal, rubber, glass, emissive).
3
+ import { camera, createAuraApp, lights, material, primitives, scene } from "@aura3d/engine";
4
+
5
+ const swatches = [
6
+ { name: "pbr swatch", material: material.pbr({ color: "#c66f53", roughness: 0.55 }) },
7
+ { name: "metal swatch", material: material.metal({ color: "#d7e1ec", roughness: 0.12 }) },
8
+ { name: "rubber swatch", material: material.rubber({ color: "#22262e" }) },
9
+ { name: "glass swatch", material: material.glass({ color: "#bfe6ff" }) },
10
+ { name: "emissive swatch", material: material.emissive({ color: "#13202c", emissive: "#38d6ff", emissiveIntensity: 1.2 }) }
11
+ ] as const;
12
+
13
+ const lab = scene()
14
+ .background("#0c1018")
15
+ .camera(camera.orbit({ target: [0, 0.7, 0], distance: 6.4 }))
16
+ .add(primitives.box({ name: "swatch bench", size: [7, 0.12, 2.4], position: [0, -0.06, 0], material: material.pbr({ color: "#1c2433", roughness: 0.88 }), receiveShadow: true }));
17
+
18
+ swatches.forEach((swatch, index) => {
19
+ lab.add(primitives.sphere({
20
+ name: swatch.name,
21
+ size: 0.9,
22
+ position: [(index - (swatches.length - 1) / 2) * 1.35, 0.65, 0],
23
+ material: swatch.material,
24
+ castShadow: true
25
+ }));
26
+ });
27
+
28
+ lab
29
+ .add(lights.ambient({ intensity: 0.3 }))
30
+ .add(lights.directional({ name: "key", position: [3, 4.5, 3.5], intensity: 1.5 }))
31
+ .add(lights.point({ name: "cool rim", position: [-3, 2.4, -2.4], intensity: 1.3, color: "#9fc4ff" }));
32
+
33
+ createAuraApp("#app", { scene: lab });
@@ -0,0 +1,16 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { expect, test } from "@playwright/test";
4
+
5
+ test.setTimeout(60_000);
6
+
7
+ test("Aura3D three-compat template reaches ready state", async ({ page }) => {
8
+ await page.goto("/");
9
+ await expect.poll(() => page.locator("body").getAttribute("data-aura3d-ready"), { timeout: 45_000 }).toBe("true");
10
+ const drawCalls = Number(await page.locator("body").getAttribute("data-aura3d-draw-calls"));
11
+ const diagnostics = await page.evaluate(() => (window as unknown as { __AURA3D_ROUTE_READY__?: { diagnostics?: { backend?: string } } }).__AURA3D_ROUTE_READY__?.diagnostics);
12
+ expect(diagnostics?.backend).toBe("webgl2");
13
+ expect(drawCalls).toBeGreaterThan(0);
14
+ mkdirSync(resolve("tests/reports"), { recursive: true });
15
+ writeFileSync(resolve("tests/reports/route-health.json"), `${JSON.stringify({ ready: true, backend: diagnostics?.backend, drawCalls }, null, 2)}\n`);
16
+ });
@@ -0,0 +1,15 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { expect, test } from "@playwright/test";
4
+
5
+ test.setTimeout(60_000);
6
+
7
+ test("Aura3D three-compat template screenshot shows content", async ({ page }) => {
8
+ await page.goto("/");
9
+ await expect.poll(() => page.locator("body").getAttribute("data-aura3d-ready"), { timeout: 45_000 }).toBe("true");
10
+ const screenshot = await page.screenshot({ fullPage: false });
11
+ mkdirSync(resolve("tests/reports"), { recursive: true });
12
+ writeFileSync(resolve("tests/reports/screenshot.png"), screenshot);
13
+ writeFileSync(resolve("tests/reports/screenshot.json"), `${JSON.stringify({ bytes: screenshot.byteLength }, null, 2)}\n`);
14
+ expect(screenshot.byteLength).toBeGreaterThan(1000);
15
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "allowJs": false,
8
+ "skipLibCheck": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "strict": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "moduleResolution": "Bundler",
14
+ "resolveJsonModule": true,
15
+ "isolatedModules": true,
16
+ "noEmit": true
17
+ },
18
+ "include": ["src", "tests"]
19
+ }
@@ -0,0 +1,16 @@
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.0">
6
+ <title>Aura3D Three-Compat Postprocess Scene</title>
7
+ <style>
8
+ html, body, #app { margin: 0; width: 100%; height: 100%; background: #080d15; }
9
+ body { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <div id="app"></div>
14
+ <script type="module" src="/src/main.ts"></script>
15
+ </body>
16
+ </html>
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "aura3d-three-compat-postprocess-scene",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite --host 127.0.0.1",
8
+ "typecheck": "tsc --noEmit",
9
+ "build": "npm run typecheck && vite build",
10
+ "preview": "vite preview --host 127.0.0.1",
11
+ "test": "playwright test tests/route-health.spec.ts tests/screenshot.spec.ts --workers=1"
12
+ },
13
+ "dependencies": {
14
+ "@aura3d/engine": "1.3.3"
15
+ },
16
+ "devDependencies": {
17
+ "@playwright/test": "^1.52.0",
18
+ "typescript": "^5.8.3",
19
+ "vite": "^7.3.2"
20
+ }
21
+ }
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from "@playwright/test";
2
+
3
+ export default defineConfig({
4
+ testDir: "./tests",
5
+ use: {
6
+ baseURL: "http://127.0.0.1:4197"
7
+ },
8
+ webServer: {
9
+ command: "npm exec vite -- --host 127.0.0.1 --port 4197 --strictPort",
10
+ url: "http://127.0.0.1:4197",
11
+ reuseExistingServer: !process.env.CI,
12
+ timeout: 120_000
13
+ }
14
+ });
@@ -0,0 +1,17 @@
1
+ // Three-compat postprocess scene: emissive primitives pushed through the
2
+ // engine's bloom post pass, authored via the public @aura3d/engine API.
3
+ import { camera, createAuraApp, effects, lights, material, primitives, scene } from "@aura3d/engine";
4
+
5
+ createAuraApp("#app", {
6
+ scene: scene()
7
+ .background("#070a11")
8
+ .camera(camera.orbit({ target: [0, 0.9, 0], distance: 6 }))
9
+ .add(primitives.box({ name: "dark deck", size: [8, 0.1, 8], position: [0, -0.05, 0], material: material.pbr({ color: "#101723", roughness: 0.92 }), receiveShadow: true }))
10
+ .add(primitives.sphere({ name: "bloom core", size: 1.1, position: [0, 1, 0], material: material.emissive({ color: "#1a2330", emissive: "#7dfcff", emissiveIntensity: 1.6 }), castShadow: true }))
11
+ .add(primitives.torus({ name: "neon ring", size: 1.5, position: [0, 1, 0], rotation: [1.1, 0, 0.2], material: material.emissive({ color: "#171120", emissive: "#ff42c8", emissiveIntensity: 1.3 }), castShadow: true }))
12
+ .add(primitives.box({ name: "amber pylon", size: [0.4, 1.6, 0.4], position: [-2.4, 0.8, -1.2], material: material.emissive({ color: "#221a10", emissive: "#ffb347", emissiveIntensity: 1.1 }), castShadow: true }))
13
+ .add(primitives.box({ name: "cyan pylon", size: [0.4, 1.1, 0.4], position: [2.3, 0.55, 1], material: material.emissive({ color: "#101d22", emissive: "#38d6ff", emissiveIntensity: 1.1 }), castShadow: true }))
14
+ .add(effects.bloom({ intensity: 0.55, threshold: 0.62, radius: 0.42 }))
15
+ .add(lights.ambient({ intensity: 0.26 }))
16
+ .add(lights.directional({ name: "soft key", position: [3, 5, 3], intensity: 0.9 }))
17
+ });
@@ -0,0 +1,16 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { expect, test } from "@playwright/test";
4
+
5
+ test.setTimeout(60_000);
6
+
7
+ test("Aura3D three-compat template reaches ready state", async ({ page }) => {
8
+ await page.goto("/");
9
+ await expect.poll(() => page.locator("body").getAttribute("data-aura3d-ready"), { timeout: 45_000 }).toBe("true");
10
+ const drawCalls = Number(await page.locator("body").getAttribute("data-aura3d-draw-calls"));
11
+ const diagnostics = await page.evaluate(() => (window as unknown as { __AURA3D_ROUTE_READY__?: { diagnostics?: { backend?: string } } }).__AURA3D_ROUTE_READY__?.diagnostics);
12
+ expect(diagnostics?.backend).toBe("webgl2");
13
+ expect(drawCalls).toBeGreaterThan(0);
14
+ mkdirSync(resolve("tests/reports"), { recursive: true });
15
+ writeFileSync(resolve("tests/reports/route-health.json"), `${JSON.stringify({ ready: true, backend: diagnostics?.backend, drawCalls }, null, 2)}\n`);
16
+ });
@@ -0,0 +1,15 @@
1
+ import { mkdirSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { expect, test } from "@playwright/test";
4
+
5
+ test.setTimeout(60_000);
6
+
7
+ test("Aura3D three-compat template screenshot shows content", async ({ page }) => {
8
+ await page.goto("/");
9
+ await expect.poll(() => page.locator("body").getAttribute("data-aura3d-ready"), { timeout: 45_000 }).toBe("true");
10
+ const screenshot = await page.screenshot({ fullPage: false });
11
+ mkdirSync(resolve("tests/reports"), { recursive: true });
12
+ writeFileSync(resolve("tests/reports/screenshot.png"), screenshot);
13
+ writeFileSync(resolve("tests/reports/screenshot.json"), `${JSON.stringify({ bytes: screenshot.byteLength }, null, 2)}\n`);
14
+ expect(screenshot.byteLength).toBeGreaterThan(1000);
15
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "allowJs": false,
8
+ "skipLibCheck": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "strict": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "moduleResolution": "Bundler",
14
+ "resolveJsonModule": true,
15
+ "isolatedModules": true,
16
+ "noEmit": true
17
+ },
18
+ "include": ["src", "tests"]
19
+ }
@@ -0,0 +1,16 @@
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.0">
6
+ <title>Aura3D Three-Compat Premium Product Viewer</title>
7
+ <style>
8
+ html, body, #app { margin: 0; width: 100%; height: 100%; background: #080d15; }
9
+ body { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <div id="app"></div>
14
+ <script type="module" src="/src/main.ts"></script>
15
+ </body>
16
+ </html>
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "aura3d-three-compat-premium-product-viewer",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite --host 127.0.0.1",
8
+ "typecheck": "tsc --noEmit",
9
+ "build": "npm run typecheck && vite build",
10
+ "preview": "vite preview --host 127.0.0.1",
11
+ "test": "playwright test tests/route-health.spec.ts tests/screenshot.spec.ts --workers=1"
12
+ },
13
+ "dependencies": {
14
+ "@aura3d/engine": "1.3.3"
15
+ },
16
+ "devDependencies": {
17
+ "@playwright/test": "^1.52.0",
18
+ "typescript": "^5.8.3",
19
+ "vite": "^7.3.2"
20
+ }
21
+ }
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from "@playwright/test";
2
+
3
+ export default defineConfig({
4
+ testDir: "./tests",
5
+ use: {
6
+ baseURL: "http://127.0.0.1:4198"
7
+ },
8
+ webServer: {
9
+ command: "npm exec vite -- --host 127.0.0.1 --port 4198 --strictPort",
10
+ url: "http://127.0.0.1:4198",
11
+ reuseExistingServer: !process.env.CI,
12
+ timeout: 120_000
13
+ }
14
+ });