fix: fresh-scaffold + background_tasks papercuts (#116, #119, #123, #124, #126, #127, #128, #129) - #130
Merged
Merged
Conversation
…123, #124, #126, #127, #128, #129) Pulls together the post-0.0.8 follow-up fixes: - #129: `repo_root_from_client_app` now walks up to the nearest workspace `package.json` (falling back to the nearest plain `package.json`) instead of hardcoding two levels up. This unblocks `sm host sync-js-deps` in the flat `sm new` scaffold layout where `client_app/` sits one level under the project root. - #123: scaffolded `vite.config.ts` now also seeds the optimizeDeps walk with each wheel-installed module's `package.json`. Without it, deps a module imports directly (`sonner`, `lucide-react`, ...) were never pre-bundled and Node module resolution from inside `.venv/site-packages` could not reach `host/client_app/node_modules`. - #124: `background_tasks.sync_db` now exposes `set_database_url(url)`, called from `BackgroundTasksModule.on_startup` with the host's resolved `settings.database_url`. The old `os.environ["SM_DATABASE_URL"]` read silently fell back to SQLite in the web process (uvicorn doesn't load `.env` into the env). Falls back to the env var when no override is set so the worker's existing flow keeps working. - Adds regression tests for #126, #127, #128 (already fixed in source but not previously asserted in CI), #129 layout-resolution edges, and the new `set_database_url` URL-resolution contract.
Deploying simple-module-python with
|
| Latest commit: |
353d65c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://391687db.simple-module-python.pages.dev |
| Branch Preview URL: | https://feature-blissful-gagarin-0d6.simple-module-python.pages.dev |
This was referenced May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses every open issue on the tracker, all in one place. The bugs split into three buckets:
sm newscaffold layout (#116, #119, #126, #127, #128, #129). Most were fixed at the source level since 0.0.8 but lacked CI coverage; #129 was a live regression in the flat scaffold layout. New regression tests now pin them so they can't sneak back in.Vite resolver (#123).
vite.config.tstemplate now seeds the optimizeDeps walk with each wheel-installed module'spackage.json. Without it,sonner/lucide-reactimports from.venv/site-packages/<mod>/pages/*.tsxcouldn't reachhost/client_app/node_modules.Background tasks (#124).
background_tasks.sync_dbnow exposesset_database_url(url), called fromBackgroundTasksModule.on_startupwith the host's resolvedsettings.database_url. The oldos.environ['SM_DATABASE_URL']read silently fell back to SQLite in the web process because pydantic-settings never propagates.envto the OS environment.Per-issue notes
repo_root_from_client_appnow walks up to the nearest workspacepackage.json, falling back to anypackage.jsonit finds. Fixes the ENOENT onmake sync-js-depsin flat scaffolds.vite.config.tstemplate'scollectOptimizeIncludesnow also queues each wheel-installed module'spackage.json.set_database_url(url)cached and consulted beforeos.environ.dispose_sync_engine()clears the override too so test runners stay isolated.test_cli_new_regressions.pylock in the contract.Test plan
uv run pytest— 982 passedmake lint— clean (Ruff, ty, Biome, tsc per workspace, file-size, metadata, READMEs)framework/hosting/tests/test_manifest.py— covers framework-repo + flat-scaffold + workspace-with-intermediate-package.json + no-package.json fallbackmodules/background_tasks/tests/test_sync_db.py— covers env-fallback, override-wins, URL-change-resets-engine, dispose-clears-overrideframework/cli/tests/test_cli_new_regressions.py— covers@inertiajs/react ^2.x(sm new root package.json pins @inertiajs/react ^1.0.0 but @simple-module-py/ui@0.0.8 peers ^2.0.0 — npm install fails ERESOLVE #128), sample-module framework pins (sm new sample module pins simple_module_core/db/hosting>=1.0,<2.0 — uv sync fails because framework is at 0.0.x #126/sm new scaffold pins ^0.0.3 npm deps and ==0.0.7 python deps even when 0.0.8 is published; npm caret on 0.0.x silently blocks the bump #119),static/dist/placeholder (sm new sample module's [tool.hatch.build.targets.wheel.force-include] requires hello/static/dist/ — uv sync fails because that dir is gitignored #127)sm new --flat→make install→make devagainst a release wheel (deferred until next release; the pinned regression tests cover the same surface)