@replayablejs/build 0.1.0-alpha.0 → 0.1.0-alpha.2
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/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -226,7 +226,10 @@ function createDevelopmentViteConfig(options) {
|
|
|
226
226
|
assets,
|
|
227
227
|
application
|
|
228
228
|
].reduce((current, entry) => mergeConfig(current, entry.viteConfig), {});
|
|
229
|
-
return mergeConfig(createBaseViteConfig(options.projectRoot), mergeConfig(entryConfig, {
|
|
229
|
+
return mergeConfig(createBaseViteConfig(options.projectRoot), mergeConfig(entryConfig, {
|
|
230
|
+
plugins: [...options.plugins ?? []],
|
|
231
|
+
optimizeDeps: { rolldownOptions: { resolve: { alias: Array.isArray(entryConfig.resolve?.alias) ? Object.fromEntries(entryConfig.resolve.alias.flatMap(({ find, replacement }) => typeof find === "string" ? [[find, replacement]] : [])) : entryConfig.resolve?.alias } } }
|
|
232
|
+
}));
|
|
230
233
|
}
|
|
231
234
|
//#endregion
|
|
232
235
|
//#region src/runtime/resolve-build-runtime-module.ts
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["runtimeDirectory","playableShellStyles","loadingIndicatorStyles"],"sources":["../src/networks/google.ts","../src/networks/unity.ts","../src/networks/network-profiles.ts","../src/runtime/resolve-assets-module.ts","../src/vite/create-playable-vite-context.ts","../src/pipeline/create-development-context.ts","../src/vite/create-base-vite-config.ts","../src/vite/create-development-vite-config.ts","../src/runtime/resolve-build-runtime-module.ts","../src/runtime/resolve-build-runtime-entry.ts","../src/runtime/resolve-devtools.ts","../src/runtime/resolve-runtime-audio.ts","../src/vite/resolve-physical-id.ts","../src/vite/plugins/generated-assets-boundary.ts","../src/vite/create-application-vite-config.ts","../src/vite/plugins/generated-assets.ts","../src/vite/create-assets-vite-config.ts","../src/runtime/create-runtime-define.ts","../src/vite/create-config-vite-config.ts","../src/runtime/resolve-runtime-adapter.ts","../src/vite/create-host-vite-config.ts","../src/vite/create-playable-entries.ts","../src/development/plugins/development-reporter.ts","../src/html/playable-html.ts","../src/html/loading-indicator.scss?inline","../src/html/playable-shell.scss?inline","../src/html/playable-shell.ts","../src/html/render-playable-html.ts","../src/development/plugins/playable-html.ts","../src/development/create-development-server.ts","../src/development/select-development-variant.ts","../src/development/serve-preview.ts","../src/pipeline/resolve-output-directory.ts","../src/html/emit-playable-html.ts","../src/pipeline/create-build-context.ts","../src/browser-targets.ts","../src/production/create-bundle-output.ts","../src/production/validate-application-module-graph.ts","../src/production/bundle-variant.ts","../src/production/build-variant.ts","../src/production/build-project.ts"],"sourcesContent":["import type { PlayableVariant } from '@replayablejs/config';\n\nimport type { NetworkHtmlHead } from '#types/network.js';\n\nconst EXIT_API_URL = 'https://tpc.googlesyndication.com/pagead/gadgets/html5/api/exitapi.js';\n\n/** Resolves the production document elements required by Google App Campaigns. */\nexport function resolveGoogleHtmlHead(variant: PlayableVariant): NetworkHtmlHead {\n return {\n metaTags: [\n {\n name: 'ad.orientation',\n content: resolveOrientation(variant.screen.orientations),\n },\n ],\n scripts: [{ src: EXIT_API_URL }],\n };\n}\n\n/** Converts Replayable's enabled layouts into Google's orientation-tag value. */\nfunction resolveOrientation(orientations: PlayableVariant['screen']['orientations']): string {\n const { landscape, portrait } = orientations;\n\n if (landscape.enabled && portrait.enabled) {\n return 'portrait,landscape';\n }\n\n return portrait.enabled ? 'portrait' : 'landscape';\n}\n","import type { NetworkHtmlHead } from '#types/network.js';\n\nconst unityHtmlHead: NetworkHtmlHead = {\n metaTags: [],\n scripts: [{ src: 'mraid.js' }],\n};\n\n/** Adds Unity's required MRAID SDK bootstrap before authored runtime code. */\nexport function resolveUnityHtmlHead(): NetworkHtmlHead {\n return unityHtmlHead;\n}\n","import type { PlayableVariant, ReplayableNetwork } from '@replayablejs/config';\n\nimport type { NetworkHtmlHead, NetworkProfile, PlayableProfile } from '#types/network.js';\n\nimport { resolveGoogleHtmlHead } from './google.js';\nimport { resolveUnityHtmlHead } from './unity.js';\n\nconst fullScreenEndCard = { animation: 'continuous', interaction: 'full-screen' } as const;\nconst ctaOnlyEndCard = { animation: 'finite', interaction: 'cta-only' } as const;\nconst previewControls = { persistentCta: true } as const;\nconst hiddenControls = { persistentCta: false } as const;\nconst liftoffControls = { persistentCta: true } as const;\nconst noCompileTimeDefinitions: Readonly<Record<string, string>> = {};\n\nconst emptyHtmlHead: NetworkHtmlHead = {\n metaTags: [],\n scripts: [],\n};\n\nconst networkProfiles = {\n preview: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: previewControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'browser',\n },\n applovin: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'interaction',\n controls: hiddenControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'applovin',\n },\n meta: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: hiddenControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'meta',\n },\n google: {\n assetMode: 'resource',\n applicationMode: 'module-graph',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: hiddenControls,\n endCard: ctaOnlyEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveGoogleHtmlHead,\n runtime: 'google',\n },\n liftoff: {\n assetMode: 'resource',\n applicationMode: 'module-graph',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: liftoffControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'liftoff',\n },\n mintegral: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: hiddenControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'host',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'mintegral',\n },\n moloco: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: {\n // Moloco forbids this global. Howler only needs it for URL sources, while\n // Moloco's inline asset mode always supplies audio as a data URI.\n XMLHttpRequest: 'undefined',\n },\n completionDurationStart: 'ready',\n controls: hiddenControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'moloco',\n },\n unity: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: hiddenControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveUnityHtmlHead,\n runtime: 'unity',\n },\n} satisfies Record<ReplayableNetwork, NetworkProfile>;\n\n/** Resolves the asset, document, and runtime policy owned by one variant's network. */\nexport function resolvePlayableProfile(variant: PlayableVariant): PlayableProfile {\n const profile = networkProfiles[variant.network];\n\n return {\n assetMode: profile.assetMode,\n applicationMode: profile.applicationMode,\n compileTimeDefinitions: profile.compileTimeDefinitions,\n completionDurationStart: profile.completionDurationStart,\n // Development always selects preview. Real ad networks replace authored\n // preferences completely, rather than treating them as optional overrides.\n controls: variant.network === 'preview' ? variant.controls : profile.controls,\n endCard: profile.endCard,\n htmlHead: profile.resolveHtmlHead(variant),\n loadingIndicator: profile.loadingIndicator,\n runtime: profile.runtime,\n };\n}\n\n/** Returns no document additions for networks without production head requirements. */\nfunction resolveEmptyHtmlHead(_variant: PlayableVariant): NetworkHtmlHead {\n return emptyHtmlHead;\n}\n","import { resolve } from 'node:path';\n\nimport type { PlayableVariant } from '@replayablejs/config';\nimport { normalizePath } from 'vite';\n\n/** Resolves the generated assets module selected for one playable variant. */\nexport function resolveAssetsModule(projectRoot: string, variant: PlayableVariant): string {\n return normalizePath(resolve(projectRoot, variant.assets.emit.assets));\n}\n","import { resolve } from 'node:path';\n\nimport { resolvePlayableProfile } from '#networks/network-profiles.js';\nimport { resolveAssetsModule } from '#runtime/resolve-assets-module.js';\nimport type { PlayableViteContext, PlayableViteContextOptions } from '#types/vite.js';\n\n/** Resolves every shared input needed before configuring Vite. */\nexport function createPlayableViteContext(\n options: PlayableViteContextOptions,\n): PlayableViteContext {\n return {\n entryFile: resolve(options.projectRoot, options.variant.entry),\n assetsModule: resolveAssetsModule(options.projectRoot, options.variant),\n profile: resolvePlayableProfile(options.variant),\n projectRoot: options.projectRoot,\n variant: options.variant,\n };\n}\n","import { resolve } from 'node:path';\n\nimport type { PlayableVariant } from '@replayablejs/config';\n\nimport type { ServePreviewOptions } from '#types/build.js';\nimport type { DevelopmentContext } from '#types/context.js';\nimport { createPlayableViteContext } from '#vite/create-playable-vite-context.js';\n\nconst DEFAULT_HOST = '0.0.0.0';\nconst DEFAULT_PORT = 5173;\n\n/** Resolves every path, profile, and server option needed by local development. */\nexport function createDevelopmentContext(\n variant: PlayableVariant,\n options: ServePreviewOptions,\n): DevelopmentContext {\n const projectRoot = resolve(options.projectRoot);\n const viteContext = createPlayableViteContext({ projectRoot, variant });\n\n return {\n ...viteContext,\n profile: {\n ...viteContext.profile,\n // Development keeps every generated file visible in browser network tools.\n assetMode: 'resource',\n },\n host: options.host ?? DEFAULT_HOST,\n open: options.open ?? false,\n port: options.port ?? DEFAULT_PORT,\n };\n}\n","import type { InlineConfig } from 'vite';\n\n/** Creates environment-independent Vite configuration for one Replayable project. */\nexport function createBaseViteConfig(projectRoot: string): InlineConfig {\n return {\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n publicDir: false,\n root: projectRoot,\n };\n}\n","import { mergeConfig, type InlineConfig } from 'vite';\n\nimport type { DevelopmentViteConfigOptions } from '#types/vite.js';\n\nimport { createBaseViteConfig } from './create-base-vite-config.js';\n\n/** Combines the four production entry configurations into one HMR module graph. */\nexport function createDevelopmentViteConfig(options: DevelopmentViteConfigOptions): InlineConfig {\n const { application, assets, config, host } = options.entries;\n const entryConfig = [host, config, assets, application].reduce<InlineConfig>(\n (current, entry) => mergeConfig(current, entry.viteConfig),\n {},\n );\n\n return mergeConfig(\n createBaseViteConfig(options.projectRoot),\n mergeConfig(entryConfig, {\n plugins: [...(options.plugins ?? [])],\n }),\n );\n}\n","import { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst buildDirectory = dirname(fileURLToPath(import.meta.resolve('@replayablejs/build')));\n\n/** Resolves one private browser module emitted beside the build package entry. */\nexport function resolveBuildRuntimeModule(modulePath: string): string {\n return resolve(buildDirectory, 'runtime', modulePath);\n}\n","import type { BuildRuntimeEntry } from '#types/runtime.js';\n\nimport { resolveBuildRuntimeModule } from './resolve-build-runtime-module.js';\n\n/** Resolves one private browser entry emitted with the build package. */\nexport function resolveBuildRuntimeEntry(entry: BuildRuntimeEntry): string {\n return resolveBuildRuntimeModule(`entries/${entry}.mjs`);\n}\n","import { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport type { PlayableVariant } from '@replayablejs/config';\n\nconst devtoolsDirectory = dirname(fileURLToPath(import.meta.resolve('@replayablejs/devtools')));\n\n/** Audio-disabled variants and production never load the sound control or its icons. */\nexport function resolveSoundControl(command: 'build' | 'serve', enabled: boolean): string {\n return resolve(\n devtoolsDirectory,\n 'sound-control',\n command === 'serve' && enabled ? 'enabled.js' : 'disabled.js',\n );\n}\n\n/** Production selects a dependency-free stub, regardless of the project's preference. */\nexport function resolveEndCardTrigger(command: 'build' | 'serve', enabled: boolean): string {\n return resolve(\n devtoolsDirectory,\n 'endcard-trigger',\n command === 'serve' && enabled ? 'enabled.js' : 'disabled.js',\n );\n}\n\n/** Selects stats before module loading; production never visits the enabled graph. */\nexport function resolveDevtoolsStats(\n command: 'build' | 'serve',\n stats: PlayableVariant['devtools']['stats'],\n): string {\n const enabled =\n command === 'serve' && stats !== false && Object.values(stats).some((value) => value === true);\n\n return resolve(devtoolsDirectory, 'stats', enabled ? 'enabled.js' : 'disabled.js');\n}\n\n/** Context registration is unnecessary unless a WebGL metric is requested in development. */\nexport function resolveWebglStats(\n command: 'build' | 'serve',\n stats: PlayableVariant['devtools']['stats'],\n): string {\n const enabled =\n command === 'serve' &&\n stats !== false &&\n (stats.drawCalls || stats.textureBinds || stats.programUses);\n\n return resolve(devtoolsDirectory, 'stats', 'webgl', enabled ? 'enabled.js' : 'disabled.js');\n}\n","import { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst runtimeDirectory = dirname(fileURLToPath(import.meta.resolve('@replayablejs/runtime')));\n\n/** Returns the enabled or no-op audio module selected for one concrete variant. */\nexport function resolveRuntimeAudio(enabled: boolean): string {\n return resolve(runtimeDirectory, 'audio', enabled ? 'enabled.js' : 'disabled.js');\n}\n","import { normalizePath } from 'vite';\n\n/** Removes Vite query metadata and normalizes a module ID for comparison. */\nexport function resolvePhysicalId(id: string): string {\n return normalizePath(id).split('?')[0] ?? id;\n}\n","import type { Plugin } from 'vite';\n\nimport type { GeneratedAssetsBoundaryPluginOptions } from '#types/vite.js';\nimport { resolvePhysicalId } from '#vite/resolve-physical-id.js';\n\n/** Prevents application code from importing the physical generated asset registry. */\nexport function createGeneratedAssetsBoundaryPlugin(\n options: GeneratedAssetsBoundaryPluginOptions,\n): Plugin {\n const allowedImporter =\n options.allowedImporter === undefined ? undefined : resolvePhysicalId(options.allowedImporter);\n const generatedAssetsModule = resolvePhysicalId(options.assetsModule);\n\n return {\n name: 'replayable:generated-assets-boundary',\n enforce: 'pre',\n\n async resolveId(source, importer) {\n if (importer === undefined) {\n return undefined;\n }\n\n const resolved = await this.resolve(source, importer, { skipSelf: true });\n\n if (resolved === null || resolvePhysicalId(resolved.id) !== generatedAssetsModule) {\n return resolved;\n }\n\n if (allowedImporter !== undefined && resolvePhysicalId(importer) === allowedImporter) {\n return resolved;\n }\n\n throw new Error(\n [\n 'The generated assets module is internal to the Replayable build.',\n 'Consume assets through playable.loader instead of importing the generated module directly.',\n ].join(' '),\n );\n },\n };\n}\n","import type { InlineConfig } from 'vite';\n\nimport { resolveBuildRuntimeModule } from '#runtime/resolve-build-runtime-module.js';\nimport {\n resolveDevtoolsStats,\n resolveWebglStats,\n resolveEndCardTrigger,\n resolveSoundControl,\n} from '#runtime/resolve-devtools.js';\nimport { resolveRuntimeAudio } from '#runtime/resolve-runtime-audio.js';\nimport type { PlayableViteContext } from '#types/vite.js';\n\nimport { createGeneratedAssetsBoundaryPlugin } from './plugins/generated-assets-boundary.js';\n\n/** Creates Vite configuration for authored application and runtime code only. */\nexport function createApplicationViteConfig(\n options: PlayableViteContext,\n assetsEntry: string,\n command: 'build' | 'serve',\n): InlineConfig {\n return {\n define: options.profile.compileTimeDefinitions,\n plugins: [\n createGeneratedAssetsBoundaryPlugin({\n allowedImporter: assetsEntry,\n assetsModule: options.assetsModule,\n }),\n ],\n resolve: {\n alias: {\n '#adapter': resolveBuildRuntimeModule('bindings/adapter.mjs'),\n '#assets': resolveBuildRuntimeModule('bindings/assets.mjs'),\n '#audio': resolveRuntimeAudio(options.variant.audio),\n '#definition': resolveBuildRuntimeModule('bindings/definition.mjs'),\n '#stats': resolveDevtoolsStats(command, options.variant.devtools.stats),\n '#endcard-trigger': resolveEndCardTrigger(command, options.variant.devtools.endCardTrigger),\n '#sound-control': resolveSoundControl(\n command,\n options.variant.audio && options.variant.devtools.soundControl,\n ),\n '#webgl-stats': resolveWebglStats(command, options.variant.devtools.stats),\n },\n },\n };\n}\n","import { extname } from 'node:path';\n\nimport type { AssetMode } from '@replayablejs/runtime/assets';\nimport type { Plugin } from 'vite';\n\nimport type { GeneratedAssetsPluginOptions, GeneratedImportKind } from '#types/vite.js';\nimport { resolvePhysicalId } from '#vite/resolve-physical-id.js';\n\nconst BINARY_EXTENSIONS = new Set([\n '.avif',\n '.glb',\n '.gltf',\n '.jpeg',\n '.jpg',\n '.m4a',\n '.mp3',\n '.ogg',\n '.png',\n '.skel',\n '.wav',\n '.webp',\n '.woff',\n '.woff2',\n]);\nconst JSON_EXTENSION = '.json';\nconst TEXT_EXTENSIONS = new Set(['.atlas', '.frag', '.glsl', '.vert']);\n\nconst INLINE_QUERY_BY_KIND = {\n binary: '?url&inline',\n json: undefined,\n text: '?raw',\n} satisfies Record<GeneratedImportKind, string | undefined>;\n\n/**\n * Applies a profile's asset policy through Vite's native import queries.\n *\n * The generated assets module stays independent of Vite and contains ordinary\n * imports such as:\n *\n * ```ts\n * import image from './resources/logo.webp';\n * import shader from './resources/frag.glsl';\n * import locale from './resources/translations.json';\n * ```\n *\n * Before Vite resolves those imports, this plugin privately attaches the query\n * that describes the required runtime representation:\n *\n * | Imported file | Inline mode | Resource mode |\n * | ------------------- | ------------- | ---------------- |\n * | Image/audio/font | `?url&inline` | `?url&no-inline` |\n * | Binary SKEL | `?url&inline` | `?url&no-inline` |\n * | GLSL/Spine atlas | `?raw` | `?url&no-inline` |\n * | JSON | ordinary JSON | `?url&no-inline` |\n *\n * Only direct imports made by the generated assets module are rewritten.\n * Authored application imports and unrelated JSON or text files retain Vite's\n * normal behavior.\n */\nexport function createGeneratedAssetsPlugin(options: GeneratedAssetsPluginOptions): Plugin {\n const assetsModule = resolvePhysicalId(options.assetsModule);\n\n return {\n name: 'replayable:generated-assets',\n enforce: 'pre',\n\n async resolveId(source, importer) {\n if (importer === undefined || resolvePhysicalId(importer) !== assetsModule) {\n return undefined;\n }\n\n const importKind = classifyGeneratedImport(source);\n\n if (importKind === undefined) {\n return undefined;\n }\n\n const query = resolveViteQuery(importKind, options.mode);\n\n // Inline JSON deliberately reaches Vite unchanged so its native JSON\n // module handling returns the parsed object.\n if (query === undefined) {\n return undefined;\n }\n\n // Resolve the rewritten import through Vite while preventing this plugin\n // from intercepting its own query-enhanced request a second time.\n return this.resolve(`${source}${query}`, importer, { skipSelf: true });\n },\n };\n}\n\n/** Classifies one physical import emitted by the generated assets module. */\nfunction classifyGeneratedImport(source: string): GeneratedImportKind | undefined {\n const extension = extname(resolvePhysicalId(source)).toLowerCase();\n\n if (BINARY_EXTENSIONS.has(extension)) {\n return 'binary';\n }\n\n if (TEXT_EXTENSIONS.has(extension)) {\n return 'text';\n }\n\n return extension === JSON_EXTENSION ? 'json' : undefined;\n}\n\n/** Selects the documented Vite query for one asset kind and delivery mode. */\nfunction resolveViteQuery(kind: GeneratedImportKind, mode: AssetMode): string | undefined {\n return mode === 'resource' ? '?url&no-inline' : INLINE_QUERY_BY_KIND[kind];\n}\n","import type { InlineConfig } from 'vite';\n\nimport type { PlayableViteContext } from '#types/vite.js';\n\nimport { createGeneratedAssetsPlugin } from './plugins/generated-assets.js';\n\n/** Creates Vite configuration for the generated assets registration only. */\nexport function createAssetsViteConfig(options: PlayableViteContext): InlineConfig {\n return {\n resolve: {\n alias: {\n '#generated-assets': options.assetsModule,\n },\n },\n plugins: [\n createGeneratedAssetsPlugin({\n assetsModule: options.assetsModule,\n mode: options.profile.assetMode,\n }),\n ],\n };\n}\n","import type { PlayableVariant } from '@replayablejs/config';\nimport type { RuntimeConfig, RuntimeDefinition } from '@replayablejs/runtime';\n\nimport type { PlayableProfile } from '#types/network.js';\n\nconst RUNTIME_DEFINITION = 'REPLAYABLE_RUNTIME_DEFINITION';\n\n/** Creates the platform-neutral value completed by the browser config entry. */\nexport function createRuntimeDefine(\n variant: PlayableVariant,\n profile: PlayableProfile,\n): Record<string, string> {\n const definition: Pick<RuntimeDefinition, 'assetMode' | 'config'> = {\n assetMode: profile.assetMode,\n config: {\n audio: variant.audio,\n backgroundColor: variant.backgroundColor,\n completion: createRuntimeCompletionConfig(variant, profile),\n controls: {\n persistentCta: profile.controls.persistentCta,\n },\n devtools: variant.devtools,\n endCard: profile.endCard,\n id: variant.id,\n localization: variant.localization,\n network: variant.network,\n params: variant.params,\n screen: variant.screen,\n store: variant.store,\n version: variant.version,\n },\n };\n\n return {\n [RUNTIME_DEFINITION]: JSON.stringify(definition),\n };\n}\n\n/** Removes disabled timers while adding the network-owned duration start policy. */\nfunction createRuntimeCompletionConfig(\n variant: PlayableVariant,\n profile: PlayableProfile,\n): RuntimeConfig['completion'] {\n const { duration, inactivity } = variant.completion;\n\n return {\n durationStart: profile.completionDurationStart,\n ...(duration === undefined ? {} : { duration }),\n ...(inactivity === undefined ? {} : { inactivity }),\n };\n}\n","import type { InlineConfig } from 'vite';\n\nimport { createRuntimeDefine } from '#runtime/create-runtime-define.js';\nimport type { PlayableViteContext } from '#types/vite.js';\n\n/** Creates Vite configuration for the resolved runtime definition only. */\nexport function createConfigViteConfig(options: PlayableViteContext): InlineConfig {\n return {\n define: createRuntimeDefine(options.variant, options.profile),\n };\n}\n","import { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport type { RuntimeHost } from '#types/network.js';\n\nconst runtimeDirectory = dirname(fileURLToPath(import.meta.resolve('@replayablejs/runtime')));\n\n/** Returns the private runtime adapter module selected by Replayable. */\nexport function resolveRuntimeAdapter(host: RuntimeHost): string {\n return resolve(runtimeDirectory, 'adapters', `${host}.js`);\n}\n","import type { InlineConfig } from 'vite';\n\nimport { resolveRuntimeAdapter } from '#runtime/resolve-runtime-adapter.js';\nimport type { PlayableViteContext } from '#types/vite.js';\n\n/** Creates Vite configuration for the profile-selected network host only. */\nexport function createHostViteConfig(options: PlayableViteContext): InlineConfig {\n return {\n resolve: {\n alias: {\n '#selected-adapter': resolveRuntimeAdapter(options.profile.runtime),\n },\n },\n };\n}\n","import { resolveBuildRuntimeEntry } from '#runtime/resolve-build-runtime-entry.js';\nimport type { PlayableViteContext, PlayableViteEntries } from '#types/vite.js';\n\nimport { createApplicationViteConfig } from './create-application-vite-config.js';\nimport { createAssetsViteConfig } from './create-assets-vite-config.js';\nimport { createConfigViteConfig } from './create-config-vite-config.js';\nimport { createHostViteConfig } from './create-host-vite-config.js';\n\n/**\n * Describes the four private module entries shared by development and production.\n *\n * Production builds each descriptor independently. Development merges their Vite\n * configuration into one live graph and serves the same inputs in execution order.\n */\nexport function createPlayableEntries(\n context: PlayableViteContext,\n command: 'build' | 'serve',\n): PlayableViteEntries {\n const assetsEntry = resolveBuildRuntimeEntry('assets');\n\n return {\n host: {\n input: resolveBuildRuntimeEntry('host'),\n viteConfig: createHostViteConfig(context),\n },\n config: {\n input: resolveBuildRuntimeEntry('config'),\n viteConfig: createConfigViteConfig(context),\n },\n assets: {\n input: assetsEntry,\n viteConfig: createAssetsViteConfig(context),\n },\n application: {\n input: context.entryFile,\n viteConfig: createApplicationViteConfig(context, assetsEntry, command),\n },\n };\n}\n","import { relative } from 'node:path';\nimport { styleText } from 'node:util';\n\nimport { normalizePath, type Plugin } from 'vite';\n\nconst UPDATE_LABELS = {\n create: 'Created',\n delete: 'Deleted',\n update: 'Updated',\n} as const;\nconst DUPLICATE_UPDATE_WINDOW = 100;\n\n/** Reports Vite file updates without exposing Vite as the public development interface. */\nexport function createDevelopmentReporterPlugin(projectRoot: string): Plugin {\n const recentUpdates = new Map<string, number>();\n\n return {\n name: 'replayable:development-reporter',\n hotUpdate(options) {\n if (this.environment.name !== 'client') {\n return;\n }\n\n const file = normalizePath(relative(projectRoot, options.file));\n const startedAt = performance.now();\n const previousUpdate = recentUpdates.get(file);\n\n // Editors may save one file through several rapid filesystem writes.\n if (previousUpdate !== undefined && startedAt - previousUpdate < DUPLICATE_UPDATE_WINDOW) {\n return;\n }\n\n recentUpdates.set(file, startedAt);\n\n setImmediate(() => {\n const duration = Math.round(performance.now() - startedAt);\n const label = styleText('green', UPDATE_LABELS[options.type].padEnd(9));\n const formattedDuration = duration === 0 ? '<1ms' : `${duration}ms`;\n const details = styleText('dim', `${file} in ${formattedDuration}`);\n\n console.log(`${label} ${details}`);\n });\n },\n };\n}\n","/** Canonical entry document produced by every Replayable build. */\nexport const PLAYABLE_HTML_FILE = 'index.html';\n","#replayable-loading-indicator {\n position: absolute;\n z-index: 1;\n display: grid;\n pointer-events: none;\n inset: 0;\n place-items: center;\n}\n\n#replayable-loading-indicator::after {\n width: 1.5rem;\n height: 1.5rem;\n border: 0.125rem solid rgba(127, 127, 127, 0.45);\n border-top-color: #ffffff;\n border-radius: 50%;\n animation: replayable-loading-spin 800ms linear infinite;\n content: \"\";\n}\n\n@keyframes replayable-loading-spin {\n to {\n transform: rotate(1turn);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n #replayable-loading-indicator::after {\n animation: none;\n }\n}","html,\nbody {\n width: 100%;\n height: 100%;\n margin: 0;\n overflow: hidden;\n overscroll-behavior: none;\n}\n\nbody {\n background-color: inherit;\n position: fixed;\n inset: 0;\n}\n\n#replayable-root {\n background-color: inherit;\n position: fixed;\n inset: 0;\n overflow: hidden;\n user-select: none;\n -webkit-user-select: none;\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: transparent;\n touch-action: none;\n}\n\n#replayable-container {\n background-color: inherit;\n position: absolute;\n overflow: hidden;\n}\n\n#replayable-root::before {\n content: \"\";\n position: absolute;\n visibility: hidden;\n pointer-events: none;\n padding: max(env(safe-area-inset-top, 0px), clamp(36px, 5svh, 44px)) max(env(safe-area-inset-right, 0px), 12px) max(env(safe-area-inset-bottom, 0px), clamp(24px, 4svh, 36px)) max(env(safe-area-inset-left, 0px), 12px);\n}\n\n#replayable-root[data-orientation=landscape]::before {\n padding: max(env(safe-area-inset-top, 0px), 12px) max(env(safe-area-inset-right, 0px), clamp(48px, 7svw, 64px)) max(env(safe-area-inset-bottom, 0px), clamp(20px, 4svh, 32px)) max(env(safe-area-inset-left, 0px), clamp(48px, 7svw, 64px));\n}","import {\n REPLAYABLE_CONTAINER_ID,\n REPLAYABLE_LOADING_INDICATOR_ID,\n REPLAYABLE_ROOT_ID,\n} from '@replayablejs/runtime/shell';\nimport { h } from 'hastscript';\n\nimport type { LoadingIndicatorOwner } from '#types/network.js';\n\nimport loadingIndicatorStyles from './loading-indicator.scss?inline';\nimport playableShellStyles from './playable-shell.scss?inline';\n\n/** Returns only the framework styles required by the active loading owner. */\nexport function resolvePlayableShellStyles(loadingIndicator: LoadingIndicatorOwner): string {\n if (loadingIndicator === 'host') {\n return playableShellStyles;\n }\n\n return `${playableShellStyles}${loadingIndicatorStyles}`;\n}\n\n/** Renders the framework mount points shared by DOM and canvas playables. */\nexport function renderPlayableShell(loadingIndicator: LoadingIndicatorOwner): ReturnType<typeof h> {\n const children = [h('div', { id: REPLAYABLE_CONTAINER_ID })];\n\n if (loadingIndicator === 'replayable') {\n children.unshift(\n h('div', {\n id: REPLAYABLE_LOADING_INDICATOR_ID,\n role: 'status',\n ariaLabel: 'Loading',\n }),\n );\n }\n\n return h('div', { id: REPLAYABLE_ROOT_ID }, children);\n}\n","import type { PlayableVariant } from '@replayablejs/config';\nimport { toHtml } from 'hast-util-to-html';\nimport { h } from 'hastscript';\n\nimport { renderPlayableShell, resolvePlayableShellStyles } from '#html/playable-shell.js';\nimport type { PlayableHtmlInitializers, PlayableHtmlResources } from '#types/html.js';\n\n/** Renders the shared playable document used by development and production. */\nexport function renderPlayableHtml(\n variant: PlayableVariant,\n resources: PlayableHtmlResources,\n): string {\n const networkMetaTags = resources.head.metaTags.map(({ name, content }) =>\n h('meta', { name, content }),\n );\n const stylesheets = resources.stylesheets.map((stylesheet) =>\n h('link', { href: stylesheet, rel: 'stylesheet' }),\n );\n const networkScripts = resources.head.scripts.map(({ src }) => h('script', { src }));\n const initializationScripts = renderInitializationScripts(resources.initializers);\n const shellStyles = resolvePlayableShellStyles(resources.loadingIndicator);\n const document = h(null, [\n { type: 'doctype' },\n h(\n 'html',\n {\n lang: variant.localization.language,\n style: { 'background-color': variant.backgroundColor },\n },\n [\n h('head', [\n h('meta', { charSet: 'UTF-8' }),\n h('meta', {\n name: 'viewport',\n content:\n 'width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover',\n }),\n ...networkMetaTags,\n h('title', variant.projectName),\n h('style', shellStyles),\n ...stylesheets,\n ...networkScripts,\n ]),\n h('body', [\n renderPlayableShell(resources.loadingIndicator),\n ...initializationScripts,\n h('script', {\n 'data-replayable-entry': 'application',\n src: resources.entry,\n type: 'module',\n }),\n ]),\n ],\n ),\n ]);\n\n return `${toHtml(document)}\\n`;\n}\n\n/** Renders scope initialization in its required execution order. */\nfunction renderInitializationScripts(\n initializers: PlayableHtmlInitializers | undefined,\n): ReturnType<typeof h>[] {\n if (initializers === undefined) {\n return [];\n }\n\n return [\n h('script', {\n 'data-replayable-entry': 'host',\n src: initializers.host,\n type: 'module',\n }),\n h('script', {\n 'data-replayable-entry': 'config',\n src: initializers.config,\n type: 'module',\n }),\n h('script', {\n 'data-replayable-entry': 'assets',\n src: initializers.assets,\n type: 'module',\n }),\n ];\n}\n","import type { PlayableVariant } from '@replayablejs/config';\nimport type { Plugin } from 'vite';\n\nimport { PLAYABLE_HTML_FILE } from '#html/playable-html.js';\nimport { renderPlayableHtml } from '#html/render-playable-html.js';\nimport type { PlayableHtmlResources } from '#types/html.js';\n\n/** Serves framework-owned HTML while leaving modules and HMR to Vite. */\nexport function createPlayableHtmlPlugin(\n variant: PlayableVariant,\n resources: PlayableHtmlResources,\n): Plugin {\n return {\n name: 'replayable:html',\n configureServer(server) {\n server.middlewares.use(async (request, response, next) => {\n if (!isHtmlRequest(request.url)) {\n next();\n\n return;\n }\n\n try {\n const source = renderPlayableHtml(variant, resources);\n const html = await server.transformIndexHtml(request.url ?? '/', source);\n\n response.statusCode = 200;\n response.setHeader('Content-Type', 'text/html; charset=utf-8');\n response.end(html);\n } catch (error) {\n next(error);\n }\n });\n },\n };\n}\n\n/** Matches only the development document, never module or asset requests. */\nfunction isHtmlRequest(requestUrl: string | undefined): boolean {\n if (requestUrl === undefined) {\n return false;\n }\n\n const pathname = new URL(requestUrl, 'http://replayable.local').pathname;\n\n return pathname === '/' || pathname === `/${PLAYABLE_HTML_FILE}`;\n}\n","import { createServer, normalizePath, type ViteDevServer } from 'vite';\n\nimport type { DevelopmentContext } from '#types/context.js';\nimport { createDevelopmentViteConfig } from '#vite/create-development-vite-config.js';\nimport { createPlayableEntries } from '#vite/create-playable-entries.js';\n\nimport { createDevelopmentReporterPlugin } from './plugins/development-reporter.js';\nimport { createPlayableHtmlPlugin } from './plugins/playable-html.js';\n\n/** Starts Vite for one resolved playable variant and its authored browser entry. */\nexport async function createDevelopmentServer(context: DevelopmentContext): Promise<ViteDevServer> {\n const entries = createPlayableEntries(context, 'serve');\n const viteConfig = createDevelopmentViteConfig({\n entries,\n projectRoot: context.projectRoot,\n plugins: [\n createPlayableHtmlPlugin(context.variant, {\n entry: toDevelopmentModuleUrl(entries.application.input),\n initializers: {\n assets: toDevelopmentModuleUrl(entries.assets.input),\n config: toDevelopmentModuleUrl(entries.config.input),\n host: toDevelopmentModuleUrl(entries.host.input),\n },\n head: context.profile.htmlHead,\n loadingIndicator: context.profile.loadingIndicator,\n stylesheets: [],\n }),\n createDevelopmentReporterPlugin(context.projectRoot),\n ],\n });\n const server = await createServer({\n ...viteConfig,\n appType: 'custom',\n server: {\n host: context.host,\n open: context.open,\n port: context.port,\n },\n });\n\n await server.listen();\n\n return server;\n}\n\n/** Converts an absolute private entry path into Vite's browser-facing filesystem URL. */\nfunction toDevelopmentModuleUrl(file: string): string {\n return `/@fs/${normalizePath(file)}`;\n}\n","import type { PlayableVariant } from '@replayablejs/config';\n\nimport type { VariantSelection } from '#types/build.js';\n\n/** Selects the preview variant that satisfies every explicit development choice. */\nexport function selectDevelopmentVariant(\n variants: readonly PlayableVariant[],\n selection: VariantSelection,\n): PlayableVariant {\n const variant = variants.find(\n (candidate) =>\n candidate.network === 'preview' &&\n (selection.version === undefined || candidate.version === selection.version) &&\n (selection.language === undefined || candidate.localization.language === selection.language),\n );\n\n if (variant === undefined) {\n throw new Error(`No configured playable variant matches ${describeSelection(selection)}.`);\n }\n\n return variant;\n}\n\n/** Produces a concise, actionable description for an invalid selection. */\nfunction describeSelection(selection: VariantSelection): string {\n return [\n `version=${selection.version ?? '*'}`,\n 'network=preview',\n `language=${selection.language ?? '*'}`,\n ].join(', ');\n}\n","import { buildAssets } from '@replayablejs/assets';\nimport { createVariants, defineConfig, type ReplayableConfigInput } from '@replayablejs/config';\n\nimport { createDevelopmentContext } from '#pipeline/create-development-context.js';\nimport type { ServePreviewOptions, ServePreviewResult } from '#types/build.js';\n\nimport { createDevelopmentServer } from './create-development-server.js';\nimport { selectDevelopmentVariant } from './select-development-variant.js';\n\n/** Builds one preview variant's assets and starts its local Vite server. */\nexport async function servePreview(\n config: ReplayableConfigInput,\n options: ServePreviewOptions,\n): Promise<ServePreviewResult> {\n const validatedConfig = defineConfig(config);\n const variants = createVariants(validatedConfig);\n const variant = selectDevelopmentVariant(variants, options);\n const context = createDevelopmentContext(variant, options);\n\n await buildAssets(context.variant.assets, context.projectRoot);\n\n const server = await createDevelopmentServer(context);\n const resolvedUrls = server.resolvedUrls;\n\n return {\n close: () => server.close(),\n localUrls: resolvedUrls?.local ?? [],\n networkUrls: resolvedUrls?.network ?? [],\n variantId: context.variant.id,\n };\n}\n","import { lstatSync, realpathSync, statSync } from 'node:fs';\nimport { dirname, isAbsolute, relative, resolve, sep } from 'node:path';\n\n/** Resolves an output path while preventing project-wide recursive deletion. */\nexport function resolveOutputDirectory(projectRoot: string, configuredPath: string): string {\n const outputDirectory = resolve(projectRoot, configuredPath);\n const projectRelativePath = relative(projectRoot, outputDirectory);\n\n if (projectRelativePath === '' || isOutsideProject(projectRelativePath)) {\n throw new Error('The build output must resolve to a directory inside the project root.');\n }\n\n // Resolve existing ancestors too: `linked/dist` may escape even when `dist`\n // does not exist yet. Return the authored path, but validate its physical target.\n const physicalRoot = realpathSync.native(projectRoot);\n const physicalOutput = resolvePhysicalPath(outputDirectory);\n const physicalRelativePath = relative(physicalRoot, physicalOutput);\n\n if (physicalRelativePath === '' || isOutsideProject(physicalRelativePath)) {\n throw new Error('The build output must resolve to a directory inside the project root.');\n }\n\n return outputDirectory;\n}\n\n/** Resolves symlinks in the nearest existing ancestor of a future output path. */\nfunction resolvePhysicalPath(path: string): string {\n if (lstatSync(path, { throwIfNoEntry: false }) !== undefined) {\n // Dangling links and permission errors must fail, not bypass the safety check.\n const physicalPath = realpathSync.native(path);\n if (!statSync(physicalPath).isDirectory()) {\n throw new Error(`ENOTDIR: build output ancestor is not a directory: ${path}`);\n }\n return physicalPath;\n }\n\n const parent = dirname(path);\n return resolve(resolvePhysicalPath(parent), relative(parent, path));\n}\n\n/** Identifies relative paths that resolve beyond their intended parent directory. */\nfunction isOutsideProject(relativePath: string): boolean {\n return relativePath === '..' || relativePath.startsWith(`..${sep}`) || isAbsolute(relativePath);\n}\n","import { writeFile } from 'node:fs/promises';\n\nimport { renderPlayableHtml } from '#html/render-playable-html.js';\nimport type { BundleOutput } from '#types/bundle.js';\nimport type { BuildContext } from '#types/context.js';\n\n/** Writes the runnable HTML document into its prepared variant output. */\nexport async function emitPlayableHtml(context: BuildContext, bundle: BundleOutput): Promise<void> {\n const source = renderPlayableHtml(context.variant, {\n entry: `./${bundle.entries.application}`,\n head: context.profile.htmlHead,\n initializers: {\n assets: `./${bundle.entries.assets}`,\n config: `./${bundle.entries.config}`,\n host: `./${bundle.entries.host}`,\n },\n loadingIndicator: context.profile.loadingIndicator,\n stylesheets: bundle.stylesheets.map((stylesheet) => `./${stylesheet}`),\n });\n\n await writeFile(context.htmlFile, source, 'utf8');\n}\n","import { join, resolve } from 'node:path';\n\nimport type { PlayableVariant } from '@replayablejs/config';\n\nimport { PLAYABLE_HTML_FILE } from '#html/playable-html.js';\nimport type { BuildVariantOptions } from '#types/build.js';\nimport type { BuildContext } from '#types/context.js';\nimport { createPlayableViteContext } from '#vite/create-playable-vite-context.js';\n\nimport { resolveOutputDirectory } from './resolve-output-directory.js';\n\n/** Resolves every authored and generated path needed to build one variant. */\nexport function createBuildContext(\n variant: PlayableVariant,\n options: BuildVariantOptions,\n): BuildContext {\n const projectRoot = resolve(options.projectRoot);\n const outputDirectory = resolveOutputDirectory(projectRoot, options.outputDirectory);\n const viteContext = createPlayableViteContext({\n projectRoot,\n variant,\n });\n\n return {\n ...viteContext,\n outputDirectory,\n htmlFile: join(outputDirectory, PLAYABLE_HTML_FILE),\n };\n}\n","/** Minimum browser engines supported by compiled playable output. */\nexport const PLAYABLE_BROWSER_TARGETS = ['ios16.1', 'chrome105'] as const;\n","import type { Rolldown } from 'vite';\n\nimport type {\n BundleEntries,\n BundleEntryOutputs,\n BundleOutput,\n EntryOutput,\n EntryRole,\n} from '#types/bundle.js';\nimport type { ApplicationMode } from '#types/network.js';\n\nconst STYLESHEET_EXTENSION = '.css';\n\nconst standaloneEntryRoles = ['host', 'config', 'assets'] as const;\nconst entryRoles: readonly EntryRole[] = [...standaloneEntryRoles, 'application'];\n\n/** Combines four role-specific Rolldown results into one HTML-facing description. */\nexport function createBundleOutput(\n outputs: BundleEntryOutputs,\n applicationMode: ApplicationMode,\n): BundleOutput {\n const entries: BundleEntries = {\n host: requireEntryFile(outputs.host, 'host'),\n config: requireEntryFile(outputs.config, 'config'),\n assets: requireEntryFile(outputs.assets, 'assets'),\n application: requireEntryFile(outputs.application, 'application'),\n };\n\n validateBundleContract(outputs, entries, applicationMode);\n\n const emittedAssets = Object.values(outputs)\n .flat()\n .filter((chunkOrAsset) => chunkOrAsset.type === 'asset');\n const applicationChunks = outputs.application.filter(\n (chunkOrAsset) => chunkOrAsset.type === 'chunk' && !chunkOrAsset.isEntry,\n );\n\n return {\n entries,\n chunks: applicationChunks.map(({ fileName }) => fileName).sort(),\n stylesheets: collectAssetFiles(emittedAssets, true),\n resources: collectAssetFiles(emittedAssets, false),\n };\n}\n\n/** Enforces the entry isolation required by the runtime registration protocol. */\nfunction validateBundleContract(\n outputs: BundleEntryOutputs,\n entries: BundleEntries,\n applicationMode: ApplicationMode,\n): void {\n const entryFiles = Object.values(entries);\n\n if (new Set(entryFiles).size !== entryFiles.length) {\n throw new Error(`Playable entry filenames must be unique; received ${entryFiles.join(', ')}.`);\n }\n\n for (const role of standaloneEntryRoles) {\n assertStandaloneEntry(outputs[role], role);\n }\n\n if (applicationMode === 'single-module') {\n assertStandaloneEntry(outputs.application, 'application');\n }\n\n for (const role of entryRoles) {\n assertNoCrossEntryImports(outputs[role], role, entries);\n }\n}\n\n/** Requires a role configured without code splitting to emit exactly one chunk. */\nfunction assertStandaloneEntry(output: EntryOutput, role: EntryRole): void {\n const chunks = output.filter((chunkOrAsset) => chunkOrAsset.type === 'chunk');\n\n if (chunks.length !== 1) {\n throw new Error(\n `Expected standalone ${role} entry to emit one chunk, received ${chunks.length}.`,\n );\n }\n}\n\n/** Rejects dependencies on another private entry while permitting application chunks. */\nfunction assertNoCrossEntryImports(\n output: EntryOutput,\n role: EntryRole,\n entries: BundleEntries,\n): void {\n const forbiddenEntryFiles = new Set(\n Object.entries(entries)\n .filter(([entryRole]) => entryRole !== role)\n .map(([, entryFile]) => entryFile),\n );\n\n for (const chunk of output) {\n if (chunk.type !== 'chunk') {\n continue;\n }\n\n const importedFiles = [...chunk.imports, ...chunk.dynamicImports];\n const forbiddenImport = importedFiles.find((file) => forbiddenEntryFiles.has(file));\n\n if (forbiddenImport !== undefined) {\n throw new Error(`Playable ${role} entry imports private entry ${forbiddenImport}.`);\n }\n }\n}\n\n/** Returns the one entry emitted by a role-specific build. */\nfunction requireEntryFile(output: Rolldown.RolldownOutput['output'], role: string): string {\n const entryFiles = output\n .filter((chunkOrAsset) => chunkOrAsset.type === 'chunk' && chunkOrAsset.isEntry)\n .map(({ fileName }) => fileName);\n const entryFile = entryFiles[0];\n\n if (entryFile === undefined || entryFiles.length !== 1) {\n throw new Error(`Expected one ${role} entry, received ${entryFiles.length}.`);\n }\n\n return entryFile;\n}\n\n/** Collects unique stylesheet or non-stylesheet asset paths in stable order. */\nfunction collectAssetFiles(\n assets: readonly Rolldown.OutputAsset[],\n stylesheets: boolean,\n): string[] {\n return [\n ...new Set(\n assets\n .filter(({ fileName }) => fileName.endsWith(STYLESHEET_EXTENSION) === stylesheets)\n .map(({ fileName }) => fileName),\n ),\n ].sort();\n}\n","import { existsSync, readFileSync, realpathSync } from 'node:fs';\nimport { dirname, isAbsolute, join, parse } from 'node:path';\n\nimport type { ApplicationModuleGraph, PackageInstance } from '#types/module-graph.js';\n\n/**\n * Browser packages whose state or object identity cannot safely be duplicated.\n *\n * This list is intentionally local to `@replayablejs/build`: unlike the repository\n * dependency check, this validator ships to consumers and must work independently.\n */\nconst SINGLETON_PACKAGES = [\n '@esotericsoftware/spine-core',\n '@esotericsoftware/spine-pixi-v8',\n '@replayablejs/runtime',\n 'motion',\n 'motion-dom',\n 'pixi.js',\n] as const;\n\n/**\n * Rejects singleton packages bundled from more than one physical installation.\n *\n * Rolldown may include the same package in several chunks; those modules are\n * valid when their nearest package.json resolves to the same real directory.\n * Distinct directories indicate separate caches, class identities, or frame\n * schedulers that cannot safely coexist inside one playable application.\n *\n * Only the application build belongs here. Replayable deliberately builds host,\n * config, and assets as separate executable entries; combining all four module\n * graphs would confuse that isolation with duplicate browser package instances.\n *\n * A protected package may be absent—for example, a DOM-only playable contains\n * no PixiJS. Presence is enforced by authored imports; this function only rejects\n * multiple installations of a package that actually entered the application.\n */\nexport function validateApplicationModuleGraph(output: ApplicationModuleGraph): void {\n const packageInstances = new Map<string, Set<string>>();\n const packageCache = new Map<string, PackageInstance | null>();\n\n for (const chunkOrAsset of output) {\n // Assets contain emitted bytes but no Rolldown module ownership information.\n if (chunkOrAsset.type !== 'chunk') {\n continue;\n }\n\n // `modules` includes every source contributing to this chunk. The same module\n // may appear in graph reporting more than once, so physical paths enter Sets.\n for (const moduleId of Object.keys(chunkOrAsset.modules)) {\n const packageInstance = resolvePackageInstance(moduleId, packageCache);\n\n if (!isSingletonPackage(packageInstance?.name)) {\n continue;\n }\n\n const instances = packageInstances.get(packageInstance.name) ?? new Set<string>();\n\n instances.add(packageInstance.directory);\n packageInstances.set(packageInstance.name, instances);\n }\n }\n\n for (const packageName of SINGLETON_PACKAGES) {\n const instances = packageInstances.get(packageName);\n\n if (instances !== undefined && instances.size > 1) {\n throw new Error(\n `Playable application contains multiple ${packageName} instances: ${[...instances].join(\n ', ',\n )}.`,\n );\n }\n }\n}\n\n/** Resolves the nearest package.json that owns one filesystem-backed module. */\nfunction resolvePackageInstance(\n moduleId: string,\n cache: Map<string, PackageInstance | null>,\n): PackageInstance | null {\n // Vite queries describe alternate transforms of the same source file and are\n // not part of its filesystem location (`sprite.png?url`, `module.ts?raw`).\n const filePath = moduleId.replace(/[?#].*$/, '');\n\n // Rolldown also reports virtual module IDs. They have no owning package.json\n // and therefore cannot establish a second physical package installation.\n if (!isAbsolute(filePath)) {\n return null;\n }\n\n let directory = dirname(filePath);\n const visitedDirectories: string[] = [];\n\n while (directory !== parse(directory).root) {\n const cachedInstance = cache.get(directory);\n\n // `null` is deliberately cached as well. `has()` distinguishes a completed\n // negative lookup from a directory that has not been inspected yet.\n if (cachedInstance !== undefined || cache.has(directory)) {\n cacheDirectories(visitedDirectories, cachedInstance ?? null, cache);\n return cachedInstance ?? null;\n }\n\n visitedDirectories.push(directory);\n\n const manifestPath = join(directory, 'package.json');\n\n if (existsSync(manifestPath)) {\n // The nearest manifest owns the module. Walking beyond it could incorrectly\n // attribute an application source file to a parent workspace package.\n const manifest: unknown = JSON.parse(readFileSync(manifestPath, 'utf8'));\n const packageInstance = readPackageInstance(manifest, directory);\n\n cacheDirectories(visitedDirectories, packageInstance, cache);\n return packageInstance;\n }\n\n directory = dirname(directory);\n }\n\n cacheDirectories(visitedDirectories, null, cache);\n return null;\n}\n\n/**\n * Retains one package lookup for every traversed directory.\n *\n * Many modules share nested directories. Caching the whole walk prevents repeated\n * filesystem traversal for every file in a large dependency such as PixiJS.\n */\nfunction cacheDirectories(\n directories: readonly string[],\n packageInstance: PackageInstance | null,\n cache: Map<string, PackageInstance | null>,\n): void {\n for (const directory of directories) {\n cache.set(directory, packageInstance);\n }\n}\n\n/** Reads only the package identity required by singleton validation. */\nfunction readPackageInstance(manifest: unknown, directory: string): PackageInstance | null {\n if (\n typeof manifest !== 'object' ||\n manifest === null ||\n !('name' in manifest) ||\n typeof manifest.name !== 'string'\n ) {\n return null;\n }\n\n return {\n // Different symlink spellings of one pnpm/workspace package must compare equal.\n directory: realpathSync.native(directory),\n name: manifest.name,\n };\n}\n\n/** Narrows an arbitrary package name to the protected singleton set. */\nfunction isSingletonPackage(name: string | undefined): name is string {\n return name !== undefined && SINGLETON_PACKAGES.some((packageName) => packageName === name);\n}\n","import { build, type Rolldown } from 'vite';\n\nimport { PLAYABLE_BROWSER_TARGETS } from '#browser-targets';\nimport type { BundleOutput, EntryBuildOptions } from '#types/bundle.js';\nimport type { BuildContext } from '#types/context.js';\nimport type { PlayableViteEntry } from '#types/vite.js';\nimport { createBaseViteConfig } from '#vite/create-base-vite-config.js';\nimport { createPlayableEntries } from '#vite/create-playable-entries.js';\n\nimport { createBundleOutput } from './create-bundle-output.js';\nimport { validateApplicationModuleGraph } from './validate-application-module-graph.js';\n\n/** Builds independently executable host, config, assets, and application entries. */\nexport async function bundleVariant(context: BuildContext): Promise<BundleOutput> {\n const entries = createPlayableEntries(context, 'build');\n const hostOutput = await buildEntry(context, entries.host, {\n emptyOutputDirectory: true,\n output: {\n codeSplitting: false,\n format: 'es',\n },\n });\n const configOutput = await buildEntry(context, entries.config, {\n emptyOutputDirectory: false,\n output: {\n codeSplitting: false,\n format: 'es',\n },\n });\n const assetsOutput = await buildEntry(context, entries.assets, {\n emptyOutputDirectory: false,\n output: {\n codeSplitting: false,\n format: 'es',\n },\n });\n const applicationOutput = await buildEntry(context, entries.application, {\n emptyOutputDirectory: false,\n output: {\n codeSplitting: context.profile.applicationMode === 'module-graph',\n format: 'es',\n },\n });\n\n validateApplicationModuleGraph(applicationOutput);\n\n return createBundleOutput(\n {\n host: hostOutput,\n config: configOutput,\n assets: assetsOutput,\n application: applicationOutput,\n },\n context.profile.applicationMode,\n );\n}\n\n/** Runs one role-specific Vite build into the shared variant directory. */\nasync function buildEntry(\n context: BuildContext,\n entry: PlayableViteEntry,\n options: EntryBuildOptions,\n): Promise<Rolldown.RolldownOutput['output']> {\n const buildResult = await build({\n ...createBaseViteConfig(context.projectRoot),\n ...entry.viteConfig,\n base: './',\n build: {\n assetsInlineLimit: context.profile.assetMode === 'inline' ? Infinity : 0,\n // Playable profiles intentionally keep large entries together. Export\n // validation checks delivery size; Vite's web-app chunk heuristic does not.\n chunkSizeWarningLimit: Infinity,\n cssTarget: [...PLAYABLE_BROWSER_TARGETS],\n emptyOutDir: options.emptyOutputDirectory,\n outDir: context.outputDirectory,\n rolldownOptions: {\n input: entry.input,\n // Never ship output that Rolldown or Oxc could not confidently produce.\n // In particular, this turns target-compatibility warnings into build failures.\n onLog(level, log, defaultHandler): void {\n defaultHandler(level === 'warn' ? 'error' : level, log);\n },\n output: options.output,\n },\n target: [...PLAYABLE_BROWSER_TARGETS],\n },\n });\n\n if (!('output' in buildResult)) {\n throw new Error('Vite did not return a single playable build output.');\n }\n\n return buildResult.output;\n}\n","import { buildAssets } from '@replayablejs/assets';\nimport type { PlayableVariant } from '@replayablejs/config';\n\nimport { emitPlayableHtml } from '#html/emit-playable-html.js';\nimport { createBuildContext } from '#pipeline/create-build-context.js';\nimport type { BuildVariantOptions, BuildVariantResult } from '#types/build.js';\n\nimport { bundleVariant } from './bundle-variant.js';\n\n/**\n * Produces one runnable playable from a concrete configuration variant.\n *\n * @param variant - Fully resolved version, network, and language combination.\n * @param options - Explicit project root and variant output directory.\n */\nexport async function buildVariant(\n variant: PlayableVariant,\n options: BuildVariantOptions,\n): Promise<BuildVariantResult> {\n const context = createBuildContext(variant, options);\n const assets = await buildAssets(context.variant.assets, context.projectRoot);\n\n const bundle = await bundleVariant(context);\n\n await emitPlayableHtml(context, bundle);\n\n return {\n assets,\n htmlFile: context.htmlFile,\n outputDirectory: context.outputDirectory,\n variantId: context.variant.id,\n };\n}\n","import { rm } from 'node:fs/promises';\nimport { join, resolve } from 'node:path';\n\nimport { buildAssets } from '@replayablejs/assets';\nimport { createVariants, defineConfig, type ReplayableConfigInput } from '@replayablejs/config';\n\nimport { resolveOutputDirectory } from '#pipeline/resolve-output-directory.js';\nimport type { BuildProjectResult } from '#types/build.js';\n\nimport { buildVariant } from './build-variant.js';\n\n/**\n * Builds every concrete variant configured by one Replayable project.\n *\n * Variants are built sequentially because their asset builds share generated\n * source paths. The project output is reset once so variants removed from the\n * configuration cannot leave stale playable directories behind.\n * The first variant is restored afterward as a deterministic baseline. This\n * does not isolate an active preview: build and development share asset paths.\n *\n * @param config - Human-authored or already validated Replayable configuration.\n * @param workingDirectory - Project directory used to resolve authored paths.\n */\nexport async function buildProject(\n config: ReplayableConfigInput,\n workingDirectory = process.cwd(),\n): Promise<BuildProjectResult> {\n const validatedConfig = defineConfig(config);\n const projectRoot = resolve(workingDirectory);\n const outputDirectory = resolveOutputDirectory(projectRoot, validatedConfig.build.outDir);\n const configuredVariants = createVariants(validatedConfig);\n const canonicalVariant = configuredVariants[0];\n const variants = [];\n const errors: unknown[] = [];\n\n if (canonicalVariant === undefined) {\n throw new Error('A Replayable project must resolve at least one playable variant.');\n }\n\n await rm(outputDirectory, { force: true, recursive: true });\n\n try {\n for (const variant of configuredVariants) {\n variants.push(\n await buildVariant(variant, {\n outputDirectory: join(outputDirectory, variant.id),\n projectRoot,\n }),\n );\n }\n } catch (error) {\n errors.push(error);\n }\n\n try {\n // Restore a deterministic baseline, not the active preview's selection.\n // Builds share generated paths with development; running both concurrently\n // is not isolated, even when this final restoration succeeds.\n await buildAssets(canonicalVariant.assets, projectRoot);\n } catch (error) {\n errors.push(error);\n }\n\n if (errors.length === 1) {\n throw errors[0];\n }\n\n if (errors.length > 1) {\n throw new AggregateError(errors, 'Playable build and generated asset restoration both failed.');\n }\n\n return {\n outputDirectory,\n variants,\n };\n}\n"],"mappings":";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M,UAAU,mBAAmB,SAAS,OAAO;CACnD,MAAM,SAAS,MAAM,YAAY,QAAQ,QAAQ,QAAQ,QAAQ,WAAW;CAI5E,MAAM,iBAAiB,SAAS,MAFX,cAAc,OAAO,CAEJ;CAEtC,OAAO;EACL;EACA,UAAU,QAAQ;EAClB,iBAAiB,QAAQ;EACzB,WAAW,QAAQ,QAAQ;CAC7B;AACF;;;;;;;;;;;;;;;ACTA,eAAsB,aACpB,QACA,mBAAmB,QAAQ,IAAI,GACF;CAC7B,MAAM,kBAAkB,aAAa,MAAM;CAC3C,MAAM,cAAc,QAAQ,gBAAgB;CAC5C,MAAM,kBAAkB,uBAAuB,aAAa,gBAAgB,MAAM,MAAM;CACxF,MAAM,qBAAqB,eAAe,eAAe;CACzD,MAAM,mBAAmB,mBAAmB;CAC5C,MAAM,WAAW,CAAC;CAClB,MAAM,SAAoB,CAAC;CAE3B,IAAI,qBAAqB,KAAA,GACvB,MAAM,IAAI,MAAM,kEAAkE;CAGpF,MAAM,GAAG,iBAAiB;EAAE,OAAO;EAAM,WAAW;CAAK,CAAC;CAE1D,IAAI;EACF,KAAK,MAAM,WAAW,oBACpB,SAAS,KACP,MAAM,aAAa,SAAS;GAC1B,iBAAiB,KAAK,iBAAiB,QAAQ,EAAE;GACjD;EACF,CAAC,CACH;CAEJ,SAAS,OAAO;EACd,OAAO,KAAK,KAAK;CACnB;CAEA,IAAI;EAIF,MAAM,YAAY,iBAAiB,QAAQ,WAAW;CACxD,SAAS,OAAO;EACd,OAAO,KAAK,KAAK;CACnB;CAEA,IAAI,OAAO,WAAW,GACpB,MAAM,OAAO;CAGf,IAAI,OAAO,SAAS,GAClB,MAAM,IAAI,eAAe,QAAQ,6DAA6D;CAGhG,OAAO;EACL;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["runtimeDirectory","playableShellStyles","loadingIndicatorStyles"],"sources":["../src/networks/google.ts","../src/networks/unity.ts","../src/networks/network-profiles.ts","../src/runtime/resolve-assets-module.ts","../src/vite/create-playable-vite-context.ts","../src/pipeline/create-development-context.ts","../src/vite/create-base-vite-config.ts","../src/vite/create-development-vite-config.ts","../src/runtime/resolve-build-runtime-module.ts","../src/runtime/resolve-build-runtime-entry.ts","../src/runtime/resolve-devtools.ts","../src/runtime/resolve-runtime-audio.ts","../src/vite/resolve-physical-id.ts","../src/vite/plugins/generated-assets-boundary.ts","../src/vite/create-application-vite-config.ts","../src/vite/plugins/generated-assets.ts","../src/vite/create-assets-vite-config.ts","../src/runtime/create-runtime-define.ts","../src/vite/create-config-vite-config.ts","../src/runtime/resolve-runtime-adapter.ts","../src/vite/create-host-vite-config.ts","../src/vite/create-playable-entries.ts","../src/development/plugins/development-reporter.ts","../src/html/playable-html.ts","../src/html/loading-indicator.scss?inline","../src/html/playable-shell.scss?inline","../src/html/playable-shell.ts","../src/html/render-playable-html.ts","../src/development/plugins/playable-html.ts","../src/development/create-development-server.ts","../src/development/select-development-variant.ts","../src/development/serve-preview.ts","../src/pipeline/resolve-output-directory.ts","../src/html/emit-playable-html.ts","../src/pipeline/create-build-context.ts","../src/browser-targets.ts","../src/production/create-bundle-output.ts","../src/production/validate-application-module-graph.ts","../src/production/bundle-variant.ts","../src/production/build-variant.ts","../src/production/build-project.ts"],"sourcesContent":["import type { PlayableVariant } from '@replayablejs/config';\n\nimport type { NetworkHtmlHead } from '#types/network.js';\n\nconst EXIT_API_URL = 'https://tpc.googlesyndication.com/pagead/gadgets/html5/api/exitapi.js';\n\n/** Resolves the production document elements required by Google App Campaigns. */\nexport function resolveGoogleHtmlHead(variant: PlayableVariant): NetworkHtmlHead {\n return {\n metaTags: [\n {\n name: 'ad.orientation',\n content: resolveOrientation(variant.screen.orientations),\n },\n ],\n scripts: [{ src: EXIT_API_URL }],\n };\n}\n\n/** Converts Replayable's enabled layouts into Google's orientation-tag value. */\nfunction resolveOrientation(orientations: PlayableVariant['screen']['orientations']): string {\n const { landscape, portrait } = orientations;\n\n if (landscape.enabled && portrait.enabled) {\n return 'portrait,landscape';\n }\n\n return portrait.enabled ? 'portrait' : 'landscape';\n}\n","import type { NetworkHtmlHead } from '#types/network.js';\n\nconst unityHtmlHead: NetworkHtmlHead = {\n metaTags: [],\n scripts: [{ src: 'mraid.js' }],\n};\n\n/** Adds Unity's required MRAID SDK bootstrap before authored runtime code. */\nexport function resolveUnityHtmlHead(): NetworkHtmlHead {\n return unityHtmlHead;\n}\n","import type { PlayableVariant, ReplayableNetwork } from '@replayablejs/config';\n\nimport type { NetworkHtmlHead, NetworkProfile, PlayableProfile } from '#types/network.js';\n\nimport { resolveGoogleHtmlHead } from './google.js';\nimport { resolveUnityHtmlHead } from './unity.js';\n\nconst fullScreenEndCard = { animation: 'continuous', interaction: 'full-screen' } as const;\nconst ctaOnlyEndCard = { animation: 'finite', interaction: 'cta-only' } as const;\nconst previewControls = { persistentCta: true } as const;\nconst hiddenControls = { persistentCta: false } as const;\nconst liftoffControls = { persistentCta: true } as const;\nconst noCompileTimeDefinitions: Readonly<Record<string, string>> = {};\n\nconst emptyHtmlHead: NetworkHtmlHead = {\n metaTags: [],\n scripts: [],\n};\n\nconst networkProfiles = {\n preview: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: previewControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'browser',\n },\n applovin: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'interaction',\n controls: hiddenControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'applovin',\n },\n meta: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: hiddenControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'meta',\n },\n google: {\n assetMode: 'resource',\n applicationMode: 'module-graph',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: hiddenControls,\n endCard: ctaOnlyEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveGoogleHtmlHead,\n runtime: 'google',\n },\n liftoff: {\n assetMode: 'resource',\n applicationMode: 'module-graph',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: liftoffControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'liftoff',\n },\n mintegral: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: hiddenControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'host',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'mintegral',\n },\n moloco: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: {\n // Moloco forbids this global. Howler only needs it for URL sources, while\n // Moloco's inline asset mode always supplies audio as a data URI.\n XMLHttpRequest: 'undefined',\n },\n completionDurationStart: 'ready',\n controls: hiddenControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveEmptyHtmlHead,\n runtime: 'moloco',\n },\n unity: {\n assetMode: 'inline',\n applicationMode: 'single-module',\n compileTimeDefinitions: noCompileTimeDefinitions,\n completionDurationStart: 'ready',\n controls: hiddenControls,\n endCard: fullScreenEndCard,\n loadingIndicator: 'replayable',\n resolveHtmlHead: resolveUnityHtmlHead,\n runtime: 'unity',\n },\n} satisfies Record<ReplayableNetwork, NetworkProfile>;\n\n/** Resolves the asset, document, and runtime policy owned by one variant's network. */\nexport function resolvePlayableProfile(variant: PlayableVariant): PlayableProfile {\n const profile = networkProfiles[variant.network];\n\n return {\n assetMode: profile.assetMode,\n applicationMode: profile.applicationMode,\n compileTimeDefinitions: profile.compileTimeDefinitions,\n completionDurationStart: profile.completionDurationStart,\n // Development always selects preview. Real ad networks replace authored\n // preferences completely, rather than treating them as optional overrides.\n controls: variant.network === 'preview' ? variant.controls : profile.controls,\n endCard: profile.endCard,\n htmlHead: profile.resolveHtmlHead(variant),\n loadingIndicator: profile.loadingIndicator,\n runtime: profile.runtime,\n };\n}\n\n/** Returns no document additions for networks without production head requirements. */\nfunction resolveEmptyHtmlHead(_variant: PlayableVariant): NetworkHtmlHead {\n return emptyHtmlHead;\n}\n","import { resolve } from 'node:path';\n\nimport type { PlayableVariant } from '@replayablejs/config';\nimport { normalizePath } from 'vite';\n\n/** Resolves the generated assets module selected for one playable variant. */\nexport function resolveAssetsModule(projectRoot: string, variant: PlayableVariant): string {\n return normalizePath(resolve(projectRoot, variant.assets.emit.assets));\n}\n","import { resolve } from 'node:path';\n\nimport { resolvePlayableProfile } from '#networks/network-profiles.js';\nimport { resolveAssetsModule } from '#runtime/resolve-assets-module.js';\nimport type { PlayableViteContext, PlayableViteContextOptions } from '#types/vite.js';\n\n/** Resolves every shared input needed before configuring Vite. */\nexport function createPlayableViteContext(\n options: PlayableViteContextOptions,\n): PlayableViteContext {\n return {\n entryFile: resolve(options.projectRoot, options.variant.entry),\n assetsModule: resolveAssetsModule(options.projectRoot, options.variant),\n profile: resolvePlayableProfile(options.variant),\n projectRoot: options.projectRoot,\n variant: options.variant,\n };\n}\n","import { resolve } from 'node:path';\n\nimport type { PlayableVariant } from '@replayablejs/config';\n\nimport type { ServePreviewOptions } from '#types/build.js';\nimport type { DevelopmentContext } from '#types/context.js';\nimport { createPlayableViteContext } from '#vite/create-playable-vite-context.js';\n\nconst DEFAULT_HOST = '0.0.0.0';\nconst DEFAULT_PORT = 5173;\n\n/** Resolves every path, profile, and server option needed by local development. */\nexport function createDevelopmentContext(\n variant: PlayableVariant,\n options: ServePreviewOptions,\n): DevelopmentContext {\n const projectRoot = resolve(options.projectRoot);\n const viteContext = createPlayableViteContext({ projectRoot, variant });\n\n return {\n ...viteContext,\n profile: {\n ...viteContext.profile,\n // Development keeps every generated file visible in browser network tools.\n assetMode: 'resource',\n },\n host: options.host ?? DEFAULT_HOST,\n open: options.open ?? false,\n port: options.port ?? DEFAULT_PORT,\n };\n}\n","import type { InlineConfig } from 'vite';\n\n/** Creates environment-independent Vite configuration for one Replayable project. */\nexport function createBaseViteConfig(projectRoot: string): InlineConfig {\n return {\n configFile: false,\n envDir: false,\n logLevel: 'warn',\n publicDir: false,\n root: projectRoot,\n };\n}\n","import { mergeConfig, type InlineConfig } from 'vite';\n\nimport type { DevelopmentViteConfigOptions } from '#types/vite.js';\n\nimport { createBaseViteConfig } from './create-base-vite-config.js';\n\n/** Combines the four production entry configurations into one HMR module graph. */\nexport function createDevelopmentViteConfig(options: DevelopmentViteConfigOptions): InlineConfig {\n const { application, assets, config, host } = options.entries;\n const entryConfig = [host, config, assets, application].reduce<InlineConfig>(\n (current, entry) => mergeConfig(current, entry.viteConfig),\n {},\n );\n\n return mergeConfig(\n createBaseViteConfig(options.projectRoot),\n mergeConfig(entryConfig, {\n plugins: [...(options.plugins ?? [])],\n // Vite 8's dependency resolver skips imports beginning with '#'. Forward\n // the same string aliases to Rolldown so prebundling selects the same\n // runtime bindings as the development module graph.\n optimizeDeps: {\n rolldownOptions: {\n resolve: {\n alias: Array.isArray(entryConfig.resolve?.alias)\n ? Object.fromEntries(\n entryConfig.resolve.alias.flatMap(({ find, replacement }) =>\n typeof find === 'string' ? [[find, replacement]] : [],\n ),\n )\n : entryConfig.resolve?.alias,\n },\n },\n },\n }),\n );\n}\n","import { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst buildDirectory = dirname(fileURLToPath(import.meta.resolve('@replayablejs/build')));\n\n/** Resolves one private browser module emitted beside the build package entry. */\nexport function resolveBuildRuntimeModule(modulePath: string): string {\n return resolve(buildDirectory, 'runtime', modulePath);\n}\n","import type { BuildRuntimeEntry } from '#types/runtime.js';\n\nimport { resolveBuildRuntimeModule } from './resolve-build-runtime-module.js';\n\n/** Resolves one private browser entry emitted with the build package. */\nexport function resolveBuildRuntimeEntry(entry: BuildRuntimeEntry): string {\n return resolveBuildRuntimeModule(`entries/${entry}.mjs`);\n}\n","import { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport type { PlayableVariant } from '@replayablejs/config';\n\nconst devtoolsDirectory = dirname(fileURLToPath(import.meta.resolve('@replayablejs/devtools')));\n\n/** Audio-disabled variants and production never load the sound control or its icons. */\nexport function resolveSoundControl(command: 'build' | 'serve', enabled: boolean): string {\n return resolve(\n devtoolsDirectory,\n 'sound-control',\n command === 'serve' && enabled ? 'enabled.js' : 'disabled.js',\n );\n}\n\n/** Production selects a dependency-free stub, regardless of the project's preference. */\nexport function resolveEndCardTrigger(command: 'build' | 'serve', enabled: boolean): string {\n return resolve(\n devtoolsDirectory,\n 'endcard-trigger',\n command === 'serve' && enabled ? 'enabled.js' : 'disabled.js',\n );\n}\n\n/** Selects stats before module loading; production never visits the enabled graph. */\nexport function resolveDevtoolsStats(\n command: 'build' | 'serve',\n stats: PlayableVariant['devtools']['stats'],\n): string {\n const enabled =\n command === 'serve' && stats !== false && Object.values(stats).some((value) => value === true);\n\n return resolve(devtoolsDirectory, 'stats', enabled ? 'enabled.js' : 'disabled.js');\n}\n\n/** Context registration is unnecessary unless a WebGL metric is requested in development. */\nexport function resolveWebglStats(\n command: 'build' | 'serve',\n stats: PlayableVariant['devtools']['stats'],\n): string {\n const enabled =\n command === 'serve' &&\n stats !== false &&\n (stats.drawCalls || stats.textureBinds || stats.programUses);\n\n return resolve(devtoolsDirectory, 'stats', 'webgl', enabled ? 'enabled.js' : 'disabled.js');\n}\n","import { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst runtimeDirectory = dirname(fileURLToPath(import.meta.resolve('@replayablejs/runtime')));\n\n/** Returns the enabled or no-op audio module selected for one concrete variant. */\nexport function resolveRuntimeAudio(enabled: boolean): string {\n return resolve(runtimeDirectory, 'audio', enabled ? 'enabled.js' : 'disabled.js');\n}\n","import { normalizePath } from 'vite';\n\n/** Removes Vite query metadata and normalizes a module ID for comparison. */\nexport function resolvePhysicalId(id: string): string {\n return normalizePath(id).split('?')[0] ?? id;\n}\n","import type { Plugin } from 'vite';\n\nimport type { GeneratedAssetsBoundaryPluginOptions } from '#types/vite.js';\nimport { resolvePhysicalId } from '#vite/resolve-physical-id.js';\n\n/** Prevents application code from importing the physical generated asset registry. */\nexport function createGeneratedAssetsBoundaryPlugin(\n options: GeneratedAssetsBoundaryPluginOptions,\n): Plugin {\n const allowedImporter =\n options.allowedImporter === undefined ? undefined : resolvePhysicalId(options.allowedImporter);\n const generatedAssetsModule = resolvePhysicalId(options.assetsModule);\n\n return {\n name: 'replayable:generated-assets-boundary',\n enforce: 'pre',\n\n async resolveId(source, importer) {\n if (importer === undefined) {\n return undefined;\n }\n\n const resolved = await this.resolve(source, importer, { skipSelf: true });\n\n if (resolved === null || resolvePhysicalId(resolved.id) !== generatedAssetsModule) {\n return resolved;\n }\n\n if (allowedImporter !== undefined && resolvePhysicalId(importer) === allowedImporter) {\n return resolved;\n }\n\n throw new Error(\n [\n 'The generated assets module is internal to the Replayable build.',\n 'Consume assets through playable.loader instead of importing the generated module directly.',\n ].join(' '),\n );\n },\n };\n}\n","import type { InlineConfig } from 'vite';\n\nimport { resolveBuildRuntimeModule } from '#runtime/resolve-build-runtime-module.js';\nimport {\n resolveDevtoolsStats,\n resolveWebglStats,\n resolveEndCardTrigger,\n resolveSoundControl,\n} from '#runtime/resolve-devtools.js';\nimport { resolveRuntimeAudio } from '#runtime/resolve-runtime-audio.js';\nimport type { PlayableViteContext } from '#types/vite.js';\n\nimport { createGeneratedAssetsBoundaryPlugin } from './plugins/generated-assets-boundary.js';\n\n/** Creates Vite configuration for authored application and runtime code only. */\nexport function createApplicationViteConfig(\n options: PlayableViteContext,\n assetsEntry: string,\n command: 'build' | 'serve',\n): InlineConfig {\n return {\n define: options.profile.compileTimeDefinitions,\n plugins: [\n createGeneratedAssetsBoundaryPlugin({\n allowedImporter: assetsEntry,\n assetsModule: options.assetsModule,\n }),\n ],\n resolve: {\n alias: {\n '#adapter': resolveBuildRuntimeModule('bindings/adapter.mjs'),\n '#assets': resolveBuildRuntimeModule('bindings/assets.mjs'),\n '#audio': resolveRuntimeAudio(options.variant.audio),\n '#definition': resolveBuildRuntimeModule('bindings/definition.mjs'),\n '#stats': resolveDevtoolsStats(command, options.variant.devtools.stats),\n '#endcard-trigger': resolveEndCardTrigger(command, options.variant.devtools.endCardTrigger),\n '#sound-control': resolveSoundControl(\n command,\n options.variant.audio && options.variant.devtools.soundControl,\n ),\n '#webgl-stats': resolveWebglStats(command, options.variant.devtools.stats),\n },\n },\n };\n}\n","import { extname } from 'node:path';\n\nimport type { AssetMode } from '@replayablejs/runtime/assets';\nimport type { Plugin } from 'vite';\n\nimport type { GeneratedAssetsPluginOptions, GeneratedImportKind } from '#types/vite.js';\nimport { resolvePhysicalId } from '#vite/resolve-physical-id.js';\n\nconst BINARY_EXTENSIONS = new Set([\n '.avif',\n '.glb',\n '.gltf',\n '.jpeg',\n '.jpg',\n '.m4a',\n '.mp3',\n '.ogg',\n '.png',\n '.skel',\n '.wav',\n '.webp',\n '.woff',\n '.woff2',\n]);\nconst JSON_EXTENSION = '.json';\nconst TEXT_EXTENSIONS = new Set(['.atlas', '.frag', '.glsl', '.vert']);\n\nconst INLINE_QUERY_BY_KIND = {\n binary: '?url&inline',\n json: undefined,\n text: '?raw',\n} satisfies Record<GeneratedImportKind, string | undefined>;\n\n/**\n * Applies a profile's asset policy through Vite's native import queries.\n *\n * The generated assets module stays independent of Vite and contains ordinary\n * imports such as:\n *\n * ```ts\n * import image from './resources/logo.webp';\n * import shader from './resources/frag.glsl';\n * import locale from './resources/translations.json';\n * ```\n *\n * Before Vite resolves those imports, this plugin privately attaches the query\n * that describes the required runtime representation:\n *\n * | Imported file | Inline mode | Resource mode |\n * | ------------------- | ------------- | ---------------- |\n * | Image/audio/font | `?url&inline` | `?url&no-inline` |\n * | Binary SKEL | `?url&inline` | `?url&no-inline` |\n * | GLSL/Spine atlas | `?raw` | `?url&no-inline` |\n * | JSON | ordinary JSON | `?url&no-inline` |\n *\n * Only direct imports made by the generated assets module are rewritten.\n * Authored application imports and unrelated JSON or text files retain Vite's\n * normal behavior.\n */\nexport function createGeneratedAssetsPlugin(options: GeneratedAssetsPluginOptions): Plugin {\n const assetsModule = resolvePhysicalId(options.assetsModule);\n\n return {\n name: 'replayable:generated-assets',\n enforce: 'pre',\n\n async resolveId(source, importer) {\n if (importer === undefined || resolvePhysicalId(importer) !== assetsModule) {\n return undefined;\n }\n\n const importKind = classifyGeneratedImport(source);\n\n if (importKind === undefined) {\n return undefined;\n }\n\n const query = resolveViteQuery(importKind, options.mode);\n\n // Inline JSON deliberately reaches Vite unchanged so its native JSON\n // module handling returns the parsed object.\n if (query === undefined) {\n return undefined;\n }\n\n // Resolve the rewritten import through Vite while preventing this plugin\n // from intercepting its own query-enhanced request a second time.\n return this.resolve(`${source}${query}`, importer, { skipSelf: true });\n },\n };\n}\n\n/** Classifies one physical import emitted by the generated assets module. */\nfunction classifyGeneratedImport(source: string): GeneratedImportKind | undefined {\n const extension = extname(resolvePhysicalId(source)).toLowerCase();\n\n if (BINARY_EXTENSIONS.has(extension)) {\n return 'binary';\n }\n\n if (TEXT_EXTENSIONS.has(extension)) {\n return 'text';\n }\n\n return extension === JSON_EXTENSION ? 'json' : undefined;\n}\n\n/** Selects the documented Vite query for one asset kind and delivery mode. */\nfunction resolveViteQuery(kind: GeneratedImportKind, mode: AssetMode): string | undefined {\n return mode === 'resource' ? '?url&no-inline' : INLINE_QUERY_BY_KIND[kind];\n}\n","import type { InlineConfig } from 'vite';\n\nimport type { PlayableViteContext } from '#types/vite.js';\n\nimport { createGeneratedAssetsPlugin } from './plugins/generated-assets.js';\n\n/** Creates Vite configuration for the generated assets registration only. */\nexport function createAssetsViteConfig(options: PlayableViteContext): InlineConfig {\n return {\n resolve: {\n alias: {\n '#generated-assets': options.assetsModule,\n },\n },\n plugins: [\n createGeneratedAssetsPlugin({\n assetsModule: options.assetsModule,\n mode: options.profile.assetMode,\n }),\n ],\n };\n}\n","import type { PlayableVariant } from '@replayablejs/config';\nimport type { RuntimeConfig, RuntimeDefinition } from '@replayablejs/runtime';\n\nimport type { PlayableProfile } from '#types/network.js';\n\nconst RUNTIME_DEFINITION = 'REPLAYABLE_RUNTIME_DEFINITION';\n\n/** Creates the platform-neutral value completed by the browser config entry. */\nexport function createRuntimeDefine(\n variant: PlayableVariant,\n profile: PlayableProfile,\n): Record<string, string> {\n const definition: Pick<RuntimeDefinition, 'assetMode' | 'config'> = {\n assetMode: profile.assetMode,\n config: {\n audio: variant.audio,\n backgroundColor: variant.backgroundColor,\n completion: createRuntimeCompletionConfig(variant, profile),\n controls: {\n persistentCta: profile.controls.persistentCta,\n },\n devtools: variant.devtools,\n endCard: profile.endCard,\n id: variant.id,\n localization: variant.localization,\n network: variant.network,\n params: variant.params,\n screen: variant.screen,\n store: variant.store,\n version: variant.version,\n },\n };\n\n return {\n [RUNTIME_DEFINITION]: JSON.stringify(definition),\n };\n}\n\n/** Removes disabled timers while adding the network-owned duration start policy. */\nfunction createRuntimeCompletionConfig(\n variant: PlayableVariant,\n profile: PlayableProfile,\n): RuntimeConfig['completion'] {\n const { duration, inactivity } = variant.completion;\n\n return {\n durationStart: profile.completionDurationStart,\n ...(duration === undefined ? {} : { duration }),\n ...(inactivity === undefined ? {} : { inactivity }),\n };\n}\n","import type { InlineConfig } from 'vite';\n\nimport { createRuntimeDefine } from '#runtime/create-runtime-define.js';\nimport type { PlayableViteContext } from '#types/vite.js';\n\n/** Creates Vite configuration for the resolved runtime definition only. */\nexport function createConfigViteConfig(options: PlayableViteContext): InlineConfig {\n return {\n define: createRuntimeDefine(options.variant, options.profile),\n };\n}\n","import { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport type { RuntimeHost } from '#types/network.js';\n\nconst runtimeDirectory = dirname(fileURLToPath(import.meta.resolve('@replayablejs/runtime')));\n\n/** Returns the private runtime adapter module selected by Replayable. */\nexport function resolveRuntimeAdapter(host: RuntimeHost): string {\n return resolve(runtimeDirectory, 'adapters', `${host}.js`);\n}\n","import type { InlineConfig } from 'vite';\n\nimport { resolveRuntimeAdapter } from '#runtime/resolve-runtime-adapter.js';\nimport type { PlayableViteContext } from '#types/vite.js';\n\n/** Creates Vite configuration for the profile-selected network host only. */\nexport function createHostViteConfig(options: PlayableViteContext): InlineConfig {\n return {\n resolve: {\n alias: {\n '#selected-adapter': resolveRuntimeAdapter(options.profile.runtime),\n },\n },\n };\n}\n","import { resolveBuildRuntimeEntry } from '#runtime/resolve-build-runtime-entry.js';\nimport type { PlayableViteContext, PlayableViteEntries } from '#types/vite.js';\n\nimport { createApplicationViteConfig } from './create-application-vite-config.js';\nimport { createAssetsViteConfig } from './create-assets-vite-config.js';\nimport { createConfigViteConfig } from './create-config-vite-config.js';\nimport { createHostViteConfig } from './create-host-vite-config.js';\n\n/**\n * Describes the four private module entries shared by development and production.\n *\n * Production builds each descriptor independently. Development merges their Vite\n * configuration into one live graph and serves the same inputs in execution order.\n */\nexport function createPlayableEntries(\n context: PlayableViteContext,\n command: 'build' | 'serve',\n): PlayableViteEntries {\n const assetsEntry = resolveBuildRuntimeEntry('assets');\n\n return {\n host: {\n input: resolveBuildRuntimeEntry('host'),\n viteConfig: createHostViteConfig(context),\n },\n config: {\n input: resolveBuildRuntimeEntry('config'),\n viteConfig: createConfigViteConfig(context),\n },\n assets: {\n input: assetsEntry,\n viteConfig: createAssetsViteConfig(context),\n },\n application: {\n input: context.entryFile,\n viteConfig: createApplicationViteConfig(context, assetsEntry, command),\n },\n };\n}\n","import { relative } from 'node:path';\nimport { styleText } from 'node:util';\n\nimport { normalizePath, type Plugin } from 'vite';\n\nconst UPDATE_LABELS = {\n create: 'Created',\n delete: 'Deleted',\n update: 'Updated',\n} as const;\nconst DUPLICATE_UPDATE_WINDOW = 100;\n\n/** Reports Vite file updates without exposing Vite as the public development interface. */\nexport function createDevelopmentReporterPlugin(projectRoot: string): Plugin {\n const recentUpdates = new Map<string, number>();\n\n return {\n name: 'replayable:development-reporter',\n hotUpdate(options) {\n if (this.environment.name !== 'client') {\n return;\n }\n\n const file = normalizePath(relative(projectRoot, options.file));\n const startedAt = performance.now();\n const previousUpdate = recentUpdates.get(file);\n\n // Editors may save one file through several rapid filesystem writes.\n if (previousUpdate !== undefined && startedAt - previousUpdate < DUPLICATE_UPDATE_WINDOW) {\n return;\n }\n\n recentUpdates.set(file, startedAt);\n\n setImmediate(() => {\n const duration = Math.round(performance.now() - startedAt);\n const label = styleText('green', UPDATE_LABELS[options.type].padEnd(9));\n const formattedDuration = duration === 0 ? '<1ms' : `${duration}ms`;\n const details = styleText('dim', `${file} in ${formattedDuration}`);\n\n console.log(`${label} ${details}`);\n });\n },\n };\n}\n","/** Canonical entry document produced by every Replayable build. */\nexport const PLAYABLE_HTML_FILE = 'index.html';\n","#replayable-loading-indicator {\n position: absolute;\n z-index: 1;\n display: grid;\n pointer-events: none;\n inset: 0;\n place-items: center;\n}\n\n#replayable-loading-indicator::after {\n width: 1.5rem;\n height: 1.5rem;\n border: 0.125rem solid rgba(127, 127, 127, 0.45);\n border-top-color: #ffffff;\n border-radius: 50%;\n animation: replayable-loading-spin 800ms linear infinite;\n content: \"\";\n}\n\n@keyframes replayable-loading-spin {\n to {\n transform: rotate(1turn);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n #replayable-loading-indicator::after {\n animation: none;\n }\n}","html,\nbody {\n width: 100%;\n height: 100%;\n margin: 0;\n overflow: hidden;\n overscroll-behavior: none;\n}\n\nbody {\n background-color: inherit;\n position: fixed;\n inset: 0;\n}\n\n#replayable-root {\n background-color: inherit;\n position: fixed;\n inset: 0;\n overflow: hidden;\n user-select: none;\n -webkit-user-select: none;\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: transparent;\n touch-action: none;\n}\n\n#replayable-container {\n background-color: inherit;\n position: absolute;\n overflow: hidden;\n}\n\n#replayable-root::before {\n content: \"\";\n position: absolute;\n visibility: hidden;\n pointer-events: none;\n padding: max(env(safe-area-inset-top, 0px), clamp(36px, 5svh, 44px)) max(env(safe-area-inset-right, 0px), 12px) max(env(safe-area-inset-bottom, 0px), clamp(24px, 4svh, 36px)) max(env(safe-area-inset-left, 0px), 12px);\n}\n\n#replayable-root[data-orientation=landscape]::before {\n padding: max(env(safe-area-inset-top, 0px), 12px) max(env(safe-area-inset-right, 0px), clamp(48px, 7svw, 64px)) max(env(safe-area-inset-bottom, 0px), clamp(20px, 4svh, 32px)) max(env(safe-area-inset-left, 0px), clamp(48px, 7svw, 64px));\n}","import {\n REPLAYABLE_CONTAINER_ID,\n REPLAYABLE_LOADING_INDICATOR_ID,\n REPLAYABLE_ROOT_ID,\n} from '@replayablejs/runtime/shell';\nimport { h } from 'hastscript';\n\nimport type { LoadingIndicatorOwner } from '#types/network.js';\n\nimport loadingIndicatorStyles from './loading-indicator.scss?inline';\nimport playableShellStyles from './playable-shell.scss?inline';\n\n/** Returns only the framework styles required by the active loading owner. */\nexport function resolvePlayableShellStyles(loadingIndicator: LoadingIndicatorOwner): string {\n if (loadingIndicator === 'host') {\n return playableShellStyles;\n }\n\n return `${playableShellStyles}${loadingIndicatorStyles}`;\n}\n\n/** Renders the framework mount points shared by DOM and canvas playables. */\nexport function renderPlayableShell(loadingIndicator: LoadingIndicatorOwner): ReturnType<typeof h> {\n const children = [h('div', { id: REPLAYABLE_CONTAINER_ID })];\n\n if (loadingIndicator === 'replayable') {\n children.unshift(\n h('div', {\n id: REPLAYABLE_LOADING_INDICATOR_ID,\n role: 'status',\n ariaLabel: 'Loading',\n }),\n );\n }\n\n return h('div', { id: REPLAYABLE_ROOT_ID }, children);\n}\n","import type { PlayableVariant } from '@replayablejs/config';\nimport { toHtml } from 'hast-util-to-html';\nimport { h } from 'hastscript';\n\nimport { renderPlayableShell, resolvePlayableShellStyles } from '#html/playable-shell.js';\nimport type { PlayableHtmlInitializers, PlayableHtmlResources } from '#types/html.js';\n\n/** Renders the shared playable document used by development and production. */\nexport function renderPlayableHtml(\n variant: PlayableVariant,\n resources: PlayableHtmlResources,\n): string {\n const networkMetaTags = resources.head.metaTags.map(({ name, content }) =>\n h('meta', { name, content }),\n );\n const stylesheets = resources.stylesheets.map((stylesheet) =>\n h('link', { href: stylesheet, rel: 'stylesheet' }),\n );\n const networkScripts = resources.head.scripts.map(({ src }) => h('script', { src }));\n const initializationScripts = renderInitializationScripts(resources.initializers);\n const shellStyles = resolvePlayableShellStyles(resources.loadingIndicator);\n const document = h(null, [\n { type: 'doctype' },\n h(\n 'html',\n {\n lang: variant.localization.language,\n style: { 'background-color': variant.backgroundColor },\n },\n [\n h('head', [\n h('meta', { charSet: 'UTF-8' }),\n h('meta', {\n name: 'viewport',\n content:\n 'width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover',\n }),\n ...networkMetaTags,\n h('title', variant.projectName),\n h('style', shellStyles),\n ...stylesheets,\n ...networkScripts,\n ]),\n h('body', [\n renderPlayableShell(resources.loadingIndicator),\n ...initializationScripts,\n h('script', {\n 'data-replayable-entry': 'application',\n src: resources.entry,\n type: 'module',\n }),\n ]),\n ],\n ),\n ]);\n\n return `${toHtml(document)}\\n`;\n}\n\n/** Renders scope initialization in its required execution order. */\nfunction renderInitializationScripts(\n initializers: PlayableHtmlInitializers | undefined,\n): ReturnType<typeof h>[] {\n if (initializers === undefined) {\n return [];\n }\n\n return [\n h('script', {\n 'data-replayable-entry': 'host',\n src: initializers.host,\n type: 'module',\n }),\n h('script', {\n 'data-replayable-entry': 'config',\n src: initializers.config,\n type: 'module',\n }),\n h('script', {\n 'data-replayable-entry': 'assets',\n src: initializers.assets,\n type: 'module',\n }),\n ];\n}\n","import type { PlayableVariant } from '@replayablejs/config';\nimport type { Plugin } from 'vite';\n\nimport { PLAYABLE_HTML_FILE } from '#html/playable-html.js';\nimport { renderPlayableHtml } from '#html/render-playable-html.js';\nimport type { PlayableHtmlResources } from '#types/html.js';\n\n/** Serves framework-owned HTML while leaving modules and HMR to Vite. */\nexport function createPlayableHtmlPlugin(\n variant: PlayableVariant,\n resources: PlayableHtmlResources,\n): Plugin {\n return {\n name: 'replayable:html',\n configureServer(server) {\n server.middlewares.use(async (request, response, next) => {\n if (!isHtmlRequest(request.url)) {\n next();\n\n return;\n }\n\n try {\n const source = renderPlayableHtml(variant, resources);\n const html = await server.transformIndexHtml(request.url ?? '/', source);\n\n response.statusCode = 200;\n response.setHeader('Content-Type', 'text/html; charset=utf-8');\n response.end(html);\n } catch (error) {\n next(error);\n }\n });\n },\n };\n}\n\n/** Matches only the development document, never module or asset requests. */\nfunction isHtmlRequest(requestUrl: string | undefined): boolean {\n if (requestUrl === undefined) {\n return false;\n }\n\n const pathname = new URL(requestUrl, 'http://replayable.local').pathname;\n\n return pathname === '/' || pathname === `/${PLAYABLE_HTML_FILE}`;\n}\n","import { createServer, normalizePath, type ViteDevServer } from 'vite';\n\nimport type { DevelopmentContext } from '#types/context.js';\nimport { createDevelopmentViteConfig } from '#vite/create-development-vite-config.js';\nimport { createPlayableEntries } from '#vite/create-playable-entries.js';\n\nimport { createDevelopmentReporterPlugin } from './plugins/development-reporter.js';\nimport { createPlayableHtmlPlugin } from './plugins/playable-html.js';\n\n/** Starts Vite for one resolved playable variant and its authored browser entry. */\nexport async function createDevelopmentServer(context: DevelopmentContext): Promise<ViteDevServer> {\n const entries = createPlayableEntries(context, 'serve');\n const viteConfig = createDevelopmentViteConfig({\n entries,\n projectRoot: context.projectRoot,\n plugins: [\n createPlayableHtmlPlugin(context.variant, {\n entry: toDevelopmentModuleUrl(entries.application.input),\n initializers: {\n assets: toDevelopmentModuleUrl(entries.assets.input),\n config: toDevelopmentModuleUrl(entries.config.input),\n host: toDevelopmentModuleUrl(entries.host.input),\n },\n head: context.profile.htmlHead,\n loadingIndicator: context.profile.loadingIndicator,\n stylesheets: [],\n }),\n createDevelopmentReporterPlugin(context.projectRoot),\n ],\n });\n const server = await createServer({\n ...viteConfig,\n appType: 'custom',\n server: {\n host: context.host,\n open: context.open,\n port: context.port,\n },\n });\n\n await server.listen();\n\n return server;\n}\n\n/** Converts an absolute private entry path into Vite's browser-facing filesystem URL. */\nfunction toDevelopmentModuleUrl(file: string): string {\n return `/@fs/${normalizePath(file)}`;\n}\n","import type { PlayableVariant } from '@replayablejs/config';\n\nimport type { VariantSelection } from '#types/build.js';\n\n/** Selects the preview variant that satisfies every explicit development choice. */\nexport function selectDevelopmentVariant(\n variants: readonly PlayableVariant[],\n selection: VariantSelection,\n): PlayableVariant {\n const variant = variants.find(\n (candidate) =>\n candidate.network === 'preview' &&\n (selection.version === undefined || candidate.version === selection.version) &&\n (selection.language === undefined || candidate.localization.language === selection.language),\n );\n\n if (variant === undefined) {\n throw new Error(`No configured playable variant matches ${describeSelection(selection)}.`);\n }\n\n return variant;\n}\n\n/** Produces a concise, actionable description for an invalid selection. */\nfunction describeSelection(selection: VariantSelection): string {\n return [\n `version=${selection.version ?? '*'}`,\n 'network=preview',\n `language=${selection.language ?? '*'}`,\n ].join(', ');\n}\n","import { buildAssets } from '@replayablejs/assets';\nimport { createVariants, defineConfig, type ReplayableConfigInput } from '@replayablejs/config';\n\nimport { createDevelopmentContext } from '#pipeline/create-development-context.js';\nimport type { ServePreviewOptions, ServePreviewResult } from '#types/build.js';\n\nimport { createDevelopmentServer } from './create-development-server.js';\nimport { selectDevelopmentVariant } from './select-development-variant.js';\n\n/** Builds one preview variant's assets and starts its local Vite server. */\nexport async function servePreview(\n config: ReplayableConfigInput,\n options: ServePreviewOptions,\n): Promise<ServePreviewResult> {\n const validatedConfig = defineConfig(config);\n const variants = createVariants(validatedConfig);\n const variant = selectDevelopmentVariant(variants, options);\n const context = createDevelopmentContext(variant, options);\n\n await buildAssets(context.variant.assets, context.projectRoot);\n\n const server = await createDevelopmentServer(context);\n const resolvedUrls = server.resolvedUrls;\n\n return {\n close: () => server.close(),\n localUrls: resolvedUrls?.local ?? [],\n networkUrls: resolvedUrls?.network ?? [],\n variantId: context.variant.id,\n };\n}\n","import { lstatSync, realpathSync, statSync } from 'node:fs';\nimport { dirname, isAbsolute, relative, resolve, sep } from 'node:path';\n\n/** Resolves an output path while preventing project-wide recursive deletion. */\nexport function resolveOutputDirectory(projectRoot: string, configuredPath: string): string {\n const outputDirectory = resolve(projectRoot, configuredPath);\n const projectRelativePath = relative(projectRoot, outputDirectory);\n\n if (projectRelativePath === '' || isOutsideProject(projectRelativePath)) {\n throw new Error('The build output must resolve to a directory inside the project root.');\n }\n\n // Resolve existing ancestors too: `linked/dist` may escape even when `dist`\n // does not exist yet. Return the authored path, but validate its physical target.\n const physicalRoot = realpathSync.native(projectRoot);\n const physicalOutput = resolvePhysicalPath(outputDirectory);\n const physicalRelativePath = relative(physicalRoot, physicalOutput);\n\n if (physicalRelativePath === '' || isOutsideProject(physicalRelativePath)) {\n throw new Error('The build output must resolve to a directory inside the project root.');\n }\n\n return outputDirectory;\n}\n\n/** Resolves symlinks in the nearest existing ancestor of a future output path. */\nfunction resolvePhysicalPath(path: string): string {\n if (lstatSync(path, { throwIfNoEntry: false }) !== undefined) {\n // Dangling links and permission errors must fail, not bypass the safety check.\n const physicalPath = realpathSync.native(path);\n if (!statSync(physicalPath).isDirectory()) {\n throw new Error(`ENOTDIR: build output ancestor is not a directory: ${path}`);\n }\n return physicalPath;\n }\n\n const parent = dirname(path);\n return resolve(resolvePhysicalPath(parent), relative(parent, path));\n}\n\n/** Identifies relative paths that resolve beyond their intended parent directory. */\nfunction isOutsideProject(relativePath: string): boolean {\n return relativePath === '..' || relativePath.startsWith(`..${sep}`) || isAbsolute(relativePath);\n}\n","import { writeFile } from 'node:fs/promises';\n\nimport { renderPlayableHtml } from '#html/render-playable-html.js';\nimport type { BundleOutput } from '#types/bundle.js';\nimport type { BuildContext } from '#types/context.js';\n\n/** Writes the runnable HTML document into its prepared variant output. */\nexport async function emitPlayableHtml(context: BuildContext, bundle: BundleOutput): Promise<void> {\n const source = renderPlayableHtml(context.variant, {\n entry: `./${bundle.entries.application}`,\n head: context.profile.htmlHead,\n initializers: {\n assets: `./${bundle.entries.assets}`,\n config: `./${bundle.entries.config}`,\n host: `./${bundle.entries.host}`,\n },\n loadingIndicator: context.profile.loadingIndicator,\n stylesheets: bundle.stylesheets.map((stylesheet) => `./${stylesheet}`),\n });\n\n await writeFile(context.htmlFile, source, 'utf8');\n}\n","import { join, resolve } from 'node:path';\n\nimport type { PlayableVariant } from '@replayablejs/config';\n\nimport { PLAYABLE_HTML_FILE } from '#html/playable-html.js';\nimport type { BuildVariantOptions } from '#types/build.js';\nimport type { BuildContext } from '#types/context.js';\nimport { createPlayableViteContext } from '#vite/create-playable-vite-context.js';\n\nimport { resolveOutputDirectory } from './resolve-output-directory.js';\n\n/** Resolves every authored and generated path needed to build one variant. */\nexport function createBuildContext(\n variant: PlayableVariant,\n options: BuildVariantOptions,\n): BuildContext {\n const projectRoot = resolve(options.projectRoot);\n const outputDirectory = resolveOutputDirectory(projectRoot, options.outputDirectory);\n const viteContext = createPlayableViteContext({\n projectRoot,\n variant,\n });\n\n return {\n ...viteContext,\n outputDirectory,\n htmlFile: join(outputDirectory, PLAYABLE_HTML_FILE),\n };\n}\n","/** Minimum browser engines supported by compiled playable output. */\nexport const PLAYABLE_BROWSER_TARGETS = ['ios16.1', 'chrome105'] as const;\n","import type { Rolldown } from 'vite';\n\nimport type {\n BundleEntries,\n BundleEntryOutputs,\n BundleOutput,\n EntryOutput,\n EntryRole,\n} from '#types/bundle.js';\nimport type { ApplicationMode } from '#types/network.js';\n\nconst STYLESHEET_EXTENSION = '.css';\n\nconst standaloneEntryRoles = ['host', 'config', 'assets'] as const;\nconst entryRoles: readonly EntryRole[] = [...standaloneEntryRoles, 'application'];\n\n/** Combines four role-specific Rolldown results into one HTML-facing description. */\nexport function createBundleOutput(\n outputs: BundleEntryOutputs,\n applicationMode: ApplicationMode,\n): BundleOutput {\n const entries: BundleEntries = {\n host: requireEntryFile(outputs.host, 'host'),\n config: requireEntryFile(outputs.config, 'config'),\n assets: requireEntryFile(outputs.assets, 'assets'),\n application: requireEntryFile(outputs.application, 'application'),\n };\n\n validateBundleContract(outputs, entries, applicationMode);\n\n const emittedAssets = Object.values(outputs)\n .flat()\n .filter((chunkOrAsset) => chunkOrAsset.type === 'asset');\n const applicationChunks = outputs.application.filter(\n (chunkOrAsset) => chunkOrAsset.type === 'chunk' && !chunkOrAsset.isEntry,\n );\n\n return {\n entries,\n chunks: applicationChunks.map(({ fileName }) => fileName).sort(),\n stylesheets: collectAssetFiles(emittedAssets, true),\n resources: collectAssetFiles(emittedAssets, false),\n };\n}\n\n/** Enforces the entry isolation required by the runtime registration protocol. */\nfunction validateBundleContract(\n outputs: BundleEntryOutputs,\n entries: BundleEntries,\n applicationMode: ApplicationMode,\n): void {\n const entryFiles = Object.values(entries);\n\n if (new Set(entryFiles).size !== entryFiles.length) {\n throw new Error(`Playable entry filenames must be unique; received ${entryFiles.join(', ')}.`);\n }\n\n for (const role of standaloneEntryRoles) {\n assertStandaloneEntry(outputs[role], role);\n }\n\n if (applicationMode === 'single-module') {\n assertStandaloneEntry(outputs.application, 'application');\n }\n\n for (const role of entryRoles) {\n assertNoCrossEntryImports(outputs[role], role, entries);\n }\n}\n\n/** Requires a role configured without code splitting to emit exactly one chunk. */\nfunction assertStandaloneEntry(output: EntryOutput, role: EntryRole): void {\n const chunks = output.filter((chunkOrAsset) => chunkOrAsset.type === 'chunk');\n\n if (chunks.length !== 1) {\n throw new Error(\n `Expected standalone ${role} entry to emit one chunk, received ${chunks.length}.`,\n );\n }\n}\n\n/** Rejects dependencies on another private entry while permitting application chunks. */\nfunction assertNoCrossEntryImports(\n output: EntryOutput,\n role: EntryRole,\n entries: BundleEntries,\n): void {\n const forbiddenEntryFiles = new Set(\n Object.entries(entries)\n .filter(([entryRole]) => entryRole !== role)\n .map(([, entryFile]) => entryFile),\n );\n\n for (const chunk of output) {\n if (chunk.type !== 'chunk') {\n continue;\n }\n\n const importedFiles = [...chunk.imports, ...chunk.dynamicImports];\n const forbiddenImport = importedFiles.find((file) => forbiddenEntryFiles.has(file));\n\n if (forbiddenImport !== undefined) {\n throw new Error(`Playable ${role} entry imports private entry ${forbiddenImport}.`);\n }\n }\n}\n\n/** Returns the one entry emitted by a role-specific build. */\nfunction requireEntryFile(output: Rolldown.RolldownOutput['output'], role: string): string {\n const entryFiles = output\n .filter((chunkOrAsset) => chunkOrAsset.type === 'chunk' && chunkOrAsset.isEntry)\n .map(({ fileName }) => fileName);\n const entryFile = entryFiles[0];\n\n if (entryFile === undefined || entryFiles.length !== 1) {\n throw new Error(`Expected one ${role} entry, received ${entryFiles.length}.`);\n }\n\n return entryFile;\n}\n\n/** Collects unique stylesheet or non-stylesheet asset paths in stable order. */\nfunction collectAssetFiles(\n assets: readonly Rolldown.OutputAsset[],\n stylesheets: boolean,\n): string[] {\n return [\n ...new Set(\n assets\n .filter(({ fileName }) => fileName.endsWith(STYLESHEET_EXTENSION) === stylesheets)\n .map(({ fileName }) => fileName),\n ),\n ].sort();\n}\n","import { existsSync, readFileSync, realpathSync } from 'node:fs';\nimport { dirname, isAbsolute, join, parse } from 'node:path';\n\nimport type { ApplicationModuleGraph, PackageInstance } from '#types/module-graph.js';\n\n/**\n * Browser packages whose state or object identity cannot safely be duplicated.\n *\n * This list is intentionally local to `@replayablejs/build`: unlike the repository\n * dependency check, this validator ships to consumers and must work independently.\n */\nconst SINGLETON_PACKAGES = [\n '@esotericsoftware/spine-core',\n '@esotericsoftware/spine-pixi-v8',\n '@replayablejs/runtime',\n 'motion',\n 'motion-dom',\n 'pixi.js',\n] as const;\n\n/**\n * Rejects singleton packages bundled from more than one physical installation.\n *\n * Rolldown may include the same package in several chunks; those modules are\n * valid when their nearest package.json resolves to the same real directory.\n * Distinct directories indicate separate caches, class identities, or frame\n * schedulers that cannot safely coexist inside one playable application.\n *\n * Only the application build belongs here. Replayable deliberately builds host,\n * config, and assets as separate executable entries; combining all four module\n * graphs would confuse that isolation with duplicate browser package instances.\n *\n * A protected package may be absent—for example, a DOM-only playable contains\n * no PixiJS. Presence is enforced by authored imports; this function only rejects\n * multiple installations of a package that actually entered the application.\n */\nexport function validateApplicationModuleGraph(output: ApplicationModuleGraph): void {\n const packageInstances = new Map<string, Set<string>>();\n const packageCache = new Map<string, PackageInstance | null>();\n\n for (const chunkOrAsset of output) {\n // Assets contain emitted bytes but no Rolldown module ownership information.\n if (chunkOrAsset.type !== 'chunk') {\n continue;\n }\n\n // `modules` includes every source contributing to this chunk. The same module\n // may appear in graph reporting more than once, so physical paths enter Sets.\n for (const moduleId of Object.keys(chunkOrAsset.modules)) {\n const packageInstance = resolvePackageInstance(moduleId, packageCache);\n\n if (!isSingletonPackage(packageInstance?.name)) {\n continue;\n }\n\n const instances = packageInstances.get(packageInstance.name) ?? new Set<string>();\n\n instances.add(packageInstance.directory);\n packageInstances.set(packageInstance.name, instances);\n }\n }\n\n for (const packageName of SINGLETON_PACKAGES) {\n const instances = packageInstances.get(packageName);\n\n if (instances !== undefined && instances.size > 1) {\n throw new Error(\n `Playable application contains multiple ${packageName} instances: ${[...instances].join(\n ', ',\n )}.`,\n );\n }\n }\n}\n\n/** Resolves the nearest package.json that owns one filesystem-backed module. */\nfunction resolvePackageInstance(\n moduleId: string,\n cache: Map<string, PackageInstance | null>,\n): PackageInstance | null {\n // Vite queries describe alternate transforms of the same source file and are\n // not part of its filesystem location (`sprite.png?url`, `module.ts?raw`).\n const filePath = moduleId.replace(/[?#].*$/, '');\n\n // Rolldown also reports virtual module IDs. They have no owning package.json\n // and therefore cannot establish a second physical package installation.\n if (!isAbsolute(filePath)) {\n return null;\n }\n\n let directory = dirname(filePath);\n const visitedDirectories: string[] = [];\n\n while (directory !== parse(directory).root) {\n const cachedInstance = cache.get(directory);\n\n // `null` is deliberately cached as well. `has()` distinguishes a completed\n // negative lookup from a directory that has not been inspected yet.\n if (cachedInstance !== undefined || cache.has(directory)) {\n cacheDirectories(visitedDirectories, cachedInstance ?? null, cache);\n return cachedInstance ?? null;\n }\n\n visitedDirectories.push(directory);\n\n const manifestPath = join(directory, 'package.json');\n\n if (existsSync(manifestPath)) {\n // The nearest manifest owns the module. Walking beyond it could incorrectly\n // attribute an application source file to a parent workspace package.\n const manifest: unknown = JSON.parse(readFileSync(manifestPath, 'utf8'));\n const packageInstance = readPackageInstance(manifest, directory);\n\n cacheDirectories(visitedDirectories, packageInstance, cache);\n return packageInstance;\n }\n\n directory = dirname(directory);\n }\n\n cacheDirectories(visitedDirectories, null, cache);\n return null;\n}\n\n/**\n * Retains one package lookup for every traversed directory.\n *\n * Many modules share nested directories. Caching the whole walk prevents repeated\n * filesystem traversal for every file in a large dependency such as PixiJS.\n */\nfunction cacheDirectories(\n directories: readonly string[],\n packageInstance: PackageInstance | null,\n cache: Map<string, PackageInstance | null>,\n): void {\n for (const directory of directories) {\n cache.set(directory, packageInstance);\n }\n}\n\n/** Reads only the package identity required by singleton validation. */\nfunction readPackageInstance(manifest: unknown, directory: string): PackageInstance | null {\n if (\n typeof manifest !== 'object' ||\n manifest === null ||\n !('name' in manifest) ||\n typeof manifest.name !== 'string'\n ) {\n return null;\n }\n\n return {\n // Different symlink spellings of one pnpm/workspace package must compare equal.\n directory: realpathSync.native(directory),\n name: manifest.name,\n };\n}\n\n/** Narrows an arbitrary package name to the protected singleton set. */\nfunction isSingletonPackage(name: string | undefined): name is string {\n return name !== undefined && SINGLETON_PACKAGES.some((packageName) => packageName === name);\n}\n","import { build, type Rolldown } from 'vite';\n\nimport { PLAYABLE_BROWSER_TARGETS } from '#browser-targets';\nimport type { BundleOutput, EntryBuildOptions } from '#types/bundle.js';\nimport type { BuildContext } from '#types/context.js';\nimport type { PlayableViteEntry } from '#types/vite.js';\nimport { createBaseViteConfig } from '#vite/create-base-vite-config.js';\nimport { createPlayableEntries } from '#vite/create-playable-entries.js';\n\nimport { createBundleOutput } from './create-bundle-output.js';\nimport { validateApplicationModuleGraph } from './validate-application-module-graph.js';\n\n/** Builds independently executable host, config, assets, and application entries. */\nexport async function bundleVariant(context: BuildContext): Promise<BundleOutput> {\n const entries = createPlayableEntries(context, 'build');\n const hostOutput = await buildEntry(context, entries.host, {\n emptyOutputDirectory: true,\n output: {\n codeSplitting: false,\n format: 'es',\n },\n });\n const configOutput = await buildEntry(context, entries.config, {\n emptyOutputDirectory: false,\n output: {\n codeSplitting: false,\n format: 'es',\n },\n });\n const assetsOutput = await buildEntry(context, entries.assets, {\n emptyOutputDirectory: false,\n output: {\n codeSplitting: false,\n format: 'es',\n },\n });\n const applicationOutput = await buildEntry(context, entries.application, {\n emptyOutputDirectory: false,\n output: {\n codeSplitting: context.profile.applicationMode === 'module-graph',\n format: 'es',\n },\n });\n\n validateApplicationModuleGraph(applicationOutput);\n\n return createBundleOutput(\n {\n host: hostOutput,\n config: configOutput,\n assets: assetsOutput,\n application: applicationOutput,\n },\n context.profile.applicationMode,\n );\n}\n\n/** Runs one role-specific Vite build into the shared variant directory. */\nasync function buildEntry(\n context: BuildContext,\n entry: PlayableViteEntry,\n options: EntryBuildOptions,\n): Promise<Rolldown.RolldownOutput['output']> {\n const buildResult = await build({\n ...createBaseViteConfig(context.projectRoot),\n ...entry.viteConfig,\n base: './',\n build: {\n assetsInlineLimit: context.profile.assetMode === 'inline' ? Infinity : 0,\n // Playable profiles intentionally keep large entries together. Export\n // validation checks delivery size; Vite's web-app chunk heuristic does not.\n chunkSizeWarningLimit: Infinity,\n cssTarget: [...PLAYABLE_BROWSER_TARGETS],\n emptyOutDir: options.emptyOutputDirectory,\n outDir: context.outputDirectory,\n rolldownOptions: {\n input: entry.input,\n // Never ship output that Rolldown or Oxc could not confidently produce.\n // In particular, this turns target-compatibility warnings into build failures.\n onLog(level, log, defaultHandler): void {\n defaultHandler(level === 'warn' ? 'error' : level, log);\n },\n output: options.output,\n },\n target: [...PLAYABLE_BROWSER_TARGETS],\n },\n });\n\n if (!('output' in buildResult)) {\n throw new Error('Vite did not return a single playable build output.');\n }\n\n return buildResult.output;\n}\n","import { buildAssets } from '@replayablejs/assets';\nimport type { PlayableVariant } from '@replayablejs/config';\n\nimport { emitPlayableHtml } from '#html/emit-playable-html.js';\nimport { createBuildContext } from '#pipeline/create-build-context.js';\nimport type { BuildVariantOptions, BuildVariantResult } from '#types/build.js';\n\nimport { bundleVariant } from './bundle-variant.js';\n\n/**\n * Produces one runnable playable from a concrete configuration variant.\n *\n * @param variant - Fully resolved version, network, and language combination.\n * @param options - Explicit project root and variant output directory.\n */\nexport async function buildVariant(\n variant: PlayableVariant,\n options: BuildVariantOptions,\n): Promise<BuildVariantResult> {\n const context = createBuildContext(variant, options);\n const assets = await buildAssets(context.variant.assets, context.projectRoot);\n\n const bundle = await bundleVariant(context);\n\n await emitPlayableHtml(context, bundle);\n\n return {\n assets,\n htmlFile: context.htmlFile,\n outputDirectory: context.outputDirectory,\n variantId: context.variant.id,\n };\n}\n","import { rm } from 'node:fs/promises';\nimport { join, resolve } from 'node:path';\n\nimport { buildAssets } from '@replayablejs/assets';\nimport { createVariants, defineConfig, type ReplayableConfigInput } from '@replayablejs/config';\n\nimport { resolveOutputDirectory } from '#pipeline/resolve-output-directory.js';\nimport type { BuildProjectResult } from '#types/build.js';\n\nimport { buildVariant } from './build-variant.js';\n\n/**\n * Builds every concrete variant configured by one Replayable project.\n *\n * Variants are built sequentially because their asset builds share generated\n * source paths. The project output is reset once so variants removed from the\n * configuration cannot leave stale playable directories behind.\n * The first variant is restored afterward as a deterministic baseline. This\n * does not isolate an active preview: build and development share asset paths.\n *\n * @param config - Human-authored or already validated Replayable configuration.\n * @param workingDirectory - Project directory used to resolve authored paths.\n */\nexport async function buildProject(\n config: ReplayableConfigInput,\n workingDirectory = process.cwd(),\n): Promise<BuildProjectResult> {\n const validatedConfig = defineConfig(config);\n const projectRoot = resolve(workingDirectory);\n const outputDirectory = resolveOutputDirectory(projectRoot, validatedConfig.build.outDir);\n const configuredVariants = createVariants(validatedConfig);\n const canonicalVariant = configuredVariants[0];\n const variants = [];\n const errors: unknown[] = [];\n\n if (canonicalVariant === undefined) {\n throw new Error('A Replayable project must resolve at least one playable variant.');\n }\n\n await rm(outputDirectory, { force: true, recursive: true });\n\n try {\n for (const variant of configuredVariants) {\n variants.push(\n await buildVariant(variant, {\n outputDirectory: join(outputDirectory, variant.id),\n projectRoot,\n }),\n );\n }\n } catch (error) {\n errors.push(error);\n }\n\n try {\n // Restore a deterministic baseline, not the active preview's selection.\n // Builds share generated paths with development; running both concurrently\n // is not isolated, even when this final restoration succeeds.\n await buildAssets(canonicalVariant.assets, projectRoot);\n } catch (error) {\n errors.push(error);\n }\n\n if (errors.length === 1) {\n throw errors[0];\n }\n\n if (errors.length > 1) {\n throw new AggregateError(errors, 'Playable build and generated asset restoration both failed.');\n }\n\n return {\n outputDirectory,\n variants,\n };\n}\n"],"mappings":";;;;;;;;;;;;AAIA,MAAM,eAAe;;AAGrB,SAAgB,sBAAsB,SAA2C;CAC/E,OAAO;EACL,UAAU,CACR;GACE,MAAM;GACN,SAAS,mBAAmB,QAAQ,OAAO,YAAY;EACzD,CACF;EACA,SAAS,CAAC,EAAE,KAAK,aAAa,CAAC;CACjC;AACF;;AAGA,SAAS,mBAAmB,cAAiE;CAC3F,MAAM,EAAE,WAAW,aAAa;CAEhC,IAAI,UAAU,WAAW,SAAS,SAChC,OAAO;CAGT,OAAO,SAAS,UAAU,aAAa;AACzC;;;AC1BA,MAAM,gBAAiC;CACrC,UAAU,CAAC;CACX,SAAS,CAAC,EAAE,KAAK,WAAW,CAAC;AAC/B;;AAGA,SAAgB,uBAAwC;CACtD,OAAO;AACT;;;ACHA,MAAM,oBAAoB;CAAE,WAAW;CAAc,aAAa;AAAc;AAChF,MAAM,iBAAiB;CAAE,WAAW;CAAU,aAAa;AAAW;AACtE,MAAM,kBAAkB,EAAE,eAAe,KAAK;AAC9C,MAAM,iBAAiB,EAAE,eAAe,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BAAuB,aAAa,gBAAgB,MAAM,MAAM;CACxF,MAAM,qBAAqB,eAAe,eAAe;CACzD,MAAM,mBAAmB,mBAAmB;CAC5C,MAAM,WAAW,CAAC;CAClB,MAAM,SAAoB,CAAC;CAE3B,IAAI,qBAAqB,KAAA,GACvB,MAAM,IAAI,MAAM,kEAAkE;CAGpF,MAAM,GAAG,iBAAiB;EAAE,OAAO;EAAM,WAAW;CAAK,CAAC;CAE1D,IAAI;EACF,KAAK,MAAM,WAAW,oBACpB,SAAS,KACP,MAAM,aAAa,SAAS;GAC1B,iBAAiB,KAAK,iBAAiB,QAAQ,EAAE;GACjD;EACF,CAAC,CACH;CAEJ,SAAS,OAAO;EACd,OAAO,KAAK,KAAK;CACnB;CAEA,IAAI;EAIF,MAAM,YAAY,iBAAiB,QAAQ,WAAW;CACxD,SAAS,OAAO;EACd,OAAO,KAAK,KAAK;CACnB;CAEA,IAAI,OAAO,WAAW,GACpB,MAAM,OAAO;CAGf,IAAI,OAAO,SAAS,GAClB,MAAM,IAAI,eAAe,QAAQ,6DAA6D;CAGhG,OAAO;EACL;EACA;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replayablejs/build",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"description": "Playable ad build orchestration for Replayable",
|
|
5
5
|
"homepage": "https://github.com/replayablejs/replayable#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"hast-util-to-html": "9.0.5",
|
|
42
42
|
"hastscript": "9.0.1",
|
|
43
43
|
"vite": "8.2.1",
|
|
44
|
-
"@replayablejs/assets": "0.1.0-alpha.
|
|
45
|
-
"@replayablejs/
|
|
46
|
-
"@replayablejs/
|
|
47
|
-
"@replayablejs/
|
|
44
|
+
"@replayablejs/assets": "0.1.0-alpha.2",
|
|
45
|
+
"@replayablejs/config": "0.1.0-alpha.2",
|
|
46
|
+
"@replayablejs/devtools": "0.1.0-alpha.2",
|
|
47
|
+
"@replayablejs/runtime": "0.1.0-alpha.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@tsdown/css": "0.22.14",
|