@maltty/cli 1.0.0-rc.0 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_format-CeQhQTl5.js → _format-XTN-U4H5.js} +4 -2
- package/dist/{_format-CeQhQTl5.js.map → _format-XTN-U4H5.js.map} +1 -1
- package/dist/attemptAsync-D_oWcKfe.js +74 -0
- package/dist/attemptAsync-D_oWcKfe.js.map +1 -0
- package/dist/commands/add/command.d.ts +0 -1
- package/dist/commands/add/command.d.ts.map +1 -1
- package/dist/commands/add/command.js +4 -4
- package/dist/commands/add/command.js.map +1 -1
- package/dist/commands/add/config.d.ts +0 -1
- package/dist/commands/add/config.d.ts.map +1 -1
- package/dist/commands/add/config.js +3 -3
- package/dist/commands/add/config.js.map +1 -1
- package/dist/commands/add/index.d.ts +0 -1
- package/dist/commands/add/index.d.ts.map +1 -1
- package/dist/commands/add/index.js.map +1 -1
- package/dist/commands/add/middleware.d.ts +0 -1
- package/dist/commands/add/middleware.d.ts.map +1 -1
- package/dist/commands/add/middleware.js +3 -3
- package/dist/commands/add/middleware.js.map +1 -1
- package/dist/commands/build.d.ts +7 -8
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +3 -3
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/commands.d.ts +6 -7
- package/dist/commands/commands.d.ts.map +1 -1
- package/dist/commands/commands.js +5 -5
- package/dist/commands/commands.js.map +1 -1
- package/dist/commands/dev.d.ts +5 -6
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +3 -3
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts +5 -6
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +7 -6
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/run.d.ts +11 -12
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +6 -6
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/stories.d.ts +3 -4
- package/dist/commands/stories.d.ts.map +1 -1
- package/dist/commands/stories.js.map +1 -1
- package/dist/{config-helpers-pv_2Spux.js → config-helpers-DAy-Arox.js} +1 -1
- package/dist/{config-helpers-pv_2Spux.js.map → config-helpers-DAy-Arox.js.map} +1 -1
- package/dist/{defu-BBwssjW3.js → defu-BOMYL43b.js} +1 -13
- package/dist/{defu-BBwssjW3.js.map → defu-BOMYL43b.js.map} +1 -1
- package/dist/{detect-AOq1ehTE.js → detect-Gdceq3rh.js} +4 -4
- package/dist/{detect-AOq1ehTE.js.map → detect-Gdceq3rh.js.map} +1 -1
- package/dist/{dist-Xa07jNxS.js → dist-BGEDDbkB.js} +1430 -859
- package/dist/dist-BGEDDbkB.js.map +1 -0
- package/dist/{dist-DW_gRP7_.js → dist-FY8K5na4.js} +37 -8
- package/dist/dist-FY8K5na4.js.map +1 -0
- package/dist/fs-Uxhr-pvi-AfTuGWmD.js +98 -0
- package/dist/fs-Uxhr-pvi-AfTuGWmD.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{jiti-CxWlVmZ_.js → jiti-DLiXBetA.js} +15 -10
- package/dist/{jiti-CxWlVmZ_.js.map → jiti-DLiXBetA.js.map} +1 -1
- package/dist/json-DjLTvRvF.js +82 -0
- package/dist/json-DjLTvRvF.js.map +1 -0
- package/dist/{json5-z-PGDMyy.js → json5-Dgws4cj9.js} +22 -8
- package/dist/{json5-z-PGDMyy.js.map → json5-Dgws4cj9.js.map} +1 -1
- package/dist/{jsonc-DqZkfC3S.js → jsonc-B3DUZTiW.js} +9 -15
- package/dist/jsonc-B3DUZTiW.js.map +1 -0
- package/dist/jsonc-BjIiMOLf.js +2 -0
- package/dist/{main-C_8x2aB3.js → main-CMmTVJ4V.js} +2 -2
- package/dist/{main-C_8x2aB3.js.map → main-CMmTVJ4V.js.map} +1 -1
- package/dist/{manifest-BIKVDJML.js → manifest-C192Fk9X.js} +3 -3
- package/dist/{manifest-BIKVDJML.js.map → manifest-C192Fk9X.js.map} +1 -1
- package/dist/{multipart-parser-MNkxNO83.js → multipart-parser-XnJOfY8C.js} +14 -4
- package/dist/{multipart-parser-MNkxNO83.js.map → multipart-parser-XnJOfY8C.js.map} +1 -1
- package/dist/{node-C91xGGqn.js → node-Bbe24r0m.js} +28 -105
- package/dist/node-Bbe24r0m.js.map +1 -0
- package/dist/{node-Drmc03fL.js → node-lkjrm0W1.js} +95 -33
- package/dist/{node-Drmc03fL.js.map → node-lkjrm0W1.js.map} +1 -1
- package/dist/{ohash-BPoV4zBH.js → ohash-Cgvv31gH.js} +5 -3
- package/dist/ohash-Cgvv31gH.js.map +1 -0
- package/dist/pnpm-workspace.yaml +10 -10
- package/dist/{chunk-DsIazq42.js → rolldown-runtime-C7HZzL1F.js} +2 -2
- package/dist/{toml-LuHsHQtV.js → toml-BrfNstp2.js} +34 -3
- package/dist/{toml-LuHsHQtV.js.map → toml-BrfNstp2.js.map} +1 -1
- package/dist/{utils-DlIJNGLQ.js → utils-ioeFEbm4.js} +208 -236
- package/dist/utils-ioeFEbm4.js.map +1 -0
- package/dist/{validate-C_SXBoLq.js → validate-CX8axBK6.js} +1 -1
- package/dist/{validate-C_SXBoLq.js.map → validate-CX8axBK6.js.map} +1 -1
- package/dist/{write-CSwG4Stj.js → write-C6VsyUuc.js} +6 -4
- package/dist/{write-CSwG4Stj.js.map → write-C6VsyUuc.js.map} +1 -1
- package/dist/{yaml-BS9RDuUr.js → yaml-Cp5SldPx.js} +78 -18
- package/dist/yaml-Cp5SldPx.js.map +1 -0
- package/package.json +14 -14
- package/dist/attemptAsync-BdXzRSIT.js +0 -42
- package/dist/attemptAsync-BdXzRSIT.js.map +0 -1
- package/dist/dist-DW_gRP7_.js.map +0 -1
- package/dist/dist-Xa07jNxS.js.map +0 -1
- package/dist/json-D7WbuVK1.js +0 -43
- package/dist/json-D7WbuVK1.js.map +0 -1
- package/dist/jsonc-DqZkfC3S.js.map +0 -1
- package/dist/jsonc-KADMdSjU.js +0 -2
- package/dist/node-C91xGGqn.js.map +0 -1
- package/dist/ohash-BPoV4zBH.js.map +0 -1
- package/dist/utils-DlIJNGLQ.js.map +0 -1
- package/dist/yaml-BS9RDuUr.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dist-DW_gRP7_.js","names":["path","match","fs","process$1","P"],"sources":["../../../node_modules/.pnpm/es-toolkit@1.46.1/node_modules/es-toolkit/dist/function/noop.mjs","../../../node_modules/.pnpm/es-toolkit@1.46.1/node_modules/es-toolkit/dist/predicate/isNil.mjs","../../bundler/dist/index.js"],"sourcesContent":["function noop() { }\n\nexport { noop };\n","function isNil(x) {\n return x == null;\n}\n\nexport { isNil };\n","import { builtinModules, createRequire } from \"node:module\";\nimport { readManifest } from \"@maltty/utils/manifest\";\nimport { attemptAsync, isNil, noop } from \"es-toolkit\";\nimport { P, match } from \"ts-pattern\";\nimport { err, ok, toError } from \"@maltty/utils/fp\";\nimport { build } from \"tsdown\";\nimport { fs, path, process as process$1 } from \"@maltty/utils/node\";\nimport { readdir } from \"node:fs/promises\";\nimport { basename, extname, join, resolve } from \"node:path\";\nimport { compileTargets } from \"@maltty/config/utils\";\n//#region src/autoloader/generate-autoloader.ts\n/**\n* Generate JavaScript source code for a static autoloader virtual module.\n*\n* The generated module statically imports every discovered command file and\n* exports an `autoload()` function that returns the pre-built CommandMap.\n* Directory commands that merge a parent handler with subcommands are re-tagged\n* via `withTag` because the TAG symbol is non-enumerable and lost on spread.\n*\n* @param params - The scan result and path to the tag utility module.\n* @returns JavaScript source code for the static autoloader.\n*/\nfunction generateStaticAutoloader(params) {\n\tconst importLines = buildImportStatements(collectImports(params.scan), params.tagModulePath);\n\tconst commandsObject = buildCommandsObject(params.scan);\n\treturn [\n\t\t...importLines,\n\t\t\"\",\n\t\t`const commands = ${commandsObject}`,\n\t\t\"\",\n\t\t\"export async function autoload() {\",\n\t\t\" return commands\",\n\t\t\"}\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\n/**\n* Collect all import entries from a scan result.\n*\n* @private\n* @param scan - The scan result to collect imports from.\n* @returns A flat array of all import entries.\n*/\nfunction collectImports(scan) {\n\treturn [...scan.files.map((file) => fileToImport(file, [])), ...scan.dirs.flatMap((dir) => collectDirImports(dir, []))];\n}\n/**\n* Recursively collect import entries from a scanned directory.\n*\n* @private\n* @param dir - The scanned directory.\n* @param parentPath - The path segments leading to this directory.\n* @returns A flat array of import entries for the directory and its children.\n*/\nfunction collectDirImports(dir, parentPath) {\n\tconst currentPath = [...parentPath, dir.name];\n\treturn [\n\t\t...buildIndexImport(dir.index, currentPath),\n\t\t...dir.files.map((file) => fileToImport(file, currentPath)),\n\t\t...dir.dirs.flatMap((sub) => collectDirImports(sub, currentPath))\n\t];\n}\n/**\n* Create an import entry for a leaf command file.\n*\n* @private\n* @param file - The scanned file.\n* @param parentPath - The path segments leading to the file's parent directory.\n* @returns An import entry with a generated identifier.\n*/\nfunction fileToImport(file, parentPath) {\n\treturn {\n\t\tfilePath: file.filePath,\n\t\tidentifier: toIdentifier([...parentPath, file.name])\n\t};\n}\n/**\n* Convert a path segment array to a valid JavaScript identifier.\n*\n* Joins segments with underscores and prefixes with `_`.\n* Example: `['deploy', 'preview']` becomes `_deploy_preview`.\n*\n* @private\n* @param segments - The path segments to convert.\n* @returns A valid JavaScript identifier string.\n*/\nfunction toIdentifier(segments) {\n\treturn `_${segments.map((s) => s.replaceAll(\"-\", \"$\")).join(\"_\")}`;\n}\n/**\n* Build the array of import statement lines.\n*\n* @private\n* @param imports - All collected import entries.\n* @param tagModulePath - Absolute path to the tag utility module.\n* @returns An array of import statement strings.\n*/\nfunction buildImportStatements(imports, tagModulePath) {\n\tconst tagLine = buildTagImportLine(imports, tagModulePath);\n\tconst importLines = imports.map((entry) => `import ${entry.identifier} from '${path.toImportUrl(entry.filePath)}'`);\n\treturn [\n\t\t...tagLine,\n\t\t\"\",\n\t\t...importLines\n\t];\n}\n/**\n* Build the JavaScript object literal string for the top-level commands map.\n*\n* @private\n* @param scan - The scan result.\n* @returns A string representation of the commands object literal.\n*/\nfunction buildCommandsObject(scan) {\n\treturn formatObject([...scan.files.map((file) => buildFileEntry(file, [])), ...scan.dirs.map((dir) => buildDirEntry(dir, []))]);\n}\n/**\n* Build an object entry string for a leaf command file.\n*\n* @private\n* @param file - The scanned file.\n* @param parentPath - Path segments to the file's parent.\n* @returns A string like `'status': _status`.\n*/\nfunction buildFileEntry(file, parentPath) {\n\tconst identifier = toIdentifier([...parentPath, file.name]);\n\treturn `'${file.name}': ${identifier}`;\n}\n/**\n* Build an object entry string for a directory command (possibly with subcommands).\n*\n* @private\n* @param dir - The scanned directory.\n* @param parentPath - Path segments to the directory's parent.\n* @returns A string representing the directory command with withTag wrapping.\n*/\nfunction buildDirEntry(dir, parentPath) {\n\tconst currentPath = [...parentPath, dir.name];\n\tconst commandsObj = formatObject([...dir.files.map((file) => buildFileEntry(file, currentPath)), ...dir.dirs.map((sub) => buildDirEntry(sub, currentPath))]);\n\tif (dir.index) {\n\t\tconst indexIdentifier = toIdentifier(currentPath);\n\t\treturn `'${dir.name}': withTag({ ...${indexIdentifier}, commands: ${commandsObj} }, 'Command')`;\n\t}\n\treturn `'${dir.name}': withTag({ commands: ${commandsObj} }, 'Command')`;\n}\n/**\n* Build the import entry for an index file, if present.\n*\n* @private\n* @param index - The absolute path to the index file, or undefined.\n* @param currentPath - The current path segments for identifier generation.\n* @returns An array with zero or one import entries.\n*/\nfunction buildIndexImport(index, currentPath) {\n\tif (!index) return [];\n\treturn [{\n\t\tfilePath: index,\n\t\tidentifier: toIdentifier(currentPath)\n\t}];\n}\n/**\n* Build the tag import line if any imports exist.\n*\n* @private\n* @param imports - The collected import entries.\n* @param tagModulePath - The absolute path to the tag module.\n* @returns An array with zero or one import statement strings.\n*/\nfunction buildTagImportLine(imports, tagModulePath) {\n\tif (imports.length === 0) return [];\n\treturn [`import { withTag } from '${path.toImportUrl(tagModulePath)}'`];\n}\n/**\n* Format an array of key-value strings as a JavaScript object literal.\n*\n* @private\n* @param entries - The key-value pair strings.\n* @returns A formatted object literal string.\n*/\nfunction formatObject(entries) {\n\tif (entries.length === 0) return \"{}\";\n\treturn `{\\n${entries.map((entry) => ` ${entry},`).join(\"\\n\")}\\n}`;\n}\n//#endregion\n//#region src/autoloader/scan-commands.ts\nconst VALID_EXTENSIONS = new Set([\n\t\".ts\",\n\t\".js\",\n\t\".mjs\",\n\t\".tsx\",\n\t\".jsx\"\n]);\nconst INDEX_NAME = \"index\";\n/**\n* Scan a commands directory and produce a tree structure for static code generation.\n*\n* Mirrors the runtime autoloader's rules: valid extensions are `.ts`, `.js`, `.mjs`;\n* files and directories starting with `_` or `.` are skipped; `index` files in\n* subdirectories become parent command handlers.\n*\n* @param dir - Absolute path to the commands directory.\n* @returns A tree of scanned files and directories.\n*/\nasync function scanCommandsDir(dir) {\n\tconst entries = await readdir(dir, { withFileTypes: true });\n\tconst files = entries.filter(isCommandFile).map((entry) => toScannedFile(dir, entry));\n\treturn {\n\t\tdirs: await Promise.all(entries.filter(isCommandDir).map((entry) => scanSubDir(join(dir, entry.name)))),\n\t\tfiles\n\t};\n}\n/**\n* Recursively scan a subdirectory into a ScannedDir.\n*\n* @private\n* @param dir - Absolute path to the subdirectory.\n* @returns A ScannedDir representing the directory and its contents.\n*/\nasync function scanSubDir(dir) {\n\tconst name = basename(dir);\n\tconst entries = await readdir(dir, { withFileTypes: true });\n\tconst indexEntry = findIndexEntry(entries);\n\tconst files = entries.filter(isCommandFile).map((entry) => toScannedFile(dir, entry));\n\treturn {\n\t\tdirs: await Promise.all(entries.filter(isCommandDir).map((entry) => scanSubDir(join(dir, entry.name)))),\n\t\tfiles,\n\t\tindex: resolveIndexPath(dir, indexEntry),\n\t\tname\n\t};\n}\n/**\n* Convert a directory entry into a ScannedFile.\n*\n* @private\n* @param dir - Parent directory absolute path.\n* @param entry - The directory entry for the file.\n* @returns A ScannedFile with name and absolute file path.\n*/\nfunction toScannedFile(dir, entry) {\n\treturn {\n\t\tfilePath: join(dir, entry.name),\n\t\tname: basename(entry.name, extname(entry.name))\n\t};\n}\n/**\n* Find the index file entry among a list of directory entries.\n*\n* @private\n* @param entries - The directory entries to search.\n* @returns The Dirent for the index file, or undefined.\n*/\nfunction findIndexEntry(entries) {\n\treturn entries.find((entry) => entry.isFile() && !entry.name.endsWith(\".d.ts\") && !entry.name.endsWith(\".d.tsx\") && VALID_EXTENSIONS.has(extname(entry.name)) && basename(entry.name, extname(entry.name)) === INDEX_NAME);\n}\n/**\n* Predicate: entry is a valid command file (not index, not hidden/private).\n*\n* @private\n* @param entry - The directory entry to check.\n* @returns True when the entry is a scannable command file.\n*/\nfunction isCommandFile(entry) {\n\tif (!entry.isFile()) return false;\n\tif (entry.name.startsWith(\"_\") || entry.name.startsWith(\".\")) return false;\n\tif (entry.name.endsWith(\".d.ts\") || entry.name.endsWith(\".d.tsx\")) return false;\n\tif (!VALID_EXTENSIONS.has(extname(entry.name))) return false;\n\treturn basename(entry.name, extname(entry.name)) !== INDEX_NAME;\n}\n/**\n* Predicate: entry is a scannable command directory (not hidden/private).\n*\n* @private\n* @param entry - The directory entry to check.\n* @returns True when the entry is a scannable command directory.\n*/\nfunction isCommandDir(entry) {\n\tif (!entry.isDirectory()) return false;\n\treturn !entry.name.startsWith(\"_\") && !entry.name.startsWith(\".\");\n}\n/**\n* Resolve the absolute path to an index file entry, or undefined.\n*\n* @private\n* @param dir - The parent directory absolute path.\n* @param entry - The index file Dirent, or undefined.\n* @returns The absolute path to the index file, or undefined.\n*/\nfunction resolveIndexPath(dir, entry) {\n\tif (!entry) return;\n\treturn join(dir, entry.name);\n}\n//#endregion\n//#region src/autoloader/autoload-plugin.ts\nconst VIRTUAL_MODULE_ID = \"virtual:maltty-static-commands\";\nconst RESOLVED_VIRTUAL_ID = `\\0${VIRTUAL_MODULE_ID}`;\nconst AUTOLOADER_REGION_START = \"//#region src/autoload.ts\";\nconst AUTOLOADER_REGION_END = \"//#endregion\";\n/**\n* Create a rolldown plugin that replaces the runtime autoloader with a static version.\n*\n* Uses a three-hook approach to break the circular dependency between maltty's\n* dist and user command files (which `import { command } from 'maltty'`):\n*\n* 1. `transform` — detects maltty's pre-bundled dist and replaces the autoloader\n* region with a dynamic `import()` to a virtual module\n* 2. `resolveId` — resolves the virtual module identifier\n* 3. `load` — scans the commands directory and generates a static autoloader\n* module with all command imports pre-resolved\n*\n* The dynamic import ensures command files execute after maltty's code is fully\n* initialized, avoiding `ReferenceError` from accessing `TAG` before its\n* declaration.\n*\n* @param params - The commands directory and tag module path.\n* @returns A rolldown plugin for static autoloading.\n*/\nfunction createAutoloadPlugin(params) {\n\treturn {\n\t\tasync load(id) {\n\t\t\tif (id !== RESOLVED_VIRTUAL_ID) return null;\n\t\t\treturn generateStaticAutoloader({\n\t\t\t\tscan: await scanCommandsDir(params.commandsDir),\n\t\t\t\ttagModulePath: params.tagModulePath\n\t\t\t});\n\t\t},\n\t\tname: \"maltty-static-autoloader\",\n\t\tresolveId(source) {\n\t\t\tif (source === VIRTUAL_MODULE_ID) return RESOLVED_VIRTUAL_ID;\n\t\t\treturn null;\n\t\t},\n\t\ttransform(code, _id) {\n\t\t\tconst regionStart = code.indexOf(AUTOLOADER_REGION_START);\n\t\t\tif (regionStart === -1) return null;\n\t\t\tconst regionEnd = code.indexOf(AUTOLOADER_REGION_END, regionStart);\n\t\t\tif (regionEnd === -1) return null;\n\t\t\tconst before = code.slice(0, regionStart);\n\t\t\tconst after = code.slice(regionEnd + 12);\n\t\t\treturn `${before}${buildStaticRegion()}${after}`;\n\t\t}\n\t};\n}\n/**\n* Build the replacement autoloader region that delegates to the virtual module.\n*\n* @private\n* @returns The replacement region string with dynamic import.\n*/\nfunction buildStaticRegion() {\n\treturn [\n\t\t\"//#region src/autoload.ts (static)\",\n\t\t\"async function autoload() {\",\n\t\t` const mod = await import('${VIRTUAL_MODULE_ID}')`,\n\t\t\" return mod.autoload()\",\n\t\t\"}\",\n\t\t\"//#endregion\"\n\t].join(\"\\n\");\n}\n//#endregion\n//#region src/constants.ts\n/**\n* Shebang line prepended to CLI entry files.\n*/\nconst SHEBANG = \"#!/usr/bin/env node\\n\";\n/**\n* Default entry point for the CLI source.\n*/\nconst DEFAULT_ENTRY = \"./src/index.ts\";\n/**\n* Default directory for CLI commands.\n*/\nconst DEFAULT_COMMANDS = \"./commands\";\n/**\n* File extensions produced by maltty builds that are safe to remove during clean.\n*/\nconst BUILD_ARTIFACT_EXTENSIONS = [\n\t\".js\",\n\t\".mjs\",\n\t\".js.map\",\n\t\".mjs.map\"\n];\n/**\n* Packages that must always be bundled into the output.\n*\n* The `maltty` framework and its internal `@maltty/*` packages must be inlined\n* so the autoload plugin can intercept and replace the runtime autoloader\n* with a static version for compiled binaries.\n*/\nconst ALWAYS_BUNDLE = [/^@?maltty/];\n/**\n* Packages that are optional or conditional dependencies of bundled libraries\n* (c12, ink) that must be stubbed during compile-mode builds. These are behind\n* dynamic `import()` calls or runtime guards that never execute in production,\n* but when all deps are inlined, rolldown traces into them statically.\n*/\nconst STUB_PACKAGES = [\n\t\"chokidar\",\n\t\"magicast\",\n\t\"giget\",\n\t\"react-devtools-core\"\n];\n/**\n* Node.js builtin modules in both bare and `node:` prefixed forms.\n*/\nconst NODE_BUILTINS = [...builtinModules, ...builtinModules.map((m) => `node:${m}`)];\n//#endregion\n//#region src/build/config.ts\nconst TAG_MODULE_PATH = createRequire(import.meta.url).resolve(\"@maltty/utils/tag\");\n/**\n* Convert a resolved bundler config to a tsdown InlineConfig for production builds.\n*\n* @param params - The resolved config and optional version for compile-time injection.\n* @returns A tsdown InlineConfig ready for `build()`.\n*/\nfunction toTsdownBuildConfig(params) {\n\treturn {\n\t\tbanner: SHEBANG,\n\t\tclean: false,\n\t\tconfig: false,\n\t\tcwd: params.config.cwd,\n\t\tdefine: buildDefine({\n\t\t\tdefine: params.config.build.define,\n\t\t\tversion: params.config.version\n\t\t}),\n\t\tdeps: buildDeps(params.config.build.external, params.compile ?? false),\n\t\tdts: false,\n\t\tentry: { index: params.config.entry },\n\t\tformat: \"esm\",\n\t\tinputOptions: { resolve: { mainFields: [\"module\", \"main\"] } },\n\t\tlogLevel: \"silent\",\n\t\tminify: params.config.build.minify,\n\t\toutDir: params.config.buildOutDir,\n\t\toutputOptions: { codeSplitting: false },\n\t\tplatform: \"node\",\n\t\tplugins: [createAutoloadPlugin({\n\t\t\tcommandsDir: params.config.commands,\n\t\t\ttagModulePath: TAG_MODULE_PATH\n\t\t}), ...buildPlugins(params.compile ?? false)],\n\t\tsourcemap: params.config.build.sourcemap,\n\t\ttarget: params.config.build.target,\n\t\ttreeshake: true\n\t};\n}\n/**\n* Convert a resolved bundler config to a tsdown InlineConfig for watch mode.\n*\n* @param params - The resolved config, optional version, and optional success callback.\n* @returns A tsdown InlineConfig with `watch: true`.\n*/\nfunction toTsdownWatchConfig(params) {\n\treturn {\n\t\t...toTsdownBuildConfig({ config: params.config }),\n\t\tlogLevel: \"error\",\n\t\tonSuccess: params.onSuccess,\n\t\twatch: true\n\t};\n}\n/**\n* Build the `deps` configuration for tsdown.\n*\n* When compiling to a standalone binary, all dependencies must be inlined so\n* `bun build --compile` never encounters unresolvable bare imports. Only\n* Node.js builtins and explicit user externals are kept external.\n*\n* In normal (non-compile) mode, only `@maltty/*` packages are force-bundled\n* and everything else in `node_modules` is left external by tsdown's default.\n*\n* @private\n* @param userExternals - Additional packages the user explicitly marked external.\n* @param compile - Whether the build targets a compiled binary.\n* @returns A tsdown `deps` configuration object.\n*/\nfunction buildDeps(userExternals, compile) {\n\treturn {\n\t\talwaysBundle: resolveAlwaysBundle(compile),\n\t\tneverBundle: [...NODE_BUILTINS, ...userExternals]\n\t};\n}\n/**\n* Resolve the `alwaysBundle` rule list based on whether we're compiling.\n*\n* @private\n* @param compile - Whether the build targets a compiled binary.\n* @returns The matchers tsdown should always bundle.\n*/\nfunction resolveAlwaysBundle(compile) {\n\tif (compile) return [/./];\n\treturn [...ALWAYS_BUNDLE];\n}\n/**\n* Build the `define` map for tsdown/rolldown.\n*\n* Merges three sources (lowest to highest precedence):\n* 1. `MALTTY_PUBLIC_*` env vars — prefixed with `process.env.` for rolldown replacement\n* 2. `__MALTTY_VERSION__` — injected when a version string is available\n* 3. Explicit `define` from `maltty.config.ts` — user overrides win\n*\n* @private\n* @param params - The version and user-defined constants.\n* @returns A define map for tsdown/rolldown.\n*/\nfunction buildDefine(params) {\n\tconst envVars = resolveBuildVars();\n\tconst envDefines = Object.fromEntries(Object.entries(envVars).map(([key, value]) => [`process.env.${key}`, value]));\n\tconst versionDefine = match(params.version).with(void 0, () => ({})).otherwise((v) => ({ __MALTTY_VERSION__: JSON.stringify(v) }));\n\treturn {\n\t\t...envDefines,\n\t\t...versionDefine,\n\t\t...params.define\n\t};\n}\n/**\n* Resolve `MALTTY_PUBLIC_*` environment variables into a define map.\n*\n* Scans `process.env` for keys prefixed with `MALTTY_PUBLIC_` and returns\n* clean key-value pairs with JSON-stringified values.\n*\n* @param env - The environment variables to scan (defaults to `process.env`).\n* @returns A define map with clean keys (no `process.env.` prefix).\n*/\nfunction resolveBuildVars(env = process.env) {\n\treturn Object.fromEntries(Object.entries(env).filter(([key]) => key.startsWith(\"MALTTY_PUBLIC_\")).map(([key, value]) => [key, JSON.stringify(value ?? \"\")]));\n}\n/**\n* Build additional plugins needed when compiling to a standalone binary.\n*\n* When `compile` is true, includes a stub plugin that replaces optional/conditional\n* dependencies with empty modules so rolldown (and subsequently bun compile) never\n* attempts to resolve packages that don't exist at runtime.\n*\n* @private\n* @param compile - Whether the build targets a compiled binary.\n* @returns An array of rolldown plugins (empty when not compiling).\n*/\nfunction buildPlugins(compile) {\n\tif (compile) return [createStubPlugin(STUB_PACKAGES)];\n\treturn [];\n}\n/**\n* Create a rolldown plugin that replaces specified packages with empty modules.\n*\n* Libraries like c12 and ink have optional/conditional dependencies behind\n* dynamic `import()` calls or runtime guards (e.g. `isDev()`). When all deps\n* are inlined for compile mode, rolldown traces into these statically. Stubbing\n* at the resolve level ensures the real package is never loaded.\n*\n* @private\n* @param packages - Package names to replace with empty modules.\n* @returns A rolldown plugin.\n*/\nfunction createStubPlugin(packages) {\n\tconst stubbed = new Set(packages);\n\tconst STUB_PREFIX = \"\\0stub:\";\n\treturn {\n\t\tname: \"maltty-stub-packages\",\n\t\tresolveId(source) {\n\t\t\tif (stubbed.has(source)) return `${STUB_PREFIX}${source}`;\n\t\t\treturn null;\n\t\t},\n\t\tload(id) {\n\t\t\tif (id.startsWith(STUB_PREFIX)) return \"export default undefined;\";\n\t\t\treturn null;\n\t\t}\n\t};\n}\n//#endregion\n//#region src/utils/clean.ts\n/**\n* Remove maltty build artifacts from the output directory.\n*\n* Removes files matching known build artifact extensions (`.js`, `.mjs`,\n* `.js.map`, `.mjs.map`). When compile mode is active, also removes the\n* exact binary files that would be produced based on the resolved compile\n* name and targets.\n*\n* @param params - The resolved config and whether compile mode is active.\n* @returns A {@link CleanResult} describing what was removed and what was skipped.\n*/\nasync function clean(params) {\n\tconst [listError, entries] = await fs.list(params.resolved.buildOutDir);\n\tif (listError) return {\n\t\tforeign: [],\n\t\tremoved: []\n\t};\n\tconst binaryNames = match(params).with({ compile: true }, ({ resolved }) => buildBinaryNames(resolved.compile.name, resolved.compile.targets)).otherwise(() => /* @__PURE__ */ new Set());\n\tconst results = await Promise.all(entries.map(async (name) => {\n\t\tif (isBuildArtifact(name) || binaryNames.has(name)) {\n\t\t\tconst [removeError] = await fs.remove(join(params.resolved.buildOutDir, name));\n\t\t\tif (removeError) return {\n\t\t\t\ttype: \"foreign\",\n\t\t\t\tname\n\t\t\t};\n\t\t\treturn {\n\t\t\t\ttype: \"removed\",\n\t\t\t\tname\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\ttype: \"foreign\",\n\t\t\tname\n\t\t};\n\t}));\n\treturn {\n\t\tremoved: results.filter((r) => r.type === \"removed\").map((r) => r.name),\n\t\tforeign: results.filter((r) => r.type === \"foreign\").map((r) => r.name)\n\t};\n}\n/**\n* Check whether a filename matches a known build artifact extension.\n*\n* @private\n* @param filename - The filename to check.\n* @returns `true` when the file ends with a known build artifact extension.\n*/\nfunction isBuildArtifact(filename) {\n\treturn BUILD_ARTIFACT_EXTENSIONS.some((ext) => filename.endsWith(ext));\n}\n/**\n* Build the set of exact binary filenames that compile would produce.\n*\n* Single-target builds produce `{name}`, multi-target builds produce\n* `{name}-{target}`. Windows targets append `.exe` to match the file bun\n* actually creates on disk.\n*\n* @private\n* @param name - The resolved binary base name.\n* @param targets - The resolved compile targets (may be empty → defaults used).\n* @returns A set of filenames to remove.\n*/\nfunction buildBinaryNames(name, targets) {\n\tconst resolvedTargets = match(targets).with([], () => compileTargets.filter((t) => t.default).map((t) => t.target)).otherwise(() => targets);\n\tconst names = resolvedTargets.map((target) => {\n\t\tconst base = match(resolvedTargets.length).with(1, () => name).otherwise(() => `${name}-${target}`);\n\t\tif (target.startsWith(\"windows-\")) return `${base}.exe`;\n\t\treturn base;\n\t});\n\treturn new Set(names);\n}\n//#endregion\n//#region src/utils/format-error.ts\n/**\n* Build a descriptive error message for a failed tsdown operation.\n*\n* When verbose is false only a short header is returned. When verbose is true\n* the underlying error message is appended so callers get actionable detail.\n*\n* @param params - The phase, error, and verbose flag.\n* @returns A formatted error message.\n*/\nfunction formatBuildError(params) {\n\tconst header = `tsdown ${params.phase} failed`;\n\tconst detail = toError(params.error).message.trim();\n\tif (params.verbose && detail.length > 0) return `${header}\\n${detail}`;\n\treturn header;\n}\n//#endregion\n//#region src/utils/resolve-build-entry.ts\n/**\n* Known entry file names produced by tsdown for ESM builds, in preference order.\n*/\nconst ENTRY_CANDIDATES = [\"index.mjs\", \"index.js\"];\n/**\n* Resolve the bundled entry file in a build output directory.\n*\n* tsdown may produce `index.mjs` or `index.js` depending on the project's\n* `package.json` `type` field and tsdown configuration. This function checks\n* for both candidates and returns the first one that exists on disk.\n*\n* @param outDir - Absolute path to the build output directory.\n* @returns The absolute path to the entry file, or `undefined` when none is found.\n*/\nasync function resolveBuildEntry(outDir) {\n\tconst candidates = ENTRY_CANDIDATES.map((name) => join(outDir, name));\n\treturn match((await Promise.all(candidates.map(async (path) => ({\n\t\tpath,\n\t\tfound: await fs.exists(path)\n\t})))).find((r) => r.found)).with(void 0, () => void 0).otherwise((entry) => entry.path);\n}\n//#endregion\n//#region src/build/build.ts\n/**\n* Run the tsdown build with a resolved config.\n*\n* Cleans artifacts when enabled, maps to a tsdown InlineConfig, and invokes\n* tsdown's build API.\n*\n* @param params - The resolved config and whether compile mode is active.\n* @returns A result tuple with build output on success or an Error on failure.\n*/\nasync function build$1(params) {\n\tif (params.resolved.build.clean) await clean({\n\t\tresolved: params.resolved,\n\t\tcompile: params.compile\n\t});\n\tconst inlineConfig = toTsdownBuildConfig({\n\t\tcompile: params.compile,\n\t\tconfig: params.resolved\n\t});\n\tconst [buildError] = await attemptAsync(() => build(inlineConfig));\n\tif (buildError) return err(new Error(formatBuildError({\n\t\tphase: \"build\",\n\t\terror: buildError,\n\t\tverbose: params.verbose ?? false\n\t}), { cause: buildError }));\n\tconst entryFile = await resolveBuildEntry(params.resolved.buildOutDir);\n\tif (!entryFile) return err(/* @__PURE__ */ new Error(`build produced no entry file in ${params.resolved.buildOutDir}`));\n\treturn ok({\n\t\tdefine: {\n\t\t\t...resolveBuildVars(),\n\t\t\t...params.resolved.build.define\n\t\t},\n\t\tentryFile,\n\t\toutDir: params.resolved.buildOutDir,\n\t\tversion: params.resolved.version\n\t});\n}\n//#endregion\n//#region src/build/watch.ts\n/**\n* Start a watch-mode build using tsdown.\n*\n* The returned promise resolves only when tsdown's watch terminates (typically on process exit).\n*\n* @param params - The resolved config, optional success callback, and verbose flag.\n* @returns A result tuple with void on success or an Error on failure.\n*/\nasync function watch(params) {\n\tconst watchConfig = toTsdownWatchConfig({\n\t\tconfig: params.resolved,\n\t\tonSuccess: params.onSuccess\n\t});\n\tconst [watchError] = await attemptAsync(() => build(watchConfig));\n\tif (watchError) return err(new Error(formatBuildError({\n\t\tphase: \"watch\",\n\t\terror: watchError,\n\t\tverbose: params.verbose ?? false\n\t}), { cause: watchError }));\n\treturn ok();\n}\n//#endregion\n//#region src/compile/compile.ts\n/**\n* Compile a maltty CLI tool into standalone binaries using `bun build --compile`.\n*\n* Expects the bundled entry to already exist in `outDir` (i.e., `build()` must\n* be run first). For each requested target (or defaults when none configured),\n* spawns `bun build --compile` to produce a self-contained binary.\n*\n* @param params - The resolved config, lifecycle hooks, and verbose flag.\n* @returns A result tuple with compile output on success or an Error on failure.\n*/\nasync function compile(params) {\n\tif (!await process$1.exists(\"bun\")) return err(/* @__PURE__ */ new Error(\"bun is not installed or not found in PATH. Install it from https://bun.sh to use compile.\"));\n\tconst bundledEntry = await resolveBuildEntry(params.resolved.buildOutDir);\n\tif (!bundledEntry) return err(/* @__PURE__ */ new Error(`bundled entry not found in ${params.resolved.buildOutDir} — run build() first`));\n\tconst targets = resolveTargets(params.resolved.compile.targets);\n\tconst isMultiTarget = targets.length > 1;\n\tconst results = await compileTargetsSequentially({\n\t\tautoloadDotenv: params.resolved.compile.autoloadDotenv,\n\t\tbundledEntry,\n\t\tcwd: params.resolved.cwd,\n\t\tisMultiTarget,\n\t\tlifecycle: params.lifecycle,\n\t\tname: params.resolved.compile.name,\n\t\toutDir: params.resolved.compileOutDir,\n\t\ttargets,\n\t\tverbose: params.verbose ?? false\n\t});\n\tawait cleanBunBuildArtifacts(params.resolved.cwd);\n\tconst failedResult = results.find((r) => r[0] !== null);\n\tif (failedResult) return err(failedResult[0]);\n\treturn ok({ binaries: results.filter((r) => r[1] !== null).map(([, binary]) => binary) });\n}\n/**\n* Look up the human-readable label for a compile target.\n*\n* @param target - The compile target identifier.\n* @returns A descriptive label (e.g., \"macOS Apple Silicon\").\n*/\nfunction resolveTargetLabel(target) {\n\tconst entry = compileTargets.find((t) => t.target === target);\n\tif (entry) return entry.label;\n\treturn target;\n}\n/**\n* Compile targets one at a time to avoid overwhelming bun with concurrent processes.\n*\n* @private\n* @param params - The targets and compilation parameters.\n* @returns The accumulated result tuples for each target.\n*/\nasync function compileTargetsSequentially(params) {\n\treturn params.targets.reduce(async (accPromise, target) => {\n\t\tconst acc = await accPromise;\n\t\tconst meta = {\n\t\t\ttarget,\n\t\t\tlabel: resolveTargetLabel(target)\n\t\t};\n\t\tif (params.lifecycle.onStepStart) await params.lifecycle.onStepStart({\n\t\t\tphase: \"compile\",\n\t\t\tstep: \"target\",\n\t\t\tmeta\n\t\t});\n\t\tconst result = await compileSingleTarget({\n\t\t\tautoloadDotenv: params.autoloadDotenv,\n\t\t\tbundledEntry: params.bundledEntry,\n\t\t\tcwd: params.cwd,\n\t\t\tisMultiTarget: params.isMultiTarget,\n\t\t\tname: params.name,\n\t\t\toutDir: params.outDir,\n\t\t\ttarget,\n\t\t\tverbose: params.verbose\n\t\t});\n\t\tif (params.lifecycle.onStepFinish) await params.lifecycle.onStepFinish({\n\t\t\tphase: \"compile\",\n\t\t\tstep: \"target\",\n\t\t\tmeta\n\t\t});\n\t\treturn [...acc, result];\n\t}, Promise.resolve([]));\n}\n/**\n* Compile a single target via `bun build --compile`.\n*\n* @private\n* @param params - Target compilation parameters.\n* @returns A result tuple with the compiled binary info or an error.\n*/\nasync function compileSingleTarget(params) {\n\tconst binaryName = resolveBinaryName$1(params.name, params.target, params.isMultiTarget);\n\tconst outfile = join(params.outDir, binaryName);\n\tconst [mapError, bunTarget] = mapCompileTarget(params.target);\n\tif (mapError) return err(mapError);\n\tconst args = [\n\t\t\"build\",\n\t\t\"--compile\",\n\t\t...resolveAutoloadFlags({ autoloadDotenv: params.autoloadDotenv }),\n\t\tparams.bundledEntry,\n\t\t\"--outfile\",\n\t\toutfile,\n\t\t\"--target\",\n\t\tbunTarget\n\t];\n\tconst [execError] = await process$1.exec({\n\t\tcmd: \"bun\",\n\t\targs,\n\t\tcwd: params.cwd\n\t});\n\tif (execError) return err(new Error(formatCompileError(params.target, execError, params.verbose), { cause: execError }));\n\treturn ok({\n\t\tlabel: resolveTargetLabel(params.target),\n\t\tpath: outfile,\n\t\ttarget: params.target\n\t});\n}\n/**\n* Resolve the list of compile targets, falling back to the default set.\n*\n* @private\n* @param explicit - User-specified targets (may be empty).\n* @returns The targets to compile for.\n*/\nfunction resolveTargets(explicit) {\n\tif (explicit.length > 0) return explicit;\n\treturn compileTargets.filter((t) => t.default).map((t) => t.target);\n}\n/**\n* Build the output binary name, appending the target suffix for multi-target\n* builds and the `.exe` extension for Windows targets.\n*\n* Windows targets must end with `.exe` because that is the file bun actually\n* produces (bun auto-appends `.exe` for any `bun-windows-*` target). Recording\n* the path without `.exe` would cause filesystem operations on the recorded\n* path to fail and would diverge from what is on disk.\n*\n* @private\n* @param name - Base binary name.\n* @param target - The compile target.\n* @param isMultiTarget - Whether multiple targets are being compiled.\n* @returns The resolved binary file name.\n*/\nfunction resolveBinaryName$1(name, target, isMultiTarget) {\n\treturn appendBinaryExtension(buildBaseBinaryName(name, target, isMultiTarget), target);\n}\n/**\n* Build the base name without the platform extension.\n*\n* @private\n* @param name - Base binary name.\n* @param target - The compile target.\n* @param isMultiTarget - Whether multiple targets are being compiled.\n* @returns The base binary name with optional target suffix.\n*/\nfunction buildBaseBinaryName(name, target, isMultiTarget) {\n\tif (isMultiTarget) return `${name}-${target}`;\n\treturn name;\n}\n/**\n* Append the `.exe` extension to Windows binary names.\n*\n* @private\n* @param base - The base binary name.\n* @param target - The compile target.\n* @returns The base name plus `.exe` for Windows targets, or the base unchanged.\n*/\nfunction appendBinaryExtension(base, target) {\n\tif (target.startsWith(\"windows-\")) return `${base}.exe`;\n\treturn base;\n}\n/**\n* Map a `CompileTarget` to Bun's `--target` string.\n*\n* Every supported maltty target must have an explicit mapping. An unrecognized\n* target is a fatal error — it means `compileTargets` was extended without\n* updating this function.\n*\n* @private\n* @param target - The maltty compile target.\n* @returns A result with the Bun target string, or an Error for unknown targets.\n*/\nfunction mapCompileTarget(target) {\n\treturn match(target).with(\"darwin-arm64\", () => ok(\"bun-darwin-arm64\")).with(\"darwin-x64\", () => ok(\"bun-darwin-x64\")).with(\"linux-arm64\", () => ok(\"bun-linux-arm64\")).with(\"linux-x64\", () => ok(\"bun-linux-x64\")).with(\"linux-x64-musl\", () => ok(\"bun-linux-x64-musl\")).with(\"windows-arm64\", () => ok(\"bun-windows-arm64\")).with(\"windows-x64\", () => ok(\"bun-windows-x64\")).otherwise(() => err(/* @__PURE__ */ new Error(`unknown compile target: ${target}`)));\n}\n/**\n* Build a descriptive error message for a failed compile target.\n*\n* @private\n* @param target - The compile target that failed.\n* @param execError - The error returned by execFile.\n* @param verbose - Whether to include stderr output in the message.\n* @returns A formatted error message.\n*/\nfunction formatCompileError(target, execError, verbose) {\n\tconst header = `bun build --compile failed for target ${target}`;\n\tif (!verbose) return header;\n\tconst { stderr } = execError;\n\tif (stderr && stderr.trim().length > 0) return `${header}\\n${stderr.trim()}`;\n\treturn header;\n}\n/**\n* Build the CLI flags that control Bun's compile-time config autoloading.\n*\n* `bunfig.toml` loading is always disabled — maltty CLIs should never load\n* Bun runtime config. `.env` loading is controlled by the `autoloadDotenv`\n* option (disabled by default).\n*\n* @private\n* @param params - The autoload settings.\n* @returns An array of CLI flag strings.\n*/\nfunction resolveAutoloadFlags(params) {\n\treturn [{\n\t\tenabled: false,\n\t\tflag: \"--no-compile-autoload-bunfig\"\n\t}, {\n\t\tenabled: params.autoloadDotenv,\n\t\tflag: \"--no-compile-autoload-dotenv\"\n\t}].filter((c) => !c.enabled).map((c) => c.flag);\n}\n/**\n* Remove temporary `.bun-build` files that `bun build --compile` leaves behind.\n*\n* @private\n* @param cwd - The working directory to clean.\n*/\nasync function cleanBunBuildArtifacts(cwd) {\n\tconst [listError, entries] = await fs.list(cwd);\n\tif (listError) return;\n\tconst artifacts = entries.filter((name) => name.endsWith(\".bun-build\")).map((name) => join(cwd, name));\n\tawait Promise.allSettled(artifacts.map(fs.remove));\n}\n//#endregion\n//#region src/utils/resolve-config.ts\n/**\n* Normalize the `compile` config field from `boolean | CompileOptions | undefined` to `CompileOptions`.\n*\n* - `true` → `{}` (compile with defaults)\n* - `false` / `undefined` → `{}` (no explicit options, caller decides whether to compile)\n* - object → pass through\n*\n* @param value - The raw compile config value.\n* @returns A normalized CompileOptions object.\n*/\nfunction normalizeCompileOptions(value) {\n\tif (typeof value === \"object\") return value;\n\treturn {};\n}\n/**\n* Fill defaults and resolve relative paths against `cwd`.\n*\n* This is a pure function — the incoming config is already validated by `@maltty/config`.\n* It only fills missing optional fields with defaults and resolves paths to absolute.\n*\n* @param params - The raw config and working directory.\n* @returns A fully resolved bundler configuration.\n*/\nfunction resolveConfig(params) {\n\tconst { config, cwd } = params;\n\tconst entry = resolve(cwd, config.entry ?? \"./src/index.ts\");\n\tconst commands = resolve(cwd, config.commands ?? \"./commands\");\n\tconst buildOpts = config.build ?? {};\n\tconst compileOpts = normalizeCompileOptions(config.compile);\n\tconst buildOutDir = resolve(cwd, buildOpts.out ?? \"./dist\");\n\tconst compileOutDir = resolve(cwd, compileOpts.out ?? \"./dist\");\n\treturn {\n\t\tbuild: {\n\t\t\tclean: buildOpts.clean ?? true,\n\t\t\tdefine: buildOpts.define ?? {},\n\t\t\texternal: buildOpts.external ?? [],\n\t\t\tminify: buildOpts.minify ?? true,\n\t\t\tsourcemap: buildOpts.sourcemap ?? true,\n\t\t\ttarget: buildOpts.target ?? \"node18\"\n\t\t},\n\t\tbuildOutDir,\n\t\tcommands,\n\t\tcompile: {\n\t\t\tautoloadDotenv: compileOpts.autoloadDotenv ?? false,\n\t\t\tname: compileOpts.name ?? params.binaryName,\n\t\t\ttargets: compileOpts.targets ?? []\n\t\t},\n\t\tcompileOutDir,\n\t\tcwd,\n\t\tentry,\n\t\tinclude: config.include ?? [],\n\t\tversion: params.version\n\t};\n}\n//#endregion\n//#region src/bundler.ts\n/**\n* Create a bundler instance for a maltty CLI project.\n*\n* Reads the project manifest once, resolves config, and returns methods\n* that share the resolved state. Lifecycle hooks fire at phase boundaries.\n* Per-call overrides replace base hooks for that invocation.\n*\n* @param params - The config, working directory, and optional lifecycle hooks.\n* @returns A bundler with build, watch, and compile methods.\n*/\nasync function createBundler(params) {\n\tconst [, manifest] = await readManifest(params.cwd);\n\tconst { version, name: packageName } = manifest ?? {};\n\tconst binaryName = match(params.config.compile).with({ name: P.string }, (c) => c.name).otherwise(() => resolveBinaryName(packageName));\n\tconst resolved = resolveConfig({\n\t\tconfig: params.config,\n\t\tcwd: params.cwd,\n\t\tversion,\n\t\tbinaryName\n\t});\n\tconst hasCompile = !isNil(params.config.compile);\n\tconst baseLifecycle = {\n\t\tonFinish: params.onFinish,\n\t\tonStart: params.onStart,\n\t\tonStepFinish: params.onStepFinish,\n\t\tonStepStart: params.onStepStart\n\t};\n\treturn {\n\t\tbuild: async (overrides = {}) => {\n\t\t\tconst lifecycle = resolveLifecycle(baseLifecycle, overrides);\n\t\t\tawait lifecycle.onStart({ phase: \"build\" });\n\t\t\tconst result = await build$1({\n\t\t\t\tcompile: hasCompile,\n\t\t\t\tresolved,\n\t\t\t\tverbose: overrides.verbose\n\t\t\t});\n\t\t\tawait lifecycle.onFinish({ phase: \"build\" });\n\t\t\treturn result;\n\t\t},\n\t\twatch: async (overrides = {}) => {\n\t\t\tconst lifecycle = resolveLifecycle(baseLifecycle, overrides);\n\t\t\tawait lifecycle.onStart({ phase: \"watch\" });\n\t\t\tconst result = await watch({\n\t\t\t\tonSuccess: overrides.onSuccess,\n\t\t\t\tresolved,\n\t\t\t\tverbose: overrides.verbose\n\t\t\t});\n\t\t\tawait lifecycle.onFinish({ phase: \"watch\" });\n\t\t\treturn result;\n\t\t},\n\t\tcompile: async (overrides = {}) => {\n\t\t\tconst lifecycle = resolveLifecycle(baseLifecycle, overrides);\n\t\t\tawait lifecycle.onStart({ phase: \"compile\" });\n\t\t\tconst result = await compile({\n\t\t\t\tlifecycle,\n\t\t\t\tresolved,\n\t\t\t\tverbose: overrides.verbose\n\t\t\t});\n\t\t\tawait lifecycle.onFinish({ phase: \"compile\" });\n\t\t\treturn result;\n\t\t}\n\t};\n}\n/**\n* Derive the binary name from the package.json name, stripping scope.\n*\n* @private\n* @param packageName - The package name from manifest, or undefined.\n* @returns The binary name.\n*/\nfunction resolveBinaryName(packageName) {\n\tif (!packageName) return \"cli\";\n\treturn stripScope(packageName);\n}\n/**\n* Strip the npm scope prefix from a package name.\n*\n* @private\n* @param name - The package name (e.g. `@scope/my-cli`).\n* @returns The unscoped name (e.g. `my-cli`).\n*/\nfunction stripScope(name) {\n\tconst slashIndex = name.indexOf(\"/\");\n\tif (name.startsWith(\"@\") && slashIndex > 0) return name.slice(slashIndex + 1);\n\treturn name;\n}\n/**\n* Merge base lifecycle hooks with per-call overrides.\n*\n* Per-call hooks replace base hooks (no chaining). Missing hooks\n* are filled with no-ops so callers don't need null checks.\n*\n* @private\n* @param base - The base lifecycle hooks from the factory.\n* @param overrides - Per-call hook overrides.\n* @returns A lifecycle with all hooks guaranteed to be defined.\n*/\nfunction resolveLifecycle(base, overrides = {}) {\n\treturn {\n\t\tonFinish: overrides.onFinish ?? base.onFinish ?? noop,\n\t\tonStart: overrides.onStart ?? base.onStart ?? noop,\n\t\tonStepFinish: overrides.onStepFinish ?? base.onStepFinish ?? noop,\n\t\tonStepStart: overrides.onStepStart ?? base.onStepStart ?? noop\n\t};\n}\n//#endregion\nexport { DEFAULT_COMMANDS, DEFAULT_ENTRY, createBundler, normalizeCompileOptions };\n\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;AAAA,SAAS,OAAO;;;ACAhB,SAAS,MAAM,GAAG;AACd,QAAO,KAAK;;;;;;;;;;;;;;;ACqBhB,SAAS,yBAAyB,QAAQ;CACzC,MAAM,cAAc,sBAAsB,eAAe,OAAO,KAAK,EAAE,OAAO,cAAc;CAC5F,MAAM,iBAAiB,oBAAoB,OAAO,KAAK;AAC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