simple-module-cli 0.0.45__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.
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/PKG-INFO +1 -1
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/pyproject.toml +1 -1
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/_add_install.py +26 -2
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/_lint_tooling.py +2 -3
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/cli.py +33 -20
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/module_cmd.py +2 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/new.py +54 -31
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/scaffolding.py +5 -4
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-cli/SKILL.md +9 -5
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-conventions/SKILL.md +1 -1
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-creating/SKILL.md +8 -2
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/host-flat.Dockerfile +4 -1
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/host.Dockerfile +4 -1
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/Makefile +3 -1
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/pyproject.toml.tpl +2 -1
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/README.md.tpl +7 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/Makefile +3 -1
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/README.md.tpl +4 -2
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/pyproject.toml.tpl +10 -2
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_add_workspace_member.py +35 -5
- simple_module_cli-0.0.46/tests/test_cli_app_install_flow.py +64 -0
- simple_module_cli-0.0.46/tests/test_cli_module_pages_keyed.py +57 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_new_migration_bootstrap.py +3 -2
- simple_module_cli-0.0.46/tests/test_cli_new_quiet_install.py +82 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_new_scaffold_layout.py +2 -1
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_module_cmd_verify.py +2 -2
- simple_module_cli-0.0.46/tests/test_scaffolded_host_admin_overview.py +38 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/.gitignore +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/LICENSE +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/README.md +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/__init__.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/_add_sources.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/_app_project_manifests.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/_env.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/_local_env.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/_module_build.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/_module_host.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/_templating.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/_version_check.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/add_cmd.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/app_project.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/case.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/catalog.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/docker_assets.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/docker_cmd.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/framework_repo.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/git_source.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/git_versions.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/migration_recipes/mail_settings.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/migration_recipes/users_tokens.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/migrations_cmd.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/openapi_cmd.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/openapi_types.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/package_update.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/package_update_deps.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/package_update_npm.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/pins.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/plugins.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/pypi.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/pyproject_edit.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/recipes.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/requirements.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/README.md +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-database/SKILL.md +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-doctor/SKILL.md +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-inertia-pages/SKILL.md +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-locales/SKILL.md +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-migrations/SKILL.md +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/SKILL.md +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/__main__.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_browser.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_crawl.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_report.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_server.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-registries/SKILL.md +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills/simple-module-testing/SKILL.md +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/skills_cmd.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/Makefile.snippet +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/compose-base-postgres.yml.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/compose-base-sqlite.yml.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/compose-tasks-postgres.yml.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/compose-tasks-sqlite.yml.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/compose-worker.yml.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/dockerignore +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/docker/worker.Dockerfile.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/.env.example +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/.gitignore +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/README.md.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/_optional/background_tasks/Makefile.snippet +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/_optional/background_tasks/run_worker.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/alembic.ini +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/app.tsx +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/main.tsx +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/module-assets.ts +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/package.json.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/pages/Error.tsx +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/pages/Landing.tsx +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/pages.ts +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/styles.css +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/tsconfig.json +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/vite.config.ts +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/client_app/vite.dev-url.ts +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/main.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/migrations/env.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/migrations/script.py.mako +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/migrations/versions/.gitkeep +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/routes.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/templates/index.html +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/.github/workflows/ci.yml +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/.github/workflows/publish.yml.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/.gitignore +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/__init__.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/contracts/__init__.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/contracts/schemas.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/core/__init__.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/core/constants.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/core/services.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/core/settings.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/locales/en.json.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/models.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/module.py.tpl +0 -0
- {simple_module_cli-0.0.45/simple_module_cli/templates/module/_optional/framework_repo → simple_module_cli-0.0.46/simple_module_cli/templates/module}/__PACKAGE__/pages/Browse.tsx.tpl +0 -0
- {simple_module_cli-0.0.45/simple_module_cli/templates/module/_optional/framework_repo → simple_module_cli-0.0.46/simple_module_cli/templates/module}/__PACKAGE__/pages/Create.tsx.tpl +0 -0
- {simple_module_cli-0.0.45/simple_module_cli/templates/module/_optional/framework_repo → simple_module_cli-0.0.46/simple_module_cli/templates/module}/__PACKAGE__/pages/Edit.tsx.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/pages/api.generated.ts.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/pages/api.ts.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/py.typed +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/__init__.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/deps.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/__init__.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/api.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/views.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/__PACKAGE__/web/service.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/_optional/framework_repo/LICENSE +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/_optional/framework_repo/README.md.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/_optional/framework_repo/pyproject.toml.tpl +0 -0
- {simple_module_cli-0.0.45/simple_module_cli/templates/module → simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone}/__PACKAGE__/pages/Browse.tsx.tpl +0 -0
- {simple_module_cli-0.0.45/simple_module_cli/templates/module → simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone}/__PACKAGE__/pages/Create.tsx.tpl +0 -0
- {simple_module_cli-0.0.45/simple_module_cli/templates/module → simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone}/__PACKAGE__/pages/Edit.tsx.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/_optional/standalone/package.json.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/_optional/standalone/tsconfig.json.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/package.json.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/pyproject.toml.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/tests/conftest.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/tests/core/contracts/test___PACKAGE___schemas.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/tests/core/module/test___PACKAGE___module.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/tests/web/crud/test___PACKAGE___crud.py.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/module/tsconfig.json.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/.env.example +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/.gitignore +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/workspace/package.json.tpl +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/update_cmd.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/uv_workspace.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/wizard.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/conftest.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_build_packaging.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_case.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_add_cmd.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_add_spec_parse.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_alembic_ini.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_asset_prerequisites.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_catalog.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_catalog_depends_on.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_docker_assets.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_docker_persistence_secrets.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_docker_workers.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_gen_types_scaffold.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_git_scan.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_new.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_new_dest_tolerance.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_new_git_module.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_new_regressions.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_openapi_export.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_openapi_gen_types.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_package_update.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_package_update_groups.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_package_update_npm.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_package_update_pins.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_package_update_release_order.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_package_update_workspace_excludes.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_prepare_data_migrations.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_prepare_data_postgres.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_pyproject_edit.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_recipes.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_scaffold_vite8.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_skill_links.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_skill_page_audit.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_update_release_policy.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_update_sources.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_version_check.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_vite_port_env.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_wizard.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_wizard_git.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_create_module_ci_skip.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_env_helper.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_framework_repo_wiring.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_module_cmd_build.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_module_cmd_e2e.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_module_css_assets.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_module_css_build.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_module_css_subdir_sources.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_module_npm_aliases.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_module_pages_manifest.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_no_framework_deps.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_plugin_discovery.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_scaffold_app_tsx_spa_links.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_scaffold_lint_tooling.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_scaffold_rollback.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_scaffolded_host_setup_wizard.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_scaffolding_area_layout.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_scaffolding_framework_repo.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_scaffolding_host.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_scaffolding_module.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_scaffolding_module_js.py +0 -0
- {simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_skills_cmd.py +0 -0
- {simple_module_cli-0.0.45 → 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.
|
|
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
|
|
@@ -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
|
-
|
|
44
|
-
|
|
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)
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
# ty is pre-1.0 and renames rules between releases
|
|
6
|
-
# ``unresolved-attribute``, which the scaffold's ``[tool.ty.rules]`` names), so
|
|
5
|
+
# ty is pre-1.0 and renames rules between releases, so
|
|
7
6
|
# new apps get the range this repo is tested on, not the newest ty.
|
|
8
7
|
# ``test_scaffold_lint_tooling.py`` fails once ``uv.lock`` moves past it.
|
|
9
|
-
TY_REQUIREMENT = "ty>=0.0.
|
|
8
|
+
TY_REQUIREMENT = "ty>=0.0.100,<0.0.101"
|
|
10
9
|
|
|
11
10
|
# Apps turn ty's ``invalid-assignment`` off, so this ignore would be reported as
|
|
12
11
|
# unused there; only a module inside the framework repo, which checks the rule,
|
|
@@ -126,25 +126,35 @@ def create_host(
|
|
|
126
126
|
typer.echo(" python main.py")
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
def
|
|
130
|
-
"""
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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,6 +4,7 @@ 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
|
|
@@ -174,61 +175,83 @@ def new_project(
|
|
|
174
175
|
rel = path.relative_to(target) if path.is_relative_to(target) else path
|
|
175
176
|
typer.echo(f" {rel}")
|
|
176
177
|
typer.echo("\nGenerated secrets were written to .env (gitignored), not .env.example.")
|
|
177
|
-
|
|
178
|
-
typer.echo(f" cd {target}")
|
|
178
|
+
manual_setup = ["make install", 'make migration msg="initial schema"', "make migrate"]
|
|
179
179
|
if no_install:
|
|
180
|
-
|
|
181
|
-
typer.echo(" npm install")
|
|
182
|
-
typer.echo(' make migration msg="initial schema"')
|
|
183
|
-
typer.echo(" make migrate")
|
|
184
|
-
typer.echo(" make dev")
|
|
185
|
-
typer.echo(" make docker-up # or run the full stack in containers")
|
|
186
|
-
if "background_tasks" in resolved:
|
|
187
|
-
typer.echo(" docker compose up -d redis worker beat # background jobs")
|
|
180
|
+
_echo_next_steps(target, manual_setup, resolved)
|
|
188
181
|
return
|
|
189
182
|
|
|
190
|
-
typer.echo("
|
|
191
|
-
|
|
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"]):
|
|
192
187
|
if shutil.which(cmd[0]) is None:
|
|
193
188
|
typer.echo(
|
|
194
189
|
f"WARNING: '{cmd[0]}' not found on PATH; skipping `{' '.join(cmd)}`. "
|
|
195
190
|
"Install it and finish setup manually.",
|
|
196
191
|
err=True,
|
|
197
192
|
)
|
|
193
|
+
_echo_next_steps(target, manual_setup, resolved)
|
|
198
194
|
return
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
typer.echo(
|
|
202
|
-
f"WARNING: {' '.join(cmd)} failed (exit {result.returncode}); "
|
|
203
|
-
"finish setup manually.",
|
|
204
|
-
err=True,
|
|
205
|
-
)
|
|
195
|
+
if not _run_quietly(cmd, target):
|
|
196
|
+
_echo_next_steps(target, manual_setup, resolved)
|
|
206
197
|
return
|
|
207
198
|
|
|
208
199
|
alembic = _alembic_argv(target, host_dir)
|
|
209
|
-
|
|
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
|
|
210
204
|
# `heads` (plural) applies every per-module branch head; `head` (singular)
|
|
211
205
|
# errors once a second module ships its own migration branch label.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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")
|
|
215
241
|
if "background_tasks" in resolved:
|
|
216
|
-
typer.echo("
|
|
242
|
+
typer.echo(" docker compose up -d redis worker beat # background jobs")
|
|
217
243
|
|
|
218
244
|
|
|
219
|
-
def _bootstrap_initial_migration(target: Path, host_dir: Path, alembic: list[str]) ->
|
|
245
|
+
def _bootstrap_initial_migration(target: Path, host_dir: Path, alembic: list[str]) -> bool:
|
|
220
246
|
"""Autogenerate the baseline migration if the scaffold ships none.
|
|
221
247
|
|
|
222
248
|
Without a real revision, ``alembic upgrade head`` is a silent no-op
|
|
223
249
|
against an empty schema — the bundled modules' tables never exist.
|
|
224
250
|
|
|
225
251
|
Runs from ``target`` (the project root) — see :func:`_alembic_argv`.
|
|
252
|
+
Returns False when the autogenerate failed.
|
|
226
253
|
"""
|
|
227
254
|
versions_dir = host_dir / "migrations" / "versions"
|
|
228
255
|
if any(p.name != "__init__.py" for p in versions_dir.glob("*.py")):
|
|
229
|
-
return
|
|
230
|
-
|
|
231
|
-
[*alembic, "revision", "--autogenerate", "-m", "initial schema"],
|
|
232
|
-
cwd=target,
|
|
233
|
-
check=False,
|
|
234
|
-
)
|
|
256
|
+
return True
|
|
257
|
+
return _run_quietly([*alembic, "revision", "--autogenerate", "-m", "initial schema"], target)
|
|
@@ -220,13 +220,14 @@ def create_module(
|
|
|
220
220
|
simple_module_python monorepo itself (``make new-module``): it overlays
|
|
221
221
|
``_optional/framework_repo/`` (a workspace-sourced ``pyproject.toml`` with
|
|
222
222
|
the metadata ``scripts/check_metadata.py`` requires, a LICENSE and README
|
|
223
|
-
that pass ``check_readmes.py
|
|
224
|
-
|
|
225
|
-
: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.
|
|
226
225
|
|
|
227
226
|
``standalone=True`` additionally overlays ``_optional/standalone/`` (npm
|
|
228
227
|
devDependencies + a tsconfig that resolves ``@simple-module-py/ui`` from the
|
|
229
|
-
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.
|
|
230
231
|
"""
|
|
231
232
|
dest = Path(dest)
|
|
232
233
|
existed_before = dest.exists()
|
|
@@ -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
|
|
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
|
-
|
|
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
|
|
97
|
-
smpy create-module 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
|
-
- **
|
|
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.
|
|
@@ -114,7 +114,7 @@ Locale-related diagnostics: SM013 (missing file), SM014 (missing keys vs default
|
|
|
114
114
|
|
|
115
115
|
### 9. Don't re-enable the silenced ty rules
|
|
116
116
|
|
|
117
|
-
Projects using
|
|
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.
|
|
118
118
|
|
|
119
119
|
### 10. Declare external asset origins with `register_csp_sources`
|
|
120
120
|
|
|
@@ -27,11 +27,17 @@ make migrate
|
|
|
27
27
|
same `create_module` as `smpy create-module`, so both produce the same tree
|
|
28
28
|
below (permissions, menu item with `label_key`, `core/constants.py`, CRUD sample,
|
|
29
29
|
`locales/en.json`); the in-repo variant adds workspace-sourced `pyproject.toml`
|
|
30
|
-
metadata
|
|
30
|
+
metadata and a `LICENSE`. The pages read their text from `locales/en.json`
|
|
31
|
+
through `t(keys.<module>.…)`; the host's `make gen-i18n` (also run by
|
|
32
|
+
`make install` and each dev boot) adds the module to `keys`. A `--standalone`
|
|
33
|
+
module repo gets pages with literal English instead, since it has no host to
|
|
34
|
+
generate `keys`. For a **standalone publishable
|
|
31
35
|
package** (its own repo, with CI + PyPI `publish.yml`), use
|
|
32
36
|
`smpy create-module orders`; pass `--standalone` to force the `.github/`
|
|
33
37
|
workflows, then `uv sync` (or `pip install -e ./orders`) to install it into the
|
|
34
|
-
host.
|
|
38
|
+
host. Inside a `smpy new` app, `smpy create-module orders --dest modules/orders`
|
|
39
|
+
makes a workspace member and prints the app's steps (`smpy add … --path host`,
|
|
40
|
+
`make install`, `make migration`); don't run `uv sync` inside the module there.
|
|
35
41
|
|
|
36
42
|
## What scaffolding produces
|
|
37
43
|
|
|
@@ -32,8 +32,11 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|
|
32
32
|
# Flat mode keeps the frontend's own package.json under client_app/.
|
|
33
33
|
RUN cd client_app && if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
|
34
34
|
|
|
35
|
-
# Page manifest + generated module imports,
|
|
35
|
+
# Page manifest + generated module imports, the app's i18n keys (module pages
|
|
36
|
+
# read `keys.<module>`, which the published @simple-module-py/i18n lacks), then
|
|
37
|
+
# the production bundle.
|
|
36
38
|
RUN uv run python -m simple_module_hosting gen-pages --host-dir=client_app
|
|
39
|
+
RUN uv run python -m simple_module_hosting gen-i18n
|
|
37
40
|
RUN cd client_app && npm run build
|
|
38
41
|
|
|
39
42
|
# node_modules never ships in the runtime image.
|
|
@@ -36,8 +36,11 @@ COPY . .
|
|
|
36
36
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
37
37
|
uv sync --all-packages --no-dev
|
|
38
38
|
|
|
39
|
-
# Page manifest + generated module imports,
|
|
39
|
+
# Page manifest + generated module imports, the app's i18n keys (module pages
|
|
40
|
+
# read `keys.<module>`, which the published @simple-module-py/i18n lacks), then
|
|
41
|
+
# the production bundle.
|
|
40
42
|
RUN cd host && uv run python -m simple_module_hosting gen-pages --host-dir=client_app
|
|
43
|
+
RUN cd host && uv run python -m simple_module_hosting gen-i18n
|
|
41
44
|
RUN npm run build
|
|
42
45
|
|
|
43
46
|
# Re-sync so hatch force-include picks up freshly built module static/dist.
|
{simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/simple_module_cli/templates/host/Makefile
RENAMED
|
@@ -23,7 +23,9 @@ dev-api:
|
|
|
23
23
|
dev-ui:
|
|
24
24
|
cd client_app && npm run dev
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
# Module pages read `keys.<module>` (gen-i18n); a bundle built without them
|
|
27
|
+
# crashes those pages at runtime, and tsc does not catch it.
|
|
28
|
+
build: gen-pages gen-i18n
|
|
27
29
|
cd client_app && npm run build
|
|
28
30
|
|
|
29
31
|
# Testing
|
|
@@ -49,7 +49,8 @@ ignore = [
|
|
|
49
49
|
# see through this, so ORM query expressions trip these rules with false
|
|
50
50
|
# positives — real bugs still surface in tests.
|
|
51
51
|
[tool.ty.rules]
|
|
52
|
-
|
|
52
|
+
missing-attribute = "ignore"
|
|
53
|
+
missing-union-attribute = "ignore"
|
|
53
54
|
unsupported-operator = "ignore"
|
|
54
55
|
unknown-argument = "ignore"
|
|
55
56
|
no-matching-overload = "ignore"
|
|
@@ -20,6 +20,13 @@ uv run pytest
|
|
|
20
20
|
|
|
21
21
|
## Frontend assets (optional)
|
|
22
22
|
|
|
23
|
+
The pages read their text from `{{PACKAGE_NAME}}/locales/en.json`. Inside an
|
|
24
|
+
app they use `t(keys.{{PACKAGE_NAME}}.…)`; the host's `make gen-i18n` (also run
|
|
25
|
+
by `make install`, `make build` and each dev boot) adds this module to `keys`.
|
|
26
|
+
A standalone module repo has no host to generate them, so its scaffolded pages
|
|
27
|
+
use literal English: once the module is installed in an app, switch a string
|
|
28
|
+
to `t(keys.{{PACKAGE_NAME}}.browse.title)` and the like.
|
|
29
|
+
|
|
23
30
|
If this module ships TSX pages:
|
|
24
31
|
|
|
25
32
|
1. Drop them in `{{PACKAGE_NAME}}/pages/` (the scaffold created the
|
|
@@ -67,8 +67,10 @@ make migration msg="add my-feature" && make migrate
|
|
|
67
67
|
## How the workspace fits together
|
|
68
68
|
|
|
69
69
|
- **uv workspace** (`pyproject.toml` here): members are `host` and every
|
|
70
|
-
directory under `modules/*`. `uv sync --all-packages`
|
|
71
|
-
in editable mode
|
|
70
|
+
directory under `modules/*`. `make install` (`uv sync --all-packages`)
|
|
71
|
+
installs them all in editable mode in one venv. The root depends on the
|
|
72
|
+
host, so a plain `uv sync` here installs the app too; never run `uv sync`
|
|
73
|
+
inside a module directory, which syncs that module alone.
|
|
72
74
|
- **npm workspace** (`package.json` here): `host/client_app` and every
|
|
73
75
|
module's frontend assets share one hoisted `node_modules`. Vite walks
|
|
74
76
|
up from each `.tsx` file and finds React, Inertia, and shared UI
|
|
@@ -3,12 +3,19 @@ name = "{{HOST_PYPI_NAME}}"
|
|
|
3
3
|
version = "0.1.0"
|
|
4
4
|
description = "SimpleModule application workspace root"
|
|
5
5
|
requires-python = ">=3.12"
|
|
6
|
-
|
|
6
|
+
# The app itself, so a plain `uv sync` here installs the host's dependencies
|
|
7
|
+
# (every module wired into it) instead of uninstalling them (GH #916). The host
|
|
8
|
+
# is `package = false`, so it is not installed itself. `make install` also
|
|
9
|
+
# syncs the members the host does not list yet.
|
|
10
|
+
dependencies = ["{{HOST_PYPI_NAME}}-host"]
|
|
7
11
|
|
|
8
12
|
# Workspace root: not built or installed itself.
|
|
9
13
|
[tool.uv]
|
|
10
14
|
package = false
|
|
11
15
|
|
|
16
|
+
[tool.uv.sources]
|
|
17
|
+
{{HOST_PYPI_NAME}}-host = { workspace = true }
|
|
18
|
+
|
|
12
19
|
# uv workspace — `host/` is the application; modules/* are workspace
|
|
13
20
|
# members so you can iterate on them without publishing to PyPI. Add a
|
|
14
21
|
# `[tool.uv.sources]` entry in host/pyproject.toml for each in-repo
|
|
@@ -56,7 +63,8 @@ ignore = [
|
|
|
56
63
|
# see through this, so ORM query expressions trip these rules with false
|
|
57
64
|
# positives — real bugs still surface in tests.
|
|
58
65
|
[tool.ty.rules]
|
|
59
|
-
|
|
66
|
+
missing-attribute = "ignore"
|
|
67
|
+
missing-union-attribute = "ignore"
|
|
60
68
|
unsupported-operator = "ignore"
|
|
61
69
|
unknown-argument = "ignore"
|
|
62
70
|
no-matching-overload = "ignore"
|
{simple_module_cli-0.0.45 → simple_module_cli-0.0.46}/tests/test_cli_add_workspace_member.py
RENAMED
|
@@ -7,8 +7,9 @@ from pathlib import Path
|
|
|
7
7
|
|
|
8
8
|
import pytest
|
|
9
9
|
import typer
|
|
10
|
+
from simple_module_cli._add_install import _sync_command
|
|
10
11
|
from simple_module_cli.add_cmd import run_add
|
|
11
|
-
from simple_module_cli.cli import
|
|
12
|
+
from simple_module_cli.cli import _app_add_command
|
|
12
13
|
from simple_module_cli.git_source import parse_add_spec
|
|
13
14
|
from simple_module_cli.uv_workspace import is_workspace_member
|
|
14
15
|
|
|
@@ -92,7 +93,7 @@ def test_missing_path_error_names_the_resolution_base(
|
|
|
92
93
|
|
|
93
94
|
|
|
94
95
|
def test_workspace_hint_inside_host_dir_prints_a_path_spec(
|
|
95
|
-
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
96
|
+
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
96
97
|
) -> None:
|
|
97
98
|
# GH #471: a bare "modules/x" would be parsed by `smpy add` as a PyPI requirement.
|
|
98
99
|
(tmp_path / "pyproject.toml").write_text(
|
|
@@ -104,9 +105,38 @@ def test_workspace_hint_inside_host_dir_prints_a_path_spec(
|
|
|
104
105
|
_write_module(module)
|
|
105
106
|
monkeypatch.chdir(tmp_path)
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
command = _app_add_command(module)
|
|
108
109
|
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
assert command is not None
|
|
111
|
+
assert command.endswith("--path host") # printed for the app root
|
|
112
|
+
spec = command.split("smpy add ", 1)[1].split(" --path", 1)[0]
|
|
111
113
|
assert spec == "./modules/forest_plots"
|
|
112
114
|
assert parse_add_spec(spec).kind == "path"
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def test_add_inside_an_app_workspace_syncs_the_whole_workspace(workspace: Path) -> None:
|
|
118
|
+
"""GH #916: `uv sync` from host/ would uninstall the root's dev tools and other members."""
|
|
119
|
+
_write_module(workspace / "modules" / "forest_plots")
|
|
120
|
+
calls: list[tuple[list[str], Path]] = []
|
|
121
|
+
|
|
122
|
+
def runner(cmd: list[str], cwd: Path) -> int:
|
|
123
|
+
calls.append((cmd, cwd))
|
|
124
|
+
return 0
|
|
125
|
+
|
|
126
|
+
run_add(
|
|
127
|
+
"../modules/forest_plots",
|
|
128
|
+
pyproject=workspace / "host" / "pyproject.toml",
|
|
129
|
+
exec_runner=runner,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
assert calls[0] == (["uv", "sync", "--all-packages"], workspace.resolve())
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def test_add_in_a_project_outside_the_workspace_members_syncs_it_alone(tmp_path: Path) -> None:
|
|
136
|
+
"""A flat app nested under an unrelated workspace must not sync that workspace."""
|
|
137
|
+
(tmp_path / "pyproject.toml").write_text(WORKSPACE, encoding="utf-8")
|
|
138
|
+
app_dir = tmp_path / "elsewhere" / "app"
|
|
139
|
+
app_dir.mkdir(parents=True)
|
|
140
|
+
(app_dir / "pyproject.toml").write_text(HOST, encoding="utf-8")
|
|
141
|
+
|
|
142
|
+
assert _sync_command(app_dir) == (["uv", "sync"], app_dir)
|