import { readFileSync } from 'node:fs'; import { join, resolve } from 'node:path'; import { dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; const rootDir = resolve(dirname(fileURLToPath(import.meta.url)), '..'); const runtimeDir = join(rootDir, 'runtime', 'nianxx-play'); function readJson(relativePath) { return JSON.parse(readFileSync(join(runtimeDir, relativePath), 'utf8')); } const manifest = readJson('bundle-manifest.json'); const pkg = readJson('package.json'); const paths = readJson('.next/server/app-paths-manifest.json'); const modes = readJson('content/seedance-starter/creation-modes.json'); const catalog = readJson('content/seedance-starter/catalog.json'); const planningCases = readJson('content/planning-cases.json'); const modeCounts = {}; for (const item of catalog.cases || []) { modeCounts[item.mode] = (modeCounts[item.mode] || 0) + 1; } console.log(JSON.stringify({ project: 'Zhinian Creation Assistant', packageName: 'zhinian-creation-assistant', runtime: { appId: manifest.appId, name: manifest.name, version: manifest.version, bundledAt: manifest.bundledAt, entry: manifest.entry, sizeBytes: manifest.sizeBytes, }, package: { name: pkg.name, version: pkg.version, dependencies: pkg.dependencies, }, routes: Object.keys(paths).sort(), creationModes: modes.map((mode) => ({ id: mode.id, name: mode.name, editorType: mode.editorType, assetSlots: mode.assetSlots, })), catalog: { totalCases: (catalog.cases || []).length, modeCounts, }, planningCases: planningCases.map((item) => ({ id: item.id, title: item.title, orientation: item.orientation, })), }, null, 2));