Skip to content

fix(scaffold,ui): unbreak fresh-install module pages + scaffold workspace (#110-#117) - #118

Merged
antosubash merged 3 commits into
mainfrom
feature/compassionate-robinson-e28696
May 2, 2026
Merged

antosubash merged 3 commits into
mainfrom
feature/compassionate-robinson-e28696

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

Addresses the open frontend / scaffold issues that compose into a single broken-out-of-the-box experience for sm new 0.0.7.

Test plan

  • uv run pytest framework/ — 416 passed
  • uv run pytest framework/cli/tests/test_cli_new.py — 17 passed (4 new tests for workspace mode + --flat)
  • ruff check and ruff format --check clean on all changed Python files
  • All edited package.json files parse as valid JSON
  • Smoke test: uv run sm new myapp --yes --no-install produces modules/hello/ with module.py + settings.py + endpoints/api.py + tests, top-level pyproject has [tool.uv.workspace] and [tool.uv.sources.simple_module_hello], top-level package.json has \"workspaces\".
  • Smoke test: uv run sm new myapp --yes --flat --no-install skips modules/, omits workspace plumbing.
  • On a clean checkout: make install && make migrate && make dev produces a running app whose module pages render in vite without Failed to resolve errors. (Requires npm install; not runnable in worktree.)

Closes #110, #114, #115, #116, #117. Resolves #111.

…pace (#110-#117)

* packages/ui: move lucide-react, sonner, radix-ui, and 11 other runtime
  imports out of peerDependencies into dependencies so a host that pulls
  in @simple-module-py/ui actually gets them installed; only React/Inertia
  stay as peers (singletons). Drop the catch-all "./*": "./src/*" exports
  entry and pin every subpath ("./components/*", "./layouts/*", etc.) to
  its real .tsx/.ts target with a types conditional, fixing vite resolve
  failures from module pages. (#114, #115, #110)

* modules/{users,dashboard,permissions,feature_flags,background_tasks,
  file_storage}: declare lucide-react and/or sonner as dependencies — the
  modules import these directly, but every wheel was shipping
  "dependencies": {} so `sm host sync-js-deps` had nothing to install.
  Wire sync-js-deps into the scaffolded Makefile's `install` target so a
  fresh `sm new` host gets module JS deps without a manual extra step.
  (#116)

* sm new: default to a workspace layout — scaffold modules/hello/ as a
  working authoring template (module.py + settings.py + endpoints/api.py),
  add [tool.uv.workspace] members=["modules/*"] + a workspace source for
  the sample, and "workspaces": ["client_app", "modules/*"] in
  package.json so npm + vite resolve module .tsx files naturally. New
  --flat flag preserves the legacy single-host layout. The module
  template gained a settings.py.tpl (module.py.tpl was already importing
  it) and pydantic-settings as a dep. (#117)

#111 (SM017 pointing inside .venv/site-packages) was already fixed in
#113 and is covered by test_silent_when_module_lives_in_site_packages —
no code change needed.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 2, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3244e4c
Status: ✅  Deploy successful!
Preview URL: https://3eb97934.simple-module-python.pages.dev
Branch Preview URL: https://feature-compassionate-robins.simple-module-python.pages.dev

View logs

antosubash added 2 commits May 2, 2026 12:50
Review feedback on #118:
- _inject_py_deps had two correlated booleans (workspace_sources, drop_workspace);
  collapse to a single flat: bool and rename the helper to _rewrite_pyproject
  since it now configures the uv workspace too, not just deps.
- Reuse _module_to_pypi_name from scaffolding.py instead of re-templating
  simple_module_{_SAMPLE_MODULE_NAME} inline.
- Trim WHAT-narration comments in the host pyproject template and drop the
  duplicated lookup in the helper.
ty narrowed the literal-dict branch to dict[str, str | bool] and rejected
the data['workspaces'] = list assignment. Explicit annotation widens it.
@antosubash
antosubash merged commit 162e8e7 into main May 2, 2026
12 checks passed
@antosubash
antosubash deleted the feature/compassionate-robinson-e28696 branch October 8, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant