simple-module-cli 0.0.44__tar.gz → 0.0.46__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 (216) hide show
  1. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/PKG-INFO +2 -2
  2. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/README.md +1 -1
  3. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/pyproject.toml +1 -1
  4. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/_add_install.py +26 -2
  5. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/_app_project_manifests.py +7 -1
  6. simple_module_cli-0.0.46/simple_module_cli/_lint_tooling.py +36 -0
  7. simple_module_cli-0.0.46/simple_module_cli/_version_check.py +53 -0
  8. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/app_project.py +10 -7
  9. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/cli.py +33 -20
  10. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/module_cmd.py +2 -0
  11. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/new.py +57 -31
  12. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/pins.py +4 -1
  13. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/pypi.py +2 -2
  14. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/scaffolding.py +14 -4
  15. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-cli/SKILL.md +9 -5
  16. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-conventions/SKILL.md +4 -2
  17. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-creating/SKILL.md +9 -3
  18. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-doctor/SKILL.md +3 -3
  19. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-inertia-pages/SKILL.md +2 -0
  20. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/host-flat.Dockerfile +4 -1
  21. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/host.Dockerfile +4 -1
  22. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/Makefile +3 -1
  23. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/alembic.ini +15 -0
  24. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/app.tsx +10 -26
  25. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/pages/Landing.tsx +17 -8
  26. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/tsconfig.json +1 -1
  27. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/vite.config.ts +18 -16
  28. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/pyproject.toml.tpl +9 -2
  29. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/README.md.tpl +7 -0
  30. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/contracts/schemas.py.tpl +1 -1
  31. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/module.py.tpl +1 -13
  32. {simple_module_cli-0.0.44/simple_module_cli/templates/module/_optional/framework_repo → simple_module_cli-0.0.46/simple_module_cli/templates/module}/__PACKAGE__/pages/Browse.tsx.tpl +3 -0
  33. {simple_module_cli-0.0.44/simple_module_cli/templates/module/_optional/framework_repo → simple_module_cli-0.0.46/simple_module_cli/templates/module}/__PACKAGE__/pages/Create.tsx.tpl +3 -0
  34. {simple_module_cli-0.0.44/simple_module_cli/templates/module/_optional/framework_repo → simple_module_cli-0.0.46/simple_module_cli/templates/module}/__PACKAGE__/pages/Edit.tsx.tpl +3 -0
  35. {simple_module_cli-0.0.44/simple_module_cli/templates/module → simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone}/__PACKAGE__/pages/Browse.tsx.tpl +3 -0
  36. {simple_module_cli-0.0.44/simple_module_cli/templates/module → simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone}/__PACKAGE__/pages/Create.tsx.tpl +3 -0
  37. {simple_module_cli-0.0.44/simple_module_cli/templates/module → simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone}/__PACKAGE__/pages/Edit.tsx.tpl +3 -0
  38. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/Makefile +3 -1
  39. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/README.md.tpl +4 -2
  40. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/pyproject.toml.tpl +11 -3
  41. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/conftest.py +10 -0
  42. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_add_workspace_member.py +35 -5
  43. simple_module_cli-0.0.46/tests/test_cli_alembic_ini.py +32 -0
  44. simple_module_cli-0.0.46/tests/test_cli_app_install_flow.py +64 -0
  45. simple_module_cli-0.0.46/tests/test_cli_module_pages_keyed.py +57 -0
  46. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_new_migration_bootstrap.py +3 -2
  47. simple_module_cli-0.0.46/tests/test_cli_new_quiet_install.py +82 -0
  48. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_new_regressions.py +10 -11
  49. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_new_scaffold_layout.py +17 -1
  50. simple_module_cli-0.0.46/tests/test_cli_scaffold_vite8.py +48 -0
  51. simple_module_cli-0.0.46/tests/test_cli_skill_links.py +32 -0
  52. simple_module_cli-0.0.46/tests/test_cli_version_check.py +56 -0
  53. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_module_cmd_verify.py +2 -2
  54. simple_module_cli-0.0.46/tests/test_scaffold_lint_tooling.py +104 -0
  55. simple_module_cli-0.0.46/tests/test_scaffolded_host_admin_overview.py +38 -0
  56. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_scaffolding_host.py +9 -10
  57. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_scaffolding_module_js.py +19 -0
  58. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/.gitignore +0 -0
  59. {simple_module_cli-0.0.44/simple_module_cli/templates/module/_optional/framework_repo → simple_module_cli-0.0.46}/LICENSE +0 -0
  60. {simple_module_cli-0.0.44/simple_module_cli/templates/module/__PACKAGE__ → simple_module_cli-0.0.46/simple_module_cli}/__init__.py +0 -0
  61. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/_add_sources.py +0 -0
  62. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/_env.py +0 -0
  63. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/_local_env.py +0 -0
  64. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/_module_build.py +0 -0
  65. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/_module_host.py +0 -0
  66. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/_templating.py +0 -0
  67. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/add_cmd.py +0 -0
  68. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/case.py +0 -0
  69. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/catalog.py +0 -0
  70. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/docker_assets.py +0 -0
  71. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/docker_cmd.py +0 -0
  72. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/framework_repo.py +0 -0
  73. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/git_source.py +0 -0
  74. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/git_versions.py +0 -0
  75. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/migration_recipes/mail_settings.py +0 -0
  76. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/migration_recipes/users_tokens.py +0 -0
  77. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/migrations_cmd.py +0 -0
  78. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/openapi_cmd.py +0 -0
  79. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/openapi_types.py +0 -0
  80. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/package_update.py +0 -0
  81. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/package_update_deps.py +0 -0
  82. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/package_update_npm.py +0 -0
  83. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/plugins.py +0 -0
  84. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/pyproject_edit.py +0 -0
  85. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/recipes.py +0 -0
  86. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/requirements.py +0 -0
  87. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/README.md +0 -0
  88. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-database/SKILL.md +0 -0
  89. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-locales/SKILL.md +0 -0
  90. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-migrations/SKILL.md +0 -0
  91. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/SKILL.md +0 -0
  92. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/__main__.py +0 -0
  93. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_browser.py +0 -0
  94. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_crawl.py +0 -0
  95. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_report.py +0 -0
  96. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_server.py +0 -0
  97. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-registries/SKILL.md +0 -0
  98. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-testing/SKILL.md +0 -0
  99. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/skills_cmd.py +0 -0
  100. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/Makefile.snippet +0 -0
  101. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/compose-base-postgres.yml.tpl +0 -0
  102. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/compose-base-sqlite.yml.tpl +0 -0
  103. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/compose-tasks-postgres.yml.tpl +0 -0
  104. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/compose-tasks-sqlite.yml.tpl +0 -0
  105. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/compose-worker.yml.tpl +0 -0
  106. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/dockerignore +0 -0
  107. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/worker.Dockerfile.tpl +0 -0
  108. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/.env.example +0 -0
  109. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/.gitignore +0 -0
  110. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/README.md.tpl +0 -0
  111. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/_optional/background_tasks/Makefile.snippet +0 -0
  112. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/_optional/background_tasks/run_worker.py +0 -0
  113. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/main.tsx +0 -0
  114. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/module-assets.ts +0 -0
  115. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/package.json.tpl +0 -0
  116. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/pages/Error.tsx +0 -0
  117. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/pages.ts +0 -0
  118. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/styles.css +0 -0
  119. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/vite.dev-url.ts +0 -0
  120. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/main.py +0 -0
  121. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/migrations/env.py +0 -0
  122. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/migrations/script.py.mako +0 -0
  123. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/migrations/versions/.gitkeep +0 -0
  124. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/routes.py +0 -0
  125. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/templates/index.html +0 -0
  126. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/.github/workflows/ci.yml +0 -0
  127. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/.github/workflows/publish.yml.tpl +0 -0
  128. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/.gitignore +0 -0
  129. {simple_module_cli-0.0.44/simple_module_cli → simple_module_cli-0.0.46/simple_module_cli/templates/module/__PACKAGE__}/__init__.py +0 -0
  130. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/contracts/__init__.py.tpl +0 -0
  131. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/core/__init__.py +0 -0
  132. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/core/constants.py.tpl +0 -0
  133. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/core/services.py.tpl +0 -0
  134. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/core/settings.py.tpl +0 -0
  135. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/locales/en.json.tpl +0 -0
  136. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/models.py.tpl +0 -0
  137. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/pages/api.generated.ts.tpl +0 -0
  138. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/pages/api.ts.tpl +0 -0
  139. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/py.typed +0 -0
  140. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/__init__.py +0 -0
  141. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/deps.py.tpl +0 -0
  142. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/__init__.py +0 -0
  143. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/api.py.tpl +0 -0
  144. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/views.py.tpl +0 -0
  145. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/service.py.tpl +0 -0
  146. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/framework_repo}/LICENSE +0 -0
  147. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/_optional/framework_repo/README.md.tpl +0 -0
  148. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/_optional/framework_repo/pyproject.toml.tpl +0 -0
  149. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/_optional/standalone/package.json.tpl +0 -0
  150. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/_optional/standalone/tsconfig.json.tpl +0 -0
  151. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/package.json.tpl +0 -0
  152. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/pyproject.toml.tpl +0 -0
  153. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/tests/conftest.py +0 -0
  154. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/tests/core/contracts/test___PACKAGE___schemas.py.tpl +0 -0
  155. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/tests/core/module/test___PACKAGE___module.py.tpl +0 -0
  156. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/tests/web/crud/test___PACKAGE___crud.py.tpl +0 -0
  157. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/tsconfig.json.tpl +0 -0
  158. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/.env.example +0 -0
  159. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/.gitignore +0 -0
  160. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/package.json.tpl +0 -0
  161. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/update_cmd.py +0 -0
  162. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/uv_workspace.py +0 -0
  163. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/simple_module_cli/wizard.py +0 -0
  164. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_build_packaging.py +0 -0
  165. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_case.py +0 -0
  166. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_add_cmd.py +0 -0
  167. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_add_spec_parse.py +0 -0
  168. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_asset_prerequisites.py +0 -0
  169. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_catalog.py +0 -0
  170. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_catalog_depends_on.py +0 -0
  171. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_docker_assets.py +0 -0
  172. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_docker_persistence_secrets.py +0 -0
  173. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_docker_workers.py +0 -0
  174. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_gen_types_scaffold.py +0 -0
  175. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_git_scan.py +0 -0
  176. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_new.py +0 -0
  177. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_new_dest_tolerance.py +0 -0
  178. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_new_git_module.py +0 -0
  179. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_openapi_export.py +0 -0
  180. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_openapi_gen_types.py +0 -0
  181. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_package_update.py +0 -0
  182. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_package_update_groups.py +0 -0
  183. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_package_update_npm.py +0 -0
  184. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_package_update_pins.py +0 -0
  185. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_package_update_release_order.py +0 -0
  186. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_package_update_workspace_excludes.py +0 -0
  187. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_prepare_data_migrations.py +0 -0
  188. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_prepare_data_postgres.py +0 -0
  189. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_pyproject_edit.py +0 -0
  190. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_recipes.py +0 -0
  191. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_skill_page_audit.py +0 -0
  192. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_update_release_policy.py +0 -0
  193. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_update_sources.py +0 -0
  194. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_vite_port_env.py +0 -0
  195. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_wizard.py +0 -0
  196. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_cli_wizard_git.py +0 -0
  197. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_create_module_ci_skip.py +0 -0
  198. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_env_helper.py +0 -0
  199. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_framework_repo_wiring.py +0 -0
  200. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_module_cmd_build.py +0 -0
  201. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_module_cmd_e2e.py +0 -0
  202. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_module_css_assets.py +0 -0
  203. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_module_css_build.py +0 -0
  204. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_module_css_subdir_sources.py +0 -0
  205. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_module_npm_aliases.py +0 -0
  206. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_module_pages_manifest.py +0 -0
  207. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_no_framework_deps.py +0 -0
  208. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_plugin_discovery.py +0 -0
  209. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_scaffold_app_tsx_spa_links.py +0 -0
  210. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_scaffold_rollback.py +0 -0
  211. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_scaffolded_host_setup_wizard.py +0 -0
  212. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_scaffolding_area_layout.py +0 -0
  213. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_scaffolding_framework_repo.py +0 -0
  214. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_scaffolding_module.py +0 -0
  215. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/tests/test_skills_cmd.py +0 -0
  216. {simple_module_cli-0.0.44 → simple_module_cli-0.0.46}/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.46
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.46"
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"
@@ -8,6 +8,8 @@ from pathlib import Path
8
8
 
