-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add subpath patterns to package.json (#145)
This adds the corresponding subpath patterns to the created package.json, so the import declarations can be kept as-is.
- Loading branch information
1 parent
a7acb07
commit 06450d7
Showing
9 changed files
with
174 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { foo } from '#lib' | ||
import { foo2 } from '#lib/2.js' | ||
import type { APIGatewayProxyResultV2 } from 'aws-lambda' | ||
|
||
export const handler = async (): Promise<APIGatewayProxyResultV2> => ({ | ||
statusCode: 201, | ||
body: (foo() + foo2()).toString(), | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
import path from 'node:path' | ||
import type { PackedLambda } from '../src/packLambda.js' | ||
import { packLambdaFromPath } from '../src/packLambdaFromPath.js' | ||
|
||
const __dirname = path.dirname(new URL(import.meta.url).pathname) | ||
|
||
export type TestLambdas = { | ||
test: PackedLambda | ||
testAliasImports: PackedLambda | ||
} | ||
|
||
export const packTestLambdas = async (): Promise<TestLambdas> => ({ | ||
test: await packLambdaFromPath({ | ||
id: 'test', | ||
sourceFilePath: 'cdk/lambda.ts', | ||
}), | ||
testAliasImports: await packLambdaFromPath({ | ||
id: 'testAliasImports', | ||
sourceFilePath: 'cdk/lambda-with-subpath.ts', | ||
tsConfigFilePath: path.join(__dirname, '..', 'tsconfig.json'), | ||
}), | ||
}) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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