simple-module-cli 0.0.43__tar.gz → 0.0.45__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/PKG-INFO +2 -2
  2. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/README.md +1 -1
  3. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/pyproject.toml +1 -1
  4. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/_app_project_manifests.py +7 -1
  5. simple_module_cli-0.0.45/simple_module_cli/_lint_tooling.py +37 -0
  6. simple_module_cli-0.0.45/simple_module_cli/_version_check.py +53 -0
  7. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/app_project.py +10 -7
  8. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/framework_repo.py +1 -0
  9. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/new.py +3 -0
  10. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/pins.py +4 -1
  11. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/pypi.py +2 -2
  12. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/scaffolding.py +12 -0
  13. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/README.md +1 -0
  14. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-cli/SKILL.md +1 -1
  15. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-conventions/SKILL.md +9 -2
  16. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-creating/SKILL.md +26 -21
  17. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-doctor/SKILL.md +3 -3
  18. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-inertia-pages/SKILL.md +4 -1
  19. simple_module_cli-0.0.45/simple_module_cli/skills/simple-module-page-perf/SKILL.md +157 -0
  20. simple_module_cli-0.0.45/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/__main__.py +245 -0
  21. simple_module_cli-0.0.45/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_browser.py +208 -0
  22. simple_module_cli-0.0.45/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_crawl.py +79 -0
  23. simple_module_cli-0.0.45/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_report.py +171 -0
  24. simple_module_cli-0.0.45/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_server.py +175 -0
  25. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-registries/SKILL.md +1 -1
  26. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-testing/SKILL.md +9 -5
  27. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/dockerignore +1 -1
  28. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/_optional/background_tasks/run_worker.py +3 -3
  29. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/alembic.ini +15 -0
  30. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/app.tsx +10 -26
  31. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/module-assets.ts +6 -4
  32. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/pages/Landing.tsx +17 -8
  33. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/tsconfig.json +1 -1
  34. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/vite.config.ts +18 -16
  35. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/pyproject.toml.tpl +7 -1
  36. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/README.md.tpl +11 -0
  37. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/contracts/schemas.py.tpl +2 -2
  38. simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__/core/__init__.py +1 -0
  39. {simple_module_cli-0.0.43/simple_module_cli/templates/module/__PACKAGE__ → simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__/core}/services.py.tpl +1 -1
  40. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/models.py.tpl +1 -1
  41. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/module.py.tpl +6 -18
  42. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/pages/Browse.tsx.tpl +3 -0
  43. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/pages/Create.tsx.tpl +3 -0
  44. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/pages/Edit.tsx.tpl +3 -0
  45. simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__/web/__init__.py +1 -0
  46. {simple_module_cli-0.0.43/simple_module_cli/templates/module/__PACKAGE__ → simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__/web}/deps.py.tpl +1 -1
  47. simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/__init__.py +1 -0
  48. {simple_module_cli-0.0.43/simple_module_cli/templates/module/__PACKAGE__ → simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__/web}/endpoints/api.py.tpl +8 -8
  49. {simple_module_cli-0.0.43/simple_module_cli/templates/module/__PACKAGE__ → simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__/web}/endpoints/views.py.tpl +7 -7
  50. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/README.md.tpl +9 -1
  51. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Browse.tsx.tpl +3 -0
  52. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Create.tsx.tpl +3 -0
  53. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Edit.tsx.tpl +3 -0
  54. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/pyproject.toml.tpl +1 -0
  55. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/pyproject.toml.tpl +1 -0
  56. simple_module_cli-0.0.45/simple_module_cli/templates/module/tests/conftest.py +1 -0
  57. simple_module_cli-0.0.45/simple_module_cli/templates/module/tests/core/contracts/test___PACKAGE___schemas.py.tpl +26 -0
  58. simple_module_cli-0.0.45/simple_module_cli/templates/module/tests/core/module/test___PACKAGE___module.py.tpl +27 -0
  59. simple_module_cli-0.0.43/simple_module_cli/templates/module/tests/test___PACKAGE__.py.tpl → simple_module_cli-0.0.45/simple_module_cli/templates/module/tests/web/crud/test___PACKAGE___crud.py.tpl +3 -51
  60. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/pyproject.toml.tpl +1 -1
  61. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/conftest.py +10 -0
  62. simple_module_cli-0.0.45/tests/test_cli_alembic_ini.py +32 -0
  63. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_docker_persistence_secrets.py +5 -1
  64. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_new_regressions.py +11 -12
  65. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_new_scaffold_layout.py +18 -0
  66. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_prepare_data_migrations.py +2 -2
  67. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_recipes.py +1 -1
  68. simple_module_cli-0.0.45/tests/test_cli_scaffold_vite8.py +48 -0
  69. simple_module_cli-0.0.45/tests/test_cli_skill_links.py +32 -0
  70. simple_module_cli-0.0.45/tests/test_cli_skill_page_audit.py +265 -0
  71. simple_module_cli-0.0.45/tests/test_cli_version_check.py +56 -0
  72. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_module_css_assets.py +1 -0
  73. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_module_css_build.py +1 -1
  74. simple_module_cli-0.0.45/tests/test_scaffold_lint_tooling.py +104 -0
  75. simple_module_cli-0.0.45/tests/test_scaffolding_area_layout.py +64 -0
  76. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_scaffolding_framework_repo.py +4 -3
  77. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_scaffolding_host.py +10 -11
  78. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_scaffolding_module.py +20 -9
  79. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_scaffolding_module_js.py +21 -2
  80. simple_module_cli-0.0.43/simple_module_cli/templates/module/__PACKAGE__/endpoints/__init__.py +0 -0
  81. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/.gitignore +0 -0
  82. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/LICENSE +0 -0
  83. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/__init__.py +0 -0
  84. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/_add_install.py +0 -0
  85. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/_add_sources.py +0 -0
  86. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/_env.py +0 -0
  87. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/_local_env.py +0 -0
  88. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/_module_build.py +0 -0
  89. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/_module_host.py +0 -0
  90. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/_templating.py +0 -0
  91. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/add_cmd.py +0 -0
  92. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/case.py +0 -0
  93. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/catalog.py +0 -0
  94. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/cli.py +0 -0
  95. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/docker_assets.py +0 -0
  96. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/docker_cmd.py +0 -0
  97. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/git_source.py +0 -0
  98. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/git_versions.py +0 -0
  99. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/migration_recipes/mail_settings.py +0 -0
  100. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/migration_recipes/users_tokens.py +0 -0
  101. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/migrations_cmd.py +0 -0
  102. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/module_cmd.py +0 -0
  103. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/openapi_cmd.py +0 -0
  104. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/openapi_types.py +0 -0
  105. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/package_update.py +0 -0
  106. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/package_update_deps.py +0 -0
  107. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/package_update_npm.py +0 -0
  108. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/plugins.py +0 -0
  109. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/pyproject_edit.py +0 -0
  110. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/recipes.py +0 -0
  111. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/requirements.py +0 -0
  112. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-database/SKILL.md +0 -0
  113. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-locales/SKILL.md +0 -0
  114. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-migrations/SKILL.md +0 -0
  115. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/skills_cmd.py +0 -0
  116. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/Makefile.snippet +0 -0
  117. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/compose-base-postgres.yml.tpl +0 -0
  118. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/compose-base-sqlite.yml.tpl +0 -0
  119. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/compose-tasks-postgres.yml.tpl +0 -0
  120. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/compose-tasks-sqlite.yml.tpl +0 -0
  121. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/compose-worker.yml.tpl +0 -0
  122. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/host-flat.Dockerfile +0 -0
  123. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/host.Dockerfile +0 -0
  124. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/worker.Dockerfile.tpl +0 -0
  125. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/.env.example +0 -0
  126. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/.gitignore +0 -0
  127. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/Makefile +0 -0
  128. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/README.md.tpl +0 -0
  129. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/_optional/background_tasks/Makefile.snippet +0 -0
  130. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/main.tsx +0 -0
  131. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/package.json.tpl +0 -0
  132. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/pages/Error.tsx +0 -0
  133. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/pages.ts +0 -0
  134. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/styles.css +0 -0
  135. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/vite.dev-url.ts +0 -0
  136. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/main.py +0 -0
  137. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/migrations/env.py +0 -0
  138. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/migrations/script.py.mako +0 -0
  139. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/migrations/versions/.gitkeep +0 -0
  140. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/routes.py +0 -0
  141. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/templates/index.html +0 -0
  142. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/.github/workflows/ci.yml +0 -0
  143. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/.github/workflows/publish.yml.tpl +0 -0
  144. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/.gitignore +0 -0
  145. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/__init__.py +0 -0
  146. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/contracts/__init__.py.tpl +0 -0
  147. {simple_module_cli-0.0.43/simple_module_cli/templates/module/__PACKAGE__ → simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__/core}/constants.py.tpl +0 -0
  148. {simple_module_cli-0.0.43/simple_module_cli/templates/module/__PACKAGE__ → simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__/core}/settings.py.tpl +0 -0
  149. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/locales/en.json.tpl +0 -0
  150. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/pages/api.generated.ts.tpl +0 -0
  151. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/pages/api.ts.tpl +0 -0
  152. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/py.typed +0 -0
  153. {simple_module_cli-0.0.43/simple_module_cli/templates/module/__PACKAGE__ → simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__/web}/service.py.tpl +0 -0
  154. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/LICENSE +0 -0
  155. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/standalone/package.json.tpl +0 -0
  156. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/standalone/tsconfig.json.tpl +0 -0
  157. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/package.json.tpl +0 -0
  158. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/tsconfig.json.tpl +0 -0
  159. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/.env.example +0 -0
  160. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/.gitignore +0 -0
  161. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/Makefile +0 -0
  162. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/README.md.tpl +0 -0
  163. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/package.json.tpl +0 -0
  164. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/update_cmd.py +0 -0
  165. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/uv_workspace.py +0 -0
  166. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/simple_module_cli/wizard.py +0 -0
  167. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_build_packaging.py +0 -0
  168. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_case.py +0 -0
  169. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_add_cmd.py +0 -0
  170. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_add_spec_parse.py +0 -0
  171. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_add_workspace_member.py +0 -0
  172. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_asset_prerequisites.py +0 -0
  173. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_catalog.py +0 -0
  174. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_catalog_depends_on.py +0 -0
  175. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_docker_assets.py +0 -0
  176. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_docker_workers.py +0 -0
  177. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_gen_types_scaffold.py +0 -0
  178. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_git_scan.py +0 -0
  179. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_new.py +0 -0
  180. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_new_dest_tolerance.py +0 -0
  181. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_new_git_module.py +0 -0
  182. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_new_migration_bootstrap.py +0 -0
  183. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_openapi_export.py +0 -0
  184. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_openapi_gen_types.py +0 -0
  185. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_package_update.py +0 -0
  186. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_package_update_groups.py +0 -0
  187. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_package_update_npm.py +0 -0
  188. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_package_update_pins.py +0 -0
  189. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_package_update_release_order.py +0 -0
  190. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_package_update_workspace_excludes.py +0 -0
  191. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_prepare_data_postgres.py +0 -0
  192. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_pyproject_edit.py +0 -0
  193. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_update_release_policy.py +0 -0
  194. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_update_sources.py +0 -0
  195. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_vite_port_env.py +0 -0
  196. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_wizard.py +0 -0
  197. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_cli_wizard_git.py +0 -0
  198. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_create_module_ci_skip.py +0 -0
  199. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_env_helper.py +0 -0
  200. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_framework_repo_wiring.py +0 -0
  201. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_module_cmd_build.py +0 -0
  202. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_module_cmd_e2e.py +0 -0
  203. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_module_cmd_verify.py +0 -0
  204. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_module_css_subdir_sources.py +0 -0
  205. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_module_npm_aliases.py +0 -0
  206. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_module_pages_manifest.py +0 -0
  207. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_no_framework_deps.py +0 -0
  208. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_plugin_discovery.py +0 -0
  209. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_scaffold_app_tsx_spa_links.py +0 -0
  210. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_scaffold_rollback.py +0 -0
  211. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_scaffolded_host_setup_wizard.py +0 -0
  212. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_skills_cmd.py +0 -0
  213. {simple_module_cli-0.0.43 → simple_module_cli-0.0.45}/tests/test_template_requires_framework.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: simple_module_cli
