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
## Problem
TypeScript debugger has a race condition that breaks debugging much of the time. Hard-coded tsconfig also is used which breaks anything more than a very basic typescript lambda.
## Solution
Updated toolkit to generate tsconfig that attempts to match project tsconfig as close as possible, code is compiled into a ts build directory, sam deploys from there on an updated handler path (pointing to build dir). This eliminates the debugger race condition, and much more closely resembles a standard project build eliminating all of our errors. It also matches jetbrains approach here: https://github.com/aws/aws-toolkit-jetbrains/blob/c35ffdbd545c104c2cc5e23bb4dbf02bdc08953a/jetbrains-ultimate/src/software/aws/toolkits/jetbrains/services/lambda/nodejs/NodeJsLambdaBuilder.kt
Code updated:
src/shared/sam/activation.ts: allow typescript code to be recognized
src/shared/sam/debugger/awsSamDebugger.ts: code template generation after individual runtime configs are made so ts can update handler path
src/shared/sam/debugger/typescriptSamDebug.ts: updated build directory process matching jetbrains (most of the updates)
src/shared/sam/localLambdaRunner.ts: split getting template path and creating the template to facilitate awsSamDebugger.ts changes
src/test/shared/sam/debugger/samDebugConfigProvider.test.ts: update ts tests
Tested with unit tests, and with several typescript projects including large and small lambdas. New code lines are covered with code coverage.
0 commit comments