@aws/nx-plugin 0.99.1 → 0.101.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 (69) hide show
  1. package/LICENSE-THIRD-PARTY +14 -94
  2. package/generators.json +27 -19
  3. package/package.json +1 -1
  4. package/src/preset/__snapshots__/generator.spec.ts.snap +2 -0
  5. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +10 -10
  6. package/src/py/mcp-server/files/deploy/Dockerfile.template +1 -1
  7. package/src/py/mcp-server/generator.js +10 -2
  8. package/src/py/mcp-server/generator.js.map +1 -1
  9. package/src/py/strands-agent/__snapshots__/generator.spec.ts.snap +43 -12
  10. package/src/py/strands-agent/files/ag-ui/main.py.template +19 -0
  11. package/src/py/strands-agent/files/deploy/Dockerfile.template +3 -1
  12. package/src/py/strands-agent/generator.js +20 -7
  13. package/src/py/strands-agent/generator.js.map +1 -1
  14. package/src/py/strands-agent/react-connection/__snapshots__/generator.spec.ts.snap +133 -0
  15. package/src/py/strands-agent/react-connection/generator.js +69 -56
  16. package/src/py/strands-agent/react-connection/generator.js.map +1 -1
  17. package/src/py/strands-agent/react-connection/serve-local.d.ts +6 -2
  18. package/src/py/strands-agent/react-connection/serve-local.js +11 -6
  19. package/src/py/strands-agent/react-connection/serve-local.js.map +1 -1
  20. package/src/py/strands-agent/schema.d.ts +1 -1
  21. package/src/py/strands-agent/schema.json +2 -2
  22. package/src/ts/astro-docs/__snapshots__/generator.spec.ts.snap +223 -0
  23. package/src/ts/astro-docs/files/base/README.md.template +63 -0
  24. package/src/ts/astro-docs/files/base/astro.config.mjs.template +47 -0
  25. package/src/ts/astro-docs/files/base/src/components/link.astro.template +25 -0
  26. package/src/ts/astro-docs/files/base/src/components/snippet.astro.template +20 -0
  27. package/src/ts/astro-docs/files/base/src/content/docs/en/blog/welcome.mdx.template +13 -0
  28. package/src/ts/astro-docs/files/base/src/content/docs/en/guides/getting-started.mdx.template +64 -0
  29. package/src/ts/astro-docs/files/base/src/content/docs/en/index.mdx.template +29 -0
  30. package/src/ts/astro-docs/files/base/src/content/docs/en/snippets/example.mdx.template +7 -0
  31. package/src/ts/astro-docs/files/base/src/content.config.ts.template +13 -0
  32. package/src/ts/astro-docs/files/base/src/styles/custom.css.template +1 -0
  33. package/src/ts/astro-docs/files/base/tsconfig.json.template +12 -0
  34. package/src/ts/astro-docs/files/translation/scripts/translate.config.json.template +10 -0
  35. package/src/ts/astro-docs/files/translation/scripts/translate.ts.template +430 -0
  36. package/src/ts/astro-docs/generator.d.ts +10 -0
  37. package/src/ts/astro-docs/generator.js +113 -0
  38. package/src/ts/astro-docs/generator.js.map +1 -0
  39. package/src/ts/astro-docs/schema.d.ts +30 -0
  40. package/src/ts/astro-docs/schema.json +62 -0
  41. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +10 -10
  42. package/src/ts/mcp-server/files/Dockerfile.template +1 -1
  43. package/src/ts/mcp-server/generator.js +9 -1
  44. package/src/ts/mcp-server/generator.js.map +1 -1
  45. package/src/ts/react-website/agui/files/src/components/AguiProvider.tsx.template +19 -0
  46. package/src/ts/react-website/agui/files/src/hooks/useAgui__agentNameClassName__.tsx.template +142 -0
  47. package/src/ts/react-website/agui/generator.d.ts +26 -0
  48. package/src/ts/react-website/agui/generator.js +98 -0
  49. package/src/ts/react-website/agui/generator.js.map +1 -0
  50. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +49 -0
  51. package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +2 -0
  52. package/src/ts/strands-agent/__snapshots__/generator.spec.ts.snap +43 -12
  53. package/src/ts/strands-agent/files/deploy/Dockerfile.template +1 -1
  54. package/src/ts/strands-agent/generator.js +14 -1
  55. package/src/ts/strands-agent/generator.js.map +1 -1
  56. package/src/ts/strands-agent/schema.d.ts +1 -1
  57. package/src/ts/strands-agent/schema.json +2 -2
  58. package/src/utils/__snapshots__/shared-constructs.spec.ts.snap +24 -0
  59. package/src/utils/agent-core-constructs/agent-core-constructs.d.ts +3 -0
  60. package/src/utils/agent-core-constructs/agent-core-constructs.js +2 -0
  61. package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
  62. package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +26 -11
  63. package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +13 -1
  64. package/src/utils/files/common/constructs/src/core/index.ts.template +2 -1
  65. package/src/utils/files/common/constructs/src/core/workspace.ts.template +19 -0
  66. package/src/utils/versions.d.ts +18 -1
  67. package/src/utils/versions.js +17 -0
  68. package/src/utils/versions.js.map +1 -1
  69. package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/Dockerfile.template +0 -1
