@aws/nx-plugin-mcp 0.120.0 → 0.121.0

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.
Files changed (82) hide show
  1. package/bin/aws-nx-mcp.js +23 -35
  2. package/docs/guides/astro-docs.mdx +142 -0
  3. package/docs/guides/connection/py-agent-a2a.mdx +105 -0
  4. package/docs/guides/connection/py-agent-mcp.mdx +147 -0
  5. package/docs/guides/connection/react-agui.mdx +240 -0
  6. package/docs/guides/connection/react-fastapi.mdx +1476 -0
  7. package/docs/guides/connection/react-py-agent.mdx +198 -0
  8. package/docs/guides/connection/react-smithy.mdx +1355 -0
  9. package/docs/guides/connection/react-trpc.mdx +447 -0
  10. package/docs/guides/connection/react-ts-agent.mdx +198 -0
  11. package/docs/guides/connection/smithy-rdb.mdx +161 -0
  12. package/docs/guides/connection/trpc-rdb.mdx +127 -0
  13. package/docs/guides/connection/ts-agent-a2a.mdx +106 -0
  14. package/docs/guides/connection/ts-agent-mcp.mdx +144 -0
  15. package/docs/guides/connection/ts-agent-rdb.mdx +141 -0
  16. package/docs/guides/connection/ts-mcp-server-rdb.mdx +135 -0
  17. package/docs/guides/connection.mdx +126 -0
  18. package/docs/guides/docker-bundling.mdx +403 -0
  19. package/docs/guides/fastapi.mdx +509 -0
  20. package/docs/guides/license.mdx +293 -0
  21. package/docs/guides/nx-generator.mdx +588 -0
  22. package/docs/guides/py-agent.mdx +483 -0
  23. package/docs/guides/py-mcp-server.mdx +161 -0
  24. package/docs/guides/python-lambda-function.mdx +207 -0
  25. package/docs/guides/python-project.mdx +228 -0
  26. package/docs/guides/react-website-auth.mdx +216 -0
  27. package/docs/guides/react-website.mdx +421 -0
  28. package/docs/guides/runtime-config.mdx +312 -0
  29. package/docs/guides/terraform-project.mdx +317 -0
  30. package/docs/guides/trpc.mdx +816 -0
  31. package/docs/guides/ts-agent.mdx +436 -0
  32. package/docs/guides/ts-lambda-function.mdx +218 -0
  33. package/docs/guides/ts-mcp-server.mdx +169 -0
  34. package/docs/guides/ts-nx-plugin.mdx +159 -0
  35. package/docs/guides/ts-rdb.mdx +759 -0
  36. package/docs/guides/ts-smithy-api.mdx +661 -0
  37. package/docs/guides/typescript-infrastructure.mdx +408 -0
  38. package/docs/guides/typescript-project.mdx +312 -0
  39. package/docs/guides/workspace.mdx +181 -0
  40. package/docs/snippets/agent/architecture.mdx +72 -0
  41. package/docs/snippets/agent/bedrock-deployment.mdx +172 -0
  42. package/docs/snippets/agent/runtime-arn.mdx +64 -0
  43. package/docs/snippets/api/api-architecture.mdx +93 -0
  44. package/docs/snippets/api/api-choice-note.mdx +6 -0
  45. package/docs/snippets/api/cors-configuration-cdk-note.mdx +25 -0
  46. package/docs/snippets/api/cors-configuration-terraform-note.mdx +28 -0
  47. package/docs/snippets/api/shared-constructs.mdx +38 -0
  48. package/docs/snippets/api/type-safe-api-integrations.mdx +643 -0
  49. package/docs/snippets/api/waf-configuration.mdx +37 -0
  50. package/docs/snippets/connection/a2a-infrastructure.mdx +63 -0
  51. package/docs/snippets/connection/lambda-rdb-ssl-requirements.mdx +40 -0
  52. package/docs/snippets/connection/mcp-server-rdb-ssl-requirements.mdx +35 -0
  53. package/docs/snippets/connection/rdb-api-infrastructure.mdx +72 -0
  54. package/docs/snippets/connection/react-agent-infrastructure.mdx +61 -0
  55. package/docs/snippets/connection/strands-agent-rdb-ssl-requirements.mdx +35 -0
  56. package/docs/snippets/lambda-function/architecture.mdx +36 -0
  57. package/docs/snippets/lambda-function/deploying-your-function.mdx +118 -0
  58. package/docs/snippets/mcp/architecture.mdx +58 -0
  59. package/docs/snippets/mcp/assistant-docs.mdx +10 -0
  60. package/docs/snippets/mcp/bedrock-deployment.mdx +167 -0
  61. package/docs/snippets/mcp/config.mdx +13 -0
  62. package/docs/snippets/mcp/configuration-py.mdx +42 -0
  63. package/docs/snippets/mcp/configuration-ts.mdx +53 -0
  64. package/docs/snippets/mcp/observability.mdx +8 -0
  65. package/docs/snippets/mcp/shared-constructs.mdx +32 -0
  66. package/docs/snippets/pdk-migration/example/01-migrate-api.mdx +602 -0
  67. package/docs/snippets/pdk-migration/example/02-migrate-website.mdx +915 -0
  68. package/docs/snippets/pdk-migration/example/03-migrate-infra.mdx +161 -0
  69. package/docs/snippets/pdk-migration/example/04-deploy.mdx +229 -0
  70. package/docs/snippets/pdk-migration/faq/aws-arch.mdx +17 -0
  71. package/docs/snippets/pdk-migration/faq/cdk-graph.mdx +29 -0
  72. package/docs/snippets/pdk-migration/faq/infrastructure-python-java.mdx +19 -0
  73. package/docs/snippets/pdk-migration/faq/pdk-nag.mdx +15 -0
  74. package/docs/snippets/pdk-migration/faq/pipeline.mdx +15 -0
  75. package/docs/snippets/pdk-migration/faq/type-safe-api.mdx +310 -0
  76. package/docs/snippets/pdk-migration/faq/use-of-projen.mdx +15 -0
  77. package/docs/snippets/prerequisites.mdx +20 -0
  78. package/docs/snippets/required-prerequisites.mdx +12 -0
  79. package/docs/snippets/shared-constructs.mdx +40 -0
  80. package/docs/snippets/tools/acurl.mdx +73 -0
  81. package/docs/snippets/ts-bundle.mdx +14 -0
  82. package/package.json +1 -1