9
9
  import typer
10
10
 
11
+ from simple_module_cli.uv_workspace import find_workspace_root, is_workspace_member
12
+
11
13
  ExecRunner = Callable[[list[str], Path], int]
12
14
 
13
15
 
@@ -28,6 +30,24 @@ def _default_exec_runner(cmd: list[str], cwd: Path) -> int:
28
30
  return subprocess.run(cmd, cwd=cwd, check=False).returncode
29
31
 
30
32
 
33
+ def _sync_command(project_dir: Path) -> tuple[list[str], Path]:
34
+ """How to sync after editing ``project_dir``'s pyproject.
35
+
36
+ A host inside an app workspace shares one venv with the root's dev tools
37
+ and every module member. ``uv sync`` from ``host/`` would sync the host
38
+ alone and uninstall the rest (GH #916), so sync the workspace from its
39
+ root, as ``make install`` does.
40
+ """
41
+ root = find_workspace_root(project_dir)
42
+ if (
43
+ root is not None
44
+ and root != project_dir.resolve()
45
+ and is_workspace_member(project_dir, project_dir)
46
+ ):
47
+ return ["uv", "sync", "--all-packages"], root
48
+ return ["uv", "sync"], project_dir
49
+
50
+
31
51
  def _fail(message: str) -> typer.Exit:
