Skip to content

chore: unify dev environment with data-fair conventions#56

Open
BatLeDev wants to merge 7 commits intomasterfrom
chore-dev-env
Open

chore: unify dev environment with data-fair conventions#56
BatLeDev wants to merge 7 commits intomasterfrom
chore-dev-env

Conversation

@BatLeDev
Copy link
Copy Markdown
Member

@BatLeDev BatLeDev commented May 7, 2026

  • Aligns the dev environment with the data-fair conventions: refreshed .zellij.kdl layout, new dev/scripts/ directory hosting log-tee.sh, dev-deps.sh and the relocated status.sh, and consistent log-tee wrapping for the UI dev script.
  • Rewrites dev/worktree.sh and dev/delete-worktree.sh so worktree create/delete handle the full lifecycle: .env generation with randomized ports, npm ci, build-types, UI build on create; docker compose --profile dev --profile test down -v --remove-orphans --rmi local plus worktree removal on delete.
  • Updates CONTRIBUTING.md and AGENTS.md to document the current workflow (status script path, worktree scripts, log files in dev/logs/, dev-only superadmin user superadmin@dev.com).
  • Adds a dev_superadmin entry in dev/resources/users.json and a matching org in dev/resources/organizations.json so manual play data is not wiped by the DELETE /api/test-env cleanup (which only removes owner.id starting with test_).
  • Fixes the portal UI build after a clean install: portal/package.json now generates .nuxt types via a postinstall nuxi prepare, and the obsolete portal/app/components/tsconfig.json is removed.
  • Bumps a few internal dependencies and propagates the version bumps through package-lock.json.

BatLeDev added 5 commits May 7, 2026 14:00
Move the log-tee.sh wrap from the root dev-ui script into ui/package.json's
dev script, matching the convention already used for api and portal.
- Add dev/scripts/log-tee.sh helper: runs a command with FORCE_COLOR=1 for
  the terminal while writing an ANSI-stripped copy to a log file.
- Add dev/scripts/dev-deps.sh: brings up the dev profile, streams logs to
  dev/logs/docker-compose.log in the background, and shows a refreshing
  status table; exiting the pane only stops the watch + log streamer.
- Wire log-tee into api and portal dev scripts (root keeps it for the
  ingress-manager which has no workspace).
- Rewrite dev/worktree.sh and dev/delete-worktree.sh with safety checks
  and full setup/cleanup (env, deps, builds, docker volumes/images).
- .zellij.kdl: silence nvm output and call top-level scripts (dev-ui,
  dev-api, dev-portal) instead of bypassing them via npm -w.
- Document worktree workflow and dev superadmin usage in AGENTS.md.
- Add superadmin@dev.com (id dev_superadmin, password passwd) to the
  test directory + simple-directory ADMINS list and dev_org membership,
  so devs can play locally without their data being wiped by tests.
- Unify the test_superadmin password to "passwd" (was "superpasswd")
  and simplify tests/fixtures/login.ts and tests/support/axios.ts.
- Silence dotenv parse output in api configs (quiet: true).
- Drop unused portal/app/components/tsconfig.json.
Group it with the other dev helpers (log-tee.sh, dev-deps.sh). PROJECT_DIR
now goes up two levels instead of one; AGENTS.md references updated.
- Mention .nvmrc / `nvm use` in prerequisites.
- Add the missing setup steps: ./dev/init-env.sh and the initial
  `npm -w ui run build`, with a note about the known bug forcing the
  UI build before the API can start.
- Add the mock ingress manager to the Services list.
- Tests section: bootstrap via `npm run dev-zellij` (not just dev-deps),
  document test-unit/test-api/test-e2e and `npm run test -- <path>`
  (test-only no longer exists).
- Drop the leftover "Setup the development environment TODO" section.
…a clean

The UI vite build pulls in Vue components from portal/app/components and
needs portal/.nuxt/tsconfig.app.json to type-check them. That file is
generated by `nuxt prepare`, but until now nothing in the project ran it,
so a fresh checkout (or anything that wipes portal/.nuxt) made
`npm -w ui run build` fail with TSConfckParseError.

- portal/package.json: add `"postinstall": "nuxt prepare"` so `npm i`
  always produces a populated portal/.nuxt.
- portal/nuxt.config.ts: the existing nitropack workaround used
  `process.exit(0)` in the close hook, which fires before writeTypes
  during `nuxt prepare` and skipped tsconfig.app.json generation. Defer
  the exit by 1s when `_prepare` is set so writeTypes can finish; keep
  the immediate exit for real builds.
BatLeDev added 2 commits May 7, 2026 17:08
…wrapping

Import $Fetch from nitropack/types (matches the type returned by $fetch.create())
instead of ofetch, type the locale prop as string since Vue auto-unwraps refs
in templates and re-wrap it via toRef before passing to composables, and guard
the english fallback in createAgentTranslator against an undefined messages.en.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant