Skip to content

Commit abfbc87

Browse files
authored
Merge pull request #375 from Merit-Systems/rfs/structure
Restructure monorepo
2 parents de33676 + d007b20 commit abfbc87

File tree

1,070 files changed

+813
-3972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,070 files changed

+813
-3972
lines changed

.dockerignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ Thumbs.db
6161
Dockerfile
6262

6363
# Generated files
64-
echo-server/src/generated
65-
echo-control/src/generated
64+
packages/app/server/src/generated
65+
packages/app/control/src/generated
6666

6767
# Cache
6868
.npm

.github/workflows/integration-tests.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ name: Tests
33
on:
44
pull_request:
55
paths:
6-
- 'echo-control/**'
7-
- 'echo-server/**'
8-
- 'echo-react-sdk/**'
9-
- 'echo-next-sdk/**'
10-
- 'echo-typescript-sdk/**'
11-
- 'integration-tests/**'
6+
- 'packages/app/control/**'
7+
- 'packages/app/server/**'
8+
- 'packages/sdk/react/**'
9+
- 'packages/sdk/next/**'
10+
- 'packages/sdk/ts/**'
11+
- 'packages/tests/integration/**'
1212
- '.github/workflows/**'
1313
- 'pnpm-lock.yaml'
1414
- 'package.json'
1515
push:
1616
branches: [main]
1717
paths:
18-
- 'echo-control/**'
19-
- 'echo-server/**'
20-
- 'echo-react-sdk/**'
21-
- 'echo-typescript-sdk/**'
22-
- 'integration-tests/**'
18+
- 'packages/app/control/**'
19+
- 'packages/app/server/**'
20+
- 'packages/sdk/react/**'
21+
- 'packages/sdk/ts/**'
22+
- 'packages/tests/integration/**'
2323
- '.github/workflows/**'
2424

2525
jobs:
@@ -66,7 +66,7 @@ jobs:
6666
echo "✅ All workspace unit tests passed"
6767
6868
- name: Create integration test environment file
69-
working-directory: integration-tests
69+
working-directory: packages/tests/integration
7070
run: |
7171
cat > .env.test << EOF
7272
# Database Configuration
@@ -119,13 +119,13 @@ jobs:
119119
done'
120120
121121
- name: Setup Prisma schema
122-
working-directory: echo-control
122+
working-directory: packages/app/control
123123
env:
124124
DATABASE_URL: postgresql://test:test@localhost:5433/echo_integration_test
125-
run: pnpm prisma:generate
125+
run: pnpm prisma:generate
126126

127127
- name: Setup integration test environment
128-
working-directory: integration-tests
128+
working-directory: packages/tests/integration
129129
env:
130130
DATABASE_URL: postgresql://test:test@localhost:5433/echo_integration_test
131131
ECHO_CONTROL_URL: http://localhost:3001
@@ -153,11 +153,11 @@ jobs:
153153
pnpm run env:setup
154154
155155
- name: Run Echo Data Server Tests
156-
working-directory: integration-tests
156+
working-directory: packages/tests/integration
157157
run: pnpm test:echo-data-server
158158

159159
- name: Run OAuth Protocol Tests
160-
working-directory: integration-tests
160+
working-directory: packages/tests/integration
161161
run: pnpm test:oauth-protocol
162162

163163
# TODO: Re-enable echo-server integration tests when properly configured
@@ -170,13 +170,13 @@ jobs:
170170
with:
171171
name: integration-test-results
172172
path: |
173-
integration-tests/test-results/
174-
integration-tests/coverage/
173+
packages/tests/integration/test-results/
174+
packages/tests/integration/coverage/
175175
retention-days: 30
176176

177177
- name: Cleanup integration environment
178178
if: always()
179-
working-directory: integration-tests
179+
working-directory: packages/tests/integration
180180
run: |
181181
chmod +x scripts/teardown-integration-env.sh
182182
./scripts/teardown-integration-env.sh
@@ -205,11 +205,11 @@ jobs:
205205
run: pnpm install --frozen-lockfile
206206

207207
- name: Install Playwright browsers
208-
working-directory: integration-tests
208+
working-directory: packages/tests/integration
209209
run: npx playwright install --with-deps
210210

211211
- name: Create environment file for E2E tests
212-
working-directory: integration-tests
212+
working-directory: packages/tests/integration
213213
run: |
214214
cat > .env.test << EOF
215215
DATABASE_URL=postgresql://test:test@postgres-test:5432/echo_integration_test
@@ -227,7 +227,7 @@ jobs:
227227
EOF
228228
229229
- name: Create Docker environment overrides
230-
working-directory: integration-tests/docker
230+
working-directory: packages/tests/integration/docker
231231
run: |
232232
cat > .env.docker << EOF
233233
DATABASE_URL=postgresql://test:test@postgres-test:5432/echo_integration_test
@@ -236,7 +236,7 @@ jobs:
236236
EOF
237237
238238
- name: Start Docker services for E2E tests
239-
working-directory: integration-tests
239+
working-directory: packages/tests/integration
240240
run: |
241241
docker-compose -f docker/docker-compose.yml up -d
242242
echo "Waiting for services to be healthy..."
@@ -246,18 +246,18 @@ jobs:
246246
done'
247247
248248
- name: Run E2E tests
249-
working-directory: integration-tests
249+
working-directory: packages/tests/integration
250250
run: pnpm test:e2e
251251

252252
- name: Upload Playwright report
253253
if: always()
254254
uses: actions/upload-artifact@v4
255255
with:
256256
name: playwright-report
257-
path: integration-tests/playwright-report/
257+
path: packages/tests/integration/playwright-report/
258258
retention-days: 30
259259

