- add the v1 AvatarDefinition schema, bounded parser, strict validation, semantic catalog, pure geometry, scene generation, and deterministic playback to @bible-strong/avatar-core - add the React 19 renderer with semantic controls, SSR-safe embedded/floating layouts, direct frame updates, pointer and keyboard movement, constraints, callbacks, and accessible controls - add real tarball packaging and a clean React/Vite consumer using the exported Strobi definition - add Studio semantic-key authoring, runtime readiness, JSON download/copy, bundled-key recovery, concise errors, targeted local-project clearing, npm guidance, syntax highlighting, and a runnable package preview - preserve the historical ZIP and Studio project exports, regenerate the standalone engine, and synchronize English, French, and Simplified Chinese copy - add focused contract, playback, renderer, interaction, persistence, export, and localization coverage - archive the completed runtime and semantic-curation specs, retain the Vite performance draft, and record the engineering session in TIMELOG.md Validation: - pnpm check: 19 test files, 162 tests, typecheck, engine freshness, package builds, and Studio production build passed - npm pack dry runs: 30 core files and 10 React files - package smoke: real tarballs installed, typechecked, and built outside the workspace - browser checks: semantic playback, embedded/floating render, drag, mobile overflow, runtime export recovery, formatted copy, syntax colors, and live package preview Publication remains disabled: both packages stay private and AGPL-3.0-only pending licensing and repository metadata approval. Vue and Angular adapters remain deferred.
39 lines
1.3 KiB
JavaScript
39 lines
1.3 KiB
JavaScript
import { readFile, writeFile } from 'node:fs/promises'
|
|
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
import { build } from 'vite'
|
|
|
|
const root = path.dirname(path.dirname(fileURLToPath(import.meta.url)))
|
|
const result = await build({
|
|
configFile: false,
|
|
logLevel: 'silent',
|
|
resolve: {
|
|
alias: {
|
|
'@bible-strong/avatar-core': path.join(root, 'packages/avatar-core/src/index.ts'),
|
|
},
|
|
},
|
|
build: {
|
|
write: false,
|
|
minify: true,
|
|
lib: {
|
|
entry: path.join(root, 'src/features/export/standaloneEngine.entry.ts'),
|
|
formats: ['iife'],
|
|
name: 'AvatarProceduralEngine',
|
|
},
|
|
},
|
|
})
|
|
const outputs = Array.isArray(result) ? result.flatMap(item => item.output) : result.output
|
|
const chunk = outputs.find(item => item.type === 'chunk')
|
|
if (!chunk) throw new Error('Standalone avatar engine bundle was not generated.')
|
|
|
|
const outputPath = path.join(root, 'src/features/export/standaloneEngine.generated.ts')
|
|
const source = `// Generated by scripts/generate-standalone-engine.mjs. Do not edit.\nexport const standaloneEngineSource = ${JSON.stringify(chunk.code)}\n`
|
|
|
|
if (process.argv.includes('--check')) {
|
|
const current = await readFile(outputPath, 'utf8').catch(() => '')
|
|
if (current !== source) throw new Error('Standalone avatar engine is stale. Run pnpm engine.')
|
|
} else {
|
|
await writeFile(outputPath, source)
|
|
}
|