{"type":"data","nodes":[null,null,{"type":"data","data":[{"version":1,"cli":2},"0.1.77",{"name":3,"version":4,"title":5,"description":6,"commands":7,"outputFileNaming":10,"exitCodes":11,"nodeIntegration":12,"functions":13,"raw":14},"CLI","0.1.42","Macroforge CLI Binary","This binary provides command-line utilities for working with Macroforge TypeScript macros.\nIt is designed for development workflows, enabling macro expansion and type checking\nwithout requiring Node.js integration.",{"expand":8,"tsc":9},"Expands macros in TypeScript/TSX files:\n\n```bash\n# Expand a single file\nmacroforge expand src/User.ts\n\n# Expand to specific output file\nmacroforge expand src/User.ts --out dist/User.js\n\n# Scan and expand all files in a directory\nmacroforge expand --scan src/\n\n# Use only built-in Rust macros (faster, no external dependencies)\nmacroforge expand src/User.ts --builtin-only\n\n# Print expanded output to stdout\nmacroforge expand src/User.ts --print\n```","Run TypeScript type checking with macro expansion baked in:\n\n```bash\n# Type check with default tsconfig.json\nmacroforge tsc\n\n# Type check with custom tsconfig\nmacroforge tsc -p tsconfig.build.json\n```","By default, expanded files are written with `.expanded` inserted before the extension:\n\n- `foo.ts` → `foo.expanded.ts`\n- `foo.svelte.ts` → `foo.expanded.svelte.ts`","- `0` - Success\n- `1` - Error during expansion\n- `2` - No macros found in the input file (with `--quiet` suppresses output)","By default, the CLI uses Node.js to support external/custom macros from npm packages.\nUse `--builtin-only` for fast expansion with only the built-in Rust macros (Debug, Clone,\nPartialEq, Hash, Ord, PartialOrd, Default, Serialize, Deserialize).\n\nBoth modes load and respect `macroforge.config.ts/js` for foreign type configuration.\nThe config is parsed natively using SWC, so foreign types work without Node.js.",[],"# Macroforge CLI Binary\n\nThis binary provides command-line utilities for working with Macroforge TypeScript macros.\nIt is designed for development workflows, enabling macro expansion and type checking\nwithout requiring Node.js integration.\n\n## Commands\n\n### `macroforge expand`\n\nExpands macros in TypeScript/TSX files:\n\n```bash\n# Expand a single file\nmacroforge expand src/User.ts\n\n# Expand to specific output file\nmacroforge expand src/User.ts --out dist/User.js\n\n# Scan and expand all files in a directory\nmacroforge expand --scan src/\n\n# Use only built-in Rust macros (faster, no external dependencies)\nmacroforge expand src/User.ts --builtin-only\n\n# Print expanded output to stdout\nmacroforge expand src/User.ts --print\n```\n\n### `macroforge tsc`\n\nRun TypeScript type checking with macro expansion baked in:\n\n```bash\n# Type check with default tsconfig.json\nmacroforge tsc\n\n# Type check with custom tsconfig\nmacroforge tsc -p tsconfig.build.json\n```\n\n## Configuration\n\nThe CLI automatically searches for a configuration file starting from the input file's\ndirectory, walking up to the nearest `package.json` (project root). Configuration files\nare searched in this order:\n\n1. `macroforge.config.ts`\n2. `macroforge.config.mts`\n3. `macroforge.config.js`\n4. `macroforge.config.mjs`\n5. `macroforge.config.cjs`\n\n### Foreign Types\n\nConfiguration files can define foreign type handlers for external types like Effect's\n`DateTime`. When a matching type is found during expansion, the configured handlers\nare used automatically:\n\n```javascript\n// macroforge.config.ts\nimport { DateTime } from \"effect\";\n\nexport default {\n  foreignTypes: {\n    \"DateTime.DateTime\": {\n      from: [\"effect\"],\n      serialize: (v) => DateTime.formatIso(v),\n      deserialize: (raw) => DateTime.unsafeFromDate(new Date(raw)),\n      default: () => DateTime.unsafeNow()\n    }\n  }\n}\n```\n\nSee the [Configuration](crate::host::config) module for full documentation.\n\n## Output File Naming\n\nBy default, expanded files are written with `.expanded` inserted before the extension:\n\n- `foo.ts` → `foo.expanded.ts`\n- `foo.svelte.ts` → `foo.expanded.svelte.ts`\n\n## Exit Codes\n\n- `0` - Success\n- `1` - Error during expansion\n- `2` - No macros found in the input file (with `--quiet` suppresses output)\n\n## Node.js Integration\n\nBy default, the CLI uses Node.js to support external/custom macros from npm packages.\nUse `--builtin-only` for fast expansion with only the built-in Rust macros (Debug, Clone,\nPartialEq, Hash, Ord, PartialOrd, Default, Serialize, Deserialize).\n\nBoth modes load and respect `macroforge.config.ts/js` for foreign type configuration.\nThe config is parsed natively using SWC, so foreign types work without Node.js."],"uses":{}}]}