32
52
  typer.echo(f"ERROR: {message}", err=True)
33
53
  return typer.Exit(code=1)
@@ -40,8 +60,12 @@ def post_install(
40
60
  exec_runner: ExecRunner,
41
61
  ) -> None:
42
62
  """uv sync → gen-pages → sync-js-deps → entry-point check → reminders."""
43
- if exec_runner(["uv", "sync"], project_dir) != 0:
44
- raise _fail("`uv sync` failed — pyproject was written; fix and re-run `uv sync`.")
63
+ sync_cmd, sync_dir = _sync_command(project_dir)
64
+ if exec_runner(sync_cmd, sync_dir) != 0:
65
+ shown = " ".join(sync_cmd)
66
+ raise _fail(
67
+ f"`{shown}` failed — pyproject was written; fix and re-run `{shown}` from {sync_dir}."
68
+ )
45
69
  if (project_dir / "client_app").is_dir():
46
70
  exec_runner(["uv", "run", "smpy", "host", "gen-pages"], project_dir)
47
71
  exec_runner(["uv", "run", "smpy", "host", "sync-js-deps"], project_dir)
@@ -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,36 @@
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, so
6
+ # new apps get the range this repo is tested on, not the newest ty.
7
+ # ``test_scaffold_lint_tooling.py`` fails once ``uv.lock`` moves past it.
8
+ TY_REQUIREMENT = "ty>=0.0.100,<0.0.101"
9
+
10
+ # Apps turn ty's ``invalid-assignment`` off, so this ignore would be reported as
11
+ # unused there; only a module inside the framework repo, which checks the rule,
12
+ # gets it.
13
+ MODEL_CONFIG_TY_IGNORE = " # ty: ignore[invalid-assignment]"
14
+
15
+ _MODULE_CONSTANTS = (
16
+ "API_PREFIX",
17
+ "LOCALE_NAMESPACE",
18
+ "MENU_ICON",
19
+ "MENU_LABEL",
20
+ "MENU_LABEL_KEY",
21
+ "MENU_ORDER",
22
+ "MENU_URL",
23
+ "PERM_GROUP",
24
+ "VIEW_PREFIX",
25
+ )
26
+ _MODULE_PERMISSIONS = ("CREATE", "DELETE", "EDIT", "VIEW")
27
+
28
+
29
+ def module_constants_import(package_upper: str) -> str:
30
+ """The ``module.py`` constants import list, in the order ruff's isort wants.
31
+
32
+ Where ``PERM_GROUP`` falls among ``PERM_<PACKAGE>_*`` depends on the package
33
+ name, so a fixed template order is unsorted for half of all names.
34
+ """
35
+ names = [*_MODULE_CONSTANTS, *(f"PERM_{package_upper}_{p}" for p in _MODULE_PERMISSIONS)]
36
+ 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:
@@ -126,25 +126,35 @@ def create_host(
126
126
  typer.echo(" python main.py")
127
127
 
128
128
 
129
- def _echo_workspace_hint(target: Path) -> None:
130
- """Tell the user how to wire a workspace-member module into the host (GH #442)."""
129
+ def _app_add_command(target: Path) -> str | None:
130
+ """``smpy add …`` wiring a module into its app's host, or None outside an app (GH #442)."""
131
131
  root = find_workspace_root(target.parent)
132
132
  if root is None:
133
- return
133
+ return None
134
134
  host = root / "host"
135
135
  if not (host / "pyproject.toml").is_file() or not is_workspace_member(host, target):
136
- return
136
+ return None
137
137
  rel = os.path.relpath(target.resolve(), host.resolve())
138
138
  if not rel.startswith("."):
139
139
  rel = f"./{rel}" # parse_add_spec reads a bare "a/b" as a PyPI requirement
140
- host_arg = os.path.relpath(host.resolve(), Path.cwd())
141
- if host_arg.startswith(".."):
142
- host_arg = str(host.resolve())
143
- typer.echo(
144
- f"\nThis module is a uv workspace member. Wire it into the host with:\n"
145
- f" smpy add {rel} --path {host_arg}"
146
- " # adds it as { workspace = true }"
147
- )
140
+ # The steps are printed "from the app root", so name the host relative to it.
141
+ host_arg = host.resolve().relative_to(root.resolve()).as_posix()
142
+ return f"smpy add {rel} --path {host_arg}"
143
+
144
+
145
+ def _echo_app_next_steps(add_command: str, slug: str) -> None:
146
+ """The module lives in an app's workspace: wire it in with the app's own commands.
147
+
148
+ Never ``uv sync`` inside the module: that syncs the module alone and
149
+ uninstalls the rest of the app from the shared venv (GH #916).
150
+ """
151
+ typer.echo("\nNext steps (from the app root):")
152
+ typer.echo(f" {add_command} # adds it as {{ workspace = true }}")
153
+ typer.echo(" make install")
154
+ typer.echo(f' make migration msg="add {slug}"')
155
+ typer.echo(" make migrate")
156
+ typer.echo(" make test")
157
+ typer.echo("Then restart `make dev`: modules are discovered at start-up, not on reload.")
148
158
 
149
159
 
150
160
  @app.command("create-module")
@@ -193,14 +203,17 @@ def create_module(
193
203
  "Skipped .github/ workflows: this module is inside an existing repo, "
194
204
  "where nested workflows never run. Use --standalone to emit them."
195
205
  )
196
- _echo_workspace_hint(target)
197
- typer.echo("\nNext steps:")
198
- typer.echo(f" cd {target}")
199
- typer.echo(" uv sync --extra dev")
200
- typer.echo(" uv run pytest")
201
- typer.echo(" npm install")
202
- typer.echo(" npm run typecheck")
203
- typer.echo(" uv run smpy module verify")
206
+ add_command = _app_add_command(target)
207
+ if add_command is not None:
208
+ _echo_app_next_steps(add_command, slug)
209
+ else:
210
+ typer.echo("\nNext steps:")
211
+ typer.echo(f" cd {target}")
212
+ typer.echo(" uv sync --extra dev")
213
+ typer.echo(" uv run pytest")
214
+ typer.echo(" npm install")
215
+ typer.echo(" npm run typecheck")
216
+ typer.echo(" uv run smpy module verify")
204
217
  typer.echo(
205
218
  "\nThe pages ship sample API types (pages/api.generated.ts). Once the host serves "
206
219
  "the module, refresh them after any endpoint change:\n"
@@ -50,6 +50,8 @@ def run_verify(info: ModuleInfo, *, fresh: bool = False, runner=subprocess.run)
50
50
  ],
51
51
  host,
52
52
  ),
