@bf6mods/cli 1.1.2 → 1.2.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/README.md +1 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +665 -781
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -1
- package/dist/resources/templates/All/package.json +3 -2
- package/package.json +5 -4
- package/dist/index.js.map +0 -1
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/index.ts","../../package.json","../../src/cli/build/index.ts","../../src/resources/prepare/types/config.ts","../../src/cli/build/generated-strings.ts","../../src/cli/dev.ts","../../src/cli/import.ts","../../src/cli/init.ts","../../src/cli/prepare.ts","../../src/cli/utils.ts","../../../../node_modules/ansi-regex/index.js","../../../../node_modules/strip-ansi/index.js"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from \"commander\";\nimport pkg from \"../../package.json\" with { type: \"json\" };\nimport { build } from \"./build/index.ts\";\nimport { dev } from \"./dev.ts\";\nimport { importFile } from \"./import.ts\";\nimport { init, installDependencies } from \"./init.js\";\nimport { prepare } from \"./prepare.js\";\n\nconst program = new Command();\n\nprogram\n\t.name(Object.keys(pkg.bin)[0])\n\t.description(pkg.description)\n\t.version(pkg.version);\n\nprogram\n\t.command(\"init\")\n\t.argument(\"[directory]\")\n\t.description(\"Create a new bf6 mod\")\n\t.action(async (directory) => {\n\t\tawait init(directory);\n\t});\n\nprogram\n\t.command(\"build\")\n\t.description(\"build the bf6 mod\")\n\t.action(async () => {\n\t\tawait build();\n\t});\n\nprogram\n\t.command(\"prepare\")\n\t.description(\"prepare the types for bf6 mod\")\n\t.action(async () => {\n\t\tawait prepare();\n\t});\n\nprogram\n\t.command(\"dev\")\n\t.description(\"watch the changes in src, and recompile as needed\")\n\t.action(async () => {\n\t\tawait dev();\n\t});\n\nprogram\n\t.command(\"import\")\n\t.argument(\"<input>\")\n\t.argument(\"<output>\")\n\t.description(\"decompiles the json config of a mod into a new project\")\n\t.action(async (input, output) => {\n\t\tawait importFile(input as string, output as string);\n\t\tinstallDependencies(output);\n\t});\n\nprogram.exitOverride((_err) => {\n\tif (process.env.EXIT_CODE === \"none\") process.exit(0);\n});\n\nprogram.parse();\n","{\n\t\"name\": \"@bf6mods/cli\",\n\t\"version\": \"1.0.2\",\n\t\"description\": \"CLI and library for bundling BF6 mods\",\n\t\"license\": \"MIT\",\n\t\"type\": \"module\",\n\t\"bin\": {\n\t\t\"bf6mods\": \"./dist/cli/index.js\"\n\t},\n\t\"main\": \"./dist/index.js\",\n\t\"types\": \"./dist/index.d.ts\",\n\t\"scripts\": {\n\t\t\"build\": \"tsup\",\n\t\t\"start\": \"cross-env EXIT_CODE=none tsx ./src/cli/index.ts\"\n\t},\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/index.d.ts\",\n\t\t\t\"import\": \"./dist/index.js\"\n\t\t}\n\t},\n\t\"files\": [\n\t\t\"dist/\"\n\t],\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"git+https://github.com/bf6mods/bf6mods.git\"\n\t},\n\t\"dependencies\": {\n\t\t\"@bf6mods/sdk\": \"1.0.3\",\n\t\t\"@clack/prompts\": \"^0.11.0\",\n\t\t\"chokidar\": \"^4.0.3\",\n\t\t\"colors\": \"^1.4.0\",\n\t\t\"commander\": \"^14.0.1\",\n\t\t\"jiti\": \"^2.6.1\",\n\t\t\"knitwork\": \"^1.2.0\",\n\t\t\"rolldown\": \"^1.0.0-beta.43\",\n\t\t\"stringify-object\": \"^6.0.0\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@oxc-project/types\": \"^0.95.0\",\n\t\t\"@types/stringify-object\": \"^4.0.5\",\n\t\t\"cross-env\": \"^10.1.0\",\n\t\t\"tsx\": \"^4.20.6\"\n\t}\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport {\n\ttype Attachment,\n\tAttachmentType,\n\ttype ConfigType,\n\ttype MapType,\n} from \"@bf6mods/sdk\";\nimport { createJiti } from \"jiti\";\nimport { type Plugin, rolldown } from \"rolldown\";\nimport {\n\ttype Bf6Config,\n\tMapId as MapIdEnum,\n} from \"../../resources/prepare/types/config.ts\";\nimport { extractBf6Strings } from \"./generated-strings.ts\";\n\ndeclare global {\n\tvar defineBf6Config: ((config: Bf6Config) => Bf6Config) | undefined;\n\tvar MapId: typeof MapIdEnum | undefined;\n}\n\n/**\n * Dynamically imports and validates bf6.config.ts\n */\nexport async function getBf6Config(rootDir: string): Promise<Bf6Config> {\n\tglobalThis.defineBf6Config = (c) => c;\n\tglobalThis.MapId = MapIdEnum;\n\tconst jiti = createJiti(rootDir, { interopDefault: true });\n\tconst result = await jiti.import(\"./bf6.config\", { default: true });\n\tdelete globalThis.defineBf6Config;\n\tdelete globalThis.MapId;\n\treturn result as Bf6Config;\n}\n\n/**\n * Builds the entire mod project once (for production or single run).\n */\nexport async function build() {\n\tconst workingDir = path.resolve(\".\");\n\tconst config = await getBf6Config(workingDir);\n\n\tconst outDir = path.resolve(workingDir, config.outDir);\n\tif (fs.existsSync(outDir))\n\t\tfs.rmSync(outDir, { recursive: true, force: true });\n\tfs.mkdirSync(outDir, { recursive: true });\n\n\tconst minifyJson =\n\t\ttypeof config.minify === \"boolean\"\n\t\t\t? config.minify\n\t\t\t: (config.minify?.json ?? false);\n\n\tconst generatedStrings = {};\n\tlet tsAttachment: Attachment | undefined;\n\tif (config.entrypoint) {\n\t\tconst entryAbs = path.resolve(workingDir, config.entrypoint);\n\t\tconst compiled = await buildEntrypoint(\n\t\t\tentryAbs,\n\t\t\tgeneratedStrings,\n\t\t\tconfig.generateStrings ?? true,\n\t\t);\n\t\ttsAttachment = createTsAttachment(entryAbs, compiled);\n\t}\n\n\tconst { attachments, mapRotation } = await collectAttachments(\n\t\tconfig,\n\t\tworkingDir,\n\t\ttsAttachment,\n\t\tgeneratedStrings,\n\t);\n\n\tawait writeModJson(config, outDir, attachments, mapRotation, minifyJson);\n\tconsole.log(`✔ Built mod: ${config.name}`);\n}\n\nexport function helloPlugin(message = \"hello-plugin ran ✅\"): Plugin {\n\treturn {\n\t\tname: \"hello-plugin\",\n\n\t\t// Fires once when the build starts\n\t\tbuildStart() {\n\t\t\t// Prefer the bundler's logger so it shows up in Rolldown's output\n\t\t\t// (Rolldown forwards plugin warnings to the console.)\n\t\t\ttry {\n\t\t\t\t// Rollup-style API: this.warn(...) is widely supported\n\t\t\t\tthis.warn({ code: \"HELLO_PLUGIN\", message });\n\t\t\t} catch {\n\t\t\t\t// Fallback if the context logger isn't available\n\t\t\t\t// (e.g., if API changes or running programmatically)\n\t\t\t\tconsole.log(`[hello-plugin] ${message}`);\n\t\t\t}\n\t\t},\n\n\t\t// Also log at bundle time to show multiple hook points\n\t\tgenerateBundle() {\n\t\t\ttry {\n\t\t\t\tthis.warn({\n\t\t\t\t\tcode: \"HELLO_PLUGIN\",\n\t\t\t\t\tmessage: `${message} (generateBundle)`,\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\tconsole.log(`[hello-plugin] ${message} (generateBundle)`);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Compiles the TypeScript entrypoint using rolldown and returns the compiled code.\n */\nexport async function buildEntrypoint(\n\tentry: string,\n\tbf6Strings: Record<string, string>,\n\tgenerateStringsFromLiterals: boolean,\n): Promise<string> {\n\tconst bundle = await rolldown({\n\t\tinput: entry,\n\t\tplugins: [extractBf6Strings(bf6Strings, generateStringsFromLiterals)],\n\t\tlogLevel: \"debug\",\n\t});\n\tconst result = await bundle.generate({\n\t\tformat: \"esm\",\n\t\tinlineDynamicImports: true,\n\t});\n\n\tconst code = result.output[0].code;\n\treturn code;\n}\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\nconst spatialsDir = path.resolve(__dirname, \"../resources/maps/spatial\");\n/**\n * Collects all attachments (TS, scenes, strings) and returns them + mapRotation.\n */\nexport async function collectAttachments(\n\tconfig: Bf6Config,\n\tworkingDir: string,\n\ttsAttachment: Attachment | undefined,\n\tgeneratedStrings: Record<string, number | string> | undefined,\n) {\n\tconst attachments: Attachment[] = [];\n\tconst mapRotation: MapType[] = [];\n\n\tif (tsAttachment) attachments.push(tsAttachment);\n\n\t// Strings\n\tif (config.strings) {\n\t\tconst strPath = path.resolve(workingDir, config.strings);\n\t\tif (!fs.existsSync(strPath)) throw new Error(\"Cannot find strings file\");\n\t\tconst raw = await fs.promises.readFile(strPath, \"utf8\");\n\t\tconst attachment = createStringsAttachment(strPath, raw, generatedStrings);\n\t\tattachments.push(attachment);\n\t}\n\n\t// Scenes\n\tif (config.scenes) {\n\t\tlet mapIdx = 0;\n\t\tfor (const map of config.scenes) {\n\t\t\tlet mapId: MapIdEnum;\n\t\t\tlet scene: string;\n\t\t\tif (Array.isArray(map)) {\n\t\t\t\t[mapId, scene] = map;\n\t\t\t} else {\n\t\t\t\tmapId = map;\n\t\t\t\tscene = path.resolve(spatialsDir, `${mapId}.spatial.json`);\n\t\t\t}\n\n\t\t\tconst scenePath = path.resolve(workingDir, scene);\n\t\t\tif (!fs.existsSync(scenePath))\n\t\t\t\tthrow new Error(`Cannot find spatial data file: ${scene}`);\n\t\t\tconst raw = await fs.promises.readFile(scenePath, \"utf8\");\n\t\t\tconst spatial = createSpatialAttachment(scenePath, raw, mapIdx++);\n\t\t\tattachments.push(spatial);\n\t\t\tmapRotation.push({ id: mapId, spatialAttachment: spatial });\n\t\t}\n\t}\n\n\treturn { attachments, mapRotation };\n}\n\n/**\n * Writes the mod.json output to disk.\n */\nexport async function writeModJson(\n\tconfig: Bf6Config,\n\toutDir: string,\n\tattachments: ConfigType[\"attachments\"],\n\tmapRotation: MapType[],\n\tminify: boolean,\n) {\n\tconst baseGame = config.game;\n\tconst finalJson: ConfigType = {\n\t\tname: config.name,\n\t\tdescription: config.description,\n\t\tgameMode: \"ModBuilderCustom\",\n\t\tmutators: baseGame.mutators ?? {},\n\t\tassetRestrictions: baseGame.assetRestrictions ?? {},\n\t\tteamComposition: baseGame.teamComposition ?? [],\n\t\tmapRotation,\n\t\tattachments,\n\t};\n\n\tconst jsonOutput = minify\n\t\t? JSON.stringify(finalJson)\n\t\t: JSON.stringify(finalJson, null, 2);\n\tawait fs.promises.writeFile(path.resolve(outDir, \"mod.json\"), jsonOutput);\n\n\tif (config.outputArtifacts && finalJson?.attachments) {\n\t\tfor (const attachment of finalJson.attachments) {\n\t\t\tconst attachmentsDir = path.resolve(outDir, \"attachments\");\n\t\t\tif (!fs.existsSync(attachmentsDir))\n\t\t\t\tfs.mkdirSync(attachmentsDir, {\n\t\t\t\t\trecursive: true,\n\t\t\t\t});\n\t\t\tawait fs.promises.writeFile(\n\t\t\t\tpath.resolve(outDir, \"attachments\", attachment.filename),\n\t\t\t\tatob(attachment.attachmentData.original),\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport function createTsAttachment(\n\tfilePath: string,\n\tcompiled: string,\n): Attachment {\n\treturn {\n\t\tid: crypto.randomUUID(),\n\t\tversion: \"1.0\",\n\t\tfilename: `${path.parse(filePath).name}.js`,\n\t\tisProcessable: true,\n\t\tprocessingStatus: 2,\n\t\tattachmentType: AttachmentType.TypeScript,\n\t\tattachmentData: { original: toBase64(compiled), compiled: \"\" },\n\t\terrors: [],\n\t};\n}\n\nexport function createStringsAttachment(\n\tfilePath: string,\n\traw: string,\n\tgeneratedStrings?: Record<string, number | string> | undefined,\n): Attachment {\n\tlet result = raw;\n\tif (generatedStrings) {\n\t\tresult = JSON.stringify(\n\t\t\t{\n\t\t\t\t...generatedStrings,\n\t\t\t\t...JSON.parse(raw),\n\t\t\t},\n\t\t\tnull,\n\t\t\t4,\n\t\t);\n\t}\n\n\treturn {\n\t\tid: crypto.randomUUID(),\n\t\tversion: \"1.0\",\n\t\tfilename: path.basename(filePath),\n\t\tisProcessable: true,\n\t\tprocessingStatus: 2,\n\t\tattachmentType: AttachmentType.Strings,\n\t\tattachmentData: { original: toBase64(result), compiled: \"\" },\n\t\terrors: [],\n\t};\n}\n\nexport function createSpatialAttachment(\n\tfilePath: string,\n\traw: string,\n\tmapIdx: number,\n): MapType[\"spatialAttachment\"] {\n\treturn {\n\t\tid: crypto.randomUUID(),\n\t\tversion: \"1.0\",\n\t\tfilename: path.basename(filePath),\n\t\tisProcessable: true,\n\t\tprocessingStatus: 2,\n\t\tattachmentType: AttachmentType.SpatialData,\n\t\tattachmentData: { original: toBase64(raw), compiled: \"\" },\n\t\tmetadata: `mapIdx=${mapIdx}`,\n\t\terrors: [],\n\t};\n}\n\nexport function toBase64(input: string | Buffer): string {\n\treturn Buffer.isBuffer(input)\n\t\t? input.toString(\"base64\")\n\t\t: Buffer.from(input, \"utf8\").toString(\"base64\");\n}\n","import type { ConfigType } from \"@bf6mods/sdk\";\n\nexport enum MapId {\n\tFireStorm = \"MP_FireStorm-ModBuilderCustom0\",\n\tSiegeOfCairo = \"MP_Abbasid-ModBuilderCustom0\",\n\tEmpireState = \"MP_Aftermath-ModBuilderCustom0\",\n\tIberianOffensive = \"MP_Battery-ModBuilderCustom0\",\n\tLiberationPeak = \"MP_Capstone-ModBuilderCustom0\",\n\tManhattanBridge = \"MP_Dumbo-ModBuilderCustom0\",\n\tSaintsQuarter = \"MP_Limestone-ModBuilderCustom0\",\n\tNewSobekCity = \"MP_Outskirts-ModBuilderCustom0\",\n\tMirakValley = \"MP_Tungsten-ModBuilderCustom0\",\n}\n\n/**\n * Represents the root configuration for a Battlefield 6 mod project.\n *\n * This file combines both build-level settings (like entrypoints and output directories)\n * and in-game configuration data (such as mutators and asset restrictions)\n * under the `game` key.\n *\n * Use {@link defineBf6Config} to define and validate this structure\n * in your `bf6.config.ts` file.\n */\nexport type Bf6Config = {\n\t/**\n\t * The human-readable name of the mod.\n\t *\n\t * Typically matches the project name used in the BF6 mod editor or\n\t * the display name shown in the in-game mod browser.\n\t */\n\tname: string;\n\n\t/**\n\t * A short description of the mod’s purpose or content.\n\t * Used for display and metadata purposes.\n\t */\n\tdescription: string;\n\n\t/**\n\t * The output directory where compiled or bundled files are written.\n\t * Usually something like `\"dist\"` or `\"build\"`.\n\t */\n\toutDir: string;\n\n\t/**\n\t * Whether or not to output the built files like the entrypoint typescript file\n\t */\n\toutputArtifacts?: boolean;\n\n\t/**\n\t * The main entrypoint for your mod’s TypeScript source file.\n\t *\n\t * This is typically something like `\"src/index.ts\"` or `\"src/main.ts\"`.\n\t */\n\tentrypoint?: string;\n\n\t/**\n\t * One or more scene file paths (.json) that the mod includes.\n\t * If no file path is provided, it loads in the default spatial data.\n\t */\n\tscenes?: ([MapId, string] | MapId)[];\n\n\t/**\n\t * Path to a JSON file or other source that defines localized strings\n\t * used by the mod (optional).\n\t */\n\tstrings?: string;\n\n\t/**\n\t * Generate strings automatically, by default this is enabled\n\t */\n\tgenerateStrings?: boolean;\n\n\t/**\n\t * Controls whether build output should be minified.\n\t *\n\t * Can be a boolean (to toggle all minification),\n\t * or an object specifying independent settings for JS and JSON files.\n\t *\n\t * @example\n\t * ```ts\n\t * minify: true\n\t * // or\n\t * minify: { js: true, json: false }\n\t * ```\n\t */\n\tminify?:\n\t\t| {\n\t\t\t\t/** Whether to minify JavaScript output. */\n\t\t\t\tjs?: boolean;\n\t\t\t\t/** Whether to minify JSON output. */\n\t\t\t\tjson?: boolean;\n\t\t }\n\t\t/** Enables or disables all minification. */\n\t\t| boolean;\n\n\t/**\n\t * The underlying in-game configuration derived from `ConfigType`\n\t * in the BF6 SDK. Includes gameplay-level details like mutators,\n\t * asset restrictions, and team compositions.\n\t *\n\t * The following properties are **excluded**:\n\t * - `attachments`\n\t * - `workspace`\n\t * - `mapRotation`\n\t * - `name`\n\t * - `description`\n\t *\n\t * since those are either redundant or handled elsewhere.\n\t */\n\tgame: Omit<\n\t\tConfigType,\n\t\t\"attachments\" | \"workspace\" | \"mapRotation\" | \"name\" | \"description\"\n\t>;\n};\n\n/**\n * Defines and validates a Battlefield 6 mod configuration object.\n *\n * This helper ensures your config is properly typed and can be\n * statically analyzed by TypeScript.\n *\n * @example\n * ```ts\n * export default defineBf6Config({\n * name: \"My Custom Mod\",\n * description: \"Adds custom rules\",\n * outDir: \"dist\",\n * entrypoint: \"src/main.ts\",\n * game: {\n * mutators: [],\n * assetRestrictions: {},\n * teamComposition: [],\n * },\n * });\n * ```\n *\n * @param bf6Config The configuration object to validate and return.\n * @returns The validated Battlefield 6 configuration object.\n */\nexport function defineBf6Config(bf6Config: Bf6Config): Bf6Config {\n\treturn bf6Config;\n}\n","import type { Node, ObjectProperty, VariableDeclarator } from \"@oxc-project/types\";\nimport type { Plugin } from \"rolldown\";\n\nexport function extractBf6Strings(\n\tbf6Strings: Record<string, string>,\n\tgenerateFromLiterals: boolean,\n): Plugin {\n\treturn {\n\t\tname: \"extract-bf6-strings\",\n\t\tgenerateBundle(_options, bundle) {\n\t\t\tif (!generateFromLiterals) return;\n\n\t\t\tlet id = 0;\n\t\t\tconst existingStrings = new Set(Object.values(bf6Strings));\n\n\t\t\tfor (const [_file, output] of Object.entries(bundle)) {\n\t\t\t\tif (output.type !== \"chunk\") continue;\n\t\t\t\tconst code = output.code;\n\n\t\t\t\t// Parse the code with rolldown’s parser\n\t\t\t\tconst program = this.parse(code, {\n\t\t\t\t\tlang: \"ts\",\n\t\t\t\t\tastType: \"js\",\n\t\t\t\t\trange: true,\n\t\t\t\t});\n\n\t\t\t\t// Visit every node recursively to collect string literals\n\t\t\t\tfunction walk(node: Node) {\n\t\t\t\t\tif (node.type === \"Literal\") {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof node.value !== \"string\" ||\n\t\t\t\t\t\t\tnode.value === \"\" ||\n\t\t\t\t\t\t\tnode.value === \"----uniquename----\"\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!(node.value in bf6Strings) &&\n\t\t\t\t\t\t\t!existingStrings.has(node.value)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\texistingStrings.add(node.value);\n\t\t\t\t\t\t\tbf6Strings[`__auto__${id++}`] = node.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (const value of Object.values(node)) {\n\t\t\t\t\t\tif (!value) continue;\n\t\t\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\t\t\tfor (const v of value) {\n\t\t\t\t\t\t\t\tif (v && typeof v === \"object\" && \"type\" in v) walk(v as Node);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (typeof value === \"object\" && \"type\" in value) {\n\t\t\t\t\t\t\twalk(value as Node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const item of program.body) {\n\t\t\t\t\twalk(item);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tmoduleParsed(moduleInfo) {\n\t\t\tif (moduleInfo.code && moduleInfo.exports.includes(\"bf6Strings\")) {\n\t\t\t\tconst code = moduleInfo.code;\n\t\t\t\tconst getSnippet = (\n\t\t\t\t\tstart: number,\n\t\t\t\t\tend: number,\n\t\t\t\t\tlinesBefore = 2,\n\t\t\t\t\tlinesAfter = 2,\n\t\t\t\t) => {\n\t\t\t\t\tconst lines = code.split(/\\r?\\n/);\n\t\t\t\t\tconst startLine = Math.max(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tcode.slice(0, start).split(/\\r?\\n/).length - 1 - linesBefore,\n\t\t\t\t\t);\n\t\t\t\t\tconst endLine = Math.min(\n\t\t\t\t\t\tlines.length,\n\t\t\t\t\t\tcode.slice(0, end).split(/\\r?\\n/).length - 1 + linesAfter,\n\t\t\t\t\t);\n\t\t\t\t\treturn lines\n\t\t\t\t\t\t.slice(startLine, endLine)\n\t\t\t\t\t\t.map((line, i) => {\n\t\t\t\t\t\t\tconst actualLine = startLine + i + 1;\n\t\t\t\t\t\t\treturn `${actualLine.toString().padStart(3)} | ${line}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(\"\\n\");\n\t\t\t\t};\n\n\t\t\t\tconst program = this.parse(code, {\n\t\t\t\t\tlang: \"ts\",\n\t\t\t\t\tastType: \"js\",\n\t\t\t\t\trange: true,\n\t\t\t\t});\n\n\t\t\t\tconst extractObjectLiteral = (declaration: VariableDeclarator) => {\n\t\t\t\t\tif (declaration.init?.type !== \"ObjectExpression\") {\n\t\t\t\t\t\t\tconst snippet = getSnippet(...(declaration.range ?? [0, 0]));\n\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t`❌ Invalid bf6Strings export: expected an object literal.\\n\\n${snippet}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const property of declaration.init.properties) {\n\t\t\t\t\t\t\tif (property.type !== \"Property\") {\n\t\t\t\t\t\t\t\tconst snippet = getSnippet(...(property.range ?? [0, 0]));\n\t\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t\t`❌ Invalid bf6Strings property: expected a key/value pair.\\nFound type: ${property.type}\\n\\n${snippet}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet key: string | number | bigint | boolean | RegExp | null | undefined = undefined;\n\t\t\t\t\t\t\tif (property.key.type === \"Literal\") {\n\t\t\t\t\t\t\t\tkey = property.key.value;\n\t\t\t\t\t\t\t} else if (property.key.type === \"Identifier\") {\n\t\t\t\t\t\t\t\tkey = property.key.name;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst snippet = getSnippet(...(property.range ?? [0, 0]));\n\t\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t\t`❌ Invalid bf6Strings key: expected a string literal or identifier.\\nFound type: ${property.key.type}\\n\\n${snippet}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (property.value.type !== \"Literal\") {\n\t\t\t\t\t\t\t\tconst snippet = getSnippet(...(property.range ?? [0, 0]));\n\t\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t\t`❌ Invalid bf6Strings value: expected a string literal.\\nFound type: ${property.value.type}\\n\\n${snippet}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst value = property.value.value;\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttypeof key !== \"string\" &&\n\t\t\t\t\t\t\t\ttypeof key !== \"number\" &&\n\t\t\t\t\t\t\t\ttypeof key !== \"bigint\" &&\n\t\t\t\t\t\t\t\ttypeof key !== \"boolean\"\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tconst snippet = getSnippet(...(property.range ?? [0, 0]));\n\t\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t\t`❌ bf6Strings key must be a string, found: ${typeof key}\\n\\n${snippet}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttypeof value !== \"string\" &&\n\t\t\t\t\t\t\t\ttypeof value !== \"number\" &&\n\t\t\t\t\t\t\t\ttypeof value !== \"bigint\" &&\n\t\t\t\t\t\t\t\ttypeof value !== \"boolean\"\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tconst snippet = getSnippet(...(property.range ?? [0, 0]));\n\t\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t\t`❌ bf6Strings value must be a string, found: ${typeof value}\\n\\n${snippet}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbf6Strings[`${key}`] = `${value}`;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tfor (const item of program.body) {\n\t\t\t\t\t// Case 1: plain variable `var bf6Strings = {...}`\n\t\t\t\t\tif (item.type === \"VariableDeclaration\") {\n\t\t\t\t\t\tfor (const declaration of item.declarations) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdeclaration.type === \"VariableDeclarator\" &&\n\t\t\t\t\t\t\t\tdeclaration.id.type === \"Identifier\" &&\n\t\t\t\t\t\t\t\tdeclaration.id.name === \"bf6Strings\"\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\textractObjectLiteral(declaration);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Case 2: exported variable `export const bf6Strings = {...}`\n\t\t\t\t\tif (item.type === \"ExportNamedDeclaration\" && item.declaration?.type === \"VariableDeclaration\") {\n\t\t\t\t\t\tfor (const declaration of item.declaration.declarations) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdeclaration.type === \"VariableDeclarator\" &&\n\t\t\t\t\t\t\t\tdeclaration.id.type === \"Identifier\" &&\n\t\t\t\t\t\t\t\tdeclaration.id.name === \"bf6Strings\"\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\textractObjectLiteral(declaration);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n}\n","import fs from \"node:fs\";\nimport { glob } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport chokidar, { type FSWatcher } from \"chokidar\";\nimport colors from \"colors\";\nimport { build, getBf6Config } from \"./build/index.ts\";\n\nexport async function dev() {\n\tconst workingDir = path.resolve(\".\");\n\tlet config = await getBf6Config(workingDir);\n\tconst outDir = path.resolve(workingDir, config.outDir);\n\tif (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });\n\n\tconsole.log(colors.cyan(`▶ Starting dev for ${config.name}`));\n\n\tlet watcher: FSWatcher | undefined;\n\n\tasync function rebuild(trigger: string) {\n\t\tconsole.log(\n\t\t\tcolors.yellow(\n\t\t\t\t`↻ Change detected in ${path.basename(trigger)}, rebuilding...`,\n\t\t\t),\n\t\t);\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tawait build();\n\t\t\tconst end = performance.now();\n\t\t\tconst duration = ((end - start) / 1000).toFixed(2);\n\t\t\tconsole.log(colors.green(`✔ Updated mod.json (${duration}s)`));\n\t\t} catch (err) {\n\t\t\tconsole.error(colors.red(`✖ Rebuild failed: ${(err as Error).message}`));\n\t\t}\n\t}\n\n\tasync function collectWatchTargets(): Promise<string[]> {\n\t\tconst targets: string[] = [];\n\n\t\tif (config.entrypoint)\n\t\t\ttargets.push(path.resolve(workingDir, config.entrypoint));\n\t\tif (config.scenes) {\n\t\t\tfor (const [, scene] of config.scenes) {\n\t\t\t\ttargets.push(path.resolve(workingDir, scene));\n\t\t\t}\n\t\t}\n\t\tif (config.strings) targets.push(path.resolve(workingDir, config.strings));\n\n\t\tconst srcDir = path.resolve(workingDir, \"src\");\n\t\tfor await (const entry of glob(`${srcDir}/**/*`)) targets.push(entry);\n\n\t\tfor await (const entry of glob(\"bf6.config.*\")) targets.push(entry);\n\n\t\treturn targets;\n\t}\n\n\tasync function setupWatcher() {\n\t\tif (watcher) {\n\t\t\tawait watcher.close();\n\t\t\tconsole.log(colors.grey(\"♻ Reloading watcher due to config change...\"));\n\t\t}\n\n\t\tconst watchTargets = await collectWatchTargets();\n\n\t\twatcher = chokidar.watch(watchTargets, {\n\t\t\tpersistent: true,\n\t\t\tignoreInitial: true,\n\t\t\tawaitWriteFinish: true,\n\t\t\tignored: [path.resolve(outDir), `${path.resolve(outDir)}/**`],\n\t\t});\n\n\t\twatcher.on(\"change\", async (file) => {\n\t\t\tif (file.includes(\"bf6.config.\")) {\n\t\t\t\tconsole.log(\n\t\t\t\t\tcolors.magenta(\n\t\t\t\t\t\t\"⚙ Config changed — reloading and rebuilding watcher...\",\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\ttry {\n\t\t\t\t\tconfig = await getBf6Config(workingDir);\n\t\t\t\t\tawait setupWatcher();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\tcolors.red(`✖ Failed to reload config: ${(err as Error).message}`),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tawait rebuild(file);\n\t\t});\n\n\t\twatcher.on(\"add\", async (file) => await rebuild(file));\n\n\t\tawait rebuild(\"initial\");\n\t}\n\n\tawait setupWatcher();\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { AttachmentType, type ConfigType } from \"@bf6mods/sdk\";\nimport stringifyObject from \"stringify-object\";\nimport { MapId as MapIdEnum } from \"../resources/prepare/types/config.ts\";\nimport { startProject } from \"./init.ts\";\n\nasync function writeFileSafe(filePath: string, data: string | Buffer) {\n\tconst dir = path.dirname(filePath);\n\tawait fs.promises.mkdir(dir, { recursive: true });\n\tawait fs.promises.writeFile(filePath, data);\n}\n\nfunction getMapKeyByValue(value: string): keyof typeof MapIdEnum | undefined {\n\treturn Object.keys(MapIdEnum).find(\n\t\t(k) => MapIdEnum[k as keyof typeof MapIdEnum] === value,\n\t) as keyof typeof MapIdEnum | undefined;\n}\n\nexport async function importFile(input: string, output: string, name?: string) {\n\tconst workingDir = path.resolve(\".\");\n\tconst entrypoint = path.resolve(workingDir, input);\n\tconst outDir = path.resolve(workingDir, output);\n\n\tif (!fs.existsSync(entrypoint)) throw new Error(\"Cannot find strings file\");\n\n\tconst config = JSON.parse(\n\t\tawait fs.promises.readFile(entrypoint, { encoding: \"utf8\" }),\n\t) as ConfigType;\n\n\tif (!fs.existsSync(outDir))\n\t\tawait fs.promises.mkdir(outDir, { recursive: true });\n\n\tawait startProject(outDir, \"None\", name ?? config.name);\n\n\tlet typescriptFile: string | undefined;\n\tlet stringsFile: string | undefined;\n\tconst scenes: [string, string][] = [];\n\tconst promises: Promise<unknown>[] = [];\n\n\tif (config.attachments) {\n\t\tfor (const attachment of config.attachments) {\n\t\t\tif (attachment.attachmentType === AttachmentType.TypeScript)\n\t\t\t\ttypescriptFile = attachment.filename;\n\n\t\t\tif (attachment.attachmentType === AttachmentType.Strings)\n\t\t\t\tstringsFile = attachment.filename;\n\n\t\t\tif (attachment.attachmentType === AttachmentType.SpatialData) {\n\t\t\t\t// We'll just use the data attached to mapRotation instead\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tpromises.push(\n\t\t\t\twriteFileSafe(\n\t\t\t\t\tpath.resolve(outDir, \"src\", attachment.filename),\n\t\t\t\t\tatob(attachment.attachmentData.original),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n\n\t// Extract spatial scenes from mapRotation instead of guessing\n\tif (config.mapRotation?.length) {\n\t\tfor (const map of config.mapRotation) {\n\t\t\tpromises.push(\n\t\t\t\twriteFileSafe(\n\t\t\t\t\tpath.resolve(outDir, \"src\", \"scenes\", map.spatialAttachment.filename),\n\t\t\t\t\tatob(map.spatialAttachment.attachmentData.original),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tscenes.push([map.id, `src/scenes/${map.spatialAttachment.filename}`]);\n\t\t}\n\t}\n\n\t// build the new bf6.config.ts structure\n\tconst bf6Config = {\n\t\tname: name ?? config.name,\n\t\tdescription: config.description,\n\t\toutDir: \"dist\",\n\t\tentrypoint: typescriptFile ? `src/${typescriptFile}` : undefined,\n\t\tscenes: scenes\n\t\t\t? scenes.map(([id, path]) => [\n\t\t\t\t\t`MapId.${getMapKeyByValue(id) ?? id}`,\n\t\t\t\t\tpath,\n\t\t\t\t])\n\t\t\t: undefined,\n\t\tstrings: stringsFile ? `src/${stringsFile}` : undefined,\n\t\tgame: {\n\t\t\tmutators: config.mutators,\n\t\t\tassetRestrictions: config.assetRestrictions,\n\t\t\tgameMode: config.gameMode,\n\t\t\tteamComposition: config.teamComposition,\n\t\t},\n\t};\n\n\tconst bf6ConfigContent = `export default defineBf6Config(${stringifyWithRaw(\n\t\tbf6Config,\n\t)});\\n`;\n\n\tpromises.push(\n\t\twriteFileSafe(path.resolve(outDir, \"bf6.config.ts\"), bf6ConfigContent),\n\t);\n\n\tawait Promise.all(promises);\n}\n\nfunction stringifyWithRaw(value: unknown, options = {}) {\n\treturn stringifyObject(value, {\n\t\tindent: \" \", // 4 spaces\n\t\tsingleQuotes: true,\n\t\ttransform: (_obj, _prop, originalResult) => {\n\t\t\t// Remove quotes from MapId.* expressions\n\t\t\tif (/^['\"]MapId\\.[A-Za-z0-9_]+['\"]$/.test(originalResult)) {\n\t\t\t\treturn originalResult.slice(1, -1); // remove surrounding quotes\n\t\t\t}\n\t\t\treturn originalResult;\n\t\t},\n\t\t...options,\n\t});\n}\n","import child_process from \"node:child_process\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport * as prompts from \"@clack/prompts\";\nimport { importFile } from \"./import.ts\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst templatesDir = path.resolve(__dirname, \"../resources/templates\");\n\nfunction renameFilesRecursively(dir: string, modName: string) {\n\tconst entries = fs.readdirSync(dir, { withFileTypes: true });\n\tfor (const entry of entries) {\n\t\tconst oldPath = path.join(dir, entry.name);\n\t\tlet newPath = oldPath;\n\n\t\t// Rename file or folder if it includes {name}\n\t\tif (entry.name.includes(\"{name}\")) {\n\t\t\tconst newName = entry.name.replace(\"{name}\", modName);\n\t\t\tnewPath = path.join(dir, newName);\n\t\t\tfs.renameSync(oldPath, newPath);\n\t\t}\n\n\t\t// If it's a bf6.config.ts, replace the {bf6ConfigName} placeholder\n\t\tif (entry.name === \"bf6.config.ts\") {\n\t\t\tlet content = fs.readFileSync(newPath, \"utf-8\");\n\t\t\tcontent = content.replace(/{bf6ConfigName}/g, modName);\n\t\t\tfs.writeFileSync(newPath, content, \"utf-8\");\n\t\t}\n\n\t\t// If it's a package.json, rewrite the \"name\" field\n\t\tif (entry.name === \"package.json\") {\n\t\t\tconst pkg = JSON.parse(fs.readFileSync(newPath, \"utf-8\"));\n\t\t\tpkg.name = modName;\n\t\t\tfs.writeFileSync(newPath, JSON.stringify(pkg, null, 2));\n\t\t}\n\n\t\t// Recurse into directories (using the new name if renamed)\n\t\tif (fs.statSync(newPath).isDirectory()) {\n\t\t\trenameFilesRecursively(newPath, modName);\n\t\t}\n\t}\n}\n\nexport const templates = [\n\t\"Basic\",\n\t\"AcePursuit\",\n\t\"BombSquad\",\n\t\"Exfil\",\n\t\"Vertigo\",\n] as const;\n\nexport async function startProject(\n\tdestination: string,\n\ttemplate: (typeof templates)[number] | \"None\",\n\tname?: string,\n) {\n\tif ([\"AcePursuit\", \"BombSquad\", \"Exfil\", \"Vertigo\"].includes(template)) {\n\t\tconst importPath = path.resolve(templatesDir, `${template}.json`);\n\t\tawait importFile(importPath, destination, name);\n\t} else if (template === \"None\") {\n\t\t// Do nothing if none\n\t} else {\n\t\t// Handles the Basic and any other template provided\n\t\tconst templateDir = path.resolve(templatesDir, template);\n\t\tfs.cpSync(templateDir, destination, { recursive: true });\n\t}\n\n\tfs.cpSync(path.resolve(templatesDir, \"All\"), destination, {\n\t\trecursive: true,\n\t});\n\n\tif (name) renameFilesRecursively(destination, name);\n}\n\nexport function installDependencies(projectDir: string) {\n\ttry {\n\t\tchild_process.execSync(`npm install`, {\n\t\t\tstdio: \"inherit\",\n\t\t\tcwd: projectDir,\n\t\t});\n\t\treturn true;\n\t} catch (_err) {\n\t\treturn false;\n\t}\n}\n\nconst _defaultTargetDir = \"bf6-mod\";\nconst cancel = () => prompts.cancel(\"Operation cancelled\");\n\nfunction isEmpty(path: string) {\n\tconst files = fs.readdirSync(path);\n\treturn files.length === 0 || (files.length === 1 && files[0] === \".git\");\n}\n\nfunction emptyDir(dir: string) {\n\tif (!fs.existsSync(dir)) {\n\t\treturn;\n\t}\n\tfor (const file of fs.readdirSync(dir)) {\n\t\tif (file === \".git\") {\n\t\t\tcontinue;\n\t\t}\n\t\tfs.rmSync(path.resolve(dir, file), { recursive: true, force: true });\n\t}\n}\n\nexport async function init(argTargetDir?: string) {\n\tprompts.intro(\"Initialize Bf6 Mod\");\n\n\tconst path = argTargetDir\n\t\t? argTargetDir\n\t\t: await prompts.text({\n\t\t\t\tmessage: \"Where should we create your project?\",\n\t\t\t\tplaceholder: \"./ace-pursuit\",\n\t\t\t\tvalidate: (value) => {\n\t\t\t\t\tif (!value) return \"Please enter a path.\";\n\t\t\t\t\tif (value[0] !== \".\") return \"Please enter a relative path.\";\n\t\t\t\t},\n\t\t\t});\n\tif (prompts.isCancel(path)) return cancel();\n\n\tlet name = await prompts.text({\n\t\tmessage: \"What is the name of your mod?\",\n\t\tplaceholder: \"Ace Pursuit\",\n\t\tvalidate: (value) => {\n\t\t\tif (!value.trim()) return \"Please enter a name.\";\n\t\t},\n\t});\n\tif (prompts.isCancel(name)) return cancel();\n\tname = name.trim();\n\n\tif (fs.existsSync(path) && !isEmpty(path)) {\n\t\tlet overwrite: \"yes\" | \"no\" | \"ignore\" | undefined;\n\t\tconst res = await prompts.select({\n\t\t\tmessage:\n\t\t\t\t(path === \".\" ? \"Current directory\" : `Target directory \"${path}\"`) +\n\t\t\t\t` is not empty. Please choose how to proceed:`,\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"Cancel operation\",\n\t\t\t\t\tvalue: \"no\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"Remove existing files and continue\",\n\t\t\t\t\tvalue: \"yes\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"Ignore files and continue\",\n\t\t\t\t\tvalue: \"ignore\",\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t\tif (prompts.isCancel(res)) return cancel();\n\t\toverwrite = res;\n\n\t\tswitch (overwrite) {\n\t\t\tcase \"yes\":\n\t\t\t\temptyDir(path);\n\t\t\t\tbreak;\n\t\t\tcase \"no\":\n\t\t\t\tcancel();\n\t\t\t\treturn;\n\t\t}\n\t}\n\n\tconst template = await prompts.select({\n\t\tmessage: \"Select a template:\",\n\t\toptions: templates.map((template) => {\n\t\t\treturn {\n\t\t\t\tlabel: template,\n\t\t\t\tvalue: template,\n\t\t\t};\n\t\t}),\n\t});\n\tif (prompts.isCancel(template)) return cancel();\n\n\tawait startProject(path, template, name);\n\n\tconst s = prompts.spinner();\n\ts.start(\"Installing via npm\");\n\tconst installed = installDependencies(path);\n\tif (installed) s.stop(\"Installed via npm\");\n\telse s.stop(\"Failed to install via npm\", 1);\n\n\tconst nextSteps = `cd ${path}\\nnpm run build`;\n\n\tprompts.note(nextSteps, \"Next steps.\");\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport colors from \"colors\";\nimport { genExport, genInlineTypeImport } from \"knitwork\";\nimport { printToConsole } from \"./utils.js\";\n\nexport async function prepare() {\n\ttry {\n\t\tconst __filename = fileURLToPath(import.meta.url);\n\t\tconst __dirname = path.dirname(__filename);\n\n\t\tconst _workingDir = path.resolve(\".\");\n\t\tconst buildDir = path.resolve(\".bf6\");\n\n\t\tconst resources = path.resolve(__dirname, \"../resources/prepare\");\n\n\t\tfs.cpSync(\n\t\t\tpath.resolve(resources, \"tsconfig.json\"),\n\t\t\tpath.resolve(buildDir, \"tsconfig.json\"),\n\t\t);\n\t\tfs.cpSync(\n\t\t\tpath.resolve(resources, \"bf6.d.ts\"),\n\t\t\tpath.resolve(buildDir, \"bf6.d.ts\"),\n\t\t);\n\t\tfs.cpSync(\n\t\t\tpath.resolve(resources, \"types\", \"config.ts\"),\n\t\t\tpath.resolve(buildDir, \"types\", \"config.ts\"),\n\t\t);\n\n\t\tconst ConfigFileExports = genExport(\"./types/config.ts\", [\n\t\t\t\"defineBf6Config\",\n\t\t]);\n\t\tfs.writeFileSync(\n\t\t\tpath.resolve(buildDir, \"imports.d.ts\"),\n\t\t\t`${ConfigFileExports}\\n`,\n\t\t);\n\n\t\tconst augmentations: Record<string, string> = {\n\t\t\tdefineBf6Config: genInlineTypeImport(\n\t\t\t\t\"./types/config.ts\",\n\t\t\t\t`defineBf6Config`,\n\t\t\t),\n\t\t\tMapId: genInlineTypeImport(\"./types/config.ts\", `MapId`),\n\t\t};\n\n\t\tconst args = genNamespaceAugmentation(\"global\", augmentations);\n\t\tfs.writeFileSync(\n\t\t\tpath.resolve(buildDir, \"globals.d.ts\"),\n\t\t\t`export {}\\n\\n${args}\\n`,\n\t\t);\n\n\t\tprintToConsole(`${colors.green(\"✔\")} Types generated in .bf6`);\n\t} catch (error) {\n\t\tconsole.error(error);\n\t\tprintToConsole(`${colors.red(\"✗\")} Types failed to generate in .bf6`);\n\t}\n}\n\nconst genNamespaceAugmentation = (\n\tname: string,\n\tcontents: Record<string, string>,\n) => {\n\tif (!contents || Object.keys(contents).length === 0)\n\t\treturn `declare ${name} {}`;\n\tconst decls = Object.entries(contents)\n\t\t.map(([k, v]) => `\\tconst ${k}: ${v};`)\n\t\t.join(\"\\n\");\n\treturn `declare ${name} {\\n${decls}\\n}`;\n};\n","import colors from \"colors\";\nimport stripAnsi from \"strip-ansi\";\n\n/**\n * Safely prints a message with a right-aligned timestamp.\n */\nexport const printToConsole = (message: string) => {\n\tconst now = new Date();\n\tconst formattedTime = colors.grey(now.toLocaleTimeString());\n\tconst terminalWidth = process.stdout.columns || 80;\n\n\tconst timeLength = stripAnsi(formattedTime).length;\n\tconst messageLength = stripAnsi(message).length;\n\tconst available = terminalWidth - (messageLength + timeLength);\n\n\tconst spacing = available > 1 ? \" \".repeat(available) : \" \";\n\n\tconsole.log(`${message}${spacing}${formattedTime}`);\n};\n","export default function ansiRegex({onlyFirst = false} = {}) {\n\t// Valid string terminator sequences are BEL, ESC\\, and 0x9c\n\tconst ST = '(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)';\n\n\t// OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n\tconst osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n\t// CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n\tconst csi = '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]';\n\n\tconst pattern = `${osc}|${csi}`;\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n"],"mappings":";;;AACA,SAAS,eAAe;;;ACDxB;AAAA,EACC,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,SAAW;AAAA,EACX,MAAQ;AAAA,EACR,KAAO;AAAA,IACN,SAAW;AAAA,EACZ;AAAA,EACA,MAAQ;AAAA,EACR,OAAS;AAAA,EACT,SAAW;AAAA,IACV,OAAS;AAAA,IACT,OAAS;AAAA,EACV;AAAA,EACA,SAAW;AAAA,IACV,KAAK;AAAA,MACJ,OAAS;AAAA,MACT,QAAU;AAAA,IACX;AAAA,EACD;AAAA,EACA,OAAS;AAAA,IACR;AAAA,EACD;AAAA,EACA,YAAc;AAAA,IACb,MAAQ;AAAA,IACR,KAAO;AAAA,EACR;AAAA,EACA,cAAgB;AAAA,IACf,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,IAClB,UAAY;AAAA,IACZ,QAAU;AAAA,IACV,WAAa;AAAA,IACb,MAAQ;AAAA,IACR,UAAY;AAAA,IACZ,UAAY;AAAA,IACZ,oBAAoB;AAAA,EACrB;AAAA,EACA,eAAiB;AAAA,IAChB,QAAU;AAAA,EACX;AAAA,EACA,iBAAmB;AAAA,IAClB,sBAAsB;AAAA,IACtB,2BAA2B;AAAA,IAC3B,aA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AU,EACnB,YAAY,wDAAwD,EACpE,OAAO,OAAO,OAAO,WAAW;AAChC,QAAM,WAAW,OAAiB,MAAgB;AAClD,sBAAoB,MAAM;AAC3B,CAAC;AAEF,QAAQ,aAAa,CAAC,SAAS;AAC9B,MAAI,QAAQ,IAAI,cAAc,OAAQ,SAAQ,KAAK,CAAC;AACrD,CAAC;AAED,QAAQ,MAAM;","names":["MapId","walk","program","fs","path","path","fs","fs","path","AttachmentType","fs","path","fileURLToPath","__filename","fileURLToPath","__dirname","path","fs","cancel","path","fs","template","path","fs","AttachmentType","fs","path","fileURLToPath","colors","colors","colors","__filename","fileURLToPath","__dirname","path","fs","colors"]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["program","key:\n\t\t\t\t\t\t\t| string\n\t\t\t\t\t\t\t| number\n\t\t\t\t\t\t\t| bigint\n\t\t\t\t\t\t\t| boolean\n\t\t\t\t\t\t\t| RegExp\n\t\t\t\t\t\t\t| null\n\t\t\t\t\t\t\t| undefined","MapIdEnum","tsAttachment: Attachment | undefined","__filename","__dirname","attachments: Attachment[]","mapRotation: MapType[]","mapId: MapIdEnum","scene: string","finalJson: ConfigType","watcher: FSWatcher | undefined","timer: NodeJS.Timeout | undefined","targets: string[]","logger: Bf6Logger | undefined","path","overwrite: \"yes\" | \"no\" | \"ignore\" | undefined","template","MapIdEnum","typescriptFile: string | undefined","stringsFile: string | undefined","scenes: [string, string][]","promises: Promise<unknown>[]","path","__filename","__dirname","pkg.bin","pkg.description","pkg.version"],"sources":["../../package.json","../../src/resources/prepare/types/config.ts","../../src/cli/utils.ts","../../src/cli/build/generated-strings.ts","../../src/cli/build/index.ts","../../src/cli/log.ts","../../src/cli/dev.ts","../../src/cli/init.ts","../../src/cli/import.ts","../../src/cli/prepare.ts","../../src/cli/index.ts"],"sourcesContent":["{\n\t\"name\": \"@bf6mods/cli\",\n\t\"version\": \"1.2.0\",\n\t\"description\": \"CLI and library for bundling BF6 mods\",\n\t\"license\": \"MIT\",\n\t\"type\": \"module\",\n\t\"bin\": {\n\t\t\"bf6mods\": \"./dist/cli/index.js\"\n\t},\n\t\"main\": \"./dist/index.js\",\n\t\"types\": \"./dist/index.d.ts\",\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"start\": \"cross-env EXIT_CODE=none tsx ./src/cli/index.ts\"\n\t},\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/index.d.ts\",\n\t\t\t\"import\": \"./dist/index.js\"\n\t\t}\n\t},\n\t\"files\": [\n\t\t\"dist/\"\n\t],\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"git+https://github.com/bf6mods/bf6mods.git\"\n\t},\n\t\"dependencies\": {\n\t\t\"@bf6mods/sdk\": \"*\",\n\t\t\"@clack/prompts\": \"^0.11.0\",\n\t\t\"chokidar\": \"^4.0.3\",\n\t\t\"colors\": \"^1.4.0\",\n\t\t\"commander\": \"^14.0.1\",\n\t\t\"jiti\": \"^2.6.1\",\n\t\t\"knitwork\": \"^1.2.0\",\n\t\t\"rolldown\": \"^1.0.0-beta.44\",\n\t\t\"stringify-object\": \"^6.0.0\",\n\t\t\"strip-ansi\": \"^7.1.2\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@oxc-project/types\": \"^0.95.0\",\n\t\t\"@types/stringify-object\": \"^4.0.5\",\n\t\t\"cross-env\": \"^10.1.0\",\n\t\t\"tsx\": \"^4.20.6\"\n\t}\n}\n","import type { ConfigType } from \"@bf6mods/sdk\";\n\nexport enum MapId {\n\tFireStorm = \"MP_FireStorm-ModBuilderCustom0\",\n\tSiegeOfCairo = \"MP_Abbasid-ModBuilderCustom0\",\n\tEmpireState = \"MP_Aftermath-ModBuilderCustom0\",\n\tIberianOffensive = \"MP_Battery-ModBuilderCustom0\",\n\tLiberationPeak = \"MP_Capstone-ModBuilderCustom0\",\n\tManhattanBridge = \"MP_Dumbo-ModBuilderCustom0\",\n\tSaintsQuarter = \"MP_Limestone-ModBuilderCustom0\",\n\tNewSobekCity = \"MP_Outskirts-ModBuilderCustom0\",\n\tMirakValley = \"MP_Tungsten-ModBuilderCustom0\",\n}\n\n/**\n * Represents the root configuration for a Battlefield 6 mod project.\n *\n * This file combines both build-level settings (like entrypoints and output directories)\n * and in-game configuration data (such as mutators and asset restrictions)\n * under the `game` key.\n *\n * Use {@link defineBf6Config} to define and validate this structure\n * in your `bf6.config.ts` file.\n */\nexport type Bf6Config = {\n\t/**\n\t * The human-readable name of the mod.\n\t *\n\t * Typically matches the project name used in the BF6 mod editor or\n\t * the display name shown in the in-game mod browser.\n\t */\n\tname: string;\n\n\t/**\n\t * A short description of the mod’s purpose or content.\n\t * Used for display and metadata purposes.\n\t */\n\tdescription: string;\n\n\t/**\n\t * The output directory where compiled or bundled files are written.\n\t * Usually something like `\"dist\"` or `\"build\"`.\n\t */\n\toutDir: string;\n\n\t/**\n\t * Whether or not to output the built files like the entrypoint typescript file\n\t */\n\toutputArtifacts?: boolean;\n\n\t/**\n\t * The main entrypoint for your mod’s TypeScript source file.\n\t *\n\t * This is typically something like `\"src/index.ts\"` or `\"src/main.ts\"`.\n\t */\n\tentrypoint?: string;\n\n\t/**\n\t * One or more scene file paths (.json) that the mod includes.\n\t * If no file path is provided, it loads in the default spatial data.\n\t */\n\tscenes?: ([MapId, string] | MapId)[];\n\n\t/**\n\t * Path to a JSON file or other source that defines localized strings\n\t * used by the mod (optional).\n\t */\n\tstrings?: string;\n\n\t/**\n\t * Generate strings automatically, by default this is enabled\n\t */\n\tgenerateStrings?: boolean;\n\n\t/**\n\t * Controls whether build output should be minified.\n\t *\n\t * Can be a boolean (to toggle all minification),\n\t * or an object specifying independent settings for JS and JSON files.\n\t *\n\t * @example\n\t * ```ts\n\t * minify: true\n\t * // or\n\t * minify: { js: true, json: false }\n\t * ```\n\t */\n\tminify?:\n\t\t| {\n\t\t\t\t/** Whether to minify JavaScript output. */\n\t\t\t\tjs?: boolean;\n\t\t\t\t/** Whether to minify JSON output. */\n\t\t\t\tjson?: boolean;\n\t\t }\n\t\t/** Enables or disables all minification. */\n\t\t| boolean;\n\n\t/**\n\t * The underlying in-game configuration derived from `ConfigType`\n\t * in the BF6 SDK. Includes gameplay-level details like mutators,\n\t * asset restrictions, and team compositions.\n\t *\n\t * The following properties are **excluded**:\n\t * - `attachments`\n\t * - `workspace`\n\t * - `mapRotation`\n\t * - `name`\n\t * - `description`\n\t *\n\t * since those are either redundant or handled elsewhere.\n\t */\n\tgame: Omit<\n\t\tConfigType,\n\t\t\"attachments\" | \"workspace\" | \"mapRotation\" | \"name\" | \"description\"\n\t>;\n};\n\n/**\n * Defines and validates a Battlefield 6 mod configuration object.\n *\n * This helper ensures your config is properly typed and can be\n * statically analyzed by TypeScript.\n *\n * @example\n * ```ts\n * export default defineBf6Config({\n * name: \"My Custom Mod\",\n * description: \"Adds custom rules\",\n * outDir: \"dist\",\n * entrypoint: \"src/main.ts\",\n * game: {\n * mutators: [],\n * assetRestrictions: {},\n * teamComposition: [],\n * },\n * });\n * ```\n *\n * @param bf6Config The configuration object to validate and return.\n * @returns The validated Battlefield 6 configuration object.\n */\nexport function defineBf6Config(bf6Config: Bf6Config): Bf6Config {\n\treturn bf6Config;\n}\n","import colors from \"colors\";\nimport stripAnsi from \"strip-ansi\";\n\n/**\n * Safely prints a message with a right-aligned timestamp.\n */\nexport const printToConsole = (message: string, error: boolean = false) => {\n\tconst now = new Date();\n\tconst formattedTime = colors.grey(now.toLocaleTimeString());\n\tconst terminalWidth = process.stdout.columns || 80;\n\n\tconst timeLength = stripAnsi(formattedTime).length;\n\tconst messageLength = stripAnsi(message).length;\n\tconst available = terminalWidth - (messageLength + timeLength);\n\n\tconst spacing = available > 1 ? \" \".repeat(available) : \" \";\n\n\tif (error) console.error(`${message}${spacing}${formattedTime}`);\n\telse console.log(`${message}${spacing}${formattedTime}`);\n};\n","import type { Node, VariableDeclarator } from \"@oxc-project/types\";\nimport colors from \"colors\";\nimport type { Plugin } from \"rolldown\";\n\nexport function extractBf6Strings(\n\tbf6Strings: Record<string, string>,\n\tgenerateFromLiterals: boolean,\n): Plugin {\n\treturn {\n\t\tname: \"extract-bf6-strings\",\n\t\tgenerateBundle(_options, bundle) {\n\t\t\tif (!generateFromLiterals) return;\n\n\t\t\tlet id = 0;\n\t\t\tconst existingStrings = new Set(Object.values(bf6Strings));\n\n\t\t\tfor (const [_file, output] of Object.entries(bundle)) {\n\t\t\t\tif (output.type !== \"chunk\") continue;\n\t\t\t\tconst code = output.code;\n\n\t\t\t\t// Parse the code with rolldown’s parser\n\t\t\t\tconst program = this.parse(code, {\n\t\t\t\t\tlang: \"ts\",\n\t\t\t\t\tastType: \"js\",\n\t\t\t\t\trange: true,\n\t\t\t\t});\n\n\t\t\t\t// Visit every node recursively to collect string literals\n\t\t\t\tfunction walk(node: Node) {\n\t\t\t\t\tif (node.type === \"Literal\") {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof node.value !== \"string\" ||\n\t\t\t\t\t\t\tnode.value === \"\" ||\n\t\t\t\t\t\t\tnode.value === \"----uniquename----\"\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!(node.value in bf6Strings) &&\n\t\t\t\t\t\t\t!existingStrings.has(node.value)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\texistingStrings.add(node.value);\n\t\t\t\t\t\t\tbf6Strings[`__auto__${id++}`] = node.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (const value of Object.values(node)) {\n\t\t\t\t\t\tif (!value) continue;\n\t\t\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\t\t\tfor (const v of value) {\n\t\t\t\t\t\t\t\tif (v && typeof v === \"object\" && \"type\" in v) walk(v as Node);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (typeof value === \"object\" && \"type\" in value) {\n\t\t\t\t\t\t\twalk(value as Node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const item of program.body) {\n\t\t\t\t\twalk(item);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tmoduleParsed(moduleInfo) {\n\t\t\tif (moduleInfo.code && moduleInfo.exports.includes(\"bf6Strings\")) {\n\t\t\t\tconst code = moduleInfo.code;\n\t\t\t\tconst getSnippet = (\n\t\t\t\t\tstart: number,\n\t\t\t\t\tend: number,\n\t\t\t\t\tlinesBefore = 2,\n\t\t\t\t\tlinesAfter = 2,\n\t\t\t\t) => {\n\t\t\t\t\tconst lines = code.split(/\\r?\\n/);\n\t\t\t\t\tconst startLine = Math.max(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tcode.slice(0, start).split(/\\r?\\n/).length - 1 - linesBefore,\n\t\t\t\t\t);\n\t\t\t\t\tconst endLine = Math.min(\n\t\t\t\t\t\tlines.length,\n\t\t\t\t\t\tcode.slice(0, end).split(/\\r?\\n/).length - 1 + linesAfter,\n\t\t\t\t\t);\n\t\t\t\t\treturn lines\n\t\t\t\t\t\t.slice(startLine, endLine)\n\t\t\t\t\t\t.map((line, i) => {\n\t\t\t\t\t\t\tconst actualLine = startLine + i + 1;\n\t\t\t\t\t\t\treturn `${actualLine.toString().padStart(3)} | ${line}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(\"\\n\");\n\t\t\t\t};\n\n\t\t\t\tconst program = this.parse(code, {\n\t\t\t\t\tlang: \"ts\",\n\t\t\t\t\tastType: \"js\",\n\t\t\t\t\trange: true,\n\t\t\t\t});\n\n\t\t\t\tconst extractObjectLiteral = (declaration: VariableDeclarator) => {\n\t\t\t\t\tif (declaration.init?.type !== \"ObjectExpression\") {\n\t\t\t\t\t\tconst snippet = getSnippet(...(declaration.range ?? [0, 0]));\n\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t`${colors.red.bold(\"✗\")} Invalid bf6Strings export: expected an object literal.\\n\\n${snippet}`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (const property of declaration.init.properties) {\n\t\t\t\t\t\tif (property.type !== \"Property\") {\n\t\t\t\t\t\t\tconst snippet = getSnippet(...(property.range ?? [0, 0]));\n\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t`${colors.red.bold(\"✗\")} Invalid bf6Strings property: expected a key/value pair.\\nFound type: ${property.type}\\n\\n${snippet}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet key:\n\t\t\t\t\t\t\t| string\n\t\t\t\t\t\t\t| number\n\t\t\t\t\t\t\t| bigint\n\t\t\t\t\t\t\t| boolean\n\t\t\t\t\t\t\t| RegExp\n\t\t\t\t\t\t\t| null\n\t\t\t\t\t\t\t| undefined;\n\t\t\t\t\t\tif (property.key.type === \"Literal\") {\n\t\t\t\t\t\t\tkey = property.key.value;\n\t\t\t\t\t\t} else if (property.key.type === \"Identifier\") {\n\t\t\t\t\t\t\tkey = property.key.name;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst snippet = getSnippet(...(property.range ?? [0, 0]));\n\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t`${colors.red.bold(\"✗\")} Invalid bf6Strings key: expected a string literal or identifier.\\nFound type: ${property.key.type}\\n\\n${snippet}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (property.value.type !== \"Literal\") {\n\t\t\t\t\t\t\tconst snippet = getSnippet(...(property.range ?? [0, 0]));\n\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t`${colors.red.bold(\"✗\")} Invalid bf6Strings value: expected a string literal.\\nFound type: ${property.value.type}\\n\\n${snippet}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst value = property.value.value;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof key !== \"string\" &&\n\t\t\t\t\t\t\ttypeof key !== \"number\" &&\n\t\t\t\t\t\t\ttypeof key !== \"bigint\" &&\n\t\t\t\t\t\t\ttypeof key !== \"boolean\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst snippet = getSnippet(...(property.range ?? [0, 0]));\n\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t`${colors.red.bold(\"✗\")} bf6Strings key must be a string, found: ${typeof key}\\n\\n${snippet}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof value !== \"string\" &&\n\t\t\t\t\t\t\ttypeof value !== \"number\" &&\n\t\t\t\t\t\t\ttypeof value !== \"bigint\" &&\n\t\t\t\t\t\t\ttypeof value !== \"boolean\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst snippet = getSnippet(...(property.range ?? [0, 0]));\n\t\t\t\t\t\t\tthis.error(\n\t\t\t\t\t\t\t\t`${colors.red.bold(\"✗\")} bf6Strings value must be a string, found: ${typeof value}\\n\\n${snippet}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbf6Strings[`${key}`] = `${value}`;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tfor (const item of program.body) {\n\t\t\t\t\t// Case 1: plain variable `var bf6Strings = {...}`\n\t\t\t\t\tif (item.type === \"VariableDeclaration\") {\n\t\t\t\t\t\tfor (const declaration of item.declarations) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdeclaration.type === \"VariableDeclarator\" &&\n\t\t\t\t\t\t\t\tdeclaration.id.type === \"Identifier\" &&\n\t\t\t\t\t\t\t\tdeclaration.id.name === \"bf6Strings\"\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\textractObjectLiteral(declaration);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Case 2: exported variable `export const bf6Strings = {...}`\n\t\t\t\t\tif (\n\t\t\t\t\t\titem.type === \"ExportNamedDeclaration\" &&\n\t\t\t\t\t\titem.declaration?.type === \"VariableDeclaration\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tfor (const declaration of item.declaration.declarations) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdeclaration.type === \"VariableDeclarator\" &&\n\t\t\t\t\t\t\t\tdeclaration.id.type === \"Identifier\" &&\n\t\t\t\t\t\t\t\tdeclaration.id.name === \"bf6Strings\"\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\textractObjectLiteral(declaration);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport {\n\ttype Attachment,\n\tAttachmentType,\n\ttype ConfigType,\n\ttype MapType,\n} from \"@bf6mods/sdk\";\nimport colors from \"colors\";\nimport { createJiti } from \"jiti\";\nimport { rolldown } from \"rolldown\";\nimport {\n\ttype Bf6Config,\n\tMapId as MapIdEnum,\n} from \"../../resources/prepare/types/config.ts\";\nimport { printToConsole } from \"../utils.ts\";\nimport { extractBf6Strings } from \"./generated-strings.ts\";\n\ndeclare global {\n\tvar defineBf6Config: ((config: Bf6Config) => Bf6Config) | undefined;\n\tvar MapId: typeof MapIdEnum | undefined;\n}\n\n/**\n * Dynamically imports and validates bf6.config.ts\n */\nexport async function getBf6Config(rootDir: string): Promise<Bf6Config> {\n\tglobalThis.defineBf6Config = (c) => c;\n\tglobalThis.MapId = MapIdEnum;\n\tconst jiti = createJiti(rootDir, { interopDefault: true });\n\tconst result = await jiti.import(\"./bf6.config\", { default: true });\n\tdelete globalThis.defineBf6Config;\n\tdelete globalThis.MapId;\n\treturn result as Bf6Config;\n}\n\n/**\n * Builds the entire mod project once (for production or single run).\n */\nexport async function build() {\n\tconst workingDir = path.resolve(\".\");\n\tconst config = await getBf6Config(workingDir);\n\n\tconst outDir = path.resolve(workingDir, config.outDir);\n\tif (fs.existsSync(outDir))\n\t\tfs.rmSync(outDir, { recursive: true, force: true });\n\tfs.mkdirSync(outDir, { recursive: true });\n\n\tconst minifyJson =\n\t\ttypeof config.minify === \"boolean\"\n\t\t\t? config.minify\n\t\t\t: (config.minify?.json ?? false);\n\n\tconst generatedStrings = {};\n\tlet tsAttachment: Attachment | undefined;\n\tif (config.entrypoint) {\n\t\tconst entryAbs = path.resolve(workingDir, config.entrypoint);\n\t\tconst compiled = await buildEntrypoint(\n\t\t\tentryAbs,\n\t\t\tgeneratedStrings,\n\t\t\tconfig.generateStrings ?? true,\n\t\t);\n\t\ttsAttachment = createTsAttachment(entryAbs, compiled);\n\t}\n\n\tconst { attachments, mapRotation } = await collectAttachments(\n\t\tconfig,\n\t\tworkingDir,\n\t\ttsAttachment,\n\t\tgeneratedStrings,\n\t);\n\n\tawait writeModJson(config, outDir, attachments, mapRotation, minifyJson);\n\tprintToConsole(`${colors.green.bold(\"✓\")} Built mod: ${config.name}`);\n}\n\n/**\n * Compiles the TypeScript entrypoint using rolldown and returns the compiled code.\n */\nexport async function buildEntrypoint(\n\tentry: string,\n\tbf6Strings: Record<string, string>,\n\tgenerateStringsFromLiterals: boolean,\n): Promise<string> {\n\tconst bundle = await rolldown({\n\t\tinput: entry,\n\t\tplugins: [extractBf6Strings(bf6Strings, generateStringsFromLiterals)],\n\t\tlogLevel: \"debug\",\n\t});\n\tconst result = await bundle.generate({\n\t\tformat: \"esm\",\n\t\tinlineDynamicImports: true,\n\t});\n\n\tconst code = result.output[0].code;\n\treturn code;\n}\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\nconst spatialsDir = path.resolve(__dirname, \"../resources/maps/spatial\");\n/**\n * Collects all attachments (TS, scenes, strings) and returns them + mapRotation.\n */\nexport async function collectAttachments(\n\tconfig: Bf6Config,\n\tworkingDir: string,\n\ttsAttachment: Attachment | undefined,\n\tgeneratedStrings: Record<string, number | string> | undefined,\n) {\n\tconst attachments: Attachment[] = [];\n\tconst mapRotation: MapType[] = [];\n\n\tif (tsAttachment) attachments.push(tsAttachment);\n\n\t// Strings\n\tif (config.strings) {\n\t\tconst strPath = path.resolve(workingDir, config.strings);\n\t\tif (!fs.existsSync(strPath)) throw new Error(\"Cannot find strings file\");\n\t\tconst raw = await fs.promises.readFile(strPath, \"utf8\");\n\t\tconst attachment = createStringsAttachment(strPath, raw, generatedStrings);\n\t\tattachments.push(attachment);\n\t}\n\n\t// Scenes\n\tif (config.scenes) {\n\t\tlet mapIdx = 0;\n\t\tfor (const map of config.scenes) {\n\t\t\tlet mapId: MapIdEnum;\n\t\t\tlet scene: string;\n\t\t\tif (Array.isArray(map)) {\n\t\t\t\t[mapId, scene] = map;\n\t\t\t} else {\n\t\t\t\tmapId = map;\n\t\t\t\tscene = path.resolve(spatialsDir, `${mapId}.spatial.json`);\n\t\t\t}\n\n\t\t\tconst scenePath = path.resolve(workingDir, scene);\n\t\t\tif (!fs.existsSync(scenePath))\n\t\t\t\tthrow new Error(`Cannot find spatial data file: ${scene}`);\n\t\t\tconst raw = await fs.promises.readFile(scenePath, \"utf8\");\n\t\t\tconst spatial = createSpatialAttachment(scenePath, raw, mapIdx++);\n\t\t\tattachments.push(spatial);\n\t\t\tmapRotation.push({ id: mapId, spatialAttachment: spatial });\n\t\t}\n\t}\n\n\treturn { attachments, mapRotation };\n}\n\n/**\n * Writes the mod.json output to disk.\n */\nexport async function writeModJson(\n\tconfig: Bf6Config,\n\toutDir: string,\n\tattachments: ConfigType[\"attachments\"],\n\tmapRotation: MapType[],\n\tminify: boolean,\n) {\n\tconst baseGame = config.game;\n\tconst finalJson: ConfigType = {\n\t\tname: config.name,\n\t\tdescription: config.description,\n\t\tgameMode: \"ModBuilderCustom\",\n\t\tmutators: baseGame.mutators ?? {},\n\t\tassetRestrictions: baseGame.assetRestrictions ?? {},\n\t\tteamComposition: baseGame.teamComposition ?? [],\n\t\tmapRotation,\n\t\tattachments,\n\t};\n\n\tconst jsonOutput = minify\n\t\t? JSON.stringify(finalJson)\n\t\t: JSON.stringify(finalJson, null, 2);\n\tawait fs.promises.writeFile(path.resolve(outDir, \"mod.json\"), jsonOutput);\n\n\tif (config.outputArtifacts && finalJson?.attachments) {\n\t\tfor (const attachment of finalJson.attachments) {\n\t\t\tconst attachmentsDir = path.resolve(outDir, \"attachments\");\n\t\t\tif (!fs.existsSync(attachmentsDir))\n\t\t\t\tfs.mkdirSync(attachmentsDir, {\n\t\t\t\t\trecursive: true,\n\t\t\t\t});\n\t\t\tawait fs.promises.writeFile(\n\t\t\t\tpath.resolve(outDir, \"attachments\", attachment.filename),\n\t\t\t\tatob(attachment.attachmentData.original),\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport function createTsAttachment(\n\tfilePath: string,\n\tcompiled: string,\n): Attachment {\n\treturn {\n\t\tid: crypto.randomUUID(),\n\t\tversion: \"1.0\",\n\t\tfilename: `${path.parse(filePath).name}.js`,\n\t\tisProcessable: true,\n\t\tprocessingStatus: 2,\n\t\tattachmentType: AttachmentType.TypeScript,\n\t\tattachmentData: { original: toBase64(compiled), compiled: \"\" },\n\t\terrors: [],\n\t};\n}\n\nexport function createStringsAttachment(\n\tfilePath: string,\n\traw: string,\n\tgeneratedStrings?: Record<string, number | string> | undefined,\n): Attachment {\n\tlet result = raw;\n\tif (generatedStrings) {\n\t\tresult = JSON.stringify(\n\t\t\t{\n\t\t\t\t...generatedStrings,\n\t\t\t\t...JSON.parse(raw),\n\t\t\t},\n\t\t\tnull,\n\t\t\t4,\n\t\t);\n\t}\n\n\treturn {\n\t\tid: crypto.randomUUID(),\n\t\tversion: \"1.0\",\n\t\tfilename: path.basename(filePath),\n\t\tisProcessable: true,\n\t\tprocessingStatus: 2,\n\t\tattachmentType: AttachmentType.Strings,\n\t\tattachmentData: { original: toBase64(result), compiled: \"\" },\n\t\terrors: [],\n\t};\n}\n\nexport function createSpatialAttachment(\n\tfilePath: string,\n\traw: string,\n\tmapIdx: number,\n): MapType[\"spatialAttachment\"] {\n\treturn {\n\t\tid: crypto.randomUUID(),\n\t\tversion: \"1.0\",\n\t\tfilename: path.basename(filePath),\n\t\tisProcessable: true,\n\t\tprocessingStatus: 2,\n\t\tattachmentType: AttachmentType.SpatialData,\n\t\tattachmentData: { original: toBase64(raw), compiled: \"\" },\n\t\tmetadata: `mapIdx=${mapIdx}`,\n\t\terrors: [],\n\t};\n}\n\nexport function toBase64(input: string | Buffer): string {\n\treturn Buffer.isBuffer(input)\n\t\t? input.toString(\"base64\")\n\t\t: Buffer.from(input, \"utf8\").toString(\"base64\");\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport chokidar, { type FSWatcher } from \"chokidar\";\nimport colors from \"colors\";\nimport { printToConsole } from \"./utils.ts\";\n\nexport class Bf6Logger {\n\tprivate static instance: Bf6Logger | undefined;\n\n\tprivate watchTarget: string;\n\tprivate watcher?: FSWatcher;\n\tprivate lastSize: number;\n\n\tconstructor(input?: string) {\n\t\tif (Bf6Logger.instance) {\n\t\t\tprintToConsole(\n\t\t\t\tcolors.yellow(\"⚠ Existing logger found — closing it first...\"),\n\t\t\t);\n\t\t\tBf6Logger.instance.stop();\n\t\t}\n\n\t\tif (input) this.watchTarget = path.resolve(input);\n\t\telse if (process.env.LOCALAPPDATA)\n\t\t\tthis.watchTarget = path.resolve(\n\t\t\t\tprocess.env.LOCALAPPDATA,\n\t\t\t\t\"temp\",\n\t\t\t\t\"Battlefieldâ„¢ 6\",\n\t\t\t\t\"PortalLog.txt\",\n\t\t\t);\n\t\telse\n\t\t\tthrow new Error(\n\t\t\t\t`${colors.red.bold(\"✗\")} Env variable LOCALAPPDATA not defined, and input file to watch was not provided!`,\n\t\t\t);\n\n\t\tif (!fs.existsSync(this.watchTarget))\n\t\t\tthrow new Error(\n\t\t\t\t`${colors.red.bold(\"✗\")} Cannot find file '${this.watchTarget}' to watch for changes`,\n\t\t\t);\n\n\t\tthis.lastSize = fs.statSync(this.watchTarget).size;\n\t\tBf6Logger.instance = this;\n\t}\n\n\tasync start() {\n\t\tprintToConsole(\n\t\t\tcolors.cyan(\n\t\t\t\t`👀 Watching Battlefield logs at: ${colors.yellow(this.watchTarget)}`,\n\t\t\t),\n\t\t);\n\n\t\tthis.watcher = chokidar.watch(this.watchTarget, {\n\t\t\tpersistent: true,\n\t\t\tignoreInitial: true,\n\t\t});\n\n\t\tthis.watcher.on(\"change\", this.handleChange.bind(this));\n\t}\n\n\tasync stop() {\n\t\tif (this.watcher) {\n\t\t\tthis.watcher.close();\n\t\t\tthis.watcher = undefined;\n\t\t\tprintToConsole(\n\t\t\t\tcolors.yellow(\n\t\t\t\t\t`${colors.red.bold(\"✗\")} Stopped watching: ${colors.gray(this.watchTarget)}`,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\tBf6Logger.instance = undefined;\n\t}\n\n\tprivate handleChange(file: string, stats?: fs.Stats) {\n\t\tif (!stats) return;\n\t\tif (stats.size > this.lastSize) {\n\t\t\tconst newBytes = stats.size - this.lastSize;\n\t\t\tconst fd = fs.openSync(file, \"r\");\n\t\t\tconst buffer = Buffer.alloc(newBytes);\n\t\t\tfs.readSync(fd, buffer, 0, newBytes, this.lastSize);\n\t\t\tfs.closeSync(fd);\n\n\t\t\tconst newContent = buffer\n\t\t\t\t.toString(\"utf8\")\n\t\t\t\t.split(\"QuickJS: \")\n\t\t\t\t.filter((debug) => debug.trim() !== \"\")\n\t\t\t\t.map((debug) => debug.trim())\n\t\t\t\t.map((debug) => {\n\t\t\t\t\tif (debug.startsWith(\"console.log: \")) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: \"console.log\",\n\t\t\t\t\t\t\ttext: debug.replace(\"console.log: \", \"\"),\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if (debug.startsWith(\"Exception:\")) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: \"exception\",\n\t\t\t\t\t\t\ttext: debug.replace(\"Exception:\", \"\"),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\t\ttext: debug,\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\tfor (const content of newContent) {\n\t\t\t\tif (content.type === \"console.log\")\n\t\t\t\t\tprintToConsole(colors.gray(content.text));\n\t\t\t\telse if (content.type === \"exception\")\n\t\t\t\t\tprintToConsole(colors.red(content.text), true);\n\t\t\t\telse printToConsole(colors.bold(content.text));\n\t\t\t}\n\t\t}\n\t\tthis.lastSize = stats.size;\n\t}\n}\n","import fs from \"node:fs\";\nimport { glob } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport chokidar, { type FSWatcher } from \"chokidar\";\nimport colors from \"colors\";\nimport { build, getBf6Config } from \"./build/index.ts\";\nimport { Bf6Logger } from \"./log.ts\";\nimport { printToConsole } from \"./utils.ts\";\n\nexport async function dev() {\n\tconst workingDir = path.resolve(\".\");\n\tlet config = await getBf6Config(workingDir);\n\tconst outDir = path.resolve(workingDir, config.outDir);\n\tfs.mkdirSync(outDir, { recursive: true });\n\n\tprintToConsole(colors.cyan(`▶ Starting dev for ${config.name}`));\n\n\tlet watcher: FSWatcher | undefined;\n\n\t// biome-ignore lint/suspicious/noExplicitAny: doesn't really matter in this case\n\tfunction debounce<T extends (...args: any[]) => void>(fn: T, delay: number) {\n\t\tlet timer: NodeJS.Timeout | undefined;\n\t\treturn (...args: Parameters<T>) => {\n\t\t\tif (timer) clearTimeout(timer);\n\t\t\ttimer = setTimeout(() => fn(...args), delay);\n\t\t};\n\t}\n\n\tconst rebuild = async (trigger: string) => {\n\t\tprintToConsole(\n\t\t\tcolors.yellow(\n\t\t\t\t`↻ Change detected in ${path.basename(trigger)}, rebuilding...`,\n\t\t\t),\n\t\t);\n\t\tconst start = performance.now();\n\t\ttry {\n\t\t\tawait build();\n\t\t\tconst duration = ((performance.now() - start) / 1000).toFixed(2);\n\t\t\tprintToConsole(\n\t\t\t\t`${colors.green.bold(\"✓\")} Updated mod.json (${duration}s)`,\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tprintToConsole(\n\t\t\t\tcolors.red(\n\t\t\t\t\t`${colors.red.bold(\"✗\")} Rebuild failed: ${(err as Error).message}`,\n\t\t\t\t),\n\t\t\t\ttrue,\n\t\t\t);\n\t\t}\n\t};\n\n\tconst debouncedRebuild = debounce(rebuild, 200);\n\n\tasync function collectWatchTargets(): Promise<string[]> {\n\t\tconst targets: string[] = [];\n\n\t\tif (config.entrypoint)\n\t\t\ttargets.push(path.resolve(workingDir, config.entrypoint));\n\t\tif (config.scenes)\n\t\t\tfor (const [, scene] of config.scenes)\n\t\t\t\ttargets.push(path.resolve(workingDir, scene));\n\t\tif (config.strings) targets.push(path.resolve(workingDir, config.strings));\n\t\tfor await (const entry of glob(\"bf6.config.*\")) targets.push(entry);\n\t\tfor await (const entry of glob(\"src/**/*\")) targets.push(entry);\n\n\t\treturn targets;\n\t}\n\n\tasync function setupWatcher() {\n\t\tif (watcher) {\n\t\t\tawait watcher.close();\n\t\t\tprintToConsole(\n\t\t\t\tcolors.grey(\"♻ Reloading watcher due to config change...\"),\n\t\t\t);\n\t\t\tawait new Promise((r) => setTimeout(r, 10));\n\t\t}\n\n\t\tconst watchTargets = await collectWatchTargets();\n\t\tprintToConsole(colors.cyan(`👀 Watching ${watchTargets.length} files...`));\n\n\t\twatcher = chokidar.watch(watchTargets, {\n\t\t\tpersistent: true,\n\t\t\tignoreInitial: true,\n\t\t\tawaitWriteFinish: { stabilityThreshold: 250, pollInterval: 100 },\n\t\t\tignored: [outDir, `${outDir}/**`, \"node_modules/**\", \".git/**\"],\n\t\t});\n\n\t\twatcher.on(\"error\", (err) => {\n\t\t\tprintToConsole(\n\t\t\t\tcolors.red(`⚠ Watcher error: ${(err as Error).message}`),\n\t\t\t\ttrue,\n\t\t\t);\n\t\t\tsetTimeout(setupWatcher, 1000);\n\t\t});\n\n\t\twatcher.on(\"change\", async (file) => {\n\t\t\tif (file.includes(\"bf6.config.\")) {\n\t\t\t\tprintToConsole(\n\t\t\t\t\tcolors.magenta(\"⚙ Config changed — reloading watcher...\"),\n\t\t\t\t);\n\t\t\t\tconfig = await getBf6Config(workingDir);\n\t\t\t\tawait setupWatcher();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdebouncedRebuild(file);\n\t\t});\n\n\t\twatcher.on(\"add\", debouncedRebuild);\n\t\tawait rebuild(\"initial\");\n\t}\n\n\tprocess.on(\"SIGINT\", async () => {\n\t\tprintToConsole(colors.red(`\\n${colors.red.bold(\"✗\")} Exiting dev mode...`));\n\t\tawait watcher?.close();\n\t\tprocess.exit(0);\n\t});\n\n\tawait setupWatcher();\n\n\tlet logger: Bf6Logger | undefined;\n\ttry {\n\t\tlogger = new Bf6Logger();\n\t\tlogger.start();\n\t} catch (error) {\n\t\tprintToConsole(\n\t\t\tcolors.grey(\n\t\t\t\t\"Failed to start logging for the following reason (building will still work)\",\n\t\t\t),\n\t\t\ttrue,\n\t\t);\n\t\tprintToConsole((error as Error).message, true);\n\t}\n}\n","import child_process from \"node:child_process\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport * as prompts from \"@clack/prompts\";\nimport { importFile } from \"./import.ts\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst templatesDir = path.resolve(__dirname, \"../resources/templates\");\n\nfunction renameFilesRecursively(dir: string, modName: string) {\n\tconst entries = fs.readdirSync(dir, { withFileTypes: true });\n\tfor (const entry of entries) {\n\t\tconst oldPath = path.join(dir, entry.name);\n\t\tlet newPath = oldPath;\n\n\t\t// Rename file or folder if it includes {name}\n\t\tif (entry.name.includes(\"{name}\")) {\n\t\t\tconst newName = entry.name.replace(\"{name}\", modName);\n\t\t\tnewPath = path.join(dir, newName);\n\t\t\tfs.renameSync(oldPath, newPath);\n\t\t}\n\n\t\t// If it's a bf6.config.ts, replace the {bf6ConfigName} placeholder\n\t\tif (entry.name === \"bf6.config.ts\") {\n\t\t\tlet content = fs.readFileSync(newPath, \"utf-8\");\n\t\t\tcontent = content.replace(/{bf6ConfigName}/g, modName);\n\t\t\tfs.writeFileSync(newPath, content, \"utf-8\");\n\t\t}\n\n\t\t// If it's a package.json, rewrite the \"name\" field\n\t\tif (entry.name === \"package.json\") {\n\t\t\tconst pkg = JSON.parse(fs.readFileSync(newPath, \"utf-8\"));\n\t\t\tpkg.name = modName;\n\t\t\tfs.writeFileSync(newPath, JSON.stringify(pkg, null, 2));\n\t\t}\n\n\t\t// Recurse into directories (using the new name if renamed)\n\t\tif (fs.statSync(newPath).isDirectory()) {\n\t\t\trenameFilesRecursively(newPath, modName);\n\t\t}\n\t}\n}\n\nexport const templates = [\n\t\"Basic\",\n\t\"AcePursuit\",\n\t\"BombSquad\",\n\t\"Exfil\",\n\t\"Vertigo\",\n] as const;\n\nexport async function startProject(\n\tdestination: string,\n\ttemplate: (typeof templates)[number] | \"None\",\n\tname?: string,\n) {\n\tif ([\"AcePursuit\", \"BombSquad\", \"Exfil\", \"Vertigo\"].includes(template)) {\n\t\tconst importPath = path.resolve(templatesDir, `${template}.json`);\n\t\tawait importFile(importPath, destination, name);\n\t} else if (template === \"None\") {\n\t\t// Do nothing if none\n\t} else {\n\t\t// Handles the Basic and any other template provided\n\t\tconst templateDir = path.resolve(templatesDir, template);\n\t\tfs.cpSync(templateDir, destination, { recursive: true });\n\t}\n\n\tfs.cpSync(path.resolve(templatesDir, \"All\"), destination, {\n\t\trecursive: true,\n\t});\n\n\tif (name) renameFilesRecursively(destination, name);\n}\n\nexport function installDependencies(projectDir: string) {\n\ttry {\n\t\tchild_process.execSync(`npm install`, {\n\t\t\tstdio: \"inherit\",\n\t\t\tcwd: projectDir,\n\t\t});\n\t\treturn true;\n\t} catch (_err) {\n\t\treturn false;\n\t}\n}\n\nconst _defaultTargetDir = \"bf6-mod\";\nconst cancel = () => prompts.cancel(\"Operation cancelled\");\n\nfunction isEmpty(path: string) {\n\tconst files = fs.readdirSync(path);\n\treturn files.length === 0 || (files.length === 1 && files[0] === \".git\");\n}\n\nfunction emptyDir(dir: string) {\n\tif (!fs.existsSync(dir)) {\n\t\treturn;\n\t}\n\tfor (const file of fs.readdirSync(dir)) {\n\t\tif (file === \".git\") {\n\t\t\tcontinue;\n\t\t}\n\t\tfs.rmSync(path.resolve(dir, file), { recursive: true, force: true });\n\t}\n}\n\nexport async function init(argTargetDir?: string) {\n\tprompts.intro(\"Initialize Bf6 Mod\");\n\n\tconst path = argTargetDir\n\t\t? argTargetDir\n\t\t: await prompts.text({\n\t\t\t\tmessage: \"Where should we create your project?\",\n\t\t\t\tplaceholder: \"./ace-pursuit\",\n\t\t\t\tvalidate: (value) => {\n\t\t\t\t\tif (!value) return \"Please enter a path.\";\n\t\t\t\t\tif (value[0] !== \".\") return \"Please enter a relative path.\";\n\t\t\t\t},\n\t\t\t});\n\tif (prompts.isCancel(path)) return cancel();\n\n\tlet name = await prompts.text({\n\t\tmessage: \"What is the name of your mod?\",\n\t\tplaceholder: \"Ace Pursuit\",\n\t\tvalidate: (value) => {\n\t\t\tif (!value.trim()) return \"Please enter a name.\";\n\t\t},\n\t});\n\tif (prompts.isCancel(name)) return cancel();\n\tname = name.trim();\n\n\tif (fs.existsSync(path) && !isEmpty(path)) {\n\t\tlet overwrite: \"yes\" | \"no\" | \"ignore\" | undefined;\n\t\tconst res = await prompts.select({\n\t\t\tmessage:\n\t\t\t\t(path === \".\" ? \"Current directory\" : `Target directory \"${path}\"`) +\n\t\t\t\t` is not empty. Please choose how to proceed:`,\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"Cancel operation\",\n\t\t\t\t\tvalue: \"no\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"Remove existing files and continue\",\n\t\t\t\t\tvalue: \"yes\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"Ignore files and continue\",\n\t\t\t\t\tvalue: \"ignore\",\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t\tif (prompts.isCancel(res)) return cancel();\n\t\toverwrite = res;\n\n\t\tswitch (overwrite) {\n\t\t\tcase \"yes\":\n\t\t\t\temptyDir(path);\n\t\t\t\tbreak;\n\t\t\tcase \"no\":\n\t\t\t\tcancel();\n\t\t\t\treturn;\n\t\t}\n\t}\n\n\tconst template = await prompts.select({\n\t\tmessage: \"Select a template:\",\n\t\toptions: templates.map((template) => {\n\t\t\treturn {\n\t\t\t\tlabel: template,\n\t\t\t\tvalue: template,\n\t\t\t};\n\t\t}),\n\t});\n\tif (prompts.isCancel(template)) return cancel();\n\n\tawait startProject(path, template, name);\n\n\tconst s = prompts.spinner();\n\ts.start(\"Installing via npm\");\n\tconst installed = installDependencies(path);\n\tif (installed) s.stop(\"Installed via npm\");\n\telse s.stop(\"Failed to install via npm\", 1);\n\n\tconst nextSteps = `cd ${path}\\nnpm run build`;\n\n\tprompts.note(nextSteps, \"Next steps.\");\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { AttachmentType, type ConfigType } from \"@bf6mods/sdk\";\nimport stringifyObject from \"stringify-object\";\nimport { MapId as MapIdEnum } from \"../resources/prepare/types/config.ts\";\nimport { startProject } from \"./init.ts\";\n\nasync function writeFileSafe(filePath: string, data: string | Buffer) {\n\tconst dir = path.dirname(filePath);\n\tawait fs.promises.mkdir(dir, { recursive: true });\n\tawait fs.promises.writeFile(filePath, data);\n}\n\nfunction getMapKeyByValue(value: string): keyof typeof MapIdEnum | undefined {\n\treturn Object.keys(MapIdEnum).find(\n\t\t(k) => MapIdEnum[k as keyof typeof MapIdEnum] === value,\n\t) as keyof typeof MapIdEnum | undefined;\n}\n\nexport async function importFile(input: string, output: string, name?: string) {\n\tconst workingDir = path.resolve(\".\");\n\tconst entrypoint = path.resolve(workingDir, input);\n\tconst outDir = path.resolve(workingDir, output);\n\n\tif (!fs.existsSync(entrypoint)) throw new Error(\"Cannot find strings file\");\n\n\tconst config = JSON.parse(\n\t\tawait fs.promises.readFile(entrypoint, { encoding: \"utf8\" }),\n\t) as ConfigType;\n\n\tif (!fs.existsSync(outDir))\n\t\tawait fs.promises.mkdir(outDir, { recursive: true });\n\n\tawait startProject(outDir, \"None\", name ?? config.name);\n\n\tlet typescriptFile: string | undefined;\n\tlet stringsFile: string | undefined;\n\tconst scenes: [string, string][] = [];\n\tconst promises: Promise<unknown>[] = [];\n\n\tif (config.attachments) {\n\t\tfor (const attachment of config.attachments) {\n\t\t\tif (attachment.attachmentType === AttachmentType.TypeScript)\n\t\t\t\ttypescriptFile = attachment.filename;\n\n\t\t\tif (attachment.attachmentType === AttachmentType.Strings)\n\t\t\t\tstringsFile = attachment.filename;\n\n\t\t\tif (attachment.attachmentType === AttachmentType.SpatialData) {\n\t\t\t\t// We'll just use the data attached to mapRotation instead\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tpromises.push(\n\t\t\t\twriteFileSafe(\n\t\t\t\t\tpath.resolve(outDir, \"src\", attachment.filename),\n\t\t\t\t\tatob(attachment.attachmentData.original),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n\n\t// Extract spatial scenes from mapRotation instead of guessing\n\tif (config.mapRotation?.length) {\n\t\tfor (const map of config.mapRotation) {\n\t\t\tpromises.push(\n\t\t\t\twriteFileSafe(\n\t\t\t\t\tpath.resolve(outDir, \"src\", \"scenes\", map.spatialAttachment.filename),\n\t\t\t\t\tatob(map.spatialAttachment.attachmentData.original),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tscenes.push([map.id, `src/scenes/${map.spatialAttachment.filename}`]);\n\t\t}\n\t}\n\n\t// build the new bf6.config.ts structure\n\tconst bf6Config = {\n\t\tname: name ?? config.name,\n\t\tdescription: config.description,\n\t\toutDir: \"dist\",\n\t\tentrypoint: typescriptFile ? `src/${typescriptFile}` : undefined,\n\t\tscenes: scenes\n\t\t\t? scenes.map(([id, path]) => [\n\t\t\t\t\t`MapId.${getMapKeyByValue(id) ?? id}`,\n\t\t\t\t\tpath,\n\t\t\t\t])\n\t\t\t: undefined,\n\t\tstrings: stringsFile ? `src/${stringsFile}` : undefined,\n\t\tgame: {\n\t\t\tmutators: config.mutators,\n\t\t\tassetRestrictions: config.assetRestrictions,\n\t\t\tgameMode: config.gameMode,\n\t\t\tteamComposition: config.teamComposition,\n\t\t},\n\t};\n\n\tconst bf6ConfigContent = `export default defineBf6Config(${stringifyWithRaw(\n\t\tbf6Config,\n\t)});\\n`;\n\n\tpromises.push(\n\t\twriteFileSafe(path.resolve(outDir, \"bf6.config.ts\"), bf6ConfigContent),\n\t);\n\n\tawait Promise.all(promises);\n}\n\nfunction stringifyWithRaw(value: unknown, options = {}) {\n\treturn stringifyObject(value, {\n\t\tindent: \" \", // 4 spaces\n\t\tsingleQuotes: true,\n\t\ttransform: (_obj, _prop, originalResult) => {\n\t\t\t// Remove quotes from MapId.* expressions\n\t\t\tif (/^['\"]MapId\\.[A-Za-z0-9_]+['\"]$/.test(originalResult)) {\n\t\t\t\treturn originalResult.slice(1, -1); // remove surrounding quotes\n\t\t\t}\n\t\t\treturn originalResult;\n\t\t},\n\t\t...options,\n\t});\n}\n","import fs from \"node:fs\";\r\nimport path from \"node:path\";\r\nimport { fileURLToPath } from \"node:url\";\r\nimport colors from \"colors\";\r\nimport { genExport, genInlineTypeImport } from \"knitwork\";\r\nimport { printToConsole } from \"./utils.js\";\r\n\r\nexport async function prepare() {\r\n\ttry {\r\n\t\tconst __filename = fileURLToPath(import.meta.url);\r\n\t\tconst __dirname = path.dirname(__filename);\r\n\r\n\t\tconst _workingDir = path.resolve(\".\");\r\n\t\tconst buildDir = path.resolve(\".bf6\");\r\n\r\n\t\tconst resources = path.resolve(__dirname, \"../resources/prepare\");\r\n\r\n\t\tfs.cpSync(\r\n\t\t\tpath.resolve(resources, \"tsconfig.json\"),\r\n\t\t\tpath.resolve(buildDir, \"tsconfig.json\"),\r\n\t\t);\r\n\t\tfs.cpSync(\r\n\t\t\tpath.resolve(resources, \"bf6.d.ts\"),\r\n\t\t\tpath.resolve(buildDir, \"bf6.d.ts\"),\r\n\t\t);\r\n\t\tfs.cpSync(\r\n\t\t\tpath.resolve(resources, \"types\", \"config.ts\"),\r\n\t\t\tpath.resolve(buildDir, \"types\", \"config.ts\"),\r\n\t\t);\r\n\r\n\t\tconst ConfigFileExports = genExport(\"./types/config.ts\", [\r\n\t\t\t\"defineBf6Config\",\r\n\t\t]);\r\n\t\tfs.writeFileSync(\r\n\t\t\tpath.resolve(buildDir, \"imports.d.ts\"),\r\n\t\t\t`${ConfigFileExports}\\n`,\r\n\t\t);\r\n\r\n\t\tconst augmentations: Record<string, string> = {\r\n\t\t\tdefineBf6Config: genInlineTypeImport(\r\n\t\t\t\t\"./types/config.ts\",\r\n\t\t\t\t`defineBf6Config`,\r\n\t\t\t),\r\n\t\t\tMapId: genInlineTypeImport(\"./types/config.ts\", `MapId`),\r\n\t\t};\r\n\r\n\t\tconst args = genNamespaceAugmentation(\"global\", augmentations);\r\n\t\tfs.writeFileSync(\r\n\t\t\tpath.resolve(buildDir, \"globals.d.ts\"),\r\n\t\t\t`export {}\\n\\n${args}\\n`,\r\n\t\t);\r\n\r\n\t\tprintToConsole(`${colors.green.bold(\"✓\")} Types generated in .bf6`);\r\n\t} catch (error) {\r\n\t\tconsole.error(error);\r\n\t\tprintToConsole(\r\n\t\t\t`${colors.red.bold(\"✗\")} Types failed to generate in .bf6`,\r\n\t\t\ttrue,\r\n\t\t);\r\n\t}\r\n}\r\n\r\nconst genNamespaceAugmentation = (\r\n\tname: string,\r\n\tcontents: Record<string, string>,\r\n) => {\r\n\tif (!contents || Object.keys(contents).length === 0)\r\n\t\treturn `declare ${name} {}`;\r\n\tconst decls = Object.entries(contents)\r\n\t\t.map(([k, v]) => `\\tconst ${k}: ${v};`)\r\n\t\t.join(\"\\n\");\r\n\treturn `declare ${name} {\\n${decls}\\n}`;\r\n};\r\n","#!/usr/bin/env node\nimport { Command } from \"commander\";\nimport pkg from \"../../package.json\" with { type: \"json\" };\nimport { build } from \"./build/index.ts\";\nimport { dev } from \"./dev.ts\";\nimport { importFile } from \"./import.ts\";\nimport { init, installDependencies } from \"./init.js\";\nimport { Bf6Logger } from \"./log.ts\";\nimport { prepare } from \"./prepare.js\";\n\nconst program = new Command();\n\nprogram\n\t.name(Object.keys(pkg.bin)[0])\n\t.description(pkg.description)\n\t.version(pkg.version);\n\nprogram\n\t.command(\"init\")\n\t.argument(\"[directory]\")\n\t.description(\"Create a new bf6 mod\")\n\t.action(async (directory) => {\n\t\tawait init(directory);\n\t});\n\nprogram\n\t.command(\"build\")\n\t.description(\"build the bf6 mod\")\n\t.action(async () => {\n\t\tawait build();\n\t});\n\nprogram\n\t.command(\"prepare\")\n\t.description(\"prepare the types for bf6 mod\")\n\t.action(async () => {\n\t\tawait prepare();\n\t});\n\nprogram\n\t.command(\"dev\")\n\t.description(\"watch the changes in src, and recompile as needed\")\n\t.action(async () => {\n\t\tawait dev();\n\t});\n\nprogram\n\t.command(\"import\")\n\t.argument(\"<input>\")\n\t.argument(\"<output>\")\n\t.description(\"decompiles the json config of a mod into a new project\")\n\t.action(async (input, output) => {\n\t\tawait importFile(input as string, output as string);\n\t\tinstallDependencies(output);\n\t});\n\nprogram\n\t.command(\"log\")\n\t.argument(\"[input]\")\n\t.description(\"logs the output from a locally running server\")\n\t.action(async (input) => {\n\t\tconst logger = new Bf6Logger(input);\n\t\tlogger.start();\n\t});\n\nprogram.exitOverride((_err) => {\n\tif (process.env.EXIT_CODE === \"none\") process.exit(0);\n});\n\nprogram.parse();\n"],"mappings":";;;;;;;;;;;;;;;;;;cAEY;kBACI;UAGR,EACN,WAAW,uBACX;;;;ACNF,IAAY,0CAAL;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLD,MAAa,kBAAkB,SAAiB,QAAiB,UAAU;CAC1E,MAAM,sBAAM,IA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
|
3
3
|
"scripts": {
|
|
4
4
|
"build": "bf6mods build",
|
|
5
5
|
"dev": "bf6mods dev",
|
|
6
|
+
"log": "bf6mods log",
|
|
6
7
|
"postinstall": "bf6mods prepare"
|
|
7
8
|
},
|
|
8
9
|
"type": "module",
|
|
9
10
|
"devDependencies": {
|
|
10
|
-
"@bf6mods/cli": "^1.0
|
|
11
|
-
"@bf6mods/sdk": "^1.0
|
|
11
|
+
"@bf6mods/cli": "^1.2.0",
|
|
12
|
+
"@bf6mods/sdk": "^1.1.0"
|
|
12
13
|
}
|
|
13
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bf6mods/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "CLI and library for bundling BF6 mods",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "
|
|
13
|
+
"build": "tsdown",
|
|
14
14
|
"start": "cross-env EXIT_CODE=none tsx ./src/cli/index.ts"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
@@ -34,8 +34,9 @@
|
|
|
34
34
|
"commander": "^14.0.1",
|
|
35
35
|
"jiti": "^2.6.1",
|
|
36
36
|
"knitwork": "^1.2.0",
|
|
37
|
-
"rolldown": "^1.0.0-beta.
|
|
38
|
-
"stringify-object": "^6.0.0"
|
|
37
|
+
"rolldown": "^1.0.0-beta.44",
|
|
38
|
+
"stringify-object": "^6.0.0",
|
|
39
|
+
"strip-ansi": "^7.1.2"
|
|
39
40
|
},
|
|
40
41
|
"publishConfig": {
|
|
41
42
|
"access": "public"
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|