Skip to content

fix(cli): keep user's name form in scaffold READMEs (#139) - #143

Merged
antosubash merged 1 commit into
mainfrom
feature/feat-scaffold-mixes-simple-module-chat-underscores-simple-23d40
May 13, 2026
Merged

fix(cli): keep user's name form in scaffold READMEs (#139)#143
antosubash merged 1 commit into
mainfrom
feature/feat-scaffold-mixes-simple-module-chat-underscores-simple-23d40

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • smpy new simple_module_chat was creating the directory with underscores but emitting # simple-module-chat in the README heading + tree diagram, because create_workspace substituted {{HOST_NAME}} with the PyPI-normalized form everywhere.
  • Split the template placeholder: {{HOST_NAME}} is now the user-typed display form (used in README heading + tree); {{HOST_PYPI_NAME}} is the kebab-case PEP 503 form (used in pyproject.toml and package.json name fields).
  • smpy new validates the input up front — rejecting mixed case (MyApp), leading digits (1chat), and mixed _/- separators (foo_bar-baz) that have no canonical display form — and prints a one-line Normalizing PyPI name to '...'. notice when the two forms diverge.

Fixes #139.

Test plan

  • uv run pytest framework/cli/tests/ — 112 passed (7 new regression tests in test_cli_new_regressions.py)
  • uv run ruff check + uv run ty check on the changed files — clean
  • Smoke test smpy new simple_module_chat --yes --no-install: directory simple_module_chat/, README heading # simple_module_chat, tree simple_module_chat/, workspace pyproject name = "simple-module-chat", host pyproject name = "simple-module-chat-host", CLI prints the normalization notice
  • Smoke test smpy new simple-module-chat --yes --no-install: everything uses simple-module-chat, no normalization notice
  • Smoke test smpy new simple_module_chat --flat --yes --no-install: flat layout consistent (README + directory both underscored, pyproject normalized)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 12, 2026

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8aed074
Status:⚡️  Build in progress...

View logs

Copy link
Copy Markdown
Owner Author

Not auto-merged in this batch — this PR is in a dirty mergeable state (conflicts against main), and it touches the same scaffold files (framework/cli/simple_module_cli/app_project.py / template tree) that were just modified by #142, #144, and #147.

CI on the head commit is green (12/12), so once rebased onto current main and the conflicts resolved, this should be ready to merge. Please rebase and re-run CI.


Generated by Claude Code

`smpy new simple_module_chat` created the directory with underscores
but produced a README header and tree diagram using `simple-module-chat`
(hyphens), because `create_workspace` substituted `{{HOST_NAME}}` with
the PyPI-normalized form everywhere.

Split the template placeholder: `{{HOST_NAME}}` is now the user-typed
display form (used in README heading + tree); `{{HOST_PYPI_NAME}}` is
the kebab-case PEP 503 form (used in `pyproject.toml` and `package.json`
`name` fields). `smpy new` validates the input up front — rejecting
mixed case, leading digits, and mixed `_`/`-` separators that have no
canonical display form — and prints a one-line "Normalizing PyPI name
to ..." notice when the two forms diverge.
@antosubash
antosubash force-pushed the feature/feat-scaffold-mixes-simple-module-chat-underscores-simple-23d40 branch from 38e70f5 to 8aed074 Compare May 13, 2026 16:13
@antosubash
antosubash merged commit 22ab7a3 into main May 13, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scaffold mixes simple_module_chat (underscores) and simple-module-chat (hyphens) inconsistently

1 participant