fix(scaffold): treat --path as project root, not parent directory #95
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_books!95
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_fix_hero_docs_new_path_nesting"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
hero_docs new --name N --path Pnow scaffolds directly intoP; previously it would create a redundantP/N/nesting. When--pathis omitted, files are written into the current directory (same no-nesting rule). The RPC methoddocs.newpicks up the fix automatically.Related Issue
Closes #91
Changes
crates/hero_books_docusaurus/src/scaffold.rs— parameter renamedbase_path→project_root; path used as root directly; non-empty-target check with--force to overwriteguard; 5 tests updated, 1 new regression test (test_scaffold_uses_path_as_root).src/bin/hero_docs.rs—--pathhelp text changed to "Project directory to create (defaults to current directory)"; the "Project created at" log line now printsproject_root.display()instead ofbase_path.join(&args.name).display().crates/hero_books_server/src/web/rpc.rs—handle_docs_newdefaultspathto<docusaurus_cache>/<input_hash>/when the caller omits it, preventing concurrent anonymous jobs from colliding at the shared cache root.handle_docs_generateandhandle_docs_job_statusuntouched.crates/hero_books_docusaurus/README.md— added### Subcommand: newand### Subcommand: generatesections; updated Usage and Examples to show the subcommand structure; added a "Behavior change" note for--path.Test Results
cargo build -p hero_books_docusaurus -p hero_books_server— ok.hero_books_docusaurusscaffold tests: 6/6 passed (including the new regression test).hero_books_serverlibrary tests: 16/16 passed.cargo fmt --check— clean after fmt was applied to the two modified crates.Notes
output_pathreturned bydocs.jobStatusis still<cache>/<hash>/buildand is unaffected by this change.scaffold()keeps the same arity and types; only the semantics of the path argument changed, and the argument was renamed toproject_rootfor clarity.