Skip to content

feat: improve init command UX and add monorepo support#14

Merged
Narrator merged 2 commits intomainfrom
feat/init-improvements
Mar 26, 2026
Merged

feat: improve init command UX and add monorepo support#14
Narrator merged 2 commits intomainfrom
feat/init-improvements

Conversation

@Narrator
Copy link
Copy Markdown
Member

@Narrator Narrator commented Mar 26, 2026

Summary

  • Fix frozen spinner during package install — replaced spawnSync with async spawn so the clack spinner animates while npm install runs
  • Add .domscribe to .gitignore — new init step that creates or appends to .gitignore idempotently
  • Monorepo support — new init step detects monorepo setups, writes domscribe.config.json at the repo root pointing to the app subdirectory. All CLI commands (serve, stop, status) and MCP connections auto-resolve the app root from this config
  • --app-root flag — non-interactive monorepo init via npx domscribe init --app-root apps/web
  • Fix package manager detection in monorepos — lockfiles are checked at the repo root, not the app subdirectory

Test plan

  • pnpm nx test domscribe-relay — 305 tests pass (config-loader, utils, monorepo-step, init-wizard, framework-step, gitignore-step)
  • pnpm nx build domscribe-core && pnpm nx build domscribe-relay — builds pass
  • pnpm nx lint domscribe-relay — no module boundary violations
  • Manual: npx domscribe init in a single-repo project — works as before
  • Manual: npx domscribe init --app-root apps/web in a monorepo — writes config, installs in correct dir
  • Manual: npx domscribe init --dry-run — shows all steps without side effects

Fix frozen spinner during package install by replacing spawnSync with
async spawn, keeping the event loop free so the clack spinner animates.

Add gitignore step to the init wizard that ensures .domscribe is listed
in the project's .gitignore (creates the file if needed, appends if
missing, no-ops if already present).
…discovery

Introduce domscribe.config.json for monorepo setups where the frontend app
lives in a subdirectory (e.g. apps/web). The init wizard now asks if the
project is a monorepo and writes a config file at the repo root pointing
to the app root.

Updated getWorkspaceRoot() discovery chain to check for config files in
addition to .domscribe/ directories, so all CLI commands (serve, stop,
status) and MCP connections resolve the app root automatically.

Also fixes package manager detection in monorepos by checking lockfiles
at the repo root rather than the app subdirectory.
@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Mar 26, 2026

View your CI Pipeline Execution ↗ for commit cb087fd

Command Status Duration Result
nx run domscribe-test-fixtures:integration--web... ✅ Succeeded 1m 42s View ↗
nx run domscribe-test-fixtures:integration--web... ✅ Succeeded 1m 45s View ↗
nx run domscribe-test-fixtures:integration--web... ✅ Succeeded 1m 38s View ↗
nx run domscribe-test-fixtures:integration--web... ✅ Succeeded 1m 39s View ↗
nx run domscribe-test-fixtures:install-fixture-... ✅ Succeeded 57s View ↗
nx run domscribe-test-fixtures:install-fixture-... ✅ Succeeded 45s View ↗
nx run domscribe-test-fixtures:install-fixture-... ✅ Succeeded 22s View ↗
nx run domscribe-test-fixtures:integration--vit... ✅ Succeeded 31s View ↗
Additional runs (18) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-03-26 19:41:24 UTC

@Narrator Narrator merged commit a84da6f into main Mar 26, 2026
24 checks passed
@Narrator Narrator deleted the feat/init-improvements branch March 26, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant