Skip to content

fix(cli): drop view_prefix from sample module template - #142

Merged
antosubash merged 2 commits into
mainfrom
feature/chore-sample-module-emits-sm019-boot-6pm8v
May 13, 2026
Merged

fix(cli): drop view_prefix from sample module template#142
antosubash merged 2 commits into
mainfrom
feature/chore-sample-module-emits-sm019-boot-6pm8v

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • Fixes Scaffolded sample hello module emits SM019 warning on every boot #138 — fresh smpy new myapp --yes was emitting an SM019 warning on every boot because the scaffolded hello module declared view_prefix="/hello" and overrode register_routes but shipped no views, menu items, or permissions.
  • Drops view_prefix from the module template so the sample is API-only by default; authors who want a sidebar entry add view_prefix + register_menu_items together (the combination SM019 is designed to enforce).
  • Adds test_sm_new_sample_module_does_not_declare_view_prefix to test_cli_new_regressions.py pinning the fix.

Test plan

  • uv run pytest framework/cli/tests/test_cli_new_regressions.py — 4 passed
  • uv run pytest framework/cli/tests/test_cli_new.py framework/core/tests/test_module_diagnostics.py — 35 passed
  • Manually verify a fresh smpy new demo --yes boots without SM019 in the doctor output

The scaffolded `hello` module declared `view_prefix="/hello"` and
overrode `register_routes` but shipped no views, menu items, or
permissions, tripping the SM019 boot warning on every fresh
`smpy new`. Drop `view_prefix` so the sample is API-only; authors
who want a sidebar entry add `view_prefix` + `register_menu_items`
together.
@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: 0b2cfb7
Status:⚡️  Build in progress...

View logs

…module-emits-sm019-boot-6pm8v

# Conflicts:
#	framework/cli/tests/test_cli_new_regressions.py
@antosubash
antosubash merged commit bc73b0b into main May 13, 2026
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.

Scaffolded sample hello module emits SM019 warning on every boot

1 participant