Skip to content

Commit d9e02ad

Browse files
authored
Merge pull request #386 from Merit-Systems/master
[RELEASE] Monorepo restructuring + Echo Start AUI
2 parents 176b63c + 7d3afce commit d9e02ad

1,125 files changed

Lines changed: 26915 additions & 4032 deletions

File tree

Some content is hidden

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

‎.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

‎.github/workflows/migrate-db.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
push:
66
branches: [master, production]
77
paths:
8-
- 'echo-control/prisma/**'
8+
- 'packages/app/control/prisma/**'
99

1010
jobs:
1111
migrate-staging:
@@ -29,11 +29,11 @@ jobs:
2929

3030
- name: Install dependencies
3131
run: pnpm install --frozen-lockfile --filter echo-control
32-
working-directory: ./echo-control
32+
working-directory: ./packages/app/control
3333

3434
- name: Run Prisma migrate deploy (Staging)
3535
run: pnpm run prisma:migrate-deploy
36-
working-directory: ./echo-control
36+
working-directory: ./packages/app/control
3737
env:
3838
DATABASE_URL: ${{ secrets.STAGING_DB_URL }}
3939

@@ -58,10 +58,10 @@ jobs:
5858

5959
- name: Install dependencies
6060
run: pnpm install --frozen-lockfile --filter echo-control
61-
working-directory: ./echo-control
61+
working-directory: ./packages/app/control
6262

6363
- name: Run Prisma migrate deploy (Production)
6464
run: pnpm run prisma:migrate-deploy
65-
working-directory: ./echo-control
65+
working-directory: ./packages/app/control
6666
env:
6767
DATABASE_URL: ${{ secrets.PRODUCTION_DB_URL }}

‎.github/workflows/publish-sdks.yml‎

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
typescript-published: ${{ steps.publish-typescript.outputs.published }}
2121
react-published: ${{ steps.publish-react.outputs.published }}
2222
next-published: ${{ steps.publish-next.outputs.published }}
23+
echo-start-published: ${{ steps.publish-echo-start.outputs.published }}
2324
version: ${{ steps.get-version.outputs.version }}
2425

2526
steps:
@@ -43,22 +44,22 @@ jobs:
4344

