@aws/nx-plugin 0.18.1 → 0.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -37
- package/package.json +1 -1
- package/src/open-api/ts-hooks/__snapshots__/generator.spec.tsx.snap +14 -18
- package/src/open-api/ts-hooks/files/options-proxy.gen.ts.template +1 -1
- package/src/utils/__snapshots__/shared-constructs.spec.ts.snap +1 -1
- package/src/utils/files/common/constructs/src/core/app.ts.template +1 -1
- package/src/utils/versions.d.ts +2 -2
- package/src/utils/versions.js +1 -1
package/README.md
CHANGED
|
@@ -1,63 +1,154 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>NX plugin for AWS - @aws/nx-plugin</h1>
|
|
3
|
+
<h3>Quickly bootstrap and build AWS projects easily</h3>
|
|
4
|
+
<a href="https://opensource.org/licenses/Apache-2.0">
|
|
5
|
+
<img
|
|
6
|
+
src="https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg"
|
|
7
|
+
alt="Apache 2.0 License"
|
|
8
|
+
/>
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://codecov.io/gh/awslabs/nx-plugin-for-aws">
|
|
11
|
+
<img src="https://codecov.io/gh/awslabs/nx-plugin-for-aws/graph/badge.svg?token=X27pgFfxuQ" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://gitpod.io/new/?workspaceClass=g1-large#https://github.com/awslabs/nx-plugin-for-aws">
|
|
14
|
+
<img
|
|
15
|
+
src="https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod"
|
|
16
|
+
alt="Gitpod ready-to-code"
|
|
17
|
+
/>
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://github.com/awslabs/nx-plugin-for-aws/actions/workflows/ci.yml">
|
|
20
|
+
<img
|
|
21
|
+
src="https://github.com/awslabs/nx-plugin-for-aws/actions/workflows/ci.yml/badge.svg"
|
|
22
|
+
alt="Release badge"
|
|
23
|
+
/>
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://github.com/awslabs/nx-plugin-for-aws/commits/main">
|
|
26
|
+
<img
|
|
27
|
+
src="https://img.shields.io/github/commit-activity/w/awslabs/nx-plugin-for-aws"
|
|
28
|
+
alt="Commit activity"
|
|
29
|
+
/>
|
|
30
|
+
</a>
|
|
31
|
+
<br />
|
|
32
|
+
<br />
|
|
33
|
+
<figure>
|
|
34
|
+
<img src="docs/src/content/docs/assets/website-generator.gif" alt="Demo" />
|
|
35
|
+
</figure>
|
|
36
|
+
👉 See full documentation on <a href="https://awslabs.github.io/nx-plugin-for-aws">https://awslabs.github.io/nx-plugin-for-aws</a> 👈
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
## Intro
|
|
40
|
+
|
|
41
|
+
[@aws/nx-plugin](https://github.com/awslabs/nx-plugin-for-aws) is a collection of generators to help you build cloud-native applications with AWS.
|
|
42
|
+
|
|
43
|
+
## Key Features
|
|
44
|
+
|
|
45
|
+
- **Declarative**: Generate code that follows best practices for AWS cloud development.
|
|
46
|
+
- **Component-Based**: Add components to your project as needed, from React websites to serverless APIs using either the CLI or UI.
|
|
47
|
+
- **Learn Once, Use Anywhere**: Consistent patterns across different AWS services and application types.
|
|
48
|
+
- **Open for modification**: All code generated is your code and can be edited as you see fit.
|
|
49
|
+
- **Type safety**: Type-safety is employed to support IDE completions and reduce the number of runtime errors encountered.
|
|
50
|
+
- **Minimal dependencies**: Getting up and running is simple and only requires langugage level global dependencies.
|
|
2
51
|
|
|
3
|
-
|
|
52
|
+
## Available Generators
|
|
4
53
|
|
|
5
|
-
|
|
54
|
+
- `ts#project` - Generate a new TypeScript library.
|
|
55
|
+
- `ts#infra` - Generate a Typescript AWS CDK infrastructure project for your application.
|
|
56
|
+
- `ts#cloudscape-website` - Generate a new Cloudscape/React/Vite based web application.
|
|
57
|
+
- `ts#cloudscape-website#auth` - Add AWS Cognito authentication to your Cloudscape website.
|
|
58
|
+
- `ts#trpc-api` - Generate a tRPC backend service with Amazon API Gateway/AWS Lambda integration and [AWS Powertools](https://github.com/aws-powertools/powertools-lambda-typescript) pre-configured.
|
|
59
|
+
- `py#project` - Generate a uv based Python project.
|
|
60
|
+
- `py#fast-api` - Generate a FastAPI backend service with [AWS Powertools](https://github.com/aws-powertools/powertools-lambda-python) pre-configured.
|
|
61
|
+
- `py#lambda-function` - Add a lambda function to an existing python project with optional type-safe event sources.
|
|
62
|
+
- `api-connection` - Connect frontend applications to backend APIs.
|
|
63
|
+
- `license` - Automatically manage LICENSE files and source code headers in your workspace.
|
|
6
64
|
|
|
7
|
-
|
|
65
|
+
## Getting started
|
|
8
66
|
|
|
9
|
-
|
|
10
|
-
2. Creates new files from templates
|
|
11
|
-
3. Updates existing files when needed
|
|
12
|
-
4. Follows project conventions automatically
|
|
67
|
+
@aws/nx-plugin has been designed for gradual adoption from the start, and **you can use as little or as much of it as you need**.
|
|
13
68
|
|
|
14
|
-
|
|
69
|
+
1. Create a new NX workspace
|
|
15
70
|
|
|
16
|
-
|
|
71
|
+
```bash
|
|
72
|
+
npx create-nx-workspace@~20.6.3 demo --pm=pnpm --preset=ts --ci=skip --formatter=prettier
|
|
73
|
+
cd demo
|
|
74
|
+
```
|
|
17
75
|
|
|
18
|
-
|
|
76
|
+
2. Install the `@aws/nx-plugin`
|
|
19
77
|
|
|
20
|
-
|
|
78
|
+
```bash
|
|
79
|
+
pnpm add -Dw @aws/nx-plugin
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
3. Add components:
|
|
21
83
|
|
|
22
84
|
```bash
|
|
23
|
-
|
|
85
|
+
# Generate a tRPC API backend
|
|
86
|
+
pnpm nx g @aws/nx-plugin:ts#trpc-api
|
|
87
|
+
|
|
88
|
+
# Generate a Cloudscape website
|
|
89
|
+
pnpm nx g @aws/nx-plugin:ts#cloudscape-website
|
|
90
|
+
|
|
91
|
+
# Connect the frontend to the backend
|
|
92
|
+
pnpm nx g @aws/nx-plugin:api-connection
|
|
93
|
+
|
|
94
|
+
# Add authentication to your website
|
|
95
|
+
pnpm nx g @aws/nx-plugin:ts#cloudscape-website#auth
|
|
96
|
+
|
|
97
|
+
# Generate AWS CDK infrastructure
|
|
98
|
+
pnpm nx g @aws/nx-plugin:ts#infra
|
|
24
99
|
```
|
|
25
100
|
|
|
26
|
-
###
|
|
101
|
+
### Additional resources
|
|
27
102
|
|
|
28
|
-
|
|
103
|
+
- Use [Quick Start](https://awslabs.github.io/nx-plugin-for-aws/get_started/quick-start/) to get a taste of @aws/nx-plugin.
|
|
104
|
+
- [Build a Dungeon Adventure Game](https://awslabs.github.io/nx-plugin-for-aws/get_started/tutorials/dungeon-game/overview/) to get an in-depth guided tutorial on how to use the @aws/nx-plugin.
|
|
105
|
+
- [Add @aws/nx-plugin to your existing project](https://awslabs.github.io/nx-plugin-for-aws/get_started/tutorials/existing-project/)
|
|
29
106
|
|
|
30
|
-
|
|
31
|
-
- JetBrains IDEs: [Nx Console for JetBrains](https://plugins.jetbrains.com/plugin/21060-nx-console)
|
|
107
|
+
## Documentation Translation
|
|
32
108
|
|
|
33
|
-
The
|
|
34
|
-
- Interactive generator configuration
|
|
35
|
-
- Command autocompletion
|
|
36
|
-
- Visual project graph
|
|
37
|
-
- Integrated task runner
|
|
109
|
+
The project supports automatic translation of documentation using AWS Bedrock's Deepseek & Haiku 3.5 models. Documentation is translated from English to multiple languages (currently Japanese, with support for French, Spanish, German, Chinese, and Korean).
|
|
38
110
|
|
|
39
|
-
|
|
111
|
+
> **_NOTE:_** It is important that only files in english (en folder) are modified directly as the translated files are generating using english as a base.
|
|
40
112
|
|
|
41
|
-
|
|
113
|
+
### Running Translations Locally
|
|
42
114
|
|
|
43
|
-
|
|
115
|
+
> **_NOTE:_** Ensure you have your aws cli configured to an AWS account with DeepSeek/Haiku 3.5 Bedrock model access before continuing.
|
|
116
|
+
|
|
117
|
+
To translate documentation locally:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Translate only changed files
|
|
121
|
+
pnpm tsx ./scripts/translate.ts
|
|
122
|
+
|
|
123
|
+
# Translate all files
|
|
124
|
+
pnpm tsx ./scripts/translate.ts --all
|
|
125
|
+
|
|
126
|
+
# Translate to specific languages
|
|
127
|
+
pnpm tsx ./scripts/translate.ts --languages jp,fr,es
|
|
128
|
+
|
|
129
|
+
# Show what would be translated without actually translating
|
|
130
|
+
pnpm tsx ./scripts/translate.ts --dry-run
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### GitHub Workflow
|
|
134
|
+
|
|
135
|
+
A GitHub workflow automatically translates documentation when changes are made to English documentation files in pull requests. The workflow:
|
|
44
136
|
|
|
45
|
-
|
|
137
|
+
1. Detects changes to English documentation files
|
|
138
|
+
2. Translates the changed files using DeepSeek and Haiku 3.5 on AWS Bedrock
|
|
139
|
+
3. Commits the translations back to the source branch
|
|
140
|
+
4. Updates the PR with files translated
|
|
46
141
|
|
|
47
|
-
|
|
48
|
-
- [Cognito Authentication](src/cloudscape-website/cognito-auth/README.md) - Add AWS Cognito authentication to your Cloudscape website
|
|
49
|
-
- [Runtime Configuration](src/cloudscape-website/runtime-config/README.md) - Add runtime configuration capabilities to your Cloudscape website
|
|
142
|
+
## Contributing
|
|
50
143
|
|
|
51
|
-
|
|
144
|
+
The main purpose of this repository is to continue evolving @aws/nx-plugin, making it faster and easier to use. Development happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements.
|
|
52
145
|
|
|
53
|
-
|
|
146
|
+
Read our [Contributing Guide](/CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to @aws/nx-plugin.
|
|
54
147
|
|
|
55
|
-
|
|
148
|
+
## Code of Conduct
|
|
56
149
|
|
|
57
|
-
|
|
58
|
-
- [tRPC React](src/trpc/react/README.md) - Add tRPC client integration to your React application
|
|
150
|
+
This project has adopted a Code of Conduct that we expect project participants to adhere to. Please read the [Code of Conduct](/CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated.
|
|
59
151
|
|
|
60
|
-
|
|
152
|
+
## License
|
|
61
153
|
|
|
62
|
-
- [
|
|
63
|
-
- [CJS to ESM](src/ts/cjs-to-esm/README.md) - Convert CommonJS modules to ECMAScript modules
|
|
154
|
+
@aws/nx-plugin is [Apache 2.0 licensed](/LICENSE).
|
package/package.json
CHANGED
|
@@ -98,9 +98,7 @@ export class TestApiOptionsProxy {
|
|
|
98
98
|
...options,
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
private _getTestQueryFilter(
|
|
102
|
-
filter?: QueryFilters<GetTest200Response, GetTestError>,
|
|
103
|
-
): QueryFilters<GetTest200Response, GetTestError> {
|
|
101
|
+
private _getTestQueryFilter(filter?: QueryFilters): QueryFilters {
|
|
104
102
|
return {
|
|
105
103
|
queryKey: this._getTestQueryKey(),
|
|
106
104
|
...filter,
|
|
@@ -173,8 +171,8 @@ export class TestApiOptionsProxy {
|
|
|
173
171
|
}
|
|
174
172
|
private _getItemsQueryFilter(
|
|
175
173
|
input: GetItemsRequest,
|
|
176
|
-
filter?: QueryFilters
|
|
177
|
-
): QueryFilters
|
|
174
|
+
filter?: QueryFilters,
|
|
175
|
+
): QueryFilters {
|
|
178
176
|
return {
|
|
179
177
|
queryKey: this._getItemsQueryKey(input),
|
|
180
178
|
...filter,
|
|
@@ -338,8 +336,8 @@ export class TestApiOptionsProxy {
|
|
|
338
336
|
}
|
|
339
337
|
private _searchDataQueryFilter(
|
|
340
338
|
input: SearchDataRequest,
|
|
341
|
-
filter?: QueryFilters
|
|
342
|
-
): QueryFilters
|
|
339
|
+
filter?: QueryFilters,
|
|
340
|
+
): QueryFilters {
|
|
343
341
|
return {
|
|
344
342
|
queryKey: this._searchDataQueryKey(input),
|
|
345
343
|
...filter,
|
|
@@ -412,8 +410,8 @@ export class TestApiOptionsProxy {
|
|
|
412
410
|
}
|
|
413
411
|
private _getItemsQueryFilter(
|
|
414
412
|
input: GetItemsRequest,
|
|
415
|
-
filter?: QueryFilters
|
|
416
|
-
): QueryFilters
|
|
413
|
+
filter?: QueryFilters,
|
|
414
|
+
): QueryFilters {
|
|
417
415
|
return {
|
|
418
416
|
queryKey: this._getItemsQueryKey(input),
|
|
419
417
|
...filter,
|
|
@@ -529,8 +527,8 @@ export class TestApiOptionsProxy {
|
|
|
529
527
|
}
|
|
530
528
|
private _listRecordsQueryFilter(
|
|
531
529
|
input: ListRecordsRequest,
|
|
532
|
-
filter?: QueryFilters
|
|
533
|
-
): QueryFilters
|
|
530
|
+
filter?: QueryFilters,
|
|
531
|
+
): QueryFilters {
|
|
534
532
|
return {
|
|
535
533
|
queryKey: this._listRecordsQueryKey(input),
|
|
536
534
|
...filter,
|
|
@@ -687,9 +685,7 @@ export class TestApiOptionsProxy {
|
|
|
687
685
|
...options,
|
|
688
686
|
};
|
|
689
687
|
}
|
|
690
|
-
private _getErrorQueryFilter(
|
|
691
|
-
filter?: QueryFilters<GetError200Response, GetErrorError>,
|
|
692
|
-
): QueryFilters<GetError200Response, GetErrorError> {
|
|
688
|
+
private _getErrorQueryFilter(filter?: QueryFilters): QueryFilters {
|
|
693
689
|
return {
|
|
694
690
|
queryKey: this._getErrorQueryKey(),
|
|
695
691
|
...filter,
|
|
@@ -809,8 +805,8 @@ export class TestApiOptionsProxy {
|
|
|
809
805
|
}
|
|
810
806
|
private _streamLogsQueryFilter(
|
|
811
807
|
input: StreamLogsRequest,
|
|
812
|
-
filter?: QueryFilters
|
|
813
|
-
): QueryFilters
|
|
808
|
+
filter?: QueryFilters,
|
|
809
|
+
): QueryFilters {
|
|
814
810
|
return {
|
|
815
811
|
queryKey: this._streamLogsQueryKey(input),
|
|
816
812
|
...filter,
|
|
@@ -1074,8 +1070,8 @@ export class TestApiOptionsProxy {
|
|
|
1074
1070
|
}
|
|
1075
1071
|
private _streamEventsQueryFilter(
|
|
1076
1072
|
input: StreamEventsRequest,
|
|
1077
|
-
filter?: QueryFilters
|
|
1078
|
-
): QueryFilters
|
|
1073
|
+
filter?: QueryFilters,
|
|
1074
|
+
): QueryFilters {
|
|
1079
1075
|
return {
|
|
1080
1076
|
queryKey: this._streamEventsQueryKey(input),
|
|
1081
1077
|
...filter,
|
|
@@ -133,7 +133,7 @@ export class <%- className %>OptionsProxy {
|
|
|
133
133
|
...options,
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
private _<%- op.uniqueName %>QueryFilter(<%- input %><% if (op.parameters.length > 0) { %>, <% } %>filter?: QueryFilters
|
|
136
|
+
private _<%- op.uniqueName %>QueryFilter(<%- input %><% if (op.parameters.length > 0) { %>, <% } %>filter?: QueryFilters): QueryFilters {
|
|
137
137
|
return {
|
|
138
138
|
queryKey: this._<%- op.uniqueName %>QueryKey(<% if (op.parameters.length > 0) { %>input<% } %>),
|
|
139
139
|
...filter,
|
|
@@ -24,7 +24,7 @@ class MetricsAspect implements IAspect {
|
|
|
24
24
|
const version = '';
|
|
25
25
|
const tags: string[] = [];
|
|
26
26
|
node.templateOptions.description =
|
|
27
|
-
\`\${node.templateOptions.description ?? ''} (\${id}) (version:\${version}) (
|
|
27
|
+
\`\${node.templateOptions.description ?? ''} (\${id}) (version:\${version}) (tag:\${tags.join(',')})\`.trim();
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -18,7 +18,7 @@ class MetricsAspect implements IAspect {
|
|
|
18
18
|
const id = '';
|
|
19
19
|
const version = '';
|
|
20
20
|
const tags: string[] = [];
|
|
21
|
-
node.templateOptions.description = `${node.templateOptions.description ?? ''} (${id}) (version:${version}) (
|
|
21
|
+
node.templateOptions.description = `${node.templateOptions.description ?? ''} (${id}) (version:${version}) (tag:${tags.join(',')})`.trim();
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare const VERSIONS: {
|
|
|
17
17
|
readonly '@cloudscape-design/board-components': "^3.0.94";
|
|
18
18
|
readonly '@cloudscape-design/components': "^3.0.928";
|
|
19
19
|
readonly '@cloudscape-design/global-styles': "^1.0.38";
|
|
20
|
-
readonly '@tanstack/react-query': "^5.
|
|
20
|
+
readonly '@tanstack/react-query': "^5.74.3";
|
|
21
21
|
readonly '@trpc/tanstack-react-query': "11.0.0";
|
|
22
22
|
readonly '@trpc/client': "11.0.0";
|
|
23
23
|
readonly '@trpc/server': "11.0.0";
|
|
@@ -44,5 +44,5 @@ export declare const VERSIONS: {
|
|
|
44
44
|
* Add versions to the given dependencies
|
|
45
45
|
*/
|
|
46
46
|
export declare const withVersions: (deps: (keyof typeof VERSIONS)[]) => {
|
|
47
|
-
[k: string]: "^0.0.60" | "^2.185.0-alpha.0" | "^3.775.0" | "^2.17.0" | "^20.12.0" | "^1.114.27" | "^3.0.94" | "^3.0.928" | "^1.0.38" | "^5.
|
|
47
|
+
[k: string]: "^0.0.60" | "^2.185.0-alpha.0" | "^3.775.0" | "^2.17.0" | "^20.12.0" | "^1.114.27" | "^3.0.94" | "^3.0.928" | "^1.0.38" | "^5.74.3" | "11.0.0" | "^22.13.13" | "^8.10.148" | "^4.2.0" | "^1.0.20" | "^2.1006.0" | "^2.185.0" | "^3.10.3" | "^10.4.2" | "^0.25.1" | "^5.2.5" | "^2.4.0" | "^3.2.0" | "^3.5.3" | "^0.5.21" | "^4.19.3" | "^5.1.4" | "^3.24.2";
|
|
48
48
|
};
|
package/src/utils/versions.js
CHANGED
|
@@ -20,7 +20,7 @@ exports.VERSIONS = {
|
|
|
20
20
|
'@cloudscape-design/board-components': '^3.0.94',
|
|
21
21
|
'@cloudscape-design/components': '^3.0.928',
|
|
22
22
|
'@cloudscape-design/global-styles': '^1.0.38',
|
|
23
|
-
'@tanstack/react-query': '^5.
|
|
23
|
+
'@tanstack/react-query': '^5.74.3',
|
|
24
24
|
'@trpc/tanstack-react-query': '11.0.0',
|
|
25
25
|
'@trpc/client': '11.0.0',
|
|
26
26
|
'@trpc/server': '11.0.0',
|