@@ -0,0 +1,63 @@
1
+ # <%= fullyQualifiedName %>
2
+
3
+ Documentation site generated with [@aws/nx-plugin](https://github.com/awslabs/nx-plugin-for-aws/),
4
+ powered by [Astro](https://astro.build/) and [Starlight](https://starlight.astro.build/).
5
+
6
+ ## Run locally
7
+
8
+ ```bash
9
+ <%= pkgMgrCmd %> nx start <%= fullyQualifiedName %>
10
+ ```
11
+
12
+ ## Build for production
13
+
14
+ ```bash
15
+ <%= pkgMgrCmd %> nx build <%= fullyQualifiedName %>
16
+ ```
17
+
18
+ ## Preview the production build
19
+
20
+ ```bash
21
+ <%= pkgMgrCmd %> nx preview <%= fullyQualifiedName %>
22
+ ```
23
+ <% if (includeTranslation) { %>
24
+ ## Translate documentation
25
+
26
+ This project is pre-wired with a translation script that uses a
27
+ [Strands Agent](https://strandsagents.com/) powered by Claude on
28
+ [Amazon Bedrock](https://aws.amazon.com/bedrock/) to translate documentation from
29
+ the source language (`en` by default) into every locale listed in
30
+ `scripts/translate.config.json`.
31
+
32
+ By default the `targetLanguages` list is empty — add the locale codes you want
33
+ to ship, for example:
34
+
35
+ ```json
36
+ "targetLanguages": ["fr", "de", "es", "ja", "ko"]
37
+ ```
38
+
39
+ Make sure each locale you list is also configured in `astro.config.mjs` under
40
+ `locales`.
41
+
42
+ Run the translator manually with:
43
+
44
+ ```bash
45
+ <%= pkgMgrCmd %> nx translate <%= fullyQualifiedName %> -- --all
46
+ ```
47
+
48
+ Translate only the files that changed since the last `docs: update translations`
49
+ commit:
50
+
51
+ ```bash
52
+ <%= pkgMgrCmd %> nx translate <%= fullyQualifiedName %>
53
+ ```
54
+
55
+ Other options in `scripts/translate.config.json`:
56
+
57
+ - `include` / `exclude` — glob patterns for docs files, relative to the source
58
+ language directory.
59
+ - `modelId` — Bedrock model id.
60
+ - `awsRegion` — Bedrock region; can be overridden with the `AWS_REGION` env var.
61
+ - `concurrency` — cap on concurrent Bedrock requests (one agent per file ×
62
+ target language).
63
+ <% } %>
@@ -0,0 +1,47 @@
1
+ // @ts-check
2
+ import { defineConfig } from 'astro/config';
3
+
4
+ import starlight from '@astrojs/starlight';
5
+ <% if (includeBlog) { %>import starlightBlog from 'starlight-blog';
6
+ <% } %>
7
+ // https://astro.build/config
8
+ export default defineConfig({
9
+ outDir: './dist',
10
+ // Redirect the root URL to the default locale so visitors land on localised content.
11
+ redirects: {
12
+ '/': '/en',
13
+ },
14
+ integrations: [
15
+ starlight({
16
+ title: '<%= title %>',
17
+ social: [],
18
+ tableOfContents: {
19
+ minHeadingLevel: 2,
20
+ maxHeadingLevel: 4,
21
+ },
22
+ defaultLocale: 'en',
23
+ locales: {
24
+ en: {
25
+ label: 'English',
26
+ },
27
+ },
28
+ sidebar: [
29
+ {
30
+ label: 'Getting started',
31
+ items: [{ slug: 'guides/getting-started' }],
32
+ },
33
+ ],
34
+ customCss: ['./src/styles/custom.css'],
35
+ plugins: [<% if (includeBlog) { %>
36
+ starlightBlog({
37
+ authors: {
38
+ default: {
39
+ name: 'Docs Author',
40
+ title: 'Maintainer',
41
+ },
42
+ },
43
+ }),
44
+ <% } %>],
45
+ }),
46
+ ],
47
+ });
@@ -0,0 +1,25 @@
1
+ ---
2
+ import { getRelativeLocaleUrl } from 'astro:i18n';
3
+ import { LinkButton } from '@astrojs/starlight/components';
4
+
5
+ // Resolve an internal docs path against the current locale so a single source of
6
+ // truth (the `path` prop) produces a correct URL in every language. Callers pass
7
+ // a locale-agnostic path like `guides/getting-started`.
8
+ const { path, type } = Astro.props;
9
+ let resolvedPath = getRelativeLocaleUrl(Astro.currentLocale || 'en', path);
10
+ if (resolvedPath.endsWith('/')) {
11
+ resolvedPath = resolvedPath.slice(0, -1);
12
+ }
13
+ ---
14
+
15
+ {
16
+ type === 'button' ? (
17
+ <LinkButton href={resolvedPath}>
18
+ <slot />
19
+ </LinkButton>
20
+ ) : (
21
+ <a href={resolvedPath}>
22
+ <slot />
23
+ </a>
24
+ )
25
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ import { Aside } from '@astrojs/starlight/components';
3
+
4
+ const locale = Astro.currentLocale || 'en';
5
+ const snippets = Object.values(
6
+ import.meta.glob('../content/docs/*/snippets/**/*.mdx', { eager: true })
7
+ );
8
+ const { name } = Astro.props;
9
+ const snippet = snippets.find((s) =>
10
+ s.file.endsWith(`content/docs/${locale}/snippets/${name}.mdx`)
11
+ );
12
+ ---
13
+
14
+ {
15
+ snippet ? (
16
+ <snippet.Content />
17
+ ) : (
18
+ <Aside type="danger">Unable to load snippet {name} for locale {locale}</Aside>
19
+ )
20
+ }
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: Welcome to <%= title %>
3
+ date: <%= today %>
4
+ authors:
5
+ - default
6
+ ---
7
+
8
+ Welcome to the **<%= title %>** blog! This post was scaffolded by the
9
+ `ts#astro-docs` generator.
10
+
11
+ The blog is powered by the [`starlight-blog`](https://starlight-blog-docs.vercel.app/)
12
+ plugin. Add new entries as MDX files under `src/content/docs/<locale>/blog/` with
13
+ `title`, `date` and `authors` frontmatter.
@@ -0,0 +1,64 @@
1
+ ---
2
+ title: Getting started
3
+ description: Running your new Astro + Starlight docs site.
4
+ ---
5
+
6
+ import Link from '@components/link.astro';
7
+ import Snippet from '@components/snippet.astro';
8
+
9
+ Welcome to **<%= title %>**! This site is built with [Astro](https://astro.build/) and the
10
+ [Starlight](https://starlight.astro.build/) documentation theme.
11
+
12
+ ## Run locally
13
+
14
+ ```bash
15
+ <%= pkgMgrCmd %> nx start <%= fullyQualifiedName %>
16
+ ```
17
+
18
+ ## Build for production
19
+
20
+ ```bash
21
+ <%= pkgMgrCmd %> nx build <%= fullyQualifiedName %>
22
+ ```
23
+
24
+ ## Adding a locale
25
+
26
+ Add an entry to the `locales` block in `astro.config.mjs` and create a matching
27
+ directory under `src/content/docs/<locale>/`. Starlight will pick up the new locale
28
+ automatically.
29
+ <% if (includeTranslation) { %>
30
+ :::note[Keep the translation config in sync]
31
+ When you add a new locale, also add its code to `targetLanguages` in
32
+ `scripts/translate.config.json` so the `translate` task will keep it up to date.
33
+ :::
34
+ <% } %>
35
+ ## Locale-aware links
36
+
37
+ Use the generated `Link` component whenever you want to link to another page
38
+ **inside** your docs — it automatically resolves the current locale, so a single
39
+ source of truth produces the right URL in every language:
40
+
41
+ ```mdx
42
+ import Link from '@components/link.astro';
43
+
44
+ <Link path="guides/getting-started">Read the getting-started guide</Link>
45
+ ```
46
+
47
+ Here is the component in action: <Link path="guides/getting-started">back to this page</Link>.
48
+
49
+ For regular external links, just use ordinary Markdown `[label](url)`.
50
+
51
+ ## Using snippets
52
+
53
+ Snippets are reusable fragments of MDX stored in `src/content/docs/<locale>/snippets/`.
54
+ Include one in any page with the `Snippet` component:
55
+
56
+ ```mdx
57
+ import Snippet from '@components/snippet.astro';
58
+
59
+ <Snippet name="example" />
60
+ ```
61
+
62
+ Here is the example snippet rendered inline:
63
+
64
+ <Snippet name="example" />
@@ -0,0 +1,29 @@
1
+ ---
2
+ title: <%= title %>
3
+ description: Documentation for <%= title %>.
4
+ template: splash
5
+ hero:
6
+ title: <%= title %>
7
+ tagline: Project documentation built with Astro and Starlight.
8
+ actions:
9
+ - text: Get started
10
+ link: /en/guides/getting-started
11
+ icon: right-arrow
12
+ ---
13
+
14
+ import { CardGrid, Card } from '@astrojs/starlight/components';
15
+
16
+ <CardGrid>
17
+ <Card title="Guides" icon="open-book">
18
+ Reference documentation for <%= title %>.
19
+ </Card>
20
+ <Card title="Blog" icon="pencil">
21
+ News and updates from the team.
22
+ </Card>
23
+ <Card title="Snippets" icon="seti:config">
24
+ Reusable content fragments used across the docs.
25
+ </Card>
26
+ <Card title="Localised" icon="translate">
27
+ Localisation is configured out of the box — add target locales in `astro.config.mjs`.
28
+ </Card>
29
+ </CardGrid>
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: Example snippet
3
+ ---
4
+
5
+ This is an **example snippet**. Snippets are reusable fragments of MDX stored
6
+ under `src/content/docs/<locale>/snippets/`. Import them into any page with the
7
+ `<Snippet />` component.
@@ -0,0 +1,13 @@
1
+ import { defineCollection } from 'astro:content';
2
+ import { docsLoader } from '@astrojs/starlight/loaders';
3
+ import { docsSchema } from '@astrojs/starlight/schema';
4
+ import { blogSchema } from 'starlight-blog/schema';
5
+
6
+ export const collections = {
7
+ docs: defineCollection({
8
+ loader: docsLoader(),
9
+ schema: docsSchema({
10
+ extend: (context) => blogSchema(context),
11
+ }),
12
+ }),
13
+ };
@@ -0,0 +1 @@
1
+ /* Customise the appearance of the Starlight docs theme here. */
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "astro/tsconfigs/strict",
3
+ "include": [".astro/types.d.ts", "**/*"],
4
+ "exclude": ["dist"],
5
+ "compilerOptions": {
6
+ "baseUrl": ".",
7
+ "paths": {
8
+ "@components/*": ["src/components/*"],
9
+ "@assets/*": ["src/content/docs/assets/*"]
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "sourceLanguage": "en",
3
+ "targetLanguages": [],
4
+ "docsDir": "src/content/docs",
5
+ "include": ["**/*.md", "**/*.mdx"],
6
+ "exclude": [],
7
+ "modelId": "us.anthropic.claude-sonnet-4-5-20250929-v1:0",
8
+ "awsRegion": "us-west-2",
9
+ "concurrency": 5
10
+ }