simple-module-cli 0.0.44__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 (212) hide show
  1. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/PKG-INFO +2 -2
  2. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/README.md +1 -1
  3. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/pyproject.toml +1 -1
  4. {simple_module_cli-0.0.44 → 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.44 → simple_module_cli-0.0.45}/simple_module_cli/app_project.py +10 -7
  8. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/new.py +3 -0
  9. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/pins.py +4 -1
  10. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/pypi.py +2 -2
  11. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/scaffolding.py +9 -0
  12. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-conventions/SKILL.md +3 -1
  13. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-creating/SKILL.md +1 -1
  14. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-doctor/SKILL.md +3 -3
  15. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-inertia-pages/SKILL.md +2 -0
  16. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/alembic.ini +15 -0
  17. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/app.tsx +10 -26
  18. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/pages/Landing.tsx +17 -8
  19. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/tsconfig.json +1 -1
  20. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/vite.config.ts +18 -16
  21. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/pyproject.toml.tpl +7 -1
  22. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/contracts/schemas.py.tpl +1 -1
  23. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/module.py.tpl +1 -13
  24. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/pages/Browse.tsx.tpl +3 -0
  25. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/pages/Create.tsx.tpl +3 -0
  26. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/pages/Edit.tsx.tpl +3 -0
  27. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Browse.tsx.tpl +3 -0
  28. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Create.tsx.tpl +3 -0
  29. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Edit.tsx.tpl +3 -0
  30. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/pyproject.toml.tpl +1 -1
  31. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/conftest.py +10 -0
  32. simple_module_cli-0.0.45/tests/test_cli_alembic_ini.py +32 -0
  33. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_new_regressions.py +10 -11
  34. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_new_scaffold_layout.py +15 -0
  35. simple_module_cli-0.0.45/tests/test_cli_scaffold_vite8.py +48 -0
  36. simple_module_cli-0.0.45/tests/test_cli_skill_links.py +32 -0
  37. simple_module_cli-0.0.45/tests/test_cli_version_check.py +56 -0
  38. simple_module_cli-0.0.45/tests/test_scaffold_lint_tooling.py +104 -0
  39. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_scaffolding_host.py +9 -10
  40. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_scaffolding_module_js.py +19 -0
  41. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/.gitignore +0 -0
  42. {simple_module_cli-0.0.44/simple_module_cli/templates/module/_optional/framework_repo → simple_module_cli-0.0.45}/LICENSE +0 -0
  43. {simple_module_cli-0.0.44/simple_module_cli/templates/module/__PACKAGE__ → simple_module_cli-0.0.45/simple_module_cli}/__init__.py +0 -0
  44. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/_add_install.py +0 -0
  45. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/_add_sources.py +0 -0
  46. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/_env.py +0 -0
  47. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/_local_env.py +0 -0
  48. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/_module_build.py +0 -0
  49. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/_module_host.py +0 -0
  50. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/_templating.py +0 -0
  51. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/add_cmd.py +0 -0
  52. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/case.py +0 -0
  53. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/catalog.py +0 -0
  54. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/cli.py +0 -0
  55. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/docker_assets.py +0 -0
  56. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/docker_cmd.py +0 -0
  57. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/framework_repo.py +0 -0
  58. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/git_source.py +0 -0
  59. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/git_versions.py +0 -0
  60. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/migration_recipes/mail_settings.py +0 -0
  61. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/migration_recipes/users_tokens.py +0 -0
  62. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/migrations_cmd.py +0 -0
  63. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/module_cmd.py +0 -0
  64. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/openapi_cmd.py +0 -0
  65. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/openapi_types.py +0 -0
  66. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/package_update.py +0 -0
  67. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/package_update_deps.py +0 -0
  68. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/package_update_npm.py +0 -0
  69. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/plugins.py +0 -0
  70. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/pyproject_edit.py +0 -0
  71. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/recipes.py +0 -0
  72. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/requirements.py +0 -0
  73. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/README.md +0 -0
  74. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-cli/SKILL.md +0 -0
  75. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-database/SKILL.md +0 -0
  76. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-locales/SKILL.md +0 -0
  77. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-migrations/SKILL.md +0 -0
  78. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-page-perf/SKILL.md +0 -0
  79. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/__main__.py +0 -0
  80. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_browser.py +0 -0
  81. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_crawl.py +0 -0
  82. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_report.py +0 -0
  83. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_server.py +0 -0
  84. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-registries/SKILL.md +0 -0
  85. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills/simple-module-testing/SKILL.md +0 -0
  86. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/skills_cmd.py +0 -0
  87. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/Makefile.snippet +0 -0
  88. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/compose-base-postgres.yml.tpl +0 -0
  89. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/compose-base-sqlite.yml.tpl +0 -0
  90. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/compose-tasks-postgres.yml.tpl +0 -0
  91. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/compose-tasks-sqlite.yml.tpl +0 -0
  92. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/compose-worker.yml.tpl +0 -0
  93. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/dockerignore +0 -0
  94. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/host-flat.Dockerfile +0 -0
  95. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/host.Dockerfile +0 -0
  96. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/docker/worker.Dockerfile.tpl +0 -0
  97. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/.env.example +0 -0
  98. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/.gitignore +0 -0
  99. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/Makefile +0 -0
  100. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/README.md.tpl +0 -0
  101. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/_optional/background_tasks/Makefile.snippet +0 -0
  102. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/_optional/background_tasks/run_worker.py +0 -0
  103. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/main.tsx +0 -0
  104. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/module-assets.ts +0 -0
  105. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/package.json.tpl +0 -0
  106. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/pages/Error.tsx +0 -0
  107. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/pages.ts +0 -0
  108. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/styles.css +0 -0
  109. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/client_app/vite.dev-url.ts +0 -0
  110. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/main.py +0 -0
  111. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/migrations/env.py +0 -0
  112. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/migrations/script.py.mako +0 -0
  113. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/migrations/versions/.gitkeep +0 -0
  114. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/routes.py +0 -0
  115. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/host/templates/index.html +0 -0
  116. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/.github/workflows/ci.yml +0 -0
  117. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/.github/workflows/publish.yml.tpl +0 -0
  118. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/.gitignore +0 -0
  119. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/README.md.tpl +0 -0
  120. {simple_module_cli-0.0.44/simple_module_cli → simple_module_cli-0.0.45/simple_module_cli/templates/module/__PACKAGE__}/__init__.py +0 -0
  121. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/contracts/__init__.py.tpl +0 -0
  122. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/core/__init__.py +0 -0
  123. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/core/constants.py.tpl +0 -0
  124. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/core/services.py.tpl +0 -0
  125. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/core/settings.py.tpl +0 -0
  126. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/locales/en.json.tpl +0 -0
  127. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/models.py.tpl +0 -0
  128. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/pages/api.generated.ts.tpl +0 -0
  129. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/pages/api.ts.tpl +0 -0
  130. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/py.typed +0 -0
  131. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/web/__init__.py +0 -0
  132. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/web/deps.py.tpl +0 -0
  133. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/__init__.py +0 -0
  134. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/api.py.tpl +0 -0
  135. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/views.py.tpl +0 -0
  136. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/__PACKAGE__/web/service.py.tpl +0 -0
  137. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45/simple_module_cli/templates/module/_optional/framework_repo}/LICENSE +0 -0
  138. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/README.md.tpl +0 -0
  139. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/framework_repo/pyproject.toml.tpl +0 -0
  140. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/standalone/package.json.tpl +0 -0
  141. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/_optional/standalone/tsconfig.json.tpl +0 -0
  142. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/package.json.tpl +0 -0
  143. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/pyproject.toml.tpl +0 -0
  144. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/tests/conftest.py +0 -0
  145. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/tests/core/contracts/test___PACKAGE___schemas.py.tpl +0 -0
  146. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/tests/core/module/test___PACKAGE___module.py.tpl +0 -0
  147. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/tests/web/crud/test___PACKAGE___crud.py.tpl +0 -0
  148. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/module/tsconfig.json.tpl +0 -0
  149. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/.env.example +0 -0
  150. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/.gitignore +0 -0
  151. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/Makefile +0 -0
  152. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/README.md.tpl +0 -0
  153. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/templates/workspace/package.json.tpl +0 -0
  154. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/update_cmd.py +0 -0
  155. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/uv_workspace.py +0 -0
  156. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/simple_module_cli/wizard.py +0 -0
  157. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_build_packaging.py +0 -0
  158. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_case.py +0 -0
  159. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_add_cmd.py +0 -0
  160. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_add_spec_parse.py +0 -0
  161. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_add_workspace_member.py +0 -0
  162. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_asset_prerequisites.py +0 -0
  163. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_catalog.py +0 -0
  164. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_catalog_depends_on.py +0 -0
  165. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_docker_assets.py +0 -0
  166. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_docker_persistence_secrets.py +0 -0
  167. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_docker_workers.py +0 -0
  168. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_gen_types_scaffold.py +0 -0
  169. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_git_scan.py +0 -0
  170. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_new.py +0 -0
  171. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_new_dest_tolerance.py +0 -0
  172. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_new_git_module.py +0 -0
  173. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_new_migration_bootstrap.py +0 -0
  174. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_openapi_export.py +0 -0
  175. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_openapi_gen_types.py +0 -0
  176. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_package_update.py +0 -0
  177. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_package_update_groups.py +0 -0
  178. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_package_update_npm.py +0 -0
  179. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_package_update_pins.py +0 -0
  180. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_package_update_release_order.py +0 -0
  181. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_package_update_workspace_excludes.py +0 -0
  182. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_prepare_data_migrations.py +0 -0
  183. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_prepare_data_postgres.py +0 -0
  184. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_pyproject_edit.py +0 -0
  185. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_recipes.py +0 -0
  186. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_skill_page_audit.py +0 -0
  187. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_update_release_policy.py +0 -0
  188. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_update_sources.py +0 -0
  189. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_vite_port_env.py +0 -0
  190. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_wizard.py +0 -0
  191. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_cli_wizard_git.py +0 -0
  192. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_create_module_ci_skip.py +0 -0
  193. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_env_helper.py +0 -0
  194. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_framework_repo_wiring.py +0 -0
  195. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_module_cmd_build.py +0 -0
  196. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_module_cmd_e2e.py +0 -0
  197. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_module_cmd_verify.py +0 -0
  198. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_module_css_assets.py +0 -0
  199. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_module_css_build.py +0 -0
  200. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_module_css_subdir_sources.py +0 -0
  201. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_module_npm_aliases.py +0 -0
  202. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_module_pages_manifest.py +0 -0
  203. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_no_framework_deps.py +0 -0
  204. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_plugin_discovery.py +0 -0
  205. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_scaffold_app_tsx_spa_links.py +0 -0
  206. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_scaffold_rollback.py +0 -0
  207. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_scaffolded_host_setup_wizard.py +0 -0
  208. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_scaffolding_area_layout.py +0 -0
  209. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_scaffolding_framework_repo.py +0 -0
  210. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_scaffolding_module.py +0 -0
  211. {simple_module_cli-0.0.44 → simple_module_cli-0.0.45}/tests/test_skills_cmd.py +0 -0
  212. {simple_module_cli-0.0.44 → 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.44
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.44"
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:
@@ -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
  )
