Skip to content

Commit d94d70b

Browse files
authored
chore(parser): mark parser as GA (#2831)
1 parent df71d78 commit d94d70b

File tree

3 files changed

+95
-108
lines changed

3 files changed

+95
-108
lines changed

.github/scripts/release_patch_package_json.js

+67-71
Original file line numberDiff line numberDiff line change
@@ -18,80 +18,76 @@ if (process.argv.length < 3) {
1818
const basePath = resolve(process.argv[2]);
1919
const packageJsonPath = join(basePath, 'package.json');
2020
const alphaPackages = [];
21-
const betaPackages = ['@aws-lambda-powertools/parser'];
21+
const betaPackages = [];
2222

2323
(() => {
24-
try {
25-
// Read the original package.json file
26-
const pkgJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
27-
// Extract the fields we want to keep
28-
const {
29-
name,
30-
version: originalVersion,
31-
description,
32-
author,
33-
license,
34-
homepage,
35-
repository,
36-
bugs,
37-
keywords,
38-
dependencies,
39-
peerDependencies,
40-
peerDependenciesMeta,
41-
exports,
42-
typesVersions,
43-
main,
44-
types,
45-
files,
46-
private,
47-
type,
48-
} = pkgJson;
24+
// Read the original package.json file
25+
const pkgJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
26+
// Extract the fields we want to keep
27+
const {
28+
name,
29+
version: originalVersion,
30+
description,
31+
author,
32+
license,
33+
homepage,
34+
repository,
35+
bugs,
36+
keywords,
37+
dependencies,
38+
peerDependencies,
39+
peerDependenciesMeta,
40+
exports,
41+
typesVersions,
42+
main,
43+
types,
44+
files,
45+
private: privateField,
46+
type,
47+
} = pkgJson;
4948

50-
let version = originalVersion;
51-
// If the package is an alpha or beta package, update the version number to include a suffix
52-
if (alphaPackages.includes(name)) {
53-
version = `${version}-alpha`;
54-
} else if (betaPackages.includes(name)) {
55-
version = `${version}-beta`;
56-
}
57-
58-
// Create a new package.json file with the updated version for the tarball
59-
const newPkgJson = {
60-
name,
61-
version,
62-
description,
63-
author,
64-
license,
65-
homepage,
66-
repository,
67-
bugs,
68-
keywords,
69-
dependencies,
70-
peerDependencies,
71-
peerDependenciesMeta,
72-
main,
73-
types,
74-
files,
75-
type,
76-
};
49+
let version = originalVersion;
50+
// If the package is an alpha or beta package, update the version number to include a suffix
51+
if (alphaPackages.includes(name)) {
52+
version = `${version}-alpha`;
53+
} else if (betaPackages.includes(name)) {
54+
version = `${version}-beta`;
55+
}
7756

78-
// Not all utilities have these fields, so only add them if they exist to avoid
79-
// having empty or undefined fields in the package.json file.
80-
if (exports) {
81-
newPkgJson.exports = exports;
82-
}
83-
if (typesVersions) {
84-
newPkgJson.typesVersions = typesVersions;
85-
}
86-
if (private) {
87-
newPkgJson.private = private;
88-
}
57+
// Create a new package.json file with the updated version for the tarball
58+
const newPkgJson = {
59+
name,
60+
version,
61+
description,
62+
author,
63+
license,
64+
homepage,
65+
repository,
66+
bugs,
67+
keywords,
68+
dependencies,
69+
peerDependencies,
70+
peerDependenciesMeta,
71+
main,
72+
types,
73+
files,
74+
type,
75+
};
8976

90-
// Temporarily update the original package.json file.
91-
// This version will be picked up during the `npm publish` step, so that
92-
// the version number and metadata in the registry are correct and match the tarball.
93-
writeFileSync('package.json', JSON.stringify(newPkgJson, null, 2));
94-
} catch (err) {
95-
throw err;
77+
// Not all utilities have these fields, so only add them if they exist to avoid
78+
// having empty or undefined fields in the package.json file.
79+
if (exports) {
80+
newPkgJson.exports = exports;
81+
}
82+
if (typesVersions) {
83+
newPkgJson.typesVersions = typesVersions;
9684
}
97-
})();
85+
if (privateField) {
86+
newPkgJson.private = privateField;
87+
}
88+
89+
// Temporarily update the original package.json file.
90+
// This version will be picked up during the `npm publish` step, so that
91+
// the version number and metadata in the registry are correct and match the tarball.
92+
writeFileSync('package.json', JSON.stringify(newPkgJson, null, 2));
93+
})();

.markdownlintignore

-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ packages/jmespath/README.md
1818
packages/logger/README.md
1919
packages/metrics/README.md
2020
packages/parameters/README.md
21-
packages/parser/README.md
2221
packages/tracer/README.md

packages/parser/README.md

+28-36
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
11
# Powertools for AWS Lambda (TypeScript) - Parser Utility <!-- omit in toc -->
22

3-
4-
| ⚠️ **WARNING: Do not use this utility in production just yet!** ⚠️ |
5-
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
6-
| This AWS Lambda Powertools for TypeScript utility is currently released as beta developer preview and is intended strictly for feedback and testing purposes only. <br/>This version is not stable, and significant breaking changes might incur before going [before the GA release](https://github.com/aws-powertools/powertools-lambda-typescript/milestone/16). | _ |
7-
8-
9-
103
Powertools for AWS Lambda (TypeScript) is a developer toolkit to implement Serverless [best practices and increase developer velocity](https://docs.powertools.aws.dev/lambda/typescript/latest/#features).
114

125
You can use the package in both TypeScript and JavaScript code bases.
136

147
- [Intro](#intro)
158
- [Key features](#key-features)
169
- [Usage](#usage)
17-
- [Middleware](#middleware)
18-
- [Decorator](#decorator)
19-
- [Manual parsing](#manual-parsing)
20-
- [Safe parsing](#safe-parsing)
21-
- [Built-in schemas and envelopes](#built-in-schemas-and-envelopes)
10+
- [Middleware](#middleware)
11+
- [Decorator](#decorator)
12+
- [Manual parsing](#manual-parsing)
13+
- [Safe parsing](#safe-parsing)
14+
- [Built-in schemas and envelopes](#built-in-schemas-and-envelopes)
2215
- [Contribute](#contribute)
2316
- [Roadmap](#roadmap)
2417
- [Connect](#connect)
2518
- [How to support Powertools for AWS Lambda (TypeScript)?](#how-to-support-powertools-for-aws-lambda-typescript)
26-
- [Becoming a reference customer](#becoming-a-reference-customer)
27-
- [Sharing your work](#sharing-your-work)
28-
- [Using Lambda Layer](#using-lambda-layer)
19+
- [Becoming a reference customer](#becoming-a-reference-customer)
20+
- [Sharing your work](#sharing-your-work)
21+
- [Using Lambda Layer](#using-lambda-layer)
2922
- [Credits](#credits)
3023
- [License](#license)
3124

@@ -35,11 +28,11 @@ The parser utility provides data validation and parsing using [Zod](https://zod.
3528

3629
## Key features
3730

38-
* Define data schema as Zod schema, then parse, validate and extract only what you want
39-
* Built-in envelopes to unwrap and validate popular AWS event sources payloads
40-
* Extend and customize envelopes to fit your needs
41-
* Safe parsing option to avoid throwing errors and custom error handling
42-
* Available for Middy.js middleware and TypeScript method decorators
31+
- Define data schema as Zod schema, then parse, validate and extract only what you want
32+
- Built-in envelopes to unwrap and validate popular AWS event sources payloads
33+
- Extend and customize envelopes to fit your needs
34+
- Safe parsing option to avoid throwing errors and custom error handling
35+
- Available for Middy.js middleware and TypeScript method decorators
4336

4437
## Usage
4538

@@ -197,7 +190,6 @@ export const handler = async (
197190

198191
When parsing data, you can use the `safeParse` method to avoid throwing errors and handle them manually:
199192

200-
201193
```typescript
202194
import type { Context } from 'aws-lambda';
203195
import { parser } from '@aws-lambda-powertools/parser/middleware';
@@ -304,28 +296,28 @@ Help us prioritize upcoming functionalities or utilities by [upvoting existing R
304296

305297
## Connect
306298

307-
* **Powertools for AWS Lambda on Discord**: `#typescript` - **[Invite link](https://discord.gg/B8zZKbbyET)**
308-
* **Email**: [email protected]
299+
- **Powertools for AWS Lambda on Discord**: `#typescript` - **[Invite link](https://discord.gg/B8zZKbbyET)**
300+
- **Email**: <[email protected]>
309301

310302
## How to support Powertools for AWS Lambda (TypeScript)?
311303

312304
### Becoming a reference customer
313305

314-
Knowing which companies are using this library is important to help prioritize the project internally. If your company is using Powertools for AWS Lambda (TypeScript), you can request to have your name and logo added to the README file by raising a [Support Powertools for AWS Lambda (TypeScript) (become a reference)](https://github.com/aws-powertools/powertools-lambda-typescript/issues/new?assignees=&labels=customer-reference&template=support_powertools.yml&title=%5BSupport+Lambda+Powertools%5D%3A+%3Cyour+organization+name%3E) issue.
306+
Knowing which companies are using this library is important to help prioritize the project internally. If your company is using Powertools for AWS Lambda (TypeScript), you can request to have your name and logo added to the README file by raising a [Support Powertools for AWS Lambda (TypeScript) (become a reference)](https://s12d.com/become-a-reference-ts) issue.
315307

316308
The following companies, among others, use Powertools:
317309

318-
* [Hashnode](https://hashnode.com/)
319-
* [Trek10](https://www.trek10.com/)
320-
* [Elva](https://elva-group.com)
321-
* [globaldatanet](https://globaldatanet.com/)
322-
* [Bailey Nelson](https://www.baileynelson.com.au)
323-
* [Perfect Post](https://www.perfectpost.fr)
324-
* [Sennder](https://sennder.com/)
325-
* [Certible](https://www.certible.com/)
326-
* [tecRacer GmbH & Co. KG](https://www.tecracer.com/)
327-
* [AppYourself](https://appyourself.net)
328-
* [Alma Media](https://www.almamedia.fi)
310+
- [Hashnode](https://hashnode.com/)
311+
- [Trek10](https://www.trek10.com/)
312+
- [Elva](https://elva-group.com)
313+
- [globaldatanet](https://globaldatanet.com/)
314+
- [Bailey Nelson](https://www.baileynelson.com.au)
315+
- [Perfect Post](https://www.perfectpost.fr)
316+
- [Sennder](https://sennder.com/)
317+
- [Certible](https://www.certible.com/)
318+
- [tecRacer GmbH & Co. KG](https://www.tecracer.com/)
319+
- [AppYourself](https://appyourself.net)
320+
- [Alma Media](https://www.almamedia.fi)
329321

330322
### Sharing your work
331323

@@ -341,4 +333,4 @@ Credits for the Lambda Powertools for AWS Lambda (TypeScript) idea go to [DAZN](
341333

342334
## License
343335

344-
This library is licensed under the MIT-0 License. See the LICENSE file.
336+
This library is licensed under the MIT-0 License. See the LICENSE file.

0 commit comments

Comments
 (0)