4445
- name: Get version from TypeScript SDK
4546
id: get-version
46-
working-directory: ./echo-typescript-sdk
47+
working-directory: ./packages/sdk/ts
4748
run: |
4849
PACKAGE_VERSION=$(node -p "require('./package.json').version")
4950
echo "version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
5051
echo "📦 Release version: $PACKAGE_VERSION"
5152
5253
# TypeScript SDK
5354
- name: Build TypeScript SDK
54-
working-directory: ./echo-typescript-sdk
55+
working-directory: ./packages/sdk/ts
5556
run: |
5657
echo "🔨 Building TypeScript SDK..."
5758
pnpm run build
5859
echo "✅ TypeScript SDK built"
5960
6061
- name: Test TypeScript SDK
61-
working-directory: ./echo-typescript-sdk
62+
working-directory: ./packages/sdk/ts
6263
run: |
6364
echo "🧪 Testing TypeScript SDK..."
6465
pnpm run test
@@ -67,7 +68,7 @@ jobs:
6768
6869
- name: Check and publish TypeScript SDK
6970
id: publish-typescript
70-
working-directory: ./echo-typescript-sdk
71+
working-directory: ./packages/sdk/ts
7172
env:
7273
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7374
run: |
@@ -95,14 +96,14 @@ jobs:
9596
9697
# React SDK
9798
- name: Build React SDK
98-
working-directory: ./echo-react-sdk
99+
working-directory: ./packages/sdk/react
99100
run: |
100101
echo "🔨 Building React SDK..."
101102
pnpm run build
102103
echo "✅ React SDK built"
103104
104105
- name: Test React SDK
105-
working-directory: ./echo-react-sdk
106+
working-directory: ./packages/sdk/react
106107
run: |
107108
echo "🧪 Testing React SDK..."
108109
# Note: Some authentication-related tests are currently failing due to SSR removal
@@ -113,7 +114,7 @@ jobs:
113114
114115
- name: Check and publish React SDK
115116
id: publish-react
116-
working-directory: ./echo-react-sdk
117+
working-directory: ./packages/sdk/react
117118
env:
118119
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
119120
run: |
@@ -141,14 +142,14 @@ jobs:
141142
142143
# Next.js SDK
143144
- name: Build Next.js SDK
144-
working-directory: ./echo-next-sdk
145+
working-directory: ./packages/sdk/next
145146
run: |
146147
echo "🔨 Building Next.js SDK..."
147148
pnpm run build
148149
echo "✅ Next.js SDK built"
149150
150151
- name: Test Next.js SDK
151-
working-directory: ./echo-next-sdk
152+
working-directory: ./packages/sdk/next
152153
run: |
153154
echo "🧪 Testing Next.js SDK..."
154155
pnpm run test
@@ -157,7 +158,51 @@ jobs:
157158
158159
- name: Check and publish Next.js SDK
159160
id: publish-next
160-
working-directory: ./echo-next-sdk
161+
working-directory: ./packages/sdk/next
162+
env:
163+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
164+
run: |
165+
PACKAGE_NAME=$(node -p "require('./package.json').name")
166+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
167+
FORCE_PUBLISH="${{ github.event.inputs.force_publish }}"
168+
169+
if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
170+
if [ "$FORCE_PUBLISH" = "true" ]; then
171+
echo "⚠️ Version $PACKAGE_VERSION of $PACKAGE_NAME already exists on npm, but force_publish is enabled"
172+
echo "🚀 Publishing $PACKAGE_NAME to npm..."
173+
npm publish --access public
174+
echo "published=true" >> $GITHUB_OUTPUT
175+
echo "✅ Successfully published $PACKAGE_NAME"
176+
else
177+
echo "❌ Version $PACKAGE_VERSION of $PACKAGE_NAME already exists on npm - skipping"
178+
echo "published=false" >> $GITHUB_OUTPUT
179+
fi
180+
else
181+
echo "🚀 Publishing $PACKAGE_NAME to npm..."
182+
npm publish --access public
183+
echo "published=true" >> $GITHUB_OUTPUT
184+
echo "✅ Successfully published $PACKAGE_NAME"
185+
fi
186+
187+
# Echo Start CLI
188+
- name: Build Echo Start CLI
189+
working-directory: ./packages/sdk/echo-start
190+
run: |
191+
echo "🔨 Building Echo Start CLI..."
192+
pnpm run build
193+
echo "✅ Echo Start CLI built"
194+
195+
- name: Test Echo Start CLI
196+
working-directory: ./packages/sdk/echo-start
197+
run: |
198+
echo "🧪 Testing Echo Start CLI..."
199+
pnpm run type-check
200+
pnpm run lint
201+
echo "✅ Echo Start CLI tests passed"
202+
203+
- name: Check and publish Echo Start CLI
204+
id: publish-echo-start
205+
working-directory: ./packages/sdk/echo-start
161206
env:
162207
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
163208
run: |
@@ -187,7 +232,7 @@ jobs:
187232
name: Create version tag
188233
runs-on: ubuntu-latest
189234
needs: publish
190-
if: (needs.publish.outputs.typescript-published == 'true' || needs.publish.outputs.react-published == 'true' || needs.publish.outputs.next-published == 'true') && github.ref == 'refs/heads/production' && !startsWith(github.ref, 'refs/tags/')
235+
if: (needs.publish.outputs.typescript-published == 'true' || needs.publish.outputs.react-published == 'true' || needs.publish.outputs.next-published == 'true' || needs.publish.outputs.echo-start-published == 'true') && github.ref == 'refs/heads/production' && !startsWith(github.ref, 'refs/tags/')
191236

192237
steps:
193238
- name: Checkout code
@@ -248,12 +293,14 @@ jobs:
248293
- \`@merit-systems/echo-typescript-sdk\`
249294
- \`@merit-systems/echo-react-sdk\`
250295
- \`@merit-systems/echo-next-sdk\`
296+
- \`echo-start\` (CLI tool)
251297
252298
### Installation
253299
\`\`\`bash
254300
npm install @merit-systems/echo-typescript-sdk
255301
npm install @merit-systems/echo-react-sdk
256302
npm install @merit-systems/echo-next-sdk
303+
npm install -g echo-start
257304
\`\`\`
258305
259306
This tag was automatically created after successful npm publishing from the production branch.

0 commit comments

Comments
 (0)