Repository navigation
Monorepo and ESM (#58) - #59
Merged
Merged
Conversation
- Move application code to packages/api and CDK code to packages/infra - Add root tsconfig.base.json and vitest.config.ts extended by workspaces - Switch to ESM, TypeScript 6.0.3, tsx for the CDK app, ESM Lambda bundles - Migrate tests from Jest to Vitest - Update CI/CD workflows for the workspace layout Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Update README and docs for the monorepo layout, ESM, and Vitest - Add AGENTS.md; point copilot-instructions.md to it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Change Summary
Closes #58
packages/apiholds the Lambda handlers and all application source.packages/infraholds the AWS CDK infrastructure.build,clean,test,test:coverage) live in the rootpackage.jsonand run in each workspace with--workspaces --if-present. There is a single rootpackage-lock.json.tsconfig.base.jsonthat both workspaces extend."type": "module". Relative and alias imports now use.jsextensions.@/alias is kept per workspace (packages/api/srcfor the api, the package root for infra). It is configured in each tsconfig, in each Vitest config, and for esbuild via the API tsconfig.index.mjs) with acreateRequirebanner.lambda-stack.tsno longer uses__dirname.tsxinstead ofts-node.source-map-supportwas removed.buildscript is nowtsc --noEmit, because the Lambdas are bundled by esbuild during CDK synth and deploy.vitest.config.tsat the root, extended in each workspace withmergeConfig.vi.hoisted, andrequire()calls becameawait import().task-service.test.tsnow uses fake timers instead of aDatespy, andsns-client.test.tsmocks@leanstacks/lambda-utils. Test names and assertions are unchanged.npm ci, with the CDK steps running inpackages/infra.docs/,packages/infra/README.md) for the new structure, scripts, ESM conventions, and Vitest.AGENTS.md..github/copilot-instructions.mdnow points to it.📝 Checklist
🧪 Steps to Test
npm cifrom the repository root.npm run lint,npm run format:check,npm run build, andnpm run test:coverage. All should pass.packages/infra/.envfrom.env.example, then runnpm run synth -w packages/infra. Verify that each Lambda bundles asindex.mjsunderpackages/infra/cdk.out.npm run local:start, then thelocal:*scripts inpackages/infra) and exercise the API.🔗 Additional Information
cdk synthand loading a bundled handler in Node both worked.deploy-reusable.ymlrunsnpm run bootstrap, which is not a script in the infra package. That predates this change and I left it alone.