You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build(workspaces): promote repo root to npm workspace root (#53)
## Summary
Restructure the npm workspace tree to be rooted at the repository root
instead of under `app/`, simplifying dependency management and build
workflows across the entire project.
## Key Changes
- **Workspace root relocation**: Moved workspace configuration from
`app/package.json` to a new root `package.json`, with workspaces now
defined as `["app", "app/packages/*", "scripts"]`
- **Root-level npm commands**: Added convenience scripts at the root
level (e.g., `npm run app:dev`, `npm run app:build`) that delegate to
workspace-specific commands, eliminating the need to `cd app` before
running tasks
- **Dockerfile updates**:
- Changed `WORKDIR` from `/app` to `/workspace` to match the new
structure
- Updated all `COPY` commands to reference the root `package.json` and
adjust paths accordingly
- Added stub `scripts/package.json` to prevent npm from installing
maintainer-only dev tools in production
- Added final `WORKDIR /workspace/app` to preserve existing behavior for
`ConfigService` path probing
- **CI/CD workflow updates**: Removed `working-directory: app` defaults
and updated cache paths to use root-level `package-lock.json`; updated
lint and test commands to use new root-level scripts
- **Documentation updates**:
- Updated `CLAUDE.md` with new command patterns (e.g., `npm run app:dev`
instead of `cd app && npm run dev`)
- Updated submodule setup guide to use the new workspace structure
- Updated `docker-compose.yml` volume mounts to reflect `/workspace`
paths
- **Setup script**: Updated `setup.sh` to run `npm ci` from repo root
instead of `app/` directory
## Implementation Details
The restructuring maintains backward compatibility by:
- Keeping the `app/` directory structure intact with its own
`package.json` (now without workspace declarations)
- Using root-level convenience scripts that target specific workspaces
with `-w` flag
- Preserving the final working directory in Docker as `/workspace/app`
to ensure existing path-based logic continues to work
- Creating a stub `scripts/package.json` to prevent unnecessary
dependencies in the production image while still allowing the workspace
to be referenced
This change simplifies the mental model of the project structure and
reduces friction when running commands from the repository root.
https://claude.ai/code/session_01BfCUaJBR6wTmdH2ET8oov4
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+20-12Lines changed: 20 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,32 +4,44 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Common Commands
6
6
7
-
The management app is a TypeScript**npm-workspaces**monorepo under `app/`. Dependencies are installed once at the workspace root. The workspaces are:
7
+
The repo uses a single**npm-workspaces**tree rooted at the repo root. Workspaces are:
8
8
9
9
-`@gsd/shared` — types, `canRun`, sanitizers, status formatter, command descriptors, DynamoDB + Secrets Manager helpers (used by both the server and the Lambdas).
10
10
-`@gsd/server` — Nest.js management API.
11
11
-`@gsd/web` — React + Vite client.
12
12
-`@gsd/lambda-interactions`, `@gsd/lambda-followup`, `@gsd/lambda-update-dns`, `@gsd/lambda-watchdog` — four Lambda packages, each bundled to a single `dist/handler.cjs` by esbuild.
# Unit tests (vitest + aws-sdk-client-mock) — discovered across every workspace
44
-
cd app && npm test# one-off run
45
-
cd app && npm run test:watch # watch mode
46
54
```
47
55
48
-
ESLint (flat config) lives at `app/eslint.config.js` using `@eslint/js` + `typescript-eslint` recommended presets, plus `eslint-plugin-react` and `eslint-plugin-react-hooks` recommended for the web package. Run `npm run lint` (or `npm run lint:fix`) from `app/`.
56
+
ESLint (flat config) lives at `app/eslint.config.js` using `@eslint/js` + `typescript-eslint` recommended presets, plus `eslint-plugin-react` and `eslint-plugin-react-hooks` recommended for the web package. Run `npm run app:lint` (or `npm run app:lint:fix`) from the repo root.
49
57
50
58
Terraform linting uses [tflint](https://github.com/terraform-linters/tflint) with its `recommended` preset and the AWS ruleset plugin. Config lives at `terraform/.tflint.hcl`. Run `tflint --init` once to install the plugin, then `tflint` from `terraform/`. `terraform fmt -check -recursive` and `terraform validate` cover formatting and syntax.
0 commit comments