simple-module-cli 0.0.46__tar.gz → 0.0.48__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.46 → simple_module_cli-0.0.48}/.gitignore +6 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/PKG-INFO +16 -10
- simple_module_cli-0.0.48/README.md +43 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/pyproject.toml +6 -1
- simple_module_cli-0.0.48/simple_module_cli/_add_install.py +130 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/_app_project_manifests.py +1 -0
- simple_module_cli-0.0.48/simple_module_cli/_generation_cache.py +63 -0
- simple_module_cli-0.0.48/simple_module_cli/_lint_tooling.py +13 -0
- simple_module_cli-0.0.48/simple_module_cli/_migration_support.py +67 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/_module_build.py +1 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/_module_host.py +22 -0
- simple_module_cli-0.0.48/simple_module_cli/_project_cli_check.py +84 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/add_cmd.py +5 -3
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/app_project.py +0 -8
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/cli.py +47 -29
- simple_module_cli-0.0.48/simple_module_cli/dev_cmd.py +174 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/docker_assets.py +3 -6
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/docker_cmd.py +86 -20
- simple_module_cli-0.0.48/simple_module_cli/gen_cmd.py +213 -0
- simple_module_cli-0.0.48/simple_module_cli/migration_recipes/__init__.py +11 -0
- simple_module_cli-0.0.48/simple_module_cli/migrations_cmd.py +162 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/module_cmd.py +4 -4
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/new.py +37 -9
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/openapi_cmd.py +6 -8
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/openapi_types.py +8 -3
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/package_update.py +90 -44
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/package_update_deps.py +15 -5
- simple_module_cli-0.0.48/simple_module_cli/package_update_git.py +84 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/package_update_npm.py +12 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/pins.py +34 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/recipes.py +4 -4
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/scaffolding.py +53 -59
- simple_module_cli-0.0.48/simple_module_cli/skills/simple-module-cli/SKILL.md +262 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-conventions/SKILL.md +26 -10
- simple_module_cli-0.0.48/simple_module_cli/skills/simple-module-creating/SKILL.md +205 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-doctor/SKILL.md +7 -7
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-inertia-pages/SKILL.md +42 -7
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-locales/SKILL.md +11 -16
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-migrations/SKILL.md +51 -22
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-page-perf/SKILL.md +1 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_server.py +1 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-registries/SKILL.md +98 -18
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-testing/SKILL.md +9 -3
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/docker/compose-tasks-postgres.yml.tpl +4 -4
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/docker/compose-tasks-sqlite.yml.tpl +4 -4
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/docker/host-flat.Dockerfile +1 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/docker/host.Dockerfile +1 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/.env.example +7 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/.gitignore +8 -0
- simple_module_cli-0.0.48/simple_module_cli/templates/host/Makefile +72 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/README.md.tpl +1 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/_optional/background_tasks/Makefile.snippet +1 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/client_app/app.tsx +12 -1
- simple_module_cli-0.0.48/simple_module_cli/templates/host/client_app/module-assets.ts +3 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/client_app/package.json.tpl +2 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/client_app/pages/Landing.tsx +3 -3
- simple_module_cli-0.0.48/simple_module_cli/templates/host/client_app/vite.config.ts +29 -0
- simple_module_cli-0.0.48/simple_module_cli/templates/host/client_app/vite.dev-url.ts +11 -0
- simple_module_cli-0.0.48/simple_module_cli/templates/host/client_app/vite.i18n.ts +2 -0
- simple_module_cli-0.0.48/simple_module_cli/templates/host/main.py +10 -0
- simple_module_cli-0.0.48/simple_module_cli/templates/host/migrations/env.py +6 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/pyproject.toml.tpl +3 -3
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/.github/workflows/ci.yml +0 -8
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/.gitignore +1 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/README.md.tpl +13 -20
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/core/constants.py.tpl +9 -11
- simple_module_cli-0.0.48/simple_module_cli/templates/module/__PACKAGE__/module.py.tpl +62 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/pages/Browse.tsx.tpl +3 -3
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/pages/Create.tsx.tpl +2 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/pages/Edit.tsx.tpl +2 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/pages/api.generated.ts.tpl +4 -0
- simple_module_cli-0.0.48/simple_module_cli/templates/module/__PACKAGE__/pages/i18n.generated.ts.tpl +56 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/api.py.tpl +6 -9
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/views.py.tpl +9 -14
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/_optional/framework_repo/README.md.tpl +4 -3
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/_optional/framework_repo/pyproject.toml.tpl +0 -5
- simple_module_cli-0.0.48/simple_module_cli/templates/module/_optional/settings-hook.py.tpl +13 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/pyproject.toml.tpl +3 -11
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/workspace/.env.example +7 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/workspace/.gitignore +7 -0
- simple_module_cli-0.0.48/simple_module_cli/templates/workspace/Makefile +86 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/workspace/pyproject.toml.tpl +3 -0
- simple_module_cli-0.0.48/simple_module_cli/update_cmd.py +64 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/conftest.py +2 -3
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_build_packaging.py +7 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_add_cmd.py +43 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_add_workspace_member.py +26 -16
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_app_install_flow.py +23 -6
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_docker_assets.py +9 -6
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_docker_workers.py +116 -4
- simple_module_cli-0.0.48/tests/test_cli_migrations_new.py +119 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_module_pages_keyed.py +1 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_new.py +5 -8
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_new_migration_bootstrap.py +3 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_new_quiet_install.py +47 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_new_regressions.py +1 -5
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_new_scaffold_layout.py +69 -16
- simple_module_cli-0.0.48/tests/test_cli_openapi_export.py +75 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_openapi_gen_types.py +6 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_package_update_npm.py +2 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_prepare_data_migrations.py +58 -3
- simple_module_cli-0.0.48/tests/test_cli_prepare_validation.py +86 -0
- simple_module_cli-0.0.48/tests/test_cli_project_cli_check.py +108 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_recipes.py +3 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_scaffold_vite8.py +3 -1
- simple_module_cli-0.0.48/tests/test_cli_unified_update.py +284 -0
- simple_module_cli-0.0.48/tests/test_cli_update_cohort.py +78 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_update_release_policy.py +2 -2
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_update_sources.py +31 -5
- simple_module_cli-0.0.48/tests/test_cli_vite_port_env.py +73 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_create_module_ci_skip.py +3 -1
- simple_module_cli-0.0.48/tests/test_dev.py +261 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_framework_repo_wiring.py +19 -2
- simple_module_cli-0.0.48/tests/test_generation.py +231 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_module_cmd_build.py +35 -1
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_module_cmd_e2e.py +1 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_module_cmd_verify.py +29 -4
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_module_css_build.py +72 -83
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_module_npm_aliases.py +5 -5
- simple_module_cli-0.0.48/tests/test_module_optional_js_packaging.py +38 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_no_framework_deps.py +10 -2
- simple_module_cli-0.0.48/tests/test_portable_i18n.py +125 -0
- simple_module_cli-0.0.48/tests/test_scaffold_host_import.py +41 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_scaffold_lint_tooling.py +1 -1
- simple_module_cli-0.0.48/tests/test_scaffold_module_defaults.py +45 -0
- simple_module_cli-0.0.48/tests/test_scaffold_optional_settings.py +92 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_scaffolded_host_setup_wizard.py +1 -3
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_scaffolding_area_layout.py +1 -4
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_scaffolding_framework_repo.py +8 -13
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_scaffolding_host.py +11 -123
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_scaffolding_module.py +1 -8
- simple_module_cli-0.0.48/tests/test_scaffolding_module_js.py +87 -0
- simple_module_cli-0.0.48/tests/test_vite_plugin_package.py +39 -0
- simple_module_cli-0.0.46/README.md +0 -38
- simple_module_cli-0.0.46/simple_module_cli/_add_install.py +0 -83
- simple_module_cli-0.0.46/simple_module_cli/_lint_tooling.py +0 -36
- simple_module_cli-0.0.46/simple_module_cli/migrations_cmd.py +0 -66
- simple_module_cli-0.0.46/simple_module_cli/skills/simple-module-cli/SKILL.md +0 -230
- simple_module_cli-0.0.46/simple_module_cli/skills/simple-module-creating/SKILL.md +0 -149
- simple_module_cli-0.0.46/simple_module_cli/templates/host/Makefile +0 -76
- simple_module_cli-0.0.46/simple_module_cli/templates/host/client_app/module-assets.ts +0 -129
- simple_module_cli-0.0.46/simple_module_cli/templates/host/client_app/vite.config.ts +0 -218
- simple_module_cli-0.0.46/simple_module_cli/templates/host/client_app/vite.dev-url.ts +0 -92
- simple_module_cli-0.0.46/simple_module_cli/templates/host/main.py +0 -62
- simple_module_cli-0.0.46/simple_module_cli/templates/host/migrations/env.py +0 -114
- simple_module_cli-0.0.46/simple_module_cli/templates/module/__PACKAGE__/module.py.tpl +0 -92
- simple_module_cli-0.0.46/simple_module_cli/templates/module/__PACKAGE__/pages/api.ts.tpl +0 -10
- simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone/__PACKAGE__/pages/Browse.tsx.tpl +0 -60
- simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone/__PACKAGE__/pages/Create.tsx.tpl +0 -46
- simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone/__PACKAGE__/pages/Edit.tsx.tpl +0 -49
- simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone/package.json.tpl +0 -29
- simple_module_cli-0.0.46/simple_module_cli/templates/module/_optional/standalone/tsconfig.json.tpl +0 -10
- simple_module_cli-0.0.46/simple_module_cli/templates/module/package.json.tpl +0 -16
- simple_module_cli-0.0.46/simple_module_cli/templates/module/tsconfig.json.tpl +0 -10
- simple_module_cli-0.0.46/simple_module_cli/templates/workspace/Makefile +0 -89
- simple_module_cli-0.0.46/simple_module_cli/update_cmd.py +0 -138
- simple_module_cli-0.0.46/tests/test_cli_openapi_export.py +0 -32
- simple_module_cli-0.0.46/tests/test_cli_vite_port_env.py +0 -48
- simple_module_cli-0.0.46/tests/test_scaffolding_module_js.py +0 -158
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/LICENSE +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/__init__.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/_add_sources.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/_env.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/_local_env.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/_templating.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/_version_check.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/case.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/catalog.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/framework_repo.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/git_source.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/git_versions.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/migration_recipes/mail_settings.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/migration_recipes/users_tokens.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/plugins.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/pypi.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/pyproject_edit.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/requirements.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/README.md +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-database/SKILL.md +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/__main__.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_browser.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_crawl.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills/simple-module-page-perf/scripts/page_audit/audit_report.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/skills_cmd.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/docker/Makefile.snippet +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/docker/compose-base-postgres.yml.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/docker/compose-base-sqlite.yml.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/docker/compose-worker.yml.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/docker/dockerignore +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/docker/worker.Dockerfile.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/_optional/background_tasks/run_worker.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/alembic.ini +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/client_app/main.tsx +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/client_app/pages/Error.tsx +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/client_app/pages.ts +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/client_app/styles.css +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/client_app/tsconfig.json +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/migrations/script.py.mako +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/migrations/versions/.gitkeep +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/routes.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/host/templates/index.html +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/.github/workflows/publish.yml.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/__init__.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/contracts/__init__.py.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/contracts/schemas.py.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/core/__init__.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/locales/en.json.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/models.py.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/py.typed +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/web/__init__.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/web/deps.py.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/web/endpoints/__init__.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/__PACKAGE__/web/service.py.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/_optional/framework_repo/LICENSE +0 -0
- {simple_module_cli-0.0.46/simple_module_cli/templates/module → simple_module_cli-0.0.48/simple_module_cli/templates/module/_optional/settings}/__PACKAGE__/core/services.py.tpl +0 -0
- {simple_module_cli-0.0.46/simple_module_cli/templates/module → simple_module_cli-0.0.48/simple_module_cli/templates/module/_optional/settings}/__PACKAGE__/core/settings.py.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/tests/conftest.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/tests/core/contracts/test___PACKAGE___schemas.py.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/tests/core/module/test___PACKAGE___module.py.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/module/tests/web/crud/test___PACKAGE___crud.py.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/workspace/README.md.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/templates/workspace/package.json.tpl +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/uv_workspace.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/wizard.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_case.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_add_spec_parse.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_alembic_ini.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_asset_prerequisites.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_catalog.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_catalog_depends_on.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_docker_persistence_secrets.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_gen_types_scaffold.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_git_scan.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_new_dest_tolerance.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_new_git_module.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_package_update.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_package_update_groups.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_package_update_pins.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_package_update_release_order.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_package_update_workspace_excludes.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_prepare_data_postgres.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_pyproject_edit.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_skill_links.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_skill_page_audit.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_version_check.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_wizard.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_cli_wizard_git.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_env_helper.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_module_css_assets.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_module_css_subdir_sources.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_module_pages_manifest.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_plugin_discovery.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_scaffold_app_tsx_spa_links.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_scaffold_rollback.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_scaffolded_host_admin_overview.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/tests/test_skills_cmd.py +0 -0
- {simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/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.48
|
|
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
|
|
@@ -20,6 +20,7 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
|
20
20
|
Classifier: Typing :: Typed
|
|
21
21
|
Requires-Python: >=3.12
|
|
22
22
|
Requires-Dist: packaging<27,>=23.0
|
|
23
|
+
Requires-Dist: pyyaml<7,>=6.0
|
|
23
24
|
Requires-Dist: tomlkit<0.16,>=0.13
|
|
24
25
|
Requires-Dist: typer<0.28,>=0.12
|
|
25
26
|
Description-Content-Type: text/markdown
|
|
@@ -38,26 +39,31 @@ pipx install simple_module_cli
|
|
|
38
39
|
uvx --from simple_module_cli@latest smpy new my-app
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
The
|
|
42
|
+
The standalone CLI depends on `typer`, `tomlkit`, `packaging`, and `PyYAML`. The Docker worker command uses PyYAML to validate Compose environment entries while preserving the original formatting.
|
|
42
43
|
|
|
43
44
|
## Usage
|
|
44
45
|
|
|
45
46
|
```bash
|
|
46
|
-
smpy new my-app # interactive wizard
|
|
47
|
-
smpy new my-app --yes --preset full # all built-in modules + background jobs
|
|
48
|
-
smpy create-module my_feature # scaffold a publishable module package
|
|
49
|
-
smpy create-host bare-host # scaffold a bare host (no opinionated wiring)
|
|
47
|
+
uv run smpy new my-app # interactive wizard
|
|
48
|
+
uv run smpy new my-app --yes --preset full # all built-in modules + background jobs
|
|
49
|
+
uv run smpy create-module my_feature # scaffold a publishable module package
|
|
50
|
+
uv run smpy create-host bare-host # scaffold a bare host (no opinionated wiring)
|
|
50
51
|
```
|
|
51
52
|
|
|
52
|
-
Built-in commands: `smpy new`, `smpy create-host`, `smpy create-module`, `smpy
|
|
53
|
+
Built-in commands: `uv run smpy new`, `uv run smpy create-host`, `uv run smpy create-module`, `uv run smpy update`, and `uv run smpy skills {list,add,update}`.
|
|
54
|
+
|
|
55
|
+
`uv run smpy update` handles PyPI and git pins, syncs lockfiles and generates the
|
|
56
|
+
frontend. `package-update` remains a deprecated alias until 0.0.50. Creating a
|
|
57
|
+
module inside an app workspace also wires and installs it; then use
|
|
58
|
+
`uv run smpy migrations new <module> -m "init"`, review, `make migrate` and restart.
|
|
53
59
|
|
|
54
60
|
When other framework packages are installed, they contribute additional subcommands via the `simple_module_cli.cli_plugins` entry-point group:
|
|
55
61
|
|
|
56
62
|
| Package | Commands |
|
|
57
63
|
|---|---|
|
|
58
|
-
| `simple_module_hosting` | `smpy host gen-pages`, `smpy host sync-js-deps` |
|
|
59
|
-
| `simple_module_users` | `smpy users create-admin` |
|
|
60
|
-
| `simple_module_settings` | `smpy settings import-from-env` |
|
|
64
|
+
| `simple_module_hosting` | `uv run smpy host gen-pages`, `uv run smpy host sync-js-deps` |
|
|
65
|
+
| `simple_module_users` | `uv run smpy users create-admin` |
|
|
66
|
+
| `simple_module_settings` | `uv run smpy settings import-from-env` |
|
|
61
67
|
|
|
62
68
|
## License
|
|
63
69
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# simple_module_cli
|
|
2
|
+
|
|
3
|
+
Standalone scaffolder for the [SimpleModule framework](https://github.com/antosubash/simple_module_python).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install simple_module_cli
|
|
9
|
+
# or, to keep the CLI in its own venv:
|
|
10
|
+
pipx install simple_module_cli
|
|
11
|
+
# or, to run it without installing:
|
|
12
|
+
uvx --from simple_module_cli@latest smpy new my-app
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The standalone CLI depends on `typer`, `tomlkit`, `packaging`, and `PyYAML`. The Docker worker command uses PyYAML to validate Compose environment entries while preserving the original formatting.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
uv run smpy new my-app # interactive wizard
|
|
21
|
+
uv run smpy new my-app --yes --preset full # all built-in modules + background jobs
|
|
22
|
+
uv run smpy create-module my_feature # scaffold a publishable module package
|
|
23
|
+
uv run smpy create-host bare-host # scaffold a bare host (no opinionated wiring)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Built-in commands: `uv run smpy new`, `uv run smpy create-host`, `uv run smpy create-module`, `uv run smpy update`, and `uv run smpy skills {list,add,update}`.
|
|
27
|
+
|
|
28
|
+
`uv run smpy update` handles PyPI and git pins, syncs lockfiles and generates the
|
|
29
|
+
frontend. `package-update` remains a deprecated alias until 0.0.50. Creating a
|
|
30
|
+
module inside an app workspace also wires and installs it; then use
|
|
31
|
+
`uv run smpy migrations new <module> -m "init"`, review, `make migrate` and restart.
|
|
32
|
+
|
|
33
|
+
When other framework packages are installed, they contribute additional subcommands via the `simple_module_cli.cli_plugins` entry-point group:
|
|
34
|
+
|
|
35
|
+
| Package | Commands |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `simple_module_hosting` | `uv run smpy host gen-pages`, `uv run smpy host sync-js-deps` |
|
|
38
|
+
| `simple_module_users` | `uv run smpy users create-admin` |
|
|
39
|
+
| `simple_module_settings` | `uv run smpy settings import-from-env` |
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "simple_module_cli"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.48"
|
|
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"
|
|
@@ -21,6 +21,7 @@ classifiers = [
|
|
|
21
21
|
]
|
|
22
22
|
dependencies = [
|
|
23
23
|
"packaging>=23.0,<27",
|
|
24
|
+
"pyyaml>=6.0,<7",
|
|
24
25
|
"typer>=0.12,<0.28",
|
|
25
26
|
"tomlkit>=0.13,<0.16",
|
|
26
27
|
]
|
|
@@ -29,6 +30,10 @@ dependencies = [
|
|
|
29
30
|
smpy = "simple_module_cli.cli:main"
|
|
30
31
|
simple-module = "simple_module_cli.cli:main"
|
|
31
32
|
|
|
33
|
+
[project.entry-points."simple_module.data_upgrades"]
|
|
34
|
+
"mail.settings_namespace_v1" = "simple_module_cli.migration_recipes:mail_settings"
|
|
35
|
+
"users.hashed_bearer_tokens_v1" = "simple_module_cli.migration_recipes:users_tokens"
|
|
36
|
+
|
|
32
37
|
[project.urls]
|
|
33
38
|
Homepage = "https://github.com/antosubash/simple_module_python"
|
|
34
39
|
Repository = "https://github.com/antosubash/simple_module_python"
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""Post-install steps and shared helpers for ``smpy add``."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
import subprocess
|
|
7
|
+
from collections.abc import Callable
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
import typer
|
|
11
|
+
|
|
12
|
+
from simple_module_cli.package_update_deps import workspace_member_dirs
|
|
13
|
+
from simple_module_cli.package_update_npm import install_roots, load_manifests
|
|
14
|
+
from simple_module_cli.pyproject_edit import load_pyproject
|
|
15
|
+
from simple_module_cli.uv_workspace import find_workspace_root, is_workspace_member
|
|
16
|
+
|
|
17
|
+
ExecRunner = Callable[[list[str], Path], int]
|
|
18
|
+
|
|
19
|
+
_DIST_PREFIX = re.compile(r"^simple[-_]module[-_]", re.IGNORECASE)
|
|
20
|
+
_SKIP_IF_MISSING = "--skip-if-missing"
|
|
21
|
+
#: Click's exit code for an unknown option.
|
|
22
|
+
_USAGE_ERROR = 2
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
_ENTRYPOINT_CHECK = (
|
|
26
|
+
"import sys\n"
|
|
27
|
+
"from importlib.metadata import distributions\n"
|
|
28
|
+
"target = sys.argv[1].replace('-', '_').lower()\n"
|
|
29
|
+
"for dist in distributions():\n"
|
|
30
|
+
" if any(ep.group == 'simple_module' for ep in dist.entry_points):\n"
|
|
31
|
+
" name = (dist.metadata['Name'] or '').replace('-', '_').lower()\n"
|
|
32
|
+
" if name == target:\n"
|
|
33
|
+
" sys.exit(0)\n"
|
|
34
|
+
"sys.exit(1)\n"
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _default_exec_runner(cmd: list[str], cwd: Path) -> int:
|
|
39
|
+
return subprocess.run(cmd, cwd=cwd, check=False).returncode
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _sync_command(project_dir: Path) -> tuple[list[str], Path]:
|
|
43
|
+
"""How to sync after editing ``project_dir``'s pyproject.
|
|
44
|
+
|
|
45
|
+
A host inside an app workspace shares one venv with the root's dev tools
|
|
46
|
+
and every module member. ``uv sync`` from ``host/`` would sync the host
|
|
47
|
+
alone and uninstall the rest (GH #916), so sync the workspace from its
|
|
48
|
+
root, as ``make install`` does.
|
|
49
|
+
"""
|
|
50
|
+
root = find_workspace_root(project_dir)
|
|
51
|
+
if root is not None and (
|
|
52
|
+
root == project_dir.resolve() or is_workspace_member(project_dir, project_dir)
|
|
53
|
+
):
|
|
54
|
+
return ["uv", "sync", "--all-packages"], root
|
|
55
|
+
return ["uv", "sync"], project_dir
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def sync_project(
|
|
59
|
+
project_dir: Path, exec_runner: ExecRunner, *, upgrade: list[str] | None = None
|
|
60
|
+
) -> None:
|
|
61
|
+
"""Finish manifest changes using the app's installation and generation flow."""
|
|
62
|
+
sync_cmd, root = _sync_command(project_dir)
|
|
63
|
+
for name in upgrade or []:
|
|
64
|
+
sync_cmd.extend(["--upgrade-package", name])
|
|
65
|
+
commands = [(sync_cmd, root)]
|
|
66
|
+
client = next((p for p in (root / "host/client_app", root / "client_app") if p.is_dir()), None)
|
|
67
|
+
if client is not None:
|
|
68
|
+
pyproject = root / "pyproject.toml"
|
|
69
|
+
files = [pyproject, *workspace_member_dirs(pyproject, load_pyproject(pyproject))]
|
|
70
|
+
manifests = load_manifests([file.parent for file in files])
|
|
71
|
+
commands.extend((["npm", "install"], directory) for directory in install_roots(manifests))
|
|
72
|
+
commands.append((["uv", "run", "smpy", "gen"], root))
|
|
73
|
+
for cmd, cwd in commands:
|
|
74
|
+
if exec_runner(cmd, cwd) != 0:
|
|
75
|
+
raise _fail(
|
|
76
|
+
f"`{' '.join(cmd)}` failed — manifests are already updated. "
|
|
77
|
+
f"Fix the error, then run `make install` from {root} to finish installation."
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _fail(message: str) -> typer.Exit:
|
|
82
|
+
typer.echo(f"ERROR: {message}", err=True)
|
|
83
|
+
return typer.Exit(code=1)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def post_install(
|
|
87
|
+
project_dir: Path,
|
|
88
|
+
dists: list[str],
|
|
89
|
+
models_dists: list[str],
|
|
90
|
+
exec_runner: ExecRunner,
|
|
91
|
+
) -> None:
|
|
92
|
+
"""Sync dependencies, regenerate frontend files, and check entry points."""
|
|
93
|
+
sync_cmd, sync_dir = _sync_command(project_dir)
|
|
94
|
+
has_frontend = (project_dir / "client_app").is_dir()
|
|
95
|
+
commands = [(sync_cmd, sync_dir)]
|
|
96
|
+
if has_frontend:
|
|
97
|
+
commands.extend(
|
|
98
|
+
(["uv", "run", "smpy", "host", *step], project_dir)
|
|
99
|
+
for step in (("gen-pages",), ("sync-js-deps",), ("gen-i18n", _SKIP_IF_MISSING))
|
|
100
|
+
)
|
|
101
|
+
for cmd, cwd in commands:
|
|
102
|
+
code = exec_runner(cmd, cwd)
|
|
103
|
+
if code == _USAGE_ERROR and _SKIP_IF_MISSING in cmd:
|
|
104
|
+
# A hosting plugin older than the global smpy has no --skip-if-missing.
|
|
105
|
+
code = exec_runner([part for part in cmd if part != _SKIP_IF_MISSING], cwd)
|
|
106
|
+
if code != 0:
|
|
107
|
+
raise _fail(
|
|
108
|
+
f"`{' '.join(cmd)}` failed — dependencies are already recorded in pyproject.toml. "
|
|
109
|
+
"Fix the error, then rerun the original `smpy add` command."
|
|
110
|
+
)
|
|
111
|
+
for dist in dists:
|
|
112
|
+
code = exec_runner(["uv", "run", "python", "-c", _ENTRYPOINT_CHECK, dist], project_dir)
|
|
113
|
+
if code != 0:
|
|
114
|
+
raise _fail(
|
|
115
|
+
f"{dist} installed but exposes no [project.entry-points.simple_module] "
|
|
116
|
+
"entry point — it is not a SimpleModule module."
|
|
117
|
+
)
|
|
118
|
+
for dist in models_dists:
|
|
119
|
+
# The same message `smpy create-module`'s next steps suggest (GH #931).
|
|
120
|
+
slug = _DIST_PREFIX.sub("", dist)
|
|
121
|
+
typer.echo(
|
|
122
|
+
f"{dist} ships database models — generate and apply the migration:\n"
|
|
123
|
+
f' make migration msg="add {slug}"\n make migrate'
|
|
124
|
+
)
|
|
125
|
+
# Only `pyproject.toml` changed, which the dev reloader does not watch; and a
|
|
126
|
+
# reload still logs the new module as not importable in that process (GH #915,
|
|
127
|
+
# #931), so only a restart serves it.
|
|
128
|
+
if has_frontend:
|
|
129
|
+
typer.echo("Run `make install` from the app root to link pages and generate i18n keys.")
|
|
130
|
+
typer.echo("If `make dev` is running, restart it to discover the installed modules.")
|
{simple_module_cli-0.0.46 → simple_module_cli-0.0.48}/simple_module_cli/_app_project_manifests.py
RENAMED
|
@@ -41,6 +41,7 @@ _APP_NPM_DEPS = {
|
|
|
41
41
|
# with templates/host/client_app/package.json.tpl.
|
|
42
42
|
_APP_NPM_DEV_DEPS = {
|
|
43
43
|
"@simple-module-py/tsconfig": _FRAMEWORK_VERSION,
|
|
44
|
+
"@simple-module-py/vite-plugin": _FRAMEWORK_VERSION,
|
|
44
45
|
"@tailwindcss/vite": "^4.0.0",
|
|
45
46
|
"@types/node": "^26.5.0",
|
|
46
47
|
"@types/react": "^19.0.0",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""Content fingerprints for the generation pipeline (never cache a failed stage)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import hashlib
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
from collections.abc import Callable, Iterable
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def file_hashes(paths: Iterable[Path]) -> dict[str, str | None]:
|
|
13
|
+
result = {}
|
|
14
|
+
for path in sorted(set(paths)):
|
|
15
|
+
result[str(path)] = (
|
|
16
|
+
hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None
|
|
17
|
+
)
|
|
18
|
+
return result
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def source_files(root: Path, suffixes: set[str]) -> list[Path]:
|
|
22
|
+
files = []
|
|
23
|
+
for directory, dirs, names in os.walk(root):
|
|
24
|
+
dirs[:] = [
|
|
25
|
+
d
|
|
26
|
+
for d in dirs
|
|
27
|
+
if not d.startswith(".")
|
|
28
|
+
and d not in {"node_modules", "__pycache__", "tests", "tests-js", "static"}
|
|
29
|
+
]
|
|
30
|
+
files.extend(Path(directory) / n for n in names if Path(n).suffix in suffixes)
|
|
31
|
+
return files
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class GenerationCache:
|
|
35
|
+
def __init__(self, path: Path):
|
|
36
|
+
self.path = path
|
|
37
|
+
try:
|
|
38
|
+
self.state = json.loads(path.read_text(encoding="utf-8"))
|
|
39
|
+
if not isinstance(self.state, dict):
|
|
40
|
+
self.state = {}
|
|
41
|
+
except (OSError, ValueError):
|
|
42
|
+
self.state = {}
|
|
43
|
+
|
|
44
|
+
def run(
|
|
45
|
+
self,
|
|
46
|
+
name: str,
|
|
47
|
+
inputs: Callable[[], object],
|
|
48
|
+
outputs: list[Path],
|
|
49
|
+
generate: Callable[[], object],
|
|
50
|
+
) -> bool:
|
|
51
|
+
def stamp():
|
|
52
|
+
return {"inputs": inputs(), "outputs": file_hashes(outputs)}
|
|
53
|
+
|
|
54
|
+
if self.state.get(name) == stamp():
|
|
55
|
+
return False
|
|
56
|
+
generate()
|
|
57
|
+
self.state[name] = stamp()
|
|
58
|
+
self.path.parent.mkdir(parents=True, exist_ok=True)
|
|
59
|
+
# Replace atomically: an interrupted generation must leave a readable cache.
|
|
60
|
+
temporary = self.path.with_suffix(f".{os.getpid()}.tmp")
|
|
61
|
+
temporary.write_text(json.dumps(self.state, sort_keys=True), encoding="utf-8")
|
|
62
|
+
temporary.replace(self.path)
|
|
63
|
+
return True
|
|
@@ -0,0 +1,13 @@
|
|
|
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.104,<0.0.105"
|
|
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]"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Migration discovery. Keep core and the standalone CLI's vendored copy identical."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from importlib.metadata import EntryPoints, entry_points
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
NO_ALEMBIC_CONFIG = "No Alembic config found. Provide alembic.ini or host/alembic.ini."
|
|
8
|
+
_PROJECT_WALK_LIMIT = 4
|
|
9
|
+
_PROJECT_MARKERS = (".git", ".env.example", ".env")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def resolve_project_root(*, fallback: Path | None = None) -> Path:
|
|
13
|
+
"""Find the host project from cwd, including from an inner workspace package."""
|
|
14
|
+
override = os.environ.get("SM_PROJECT_ROOT")
|
|
15
|
+
if override:
|
|
16
|
+
return Path(override)
|
|
17
|
+
|
|
18
|
+
cwd = Path.cwd()
|
|
19
|
+
package_root = None
|
|
20
|
+
try:
|
|
21
|
+
home = Path.home()
|
|
22
|
+
except RuntimeError:
|
|
23
|
+
home = None
|
|
24
|
+
for depth, root in enumerate((cwd, *cwd.parents[:_PROJECT_WALK_LIMIT])):
|
|
25
|
+
if root == home or (root != cwd and root.stat().st_mode & 0o002):
|
|
26
|
+
break
|
|
27
|
+
if any((root / marker).exists() for marker in _PROJECT_MARKERS):
|
|
28
|
+
return root
|
|
29
|
+
if (root / "alembic.ini").is_file():
|
|
30
|
+
# A workspace root may also have a flat config, which takes precedence.
|
|
31
|
+
parent = root.parent
|
|
32
|
+
if (
|
|
33
|
+
root.name == "host"
|
|
34
|
+
and depth < _PROJECT_WALK_LIMIT
|
|
35
|
+
and parent != home
|
|
36
|
+
and not parent.stat().st_mode & 0o002
|
|
37
|
+
and any(
|
|
38
|
+
(parent / marker).exists()
|
|
39
|
+
for marker in (*_PROJECT_MARKERS, "pyproject.toml", "alembic.ini")
|
|
40
|
+
)
|
|
41
|
+
):
|
|
42
|
+
return parent
|
|
43
|
+
return root
|
|
44
|
+
if (root / "host/alembic.ini").is_file():
|
|
45
|
+
return root
|
|
46
|
+
if package_root is None and (root / "pyproject.toml").is_file():
|
|
47
|
+
package_root = root
|
|
48
|
+
return package_root or fallback or cwd
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def resolve_alembic_ini(
|
|
52
|
+
project_root: str | Path | None = None, *, override: str | Path | None = None
|
|
53
|
+
) -> Path | None:
|
|
54
|
+
"""Find the host's ini. An explicit path is cwd-relative and disables fallback."""
|
|
55
|
+
if override is not None:
|
|
56
|
+
candidate = Path(override)
|
|
57
|
+
return candidate if candidate.is_file() else None
|
|
58
|
+
root = Path(project_root) if project_root is not None else resolve_project_root()
|
|
59
|
+
for candidate in (root / "alembic.ini", root / "host" / "alembic.ini"):
|
|
60
|
+
if candidate.is_file():
|
|
61
|
+
return candidate
|
|
62
|
+
return None
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def data_upgrade_entry_points() -> EntryPoints:
|
|
66
|
+
"""Find registered recipes without importing any recipe code."""
|
|
67
|
+
return entry_points(group="simple_module.data_upgrades")
|
|
@@ -44,7 +44,7 @@ def run_build(info: ModuleInfo, *, fresh: bool = False, runner=subprocess.run) -
|
|
|
44
44
|
raise typer.Exit(code=1)
|
|
45
45
|
|
|
46
46
|
out_dir = info.root / info.package_name / "static" / "dist"
|
|
47
|
-
config_path =
|
|
47
|
+
config_path = client_app / "module-build.config.mjs"
|
|
48
48
|
config_path.parent.mkdir(parents=True, exist_ok=True)
|
|
49
49
|
config_path.write_text(
|
|
50
50
|
_vite_lib_config(entry, out_dir, global_name=to_pascal_case(info.package_name)),
|
|
@@ -12,7 +12,10 @@ import tomllib
|
|
|
12
12
|
from dataclasses import dataclass
|
|
13
13
|
from pathlib import Path
|
|
14
14
|
|
|
15
|
+
import tomlkit
|
|
15
16
|
import typer
|
|
17
|
+
from packaging.requirements import Requirement
|
|
18
|
+
from packaging.utils import canonicalize_name
|
|
16
19
|
|
|
17
20
|
from simple_module_cli.scaffolding import create_host, resolve_framework_version
|
|
18
21
|
|
|
@@ -71,9 +74,28 @@ def ensure_verify_host(info: ModuleInfo, *, fresh: bool = False) -> Path:
|
|
|
71
74
|
framework_version=resolve_framework_version(),
|
|
72
75
|
)
|
|
73
76
|
_wire_module_dep(host_dir / "pyproject.toml", info.pypi_name)
|
|
77
|
+
_ensure_host_cli(host_dir / "pyproject.toml")
|
|
74
78
|
return host_dir
|
|
75
79
|
|
|
76
80
|
|
|
81
|
+
def _ensure_host_cli(path: Path) -> None:
|
|
82
|
+
"""Cached hosts predating smpy gen also need the CLI in their own venv."""
|
|
83
|
+
doc = tomlkit.parse(path.read_text(encoding="utf-8"))
|
|
84
|
+
groups = doc.setdefault("dependency-groups", {})
|
|
85
|
+
current = groups.get("dev", [])
|
|
86
|
+
wanted = [
|
|
87
|
+
dep
|
|
88
|
+
for dep in current
|
|
89
|
+
if not (
|
|
90
|
+
isinstance(dep, str) and canonicalize_name(Requirement(dep).name) == "simple-module-cli"
|
|
91
|
+
)
|
|
92
|
+
]
|
|
93
|
+
wanted.append(f"simple_module_cli=={resolve_framework_version()}")
|
|
94
|
+
if list(current) != wanted:
|
|
95
|
+
groups["dev"] = wanted
|
|
96
|
+
path.write_text(tomlkit.dumps(doc), encoding="utf-8")
|
|
97
|
+
|
|
98
|
+
|
|
77
99
|
def _wire_module_dep(pyproject_path: Path, pypi_name: str) -> None:
|
|
78
100
|
"""Add the module as an editable path dependency of the verify host."""
|
|
79
101
|
text = pyproject_path.read_text(encoding="utf-8")
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""Notice when ``smpy`` is not the CLI of the app it runs in (GH #929).
|
|
2
|
+
|
|
3
|
+
``uv run smpy`` falls through to whatever ``smpy`` is on ``PATH`` once the
|
|
4
|
+
project venv lost ``simple_module_cli`` (a plain ``uv sync`` used to drop it).
|
|
5
|
+
That is often an older ``uv tool install``-ed copy, which then scaffolds modules
|
|
6
|
+
pinned to its own version inside a newer app, or fails with errors that make no
|
|
7
|
+
sense inside the project. Reading the app's pins is cheap and local.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import re
|
|
13
|
+
import sys
|
|
14
|
+
import tomllib
|
|
15
|
+
from collections.abc import Iterator
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
import typer
|
|
19
|
+
|
|
20
|
+
from simple_module_cli.pins import PLACEHOLDER_VERSION
|
|
21
|
+
|
|
22
|
+
_FRAMEWORK_PIN = re.compile(r"^\s*simple[-_]module[-_][a-z0-9_-]+\s*==\s*([^\s;,\[]+)", re.I)
|
|
23
|
+
|
|
24
|
+
# Commands that legitimately run a CLI of another version than the app's:
|
|
25
|
+
# `new` makes an app, `update`/`package-update` change its pins.
|
|
26
|
+
_EXEMPT_COMMANDS = frozenset({"new", "update", "package-update"})
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _requirements(doc: dict) -> Iterator[str]:
|
|
30
|
+
project = doc.get("project", {})
|
|
31
|
+
yield from project.get("dependencies", [])
|
|
32
|
+
for extra in project.get("optional-dependencies", {}).values():
|
|
33
|
+
yield from extra
|
|
34
|
+
for group in doc.get("dependency-groups", {}).values():
|
|
35
|
+
yield from group
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _pinned_version(pyproject: Path) -> str | None:
|
|
39
|
+
try:
|
|
40
|
+
doc = tomllib.loads(pyproject.read_text(encoding="utf-8"))
|
|
41
|
+
except (OSError, tomllib.TOMLDecodeError):
|
|
42
|
+
return None
|
|
43
|
+
for requirement in _requirements(doc):
|
|
44
|
+
match = _FRAMEWORK_PIN.match(requirement) if isinstance(requirement, str) else None
|
|
45
|
+
if match:
|
|
46
|
+
return match.group(1)
|
|
47
|
+
return None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def app_framework_pin(start: Path) -> tuple[Path, str] | None:
|
|
51
|
+
"""``(project root, version)`` of the nearest project pinning the framework with ``==``.
|
|
52
|
+
|
|
53
|
+
A ``smpy new`` app pins every ``simple_module_*`` package to one version, in
|
|
54
|
+
the root ``pyproject.toml`` and (workspace mode) ``host/pyproject.toml``.
|
|
55
|
+
Range requirements, such as this repository's own, are not pins.
|
|
56
|
+
"""
|
|
57
|
+
current = start.resolve()
|
|
58
|
+
for candidate in (current, *current.parents):
|
|
59
|
+
for pyproject in (candidate / "pyproject.toml", candidate / "host" / "pyproject.toml"):
|
|
60
|
+
version = _pinned_version(pyproject) if pyproject.is_file() else None
|
|
61
|
+
if version is not None:
|
|
62
|
+
return candidate, version
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def running_cli() -> str:
|
|
67
|
+
"""Where the running ``smpy`` lives, for messages."""
|
|
68
|
+
return str(Path(sys.argv[0]).resolve()) if sys.argv and sys.argv[0] else sys.executable
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def warn_if_not_the_apps_cli(command: str | None, current: str, start: Path) -> None:
|
|
72
|
+
"""One stderr warning when the project pins another framework version than this CLI's."""
|
|
73
|
+
if command in _EXEMPT_COMMANDS or current == PLACEHOLDER_VERSION:
|
|
74
|
+
return
|
|
75
|
+
found = app_framework_pin(start)
|
|
76
|
+
if found is None or found[1] == current:
|
|
77
|
+
return
|
|
78
|
+
root, pinned = found
|
|
79
|
+
typer.echo(
|
|
80
|
+
f"WARNING: this project ({root}) pins the framework to {pinned}, but this smpy is "
|
|
81
|
+
f"{current} ({running_cli()}).\n"
|
|
82
|
+
" Use the project's own CLI: `uv sync --all-packages`, then `uv run smpy ...`.",
|
|
83
|
+
err=True,
|
|
84
|
+
)
|
|
@@ -5,8 +5,10 @@ is resolved first (ls-remote + shallow clone + entry-point scan); the host
|
|
|
5
5
|
pyproject is written only after resolution succeeds. A git spec without
|
|
6
6
|
``#subdirectory`` is scanned for module packages — one match is added
|
|
7
7
|
directly, several go through ``--module``/``--all`` or an interactive
|
|
8
|
-
picker.
|
|
9
|
-
|
|
8
|
+
picker. Unless ``--no-sync`` is set, run ``uv sync`` and verify entry points.
|
|
9
|
+
Before verification, a host with a ``client_app`` runs ``smpy host gen-pages``
|
|
10
|
+
and ``smpy host sync-js-deps``, followed by ``smpy host gen-i18n`` if the
|
|
11
|
+
i18n package is installed.
|
|
10
12
|
"""
|
|
11
13
|
|
|
12
14
|
from __future__ import annotations
|
|
@@ -168,7 +170,7 @@ def add_module(
|
|
|
168
170
|
] = Path(),
|
|
169
171
|
no_sync: Annotated[
|
|
170
172
|
bool,
|
|
171
|
-
typer.Option("--no-sync", help="Write pyproject only; skip
|
|
173
|
+
typer.Option("--no-sync", help="Write pyproject only; skip post-install steps."),
|
|
172
174
|
] = False,
|
|
173
175
|
yes: Annotated[bool, typer.Option("--yes", "-y", help="Never prompt (fail instead).")] = False,
|
|
174
176
|
) -> None:
|
|
@@ -123,14 +123,6 @@ def create_app_project(
|
|
|
123
123
|
# Generated secrets go to the gitignored .env, never the committed
|
|
124
124
|
# .env.example (GH #441) — see write_local_env below.
|
|
125
125
|
secret_keys = ["SM_SECRET_KEY"]
|
|
126
|
-
if "users" in resolved:
|
|
127
|
-
# UsersSettings refuses its placeholder token secrets when
|
|
128
|
-
# SM_ENVIRONMENT=production — the mode the compose containers run
|
|
129
|
-
# in — so generate real ones, same as SM_SECRET_KEY.
|
|
130
|
-
secret_keys += [
|
|
131
|
-
"SM_USERS_RESET_PASSWORD_TOKEN_SECRET",
|
|
132
|
-
"SM_USERS_VERIFICATION_TOKEN_SECRET",
|
|
133
|
-
]
|
|
134
126
|
db_name = to_snake_case(name)
|
|
135
127
|
env_path = target / ".env.example"
|
|
136
128
|
env_text = env_path.read_text(encoding="utf-8") if env_path.exists() else ""
|