@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.cjs
CHANGED
|
@@ -1541,8 +1541,9 @@ async function handleRunCommand(cwd, baseOpts) {
|
|
|
1541
1541
|
const logger6 = createCliLogger(baseOpts);
|
|
1542
1542
|
const configPath = baseOpts.config ? path2__default.default.resolve(cwd, baseOpts.config) : void 0;
|
|
1543
1543
|
const scaffoldDir = baseOpts.dir ? path2__default.default.resolve(cwd, baseOpts.dir) : void 0;
|
|
1544
|
+
const resolvedScaffoldDir = scaffoldDir ?? path2__default.default.resolve(cwd, SCAFFOLD_ROOT_DIR);
|
|
1544
1545
|
logger6.debug(
|
|
1545
|
-
`Starting scaffold (cwd=${cwd}, config=${configPath ?? "auto"}, dir=${
|
|
1546
|
+
`Starting scaffold (cwd=${cwd}, config=${configPath ?? "auto"}, dir=${resolvedScaffoldDir}, watch=${baseOpts.watch ? "yes" : "no"})`
|
|
1546
1547
|
);
|
|
1547
1548
|
const runnerOptions = {
|
|
1548
1549
|
configPath,
|
|
@@ -1574,7 +1575,9 @@ async function handleScanCommand(cwd, scanOpts, baseOpts) {
|
|
|
1574
1575
|
logger6.info("Scanning project using scaffold config/groups...");
|
|
1575
1576
|
await writeScannedStructuresFromConfig(cwd, {
|
|
1576
1577
|
ignore: scanOpts.ignore,
|
|
1577
|
-
groups: scanOpts.groups
|
|
1578
|
+
groups: scanOpts.groups,
|
|
1579
|
+
scaffoldDir: baseOpts.dir,
|
|
1580
|
+
maxDepth: scanOpts.maxDepth
|
|
1578
1581
|
});
|
|
1579
1582
|
return;
|
|
1580
1583
|
}
|
|
@@ -1624,19 +1627,16 @@ async function handleStructuresCommand(cwd, baseOpts) {
|
|
|
1624
1627
|
async function main() {
|
|
1625
1628
|
const cwd = process.cwd();
|
|
1626
1629
|
const program = new commander.Command();
|
|
1627
|
-
program.name("scaffold").description("@timeax/scaffold \u2013 structure-based project scaffolding").option("-c, --config <path>", "Path to scaffold config file").option(
|
|
1630
|
+
program.name("scaffold").description("@timeax/scaffold \u2013 structure-based project scaffolding").option("-c, --config <path>", "Path to scaffold config file").option(
|
|
1631
|
+
"-d, --dir <path>",
|
|
1632
|
+
`Path to scaffold directory (default: ./${SCAFFOLD_ROOT_DIR})`
|
|
1633
|
+
).option("-w, --watch", "Watch scaffold directory for changes").option("--quiet", "Silence logs").option("--debug", "Enable debug logging");
|
|
1628
1634
|
program.command("scan").description(
|
|
1629
1635
|
"Generate structure.txt-style output (config-aware by default, or manual root/out)"
|
|
1630
1636
|
).option(
|
|
1631
1637
|
"--from-config",
|
|
1632
|
-
|
|
1633
|
-
).option(
|
|
1634
|
-
"-r, --root <path>",
|
|
1635
|
-
"Root directory to scan (manual mode)"
|
|
1636
|
-
).option(
|
|
1637
|
-
"-o, --out <path>",
|
|
1638
|
-
"Output file path (manual mode)"
|
|
1639
|
-
).option(
|
|
1638
|
+
`Scan based on scaffold config/groups and write structure files into ${SCAFFOLD_ROOT_DIR}/ (default if no root/out specified)`
|
|
1639
|
+
).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(
|
|
1640
1640
|
"--ignore <patterns...>",
|
|
1641
1641
|
"Additional glob patterns to ignore (relative to root)"
|
|
1642
1642
|
).option(
|
|
@@ -1646,22 +1646,24 @@ async function main() {
|
|
|
1646
1646
|
const baseOpts = cmd.parent?.opts() ?? {};
|
|
1647
1647
|
await handleScanCommand(cwd, scanOpts, baseOpts);
|
|
1648
1648
|
});
|
|
1649
|
-
program.command("init").description(
|
|
1649
|
+
program.command("init").description(
|
|
1650
|
+
`Initialize ${SCAFFOLD_ROOT_DIR} folder and config/structure files`
|
|
1651
|
+
).option(
|
|
1650
1652
|
"--force",
|
|
1651
1653
|
"Overwrite existing config/structure files if they already exist"
|
|
1652
1654
|
).action(async (initOpts, cmd) => {
|
|
1653
1655
|
const baseOpts = cmd.parent?.opts() ?? {};
|
|
1654
1656
|
await handleInitCommand(cwd, initOpts, baseOpts);
|
|
1655
1657
|
});
|
|
1656
|
-
program.action(async (opts) => {
|
|
1657
|
-
await handleRunCommand(cwd, opts);
|
|
1658
|
-
});
|
|
1659
1658
|
program.command("structures").description(
|
|
1660
1659
|
"Create missing structure files specified in the config (does not overwrite existing files)"
|
|
1661
1660
|
).action(async (_opts, cmd) => {
|
|
1662
1661
|
const baseOpts = cmd.parent?.opts() ?? {};
|
|
1663
1662
|
await handleStructuresCommand(cwd, baseOpts);
|
|
1664
1663
|
});
|
|
1664
|
+
program.action(async (opts) => {
|
|
1665
|
+
await handleRunCommand(cwd, opts);
|
|
1666
|
+
});
|
|
1665
1667
|
await program.parseAsync(process.argv);
|
|
1666
1668
|
}
|
|
1667
1669
|
main().catch((err) => {
|