@replayablejs/export 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +29 -0
- package/dist/browser/compressed-module-loader.js +44 -0
- package/dist/index.d.mts +38 -0
- package/dist/index.mjs +1174 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["ENTRY_ATTRIBUTE","validateArchivePaths","validateDocument"],"sources":["../src/shared/filesystem-error.ts","../src/shared/canonical-path.ts","../src/emission/write-export-artifacts.ts","../src/emission/emit-export-project.ts","../src/shared/export-limits.ts","../src/shared/export-file-reference.ts","../src/validation/resource-references.ts","../src/shared/playable-html.ts","../src/validation/stylesheet-resources.ts","../src/validation/single-html.ts","../src/preparation/shared/collect-build-files.ts","../src/preparation/shared/compress-javascript.ts","../src/validation/build-entries.ts","../src/preparation/shared/prepare-javascript.ts","../src/preparation/shared/prepare-classic-javascript.ts","../src/preparation/shared/prepare-stylesheet.ts","../src/preparation/shared/html-document.ts","../src/shared/compression-protocol.ts","../src/preparation/shared/load-compressed-module-loader.ts","../src/preparation/shared/inline-compressed-modules.ts","../src/preparation/shared/load-pako-inflater.ts","../src/preparation/shared/inline-pako-inflater.ts","../src/preparation/shared/single-html.ts","../src/preparation/networks/applovin.ts","../src/validation/networks/google.ts","../src/preparation/shared/create-zip-archive.ts","../src/preparation/networks/google.ts","../src/validation/networks/liftoff.ts","../src/preparation/networks/liftoff.ts","../src/preparation/networks/meta.ts","../src/validation/networks/mintegral.ts","../src/preparation/networks/mintegral.ts","../src/validation/browser-redirects.ts","../src/validation/networks/moloco.ts","../src/preparation/networks/moloco.ts","../src/preparation/networks/preview.ts","../src/preparation/networks/unity.ts","../src/preparation/prepare-export-project.ts","../src/resolution/resolve-export-directories.ts","../src/resolution/resolve-export-variant.ts","../src/resolution/resolve-export-project.ts","../src/pipeline/export-project.ts"],"sourcesContent":["/** Reports whether a filesystem operation failed because its target path is absent. */\nexport function isMissingPathError(error: unknown): boolean {\n return error instanceof Error && 'code' in error && error.code === 'ENOENT';\n}\n","import { realpath } from 'node:fs/promises';\nimport { basename, dirname, resolve } from 'node:path';\n\nimport { isMissingPathError } from './filesystem-error.js';\n\n/**\n * Resolves symlinks in the existing portion of a path.\n *\n * Generated directories commonly do not exist yet. In that case, the nearest\n * existing ancestor is canonicalized and the missing path segments are appended\n * unchanged. For example, if \"generated\" is a symlink, resolving\n * \"generated/exports\" exposes its real destination before cleanup can use it.\n */\nexport async function resolveCanonicalPath(path: string): Promise<string> {\n const missingSegments: string[] = [];\n let existingPath = path;\n\n while (true) {\n try {\n const canonicalPath = await realpath(existingPath);\n\n return resolve(canonicalPath, ...missingSegments);\n } catch (error) {\n if (!isMissingPathError(error)) {\n throw error;\n }\n }\n\n const parent = dirname(existingPath);\n\n if (parent === existingPath) {\n throw new Error(`Unable to resolve an existing ancestor for generated path: ${path}.`);\n }\n\n missingSegments.unshift(basename(existingPath));\n existingPath = parent;\n }\n}\n","import { mkdir, mkdtemp, rename, rm, writeFile } from 'node:fs/promises';\nimport { basename, dirname, join } from 'node:path';\n\nimport { resolveCanonicalPath } from '#shared/canonical-path.js';\nimport { isMissingPathError } from '#shared/filesystem-error.js';\nimport type { PreparedExportArtifact } from '#types/artifact.js';\n\n/**\n * Writes every prepared artifact before replacing the last successful export directory.\n *\n * The caller has already prepared the HTML/ZIP bytes and resolved unique, flat\n * output filenames. This function only handles filesystem delivery; it does not\n * build, compress, validate, or rename individual network artifacts.\n *\n * Delivery has three stages:\n * 1. Write all new files into a temporary sibling directory. Existing exports stay\n * untouched while those writes run, including when a write fails.\n * 2. Move the existing export directory into a backup, then move the completed\n * replacement into its final location. Old files are replaced as a set, not merged.\n * 3. Remove the temporary directory and the now-obsolete backup after success.\n *\n * If installing the replacement fails, restore the backup before rejecting. If\n * restoration also fails, keep the backup and report its path in an AggregateError\n * containing both failures. Cleanup must never delete that remaining recovery copy.\n *\n * This is recovery for awaited filesystem failures, not a crash-safe transaction\n * or a lock against concurrent exporters. The destination is briefly absent between\n * the two renames; process termination during that interval cannot run rollback.\n *\n * @param outputDirectory - Canonical absolute destination resolved by the export pipeline.\n * @param artifacts - Complete replacement set, with unique filenames assigned by resolution.\n * An empty set intentionally produces an empty export directory.\n *\n * @example Temporary paths when replacing a project's `exports` directory:\n * ```text\n * basic-playable/\n * exports/ Previous delivery files, until replacement starts\n * .exports-staging-<unique>/ Temporary sibling owned by this operation\n * prepared/ New applovin_default_en.html, google_default_en.zip, ...\n * previous/ Old exports, moved here immediately before replacement\n * ```\n * On success, `prepared` becomes `exports`, and the temporary sibling is removed.\n */\nexport async function writeExportArtifacts(\n outputDirectory: string,\n artifacts: readonly PreparedExportArtifact[],\n): Promise<void> {\n const parent = dirname(outputDirectory);\n // Resolution already checked this destination. Check again before creating\n // temporary files, in case an intermediate directory has become a symlink.\n await assertOutputDirectoryUnchanged(outputDirectory);\n await mkdir(parent, { recursive: true });\n // A unique sibling keeps temporary files out of the delivery directory and\n // ordinarily on the same filesystem, allowing directory renames rather than copies.\n const stagingDirectory = await mkdtemp(join(parent, `.${basename(outputDirectory)}-staging-`));\n const preparedDirectory = join(stagingDirectory, 'prepared');\n const backupDirectory = join(stagingDirectory, 'previous');\n // This is a cleanup guard, not an indication that a previous export exists.\n // It becomes true only when rollback fails and the backup must remain recoverable.\n let preserveBackup = false;\n\n try {\n await mkdir(preparedDirectory);\n // Only the basename is used: resolution has already assigned unique flat names.\n // Sequential writes ensure no pending write can race cleanup after a failure.\n // Until all writes finish, the existing destination is never moved or deleted.\n for (const artifact of artifacts) {\n await writeFile(join(preparedDirectory, basename(artifact.outputFile)), artifact.content);\n }\n\n // Writing may take time. Recheck the destination before moving the old exports.\n await assertOutputDirectoryUnchanged(outputDirectory);\n const hasPreviousExport = await movePreviousExport(outputDirectory, backupDirectory);\n\n try {\n // All new files are complete. Publish the entire prepared directory at once.\n await rename(preparedDirectory, outputDirectory);\n } catch (error) {\n if (hasPreviousExport) {\n try {\n // Replacement failed after the old directory moved aside. Put it back\n // at the original path so the last successful exports remain usable.\n await rename(backupDirectory, outputDirectory);\n } catch (restoreError) {\n preserveBackup = true;\n // Both failures are preserved as members; neither replaces the other.\n // oxlint-disable-next-line preserve-caught-error\n throw new AggregateError(\n [error, restoreError],\n `Export replacement failed. Previous exports remain at ${backupDirectory}.`,\n { cause: restoreError },\n );\n }\n }\n // Successful rollback does not make this export successful. Report the\n // replacement error; on a first export, there was simply nothing to restore.\n throw error;\n }\n } finally {\n if (!preserveBackup) {\n // Success: remove the obsolete backup. Write/replacement failure: remove\n // incomplete new files. After successful rollback, the old files are already\n // outside this directory again. Cleanup failures still reject the operation.\n await rm(stagingDirectory, { recursive: true, force: true });\n }\n }\n}\n\n/**\n * Moves an existing destination into the operation's backup directory.\n *\n * Returns true only after the move succeeds, allowing the caller to attempt rollback.\n * A missing path returns false (normally the first export). Permission, device, and\n * other filesystem errors propagate; they must not be treated as an absent export.\n */\nasync function movePreviousExport(\n outputDirectory: string,\n backupDirectory: string,\n): Promise<boolean> {\n try {\n await rename(outputDirectory, backupDirectory);\n return true;\n } catch (error) {\n if (isMissingPathError(error)) {\n return false;\n }\n throw error;\n }\n}\n\n/**\n * Detects a symlink introduced after resolution and before directory replacement.\n *\n * Resolution stores the canonical destination. Resolving it again immediately\n * before staging and replacement detects an intermediate path redirected since then.\n * Reject rather than move a directory belonging to that new target. This check\n * does not lock the path or prevent another process changing it after the check.\n */\nasync function assertOutputDirectoryUnchanged(outputDirectory: string): Promise<void> {\n const currentOutputDirectory = await resolveCanonicalPath(outputDirectory);\n\n if (currentOutputDirectory !== outputDirectory) {\n throw new Error(`Refusing to clean a redirected export directory: ${outputDirectory}.`);\n }\n}\n","import type { PreparedExportArtifact } from '#types/artifact.js';\nimport type { ExportProjectContext } from '#types/context.js';\nimport type { ExportProjectResult, ExportVariantResult } from '#types/export.js';\n\nimport { writeExportArtifacts } from './write-export-artifacts.js';\n\n/** Writes prepared artifacts safely, then reports their committed destinations. */\nexport async function emitExportProject(\n project: ExportProjectContext,\n artifacts: readonly PreparedExportArtifact[],\n): Promise<ExportProjectResult> {\n await writeExportArtifacts(project.outputDirectory, artifacts);\n\n return {\n outputDirectory: project.outputDirectory,\n variants: artifacts.map(describeExportArtifact),\n };\n}\n\n/** Reports the committed artifact's final path and byte size. */\nfunction describeExportArtifact(artifact: PreparedExportArtifact): ExportVariantResult {\n const { content, outputFile, variantId } = artifact;\n\n return {\n file: outputFile,\n size: measureArtifact(content),\n variantId,\n };\n}\n\n/** Measures text and binary artifacts in the bytes reported by the filesystem. */\nfunction measureArtifact(content: string | Uint8Array): number {\n return typeof content === 'string' ? Buffer.byteLength(content) : content.byteLength;\n}\n","/** Maximum delivery size in bytes; Liftoff applies this to entry HTML. */\nexport const MAX_EXPORT_SIZE_BYTES = 5_000_000;\n\n/** Maximum number of files in a Google delivery archive. */\nexport const GOOGLE_MAX_ARCHIVE_FILE_COUNT = 512;\n\n/** Moloco requires a strictly smaller delivery; other networks include the limit. */\nexport function isWithinExportSizeLimit(bytes: number, network: string): boolean {\n return network === 'moloco' ? bytes < MAX_EXPORT_SIZE_BYTES : bytes <= MAX_EXPORT_SIZE_BYTES;\n}\n","import { posix } from 'node:path';\n\n/** Converts a relative document URL into its normalized export-file path. */\nexport function resolveExportFileReference(reference: string): string | undefined {\n if (\n reference === '' ||\n reference.startsWith('//') ||\n reference.startsWith('/') ||\n /^[a-z][a-z\\d+.-]*:/iu.test(reference)\n ) {\n return undefined;\n }\n\n const encodedPath = reference.split(/[?#]/u, 1)[0];\n\n if (encodedPath === undefined || encodedPath === '') {\n return undefined;\n }\n\n let decodedPath: string;\n\n try {\n decodedPath = decodeURIComponent(encodedPath);\n } catch {\n return undefined;\n }\n\n const exportFilePath = posix.normalize(decodedPath);\n\n if (\n exportFilePath === '..' ||\n exportFilePath.startsWith('../') ||\n posix.isAbsolute(exportFilePath)\n ) {\n return undefined;\n }\n\n return exportFilePath;\n}\n","import type { CheerioAPI } from 'cheerio';\n\nimport { resolveExportFileReference } from '#shared/export-file-reference.js';\n\nconst RESOURCE_SELECTOR = '[src], link[href], object[data], video[poster]';\nconst RESOURCE_ATTRIBUTES = ['src', 'href', 'data', 'poster'] as const;\n\n/**\n * Describes every document resource rejected by the caller's availability policy.\n *\n * For example, an unresolved image becomes 'img[src]=\"assets/logo.png\"', making\n * the exact element, attribute, and reference immediately visible in diagnostics.\n */\nexport function collectUnavailableResourceReferences(\n document: CheerioAPI,\n isAvailable: (reference: string) => boolean,\n): string[] {\n const unavailableResources: string[] = [];\n\n for (const element of document(RESOURCE_SELECTOR).toArray()) {\n for (const attribute of RESOURCE_ATTRIBUTES) {\n const reference = document(element).attr(attribute);\n\n if (reference === undefined || isAvailable(reference)) {\n continue;\n }\n\n unavailableResources.push(`${element.tagName}[${attribute}]=${JSON.stringify(reference)}`);\n }\n }\n\n return unavailableResources;\n}\n\n/** Reports whether a reference's bytes already live inside the HTML document. */\nexport function isEmbeddedResourceReference(reference: string): boolean {\n return reference.startsWith('data:') || reference.startsWith('#');\n}\n\n/**\n * Reports whether a resource is embedded or resolves to a file inside an archive.\n *\n * The caller builds the path set once, then reuses it for every document\n * reference instead of repeatedly searching the archive file array.\n */\nexport function isAvailableArchiveResourceReference(\n reference: string,\n archivePaths: ReadonlySet<string>,\n): boolean {\n if (isEmbeddedResourceReference(reference)) {\n return true;\n }\n\n const exportFilePath = resolveExportFileReference(reference);\n\n return exportFilePath !== undefined && archivePaths.has(exportFilePath);\n}\n","import type { ExportFile } from '#types/export-file.js';\n\n/** Canonical entry document produced by every Replayable build. */\nexport const PLAYABLE_HTML_FILE = 'index.html';\n\n/** Returns the required playable entry document from a collected build. */\nexport function requirePlayableHtml(files: readonly ExportFile[], variantId: string): ExportFile {\n const html = files.find(({ path }) => path === PLAYABLE_HTML_FILE);\n\n if (html === undefined) {\n throw new Error(`Build ${variantId} does not contain a root ${PLAYABLE_HTML_FILE}.`);\n }\n\n return html;\n}\n","import { load, type CheerioAPI } from 'cheerio';\nimport { build } from 'esbuild';\n\nimport { resolveExportFileReference } from '#shared/export-file-reference.js';\nimport { PLAYABLE_HTML_FILE } from '#shared/playable-html.js';\nimport type { ExportFile } from '#types/export-file.js';\n\nimport { isEmbeddedResourceReference } from './resource-references.js';\n\n/** Checks inline CSS in its final HTML location, including style attributes. */\nexport async function validateDocumentStylesheets(\n document: CheerioAPI,\n files: readonly ExportFile[] = [],\n htmlPath = PLAYABLE_HTML_FILE,\n): Promise<void> {\n for (const element of document('style, [style]').toArray()) {\n const node = document(element);\n if (element.tagName === 'style') {\n await validateStylesheetResources(node.text(), htmlPath, files);\n }\n const declarations = node.attr('style');\n if (declarations !== undefined) {\n await validateStylesheetResources(`.inline { ${declarations} }`, htmlPath, files);\n }\n }\n}\n\n/** Checks each archived stylesheet relative to its own file, not the root HTML. */\nexport async function validateArchiveStylesheets(files: readonly ExportFile[]): Promise<void> {\n const decoder = new TextDecoder();\n for (const file of files) {\n if (file.path.endsWith('.css')) {\n await validateStylesheetResources(decoder.decode(file.data), file.path, files);\n } else if (file.path.endsWith('.html')) {\n await validateDocumentStylesheets(load(decoder.decode(file.data)), files, file.path);\n }\n }\n}\n\n/**\n * Lets esbuild parse CSS escapes, url() and @import rather than guessing with regex.\n * All references are marked external during this inspection: nothing is fetched,\n * emitted, or bundled. The existing export files are the only allowed resources.\n */\nasync function validateStylesheetResources(\n source: string,\n owner: string,\n files: readonly ExportFile[],\n): Promise<void> {\n const paths = new Set(files.map((file) => file.path));\n const unavailable = new Set<string>();\n await build({\n stdin: { contents: source, loader: 'css', sourcefile: owner },\n bundle: true,\n write: false,\n logLevel: 'silent',\n plugins: [\n {\n name: 'validate-export-css-resources',\n setup(builder) {\n // esbuild uses Go regular expressions, which do not accept the JS u flag.\n builder.onResolve({ filter: /.*/ }, ({ path }) => {\n if (\n !isEmbeddedResourceReference(path) &&\n !isArchivedStylesheetResource(path, owner, paths)\n ) {\n unavailable.add(path);\n }\n return { path, external: true };\n });\n },\n },\n ],\n });\n if (unavailable.size > 0) {\n throw new Error(\n `Stylesheet in ${owner} contains unavailable resources: ${[...unavailable].join(', ')}.`,\n );\n }\n}\n\n/** Resolves nested CSS URLs while rejecting remote and root-relative resources. */\nfunction isArchivedStylesheetResource(\n reference: string,\n owner: string,\n paths: ReadonlySet<string>,\n): boolean {\n if (reference.startsWith('/') || /^[a-z][a-z\\d+.-]*:/iu.test(reference)) {\n return false;\n }\n const path = resolveExportFileReference(posix.join(posix.dirname(owner), reference));\n return path !== undefined && paths.has(path);\n}\nimport { posix } from 'node:path';\n","import type { CheerioAPI } from 'cheerio';\n\nimport type { SingleHtmlExportOptions } from '#types/single-html.js';\n\nimport {\n collectUnavailableResourceReferences,\n isEmbeddedResourceReference,\n} from './resource-references.js';\nimport { validateDocumentStylesheets } from './stylesheet-resources.js';\n\n/** Enforces the destination policy that can be proven from one standalone document. */\nexport async function validateSingleHtmlExport(\n document: CheerioAPI,\n source: string,\n options: SingleHtmlExportOptions,\n): Promise<void> {\n validateFileSize(source, options);\n await validateDocumentStylesheets(document);\n\n const preservedReferences = new Set(options.preservedResourceReferences);\n const unavailableResources = collectUnavailableResourceReferences(\n document,\n (reference) => isEmbeddedResourceReference(reference) || preservedReferences.has(reference),\n );\n\n if (unavailableResources.length > 0) {\n throw new Error(\n `${options.networkName} export contains non-embedded resources: ${unavailableResources.join(', ')}.`,\n );\n }\n}\n\n/** Rejects a serialized document larger than the destination network permits. */\nfunction validateFileSize(source: string, options: SingleHtmlExportOptions): void {\n const size = Buffer.byteLength(source);\n\n if (size <= options.maxFileSizeBytes) {\n return;\n }\n\n const formattedSize = size.toLocaleString('en-US');\n const formattedLimit = options.maxFileSizeBytes.toLocaleString('en-US');\n\n throw new Error(\n `${options.networkName} export exceeds its ${formattedLimit}-byte limit: ${formattedSize} bytes.`,\n );\n}\n","import { readdir, readFile } from 'node:fs/promises';\nimport { posix, relative, resolve, sep } from 'node:path';\n\nimport type { ExportFile } from '#types/export-file.js';\n\n/**\n * Collects one build directory as files ready for network-specific preparation.\n *\n * Given `dist/default/google/en` as the build directory:\n *\n * - `dist/default/google/en/index.html` becomes `{ path: 'index.html', data }`\n * - `dist/default/google/en/assets/main.js` becomes `{ path: 'assets/main.js', data }`\n *\n * Paths always use forward slashes and are sorted before their bytes are read,\n * producing the same ordered result on macOS, Linux, and Windows.\n */\nexport async function collectBuildFiles(buildDirectory: string): Promise<ExportFile[]> {\n // Discover the complete directory tree in one filesystem operation, then keep\n // only regular files because directories are implicit in export paths.\n const entries = await readdir(buildDirectory, {\n recursive: true,\n withFileTypes: true,\n });\n\n // Convert absolute host paths into portable paths relative to the export root.\n const files = entries\n .filter((entry) => entry.isFile())\n .map((entry) => {\n const file = resolve(entry.parentPath, entry.name);\n\n return {\n path: relative(buildDirectory, file).split(sep).join(posix.sep),\n file,\n };\n })\n .sort(compareExportFiles);\n\n // Read independent files concurrently. Promise.all preserves the sorted input\n // order, so parallel I/O does not affect deterministic export construction.\n return Promise.all(\n files.map(async ({ path, file }) => ({\n path,\n data: await readFile(file),\n })),\n );\n}\n\n/** Orders export files by code point, independently of host locale. */\nfunction compareExportFiles(left: { path: string }, right: { path: string }): number {\n if (left.path < right.path) {\n return -1;\n }\n\n if (left.path > right.path) {\n return 1;\n }\n\n return 0;\n}\n","import { deflate } from 'pako';\n\nimport type { JavaScriptCompressionCandidate } from '#types/compression.js';\n\nconst MAX_DEFLATE_LEVEL = 9;\nconst MIN_COMPRESSION_SAVINGS_RATIO = 0.05;\n\n/**\n * Compresses prepared JavaScript only when its embedded Base64 is meaningfully smaller.\n *\n * Deflate produces binary data, but the standalone HTML must carry that data as\n * Base64 text. Comparing the finished Base64 payload accounts for its roughly\n * one-third expansion. Requiring a five-percent final reduction avoids spending\n * runtime CPU to inflate a large module for a negligible delivery-size saving.\n * Returning `undefined` tells the caller to preserve the original module source.\n */\nexport function createCompressedJavaScriptPayload(source: string): string | undefined {\n if (source.length === 0) {\n return undefined;\n }\n\n const compressedSource = deflate(source, { level: MAX_DEFLATE_LEVEL });\n const compressedPayload = Buffer.from(compressedSource).toString('base64');\n const sourceSize = Buffer.byteLength(source);\n const payloadSize = Buffer.byteLength(compressedPayload);\n const savingsRatio = (sourceSize - payloadSize) / sourceSize;\n\n if (savingsRatio < MIN_COMPRESSION_SAVINGS_RATIO) {\n return undefined;\n }\n\n return compressedPayload;\n}\n\n/** Creates both delivery representations without discarding the prepared source. */\nexport function createJavaScriptCompressionCandidate(\n source: string,\n): JavaScriptCompressionCandidate {\n return {\n compressedPayload: createCompressedJavaScriptPayload(source),\n source,\n };\n}\n","import type { CheerioAPI } from 'cheerio';\n\nimport type { HtmlBuildEntries } from '#types/html-document.js';\n\nconst ENTRY_ATTRIBUTE = 'data-replayable-entry';\nconst entryRoles: readonly (keyof HtmlBuildEntries)[] = ['host', 'config', 'assets', 'application'];\n\n/**\n * Requires the four generated runtime entries to appear once in execution order.\n *\n * Module scripts execute in document order after fetching, so accepting missing,\n * duplicated, or reordered markers would make an otherwise valid archive fail only\n * at runtime with a misleading registration error.\n */\nexport function validateBuildEntryOrder(document: CheerioAPI, variantId: string): void {\n const actualRoles = document(`script[${ENTRY_ATTRIBUTE}]`)\n .toArray()\n .map((element) => document(element).attr(ENTRY_ATTRIBUTE));\n\n if (\n actualRoles.length === entryRoles.length &&\n actualRoles.every((role, index) => role === entryRoles[index])\n ) {\n return;\n }\n\n throw new Error(\n `Build ${variantId} must execute Replayable entries as ${entryRoles.join(' → ')}; received ${actualRoles.join(' → ') || 'none'}.`,\n );\n}\n","import { minify } from 'terser';\n\nimport type { JavaScriptSourceType } from '#types/javascript.js';\n\n/**\n * Prepares generated JavaScript for network delivery and safe HTML embedding.\n *\n * The narrow evaluation pass converts constant template literals produced by\n * the build minifier into ordinary quoted strings without enabling Terser's\n * broader compression transforms. This keeps static network analyzers reliable,\n * while `ascii_only` escapes Unicode for conservative delivery environments and\n * `inline_script` prevents source from closing its containing script element.\n */\nexport async function prepareExportJavaScript(\n source: string,\n sourceType: JavaScriptSourceType,\n): Promise<string> {\n const result = await minify(source, {\n compress: { defaults: false, evaluate: true },\n mangle: false,\n module: sourceType === 'module',\n format: {\n ascii_only: true,\n inline_script: true,\n quote_style: 1,\n },\n });\n\n if (result.code === undefined) {\n throw new Error('Terser did not produce JavaScript for export.');\n }\n\n return result.code;\n}\n","import { parse } from 'acorn';\nimport { transform } from 'esbuild';\n\nimport { prepareExportJavaScript } from './prepare-javascript.js';\n\n/**\n * Converts a self-contained module into Mintegral's external classic script.\n * Vite's dynamic-import helpers can retain import.meta even without splitting.\n * Resolve their URL against the executing script, not the containing HTML page.\n */\nexport async function prepareClassicJavaScript(source: string): Promise<string> {\n const transformed = await transform(source, {\n loader: 'js',\n define: {\n 'import.meta.url': 'entryUrl',\n // Vite already falls back to new URL(specifier, import.meta.url).\n 'import.meta.resolve': 'undefined',\n },\n });\n\n // Capture currentScript synchronously: it becomes null after an await.\n // The async wrapper preserves authored top-level await and isolates entries.\n const wrapped = `(async function (entryUrl) {\n'use strict';\n${transformed.code}\n})(document.currentScript.src);`;\n const result = await prepareExportJavaScript(wrapped, 'script');\n\n // Wrapping alone cannot convert every module feature. Reject remaining\n // module-only syntax here rather than delivering a script that cannot start.\n parse(result, { ecmaVersion: 'latest', sourceType: 'script' });\n\n return result;\n}\n","import { transform } from 'esbuild';\n\n/**\n * Prepares generated CSS for compact and safe embedding inside a style element.\n *\n * Esbuild's \"inline-style\" support escapes source that could otherwise terminate\n * the containing style element when the final HTML is parsed.\n */\nexport async function prepareExportStylesheet(source: string): Promise<string> {\n const result = await transform(source, {\n loader: 'css',\n minify: true,\n supported: { 'inline-style': true },\n });\n\n return result.code;\n}\n","import { load, type CheerioAPI } from 'cheerio';\n\nimport { resolveExportFileReference } from '#shared/export-file-reference.js';\nimport { requirePlayableHtml } from '#shared/playable-html.js';\nimport type { ExportFile } from '#types/export-file.js';\nimport type {\n BuildEntryRole,\n HtmlBuildResource,\n HtmlBuildResources,\n} from '#types/html-document.js';\nimport { validateBuildEntryOrder } from '#validation/build-entries.js';\n\nimport { prepareClassicJavaScript } from './prepare-classic-javascript.js';\nimport { prepareExportJavaScript } from './prepare-javascript.js';\nimport { prepareExportStylesheet } from './prepare-stylesheet.js';\n\nconst ENTRY_ATTRIBUTE = 'data-replayable-entry';\n\n/** Loads the required root HTML document from collected build files. */\nexport function loadHtmlBuildDocument(files: readonly ExportFile[], variantId: string): CheerioAPI {\n const html = requirePlayableHtml(files, variantId);\n\n return load(new TextDecoder().decode(html.data));\n}\n\n/**\n * Resolves the local host, config, assets, application, and stylesheet files\n * referenced by a production build document.\n *\n * Host-provided and external resources are ignored. Every marked entry and local\n * stylesheet must exist in `files`. Internal entry markers are removed after\n * resolution so they never appear in network delivery HTML.\n */\nexport function resolveHtmlBuildResources(\n document: CheerioAPI,\n files: readonly ExportFile[],\n variantId: string,\n): HtmlBuildResources {\n validateBuildEntryOrder(document, variantId);\n\n return {\n entries: {\n host: resolveEntry(document, files, variantId, 'host'),\n config: resolveEntry(document, files, variantId, 'config'),\n assets: resolveEntry(document, files, variantId, 'assets'),\n application: resolveEntry(document, files, variantId, 'application'),\n },\n stylesheets: resolveStylesheets(document, files, variantId),\n };\n}\n\n/** Replaces every generated stylesheet link with minified inline CSS. */\nexport async function inlineStylesheets(\n document: CheerioAPI,\n stylesheets: readonly HtmlBuildResource[],\n): Promise<void> {\n for (const stylesheet of stylesheets) {\n const source = new TextDecoder().decode(stylesheet.file.data);\n const inlineSource = await prepareExportStylesheet(source);\n const style = document('<style></style>').text(inlineSource);\n\n stylesheet.element.replaceWith(style);\n }\n}\n\n/** Reads and normalizes a generated module before its delivery form is selected. */\nexport function prepareModuleEntrySource(entry: HtmlBuildResource): Promise<string> {\n const source = new TextDecoder().decode(entry.file.data);\n\n return prepareExportJavaScript(source, 'module');\n}\n\n/** Replaces a module reference with an already prepared inline source. */\nexport function inlinePreparedModuleEntry(entry: HtmlBuildResource, source: string): void {\n entry.element.removeAttr('src');\n entry.element.text(source);\n}\n\n/**\n * Converts one external module entry into an external classic script.\n *\n * The HTML element keeps its `src` but loses `type=\"module\"`. The returned file\n * contains an async IIFE so authored top-level `await` retains its behavior.\n */\nexport async function prepareClassicScriptEntry(entry: HtmlBuildResource): Promise<ExportFile> {\n const source = new TextDecoder().decode(entry.file.data);\n const javaScript = await prepareClassicJavaScript(source);\n\n entry.element.removeAttr('type');\n\n return {\n path: entry.file.path,\n data: new TextEncoder().encode(javaScript),\n };\n}\n\n/** Serializes a transformed document with one deterministic trailing newline. */\nexport function serializeHtmlDocument(document: CheerioAPI): string {\n return `${document.html()}\\n`;\n}\n\n/** Resolves exactly one local script carrying the requested Replayable entry role. */\nfunction resolveEntry(\n document: CheerioAPI,\n files: readonly ExportFile[],\n variantId: string,\n role: BuildEntryRole,\n): HtmlBuildResource {\n const entries: HtmlBuildResource[] = [];\n\n for (const element of document(`script[${ENTRY_ATTRIBUTE}=\"${role}\"][src]`).toArray()) {\n const script = document(element);\n const reference = script.attr('src');\n\n if (reference === undefined) {\n continue;\n }\n\n const resource = resolveLocalResource(script, reference, files, variantId);\n\n if (resource !== undefined) {\n script.removeAttr(ENTRY_ATTRIBUTE);\n entries.push(resource);\n }\n }\n\n const entry = entries[0];\n\n if (entry === undefined || entries.length !== 1) {\n throw new Error(\n `Build ${variantId} requires exactly one local ${role} entry; received ${entries.length}.`,\n );\n }\n\n return entry;\n}\n\n/** Resolves local stylesheet links while preserving their document positions. */\nfunction resolveStylesheets(\n document: CheerioAPI,\n files: readonly ExportFile[],\n variantId: string,\n): HtmlBuildResource[] {\n const stylesheets: HtmlBuildResource[] = [];\n\n for (const element of document('link[rel][href]').toArray()) {\n const stylesheet = document(element);\n const relation = stylesheet.attr('rel');\n const reference = stylesheet.attr('href');\n const isStylesheet =\n relation?.split(/\\s+/u).some((value) => value.toLowerCase() === 'stylesheet') ?? false;\n\n if (!isStylesheet || reference === undefined) {\n continue;\n }\n\n const resource = resolveLocalResource(stylesheet, reference, files, variantId);\n\n if (resource !== undefined) {\n stylesheets.push(resource);\n }\n }\n\n return stylesheets;\n}\n\n/** Resolves one local document reference while leaving host and remote URLs untouched. */\nfunction resolveLocalResource(\n element: ReturnType<CheerioAPI>,\n reference: string,\n files: readonly ExportFile[],\n variantId: string,\n): HtmlBuildResource | undefined {\n const path = resolveExportFileReference(reference);\n\n if (path === undefined) {\n return undefined;\n }\n\n const file = files.find((candidate) => candidate.path === path);\n\n if (file === undefined) {\n throw new Error(`Build ${variantId} contains an unavailable local resource: ${reference}.`);\n }\n\n return { element, file };\n}\n","/** Identifies the inert script element that stores one Replayable module. */\nexport const COMPRESSED_ENTRY_ATTRIBUTE = 'data-replayable-compressed-entry';\n\n/** Describes whether an inert Replayable module contains source or Deflate data. */\nexport const ENTRY_ENCODING_ATTRIBUTE = 'data-replayable-entry-encoding';\n","import { readFile } from 'node:fs/promises';\n\nimport { prepareExportJavaScript } from './prepare-javascript.js';\n\nconst COMPRESSED_MODULE_LOADER_PATH = new URL(\n './browser/compressed-module-loader.js',\n import.meta.url,\n);\n\nlet compressedModuleLoaderSource: Promise<string> | undefined;\n\n/**\n * Loads and prepares Replayable's compiled browser-side module loader.\n *\n * The promise caches both the file read and export preparation so concurrently\n * generated variants share the same immutable minified source.\n */\nexport function loadCompressedModuleLoader(): Promise<string> {\n compressedModuleLoaderSource ??= readFile(COMPRESSED_MODULE_LOADER_PATH, 'utf8').then((source) =>\n prepareExportJavaScript(source, 'module'),\n );\n\n return compressedModuleLoaderSource;\n}\n","import {\n COMPRESSED_ENTRY_ATTRIBUTE,\n ENTRY_ENCODING_ATTRIBUTE,\n} from '#shared/compression-protocol.js';\nimport type { CompressibleEntries, CompressibleEntry } from '#types/compression.js';\n\nimport { loadCompressedModuleLoader } from './load-compressed-module-loader.js';\n\n/**\n * Stores assets and application as inert payloads and appends their shared loader.\n *\n * Compressed entries use Base64 because Deflate produces binary data. An entry\n * that did not become smaller remains readable JavaScript under `identity`\n * encoding, avoiding Base64's one-third expansion while preserving deterministic\n * assets-before-application execution.\n */\nexport async function inlineCompressedModules(entries: CompressibleEntries): Promise<void> {\n const loaderSource = await loadCompressedModuleLoader();\n const loader = entries.application.resource.element.clone();\n\n storeModulePayload(entries.assets, 'assets');\n storeModulePayload(entries.application, 'application');\n\n loader.removeAttr('src');\n loader.removeAttr(COMPRESSED_ENTRY_ATTRIBUTE);\n loader.removeAttr(ENTRY_ENCODING_ATTRIBUTE);\n loader.attr('type', 'module');\n loader.text(loaderSource);\n\n entries.application.resource.element.after(loader);\n}\n\n/** Replaces one module reference with its selected inert delivery representation. */\nfunction storeModulePayload(entry: CompressibleEntry, role: 'application' | 'assets'): void {\n const compressedPayload = entry.candidate.compressedPayload;\n\n entry.resource.element.removeAttr('src');\n entry.resource.element.attr('type', 'application/octet-stream');\n entry.resource.element.attr(COMPRESSED_ENTRY_ATTRIBUTE, role);\n entry.resource.element.attr(\n ENTRY_ENCODING_ATTRIBUTE,\n compressedPayload === undefined ? 'identity' : 'deflate',\n );\n entry.resource.element.text(compressedPayload ?? entry.candidate.source);\n}\n","import { readFile } from 'node:fs/promises';\nimport { createRequire } from 'node:module';\n\nconst require = createRequire(import.meta.url);\nconst PAKO_INFLATER_PATH = require.resolve('pako/dist/pako_inflate.min.js');\n\nlet pakoInflaterSource: Promise<string> | undefined;\n\n/**\n * Loads Pako's official inflate-only browser distribution.\n *\n * The source is cached because every single-HTML variant uses the same immutable\n * dependency file. Keeping the promise also shares an in-progress read when\n * several variants are prepared concurrently.\n */\nexport function loadPakoInflater(): Promise<string> {\n pakoInflaterSource ??= readFile(PAKO_INFLATER_PATH, 'utf8');\n\n return pakoInflaterSource;\n}\n","import type { HtmlBuildResource } from '#types/html-document.js';\n\nimport { loadPakoInflater } from './load-pako-inflater.js';\n\n/**\n * Embeds Pako's official inflate-only distribution before the first compressed entry.\n *\n * The original minified source is preserved, including its license banner. The\n * caller owns the one-time decision so multiple module candidates share one inflater.\n */\nexport async function inlinePakoInflater(beforeEntry: HtmlBuildResource): Promise<void> {\n const source = await loadPakoInflater();\n const script = beforeEntry.element.clone();\n\n script.removeAttr('src');\n script.removeAttr('type');\n script.text(source);\n\n beforeEntry.element.before(script);\n}\n","import type { ExportVariantContext } from '#types/context.js';\nimport type { SingleHtmlExportOptions } from '#types/single-html.js';\nimport { validateSingleHtmlExport } from '#validation/single-html.js';\n\nimport { collectBuildFiles } from './collect-build-files.js';\nimport { createJavaScriptCompressionCandidate } from './compress-javascript.js';\nimport {\n inlinePreparedModuleEntry,\n inlineStylesheets,\n loadHtmlBuildDocument,\n prepareModuleEntrySource,\n resolveHtmlBuildResources,\n serializeHtmlDocument,\n} from './html-document.js';\nimport { inlineCompressedModules } from './inline-compressed-modules.js';\nimport { inlinePakoInflater } from './inline-pako-inflater.js';\n\n/**\n * Produces one standalone HTML document from an existing runnable build.\n *\n * Local stylesheets and the validator-visible host and config entries are embedded\n * directly. Assets and application become ordered payloads when compression is\n * useful: qualifying Deflate results use Base64, while the other entry remains plain\n * source. If neither qualifies, both remain ordinary inline modules. The final\n * document is validated against the network's size and external-resource policy.\n */\nexport async function prepareSingleHtmlExport(\n context: ExportVariantContext,\n options: SingleHtmlExportOptions,\n): Promise<string> {\n const files = await collectBuildFiles(context.buildDirectory);\n const document = loadHtmlBuildDocument(files, context.variant.id);\n const resources = resolveHtmlBuildResources(document, files, context.variant.id);\n\n await inlineStylesheets(document, resources.stylesheets);\n const [host, config, assets, application] = await Promise.all([\n prepareModuleEntrySource(resources.entries.host),\n prepareModuleEntrySource(resources.entries.config),\n prepareModuleEntrySource(resources.entries.assets),\n prepareModuleEntrySource(resources.entries.application),\n ]);\n\n // Inspect the exact prepared code before Base64 can hide prohibited APIs.\n options.validateJavaScript?.([host, config, assets, application]);\n inlinePreparedModuleEntry(resources.entries.host, host);\n inlinePreparedModuleEntry(resources.entries.config, config);\n\n // Only generated assets and authored application code are compression candidates.\n // Host calls and resolved configuration stay visible to static network validators.\n const assetsModule = createJavaScriptCompressionCandidate(assets);\n const applicationModule = createJavaScriptCompressionCandidate(application);\n\n const usesCompression =\n assetsModule.compressedPayload !== undefined ||\n applicationModule.compressedPayload !== undefined;\n\n if (usesCompression) {\n await inlinePakoInflater(resources.entries.assets);\n await inlineCompressedModules({\n application: {\n candidate: applicationModule,\n resource: resources.entries.application,\n },\n assets: {\n candidate: assetsModule,\n resource: resources.entries.assets,\n },\n });\n } else {\n inlinePreparedModuleEntry(resources.entries.assets, assetsModule.source);\n inlinePreparedModuleEntry(resources.entries.application, applicationModule.source);\n }\n\n const source = serializeHtmlDocument(document);\n\n await validateSingleHtmlExport(document, source, options);\n\n return source;\n}\n","import { MAX_EXPORT_SIZE_BYTES } from '#shared/export-limits.js';\nimport type { ExportVariantContext } from '#types/context.js';\n\nimport { prepareSingleHtmlExport } from '../shared/single-html.js';\n\n/** Produces one upload-ready AppLovin document from an existing variant build. */\nexport function prepareAppLovinExport(context: ExportVariantContext): Promise<string> {\n return prepareSingleHtmlExport(context, {\n maxFileSizeBytes: MAX_EXPORT_SIZE_BYTES,\n networkName: 'AppLovin',\n });\n}\n","import { load } from 'cheerio';\n\nimport { isWithinExportSizeLimit, GOOGLE_MAX_ARCHIVE_FILE_COUNT } from '#shared/export-limits.js';\nimport { requirePlayableHtml } from '#shared/playable-html.js';\nimport type { ExportFile } from '#types/export-file.js';\n\nimport { validateBuildEntryOrder } from '../build-entries.js';\nimport {\n collectUnavailableResourceReferences,\n isAvailableArchiveResourceReference,\n} from '../resource-references.js';\n\nconst EXIT_API_URL = 'https://tpc.googlesyndication.com/pagead/gadgets/html5/api/exitapi.js';\nconst ORIENTATIONS = new Set(['landscape', 'portrait', 'portrait,landscape']);\nconst SUPPORTED_ARCHIVE_PATH = /^[A-Za-z\\d._/-]+$/u;\n\n/** Enforces every Google rule that can be proven from prepared archive files. */\nexport function validateGoogleFiles(files: readonly ExportFile[], variantId: string): void {\n const html = requirePlayableHtml(files, variantId);\n\n validateFileCount(files);\n validateArchivePaths(files);\n validateDocument(new TextDecoder().decode(html.data), files, variantId);\n validateExitCall(files);\n}\n\n/** Enforces Google's documented maximum compressed archive size. */\nexport function validateGoogleArchive(archive: Uint8Array): void {\n if (isWithinExportSizeLimit(archive.byteLength, 'google')) {\n return;\n }\n\n const formattedSize = archive.byteLength.toLocaleString('en-US');\n\n throw new Error(`Google archive exceeds its 5 MB limit: ${formattedSize} bytes.`);\n}\n\n/** Enforces Google's documented maximum number of files inside the ZIP. */\nfunction validateFileCount(files: readonly ExportFile[]): void {\n if (files.length > GOOGLE_MAX_ARCHIVE_FILE_COUNT) {\n throw new Error(\n `Google archive contains ${files.length} files; the maximum is ${GOOGLE_MAX_ARCHIVE_FILE_COUNT}.`,\n );\n }\n}\n\n/** Rejects archive paths containing characters unsupported by Google Ads. */\nfunction validateArchivePaths(files: readonly ExportFile[]): void {\n const invalidPaths = files\n .map(({ path }) => path)\n .filter((archivePath) => !SUPPORTED_ARCHIVE_PATH.test(archivePath));\n\n if (invalidPaths.length > 0) {\n throw new Error(`Google archive contains unsupported paths: ${invalidPaths.join(', ')}.`);\n }\n}\n\n/** Validates Google's required document structure, metadata, and resource policy. */\nfunction validateDocument(source: string, files: readonly ExportFile[], variantId: string): void {\n const document = load(source);\n\n validateBuildEntryOrder(document, variantId);\n\n if (!source.trimStart().toLowerCase().startsWith('<!doctype html>')) {\n throw new Error('Google entry document must begin with <!DOCTYPE html>.');\n }\n\n if (\n document('html').length !== 1 ||\n document('head').length !== 1 ||\n document('body').length !== 1\n ) {\n throw new Error('Google entry document must contain one html, head, and body element.');\n }\n\n const charset = document('head > meta[charset]').attr('charset')?.toLowerCase();\n\n if (charset !== 'utf-8') {\n throw new Error('Google entry document must declare UTF-8 encoding.');\n }\n\n const orientation = document('head > meta[name=\"ad.orientation\"]').attr('content');\n\n if (orientation === undefined || !ORIENTATIONS.has(orientation)) {\n throw new Error('Google entry document has no valid ad.orientation metadata.');\n }\n\n const exitApiScripts = document(`head > script[src=\"${EXIT_API_URL}\"]`);\n\n if (exitApiScripts.length !== 1) {\n throw new Error('Google entry document must load the official Exit API exactly once.');\n }\n\n validateResourceReferences(document, files);\n}\n\n/** Allows the official Exit API and requires every other resource to live in the ZIP. */\nfunction validateResourceReferences(\n document: ReturnType<typeof load>,\n files: readonly ExportFile[],\n): void {\n const archivePaths = new Set(files.map(({ path }) => path));\n const unavailableResources = collectUnavailableResourceReferences(\n document,\n (reference) =>\n reference === EXIT_API_URL || isAvailableArchiveResourceReference(reference, archivePaths),\n );\n\n if (unavailableResources.length > 0) {\n throw new Error(\n `Google archive contains unavailable resources: ${unavailableResources.join(', ')}.`,\n );\n }\n}\n\n/** Ensures the bundled CTA path invokes Google's network-owned destination API. */\nfunction validateExitCall(files: readonly ExportFile[]): void {\n const decoder = new TextDecoder();\n const invokesExitApi = files\n .filter(({ path }) => path.endsWith('.js'))\n .some(({ data }) => decoder.decode(data).includes('ExitApi.exit()'));\n\n if (!invokesExitApi) {\n throw new Error('Google archive does not invoke ExitApi.exit().');\n }\n}\n","import { Zip, ZipDeflate } from 'fflate';\n\nimport type { ExportFile } from '#types/export-file.js';\n\n/** Compresses prepared export files at the highest supported compression level. */\nexport function createZipArchive(files: readonly ExportFile[]): Promise<Uint8Array> {\n return new Promise((resolve, reject) => {\n const chunks: Uint8Array[] = [];\n const archive = new Zip((error, chunk, final) => {\n if (error !== null) {\n reject(error);\n return;\n }\n\n chunks.push(chunk);\n\n if (final) {\n resolve(Buffer.concat(chunks));\n }\n });\n\n // Add filenames directly instead of using fflate's object shorthand. Plain\n // objects treat a root filename such as \"__proto__\" as a special property.\n for (const file of files) {\n const archiveFile = new ZipDeflate(file.path, { level: 9 });\n\n archive.add(archiveFile);\n archiveFile.push(file.data, true);\n }\n\n archive.end();\n });\n}\n","import type { ExportVariantContext } from '#types/context.js';\nimport { validateGoogleArchive, validateGoogleFiles } from '#validation/networks/google.js';\nimport { validateArchiveStylesheets } from '#validation/stylesheet-resources.js';\n\nimport { collectBuildFiles } from '../shared/collect-build-files.js';\nimport { createZipArchive } from '../shared/create-zip-archive.js';\n\n/** Packages one existing Google build as an upload-ready HTML5 ZIP. */\nexport async function prepareGoogleExport(context: ExportVariantContext): Promise<Uint8Array> {\n const files = await collectBuildFiles(context.buildDirectory);\n\n validateGoogleFiles(files, context.variant.id);\n await validateArchiveStylesheets(files);\n\n const archive = await createZipArchive(files);\n\n validateGoogleArchive(archive);\n\n return archive;\n}\n","import { load } from 'cheerio';\n\nimport { isWithinExportSizeLimit } from '#shared/export-limits.js';\nimport { requirePlayableHtml } from '#shared/playable-html.js';\nimport type { ExportFile } from '#types/export-file.js';\n\nimport { validateBuildEntryOrder } from '../build-entries.js';\nimport {\n collectUnavailableResourceReferences,\n isAvailableArchiveResourceReference,\n} from '../resource-references.js';\n\nconst ASCII_ARCHIVE_PATH = /^[\\x20-\\x7e]+$/u;\n\n/** Enforces Liftoff's HTML size, archive path, and local-resource requirements. */\nexport function validateLiftoffFiles(files: readonly ExportFile[], variantId: string): void {\n const html = requirePlayableHtml(files, variantId);\n\n validateHtmlSize(html);\n validateArchivePaths(files);\n validateDocument(new TextDecoder().decode(html.data), files, variantId);\n}\n\n/** Enforces Liftoff's documented maximum entry-document size. */\nfunction validateHtmlSize(html: ExportFile): void {\n if (!isWithinExportSizeLimit(html.data.byteLength, 'liftoff')) {\n const formattedSize = html.data.byteLength.toLocaleString('en-US');\n\n throw new Error(`Liftoff HTML exceeds its 5 MB limit: ${formattedSize} bytes.`);\n }\n}\n\n/** Rejects filenames that Liftoff's case-sensitive CDN cannot address reliably. */\nfunction validateArchivePaths(files: readonly ExportFile[]): void {\n const invalidPaths = files\n .map(({ path }) => path)\n .filter((archivePath) => !ASCII_ARCHIVE_PATH.test(archivePath));\n\n if (invalidPaths.length > 0) {\n throw new Error(`Liftoff export contains non-ASCII filenames: ${invalidPaths.join(', ')}.`);\n }\n}\n\n/** Enforces Liftoff's supported document shape and local-only resource policy. */\nfunction validateDocument(source: string, files: readonly ExportFile[], variantId: string): void {\n const document = load(source);\n\n validateBuildEntryOrder(document, variantId);\n\n if (document('iframe').length > 0) {\n throw new Error('Liftoff export must not contain iframe elements.');\n }\n\n const archivePaths = new Set(files.map(({ path }) => path));\n const unavailableResources = collectUnavailableResourceReferences(document, (reference) =>\n isAvailableArchiveResourceReference(reference, archivePaths),\n );\n\n if (unavailableResources.length > 0) {\n throw new Error(\n `Liftoff export contains unavailable resources: ${unavailableResources.join(', ')}.`,\n );\n }\n}\n","import type { ExportVariantContext } from '#types/context.js';\nimport { validateLiftoffFiles } from '#validation/networks/liftoff.js';\nimport { validateArchiveStylesheets } from '#validation/stylesheet-resources.js';\n\nimport { collectBuildFiles } from '../shared/collect-build-files.js';\nimport { createZipArchive } from '../shared/create-zip-archive.js';\n\n/** Packages one existing Liftoff build as an upload-ready progressive-loading ZIP. */\nexport async function prepareLiftoffExport(context: ExportVariantContext): Promise<Uint8Array> {\n const files = await collectBuildFiles(context.buildDirectory);\n\n validateLiftoffFiles(files, context.variant.id);\n await validateArchiveStylesheets(files);\n\n return createZipArchive(files);\n}\n","import { MAX_EXPORT_SIZE_BYTES } from '#shared/export-limits.js';\nimport type { ExportVariantContext } from '#types/context.js';\n\nimport { prepareSingleHtmlExport } from '../shared/single-html.js';\n\n/** Produces one self-contained HTML document accepted by Meta playable ads. */\nexport function prepareMetaExport(context: ExportVariantContext): Promise<string> {\n return prepareSingleHtmlExport(context, {\n maxFileSizeBytes: MAX_EXPORT_SIZE_BYTES,\n networkName: 'Meta',\n });\n}\n","import { load } from 'cheerio';\n\nimport { isWithinExportSizeLimit } from '#shared/export-limits.js';\nimport type { ExportFile } from '#types/export-file.js';\n\nimport {\n collectUnavailableResourceReferences,\n isAvailableArchiveResourceReference,\n} from '../resource-references.js';\n\n/** Ensures every resource requested by the prepared HTML is contained in the ZIP. */\nexport function validateMintegralFiles(source: string, files: readonly ExportFile[]): void {\n const document = load(source);\n const archivePaths = new Set(files.map(({ path }) => path));\n const unavailableResources = collectUnavailableResourceReferences(document, (reference) =>\n isAvailableArchiveResourceReference(reference, archivePaths),\n );\n\n if (unavailableResources.length > 0) {\n throw new Error(\n `Mintegral export contains resources outside its ZIP: ${unavailableResources.join(', ')}.`,\n );\n }\n}\n\n/** Enforces Mintegral's maximum compressed delivery size. */\nexport function validateMintegralArchive(archive: Uint8Array): void {\n if (isWithinExportSizeLimit(archive.byteLength, 'mintegral')) {\n return;\n }\n\n const formattedSize = archive.byteLength.toLocaleString('en-US');\n\n throw new Error(`Mintegral export exceeds the 5 MB limit: ${formattedSize} bytes.`);\n}\n","import { PLAYABLE_HTML_FILE, requirePlayableHtml } from '#shared/playable-html.js';\nimport type { ExportVariantContext } from '#types/context.js';\nimport type { ExportFile } from '#types/export-file.js';\nimport {\n validateMintegralArchive,\n validateMintegralFiles,\n} from '#validation/networks/mintegral.js';\nimport { validateArchiveStylesheets } from '#validation/stylesheet-resources.js';\n\nimport { collectBuildFiles } from '../shared/collect-build-files.js';\nimport { createZipArchive } from '../shared/create-zip-archive.js';\nimport {\n inlineStylesheets,\n loadHtmlBuildDocument,\n prepareClassicScriptEntry,\n resolveHtmlBuildResources,\n serializeHtmlDocument,\n} from '../shared/html-document.js';\n\n/** Packages one existing Mintegral build as an upload-ready ZIP archive. */\nexport async function prepareMintegralExport(context: ExportVariantContext): Promise<Uint8Array> {\n const buildFiles = await collectBuildFiles(context.buildDirectory);\n const files = await convertMintegralBuild(context, buildFiles);\n const html = requirePlayableHtml(files, context.variant.id);\n\n validateMintegralFiles(new TextDecoder().decode(html.data), files);\n await validateArchiveStylesheets(files);\n\n const archive = await createZipArchive(files);\n\n validateMintegralArchive(archive);\n\n return archive;\n}\n\n/**\n * Converts Replayable's four ESM entries into Mintegral's local classic-script form.\n *\n * The async wrapper preserves authored top-level `await`, while Terser verifies that\n * no imports or exports remain and safely escapes text embedded in a script context.\n */\nasync function convertMintegralBuild(\n context: ExportVariantContext,\n files: readonly ExportFile[],\n): Promise<ExportFile[]> {\n const document = loadHtmlBuildDocument(files, context.variant.id);\n const resources = resolveHtmlBuildResources(document, files, context.variant.id);\n\n await inlineStylesheets(document, resources.stylesheets);\n const classicEntries = [\n await prepareClassicScriptEntry(resources.entries.host),\n await prepareClassicScriptEntry(resources.entries.config),\n await prepareClassicScriptEntry(resources.entries.assets),\n await prepareClassicScriptEntry(resources.entries.application),\n ];\n\n const htmlData = new TextEncoder().encode(serializeHtmlDocument(document));\n const filesByPath = new Map(files.map((file) => [file.path, file]));\n\n // CSS now lives inside index.html, so omit the original stylesheet files.\n for (const stylesheet of resources.stylesheets) {\n filesByPath.delete(stylesheet.file.path);\n }\n\n // Replace the original HTML with the transformed document.\n filesByPath.set(PLAYABLE_HTML_FILE, { path: PLAYABLE_HTML_FILE, data: htmlData });\n\n // Replace every module entry with its classic-script equivalent.\n for (const classicEntry of classicEntries) {\n filesByPath.set(classicEntry.path, classicEntry);\n }\n\n // Every untouched entry remains the original resource collected from the build.\n return [...filesByPath.values()];\n}\n","import { parse, type AnyNode } from 'acorn';\nimport { simple } from 'acorn-walk';\n\nconst BROWSER_OBJECTS = new Set(['window', 'self', 'globalThis', 'document']);\n\n/**\n * Checks direct browser navigation without mistaking shader .location properties,\n * comments, or strings for executable redirects. Each module is parsed separately:\n * independent build entries may legitimately reuse the same top-level bindings.\n * This is a static direct-API check, not analysis of aliases or dynamically built code.\n */\nexport function containsBrowserRedirect(source: string): boolean {\n const program = parse(source, { ecmaVersion: 'latest', sourceType: 'module' });\n let redirects = false;\n simple(program, {\n AssignmentExpression(node) {\n const path = browserPath(node.left);\n redirects ||= path === 'location' || path === 'location.href';\n },\n CallExpression(node) {\n const path = browserPath(node.callee);\n redirects ||= path === 'location.assign' || path === 'location.replace' || path === 'open';\n },\n });\n return redirects;\n}\n\n/** Removes only recognized browser roots; arbitrary object properties do not match. */\nfunction browserPath(node: AnyNode): string | undefined {\n const path = memberPath(node);\n if (path === undefined) {\n return undefined;\n }\n const [root, ...properties] = path;\n if (root === 'document' && properties[0] !== 'location') {\n return undefined;\n }\n if (root !== undefined && BROWSER_OBJECTS.has(root)) {\n return properties.join('.');\n }\n return root === 'location' ? path.join('.') : undefined;\n}\n\n/** Resolves literal member access, including window['location'] and optional chains. */\nfunction memberPath(node: AnyNode): string[] | undefined {\n if (node.type === 'Identifier') {\n return [node.name];\n }\n if (node.type === 'ChainExpression') {\n return memberPath(node.expression);\n }\n if (node.type !== 'MemberExpression') {\n return undefined;\n }\n const object = memberPath(node.object);\n const property = node.property;\n const name =\n !node.computed && property.type === 'Identifier'\n ? property.name\n : property.type === 'Literal' && typeof property.value === 'string'\n ? property.value\n : undefined;\n return object !== undefined && name !== undefined ? [...object, name] : undefined;\n}\n","import { isWithinExportSizeLimit } from '#shared/export-limits.js';\nimport type { ExportVariantContext } from '#types/context.js';\n\nimport { containsBrowserRedirect } from '../browser-redirects.js';\n\nconst CTA_CALL = 'FbPlayableAd.onCTAClick()';\n\n/** Requires the responsive portrait-and-landscape layout documented by Moloco. */\nexport function validateMolocoVariant(context: ExportVariantContext): void {\n const { landscape, portrait } = context.variant.screen.orientations;\n\n if (!landscape.enabled || !portrait.enabled) {\n throw new Error('Moloco playables must support both portrait and landscape orientations.');\n }\n}\n\n/** Rejects APIs and redirect behavior explicitly prohibited by Moloco. */\nexport function validateMolocoSource(source: string): void {\n if (!isWithinExportSizeLimit(Buffer.byteLength(source), 'moloco')) {\n throw new Error('Moloco export must be smaller than 5 MB.');\n }\n\n if (source.toLowerCase().includes('mraid.js')) {\n throw new Error('Moloco export must not contain mraid.js.');\n }\n if (!source.includes(CTA_CALL)) {\n throw new Error(`Moloco export must invoke ${CTA_CALL}.`);\n }\n}\n\n/** Checks readable code independently of the final compressed document size. */\nexport function validateMolocoJavaScript(sources: readonly string[]): void {\n const source = sources.join('\\n');\n if (source.includes('XMLHttpRequest')) {\n throw new Error(\n 'Moloco export contains XMLHttpRequest. Disable audio or remove the dependency that provides it.',\n );\n }\n\n if (source.toLowerCase().includes('mraid.js')) {\n throw new Error('Moloco export must not contain mraid.js.');\n }\n\n if (!source.includes(CTA_CALL)) {\n throw new Error(`Moloco export must invoke ${CTA_CALL}.`);\n }\n\n if (sources.some(containsBrowserRedirect)) {\n throw new Error('Moloco export contains a direct JavaScript redirect.');\n }\n}\n","import { MAX_EXPORT_SIZE_BYTES } from '#shared/export-limits.js';\nimport type { ExportVariantContext } from '#types/context.js';\nimport {\n validateMolocoJavaScript,\n validateMolocoSource,\n validateMolocoVariant,\n} from '#validation/networks/moloco.js';\n\nimport { prepareSingleHtmlExport } from '../shared/single-html.js';\n\n/** Produces one self-contained HTML document accepted by Moloco playable ads. */\nexport async function prepareMolocoExport(context: ExportVariantContext): Promise<string> {\n validateMolocoVariant(context);\n\n const source = await prepareSingleHtmlExport(context, {\n maxFileSizeBytes: MAX_EXPORT_SIZE_BYTES,\n networkName: 'Moloco',\n validateJavaScript: validateMolocoJavaScript,\n });\n\n validateMolocoSource(source);\n\n return source;\n}\n","import { MAX_EXPORT_SIZE_BYTES } from '#shared/export-limits.js';\nimport type { ExportVariantContext } from '#types/context.js';\n\nimport { prepareSingleHtmlExport } from '../shared/single-html.js';\n\n/** Produces a portable self-contained document for local review and sharing. */\nexport function preparePreviewExport(context: ExportVariantContext): Promise<string> {\n return prepareSingleHtmlExport(context, {\n maxFileSizeBytes: MAX_EXPORT_SIZE_BYTES,\n networkName: 'Preview',\n });\n}\n","import { MAX_EXPORT_SIZE_BYTES } from '#shared/export-limits.js';\nimport type { ExportVariantContext } from '#types/context.js';\n\nimport { prepareSingleHtmlExport } from '../shared/single-html.js';\n\nconst UNITY_MRAID_REFERENCE = 'mraid.js';\n\n/** Produces one upload-ready Unity document while preserving its host-injected MRAID bootstrap. */\nexport function prepareUnityExport(context: ExportVariantContext): Promise<string> {\n return prepareSingleHtmlExport(context, {\n maxFileSizeBytes: MAX_EXPORT_SIZE_BYTES,\n networkName: 'Unity',\n preservedResourceReferences: [UNITY_MRAID_REFERENCE],\n });\n}\n","import { prepareAppLovinExport } from '#preparation/networks/applovin.js';\nimport { prepareGoogleExport } from '#preparation/networks/google.js';\nimport { prepareLiftoffExport } from '#preparation/networks/liftoff.js';\nimport { prepareMetaExport } from '#preparation/networks/meta.js';\nimport { prepareMintegralExport } from '#preparation/networks/mintegral.js';\nimport { prepareMolocoExport } from '#preparation/networks/moloco.js';\nimport { preparePreviewExport } from '#preparation/networks/preview.js';\nimport { prepareUnityExport } from '#preparation/networks/unity.js';\nimport type { PreparedExportArtifact } from '#types/artifact.js';\nimport type { ExportProjectContext, ExportVariantContext } from '#types/context.js';\n\n/** Prepares every network artifact in memory without changing existing exports. */\nexport function prepareExportProject(\n project: ExportProjectContext,\n): Promise<PreparedExportArtifact[]> {\n return Promise.all(project.variants.map(prepareExportVariant));\n}\n\n/** Prepares one resolved variant and keeps its destination beside the content. */\nasync function prepareExportVariant(\n context: ExportVariantContext,\n): Promise<PreparedExportArtifact> {\n return {\n content: await prepareExportContent(context),\n outputFile: context.outputFile,\n variantId: context.variant.id,\n };\n}\n\n/** Applies the delivery rules owned by the resolved variant's network. */\nfunction prepareExportContent(context: ExportVariantContext): Promise<string | Uint8Array> {\n switch (context.variant.network) {\n case 'applovin':\n return prepareAppLovinExport(context);\n case 'google':\n return prepareGoogleExport(context);\n case 'liftoff':\n return prepareLiftoffExport(context);\n case 'meta':\n return prepareMetaExport(context);\n case 'mintegral':\n return prepareMintegralExport(context);\n case 'moloco':\n return prepareMolocoExport(context);\n case 'preview':\n return preparePreviewExport(context);\n case 'unity':\n return prepareUnityExport(context);\n default:\n throw new Error(`Unsupported export network: ${String(context.variant.network)}.`);\n }\n}\n","import { realpath } from 'node:fs/promises';\nimport { isAbsolute, relative, resolve, sep } from 'node:path';\n\nimport { resolveCanonicalPath } from '#shared/canonical-path.js';\nimport type { ExportDirectories } from '#types/directories.js';\n\nconst DEFAULT_OUTPUT_DIRECTORY = 'exports';\n\n/**\n * Resolves and validates the two generated roots used by export.\n *\n * Both directories must remain inside the project, and neither may contain the\n * other. This prevents the emission cleanup from deleting source builds. For\n * example, \"dist\" and \"exports\" are valid siblings, while \"dist/exports\" is not.\n */\nexport async function resolveExportDirectories(\n projectRoot: string,\n buildOutputPath: string,\n exportOutputPath = DEFAULT_OUTPUT_DIRECTORY,\n): Promise<ExportDirectories> {\n const canonicalProjectRoot = await realpath(projectRoot);\n const directories = {\n buildOutput: await resolveGeneratedDirectory(canonicalProjectRoot, buildOutputPath),\n exportOutput: await resolveGeneratedDirectory(canonicalProjectRoot, exportOutputPath),\n };\n\n assertDirectoriesDoNotOverlap(directories);\n\n return directories;\n}\n\n/** Resolves one generated root and rejects the project root or paths outside it. */\nasync function resolveGeneratedDirectory(\n projectRoot: string,\n configuredPath: string,\n): Promise<string> {\n const directory = await resolveCanonicalPath(resolve(projectRoot, configuredPath));\n const projectRelativePath = relative(projectRoot, directory);\n const escapesProject =\n projectRelativePath === '..' ||\n projectRelativePath.startsWith(`..${sep}`) ||\n isAbsolute(projectRelativePath);\n\n if (projectRelativePath === '' || escapesProject) {\n throw new Error(`Generated directory must be inside the project root: ${configuredPath}.`);\n }\n\n return directory;\n}\n\n/** Prevents export cleanup from removing builds or writing artifacts inside them. */\nfunction assertDirectoriesDoNotOverlap(directories: ExportDirectories): void {\n if (\n containsDirectory(directories.buildOutput, directories.exportOutput) ||\n containsDirectory(directories.exportOutput, directories.buildOutput)\n ) {\n throw new Error('The build and export directories must not overlap.');\n }\n}\n\n/**\n * Reports whether \"parent\" contains \"child\", including equality.\n *\n * For example, \"/project/dist\" contains \"/project/dist/google\", but it does not\n * contain the sibling \"/project/exports\".\n */\nfunction containsDirectory(parent: string, child: string): boolean {\n const childPath = relative(parent, child);\n\n return (\n childPath === '' ||\n (childPath !== '..' && !childPath.startsWith(`..${sep}`) && !isAbsolute(childPath))\n );\n}\n","import { stat } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport type { PlayableVariant } from '@replayablejs/config';\n\nimport { isMissingPathError } from '#shared/filesystem-error.js';\nimport { PLAYABLE_HTML_FILE } from '#shared/playable-html.js';\nimport type { ExportVariantContext } from '#types/context.js';\nimport type { ExportDirectories } from '#types/directories.js';\n\n/**\n * Resolves the existing build and future artifact paths for one variant.\n *\n * For example, the build \"dist/default/google/en/index.html\" becomes the\n * delivery artifact \"exports/google_default_en.zip\".\n * This function verifies the build but does not create the export directory.\n */\nexport async function resolveExportVariant(\n directories: ExportDirectories,\n variant: PlayableVariant,\n): Promise<ExportVariantContext> {\n const buildDirectory = join(directories.buildOutput, variant.id);\n const htmlFile = join(buildDirectory, PLAYABLE_HTML_FILE);\n\n await assertBuiltHtmlExists(variant.id, htmlFile);\n\n return {\n buildDirectory,\n outputFile: join(directories.exportOutput, resolveExportFileName(variant)),\n variant,\n };\n}\n\n/**\n * Selects the upload artifact name required by the destination network.\n *\n * Every name identifies its network, version, and language, such as\n * \"applovin_default_en.html\" or \"google_default_en.zip\".\n */\nfunction resolveExportFileName(variant: PlayableVariant): string {\n const artifactName = [variant.network, variant.version, variant.localization.language]\n .map(normalizeArtifactNameSegment)\n .join('_');\n\n switch (variant.network) {\n case 'applovin':\n case 'meta':\n case 'moloco':\n case 'preview':\n case 'unity':\n return `${artifactName}.html`;\n case 'google':\n case 'liftoff':\n case 'mintegral':\n return `${artifactName}.zip`;\n default:\n throw new Error(`Unsupported export network: ${String(variant.network)}.`);\n }\n}\n\n/** Produces a portable artifact-name segment containing letters, digits, and underscores. */\nfunction normalizeArtifactNameSegment(value: string): string {\n const segment = value\n .toLowerCase()\n .replace(/[^a-z\\d]+/gu, '_')\n .replace(/^_+|_+$/gu, '');\n\n return segment === '' ? 'playable' : segment;\n}\n\n/** Verifies that export consumes a completed build rather than rebuilding implicitly. */\nasync function assertBuiltHtmlExists(variantId: string, htmlFile: string): Promise<void> {\n try {\n const file = await stat(htmlFile);\n\n if (file.isFile()) {\n return;\n }\n } catch (error) {\n if (isMissingPathError(error)) {\n throw new Error(\n `Missing build for ${variantId}. Run replayable build before replayable export.`,\n { cause: error },\n );\n }\n\n throw new Error(`Unable to inspect build for ${variantId}: ${htmlFile}.`, { cause: error });\n }\n\n throw new Error(`Build output for ${variantId} is not an HTML file: ${htmlFile}.`);\n}\n","import { resolve } from 'node:path';\n\nimport { createVariants, defineConfig, type ReplayableConfigInput } from '@replayablejs/config';\n\nimport type { ExportProjectContext, ExportVariantContext } from '#types/context.js';\nimport type { ExportProjectOptions } from '#types/export.js';\n\nimport { resolveExportDirectories } from './resolve-export-directories.js';\nimport { resolveExportVariant } from './resolve-export-variant.js';\n\n/**\n * Resolves every existing variant build and its future export destination.\n *\n * This read-only stage parses the project configuration, validates the build and\n * export roots, verifies every expected build, and returns paths for preparation\n * and emission. It neither rebuilds variants nor changes existing exports.\n */\nexport async function resolveExportProject(\n input: ReplayableConfigInput,\n options: ExportProjectOptions,\n): Promise<ExportProjectContext> {\n const config = defineConfig(input);\n const projectRoot = resolve(options.projectRoot);\n const directories = await resolveExportDirectories(\n projectRoot,\n config.build.outDir,\n options.outputDirectory,\n );\n const variants = await Promise.all(\n createVariants(config).map((variant) => resolveExportVariant(directories, variant)),\n );\n\n assertUniqueOutputFiles(variants);\n\n return {\n outputDirectory: directories.exportOutput,\n variants,\n };\n}\n\n/** Rejects variants whose normalized names would overwrite the same delivery artifact. */\nfunction assertUniqueOutputFiles(variants: readonly ExportVariantContext[]): void {\n const variantByOutputFile = new Map<string, string>();\n\n for (const variant of variants) {\n const existingVariantId = variantByOutputFile.get(variant.outputFile);\n\n if (existingVariantId !== undefined) {\n throw new Error(\n `Export variants ${existingVariantId} and ${variant.variant.id} resolve to the same output file: ${variant.outputFile}.`,\n );\n }\n\n variantByOutputFile.set(variant.outputFile, variant.variant.id);\n }\n}\n","import type { ReplayableConfigInput } from '@replayablejs/config';\n\nimport { emitExportProject } from '#emission/emit-export-project.js';\nimport { prepareExportProject } from '#preparation/prepare-export-project.js';\nimport { resolveExportProject } from '#resolution/resolve-export-project.js';\nimport type { ExportProjectOptions, ExportProjectResult } from '#types/export.js';\n\n/**\n * Produces every upload-ready artifact from an existing Replayable project build.\n *\n * Resolution verifies the builds and assigns destinations. Preparation creates\n * every artifact in memory. Emission replaces the previous export directory only\n * after all preparation succeeds, preserving the last successful export on error.\n */\nexport async function exportProject(\n config: ReplayableConfigInput,\n options: ExportProjectOptions,\n): Promise<ExportProjectResult> {\n const project = await resolveExportProject(config, options);\n const artifacts = await prepareExportProject(project);\n\n return emitExportProject(project, artifacts);\n}\n"],"mappings":";;;;;;;;;;;;;AACA,SAAgB,mBAAmB,OAAyB;CAC1D,OAAO,iBAAiB,SAAS,UAAU,SAAS,MAAM,SAAS;AACrE;;;;;;;;;;;ACUA,eAAsB,qBAAqB,MAA+B;CACxE,MAAM,kBAA4B,CAAC;CACnC,IAAI,eAAe;CAEnB,OAAO,MAAM;EACX,IAAI;GACF,MAAM,gBAAgB,MAAM,SAAS,YAAY;GAEjD,OAAO,QAAQ,eAAe,GAAG,eAAe;EAClD,SAAS,OAAO;GACd,IAAI,CAAC,mBAAmB,KAAK,GAC3B,MAAM;EAEV;EAEA,MAAM,SAAS,QAAQ,YAAY;EAEnC,IAAI,WAAW,cACb,MAAM,IAAI,MAAM,8DAA8D,KAAK,EAAE;EAGvF,gBAAgB,QAAQ,SAAS,YAAY,CAAC;EAC9C,eAAe;CACjB;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACMA,eAAsB,qBACpB,iBACA,WACe;CACf,MAAM,SAAS,QAAQ,eAAe;CAGtC,MAAM,+BAA+B,eAAe;CACpD,MAAM,MAAM,QAAQ,EAAE,WAAW,KAAK,CAAC;CAGvC,MAAM,mBAAmB,MAAM,QAAQ,KAAK,QAAQ,IAAI,SAAS,eAAe,EAAE,UAAU,CAAC;CAC7F,MAAM,oBAAoB,KAAK,kBAAkB,UAAU;CAC3D,MAAM,kBAAkB,KAAK,kBAAkB,UAAU;CAGzD,IAAI,iBAAiB;CAErB,IAAI;EACF,MAAM,MAAM,iBAAiB;EAI7B,KAAK,MAAM,YAAY,WACrB,MAAM,UAAU,KAAK,mBAAm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cAAc,MAAM,yBADN,QAAQ,QAAQ,WAElC,GACA,OAAO,MAAM,QACb,QAAQ,eACV;CACA,MAAM,WAAW,MAAM,QAAQ,IAC7B,eAAe,MAAM,CAAC,CAAC,KAAK,YAAY,qBAAqB,aAAa,OAAO,CAAC,CACpF;CAEA,wBAAwB,QAAQ;CAEhC,OAAO;EACL,iBAAiB,YAAY;EAC7B;CACF;AACF;;AAGA,SAAS,wBAAwB,UAAiD;CAChF,MAAM,sCAAsB,IAAI,IAAoB;CAEpD,KAAK,MAAM,WAAW,UAAU;EAC9B,MAAM,oBAAoB,oBAAoB,IAAI,QAAQ,UAAU;EAEpE,IAAI,sBAAsB,KAAA,GACxB,MAAM,IAAI,MACR,mBAAmB,kBAAkB,OAAO,QAAQ,QAAQ,GAAG,oCAAoC,QAAQ,WAAW,EACxH;EAGF,oBAAoB,IAAI,QAAQ,YAAY,QAAQ,QAAQ,EAAE;CAChE;AACF;;;;;;;;;;ACzCA,eAAsB,cACpB,QACA,SAC8B;CAC9B,MAAM,UAAU,MAAM,qBAAqB,QAAQ,OAAO;CAG1D,OAAO,kBAAkB,SAAS,MAFV,qBAAqB,OAAO,CAET;AAC7C"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@replayablejs/export",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "Network delivery exporters for Replayable playable ads",
|
|
5
|
+
"homepage": "https://github.com/replayablejs/replayable#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/replayablejs/replayable/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/replayablejs/replayable.git",
|
|
13
|
+
"directory": "packages/export"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"imports": {
|
|
21
|
+
"#emission/*": "./src/emission/*",
|
|
22
|
+
"#pipeline/*": "./src/pipeline/*",
|
|
23
|
+
"#preparation/*": "./src/preparation/*",
|
|
24
|
+
"#resolution/*": "./src/resolution/*",
|
|
25
|
+
"#shared/*": "./src/shared/*",
|
|
26
|
+
"#types/*": "./src/types/*",
|
|
27
|
+
"#validation/*": "./src/validation/*"
|
|
28
|
+
},
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.mts",
|
|
32
|
+
"import": "./dist/index.mjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"acorn": "8.18.0",
|
|
40
|
+
"acorn-walk": "8.3.4",
|
|
41
|
+
"cheerio": "1.2.0",
|
|
42
|
+
"esbuild": "0.28.2",
|
|
43
|
+
"fflate": "0.8.3",
|
|
44
|
+
"pako": "2.1.0",
|
|
45
|
+
"terser": "5.51.2",
|
|
46
|
+
"@replayablejs/config": "0.1.0-alpha.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "26.2.0",
|
|
50
|
+
"@types/pako": "2.0.4",
|
|
51
|
+
"tsdown": "0.22.14",
|
|
52
|
+
"typescript": "7.0.2",
|
|
53
|
+
"vitest": "4.1.10"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=24.0.0"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsdown",
|
|
60
|
+
"dev": "tsdown --watch",
|
|
61
|
+
"lint": "oxlint --type-aware --max-warnings 0 .",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"typecheck": "tsc --noEmit"
|
|
64
|
+
}
|
|
65
|
+
}
|