53
+ # Keyed pages read `keys.<module>`, which only the host's gen-i18n adds (GH #918).
54
+ ("gen-i18n", [uv, "run", "python", "-m", "simple_module_hosting", "gen-i18n"], host),
53
55
  ("frontend build (tsc + vite)", [npm, "run", "build"], client_app),
54
56
  )
55
57
  for label, cmd, cwd in steps:
@@ -4,16 +4,19 @@ from __future__ import annotations
4
4
 
5
5
  import shutil
6
6
  import subprocess
7
+ from collections.abc import Sequence
7
8
  from enum import StrEnum
8
9
  from pathlib import Path
9
10
  from typing import Annotated
10
11
 
11
12
  import typer
12
13
 
14
+ from simple_module_cli._version_check import warn_if_outdated
13
15
  from simple_module_cli.add_cmd import run_add
14
16
  from simple_module_cli.app_project import create_app_project
15
17
  from simple_module_cli.case import InvalidScaffoldNameError, to_kebab_case, validate_scaffold_name
16
18
  from simple_module_cli.catalog import PRESETS, expand_deps
19
+ from simple_module_cli.pins import resolve_framework_version
17
20
  from simple_module_cli.wizard import run_wizard
18
21
 
19
22
  __all__ = ["new_project"]
@@ -110,6 +113,7 @@ def new_project(
110
113
  except InvalidScaffoldNameError as exc:
111
114
  typer.echo(f"ERROR: {exc}", err=True)
112
115
  raise typer.Exit(code=1) from exc
116
+ warn_if_outdated(resolve_framework_version())
113
117
  pypi_name = to_kebab_case(name)
114
118
  if pypi_name != name:
115
119
  typer.echo(f"Normalizing PyPI name to {pypi_name!r}.")
@@ -171,61 +175,83 @@ def new_project(
171
175
  rel = path.relative_to(target) if path.is_relative_to(target) else path
172
176
  typer.echo(f" {rel}")
173
177
  typer.echo("\nGenerated secrets were written to .env (gitignored), not .env.example.")
174
- typer.echo("\nNext steps:")
175
- typer.echo(f" cd {target}")
178
+ manual_setup = ["make install", 'make migration msg="initial schema"', "make migrate"]
176
179
  if no_install:
177
- typer.echo(" uv sync")
178
- typer.echo(" npm install")
179
- typer.echo(' make migration msg="initial schema"')
180
- typer.echo(" make migrate")
181
- typer.echo(" make dev")
182
- typer.echo(" make docker-up # or run the full stack in containers")
183
- if "background_tasks" in resolved:
184
- typer.echo(" docker compose up -d redis worker beat # background jobs")
180
+ _echo_next_steps(target, manual_setup, resolved)
185
181
  return
186
182
 
187
- typer.echo("Installing dependencies...")
188
- for cmd in (["uv", "sync"], ["npm", "install"]):
183
+ typer.echo("\nInstalling dependencies...")
184
+ # What `make install` runs: a workspace syncs every member, not just the root.
185
+ uv_sync = ["uv", "sync"] if flat else ["uv", "sync", "--all-packages"]
186
+ for cmd in (uv_sync, ["npm", "install"]):
189
187
  if shutil.which(cmd[0]) is None:
190
188
  typer.echo(
191
189
  f"WARNING: '{cmd[0]}' not found on PATH; skipping `{' '.join(cmd)}`. "
192
190
  "Install it and finish setup manually.",
193
191
  err=True,
194
192
  )
193
+ _echo_next_steps(target, manual_setup, resolved)
195
194
  return
196
- result = subprocess.run(cmd, cwd=target, check=False)
197
- if result.returncode != 0:
198
- typer.echo(
199
- f"WARNING: {' '.join(cmd)} failed (exit {result.returncode}); "
200
- "finish setup manually.",
201
- err=True,
202
- )
195
+ if not _run_quietly(cmd, target):
196
+ _echo_next_steps(target, manual_setup, resolved)
203
197
  return
204
198
 
205
199
  alembic = _alembic_argv(target, host_dir)
206
- _bootstrap_initial_migration(target, host_dir, alembic)
200
+ typer.echo("Creating the database...")
201
+ if not _bootstrap_initial_migration(target, host_dir, alembic):
202
+ _echo_next_steps(target, manual_setup[1:], resolved)
203
+ return
207
204
  # `heads` (plural) applies every per-module branch head; `head` (singular)
208
205
  # errors once a second module ships its own migration branch label.
209
- subprocess.run([*alembic, "upgrade", "heads"], cwd=target, check=False)
210
- typer.echo("\nSetup complete. Run `make dev` in the new directory.")
211
- typer.echo("To run the full stack in containers instead: make docker-up")
206
+ if not _run_quietly([*alembic, "upgrade", "heads"], target):
207
+ # The revision exists now; regenerating it would create a duplicate.
208
+ _echo_next_steps(target, manual_setup[2:], resolved)
209
+ return
210
+ typer.echo("\nSetup complete.")
211
+ _echo_next_steps(target, [], resolved)
212
+
213
+
214
+ def _run_quietly(cmd: list[str], cwd: Path) -> bool:
215
+ """Run a setup step, showing its output only when it fails (GH #917)."""
216
+ try:
217
+ result = subprocess.run(
218
+ cmd, cwd=cwd, check=False, capture_output=True, text=True, errors="replace"
219
+ )
220
+ except OSError as exc: # the executable is missing
221
+ typer.echo(
222
+ f"WARNING: {' '.join(cmd)} could not run ({exc}); finish setup manually.", err=True
223
+ )
224
+ return False
225
+ if result.returncode == 0:
226
+ return True
227
+ typer.echo(f"{result.stdout}{result.stderr}", err=True)
228
+ typer.echo(
229
+ f"WARNING: {' '.join(cmd)} failed (exit {result.returncode}); finish setup manually.",
230
+ err=True,
231
+ )
232
+ return False
233
+
234
+
235
+ def _echo_next_steps(target: Path, setup: list[str], resolved: Sequence[str]) -> None:
236
+ typer.echo("\nNext steps:")
237
+ typer.echo(f" cd {target}")
238
+ for step in [*setup, "make dev"]:
239
+ typer.echo(f" {step}")
240
+ typer.echo(" make docker-up # or run the full stack in containers")
212
241
  if "background_tasks" in resolved:
213
- typer.echo("For background jobs, also run: docker compose up -d redis worker beat")
242
+ typer.echo(" docker compose up -d redis worker beat # background jobs")
214
243
 
215
244
 
216
- def _bootstrap_initial_migration(target: Path, host_dir: Path, alembic: list[str]) -> None:
245
+ def _bootstrap_initial_migration(target: Path, host_dir: Path, alembic: list[str]) -> bool:
217
246
  """Autogenerate the baseline migration if the scaffold ships none.
218
247
 
219
248
  Without a real revision, ``alembic upgrade head`` is a silent no-op
220
249
  against an empty schema — the bundled modules' tables never exist.
221
250
 
222
251
  Runs from ``target`` (the project root) — see :func:`_alembic_argv`.
252
+ Returns False when the autogenerate failed.
223
253
  """
224
254
  versions_dir = host_dir / "migrations" / "versions"
225
255
  if any(p.name != "__init__.py" for p in versions_dir.glob("*.py")):
226
- return
227
- subprocess.run(
228
- [*alembic, "revision", "--autogenerate", "-m", "initial schema"],
229
- cwd=target,
230
- check=False,
231
- )
256
+ return True
257
+ return _run_quietly([*alembic, "revision", "--autogenerate", "-m", "initial schema"], target)
@@ -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
  )
@@ -213,13 +220,14 @@ def create_module(
213
220
  simple_module_python monorepo itself (``make new-module``): it overlays
214
221
  ``_optional/framework_repo/`` (a workspace-sourced ``pyproject.toml`` with
215
222
  the metadata ``scripts/check_metadata.py`` requires, a LICENSE and README
216
- that pass ``check_readmes.py``, and i18n-keyed pages) and implies no
217
- ``.github/``. Wiring into the repo's own pyproject files is
218
- :mod:`simple_module_cli.framework_repo`'s job.
223
+ that pass ``check_readmes.py``) and implies no ``.github/``. Wiring into
224
+ the repo's own pyproject files is :mod:`simple_module_cli.framework_repo`'s job.
219
225
 
220
226
  ``standalone=True`` additionally overlays ``_optional/standalone/`` (npm
221
227
  devDependencies + a tsconfig that resolves ``@simple-module-py/ui`` from the
222
- repo's own ``node_modules``) so the module type-checks outside a workspace.
228
+ repo's own ``node_modules``) so the module type-checks outside a workspace,
229
+ and pages with literal English: the base pages use ``t(keys.<package>.…)``
230
+ (GH #918), and a module repo has no host whose ``gen-i18n`` adds its keys.
223
231
  """
224
232
  dest = Path(dest)
225
233
  existed_before = dest.exists()
@@ -239,6 +247,8 @@ def create_module(
239
247
  "{{SINGULAR}}": singular,
240
248
  "{{SINGULAR_UPPER}}": singular.upper(),
241
249
  "{{SINGULAR_CLASS}}": to_pascal_case(singular),
250
+ "{{CONSTANTS_IMPORTS}}": module_constants_import(package_name.upper()),
251
+ "{{MODEL_CONFIG_TY_IGNORE}}": MODEL_CONFIG_TY_IGNORE if framework_repo else "",
242
252
  # npm-side pin for @simple-module-py/* devDependencies; "*" when the
243
253
  # caller skips pinning (mirrors _should_pin_framework_version).
244
254
  "{{FRAMEWORK_VERSION}}": (
@@ -15,7 +15,7 @@ The `smpy` command is provided by `simple_module_cli` (installed as a dep of `si
15
15
  |---|---|
16
16
  | `smpy new <name>` | Greenfield: scaffold a complete app (host + selected modules) in one shot, with an interactive wizard for DB / tenancy / module preset |
17
17
  | `smpy create-host <name>` | You want just a bare host project; you'll add modules later by `pip install`-ing them |
18
- | `smpy create-module <name>` | You're authoring a publishable module package (separate repo, distributed via PyPI) |
18
+ | `smpy create-module <name>` | You're adding a module to a `smpy new` app (`--dest modules/<name>`), or authoring a publishable module package in its own repo |
19
19
  | `smpy package-update` | Bump every `simple_module_*` / `simple-module-*` dependency, optional extra and dependency group to its latest non-yanked PyPI release, and `@simple-module-py/*` npm pins to the same core version (workspace/path/git/URL sources are left untouched) |
20
20
  | `smpy migrations prepare <upgrade-id> --head <label>@head` | Write the host-side revision for a framework data upgrade that boot or `make doctor` reported (`mail.settings_namespace_v1`, `users.hashed_bearer_tokens_v1`); it never applies it — run your migrate step afterwards |
21
21
  | `smpy doctor` | Run the module diagnostics (`SM0xx`, including `SM033` data-compatibility findings) against this host's database |
@@ -90,13 +90,15 @@ smpy create-host MyApp --dest ./apps/myapp # custom destination
90
90
 
91
91
  ## `smpy create-module <name>` — module package
92
92
 
93
- For module authors publishing to PyPI. Scaffolds a standalone repo containing one module.
93
+ Scaffolds one module package: inside a `smpy new` app, or as a standalone repo to publish to PyPI.
94
94
 
95
95
  ```bash
96
- smpy create-module orders # writes ./simple_module_orders/
97
- smpy create-module orders --dest ./packages/orders
96
+ smpy create-module orders --dest modules/orders # inside an app: a workspace member
97
+ smpy create-module orders # writes ./simple_module_orders/
98
98
  ```
99
99
 
100
+ Inside an app the printed next steps are the app's: `smpy add ../modules/orders --path host` (which syncs the whole workspace), `make install`, `make migration msg="add orders"`, `make migrate`, `make test`, then restart `make dev`. Never run `uv sync` inside the module directory there: it syncs the module alone and uninstalls the rest of the app from the shared venv. Outside an app it prints the standalone flow (`uv sync --extra dev`, `uv run pytest`, `smpy module verify`).
101
+
100
102
  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
103
 
102
104
  `<name>` accepts any case — `orders`, `Orders`, `ORDERS`, `blog_posts` all work. The CLI lowercases it for the directory and PascalCases it for `ModuleMeta.name`.
@@ -193,6 +195,7 @@ smpy settings import-from-env
193
195
  Bootstraps the first admin user, or rotates an existing admin's password.
194
196
 
195
197
  ```bash
198
+ smpy users create-admin -e admin@example.com # prompts for the password
196
199
  smpy users create-admin -e admin@example.com -p hunter2
197
200
  smpy users create-admin -e admin@example.com -p new-password --force # rotate
198
201
  smpy users create-admin -e admin@example.com -p hunter2 --full-name "Admin"
@@ -213,7 +216,8 @@ Don't bake `--password` literals into a script you commit; use a secrets store a
213
216
  - **Ran `smpy new` inside an existing project.** The default `--dest ./<name>` creates a sibling directory. If the directory already exists and is non-empty, the command errors out — pass `--dest` explicitly to disambiguate.
214
217
  - **Ran `smpy host gen-pages` from outside the host directory.** Defaults to `./client_app`; pass `--host-dir` from elsewhere.
215
218
  - **Forgot `smpy host sync-js-deps` after `pip install`-ing a module with pages.** Vite resolves module imports against `client_app/node_modules`; the new module's JS deps won't land until you sync.
216
- - **Used `smpy create-module` to add a module to an existing host.** That command is for **publishable** packages, intended to live in their own repo. To add a module to an existing host: install it (`pip install simple_module_<name>` or add to `pyproject.toml` and `uv sync`), then autogenerate a migration. See **simple-module-creating** + **simple-module-migrations**.
219
+ - **Ran `uv sync` inside a module of a `smpy new` app.** That syncs the module's own project and uninstalls the app's other packages from the shared venv. Run `make install` (`uv sync --all-packages`) at the app root instead; a plain `uv sync` at the root also works, since the root depends on the host.
220
+ - **A module added while `make dev` runs logs "installed but … cannot be imported in this process".** The reload keeps the import path the server started with; restart `make dev`.
217
221
  - **Calling `smpy create-admin` before migrations have run.** The users tables don't exist yet; the command will error. Run `alembic upgrade head` first (or use `smpy new` which does it for you when `--no-install` isn't set).
218
222
  - **Expecting `--with products` (or `keycloak` / `audit_log`) to work on `smpy new`.** Those modules exist in the monorepo but aren't scaffolder-catalog keys, so `smpy new --with products` errors. Either scaffold without them and `pip install simple_module_products` into the host afterward, or use `smpy create-host --with Products` (which doesn't validate against the catalog).
219
223
  - **Port 5050 already taken when starting a scaffolded app.** Set `SM_VITE_DEV_URL` in the project `.env` (e.g. `http://localhost:5310`) — the scaffolded `vite.config.ts` derives the dev server's port and origin from that same value, so it's the only knob to turn.
@@ -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
 
@@ -112,7 +114,7 @@ Locale-related diagnostics: SM013 (missing file), SM014 (missing keys vs default
112
114
 
113
115
  ### 9. Don't re-enable the silenced ty rules
114
116
 
115
- Projects using the `ty` type checker should globally suppress `unresolved-attribute`, `unsupported-operator`, `unknown-argument`, `no-matching-overload`, `invalid-argument-type`, and `invalid-assignment` in `pyproject.toml`. SQLModel runtime-instruments fields as SQLAlchemy attributes, so the type checker can't see what's there (and `model_config = ConfigDict(...)` clashes with ty's internal `SQLModelConfig` type, which `invalid-assignment` covers). Real bugs surface in tests. Line-level suppressions use ty's rule names, `# ty: ignore[<rule>]`; a mypy-style `# type: ignore[arg-type]` silences nothing under ty.
117
+ Projects using `ty` 0.0.100 should globally suppress `missing-attribute`, `missing-union-attribute`, `unsupported-operator`, `unknown-argument`, `no-matching-overload`, `invalid-argument-type`, and `invalid-assignment` in `pyproject.toml`. SQLModel runtime-instruments fields as SQLAlchemy attributes, so the type checker can't see what's there (and `model_config = ConfigDict(...)` clashes with ty's internal `SQLModelConfig` type, which `invalid-assignment` covers). Real bugs surface in tests. Line-level suppressions use ty's rule names, `# ty: ignore[<rule>]`; a mypy-style `# type: ignore[arg-type]` silences nothing under ty.
116
118
 
117
119
  ### 10. Declare external asset origins with `register_csp_sources`
118
120