@@ -0,0 +1,293 @@
1
+ ---
2
+ title: License
3
+ description: Reference documentation for the License generator
4
+ generator: license
5
+ ---
6
+ import { FileTree } from '@astrojs/starlight/components';
7
+ import RunGenerator from '@components/run-generator.astro';
8
+ import GeneratorParameters from '@components/generator-parameters.astro';
9
+
10
+ Automatically manage `LICENSE` files and source code headers in your workspace.
11
+
12
+ This generator registers a [sync generator](https://nx.dev/concepts/sync-generators) to execute as part of your `lint` targets which will ensure that your source files conform to the desired license content and format, as well as ensuring that your project's `LICENSE` files are correct, and licensing information is included in relevant project files (`package.json`, `pyproject.toml`).
13
+
14
+ ## Usage
15
+
16
+ ### Run the Generator
17
+
18
+ <RunGenerator generator="license" />
19
+
20
+ ### Options
21
+
22
+ <GeneratorParameters generator="license" />
23
+
24
+ ## Generator Output
25
+
26
+ The generator will create or update the following files:
27
+
28
+ <FileTree>
29
+ - nx.json The lint target is configured to run the license sync generator
30
+ - aws-nx-plugin.config.mts Configuration for the license sync generator
31
+ </FileTree>
32
+
33
+ Some default configuration for license header content and format is added to `aws-nx-plugin.config.mts` to write appropriate headers for a handful of file types. You may wish to customise this further; please see the [configuration section](#configuration) below.
34
+
35
+ ## Workflow
36
+
37
+ Whenever you build your projects (and a `lint` target runs), the license sync generator will make sure that the licensing in your project matches your configuration (see [license sync behaviour below](#license-sync-behaviour)). If it detects that anything is out of sync, you will receive a message such as:
38
+
39
+ ```bash
40
+ NX The workspace is out of sync
41
+
42
+ [@aws/nx-plugin:license#sync]: Project LICENSE files are out of sync:
43
+ - LICENSE
44
+ - packages/<my-project>LICENSE
45
+
46
+ Project package.json files are out of sync:
47
+ - package.json
48
+
49
+ Project pyproject.toml files are out of sync:
50
+ - pyproject.toml
51
+ - packages/<my-python-project>/pyproject.toml
52
+
53
+ License headers are out of sync in the following source files:
54
+ - packages/<my-project>/src/index.ts
55
+ - packages/<my-python-project>/main.py
56
+
57
+ This will result in an error in CI.
58
+
59
+ ? Would you like to sync the identified changes to get your workspace up to date?
60
+ Yes, sync the changes and run the tasks
61
+ No, run the tasks without syncing the changes
62
+ ```
63
+
64
+ Select `Yes` to sync the changes.
65
+
66
+ :::note[Review Changes]
67
+ Make sure you check the changes the license sync generator makes in to version control to ensure that any continuous integration build tasks don't fail due to licenses being out of sync.
68
+ :::
69
+
70
+ ## License Sync Behaviour
71
+
72
+ The license sync generator performs three main tasks:
73
+
74
+ ### 1. Synchronise Source File License Headers
75
+
76
+ When the sync generator is run, it will ensure that all source code files in your workspace (based on your configuration) contain the appropriate license header. The header is written as the first block comment or consecutive series of line comments in the file (besides the shebang/hashbang if present in a file).
77
+
78
+ You can update the configuration at any time to change which files should be included or excluded, as well as the content or format of license headers for different file types. For more details, please see the [configuration section](#configuration) below.
79
+
80
+ ### 2. Synchronise LICENSE Files
81
+
82
+ When the sync generator is run, it will ensure that the root `LICENSE` file corresponds to your configured license, as well as ensuring that all subprojects in your workspace also contain the correct `LICENSE` file.
83
+
84
+ You can exclude projects in the configuration if required. For more details, please see the [configuration section](#configuration) below.
85
+
86
+ ### 3. Synchronise licensing information in project files
87
+
88
+ When the sync generator is run, it will ensure the `license` fields in `package.json` and `pyproject.toml` files are set to your configured license.
89
+
90
+ You can exclude projects in the configuration if required. For more details, please see the [configuration section](#configuration) below.
91
+
92
+ ## Configuration
93
+
94
+ Configuration is defined in the `aws-nx-plugin.config.mts` file in the root of your workspace.
95
+
96
+ ### SPDX and Copyright Holder
97
+
98
+ Your chosen license can be updated at any time via the `spdx` configuration property:
99
+
100
+ ```typescript title="aws-nx-plugin.config.mts" {3}
101
+ export default {
102
+ license: {
103
+ spdx: 'MIT',
104
+ },
105
+ } satisfies AwsNxPluginConfig;
106
+ ```
107
+
108
+ When the sync generator runs, all `LICENSE` files, `package.json` and `pyproject.toml` files will be updated to reflect the configured license.
109
+
110
+ You can additionally configure the copyright holder and copyright year, which are included in some `LICENSE` files:
111
+
112
+ ```typescript title="aws-nx-plugin.config.mts" {4,5}
113
+ export default {
114
+ license: {
115
+ spdx: 'MIT',
116
+ copyrightHolder: 'Amazon.com, Inc. or its affiliates',
117
+ copyrightYear: 2025,
118
+ },
119
+ } satisfies AwsNxPluginConfig;
120
+ ```
121
+
122
+ ### License Headers
123
+
124
+ #### Content
125
+
126
+ The license header content can be configured in two ways:
127
+
128
+ 1. Using inline content:
129
+
130
+ ```typescript title="aws-nx-plugin.config.mts" {5-9}
131
+ export default {
132
+ license: {
133
+ header: {
134
+ content: {
135
+ lines: [
136
+ 'Copyright: My Company, Incorporated.',
137
+ 'Licensed under the MIT License',
138
+ 'All rights reserved',
139
+ ];
140
+ }
141
+ // ... format configuration
142
+ }
143
+ }
144
+ } satisfies AwsNxPluginConfig;
145
+ ```
146
+
147
+ 2. Loading from a file:
148
+
149
+ ```typescript title="aws-nx-plugin.config.mts" {5}
150
+ export default {
151
+ license: {
152
+ header: {
153
+ content: {
154
+ filePath: 'license-header.txt'; // relative to workspace root
155
+ }
156
+ // ... format configuration
157
+ }
158
+ }
159
+ } satisfies AwsNxPluginConfig;
160
+ ```
161
+
162
+ #### Format
163
+
164
+ You can specify how license headers should be formatted for different file types using glob patterns. The format configuration supports line comments, block comments, or a combination of both:
165
+
166
+ ```typescript title="aws-nx-plugin.config.mts" {7-29}
167
+ export default {
168
+ license: {
169
+ header: {
170
+ content: {
171
+ lines: ['Copyright notice here'],
172
+ },
173
+ format: {
174
+ // Line comments
175
+ '**/*.ts': {
176
+ lineStart: '// ',
177
+ },
178
+ // Block comments
179
+ '**/*.css': {
180
+ blockStart: '/*',
181
+ blockEnd: '*/',
182
+ },
183
+ // Block comments with line prefixes
184
+ '**/*.java': {
185
+ blockStart: '/*',
186
+ lineStart: ' * ',
187
+ blockEnd: ' */',
188
+ },
189
+ // Line comments with header/footer
190
+ '**/*.py': {
191
+ blockStart: '# ------------',
192
+ lineStart: '# ',
193
+ blockEnd: '# ------------',
194
+ },
195
+ },
196
+ },
197
+ },
198
+ } satisfies AwsNxPluginConfig;
199
+ ```
200
+
201
+ The format configuration supports:
202
+
203
+ - `blockStart`: Text written before the license content (e.g. to start a block comment)
204
+ - `lineStart`: Text prepended to each line of the license content
205
+ - `lineEnd`: Text appended to each line of the license content
206
+ - `blockEnd`: Text written after the license content (e.g. to end a block comment)
207
+
208
+ #### Custom Comment Syntax
209
+
210
+ For file types that aren't natively supported, you can specify custom comment syntax to tell the sync generator how to identify existing license headers in these file types.
211
+
212
+ ```typescript title="aws-nx-plugin.config.mts" {12-22}
213
+ export default {
214
+ license: {
215
+ header: {
216
+ content: {
217
+ lines: ['My license header'],
218
+ },
219
+ format: {
220
+ '**/*.xyz': {
221
+ lineStart: '## ',
222
+ },
223
+ },
224
+ commentSyntax: {
225
+ xyz: {
226
+ line: '##', // Define line comment syntax
227
+ },
228
+ abc: {
229
+ block: {
230
+ // Define block comment syntax
231
+ start: '<!--',
232
+ end: '-->',
233
+ },
234
+ },
235
+ },
236
+ },
237
+ },
238
+ } satisfies AwsNxPluginConfig;
239
+ ```
240
+
241
+ #### Excluding files
242
+
243
+ By default, in a git repository, all `.gitignore` files are honored to ensure that only files managed by version control are synchronized. In non-git repositories, all files are considered unless explicitly excluded in configuration.
244
+
245
+ You can exclude additional files from license header synchronization using glob patterns:
246
+
247
+ ```typescript title="aws-nx-plugin.config.mts" {12-16}
248
+ export default {
249
+ license: {
250
+ header: {
251
+ content: {
252
+ lines: ['My license header'],
253
+ },
254
+ format: {
255
+ '**/*.ts': {
256
+ lineStart: '// ',
257
+ },
258
+ },
259
+ exclude: ['**/generated/**', '**/dist/**', 'some-specific-file.ts'],
260
+ },
261
+ },
262
+ } satisfies AwsNxPluginConfig;
263
+ ```
264
+
265
+ ### Excluding project files from sync
266
+
267
+ All `LICENSE` files, `package.json` files and `pyproject.toml` files are synchronised with the configured license by default.
268
+
269
+ You can exclude specific projects or files from synchronization using glob patterns:
270
+
271
+ ```typescript title="aws-nx-plugin.config.mts" {3-10}
272
+ export default {
273
+ license: {
274
+ files: {
275
+ exclude: [
276
+ // do not sync LICENSE file, package.json or pyproject.toml
277
+ 'packages/excluded-project',
278
+ // do not sync LICENSE file, but sync package.json and/or pyproject.toml
279
+ 'apps/internal/LICENSE',
280
+ ];
281
+ }
282
+ }
283
+ } satisfies AwsNxPluginConfig;
284
+ ```
285
+
286
+ ## Disabling license sync
287
+
288
+ To disable the license sync generator:
289
+
290
+ 1. Remove the `license` section from your configuration in `aws-nx-plugin.config.mts` (or remove the `aws-nx-plugin.config.mts` file)
291
+ 2. Remove the `@aws/nx-plugin:license#sync` generator from `targetDefaults.lint.syncGenerators`
292
+
293
+ To re-enable license sync, simply run the `license` generator again.