@@ -239,6 +246,8 @@ def create_module(
239
246
  "{{SINGULAR}}": singular,
240
247
  "{{SINGULAR_UPPER}}": singular.upper(),
241
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 "",
242
251
  # npm-side pin for @simple-module-py/* devDependencies; "*" when the
243
252
  # caller skips pinning (mirrors _should_pin_framework_version).
244
253
  "{{FRAMEWORK_VERSION}}": (
@@ -30,6 +30,8 @@ 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
@@ -39,7 +41,7 @@ Treat 300 lines as the design pressure on every `.py`, `.ts`, and `.tsx` file (t
39
41
  New module settings and their app-state container live in `core/settings.py`
40
42
  and `core/services.py`; HTTP dependencies and services live in `web/`. Keep
41
43
  root lookup files in place and put non-page frontend code in `ui/`. See
42
- [Module layout](../../docs/module-layout.md).
44
+ [Module layout](https://docs.py.simplemodule.dev/module-layout).
43
45
 
44
46
  ### 3. Per-module settings: `register_module_settings` → `app.state.<module>`
45
47
 
@@ -66,7 +66,7 @@ Modules use this area layout.
66
66
  Area initializers hold only a docstring. Private helpers stay in their area.
67
67
  Tests have no `__init__.py`, keep `conftest.py` at their root and use globally
68
68
  unique `test_orders_*.py` basenames; JS tests stay in `tests-js/`.
69
- See [Module layout](../../docs/module-layout.md) for the lookup consumers and shim policy.
69
+ See [Module layout](https://docs.py.simplemodule.dev/module-layout) for the lookup consumers and shim policy.
70
70
 
71
71
  ## The contract: pyproject.toml + module.py
72
72
 
@@ -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
@@ -4,8 +4,23 @@
4
4
  # the repo root is what lets alembic read the repo-root .env — and therefore
5
5
  # the same SM_DATABASE_URL the app itself uses.
6
6
  script_location = %(here)s/migrations
7
+ # Split prepend_sys_path / version_locations on os.pathsep, not on spaces, so a
8
+ # checkout path with a space works and Alembic does not warn (GH #872).
9
+ path_separator = os
7
10
  sqlalchemy.url =
8
11
 
12
+ # Run the project's ruff on every new revision, so `make migration` output
13
+ # passes `make lint` (GH #896). Only the import rules are fixed: the unused
14
+ # `sa`/`op` imports of an empty revision stay for its author to use.
15
+ [post_write_hooks]
16
+ hooks = ruff_imports, ruff_format
17
+ ruff_imports.type = module
18
+ ruff_imports.module = ruff
19
+ ruff_imports.options = check --select I --fix --quiet REVISION_SCRIPT_FILENAME
20
+ ruff_format.type = module
21
+ ruff_format.module = ruff
22
+ ruff_format.options = format --quiet REVISION_SCRIPT_FILENAME
23
+
9
24
  [loggers]
10
25
  keys = root,sqlalchemy,alembic
11
26
 
@@ -1,5 +1,9 @@
1
1
  import { createInertiaApp, router } from '@inertiajs/react';
2
- import { configureI18n, updateI18n } from '@simple-module-py/i18n';
2
+ import {
3
+ bootI18nFromInitialPage,
4
+ type I18nPageBlock,
5
+ subscribeI18nToNavigation,
6
+ } from '@simple-module-py/i18n/inertia';
3
7
  import { formatTitle, setTitleAppName } from '@simple-module-py/ui/lib/app-title';
4
8
  import { resolveServerHead } from '@simple-module-py/ui/lib/server-head';
5
9
  import {
@@ -11,12 +15,6 @@ import { initTheme } from '@simple-module-py/ui/lib/theme';
11
15
  import { createRoot } from 'react-dom/client';
12
16
  import { resolvePage } from './pages';
13
17
 
14
- type I18nBlock = {
15
- locale: string;
16
- supportedLocales?: string[];
17
- messages: Record<string, string> | null;
18
- };
19
-
20
18
  createInertiaApp({
21
19
  title: (title) => formatTitle(title),
22
20
  // Re-emits the `_head` prop (server-rendered SEO tags) on client visits.
@@ -26,30 +24,16 @@ createInertiaApp({
26
24
  },
27
25
  setup({ el, App, props }) {
28
26
  const pageProps = props.initialPage.props as {
29
- i18n?: I18nBlock;
27
+ i18n?: I18nPageBlock;
30
28
  branding?: { appName?: string | null };
31
29
  };
32
30
  setTitleAppName(pageProps.branding?.appName);
33
31
  // Before the first render, so a dark-theme user never sees a light frame.
34
32
  initTheme();
35
- const initial = pageProps.i18n;
36
- configureI18n({
37
- locale: initial?.locale ?? 'en',
38
- messages: initial?.messages ?? {},
39
- });
40
- router.on('success', (event) => {
41
- const block = (event.detail.page.props as { i18n?: I18nBlock }).i18n;
42
- // A non-null `messages` payload IS the server's signal that the client
43
- // needs it — the backend sends `null` whenever the catalog the client
44
- // already holds is still good. Gating on a locale change instead drops
45
- // the catalog that arrives when the *audience* changes: signing in swaps
46
- // the anonymous snapshot for one including admin-only modules, at the
47
- // same locale, so every admin screen rendered raw keys
48
- // ("dashboard.home.title") until a hard refresh.
49
- if (block?.messages) {
50
- updateI18n({ locale: block.locale, messages: block.messages });
51
- }
52
- });
33
+ // Reports this tab's catalog in `X-SM-I18n` on every visit and adopts the
34
+ // catalog the server sends back, so each tab keeps its own (#788, #871).
35
+ bootI18nFromInitialPage(pageProps.i18n);
36
+ subscribeI18nToNavigation(router);
53
37
  // Authored content (pagebuilder widgets, markdown and rich-text fields)
54
38
  // renders author-entered URLs as plain <a href>, which the browser would
55
39
  // follow with a full document load. This app is client-rendered, so that
@@ -20,9 +20,7 @@ export default function Landing({ isAuthenticated }: LandingProps) {
20
20
  <p className="text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground">
21
21
  simple_module_py
22
22
  </p>
23
- <h1 className="text-4xl font-bold tracking-tight sm:text-5xl">
24
- Your app is up.
25
- </h1>
23
+ <h1 className="text-4xl font-bold tracking-tight sm:text-5xl">Your app is up.</h1>
26
24
  <p className="text-base text-muted-foreground sm:text-lg">
27
25
  This is the host's landing page — generated by{' '}
28
26
  <code className="rounded bg-secondary px-1.5 py-0.5 font-mono text-sm">smpy new</code>.
@@ -42,7 +40,7 @@ export default function Landing({ isAuthenticated }: LandingProps) {
42
40
  {primaryLabel}
43
41
  </a>
44
42
  <a
45
- href="https://github.com/antosubash/simple_module_python"
43
+ href="https://docs.py.simplemodule.dev/guide/first-module"
46
44
  className="inline-flex items-center justify-center rounded-md border border-border bg-background px-5 py-2.5 text-sm font-medium transition-colors hover:bg-secondary"
47
45
  >
48
46
  Read the docs
@@ -53,15 +51,26 @@ export default function Landing({ isAuthenticated }: LandingProps) {
53
51
  <h2 className="mb-3 text-sm font-semibold">Next steps</h2>
54
52
  <ul className="space-y-2 text-sm text-muted-foreground">
55
53
  <li>
56
- Create an admin:{' '}
54
+ Scaffold a module:{' '}
57
55
  <code className="rounded bg-secondary px-1.5 py-0.5 font-mono text-[13px] text-foreground">
58
- uv run smpy users create-admin
56
+ smpy create-module orders --dest modules/orders
59
57
  </code>
60
58
  </li>
61
59
  <li>
62
- Scaffold a module:{' '}
60
+ Wire it into the host:{' '}
63
61
  <code className="rounded bg-secondary px-1.5 py-0.5 font-mono text-[13px] text-foreground">
64
- smpy create-module orders --dest modules/orders
62
+ smpy add ../modules/orders --path host
63
+ </code>{' '}
64
+ (
65
+ <code className="rounded bg-secondary px-1.5 py-0.5 font-mono text-[13px] text-foreground">
66
+ smpy add ./modules/orders
67
+ </code>{' '}
68
+ in a flat app)
69
+ </li>
70
+ <li>
71
+ Create its tables:{' '}
72
+ <code className="rounded bg-secondary px-1.5 py-0.5 font-mono text-[13px] text-foreground">
73
+ make migration msg="add orders" && make migrate
65
74
  </code>
66
75
  </li>
67
76
  <li>
@@ -10,7 +10,7 @@
10
10
  "esModuleInterop": true,
11
11
  "skipLibCheck": true,
12
12
  "types": ["vite/client", "node"],
13
- "allowImportingTsExtensions": false
13
+ "allowImportingTsExtensions": true
14
14
  },
15
15
  "include": ["**/*.ts", "**/*.tsx"]
16
16
  }
@@ -3,8 +3,8 @@ import path from 'node:path';
3
3
  import tailwindcss from '@tailwindcss/vite';
4
4
  import react from '@vitejs/plugin-react';
5
5
  import { type Plugin, defineConfig } from 'vite';
6
- import { loadModuleAssets } from './module-assets';
7
- import { viteDevServer } from './vite.dev-url';
6
+ import { loadModuleAssets } from './module-assets.ts';
7
+ import { viteDevServer } from './vite.dev-url.ts';
8
8
 
9
9
  // Force every importer (host, workspace module, wheel-installed module)
10
10
  // to resolve to one React copy + a single Inertia hook context. Without
@@ -29,11 +29,11 @@ function findNodeModulesRoot(start: string): string {
29
29
  }
30
30
  return start;
31
31
  }
32
- const fsRoot = findNodeModulesRoot(__dirname);
32
+ const fsRoot = findNodeModulesRoot(import.meta.dirname);
33
33
 
34
34
  // Walks up from client_app to the directory holding the project .env itself —
35
35
  // fsRoot tracks node_modules, which (in flat mode) is NOT where .env lives.
36
- const { origin: devUrl, port: devPort } = viteDevServer(__dirname);
36
+ const { origin: devUrl, port: devPort } = viteDevServer(import.meta.dirname);
37
37
 
38
38
  const {
39
39
  fsAllow: moduleFsAllow,
@@ -42,7 +42,7 @@ const {
42
42
  pagesPrefixes: modulePagesPrefixes,
43
43
  aliases: moduleAliases,
44
44
  npmNames: moduleNpmNames,
45
- } = loadModuleAssets(__dirname);
45
+ } = loadModuleAssets(import.meta.dirname);
46
46
  const fakeWorkspaceImporter = path.join(fsRoot, 'package.json');
47
47
 
48
48
  // CJS-only deps like `clsx`, `tailwind-merge`, `class-variance-authority`
@@ -99,7 +99,7 @@ function collectOptimizeIncludes(): string[] {
99
99
  'use-sync-external-store/shim/with-selector',
100
100
  ]);
101
101
  const visited = new Set<string>();
102
- const queue: string[] = [path.join(__dirname, 'package.json'), ...modulePkgJsonPaths];
102
+ const queue: string[] = [path.join(import.meta.dirname, 'package.json'), ...modulePkgJsonPaths];
103
103
  while (queue.length > 0) {
104
104
  const pkgJsonPath = queue.shift();
105
105
  if (!pkgJsonPath || visited.has(pkgJsonPath)) continue;
@@ -177,7 +177,7 @@ function moduleBareImportResolver(): Plugin {
177
177
 
178
178
  export default defineConfig({
179
179
  plugins: [moduleBareImportResolver(), react(), tailwindcss()],
180
- root: __dirname,
180
+ root: import.meta.dirname,
181
181
  resolve: {
182
182
  // `#module/<pkg>` -> that module's package directory. Optional sugar for
183
183
  // hand-written imports; modules.generated.css does not rely on it.
@@ -187,22 +187,24 @@ export default defineConfig({
187
187
  optimizeDeps: {
188
188
  entries: ['main.tsx', 'pages/**/*.tsx', ...moduleOptimizeEntries],
189
189
  include: collectOptimizeIncludes(),
190
- // Vite's dep scanner runs esbuild against every entry above. When the
190
+ // Vite's dep scanner runs Rolldown against every entry above. When the
191
191
  // entry sits outside the workspace (a wheel-installed module's
192
- // pages/, or sometimes even a workspace module's pages/), esbuild's
193
- // upward node_modules walk from the importer does not always reach
194
- // the hoisted node_modules at fsRoot. Seeding it as NODE_PATH-style
195
- // fallback ensures bare specifiers like `maplibre-gl` resolve during
196
- // scan-imports. See GitHub issue #152.
197
- esbuildOptions: {
198
- nodePaths: [path.join(fsRoot, 'node_modules')],
192
+ // pages/, or sometimes even a workspace module's pages/), the upward
193
+ // node_modules walk from the importer does not always reach the
194
+ // hoisted node_modules at fsRoot. Adding it to the resolve search is
195
+ // a NODE_PATH-style fallback, so bare specifiers like `maplibre-gl`
196
+ // resolve during scan-imports. See GitHub issue #152.
197
+ rolldownOptions: {
198
+ resolve: {
199
+ modules: ['node_modules', path.join(fsRoot, 'node_modules')],
200
+ },
199
201
  },
200
202
  },
201
203
  build: {
202
204
  outDir: '../static/dist',
203
205
  manifest: true,
204
206
  rollupOptions: {
205
- input: path.resolve(__dirname, 'main.tsx'),
207
+ input: path.resolve(import.meta.dirname, 'main.tsx'),
206
208
  },
207
209
  },
208
210
  server: {
@@ -8,11 +8,17 @@ dependencies = [
8
8
  "simple_module_db>=1.0,<2.0",
9
9
  "simple_module_hosting>=1.0,<2.0",
10
10
  "simple_module_settings>=1.0,<2.0",
11
- "alembic>=1.13",
11
+ # 1.16.3 added the `module` runner host/alembic.ini's post-write hooks use.
12
+ "alembic>=1.16.3",
12
13
  "uvicorn[standard]>=0.34",
13
14
  {{MODULE_DEPS}}
14
15
  ]
15
16
 
17
+ # `host/alembic.ini` runs ruff on every new revision. `smpy new` replaces this
18
+ # group with the app's full dev tooling; a standalone `smpy create-host` keeps it.
19
+ [dependency-groups]
20
+ dev = ["ruff>=0.8"]
21
+
16
22
  # Host is an application, not a distributable package.
17
23
  [tool.uv]
18
24
  package = false
@@ -13,7 +13,7 @@ from {{PACKAGE_NAME}}.core.constants import DESCRIPTION_MAX_LENGTH, NAME_MAX_LEN
13
13
  class {{SINGULAR_CLASS}}Out(SQLModel):
14
14
  """{{SINGULAR_CLASS}} data returned by the API."""
15
15
 
16
- model_config = ConfigDict(from_attributes=True) # ty: ignore[invalid-assignment]
16
+ model_config = ConfigDict(from_attributes=True){{MODEL_CONFIG_TY_IGNORE}}
17
17
 
18
18
  id: int
19
19
  name: str
@@ -12,19 +12,7 @@ from simple_module_core.module_settings import register_module_settings
12
12
  from simple_module_core.permissions import PermissionRegistry
13
13
 
14
14
  from {{PACKAGE_NAME}}.core.constants import (
15
- API_PREFIX,
16
- LOCALE_NAMESPACE,
17
- MENU_ICON,
18
- MENU_LABEL,
19
- MENU_LABEL_KEY,
20
- MENU_ORDER,
21
- MENU_URL,
22
- PERM_GROUP,
23
- PERM_{{PACKAGE_NAME_UPPER}}_CREATE,
24
- PERM_{{PACKAGE_NAME_UPPER}}_DELETE,
25
- PERM_{{PACKAGE_NAME_UPPER}}_EDIT,
26
- PERM_{{PACKAGE_NAME_UPPER}}_VIEW,
27
- VIEW_PREFIX,
15
+ {{CONSTANTS_IMPORTS}}
28
16
  )
29
17
 
30
18
 
@@ -1,5 +1,6 @@
1
1
  import { Head, Link, router } from '@inertiajs/react';
2
2
  import { PageShell } from '@simple-module-py/ui/components/PageShell';
3
+ import { AuthenticatedLayout } from '@simple-module-py/ui/layouts/AuthenticatedLayout';
3
4
  import { apiResult } from '@simple-module-py/ui/lib/api';
4
5
  import { useState } from 'react';
5
6
  import { api } from './api';
@@ -55,3 +56,5 @@ export default function Browse({ items }: { items: Item[] }) {
55
56
  </PageShell>
56
57
  );
57
58
  }
59
+
60
+ Browse.layout = [AuthenticatedLayout];