3
- Version: 0.0.43
3
+ Version: 0.0.45
4
4
  Summary: Standalone scaffolder for the SimpleModule framework — `smpy new`, `smpy create-module`, plugin host.
5
5
  Project-URL: Homepage, https://github.com/antosubash/simple_module_python
6
6
  Project-URL: Repository, https://github.com/antosubash/simple_module_python
@@ -35,7 +35,7 @@ pip install simple_module_cli
35
35
  # or, to keep the CLI in its own venv:
36
36
  pipx install simple_module_cli
37
37
  # or, to run it without installing:
38
- uvx --from simple_module_cli smpy new my-app
38
+ uvx --from simple_module_cli@latest smpy new my-app
39
39
  ```
40
40
 
41
41
  The package depends only on `typer`, `tomlkit` and `packaging` — installing it does **not** pull in FastAPI, SQLModel, or any other framework runtime.
@@ -9,7 +9,7 @@ pip install simple_module_cli
9
9
  # or, to keep the CLI in its own venv:
10
10
  pipx install simple_module_cli
11
11
  # or, to run it without installing:
12
- uvx --from simple_module_cli smpy new my-app
12
+ uvx --from simple_module_cli@latest smpy new my-app
13
13
  ```
14
14
 
15
15
  The package depends only on `typer`, `tomlkit` and `packaging` — installing it does **not** pull in FastAPI, SQLModel, or any other framework runtime.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "simple_module_cli"
