-
Notifications
You must be signed in to change notification settings - Fork 156
feat(logger): Add dual exports with esmodule support on Logger #1734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dreamorosi
merged 15 commits into
aws-powertools:feat/v2
from
antstanley:feat/v2-es-module-support-logger
Oct 11, 2023
Merged
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
94d0730
feat(logger): add esm build output
antstanley 3bc0f1f
fix(Logger): Remove barrel files update references
antstanley a5c31c1
test(Logger): update jest/ts-jest to use ESM
antstanley 58aef57
chore(Logger): remove unused lodash.merge
antstanley 853c551
fix(logger): reinstate lodash.merge
antstanley 96f3067
chore(logger): revert TS assertion
antstanley ca2c6a1
chore(logger): revert format changes
antstanley b996e0a
chore(logger): update postbuild to remove incremental tsbuildinfo files
antstanley 8014448
fix(logger): correct reference to types output
antstanley e6bb8a2
feat(logging): add middleware export
antstanley cffad2e
chore(logger): replace postbuild script with echo statement
antstanley 8b695c7
feat(logger): add typesVersions property and barrel files to /types
antstanley 0fc7d4b
chore(logger): file not used, can be added back if needed
antstanley 7b5c5f5
chore(logger): add space back to README
antstanley 7793c66
chore(logger): revert space in README
antstanley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,4 +49,5 @@ site | |
tmp | ||
|
||
# TS build files | ||
tsconfig.tsbuildinfo | ||
tsconfig.tsbuildinfo | ||
tsconfig.esm.tsbuildinfo |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
dreamorosi marked this conversation as resolved.
Show resolved
Hide resolved
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,18 +27,18 @@ You can use the library in both TypeScript and JavaScript code bases. | |
|
||
## Features | ||
|
||
* **[Tracer](https://docs.powertools.aws.dev/lambda-typescript/latest/core/tracer/)** - Utilities to trace Lambda function handlers, and both synchronous and asynchronous functions | ||
* **[Logger](https://docs.powertools.aws.dev/lambda-typescript/latest/core/logger/)** - Structured logging made easier, and a middleware to enrich log items with key details of the Lambda context | ||
* **[Metrics](https://docs.powertools.aws.dev/lambda-typescript/latest/core/metrics/)** - Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF) | ||
* **[Parameters](https://docs.powertools.aws.dev/lambda-typescript/latest/utilities/parameters/)** - High-level functions to retrieve one or more parameters from AWS SSM, Secrets Manager, AppConfig, and DynamoDB | ||
- **[Tracer](https://docs.powertools.aws.dev/lambda-typescript/latest/core/tracer/)** - Utilities to trace Lambda function handlers, and both synchronous and asynchronous functions | ||
- **[Logger](https://docs.powertools.aws.dev/lambda-typescript/latest/core/logger/)** - Structured logging made easier, and a middleware to enrich log items with key details of the Lambda context | ||
- **[Metrics](https://docs.powertools.aws.dev/lambda-typescript/latest/core/metrics/)** - Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF) | ||
- **[Parameters](https://docs.powertools.aws.dev/lambda-typescript/latest/utilities/parameters/)** - High-level functions to retrieve one or more parameters from AWS SSM, Secrets Manager, AppConfig, and DynamoDB | ||
|
||
## Getting started | ||
|
||
Find the complete project's [documentation here](https://docs.powertools.aws.dev/lambda-typescript). | ||
|
||
### Installation | ||
|
||
The Powertools for AWS Lambda (TypeScript) utilities follow a modular approach, similar to the official [AWS SDK v3 for JavaScript](https://github.com/aws/aws-sdk-js-v3). | ||
The Powertools for AWS Lambda (TypeScript) utilities follow a modular approach, similar to the official [AWS SDK v3 for JavaScript](https://github.com/aws/aws-sdk-js-v3). | ||
|
||
Each TypeScript utility is installed as standalone npm package. | ||
|
||
|
@@ -60,8 +60,8 @@ Or refer to the installation guide of each utility: | |
|
||
### Examples | ||
|
||
* [CDK](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples/cdk) | ||
* [SAM](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples/sam) | ||
- [CDK](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples/cdk) | ||
- [SAM](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples/sam) | ||
|
||
### Serverless TypeScript Demo application | ||
|
||
|
@@ -79,8 +79,8 @@ Help us prioritize upcoming functionalities or utilities by [upvoting existing R | |
|
||
## Connect | ||
|
||
* **Powertools for AWS Lambda on Discord**: `#typescript` - **[Invite link](https://discord.gg/B8zZKbbyET)** | ||
* **Email**: [email protected] | ||
- **Powertools for AWS Lambda on Discord**: `#typescript` - **[Invite link](https://discord.gg/B8zZKbbyET)** | ||
- **Email**: [email protected] | ||
|
||
## How to support Powertools for AWS Lambda (TypeScript)? | ||
|
||
|
@@ -90,15 +90,15 @@ Knowing which companies are using this library is important to help prioritize t | |
|
||
The following companies, among others, use Powertools: | ||
|
||
* [Hashnode](https://hashnode.com/) | ||
* [Trek10](https://www.trek10.com/) | ||
* [Elva](https://elva-group.com) | ||
* [globaldatanet](https://globaldatanet.com/) | ||
* [Bailey Nelson](https://www.baileynelson.com.au) | ||
* [Perfect Post](https://www.perfectpost.fr) | ||
* [Sennder](https://sennder.com/) | ||
* [Certible](https://www.certible.com/) | ||
* [tecRacer GmbH & Co. KG](https://www.tecracer.com/) | ||
- [Hashnode](https://hashnode.com/) | ||
- [Trek10](https://www.trek10.com/) | ||
- [Elva](https://elva-group.com) | ||
- [globaldatanet](https://globaldatanet.com/) | ||
- [Bailey Nelson](https://www.baileynelson.com.au) | ||
- [Perfect Post](https://www.perfectpost.fr) | ||
- [Sennder](https://sennder.com/) | ||
- [Certible](https://www.certible.com/) | ||
- [tecRacer GmbH & Co. KG](https://www.tecracer.com/) | ||
|
||
### Sharing your work | ||
|
||
|
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
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
dreamorosi marked this conversation as resolved.
Show resolved
Hide resolved
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { writeFileSync } from 'node:fs'; | ||
import { join } from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
|
||
const __dirname = fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
const cjsPackageJson = '{ "type": "commonjs" }'; | ||
writeFileSync( | ||
join(__dirname, '..', 'lib', 'cjs', 'package.json'), | ||
cjsPackageJson, | ||
'utf-8' | ||
); | ||
|
||
const esmPackageJson = '{ "type": "module" }'; | ||
writeFileSync( | ||
join(__dirname, '..', 'lib', 'esm', 'package.json'), | ||
esmPackageJson, | ||
'utf-8' | ||
); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.