260260
- name: Cleanup Docker services
261261
if: always()
262-
working-directory: integration-tests
262+
working-directory: packages/tests/integration
263263
run: docker-compose -f docker/docker-compose.yml down -v

Dockerfile.railway

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,29 +76,29 @@ COPY package.json ./
7676
COPY tsconfig.base.json ./
7777

7878
# Copy all project files first
79-
COPY echo-control/ ./echo-control/
80-
COPY echo-server/ ./echo-server/
81-
COPY echo-typescript-sdk/ ./echo-typescript-sdk/
82-
COPY echo-next-sdk/ ./echo-next-sdk/
83-
COPY echo-react-sdk/ ./echo-react-sdk/
79+
COPY packages/app/control/ ./packages/app/control/
80+
COPY packages/app/server/ ./packages/app/server/
81+
COPY packages/sdk/ts/ ./packages/sdk/ts/
82+
COPY packages/sdk/next/ ./packages/sdk/next/
83+
COPY packages/sdk/react/ ./packages/sdk/react/
8484

8585
# Install dependencies for both projects (including dev dependencies for build)
86-
WORKDIR /app/echo-control
86+
WORKDIR /app/packages/app/control
8787
RUN pnpm install
8888

89-
WORKDIR /app/echo-server
89+
WORKDIR /app/packages/app/server
9090
RUN pnpm install
9191

9292
# Step 1: Build echo-control and generate Prisma client
93-
WORKDIR /app/echo-control
93+
WORKDIR /app/packages/app/control
9494
RUN pnpm run prisma:generate
9595
RUN pnpm run build
9696

97-
WORKDIR /app/echo-typescript-sdk
97+
WORKDIR /app/packages/sdk/ts
9898
RUN pnpm install
9999
RUN pnpm run build
100100

101-
WORKDIR /app/echo-server
101+
WORKDIR /app/packages/app/server
102102
RUN pnpm run copy-prisma
103103

104104
# Step 3: Build echo-server

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ Consider giving a star on GitHub!
3535

3636
## Core
3737

38-
- [Echo Control](./echo-control): Next.js app for [echo.merit.systems](https://echo.merit.systems). Hosted site and api routes.
39-
- [Echo Server](./echo-server): Express server for router.echo.merit.systems. Proxy for routing and metering LLM requests from clients.
38+
- [Echo Control](./packages/app/control): Next.js app for [echo.merit.systems](https://echo.merit.systems). Hosted site and api routes.
39+
- [Echo Server](./packages/app/server): Express server for router.echo.merit.systems. Proxy for routing and metering LLM requests from clients.
4040

4141
## SDKs
4242

43-
- [Echo TS SDK](./echo-typescript-sdk) Typescript SDK that all the framework specific SDKs are built on top of.
44-
- [Echo Next.js SDK](./echo-next-sdk) SDK for simple Next.js 15+ App Router integration.
45-
- [Echo React SDK](./echo-react-sdk) SDK for simple React client side SPA integration.
43+
- [Echo TS SDK](./packages/sdk/ts) Typescript SDK that all the framework specific SDKs are built on top of.
44+
- [Echo Next.js SDK](./packages/sdk/next) SDK for simple Next.js 15+ App Router integration.
45+
- [Echo React SDK](./packages/sdk/react) SDK for simple React client side SPA integration.
4646

4747
## Examples
4848

49-
- [Echo Next.js Example](./examples/next-sdk-example)
50-
- [Echo React SDK](./examples/vite)
49+
- [Echo Next.js Example](./packages/sdk/examples/next)
50+
- [Echo React SDK](./packages/sdk/examples/vite)
5151

5252
# Development
5353

54-
Fill out `echo-control/.env` and `echo-server/.env`. Then...
54+
Fill out `packages/app/control/.env` and `packages/app/server/.env`. Then...
5555

5656
- `pnpm i`
5757
- `pnpm dev`

echo-control/docs/react-sdk/use-chat.mdx

Lines changed: 0 additions & 114 deletions
This file was deleted.

echo-server/scripts/build-local-docker.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"scripts": {
88
"dev": "turbo run dev --filter=echo-control --filter=echo-server",
99
"build": "pnpm run --recursive build",
10-
"test:unit": "cd echo-typescript-sdk && pnpm run build && cd .. && pnpm run --recursive --filter=!echo-server test:unit",
11-
"test:integration": "cd integration-tests && pnpm test",
10+
"test:unit": "pnpm -C packages/sdk/ts run build && pnpm -r --filter=!packages/app/server run test:unit",
11+
"test:integration": "pnpm -C packages/tests/integration test",
1212
"test:all": "pnpm run test:unit && pnpm run test:integration",
1313
"lint": "pnpm run --recursive lint",
1414
"lint:fix": "pnpm run --recursive lint:fix",
@@ -17,6 +17,7 @@
1717
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\""
1818
},
1919
"devDependencies": {
20+
"@eslint/js": "^9.13.0",
2021
"@typescript-eslint/eslint-plugin": "^8.34.1",
2122
"@typescript-eslint/parser": "^8.34.1",
2223
"eslint": "^9.29.0",
@@ -26,6 +27,7 @@
2627
"eslint-plugin-unused-imports": "^4.1.4",
2728
"prettier": "^3.5.3",
2829
"tsup": "^8.5.0",
30+
"turbo": "^2.5.6",
2931
"typescript": "^5.8.3"
3032
},
3133
"dependencies": {

echo-control/.cursor/rules/posthog-integration.mdc renamed to packages/app/control/.cursor/rules/posthog-integration.mdc

File renamed without changes.

0 commit comments

Comments
 (0)