Skip to content

Scaffolded sample hello module emits SM019 warning on every boot #138

Description

@antosubash

Summary

A fresh smpy new myapp --yes includes a sample hello module under modules/hello/. Every boot logs:

⚠ SM019 [WARNING] Hello: Module 'Hello' registers view routes (view_prefix='/hello') but no menu items or permissions
  ↳ Suggestion: Override register_menu_items() to surface this module in the sidebar, register_permissions() to surface it in the role editor, or clear view_prefix if it's API-only

Results: 0 error(s), 1 warning(s), 0 info

…and confirming this, GET /hello returns 404 because no view is wired up — only /api/hello/ works.

A user's first boot of their scaffold shouldn't produce diagnostic warnings. It teaches the wrong lesson: "warnings are normal noise, ignore them."

Suggested fix (pick one)

  1. Sample module should be self-consistent. Either drop view_prefix='/hello' from the template (it becomes an API-only sample), or add a minimal register_menu_items + a stub pages/Browse.tsx so /hello actually renders.
  2. Tighten the template's defaults. hello/module.py should ship without view_prefix and let smpy create-module add it when the user opts in.

(1.a) — drop view_prefix — is the smallest change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions