fix(cli,build): init . sanitization + render-worker rebuild trigger#32
Merged
Merged
Conversation
Closes spike-1 issues #4 and #5. #4 — `akua init .` no longer writes `name = "."` to akua.toml. The CLI dispatcher now routes `.` / `./` / path-like / non-identifier args through a sanitizer that derives a valid package name from the canonicalized basename (lowercase, non-`[a-z0-9_-]` → `_`, strip leading hyphens). Bare-identifier args keep the original behavior. Path-like args get path target + sanitized basename name. #5 — touching files under `crates/akua-render-worker/src` or `crates/akua-core/src` now re-runs `crates/akua-cli/build.rs` (via additional `cargo:rerun-if-changed=` directives). The script also walks both trees for `.rs` files newer than the staged worker `.wasm` and emits a `cargo:warning=` naming the offender, so contributors see a clear "run task build:render-worker first" without having to remember the gotcha. Tests: - 5 unit tests in main.rs covering sanitize_package_name + derive_init_target_and_name across the 4 input shapes. - 2 integration tests in cli_integration.rs covering `init .` end-to-end (record correct name, sanitize Capitals.With.Dots). - All 22 prior cli_integration tests still green. CLAUDE.md gotcha note replaced with the new behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes spike-1 #4 + #5.
akua init .now derives the package name from the canonicalized CWD basename and sanitizes (lowercase, non-[a-z0-9_-]→_, strip leading-). Pre-fix it wrotename = "."and the next render failed withE_MANIFEST_PARSE.crates/akua-cli/build.rswatchesakua-render-worker/srcandakua-core/srcand warns when sources are newer than the staged worker.wasm— the long-standing CLAUDE.md gotcha.Test plan
main.rs(sanitize variants + derive matrix)cli_integration.rs(init .end-to-end)