@aws/nx-plugin 0.116.0 → 0.118.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.
- package/LICENSE-THIRD-PARTY +557 -327
- package/README.md +3 -3
- package/generators.json +43 -43
- package/package.json +9 -9
- package/sdk/py.d.ts +2 -2
- package/sdk/py.js +3 -3
- package/sdk/py.js.map +1 -1
- package/sdk/ts.d.ts +2 -2
- package/sdk/ts.js +4 -4
- package/sdk/ts.js.map +1 -1
- package/src/connection/generator.js +29 -29
- package/src/connection/generator.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +20 -20
- package/src/preset/__snapshots__/generator.spec.ts.snap +5 -5
- package/src/py/{strands-agent → agent}/__snapshots__/generator.spec.ts.snap +18 -18
- package/src/py/agent/a2a-connection/generator.d.ts +10 -0
- package/src/py/{strands-agent → agent}/a2a-connection/generator.js +7 -7
- package/src/py/agent/a2a-connection/generator.js.map +1 -0
- package/src/py/{strands-agent → agent}/a2a-connection/schema.d.ts +1 -1
- package/src/py/{strands-agent → agent}/a2a-connection/schema.json +5 -5
- package/src/py/agent/generator.d.ts +10 -0
- package/src/py/{strands-agent → agent}/generator.js +7 -9
- package/src/py/agent/generator.js.map +1 -0
- package/src/py/{strands-agent → agent}/mcp-connection/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/py/agent/mcp-connection/generator.d.ts +10 -0
- package/src/py/{strands-agent → agent}/mcp-connection/generator.js +7 -7
- package/src/py/agent/mcp-connection/generator.js.map +1 -0
- package/src/{ts/strands-agent/a2a-connection → py/agent/mcp-connection}/schema.d.ts +1 -1
- package/src/py/{strands-agent → agent}/mcp-connection/schema.json +4 -4
- package/src/{ts/strands-agent → py/agent}/react-connection/generator.d.ts +3 -3
- package/src/py/{strands-agent → agent}/react-connection/generator.js +7 -7
- package/src/py/agent/react-connection/generator.js.map +1 -0
- package/src/py/{strands-agent/mcp-connection → agent/react-connection}/schema.d.ts +1 -1
- package/src/py/{strands-agent → agent}/react-connection/schema.json +4 -4
- package/src/py/{strands-agent → agent}/react-connection/serve-local.d.ts +2 -2
- package/src/py/{strands-agent → agent}/react-connection/serve-local.js +3 -3
- package/src/py/agent/react-connection/serve-local.js.map +1 -0
- package/src/py/agent/schema.d.ts +22 -0
- package/src/{ts/strands-agent → py/agent}/schema.json +21 -13
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/{strands-agent → agent}/__snapshots__/generator.spec.ts.snap +15 -15
- package/src/ts/agent/a2a-connection/generator.d.ts +10 -0
- package/src/ts/{strands-agent → agent}/a2a-connection/generator.js +7 -7
- package/src/ts/agent/a2a-connection/generator.js.map +1 -0
- package/src/ts/{strands-agent/mcp-connection → agent/a2a-connection}/schema.d.ts +1 -1
- package/src/ts/{strands-agent → agent}/a2a-connection/schema.json +5 -5
- package/src/ts/agent/files/ag-ui/index.ts.template +37 -0
- package/src/ts/agent/generator.d.ts +10 -0
- package/src/ts/{strands-agent → agent}/generator.js +34 -27
- package/src/ts/agent/generator.js.map +1 -0
- package/src/ts/{strands-agent → agent}/mcp-connection/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/ts/agent/mcp-connection/generator.d.ts +10 -0
- package/src/ts/{strands-agent → agent}/mcp-connection/generator.js +7 -7
- package/src/ts/agent/mcp-connection/generator.js.map +1 -0
- package/src/ts/agent/mcp-connection/schema.d.ts +15 -0
- package/src/ts/{strands-agent → agent}/mcp-connection/schema.json +4 -4
- package/src/{py/strands-agent → ts/agent}/react-connection/generator.d.ts +3 -3
- package/src/ts/{strands-agent → agent}/react-connection/generator.js +30 -8
- package/src/ts/agent/react-connection/generator.js.map +1 -0
- package/src/ts/agent/react-connection/schema.d.ts +15 -0
- package/src/ts/{strands-agent → agent}/react-connection/schema.json +5 -5
- package/src/ts/agent/react-connection/serve-local.d.ts +13 -0
- package/src/ts/agent/react-connection/serve-local.js +19 -0
- package/src/ts/agent/react-connection/serve-local.js.map +1 -0
- package/src/ts/agent/schema.d.ts +22 -0
- package/src/{py/strands-agent → ts/agent}/schema.json +21 -13
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/rdb/{strands-agent-connection → agent-connection}/__snapshots__/generator.spec.ts.snap +12 -12
- package/src/ts/rdb/agent-connection/generator.d.ts +10 -0
- package/src/ts/rdb/{strands-agent-connection → agent-connection}/generator.js +6 -6
- package/src/ts/rdb/agent-connection/generator.js.map +1 -0
- package/src/ts/rdb/{strands-agent-connection → agent-connection}/schema.d.ts +1 -1
- package/src/ts/rdb/{strands-agent-connection → agent-connection}/schema.json +4 -4
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +43 -43
- package/src/utils/agent-connection/agent-connection.js +2 -2
- package/src/utils/agent-connection/agent-connection.js.map +1 -1
- package/src/utils/agent-connection/files/py-core-runtime-config/runtime_config.py.template +1 -4
- package/src/utils/files/common/shadcn/src/components/ui/sidebar.tsx.template +1 -1
- package/src/utils/versions.d.ts +57 -54
- package/src/utils/versions.js +56 -53
- package/src/utils/versions.js.map +1 -1
- package/src/py/strands-agent/a2a-connection/generator.d.ts +0 -10
- package/src/py/strands-agent/a2a-connection/generator.js.map +0 -1
- package/src/py/strands-agent/generator.d.ts +0 -10
- package/src/py/strands-agent/generator.js.map +0 -1
- package/src/py/strands-agent/mcp-connection/generator.d.ts +0 -10
- package/src/py/strands-agent/mcp-connection/generator.js.map +0 -1
- package/src/py/strands-agent/react-connection/generator.js.map +0 -1
- package/src/py/strands-agent/react-connection/schema.d.ts +0 -15
- package/src/py/strands-agent/react-connection/serve-local.js.map +0 -1
- package/src/py/strands-agent/schema.d.ts +0 -20
- package/src/ts/rdb/strands-agent-connection/generator.d.ts +0 -10
- package/src/ts/rdb/strands-agent-connection/generator.js.map +0 -1
- package/src/ts/strands-agent/a2a-connection/generator.d.ts +0 -10
- package/src/ts/strands-agent/a2a-connection/generator.js.map +0 -1
- package/src/ts/strands-agent/generator.d.ts +0 -10
- package/src/ts/strands-agent/generator.js.map +0 -1
- package/src/ts/strands-agent/mcp-connection/generator.d.ts +0 -10
- package/src/ts/strands-agent/mcp-connection/generator.js.map +0 -1
- package/src/ts/strands-agent/react-connection/generator.js.map +0 -1
- package/src/ts/strands-agent/react-connection/schema.d.ts +0 -15
- package/src/ts/strands-agent/react-connection/serve-local.d.ts +0 -17
- package/src/ts/strands-agent/react-connection/serve-local.js +0 -19
- package/src/ts/strands-agent/react-connection/serve-local.js.map +0 -1
- package/src/ts/strands-agent/schema.d.ts +0 -20
- /package/src/py/{strands-agent → agent}/a2a-connection/files/agent-connection/app/__targetAgentSnakeCase___client.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/a2a/main.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/ag-ui/main.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/common/__init__.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/common/agent.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/deploy/Dockerfile.template +0 -0
- /package/src/py/{strands-agent → agent}/files/http/init.py.template +0 -0
- /package/src/py/{strands-agent → agent}/files/http/main.py.template +0 -0
- /package/src/py/{strands-agent → agent}/mcp-connection/files/agent-connection/app/__mcpServerSnakeCase___client.py.template +0 -0
- /package/src/py/{strands-agent → agent}/react-connection/__snapshots__/generator.spec.ts.snap +0 -0
- /package/src/py/{strands-agent → agent}/react-connection/files/agent/scripts/__agentNameSnakeCase___openapi.py.template +0 -0
- /package/src/py/{strands-agent → agent}/scripts/http/chat.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/a2a-connection/files/agent-connection/app/__targetAgentKebabCase__-client.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/a2a/index.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/common/agent.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/deploy/Dockerfile.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/agent-core-trpc-client.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/client.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/index.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/init.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/router.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/files/http/schema/z-async-iterable.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/mcp-connection/files/agent-connection/app/__mcpServerKebabCase__-client.ts.template +0 -0
- /package/src/ts/{strands-agent → agent}/react-connection/__snapshots__/generator.spec.ts.snap +0 -0
- /package/src/ts/{strands-agent → agent}/react-connection/files/src/components/__agentNameClassName__AgentClientProvider.tsx.template +0 -0
- /package/src/ts/{strands-agent → agent}/react-connection/files/src/hooks/use__agentNameClassName__Agent.tsx.template +0 -0
- /package/src/ts/{strands-agent → agent}/scripts/http/chat.ts.template +0 -0
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
import { Tree } from '@nx/devkit';
|
|
6
6
|
import { NxGeneratorInfo } from '../../../utils/nx';
|
|
7
7
|
import { ResolvedConnectionOptions } from '../../../connection/generator';
|
|
8
|
-
export declare const
|
|
9
|
-
export declare
|
|
10
|
-
export default
|
|
8
|
+
export declare const TS_AGENT_REACT_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare function tsAgentReactConnectionGenerator(tree: Tree, options: ResolvedConnectionOptions): Promise<() => void>;
|
|
10
|
+
export default tsAgentReactConnectionGenerator;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.TS_AGENT_REACT_CONNECTION_GENERATOR_INFO = void 0;
|
|
4
|
+
exports.tsAgentReactConnectionGenerator = tsAgentReactConnectionGenerator;
|
|
5
5
|
/**
|
|
6
6
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
7
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -17,8 +17,9 @@ const nx_1 = require("../../../utils/nx");
|
|
|
17
17
|
const metrics_1 = require("../../../utils/metrics");
|
|
18
18
|
const serve_local_1 = require("./serve-local");
|
|
19
19
|
const agent_runtime_config_1 = require("../../../connection/agent-runtime-config");
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const generator_2 = require("../../react-website/agui/generator");
|
|
21
|
+
exports.TS_AGENT_REACT_CONNECTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
22
|
+
async function tsAgentReactConnectionGenerator(tree, options) {
|
|
22
23
|
const frontendProjectConfig = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.sourceProject);
|
|
23
24
|
const agentProjectConfig = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.targetProject);
|
|
24
25
|
const targetComponent = options.targetComponent;
|
|
@@ -32,7 +33,28 @@ async function tsStrandsAgentReactConnectionGenerator(tree, options) {
|
|
|
32
33
|
const agentPath = targetComponent?.path ?? 'src/agent';
|
|
33
34
|
if (targetComponent?.protocol === 'A2A') {
|
|
34
35
|
throw new Error(`Cannot connect a React website to an A2A agent. ` +
|
|
35
|
-
`Consider generating an agent with the HTTP protocol instead.`);
|
|
36
|
+
`Consider generating an agent with the HTTP or AG-UI protocol instead.`);
|
|
37
|
+
}
|
|
38
|
+
if (targetComponent?.protocol === 'AG-UI') {
|
|
39
|
+
await (0, generator_2.addAgUiReactConnection)(tree, {
|
|
40
|
+
frontendProjectConfig,
|
|
41
|
+
agentName,
|
|
42
|
+
agentNameClassName,
|
|
43
|
+
auth: auth,
|
|
44
|
+
});
|
|
45
|
+
await (0, serve_local_1.addTsAgentTargetToServeLocal)(tree, frontendProjectConfig.name, agentProjectConfig.name, {
|
|
46
|
+
agentName,
|
|
47
|
+
agentNameClassName,
|
|
48
|
+
port: agentPort,
|
|
49
|
+
targetComponent,
|
|
50
|
+
});
|
|
51
|
+
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
|
|
52
|
+
exports.TS_AGENT_REACT_CONNECTION_GENERATOR_INFO,
|
|
53
|
+
]);
|
|
54
|
+
await (0, format_1.formatFilesInSubtree)(tree);
|
|
55
|
+
return () => {
|
|
56
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
57
|
+
};
|
|
36
58
|
}
|
|
37
59
|
// Ensure the agent project has a wildcard path entry in tsconfig.base.json
|
|
38
60
|
// so that deep imports (e.g., for the router type) resolve correctly
|
|
@@ -67,7 +89,7 @@ async function tsStrandsAgentReactConnectionGenerator(tree, options) {
|
|
|
67
89
|
await (0, ast_1.applyGritQL)(tree, mainTsxPath, '`<App />` => `<QueryClientProvider><App /></QueryClientProvider>` where { $program <: not contains `<QueryClientProvider>$_</QueryClientProvider>` }');
|
|
68
90
|
// Wrap <App /> in the agent client provider if not already present
|
|
69
91
|
await (0, ast_1.applyGritQL)(tree, mainTsxPath, `\`<App />\` => \`<${clientProviderName}><App /></${clientProviderName}>\` where { $program <: not contains \`<${clientProviderName}>$_</${clientProviderName}>\` }`);
|
|
70
|
-
await (0, serve_local_1.
|
|
92
|
+
await (0, serve_local_1.addTsAgentTargetToServeLocal)(tree, frontendProjectConfig.name, agentProjectConfig.name, {
|
|
71
93
|
agentName,
|
|
72
94
|
agentNameClassName,
|
|
73
95
|
port: agentPort,
|
|
@@ -96,14 +118,14 @@ async function tsStrandsAgentReactConnectionGenerator(tree, options) {
|
|
|
96
118
|
...(auth === 'Cognito' ? ['react-oidc-context'] : []),
|
|
97
119
|
]), (0, versions_1.withVersions)(['@smithy/types']));
|
|
98
120
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
|
|
99
|
-
exports.
|
|
121
|
+
exports.TS_AGENT_REACT_CONNECTION_GENERATOR_INFO,
|
|
100
122
|
]);
|
|
101
123
|
await (0, format_1.formatFilesInSubtree)(tree);
|
|
102
124
|
return () => {
|
|
103
125
|
(0, devkit_1.installPackagesTask)(tree);
|
|
104
126
|
};
|
|
105
127
|
}
|
|
106
|
-
exports.default =
|
|
128
|
+
exports.default = tsAgentReactConnectionGenerator;
|
|
107
129
|
/**
|
|
108
130
|
* Ensures a wildcard path entry exists in tsconfig.base.json for the given project,
|
|
109
131
|
* allowing deep imports (e.g., `:scope/project/src/agent/router.js`).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/agent/react-connection/generator.ts"],"names":[],"mappings":";;;AAqCA,0EAsMC;AA3OD;;;GAGG;AACH,uCAQoB;AACpB,4EAAsF;AACtF,wDAAwD;AACxD,sDAAuD;AACvD,4CAAkE;AAClE,gDAA8D;AAC9D,kDAA6D;AAC7D,0CAK2B;AAC3B,oDAAyE;AACzE,+CAA6D;AAE7D,mFAAgG;AAChG,kEAG4C;AAE/B,QAAA,wCAAwC,GACnD,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,KAAK,UAAU,+BAA+B,CACnD,IAAU,EACV,OAAkC;IAElC,MAAM,qBAAqB,GAAG,IAAA,wCAAmC,EAC/D,IAAI,EACJ,OAAO,CAAC,aAAa,CACtB,CAAC;IACF,MAAM,kBAAkB,GAAG,IAAA,wCAAmC,EAC5D,IAAI,EACJ,OAAO,CAAC,aAAa,CACtB,CAAC;IAEF,MAAM,eAAe,GACnB,OAAO,CAAC,eAAe,CAAC;IAE1B,uEAAuE;IACvE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,QAAe,CAAC;IACpD,MAAM,SAAS,GAAG,eAAe,EAAE,IAAI,IAAI,OAAO,CAAC;IACnD,MAAM,kBAAkB,GAAG,eAAe,EAAE,EAAE,IAAI,IAAA,mBAAW,EAAC,SAAS,CAAC,CAAC;IACzE,MAAM,SAAS,GAAG,eAAe,EAAE,IAAI,IAAI,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IACxE,MAAM,IAAI,GAAG,eAAe,EAAE,IAAI,IAAI,QAAQ,EAA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AC,CAAC,CACf,CAAC;IACF,IAAI,CAAC,YAAY;QAAE,OAAO;IAE1B,MAAM,aAAa,GAAG,CAAC,KAAK,WAAW,IAAI,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,IAAA,wBAAY,EAAC,WAAW,CAAC,CAAC;IAE7C,IAAA,mBAAU,EAAC,IAAI,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC;QAChD,iEAAiE;QACjE,MAAM,gBAAgB,GAAG,GAAG,UAAU,IAAI,CAAC;QAC3C,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC7B,KAAK,CAAC,gBAAgB,CAAC,GAAG,aAAa,CAAC;QAC1C,CAAC;QACD,6CAA6C;QAC7C,MAAM,cAAc,GAAG,GAAG,WAAW,IAAI,CAAC;QAC1C,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;YAC3B,KAAK,CAAC,cAAc,CAAC,GAAG,aAAa,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,eAAe,GAAG;YACrB,GAAG,IAAI,CAAC,eAAe;YACvB,KAAK;SACN,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { ComponentMetadata } from '../../../utils/nx';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* TypeScript types for options defined in schema.json
|
|
9
|
+
*/
|
|
10
|
+
export interface TsAgentReactConnectionGeneratorSchema {
|
|
11
|
+
sourceProject: string;
|
|
12
|
+
targetProject: string;
|
|
13
|
+
sourceComponent?: ComponentMetadata;
|
|
14
|
+
targetComponent?: ComponentMetadata;
|
|
15
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "ts#
|
|
4
|
-
"title": "ts#
|
|
5
|
-
"description": "Connect a React website to a TypeScript
|
|
3
|
+
"$id": "ts#agent#react-connection",
|
|
4
|
+
"title": "ts#agent#react-connection",
|
|
5
|
+
"description": "Connect a React website to a TypeScript Agent",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"sourceProject": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"targetProject": {
|
|
13
13
|
"type": "string",
|
|
14
|
-
"description": "The project containing the
|
|
14
|
+
"description": "The project containing the Agent"
|
|
15
15
|
},
|
|
16
16
|
"sourceComponent": {
|
|
17
17
|
"type": "string",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"targetComponent": {
|
|
21
21
|
"type": "string",
|
|
22
|
-
"description": "The
|
|
22
|
+
"description": "The Agent component name"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"required": ["sourceProject", "targetProject"]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { Tree } from '@nx/devkit';
|
|
6
|
+
import { ComponentMetadata } from '../../../utils/nx';
|
|
7
|
+
export interface TsAgentServeLocalOptions {
|
|
8
|
+
agentName: string;
|
|
9
|
+
agentNameClassName: string;
|
|
10
|
+
port: number;
|
|
11
|
+
targetComponent?: ComponentMetadata;
|
|
12
|
+
}
|
|
13
|
+
export declare const addTsAgentTargetToServeLocal: (tree: Tree, sourceProjectName: string, targetProjectName: string, options: TsAgentServeLocalOptions) => Promise<void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addTsAgentTargetToServeLocal = void 0;
|
|
4
|
+
const agent_serve_local_1 = require("../../../connection/agent-serve-local");
|
|
5
|
+
const addTsAgentTargetToServeLocal = async (tree, sourceProjectName, targetProjectName, options) => {
|
|
6
|
+
const protocol = options.targetComponent?.protocol ?? 'HTTP';
|
|
7
|
+
const localUrl = protocol === 'AG-UI'
|
|
8
|
+
? `http://localhost:${options.port}/invocations`
|
|
9
|
+
: `ws://localhost:${options.port}/ws`;
|
|
10
|
+
await (0, agent_serve_local_1.addAgentTargetToServeLocal)(tree, sourceProjectName, targetProjectName, {
|
|
11
|
+
agentNameClassName: options.agentNameClassName,
|
|
12
|
+
port: options.port,
|
|
13
|
+
targetComponent: options.targetComponent,
|
|
14
|
+
runtimeConfigNamespace: 'agentRuntimes',
|
|
15
|
+
localUrl,
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.addTsAgentTargetToServeLocal = addTsAgentTargetToServeLocal;
|
|
19
|
+
//# sourceMappingURL=serve-local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-local.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/agent/react-connection/serve-local.ts"],"names":[],"mappings":";;;AAKA,6EAAmF;AAU5E,MAAM,4BAA4B,GAAG,KAAK,EAC/C,IAAU,EACV,iBAAyB,EACzB,iBAAyB,EACzB,OAAiC,EACjC,EAAE;IACF,MAAM,QAAQ,GAAG,OAAO,CAAC,eAAe,EAAE,QAAQ,IAAI,MAAM,CAAC;IAC7D,MAAM,QAAQ,GACZ,QAAQ,KAAK,OAAO;QAClB,CAAC,CAAC,oBAAoB,OAAO,CAAC,IAAI,cAAc;QAChD,CAAC,CAAC,kBAAkB,OAAO,CAAC,IAAI,KAAK,CAAC;IAE1C,MAAM,IAAA,8CAA0B,EAAC,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,EAAE;QAC3E,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;QAC9C,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,sBAAsB,EAAE,eAAe;QACvC,QAAQ;KACT,CAAC,CAAC;AACL,CAAC,CAAC;AAnBW,QAAA,4BAA4B,gCAmBvC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { IacProviderOption } from '../../utils/iac';
|
|
7
|
+
|
|
8
|
+
export type TsAgentSdk = 'strands';
|
|
9
|
+
export type TsAgentComputeType = 'BedrockAgentCoreRuntime' | 'None';
|
|
10
|
+
export type AgentProtocol = 'HTTP' | 'A2A' | 'AG-UI';
|
|
11
|
+
|
|
12
|
+
export type TsAgentAuth = 'IAM' | 'Cognito';
|
|
13
|
+
|
|
14
|
+
export interface TsAgentGeneratorSchema {
|
|
15
|
+
project: string;
|
|
16
|
+
sdk?: TsAgentSdk;
|
|
17
|
+
name?: string;
|
|
18
|
+
computeType?: TsAgentComputeType;
|
|
19
|
+
auth?: TsAgentAuth;
|
|
20
|
+
protocol?: AgentProtocol;
|
|
21
|
+
iacProvider: IacProviderOption;
|
|
22
|
+
}
|
|
@@ -1,45 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "
|
|
4
|
-
"title": "
|
|
5
|
-
"description": "Add
|
|
3
|
+
"$id": "ts#agent",
|
|
4
|
+
"title": "ts#agent",
|
|
5
|
+
"description": "Add an AI Agent to a TypeScript project",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"project": {
|
|
9
9
|
"type": "string",
|
|
10
|
-
"description": "The project to add the
|
|
10
|
+
"description": "The project to add the Agent to",
|
|
11
11
|
"$default": {
|
|
12
12
|
"$source": "argv",
|
|
13
13
|
"index": 0
|
|
14
14
|
},
|
|
15
|
-
"x-prompt": "Select the
|
|
15
|
+
"x-prompt": "Select the TypeScript project to add the Agent to",
|
|
16
16
|
"x-dropdown": "projects"
|
|
17
17
|
},
|
|
18
|
+
"sdk": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "The agent SDK to use.",
|
|
21
|
+
"x-prompt": "Which agent SDK would you like to use?",
|
|
22
|
+
"enum": ["strands"],
|
|
23
|
+
"default": "strands",
|
|
24
|
+
"x-priority": "important"
|
|
25
|
+
},
|
|
18
26
|
"computeType": {
|
|
19
27
|
"type": "string",
|
|
20
|
-
"description": "The type of compute to host your
|
|
21
|
-
"x-prompt": "How would you like to host your
|
|
28
|
+
"description": "The type of compute to host your Agent.",
|
|
29
|
+
"x-prompt": "How would you like to host your Agent server?",
|
|
22
30
|
"enum": ["BedrockAgentCoreRuntime", "None"],
|
|
23
31
|
"default": "BedrockAgentCoreRuntime",
|
|
24
32
|
"x-priority": "important"
|
|
25
33
|
},
|
|
26
34
|
"name": {
|
|
27
35
|
"type": "string",
|
|
28
|
-
"description": "The name of your
|
|
29
|
-
"x-prompt": "What would you like to call your
|
|
36
|
+
"description": "The name of your Agent (default: agent)",
|
|
37
|
+
"x-prompt": "What would you like to call your Agent? (default: agent)"
|
|
30
38
|
},
|
|
31
39
|
"auth": {
|
|
32
40
|
"type": "string",
|
|
33
|
-
"description": "The method used to authenticate with your
|
|
41
|
+
"description": "The method used to authenticate with your Agent. Choose between IAM (default) or Cognito.",
|
|
34
42
|
"default": "IAM",
|
|
35
43
|
"enum": ["IAM", "Cognito"],
|
|
36
|
-
"x-prompt": "How would you like to authenticate with your
|
|
44
|
+
"x-prompt": "How would you like to authenticate with your Agent?",
|
|
37
45
|
"x-priority": "important"
|
|
38
46
|
},
|
|
39
47
|
"protocol": {
|
|
40
48
|
"type": "string",
|
|
41
|
-
"description": "The server protocol for your
|
|
42
|
-
"x-prompt": "Which protocol would you like to use for your
|
|
49
|
+
"description": "The server protocol for your Agent. HTTP exposes a tRPC/WebSocket server. A2A exposes an Agent-to-Agent protocol server. AG-UI exposes an AG-UI protocol server for direct frontend integration with CopilotKit.",
|
|
50
|
+
"x-prompt": "Which protocol would you like to use for your Agent?",
|
|
43
51
|
"enum": ["HTTP", "A2A", "AG-UI"],
|
|
44
52
|
"default": "HTTP",
|
|
45
53
|
"x-priority": "important"
|
|
@@ -727,7 +727,7 @@ exports[`ts#mcp-server generator > should match snapshot for generated files > u
|
|
|
727
727
|
},
|
|
728
728
|
"dependencies": {
|
|
729
729
|
"@aws-lambda-powertools/parameters": "2.33.0",
|
|
730
|
-
"@aws-sdk/client-appconfigdata": "3.
|
|
730
|
+
"@aws-sdk/client-appconfigdata": "3.1053.0",
|
|
731
731
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
732
732
|
"express": "5.2.1",
|
|
733
733
|
"zod": "4.4.3"
|
|
@@ -735,7 +735,7 @@ exports[`ts#mcp-server generator > should match snapshot for generated files > u
|
|
|
735
735
|
"devDependencies": {
|
|
736
736
|
"@modelcontextprotocol/inspector": "0.19.0",
|
|
737
737
|
"@types/express": "5.0.6",
|
|
738
|
-
"tsx": "4.22.
|
|
738
|
+
"tsx": "4.22.3"
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`ts#rdb
|
|
3
|
+
exports[`ts#rdb agent-connection generator > should add RDS CA bundle to Dockerfile (A2A) 1`] = `
|
|
4
4
|
"FROM public.ecr.aws/docker/library/node:lts-jod
|
|
5
5
|
|
|
6
6
|
WORKDIR /app
|
|
@@ -21,7 +21,7 @@ CMD [ "node", "--require", "@aws/aws-distro-opentelemetry-node-autoinstrumentati
|
|
|
21
21
|
"
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
|
-
exports[`ts#rdb
|
|
24
|
+
exports[`ts#rdb agent-connection generator > should add RDS CA bundle to Dockerfile (HTTP) 1`] = `
|
|
25
25
|
"FROM public.ecr.aws/docker/library/node:lts-jod
|
|
26
26
|
|
|
27
27
|
WORKDIR /app
|
|
@@ -42,13 +42,13 @@ CMD [ "node", "--require", "@aws/aws-distro-opentelemetry-node-autoinstrumentati
|
|
|
42
42
|
"
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
|
-
exports[`ts#rdb
|
|
45
|
+
exports[`ts#rdb agent-connection generator > should add rdb serve-local dependency to the agent prefixed serve-local 1`] = `
|
|
46
46
|
{
|
|
47
47
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
48
48
|
"metadata": {
|
|
49
49
|
"components": [
|
|
50
50
|
{
|
|
51
|
-
"generator": "ts#
|
|
51
|
+
"generator": "ts#agent",
|
|
52
52
|
"name": "my-agent",
|
|
53
53
|
"path": "src/my-agent",
|
|
54
54
|
"protocol": "HTTP",
|
|
@@ -74,7 +74,7 @@ exports[`ts#rdb strands-agent-connection generator > should add rdb serve-local
|
|
|
74
74
|
}
|
|
75
75
|
`;
|
|
76
76
|
|
|
77
|
-
exports[`ts#rdb
|
|
77
|
+
exports[`ts#rdb agent-connection generator > should be idempotent for A2A agent.ts injection 1`] = `
|
|
78
78
|
"import { getPrisma as getDb } from 'db';
|
|
79
79
|
import { Agent, tool } from '@strands-agents/sdk';
|
|
80
80
|
import { z } from 'zod';
|
|
@@ -97,7 +97,7 @@ export const getAgent = async () => {
|
|
|
97
97
|
"
|
|
98
98
|
`;
|
|
99
99
|
|
|
100
|
-
exports[`ts#rdb
|
|
100
|
+
exports[`ts#rdb agent-connection generator > should be idempotent for Dockerfile 1`] = `
|
|
101
101
|
"FROM public.ecr.aws/docker/library/node:lts-jod
|
|
102
102
|
|
|
103
103
|
WORKDIR /app
|
|
@@ -118,7 +118,7 @@ CMD [ "node", "--require", "@aws/aws-distro-opentelemetry-node-autoinstrumentati
|
|
|
118
118
|
"
|
|
119
119
|
`;
|
|
120
120
|
|
|
121
|
-
exports[`ts#rdb
|
|
121
|
+
exports[`ts#rdb agent-connection generator > should be idempotent for agent.ts injection 1`] = `
|
|
122
122
|
"import { getPrisma as getDb } from 'db';
|
|
123
123
|
import { Agent, tool } from '@strands-agents/sdk';
|
|
124
124
|
import { z } from 'zod';
|
|
@@ -141,13 +141,13 @@ export const getAgent = async () => {
|
|
|
141
141
|
"
|
|
142
142
|
`;
|
|
143
143
|
|
|
144
|
-
exports[`ts#rdb
|
|
144
|
+
exports[`ts#rdb agent-connection generator > should fall back to agent-serve-local when no component name 1`] = `
|
|
145
145
|
{
|
|
146
146
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
147
147
|
"metadata": {
|
|
148
148
|
"components": [
|
|
149
149
|
{
|
|
150
|
-
"generator": "ts#
|
|
150
|
+
"generator": "ts#agent",
|
|
151
151
|
"name": "agent",
|
|
152
152
|
"path": "src/agent",
|
|
153
153
|
"protocol": "HTTP",
|
|
@@ -173,7 +173,7 @@ exports[`ts#rdb strands-agent-connection generator > should fall back to agent-s
|
|
|
173
173
|
}
|
|
174
174
|
`;
|
|
175
175
|
|
|
176
|
-
exports[`ts#rdb
|
|
176
|
+
exports[`ts#rdb agent-connection generator > should inject db into agent.ts 1`] = `
|
|
177
177
|
"import { getPrisma as getDb } from 'db';
|
|
178
178
|
import { Agent, tool } from '@strands-agents/sdk';
|
|
179
179
|
import { z } from 'zod';
|
|
@@ -196,7 +196,7 @@ export const getAgent = async () => {
|
|
|
196
196
|
"
|
|
197
197
|
`;
|
|
198
198
|
|
|
199
|
-
exports[`ts#rdb
|
|
199
|
+
exports[`ts#rdb agent-connection generator > should inject db into agent.ts for A2A 1`] = `
|
|
200
200
|
"import { getPrisma as getDb } from 'db';
|
|
201
201
|
import { Agent, tool } from '@strands-agents/sdk';
|
|
202
202
|
import { z } from 'zod';
|
|
@@ -219,7 +219,7 @@ export const getAgent = async () => {
|
|
|
219
219
|
"
|
|
220
220
|
`;
|
|
221
221
|
|
|
222
|
-
exports[`ts#rdb
|
|
222
|
+
exports[`ts#rdb agent-connection generator > should support multiple rdb connections in agent.ts 1`] = `
|
|
223
223
|
"import { getPrisma as getMysqlDb } from 'mysql-db';
|
|
224
224
|
import { getPrisma as getPostgresDb } from 'postgres-db';
|
|
225
225
|
import { Agent, tool } from '@strands-agents/sdk';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { Tree } from '@nx/devkit';
|
|
6
|
+
import { TsRdbAgentConnectionGeneratorSchema } from './schema';
|
|
7
|
+
import { NxGeneratorInfo } from '../../../utils/nx';
|
|
8
|
+
export declare const TS_RDB_AGENT_CONNECTION_GENERATOR_INFO: NxGeneratorInfo;
|
|
9
|
+
export declare const tsRdbAgentConnectionGenerator: (tree: Tree, options: TsRdbAgentConnectionGeneratorSchema) => Promise<void>;
|
|
10
|
+
export default tsRdbAgentConnectionGenerator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.tsRdbAgentConnectionGenerator = exports.TS_RDB_AGENT_CONNECTION_GENERATOR_INFO = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/**
|
|
6
6
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
@@ -15,8 +15,8 @@ const lodash_camelcase_1 = tslib_1.__importDefault(require("lodash.camelcase"));
|
|
|
15
15
|
const npm_scope_1 = require("../../../utils/npm-scope");
|
|
16
16
|
const ast_1 = require("../../../utils/ast");
|
|
17
17
|
const utils_1 = require("../utils");
|
|
18
|
-
exports.
|
|
19
|
-
const
|
|
18
|
+
exports.TS_RDB_AGENT_CONNECTION_GENERATOR_INFO = (0, nx_1.getGeneratorInfo)(__filename);
|
|
19
|
+
const tsRdbAgentConnectionGenerator = async (tree, options) => {
|
|
20
20
|
const sourceProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.sourceProject);
|
|
21
21
|
const targetProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, options.targetProject);
|
|
22
22
|
const agentName = options.sourceComponent?.name ?? 'agent';
|
|
@@ -60,10 +60,10 @@ const tsRdbStrandsAgentConnectionGenerator = async (tree, options) => {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [
|
|
63
|
-
exports.
|
|
63
|
+
exports.TS_RDB_AGENT_CONNECTION_GENERATOR_INFO,
|
|
64
64
|
]);
|
|
65
65
|
await (0, format_1.formatFilesInSubtree)(tree);
|
|
66
66
|
};
|
|
67
|
-
exports.
|
|
68
|
-
exports.default = exports.
|
|
67
|
+
exports.tsRdbAgentConnectionGenerator = tsRdbAgentConnectionGenerator;
|
|
68
|
+
exports.default = exports.tsRdbAgentConnectionGenerator;
|
|
69
69
|
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/ts/rdb/agent-connection/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAIoB;AAEpB,0CAK2B;AAC3B,oDAAyE;AACzE,kDAA6D;AAC7D,gDAAkD;AAClD,gFAAyC;AACzC,wDAAwD;AACxD,4CAAwE;AACxE,oCAA2D;AAE9C,QAAA,sCAAsC,GACjD,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,6BAA6B,GAAG,KAAK,EAChD,IAAU,EACV,OAA4C,EAC7B,EAAE;IACjB,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,OAAO,CAAC,aAAa,CACtB,CAA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AAE,CAAC;QAC3B,MAAM,IAAA,2BAAqB,EACzB,IAAI,EACJ,SAAS,EACT,CAAC,WAAW,CAAC,EACb,eAAe,CAChB,CAAC;QAEF,+DAA+D;QAC/D,MAAM,IAAA,iBAAW,EACf,IAAI,EACJ,SAAS,EACT;UACI,YAAY,eAAe,aAAa;;wCAEV,YAAY,eAAe,aAAa,QAAQ,CACnF,CAAC;QAEF,iEAAiE;QACjE,MAAM,IAAA,iBAAW,EACf,IAAI,EACJ,SAAS,EACT;UACI,YAAY,eAAe,aAAa;;sCAEZ,CACjC,CAAC;QAEF,kDAAkD;QAClD,2EAA2E;QAC3E,MAAM,MAAM,GAAG,SAAS,YAAY,eAAe,aAAa,KAAK,CAAC;QACtE,MAAM,MAAM,GAAG,GAAG,YAAY,+BAA+B,CAAC;QAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAE,CAAC;QAC/C,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,YAAY,MAAM,CAAC,EAAE,CAAC;YACzE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,MAAM,OAAO,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAED,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE;QAC1C,8CAAsC;KACvC,CAAC,CAAC;IACH,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;AAnFW,QAAA,6BAA6B,iCAmFxC;AAEF,kBAAe,qCAA6B,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { ComponentMetadata } from '../../../utils/nx';
|
|
|
7
7
|
/**
|
|
8
8
|
* TypeScript types for options defined in schema.json
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface TsRdbAgentConnectionGeneratorSchema {
|
|
11
11
|
sourceProject: string;
|
|
12
12
|
targetProject: string;
|
|
13
13
|
sourceComponent?: ComponentMetadata;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "ts#rdb#
|
|
4
|
-
"title": "ts#rdb#
|
|
5
|
-
"description": "Connect a ts#
|
|
3
|
+
"$id": "ts#rdb#agent-connection",
|
|
4
|
+
"title": "ts#rdb#agent-connection",
|
|
5
|
+
"description": "Connect a ts#agent to a ts#rdb project",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"sourceProject": {
|
|
9
9
|
"type": "string",
|
|
10
|
-
"description": "The project containing the ts#
|
|
10
|
+
"description": "The project containing the ts#agent to connect from"
|
|
11
11
|
},
|
|
12
12
|
"targetProject": {
|
|
13
13
|
"type": "string",
|
|
@@ -1065,37 +1065,37 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1065
1065
|
"{
|
|
1066
1066
|
"name": "@proj/source",
|
|
1067
1067
|
"dependencies": {
|
|
1068
|
-
"@cloudscape-design/board-components": "3.0.
|
|
1069
|
-
"@cloudscape-design/components": "3.0.
|
|
1068
|
+
"@cloudscape-design/board-components": "3.0.183",
|
|
1069
|
+
"@cloudscape-design/components": "3.0.1300",
|
|
1070
1070
|
"@cloudscape-design/global-styles": "1.0.59",
|
|
1071
|
-
"aws-cdk-lib": "2.
|
|
1071
|
+
"aws-cdk-lib": "2.257.0",
|
|
1072
1072
|
"constructs": "10.6.0",
|
|
1073
1073
|
"react": "19.2.6",
|
|
1074
1074
|
"react-dom": "19.2.6",
|
|
1075
|
-
"tailwindcss": "4.
|
|
1075
|
+
"tailwindcss": "4.3.0"
|
|
1076
1076
|
},
|
|
1077
1077
|
"devDependencies": {
|
|
1078
1078
|
"@eslint/js": "^9.8.0",
|
|
1079
|
-
"@nx/eslint": "22.7.
|
|
1080
|
-
"@nx/eslint-plugin": "22.7.
|
|
1081
|
-
"@nx/js": "22.7.
|
|
1082
|
-
"@nx/react": "22.7.
|
|
1083
|
-
"@nx/vite": "22.7.
|
|
1084
|
-
"@nx/vitest": "22.7.
|
|
1085
|
-
"@nx/web": "22.7.
|
|
1079
|
+
"@nx/eslint": "22.7.3",
|
|
1080
|
+
"@nx/eslint-plugin": "22.7.3",
|
|
1081
|
+
"@nx/js": "22.7.3",
|
|
1082
|
+
"@nx/react": "22.7.3",
|
|
1083
|
+
"@nx/vite": "22.7.3",
|
|
1084
|
+
"@nx/vitest": "22.7.3",
|
|
1085
|
+
"@nx/web": "22.7.3",
|
|
1086
1086
|
"@swc-node/register": "~1.11.1",
|
|
1087
1087
|
"@swc/cli": "~0.8.0",
|
|
1088
1088
|
"@swc/core": "~1.15.5",
|
|
1089
1089
|
"@swc/helpers": "~0.5.18",
|
|
1090
|
-
"@tailwindcss/vite": "4.
|
|
1090
|
+
"@tailwindcss/vite": "4.3.0",
|
|
1091
1091
|
"@testing-library/dom": "10.4.0",
|
|
1092
1092
|
"@testing-library/react": "16.3.0",
|
|
1093
|
-
"@types/node": "25.
|
|
1093
|
+
"@types/node": "25.9.1",
|
|
1094
1094
|
"@types/react": "^19.0.0",
|
|
1095
1095
|
"@types/react-dom": "^19.0.0",
|
|
1096
1096
|
"@vitejs/plugin-react": "^6.0.0",
|
|
1097
|
-
"@vitest/coverage-v8": "4.1.
|
|
1098
|
-
"@vitest/ui": "4.1.
|
|
1097
|
+
"@vitest/coverage-v8": "4.1.7",
|
|
1098
|
+
"@vitest/ui": "4.1.7",
|
|
1099
1099
|
"eslint": "^9.8.0",
|
|
1100
1100
|
"eslint-config-prettier": "^10.0.0",
|
|
1101
1101
|
"eslint-plugin-import": "2.31.0",
|
|
@@ -1109,8 +1109,8 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
1109
1109
|
"prettier": "3.8.3",
|
|
1110
1110
|
"typescript": "~5.9.2",
|
|
1111
1111
|
"typescript-eslint": "^8.40.0",
|
|
1112
|
-
"vite": "8.0.
|
|
1113
|
-
"vitest": "4.1.
|
|
1112
|
+
"vite": "8.0.14",
|
|
1113
|
+
"vitest": "4.1.7"
|
|
1114
1114
|
},
|
|
1115
1115
|
"type": "module",
|
|
1116
1116
|
"scripts": {
|
|
@@ -2686,42 +2686,42 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2686
2686
|
"{
|
|
2687
2687
|
"name": "@proj/source",
|
|
2688
2688
|
"dependencies": {
|
|
2689
|
-
"@cloudscape-design/board-components": "3.0.
|
|
2690
|
-
"@cloudscape-design/components": "3.0.
|
|
2689
|
+
"@cloudscape-design/board-components": "3.0.183",
|
|
2690
|
+
"@cloudscape-design/components": "3.0.1300",
|
|
2691
2691
|
"@cloudscape-design/global-styles": "1.0.59",
|
|
2692
|
-
"@tanstack/react-router": "1.170.
|
|
2693
|
-
"aws-cdk-lib": "2.
|
|
2692
|
+
"@tanstack/react-router": "1.170.8",
|
|
2693
|
+
"aws-cdk-lib": "2.257.0",
|
|
2694
2694
|
"constructs": "10.6.0",
|
|
2695
2695
|
"react": "19.2.6",
|
|
2696
2696
|
"react-dom": "19.2.6",
|
|
2697
|
-
"tailwindcss": "4.
|
|
2697
|
+
"tailwindcss": "4.3.0"
|
|
2698
2698
|
},
|
|
2699
2699
|
"devDependencies": {
|
|
2700
2700
|
"@eslint/js": "^9.8.0",
|
|
2701
|
-
"@nx/eslint": "22.7.
|
|
2702
|
-
"@nx/eslint-plugin": "22.7.
|
|
2703
|
-
"@nx/js": "22.7.
|
|
2704
|
-
"@nx/react": "22.7.
|
|
2705
|
-
"@nx/vite": "22.7.
|
|
2706
|
-
"@nx/vitest": "22.7.
|
|
2707
|
-
"@nx/web": "22.7.
|
|
2701
|
+
"@nx/eslint": "22.7.3",
|
|
2702
|
+
"@nx/eslint-plugin": "22.7.3",
|
|
2703
|
+
"@nx/js": "22.7.3",
|
|
2704
|
+
"@nx/react": "22.7.3",
|
|
2705
|
+
"@nx/vite": "22.7.3",
|
|
2706
|
+
"@nx/vitest": "22.7.3",
|
|
2707
|
+
"@nx/web": "22.7.3",
|
|
2708
2708
|
"@swc-node/register": "~1.11.1",
|
|
2709
2709
|
"@swc/cli": "~0.8.0",
|
|
2710
2710
|
"@swc/core": "~1.15.5",
|
|
2711
2711
|
"@swc/helpers": "~0.5.18",
|
|
2712
|
-
"@tailwindcss/vite": "4.
|
|
2713
|
-
"@tanstack/router-generator": "1.167.
|
|
2714
|
-
"@tanstack/router-plugin": "1.168.
|
|
2715
|
-
"@tanstack/router-utils": "1.162.
|
|
2712
|
+
"@tailwindcss/vite": "4.3.0",
|
|
2713
|
+
"@tanstack/router-generator": "1.167.10",
|
|
2714
|
+
"@tanstack/router-plugin": "1.168.11",
|
|
2715
|
+
"@tanstack/router-utils": "1.162.1",
|
|
2716
2716
|
"@tanstack/virtual-file-routes": "1.162.0",
|
|
2717
2717
|
"@testing-library/dom": "10.4.0",
|
|
2718
2718
|
"@testing-library/react": "16.3.0",
|
|
2719
|
-
"@types/node": "25.
|
|
2719
|
+
"@types/node": "25.9.1",
|
|
2720
2720
|
"@types/react": "^19.0.0",
|
|
2721
2721
|
"@types/react-dom": "^19.0.0",
|
|
2722
2722
|
"@vitejs/plugin-react": "^6.0.0",
|
|
2723
|
-
"@vitest/coverage-v8": "4.1.
|
|
2724
|
-
"@vitest/ui": "4.1.
|
|
2723
|
+
"@vitest/coverage-v8": "4.1.7",
|
|
2724
|
+
"@vitest/ui": "4.1.7",
|
|
2725
2725
|
"eslint": "^9.8.0",
|
|
2726
2726
|
"eslint-config-prettier": "^10.0.0",
|
|
2727
2727
|
"eslint-plugin-import": "2.31.0",
|
|
@@ -2735,8 +2735,8 @@ exports[`react-website generator > Tanstack router integration > should generate
|
|
|
2735
2735
|
"prettier": "3.8.3",
|
|
2736
2736
|
"typescript": "~5.9.2",
|
|
2737
2737
|
"typescript-eslint": "^8.40.0",
|
|
2738
|
-
"vite": "8.0.
|
|
2739
|
-
"vitest": "4.1.
|
|
2738
|
+
"vite": "8.0.14",
|
|
2739
|
+
"vitest": "4.1.7"
|
|
2740
2740
|
},
|
|
2741
2741
|
"type": "module",
|
|
2742
2742
|
"scripts": {
|
|
@@ -4971,15 +4971,15 @@ root &&
|
|
|
4971
4971
|
|
|
4972
4972
|
exports[`react-website generator > should handle npm scope prefix correctly > scoped-dependencies 1`] = `
|
|
4973
4973
|
{
|
|
4974
|
-
"@cloudscape-design/board-components": "3.0.
|
|
4975
|
-
"@cloudscape-design/components": "3.0.
|
|
4974
|
+
"@cloudscape-design/board-components": "3.0.183",
|
|
4975
|
+
"@cloudscape-design/components": "3.0.1300",
|
|
4976
4976
|
"@cloudscape-design/global-styles": "1.0.59",
|
|
4977
|
-
"@tanstack/react-router": "1.170.
|
|
4978
|
-
"aws-cdk-lib": "2.
|
|
4977
|
+
"@tanstack/react-router": "1.170.8",
|
|
4978
|
+
"aws-cdk-lib": "2.257.0",
|
|
4979
4979
|
"constructs": "10.6.0",
|
|
4980
4980
|
"react": "19.2.6",
|
|
4981
4981
|
"react-dom": "19.2.6",
|
|
4982
|
-
"tailwindcss": "4.
|
|
4982
|
+
"tailwindcss": "4.3.0",
|
|
4983
4983
|
}
|
|
4984
4984
|
`;
|
|
4985
4985
|
|