@timeax/scaffold 0.0.9 → 0.0.10
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/cli.cjs +17 -15
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +17 -15
- package/dist/cli.mjs.map +1 -1
- package/package.json +2 -1
- package/src/cli/main.ts +285 -286
package/dist/cli.mjs
CHANGED
|
@@ -1530,8 +1530,9 @@ async function handleRunCommand(cwd, baseOpts) {
|
|
|
1530
1530
|
const logger6 = createCliLogger(baseOpts);
|
|
1531
1531
|
const configPath = baseOpts.config ? path2.resolve(cwd, baseOpts.config) : void 0;
|
|
1532
1532
|
const scaffoldDir = baseOpts.dir ? path2.resolve(cwd, baseOpts.dir) : void 0;
|
|
1533
|
+
const resolvedScaffoldDir = scaffoldDir ?? path2.resolve(cwd, SCAFFOLD_ROOT_DIR);
|
|
1533
1534
|
logger6.debug(
|
|
1534
|
-
`Starting scaffold (cwd=${cwd}, config=${configPath ?? "auto"}, dir=${
|
|
1535
|
+
`Starting scaffold (cwd=${cwd}, config=${configPath ?? "auto"}, dir=${resolvedScaffoldDir}, watch=${baseOpts.watch ? "yes" : "no"})`
|
|
1535
1536
|
);
|
|
1536
1537
|
const runnerOptions = {
|
|
1537
1538
|
configPath,
|
|
@@ -1563,7 +1564,9 @@ async function handleScanCommand(cwd, scanOpts, baseOpts) {
|
|
|
1563
1564
|
logger6.info("Scanning project using scaffold config/groups...");
|
|
1564
1565
|
await writeScannedStructuresFromConfig(cwd, {
|
|
1565
1566
|
ignore: scanOpts.ignore,
|
|
1566
|
-
groups: scanOpts.groups
|
|
1567
|
+
groups: scanOpts.groups,
|
|
1568
|
+
scaffoldDir: baseOpts.dir,
|
|
1569
|
+
maxDepth: scanOpts.maxDepth
|
|
1567
1570
|
});
|
|
1568
1571
|
return;
|
|
1569
1572
|
}
|
|
@@ -1613,19 +1616,16 @@ async function handleStructuresCommand(cwd, baseOpts) {
|
|
|
1613
1616
|
async function main() {
|
|
1614
1617
|
const cwd = process.cwd();
|
|
1615
1618
|
const program = new Command();
|
|
1616
|
-
program.name("scaffold").description("@timeax/scaffold \u2013 structure-based project scaffolding").option("-c, --config <path>", "Path to scaffold config file").option(
|
|
1619
|
+
program.name("scaffold").description("@timeax/scaffold \u2013 structure-based project scaffolding").option("-c, --config <path>", "Path to scaffold config file").option(
|
|
1620
|
+
"-d, --dir <path>",
|
|
1621
|
+
`Path to scaffold directory (default: ./${SCAFFOLD_ROOT_DIR})`
|
|
1622
|
+
).option("-w, --watch", "Watch scaffold directory for changes").option("--quiet", "Silence logs").option("--debug", "Enable debug logging");
|
|
1617
1623
|
program.command("scan").description(
|
|
1618
1624
|
"Generate structure.txt-style output (config-aware by default, or manual root/out)"
|
|
1619
1625
|
).option(
|
|
1620
1626
|
"--from-config",
|
|
1621
|
-
|
|
1622
|
-
).option(
|
|
1623
|
-
"-r, --root <path>",
|
|
1624
|
-
"Root directory to scan (manual mode)"
|
|
1625
|
-
).option(
|
|
1626
|
-
"-o, --out <path>",
|
|
1627
|
-
"Output file path (manual mode)"
|
|
1628
|
-
).option(
|
|
1627
|
+
`Scan based on scaffold config/groups and write structure files into ${SCAFFOLD_ROOT_DIR}/ (default if no root/out specified)`
|
|
1628
|
+
).option("-r, --root <path>", "Root directory to scan (manual mode)").option("-o, --out <path>", "Output file path (manual mode)").option("-d, --depth <number>", "Max directory depth to scan (default: infinity, 0 = only scan root dir").option(
|
|
1629
1629
|
"--ignore <patterns...>",
|
|
1630
1630
|
"Additional glob patterns to ignore (relative to root)"
|
|
1631
1631
|
).option(
|
|
@@ -1635,22 +1635,24 @@ async function main() {
|
|
|
1635
1635
|
const baseOpts = cmd.parent?.opts() ?? {};
|
|
1636
1636
|
await handleScanCommand(cwd, scanOpts, baseOpts);
|
|
1637
1637
|
});
|
|
1638
|
-
program.command("init").description(
|
|
1638
|
+
program.command("init").description(
|
|
1639
|
+
`Initialize ${SCAFFOLD_ROOT_DIR} folder and config/structure files`
|
|
1640
|
+
).option(
|
|
1639
1641
|
"--force",
|
|
1640
1642
|
"Overwrite existing config/structure files if they already exist"
|
|
1641
1643
|
).action(async (initOpts, cmd) => {
|
|
1642
1644
|
const baseOpts = cmd.parent?.opts() ?? {};
|
|
1643
1645
|
await handleInitCommand(cwd, initOpts, baseOpts);
|
|
1644
1646
|
});
|
|
1645
|
-
program.action(async (opts) => {
|
|
1646
|
-
await handleRunCommand(cwd, opts);
|
|
1647
|
-
});
|
|
1648
1647
|
program.command("structures").description(
|
|
1649
1648
|
"Create missing structure files specified in the config (does not overwrite existing files)"
|
|
1650
1649
|
).action(async (_opts, cmd) => {
|
|
1651
1650
|
const baseOpts = cmd.parent?.opts() ?? {};
|
|
1652
1651
|
await handleStructuresCommand(cwd, baseOpts);
|
|
1653
1652
|
});
|
|
1653
|
+
program.action(async (opts) => {
|
|
1654
|
+
await handleRunCommand(cwd, opts);
|
|
1655
|
+
});
|
|
1654
1656
|
await program.parseAsync(process.argv);
|
|
1655
1657
|
}
|
|
1656
1658
|
main().catch((err) => {
|