3
- version = "0.0.43"
3
+ version = "0.0.45"
4
4
  description = "Standalone scaffolder for the SimpleModule framework — `smpy new`, `smpy create-module`, plugin host."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -4,6 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  from collections.abc import Sequence
6
6
 
7
+ from simple_module_cli._lint_tooling import TY_REQUIREMENT
7
8
  from simple_module_cli.scaffolding import resolve_framework_version
8
9
 
9
10
  _FRAMEWORK_VERSION = resolve_framework_version()
@@ -22,7 +23,7 @@ _APP_PY_DEV_DEPS = [
22
23
  # Floor: unpinned, uv backtracks playwright to 1.18 (GH #445).
23
24
  "playwright>=1.45",
24
25
  "ruff>=0.8",
25
- "ty>=0.0.29",
26
+ TY_REQUIREMENT,
26
27
  ]
27
28
 
28
29
  _APP_NPM_DEPS = {
@@ -50,6 +51,11 @@ _APP_NPM_DEV_DEPS = {
50
51
  "vite": "^8.2.2",
51
52
  }
52
53
 
54
+ # `@tailwindcss/typography` (pulled in by @simple-module-py/ui) pins
55
+ # postcss-selector-parser 6.0.10, which `npm audit` flags as a moderate ReDoS
56
+ # (GH #900). This repo's root package.json carries the same override.
57
+ _APP_NPM_OVERRIDES = {"postcss-selector-parser": "^6.1.5"}
58
+
53
59
 
54
60
  def _db_url(db: str, db_name: str, *, flat: bool, password: str = "<POSTGRES_PASSWORD>") -> str:
55
61
  if db == "postgres":
@@ -0,0 +1,37 @@
1
+ """Values that keep a scaffolded app passing its own ``make lint`` (GH #896)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ # ty is pre-1.0 and renames rules between releases (0.0.100 renamed
6
+ # ``unresolved-attribute``, which the scaffold's ``[tool.ty.rules]`` names), so
7
+ # new apps get the range this repo is tested on, not the newest ty.
8
+ # ``test_scaffold_lint_tooling.py`` fails once ``uv.lock`` moves past it.
9
+ TY_REQUIREMENT = "ty>=0.0.90,<0.0.100"
10
+
11
+ # Apps turn ty's ``invalid-assignment`` off, so this ignore would be reported as
12
+ # unused there; only a module inside the framework repo, which checks the rule,
13
+ # gets it.
14
+ MODEL_CONFIG_TY_IGNORE = " # ty: ignore[invalid-assignment]"
15
+
16
+ _MODULE_CONSTANTS = (
17
+ "API_PREFIX",
18
+ "LOCALE_NAMESPACE",
19
+ "MENU_ICON",
20
+ "MENU_LABEL",
21
+ "MENU_LABEL_KEY",
22
+ "MENU_ORDER",
23
+ "MENU_URL",
24
+ "PERM_GROUP",
25
+ "VIEW_PREFIX",
26
+ )
27
+ _MODULE_PERMISSIONS = ("CREATE", "DELETE", "EDIT", "VIEW")
28
+
29
+
30
+ def module_constants_import(package_upper: str) -> str:
31
+ """The ``module.py`` constants import list, in the order ruff's isort wants.
32
+
33
+ Where ``PERM_GROUP`` falls among ``PERM_<PACKAGE>_*`` depends on the package
34
+ name, so a fixed template order is unsorted for half of all names.
35
+ """
36
+ names = [*_MODULE_CONSTANTS, *(f"PERM_{package_upper}_{p}" for p in _MODULE_PERMISSIONS)]
37
+ return "\n".join(f" {name}," for name in sorted(names, key=str.lower))
@@ -0,0 +1,53 @@
1
+ """Warn when ``smpy new`` runs from an older CLI than PyPI's latest (GH #899).
2
+
3
+ A new app pins every framework package to the running CLI's own version, and
4
+ ``uvx --from simple_module_cli`` quietly reuses a ``uv tool install``-ed copy, so
5
+ an old tool scaffolds an old app without saying so. The check is best effort: a
6
+ short timeout, and any failure (offline, PyPI down, bad JSON) skips it.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from functools import partial
12
+
13
+ import typer
14
+ from packaging.version import Version
15
+
16
+ from simple_module_cli.pins import PLACEHOLDER_VERSION
17
+ from simple_module_cli.pypi import PYPI_URL, Fetcher, default_fetcher, fetch_latest
18
+
19
+ CLI_DIST = "simple_module_cli"
20
+ _TIMEOUT_SECONDS = 3
21
+ _quick_fetcher: Fetcher = partial(default_fetcher, timeout=_TIMEOUT_SECONDS)
22
+
23
+
24
+ def newer_release(current: str, fetcher: Fetcher | None = None) -> str | None:
25
+ """The latest stable ``simple_module_cli`` on PyPI if it is newer than ``current``."""
26
+ if current == PLACEHOLDER_VERSION:
27
+ return None
28
+ try:
29
+ running = Version(current)
30
+ if running.is_prerelease or running.is_devrelease or running.local:
31
+ return None # pre-release, dev or local build: not what PyPI ships
32
+ latest = fetch_latest(CLI_DIST, include_pre=False, fetcher=fetcher or _quick_fetcher)
33
+ if latest is not None and Version(latest) > running:
34
+ return latest
35
+ except Exception:
36
+ # OSError (timeouts, sockets), ValueError (bad JSON/versions), but also
37
+ # http.client.IncompleteRead and AttributeError on an unexpected payload shape.
38
+ return None
39
+ return None
40
+
41
+
42
+ def warn_if_outdated(current: str, fetcher: Fetcher | None = None) -> None:
43
+ latest = newer_release(current, fetcher)
44
+ if latest is None:
45
+ return
46
+ typer.echo(
47
+ f"WARNING: this smpy is {current}, but {CLI_DIST} {latest} is on PyPI "
48
+ f"({PYPI_URL.format(name=CLI_DIST)}). The new app will pin the framework to "
49
+ f"{current}.\n"
50
+ f" Upgrade the installed tool: uv tool upgrade {CLI_DIST} (pipx upgrade {CLI_DIST})\n"
51
+ f" or run the latest once: uvx --from {CLI_DIST}@latest smpy new ...",
52
+ err=True,
53
+ )
@@ -22,6 +22,7 @@ from typing import Any
22
22
  from simple_module_cli._app_project_manifests import (
23
23
  _APP_NPM_DEPS,
24
24
  _APP_NPM_DEV_DEPS,
25
+ _APP_NPM_OVERRIDES,
25
26
  _APP_PY_DEV_DEPS,
26
27
  _FRAMEWORK_VERSION,
27
28
  _db_url,
@@ -160,19 +161,21 @@ def create_app_project(
160
161
  )
161
162
  host_pyproject.write_text(text, encoding="utf-8")
162
163
 
164
+ pkg_path = target / "package.json"
165
+ pkg_data: dict[str, Any] = (
166
+ _json.loads(pkg_path.read_text(encoding="utf-8"))
167
+ if pkg_path.exists()
168
+ else {"name": to_kebab_case(name), "private": True, "type": "module"}
169
+ )
163
170
  if flat:
164
171
  # The workspace template already emits a top-level package.json
165
172
  # with workspaces; flat mode has none, so seed one with the
166
173
  # framework npm pins so `npm install` resolves at the root.
167
- pkg_path = target / "package.json"
168
- pkg_data: dict[str, Any] = (
169
- _json.loads(pkg_path.read_text(encoding="utf-8"))
170
- if pkg_path.exists()
171
- else {"name": to_kebab_case(name), "private": True, "type": "module"}
172
- )
173
174
  pkg_data.setdefault("dependencies", {}).update(_APP_NPM_DEPS)
174
175
  pkg_data.setdefault("devDependencies", {}).update(_APP_NPM_DEV_DEPS)
175
- pkg_path.write_text(_json.dumps(pkg_data, indent=2) + "\n", encoding="utf-8")
176
+ # npm reads `overrides` only from the root package.json, in both layouts.
177
+ pkg_data.setdefault("overrides", {}).update(_APP_NPM_OVERRIDES)
178
+ pkg_path.write_text(_json.dumps(pkg_data, indent=2) + "\n", encoding="utf-8")
176
179
 
177
180
  ctx = ScaffoldCtx(name=name, db=db, tenancy=tenancy, selected=tuple(resolved))
178
181
  for mod_name in resolved:
@@ -70,6 +70,7 @@ def update_root_pyproject(root: Path, name: str) -> None:
70
70
  root_toml = root / "pyproject.toml"
71
71
  content = root_toml.read_text()
72
72
  src_path = f"modules/{name}"
73
+ # Pytest recursively collects area/feature tests from this one root.
73
74
  test_path = f"modules/{name}/tests"
74
75
 
75
76
  if f'"{src_path}",' in content and f'"{test_path}"' in content:
@@ -10,10 +10,12 @@ from typing import Annotated
10
10
 
11
11
  import typer
12
12
 
13
+ from simple_module_cli._version_check import warn_if_outdated
13
14
  from simple_module_cli.add_cmd import run_add
14
15
  from simple_module_cli.app_project import create_app_project
15
16
  from simple_module_cli.case import InvalidScaffoldNameError, to_kebab_case, validate_scaffold_name
16
17
  from simple_module_cli.catalog import PRESETS, expand_deps
18
+ from simple_module_cli.pins import resolve_framework_version
17
19
  from simple_module_cli.wizard import run_wizard
18
20
 
19
21
  __all__ = ["new_project"]
@@ -110,6 +112,7 @@ def new_project(
110
112
  except InvalidScaffoldNameError as exc:
111
113
  typer.echo(f"ERROR: {exc}", err=True)
112
114
  raise typer.Exit(code=1) from exc
115
+ warn_if_outdated(resolve_framework_version())
113
116
  pypi_name = to_kebab_case(name)
114
117
  if pypi_name != name:
115
118
  typer.echo(f"Normalizing PyPI name to {pypi_name!r}.")
@@ -15,6 +15,9 @@ from __future__ import annotations
15
15
 
16
16
  from pathlib import Path
17
17
 
18
+ # What resolve_framework_version() returns for an install without dist-info.
19
+ PLACEHOLDER_VERSION = "0.0.0"
20
+
18
21
 
19
22
  def resolve_framework_version() -> str:
20
23
  """Resolve the framework version that scaffolded apps should pin against.
@@ -31,7 +34,7 @@ def resolve_framework_version() -> str:
31
34
  try:
32
35
  return pkg_version("simple_module_cli")
33
36
  except PackageNotFoundError:
34
- return "0.0.0"
37
+ return PLACEHOLDER_VERSION
35
38
 
36
39
 
37
40
  def _pin_one(dep: str, version: str) -> str:
@@ -57,6 +57,6 @@ def fetch_latest(name: str, *, include_pre: bool, fetcher: Fetcher) -> str | Non
57
57
  return fallback if is_valid_version(fallback) else None
58
58
 
59
59
 
60
- def default_fetcher(url: str) -> dict[str, Any]:
61
- with urllib.request.urlopen(url, timeout=10) as resp:
60
+ def default_fetcher(url: str, timeout: float = 10) -> dict[str, Any]:
61
+ with urllib.request.urlopen(url, timeout=timeout) as resp:
62
62
  return json.loads(resp.read().decode("utf-8"))
@@ -21,6 +21,12 @@ from collections.abc import Sequence
21
21
  from pathlib import Path
22
22
  from typing import TypeGuard
23
23
 
24
+ from simple_module_cli._lint_tooling import (
25
+ MODEL_CONFIG_TY_IGNORE,
26
+ TY_REQUIREMENT,
27
+ module_constants_import,
28
+ )
29
+
24
30
  # The template engine lives in _templating.py; the private names are imported
25
31
  # here because long-standing tests monkeypatch them on this module.
26
32
  from simple_module_cli._templating import (
@@ -137,6 +143,7 @@ def create_workspace(
137
143
  "{{HOST_NAME}}": validate_scaffold_name(name),
138
144
  "{{HOST_PYPI_NAME}}": to_kebab_case(name),
139
145
  "{{FRAMEWORK_VERSION}}": framework_version,
146
+ "{{TY_REQUIREMENT}}": TY_REQUIREMENT,
140
147
  },
141
148
  preserve_existing=preserve_existing,
142
149
  )
@@ -194,6 +201,9 @@ def create_module(
194
201
  ) -> Path:
195
202
  """Scaffold a module package at ``dest``.
196
203
 
204
+ Implementation lives in ``core/`` and ``web/``; nested tests mirror those
205
+ areas without test-package initializers. Root lookup paths stay stable.
206
+
197
207
  When ``framework_version`` is a concrete version, the template's
198
208
  forward-looking ``simple_module_*`` ranges are rewritten to an exact pin so
199
209
  the module resolves against that framework version (e.g. ``uv add`` into the
@@ -236,6 +246,8 @@ def create_module(
236
246
  "{{SINGULAR}}": singular,
237
247
  "{{SINGULAR_UPPER}}": singular.upper(),
238
248
  "{{SINGULAR_CLASS}}": to_pascal_case(singular),
249
+ "{{CONSTANTS_IMPORTS}}": module_constants_import(package_name.upper()),
250
+ "{{MODEL_CONFIG_TY_IGNORE}}": MODEL_CONFIG_TY_IGNORE if framework_repo else "",
239
251
  # npm-side pin for @simple-module-py/* devDependencies; "*" when the
240
252
  # caller skips pinning (mirrors _should_pin_framework_version).
241
253
  "{{FRAMEWORK_VERSION}}": (
@@ -44,6 +44,7 @@ The CLI is [vercel-labs/skills](https://github.com/vercel-labs/skills); see its
44
44
  | [simple-module-database](./simple-module-database/SKILL.md) | Adding SQLModel tables, picking a mixin, or debugging session/transaction behavior |
45
45
  | [simple-module-migrations](./simple-module-migrations/SKILL.md) | Generating, applying, or reviewing Alembic migrations after installing or changing a module |
46
46
  | [simple-module-inertia-pages](./simple-module-inertia-pages/SKILL.md) | Adding or debugging an Inertia page in a module — render keys, shared props, common pitfalls |
47
+ | [simple-module-page-perf](./simple-module-page-perf/SKILL.md) | Auditing pages for speed and perceived speed — server time and SQL counts (`Server-Timing`), payloads, deferred props, navigation timing, layout shift, UX checks; ships `scripts/page_audit` |
47
48
  | [simple-module-locales](./simple-module-locales/SKILL.md) | Adding or debugging i18n in a module — `locale_dirs()`, namespaces, CLDR plurals, the Zod-in-hook rule |
48
49
  | [simple-module-registries](./simple-module-registries/SKILL.md) | Contributing menu items, permissions, feature flags, or events from a module |
49
50
  | [simple-module-testing](./simple-module-testing/SKILL.md) | Writing pytest tests — picking the right fixture (`db_session` / `app` / `authenticated_client`), single-test runs, e2e |
@@ -97,7 +97,7 @@ smpy create-module orders # writes ./simple_module_orders/
97
97
  smpy create-module orders --dest ./packages/orders
98
98
  ```
99
99
 
100
- The result is a complete package: `pyproject.toml` with the entry point declared, `module.py` with `ModuleBase`/`ModuleMeta` skeleton, `models.py`, `contracts/`, `endpoints/{api,views}.py`, `pages/`, `locales/en.json`, plus a tests directory wired up with `simple_module_test` fixtures.
100
+ The result is a complete package: `pyproject.toml` with the entry point declared, `module.py` with `ModuleBase`/`ModuleMeta` skeleton, `models.py`, `contracts/`, `web/endpoints/{api,views}.py`, `pages/`, `locales/en.json`, `core/{constants,settings,services}.py`, `web/{deps,service}.py`, plus nested `tests/<area>/<feature>/test_<module>_*.py` wired up with `simple_module_test` fixtures.
101
101
 
102
102
  `<name>` accepts any case — `orders`, `Orders`, `ORDERS`, `blog_posts` all work. The CLI lowercases it for the directory and PascalCases it for `ModuleMeta.name`.
103
103
 
@@ -30,12 +30,19 @@ class OrderOut(SQLModel): # DTO — plain SQLModel, no table=True
30
30
  name: str
31
31
  ```
32
32
 
33
+ On a DTO, `Field(regex=...)` is accepted but never enforced, and `Field(pattern=...)` raises `TypeError`, so check formats with a pydantic `field_validator`. Length and range limits work.
34
+
33
35
  Forbidden in module code: `pydantic.BaseModel` for DTOs, and SQLAlchemy `DeclarativeBase` + `Mapped[...]` / `mapped_column(...)` for tables. Autogenerate, fixtures, Inertia serialization, and the shared mixins all assume the SQLModel metaclass.
34
36
 
35
37
  ### 2. The file-size cap
36
38
 
37
39
  Treat 300 lines as the design pressure on every `.py`, `.ts`, and `.tsx` file (the reference codebase enforces this in CI). When you approach it, **split by responsibility** — don't golf comments and blank lines to squeeze under.
38
40
 
41
+ New module settings and their app-state container live in `core/settings.py`
42
+ and `core/services.py`; HTTP dependencies and services live in `web/`. Keep
43
+ root lookup files in place and put non-page frontend code in `ui/`. See
44
+ [Module layout](https://docs.py.simplemodule.dev/module-layout).
45
+
39
46
  ### 3. Per-module settings: `register_module_settings` → `app.state.<module>`
40
47
 
41
48
  ```python
@@ -44,8 +51,8 @@ from simple_module_core.module_settings import register_module_settings
44
51
 
45
52
  class UsersModule(ModuleBase):
46
53
  def register_settings(self, app: FastAPI) -> None:
47
- from users.settings import UsersSettings # a DbBackedSettings subclass
48
- from users.state import UsersState
54
+ from users.core.settings import UsersSettings # a DbBackedSettings subclass
55
+ from users.core.state import UsersState
49
56
 
50
57
  register_module_settings(app, "users", UsersSettings, lambda s: UsersState(settings=s))
51
58
  ```
@@ -25,7 +25,7 @@ make migrate
25
25
 
26
26
  `make new-module` (→ `scripts/new_module.py`) is the in-repo path. It calls the
27
27
  same `create_module` as `smpy create-module`, so both produce the same tree
28
- below (permissions, menu item with `label_key`, `constants.py`, CRUD sample,
28
+ below (permissions, menu item with `label_key`, `core/constants.py`, CRUD sample,
29
29
  `locales/en.json`); the in-repo variant adds workspace-sourced `pyproject.toml`
30
30
  metadata, `LICENSE`, and i18n-keyed pages. For a **standalone publishable
31
31
  package** (its own repo, with CI + PyPI `publish.yml`), use
@@ -35,26 +35,25 @@ host.
35
35
 
36
36
  ## What scaffolding produces
37
37
 
38
- ```
38
+ ```text
39
39
  modules/orders/
40
- ├── pyproject.toml # entry point declared here
41
- ├── package.json # per-module JS deps
42
- ├── tsconfig.json
43
- ├── tests/test_orders.py
44
- └── orders/
45
- ├── module.py # OrdersModule(ModuleBase) with ModuleMeta
46
- ├── constants.py # PERM_*, PAGE_*, MENU_* — no magic strings elsewhere
47
- ├── models.py # Base = create_module_base("orders")
48
- ├── contracts/schemas.py # SQLModel DTOs — public surface
49
- ├── service.py # business logic
50
- ├── services.py # app.state.orders state container (settings)
51
- ├── settings.py # DbBackedSettings subclass (DB-backed, no env)
52
- ├── deps.py # FastAPI dependencies
53
- ├── endpoints/{api,views}.py
54
- ├── pages/{Browse,Create,Edit}.tsx # *.tsx, auto-discovered by Vite
55
- ├── pages/api.ts # typed /api client: createApi<paths>()
56
- ├── pages/api.generated.ts # from `smpy openapi gen-types`; never edit
57
- └── locales/en.json
40
+ ├── pyproject.toml, package.json, tsconfig.json
41
+ ├── orders/
42
+ │ ├── __init__.py, py.typed, module.py
43
+ │ ├── models.py # or models/; discovered by name
44
+ │ ├── contracts/ # public SQLModel DTOs and extension contracts
45
+ │ ├── core/ # constants.py, settings.py, services.py, errors.py
46
+ │ ├── web/ # deps.py, service.py (or services/), private schemas
47
+ │ │ └── endpoints/ # api.py, views.py
48
+ │ ├── pages/ # Inertia pages, api.ts, api.generated.ts
49
+ │ ├── locales/ # <lang>.json
50
+ │ ├── ui/ # components/, hooks/, utils/ (when needed)
51
+ │ └── tasks.py, theme.css, styles.css # optional root lookup files
52
+ └── tests/
53
+ ├── conftest.py # module-wide fixtures
54
+ ├── core/module/test_orders_module.py
55
+ ├── core/contracts/test_orders_schemas.py
56
+ └── web/crud/test_orders_crud.py
58
57
  ```
59
58
 
60
59
  `make new-module` also edits `host/pyproject.toml` (adds the workspace dep), the
@@ -63,6 +62,12 @@ root `pyproject.toml` (type-check + test paths) and the `publish-pypi` matrix in
63
62
  test` without further wiring. Commit the `uv.lock`, `package-lock.json` and
64
63
  regenerated i18n key files it leaves behind.
65
64
 
65
+ Modules use this area layout.
66
+ Area initializers hold only a docstring. Private helpers stay in their area.
67
+ Tests have no `__init__.py`, keep `conftest.py` at their root and use globally
68
+ unique `test_orders_*.py` basenames; JS tests stay in `tests-js/`.
69
+ See [Module layout](https://docs.py.simplemodule.dev/module-layout) for the lookup consumers and shim policy.
70
+
66
71
  ## The contract: pyproject.toml + module.py
67
72
 
68
73
  The host discovers modules via a single entry point. If this is wrong, the module silently does nothing in dev and **fails boot in production** (strict discovery).
@@ -130,7 +135,7 @@ The new module should appear in the registered-modules log line. If it has a vie
130
135
  - **Registered the module by hand in host code.** Don't — discovery is entry-point-only; host code never imports module code.
131
136
 
132
137
  Services raise domain exceptions derived from a per-module base in
133
- `exceptions.py` or `errors.py`, never `HTTPException`. Map them in endpoints or
138
+ `core/errors.py`, never `HTTPException`. Map them in endpoints or
134
139
  `register_exception_handlers(app)` (as in `file_storage`); translate at the
135
140
  request boundary. Preserve existing status codes, JSON bodies and headers.
136
141
  Endpoint-level `HTTPException` for pure request validation remains fine.
@@ -9,7 +9,7 @@ description: Use when interpreting a simple_module_python diagnostic code (SM001
9
9
 
10
10
  The same diagnostics also run at host boot, but **only in development** (`SM_ENVIRONMENT == development`) — they print to the boot logs and `raise SystemExit` if there's any ERROR. **In production the diagnostics pass is skipped**; what protects prod is that module *discovery* runs strictly (any bad entry point — broken import, missing `meta`, non-`ModuleBase` class — or a missing `depends_on` target raises and fails the boot). So "errors fail prod boot" is true for discovery-level breakage (surfaced as **SM001**), not for the per-finding checks below, which you'll catch via `make doctor` / dev boot before you ever deploy.
11
11
 
12
- You can also call `run_diagnostics(...)` from `simple_module_core` programmatically (e.g. in a CI job) to surface issues without booting the full app — pass `migration_state=` / `module_tables=` / `migrated_tables=` to additionally get **SM010/SM011** (the migration checks below), and `i18n_supported_locales=` / `i18n_default_locale=` to get the locale checks.
12
+ You can also call `run_diagnostics(...)` from `simple_module_core` programmatically (e.g. in a CI job) to surface issues without booting the full app — pass `migration_state=` / `module_tables=` / `migrated_tables=` to additionally get **SM010/SM011** (`make doctor` reads those from the database itself), and `i18n_supported_locales=` / `i18n_default_locale=` to get the locale checks.
13
13
 
14
14
  ## Code reference
15
15
 
@@ -21,8 +21,8 @@ You can also call `run_diagnostics(...)` from `simple_module_core` programmatica
21
21
  | **SM007** | INFO | Module overrides no `register_*` hooks at all — likely scaffolded but empty | Either implement at least one hook or delete the module if unused |
22
22
  | **SM008** | ERROR | Two modules declare the same `ModuleMeta.name`, or two names collide once lowercased as table prefixes in the shared schema (one finding per collision, from either the duplicate-name or the schema-conflict check) | Rename one module's `meta.name` |
23
23
  | **SM009** | ERROR | A `framework/*` package directly imports from a plugin module (`modules/*`) | Move the symbol *up* into `simple_module_core` / `simple_module_hosting`, or invert the dependency via the event bus / a registry |
24
- | **SM010** | ERROR | Live DB revision is behind the migration head | Run `make migrate` before booting; in CI, ensure migrations are part of the deploy step. *Note:* only emitted when a caller passes `migration_state=` to `run_diagnostics` — `make doctor` and dev boot do **not** check this. The live boot enforces it separately: `check_migrations()` raises a plain `RuntimeError` (not an SM code) in dev and prod if the DB is behind head |
25
- | **SM011** | WARNING | A module declares a SQLModel table that has no entry in migration history | Run `make migration msg="..."` and apply. *Note:* only emitted when `module_tables=`/`migrated_tables=` are passed to `run_diagnostics`; not surfaced by `make doctor` or boot |
24
+ | **SM010** | ERROR / WARNING | `make doctor` compares `alembic_version` in `SM_DATABASE_URL` with the heads in `alembic.ini` (else `host/alembic.ini`): ERROR when any head is missing, WARNING when the DB was never migrated or could not be read | Run `make migrate` before booting; in CI, ensure migrations are part of the deploy step. The live boot enforces it separately: the lifespan raises a plain `RuntimeError` in dev and prod if the DB is behind head (a never-migrated first run goes to `/setup`) |
25
+ | **SM011** | WARNING | A table in a module's `models` is missing from a database at every head, so no migration creates it. Reported by `make doctor` and by a development boot once the database is open; skipped while the DB is behind head | Run `make migration msg="..."`, review the revision, apply |
26
26
  | **SM012** | WARNING (dev only) | `register_settings` is overridden but nothing was added to `app.state.<module_lower>` | Either store the module's settings dataclass on `app.state.<module_lower>` or remove the empty override |
27
27
  | **SM013** | WARNING | A locale file declared in `locale_dirs()` is missing for one of the supported locales | Create the file (even if empty) or trim `SM_I18N_SUPPORTED_LOCALES` |
28
28
  | **SM014** | WARNING | A non-default locale is missing keys present in the default locale | Add the missing keys, or accept that a fallback to default applies |
@@ -39,6 +39,8 @@ Boot regenerates it too; mid-session adds need the manual call before HMR sees t
39
39
 
40
40
  **Typing them in TSX.** A page receives its own props as typed component arguments (`export default function Browse({ items }: Props)`). Shared props are typed globally: `usePage().props.auth` is already a `SharedProps['auth']`. Components and layouts that need page props too use `usePageProps<Props>()` from `@simple-module-py/ui` (it returns `Props & SharedProps & { errors }`). Never write `usePage<{ props: X }>().props as unknown as X`; `make lint` rejects `as unknown as` outside tests unless the line carries `// cast-ok: <reason>`.
41
41
 
42
+ **A page sets its own layout.** The host applies none by default, so a page with no `Page.layout` renders without the sidebar, header and footer. Signed-in screens end the file with `Browse.layout = [AuthenticatedLayout];` (import from `@simple-module-py/ui/layouts/AuthenticatedLayout`); `/admin/*` pages use `AdminLayout`, public ones `PublicLayout`. The module scaffold generates this.
43
+
42
44
  **`auth.user` is `None` when no `principal_serializer` is registered**, even if the user is authenticated. The framework can't know the shape of your user object. The `auth` module registers the callable during `register_settings(app)` (`modules/auth/auth/module.py`):
43
45
 
44
46
  ```python
@@ -56,7 +58,7 @@ class AuthModule(ModuleBase):
56
58
  Use `InertiaDep` from `simple_module_hosting.inertia_deps` — it injects an `Inertia` instance with shared props already attached:
57
59
 
58
60
  ```python
59
- # orders/endpoints/views.py
61
+ # orders/web/endpoints/views.py
60
62
  from fastapi import APIRouter
61
63
  from simple_module_hosting.inertia_deps import InertiaDep
62
64
 
@@ -108,3 +110,4 @@ The typed client (#504):
108
110
 
109
111
  - **simple-module-creating** — where the PascalCase rule originates (matching `ModuleMeta.name`)
110
112
  - **simple-module-doctor** — full reference for `SM003` / `SM004` / `SM018` / `SM019`
113
+ - **simple-module-page-perf** — auditing a page's speed, N+1s, deferred props and loading UX
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: simple-module-page-perf
3
+ description: Use when checking or improving the speed and perceived speed of Inertia pages in a simple_module_python app — a page or navigation feels slow, a list may have an N+1, a payload looks large, content jumps while loading, or before shipping a new page. Triggers on "page is slow", "audit page performance", "Server-Timing", "N+1", "defer this prop", "layout shift", "skeleton", "LCP", or "perf check the pages".
4
+ ---
5
+
6
+ # simple_module_python: page performance audit
7
+
8
+ `scripts/page_audit` (next to this file) signs in to a running app, finds every
9
+ page, and measures each one three ways: the Inertia JSON a navigation fetches,
10
+ a real browser load and click-through, and a phone-width load. It prints a
11
+ Markdown table and a findings list, and exits 1 if any budget fails.
12
+
13
+ ## 1. Run it against a development server (server-side numbers)
14
+
15
+ A development host sends `Server-Timing: app;dur=…, db;dur=…;desc="N queries"`
16
+ on every response. The audit reads it to report server time and SQL
17
+ statements per page.
18
+
19
+ ```bash
20
+ uv run --with playwright playwright install chromium # once
21
+ uv run --with playwright python .claude/skills/simple-module-page-perf/scripts/page_audit \
22
+ --base-url http://localhost:8000 \
23
+ --email admin@example.com --password '<admin password>' \
24
+ --json perf-dev.json
25
+ ```
26
+
27
+ - Pages come from the `menus` shared prop, then two levels of links found in
28
+ each page's `<main>`, one sample per URL pattern (`/orders/<id>` is audited
29
+ once). Add pages with `--path /x/` (repeatable), audit only those with
30
+ `--no-discover --crawl-depth 0`.
31
+ - Logout, delete, export, download, `/api/` and `/setup` links are never
32
+ followed. Add your own with `--exclude <regex>`.
33
+ - Public pages: run without `--email` and pass them with `--path`
34
+ (`--path / --path /users/login`).
35
+ - No `Server-Timing` (older framework, or a non-development server): the
36
+ Server ms and SQL columns show `—`; everything else still works.
37
+ - Seed realistic volumes first. Ten rows hide the N+1 and the oversized prop
38
+ that ten thousand expose.
39
+
40
+ ## 2. Run it against a production build (what users download)
41
+
42
+ Dev-server bundles are unminified and served module by module, so LCP and JS
43
+ bytes only mean something on a build. The audit only applies those budgets
44
+ when the page is not served by Vite.
45
+
46
+ ```bash
47
+ make build # the client bundle
48
+ SM_ENVIRONMENT=staging SM_SECRET_KEY=<32+ chars> <the other secrets production needs> \
49
+ uv run uvicorn main:app --port 8001 # any environment but development/testing serves the build
50
+ uv run --with playwright python .claude/skills/simple-module-page-perf/scripts/page_audit \
51
+ --base-url http://localhost:8001 --email … --password … --json perf-prod.json
52
+ ```
53
+
54
+ Outside development and testing the session cookie is `Secure`. Browsers accept it on
55
+ `http://localhost`; over plain HTTP on any other host, set
56
+ `SM_SESSION_COOKIE_SECURE=false` for the audit run.
57
+
58
+ ## 3. Read the report
59
+
60
+ | Column / check | Budget (warn / fail) | What it means |
61
+ | --- | --- | --- |
62
+ | Server ms | 100 / 300 | warm median of `app` in Server-Timing |
63
+ | SQL | 12 / 25 | statements, cheapest warm round (auth adds a few now and then) |
64
+ | JSON KB | 100 / 300 | the Inertia response without the i18n catalog |
65
+ | `prop_kb` | 50 / 150 | the largest single page prop |
66
+ | Deferred | — | props the page loads after it paints |
67
+ | Nav ms | 300 / 1000 | click on a visible link → new page painted (`—`: no visible link to it) |
68
+ | `deferred_ms` | 1000 / 2500 | click → every deferred prop painted |
69
+ | LCP ms | 2500 / 4000 | production build only |
70
+ | `js_kb` | 350 / 600 | JS transferred on first load, production build only |
71
+ | CLS | 0.1 / 0.25 | layout shift on first load or navigation |
72
+ | DOM / `table_rows` | 1500 / 3000, 100 / 250 | rendered size after everything settled |
73
+ | `redirect` | warn | the GET redirected: link to the canonical URL |
74
+ | `console`, `failed_requests` | fail | runtime errors, 4xx/5xx requests while on the page |
75
+ | `overflow` | warn | page scrolls sideways at 390 px |
76
+ | `stuck_loaders` | warn | skeleton/spinner/`aria-busy` still visible after everything settled |
77
+ | `unnamed_controls`, `h1` | warn | icon buttons without a name; not exactly one `<h1>` |
78
+
79
+ Override a budget with `--budget queries=20,40`. Use `--no-fail` to report
80
+ without failing.
81
+
82
+ ## 4. Fix what it finds
83
+
84
+ | Finding | Usual cause | Fix |
85
+ | --- | --- | --- |
86
+ | High SQL count | a query per row (N+1) | `selectinload()`/`joinedload()`, `get_user_directory(app).get_many(ids)`, one `GROUP BY` for per-row counts |
87
+ | High server ms, few queries | a slow call: broker, HTTP API, big aggregate | `defer(load, group="…")` with a same-size placeholder, or cache with a TTL plus invalidation |
88
+ | Large JSON / prop | whole models, unpaginated lists | a DTO with only the rendered fields; `paginate()` 20–50 rows; detail data on the detail page |
89
+ | Partial reloads still slow | props passed as values, so computed every time | pass expensive props as callables (`"stats": lambda: svc.stats()`): only evaluated when included |
90
+ | `deferred_ms` warning | the deferred work itself is slow | fine if the placeholder says what is loading; split independent slow props into separate groups (parallel requests) |
91
+ | CLS | content appears without reserved space | `Skeleton` in the real layout's shape; same component with "checking…" copy; `aria-busy="true"` |
92
+ | `redirect` | a link without the trailing slash, or to an old URL | one constant for the index URL, with its slash |
93
+ | `js_kb` | heavy library in a shared component | `lazy(() => import('./Heavy'))` + `<Suspense fallback={<Skeleton …/>}>` where it is used |
94
+ | DOM / rows | long unpaginated list | paginate, or virtualize past a few hundred rows |
95
+ | `overflow` | wide table or fixed widths | `overflow-x-auto` around tables; no fixed pixel widths |
96
+
97
+ How deferred props behave on the client:
98
+
99
+ - A deferred prop is `undefined` until it loads, which is different from `null`
100
+ (loaded, nothing there). Type it optional (`stats?: Stats`) and branch on
101
+ `=== undefined`, or wrap the part in Inertia's
102
+ `<Deferred data="stats" fallback={…}>`.
103
+ - A component that copies the prop into state must adopt it when it arrives:
104
+ `useEffect(() => { if (initial) setValue(initial); }, [initial]);`.
105
+ - Test the server side with `InertiaPage` from `simple_module_test`:
106
+ `page.deferred("group", "prop").missing("prop")`, then
107
+ `await page.load_deferred(client, "group")`.
108
+
109
+ ## 5. Pin it
110
+
111
+ Keep a fixed page fixed with a statement-count test. The cheapest of three
112
+ requests excludes the auth layer's own periodic queries:
113
+
114
+ ```python
115
+ from simple_module_db.query_stats import install_query_stats, track_queries
116
+
117
+
118
+ async def _statements(app, client, url) -> int:
119
+ install_query_stats(app.state.sm.db.engine)
120
+ counts = []
121
+ for _ in range(3):
122
+ with track_queries() as stats:
123
+ assert (await client.get(url, headers={"X-Inertia": "true"})).status_code == 200
124
+ counts.append(stats.count)
125
+ return min(counts)
126
+
127
+
128
+ # Seed 2 rows, measure; seed 20 more, measure again; assert the counts are equal.
129
+ ```
130
+
131
+ ## UX checklist the numbers don't cover
132
+
133
+ Walk through these by hand on each page you touched:
134
+
135
+ - A visit under about 150 ms shows nothing; Inertia's progress bar covers longer
136
+ ones. Don't add page-level spinners.
137
+ - Loading, empty, filtered-empty and error states each say something different
138
+ and offer a next step.
139
+ - Submit buttons disable while `form.processing` is true; validation errors keep
140
+ what the user typed.
141
+ - Filters reload with `only`, `preserveState`, `preserveScroll` and
142
+ `replace: true`; text inputs are debounced (about 300 ms).
143
+ - Live data either polls modestly (`usePoll(5000+, { only })`) or shows
144
+ "last updated" next to a Refresh button.
145
+ - `<Link prefetch>` only where slightly stale data is fine; every hover is a request.
146
+ - Touch targets are at least 44 px tall on phones (`max-lg:min-h-11`).
147
+
148
+ ## Gotchas
149
+
150
+ - Run the audit against a server that nothing else is changing: a Vite HMR
151
+ reload in the middle of a run shows up as layout shift and console errors.
152
+ - `Nav ms` needs a visible link to the page from its parent, a sibling page in
153
+ the same area, or home. Pages only reachable from a dropdown show `—`.
154
+ - A `fail` on a crawled detail page with HTTP 404 or 422 is usually seed data
155
+ linking to rows that don't exist. Check the link before chasing it.
156
+ - The browser pass drives one tab; don't run two audits against one server
157
+ at the same time, or the timings measure each other.