Skip to content

Commit 47da675

Browse files
notgitikagitikavj
andauthored
fix: replace dead CDK test and update stale READMEs; enable strict tsconfig flags in vended CDK project (#379)
* fix: replace dead CDK test and update stale READMEs * fix: enable strict tsconfig flags in vended CDK project * fix: capitalize AgentCore in vended README --------- Co-authored-by: gitikavj <gitikavj@amazon.com>
1 parent ecaedf8 commit 47da675

File tree

5 files changed

+85
-53
lines changed

5 files changed

+85
-53
lines changed

src/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,32 @@ exports[`Assets Directory Snapshots > CDK assets > cdk/cdk/.prettierrc should ma
1313
`;
1414

1515
exports[`Assets Directory Snapshots > CDK assets > cdk/cdk/README.md should match snapshot 1`] = `
16-
"# Welcome to your CDK TypeScript project
16+
"# AgentCore CDK Project
1717
18-
This is a blank project for CDK development with TypeScript.
18+
This CDK project is managed by the AgentCore CLI. It deploys your agent infrastructure into AWS using the \`@aws/agentcore-cdk\` L3 constructs.
1919
20-
The \`cdk.json\` file tells the CDK Toolkit how to execute your app.
20+
## Structure
21+
22+
- \`bin/cdk.ts\` — Entry point. Reads project configuration from \`agentcore/\` and creates a stack per deployment target.
23+
- \`lib/cdk-stack.ts\` — Defines \`AgentCoreStack\`, which wraps the \`AgentCoreApplication\` L3 construct.
24+
- \`test/cdk.test.ts\` — Unit tests for stack synthesis.
2125
2226
## Useful commands
2327
24-
- \`npm run build\` compile typescript to js
25-
- \`npm run watch\` watch for changes and compile
26-
- \`npm run test\` perform the jest unit tests
28+
- \`npm run build\` compile TypeScript to JavaScript
29+
- \`npm run test\` run unit tests
30+
- \`npx cdk synth\` emit the synthesized CloudFormation template
2731
- \`npx cdk deploy\` deploy this stack to your default AWS account/region
2832
- \`npx cdk diff\` compare deployed stack with current state
29-
- \`npx cdk synth\` emits the synthesized CloudFormation template
33+
34+
## Usage
35+
36+
You typically don't need to interact with this directory directly. The AgentCore CLI handles synthesis and deployment:
37+
38+
\`\`\`bash
39+
agentcore deploy # synthesizes and deploys via CDK
40+
agentcore status # checks deployment status
41+
\`\`\`
3042
"
3143
`;
3244

@@ -292,21 +304,25 @@ exports[`Assets Directory Snapshots > CDK assets > cdk/cdk/package.json should m
292304
`;
293305
294306
exports[`Assets Directory Snapshots > CDK assets > cdk/cdk/test/cdk.test.ts should match snapshot 1`] = `
295-
"// import * as cdk from 'aws-cdk-lib/core';
296-
// import { Template } from 'aws-cdk-lib/assertions';
297-
// import * as Cdk from '../lib/cdk-stack';
298-
299-
// example test. To run these tests, uncomment this file along with the
300-
// example resource in lib/cdk-stack.ts
301-
test('SQS Queue Created', () => {
302-
// const app = new cdk.App();
303-
// // WHEN
304-
// const stack = new Cdk.CdkStack(app, 'MyTestStack');
305-
// // THEN
306-
// const template = Template.fromStack(stack);
307-
// template.hasResourceProperties('AWS::SQS::Queue', {
308-
// VisibilityTimeout: 300
309-
// });
307+
"import * as cdk from 'aws-cdk-lib';
308+
import { Template } from 'aws-cdk-lib/assertions';
309+
import { AgentCoreStack } from '../lib/cdk-stack';
310+
311+
test('AgentCoreStack synthesizes with empty spec', () => {
312+
const app = new cdk.App();
313+
const stack = new AgentCoreStack(app, 'TestStack', {
314+
spec: {
315+
name: 'testproject',
316+
version: 1,
317+
agents: [],
318+
memories: [],
319+
credentials: [],
320+
},
321+
});
322+
const template = Template.fromStack(stack);
323+
template.hasOutput('StackNameOutput', {
324+
Description: 'Name of the CloudFormation Stack',
325+
});
310326
});
311327
"
312328
`;
@@ -324,14 +340,14 @@ exports[`Assets Directory Snapshots > CDK assets > cdk/cdk/tsconfig.json should
324340
"strictNullChecks": true,
325341
"noImplicitThis": true,
326342
"alwaysStrict": true,
327-
"noUnusedLocals": false,
328-
"noUnusedParameters": false,
343+
"noUnusedLocals": true,
344+
"noUnusedParameters": true,
329345
"noImplicitReturns": true,
330-
"noFallthroughCasesInSwitch": false,
346+
"noFallthroughCasesInSwitch": true,
331347
"inlineSourceMap": true,
332348
"inlineSources": true,
333349
"experimentalDecorators": true,
334-
"strictPropertyInitialization": false,
350+
"strictPropertyInitialization": true,
335351
"skipLibCheck": true,
336352
"typeRoots": ["./node_modules/@types"],
337353
"rootDir": ".",
@@ -2345,7 +2361,7 @@ packages = ["."]
23452361
`;
23462362
23472363
exports[`Assets Directory Snapshots > Python framework assets > python/python/strands/base/README.md should match snapshot 1`] = `
2348-
"This is a project generated by the agentcore create basic CLI tool!
2364+
"This is a project generated by the AgentCore CLI!
23492365
23502366
# Layout
23512367

src/assets/cdk/README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
1-
# Welcome to your CDK TypeScript project
1+
# AgentCore CDK Project
22

3-
This is a blank project for CDK development with TypeScript.
3+
This CDK project is managed by the AgentCore CLI. It deploys your agent infrastructure into AWS using the `@aws/agentcore-cdk` L3 constructs.
44

5-
The `cdk.json` file tells the CDK Toolkit how to execute your app.
5+
## Structure
6+
7+
- `bin/cdk.ts` — Entry point. Reads project configuration from `agentcore/` and creates a stack per deployment target.
8+
- `lib/cdk-stack.ts` — Defines `AgentCoreStack`, which wraps the `AgentCoreApplication` L3 construct.
9+
- `test/cdk.test.ts` — Unit tests for stack synthesis.
610

711
## Useful commands
812

9-
- `npm run build` compile typescript to js
10-
- `npm run watch` watch for changes and compile
11-
- `npm run test` perform the jest unit tests
13+
- `npm run build` compile TypeScript to JavaScript
14+
- `npm run test` run unit tests
15+
- `npx cdk synth` emit the synthesized CloudFormation template
1216
- `npx cdk deploy` deploy this stack to your default AWS account/region
1317
- `npx cdk diff` compare deployed stack with current state
14-
- `npx cdk synth` emits the synthesized CloudFormation template
18+
19+
## Usage
20+
21+
You typically don't need to interact with this directory directly. The AgentCore CLI handles synthesis and deployment:
22+
23+
```bash
24+
agentcore deploy # synthesizes and deploys via CDK
25+
agentcore status # checks deployment status
26+
```

src/assets/cdk/test/cdk.test.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
// import * as cdk from 'aws-cdk-lib/core';
2-
// import { Template } from 'aws-cdk-lib/assertions';
3-
// import * as Cdk from '../lib/cdk-stack';
1+
import * as cdk from 'aws-cdk-lib';
2+
import { Template } from 'aws-cdk-lib/assertions';
3+
import { AgentCoreStack } from '../lib/cdk-stack';
44

5-
// example test. To run these tests, uncomment this file along with the
6-
// example resource in lib/cdk-stack.ts
7-
test('SQS Queue Created', () => {
8-
// const app = new cdk.App();
9-
// // WHEN
10-
// const stack = new Cdk.CdkStack(app, 'MyTestStack');
11-
// // THEN
12-
// const template = Template.fromStack(stack);
13-
// template.hasResourceProperties('AWS::SQS::Queue', {
14-
// VisibilityTimeout: 300
15-
// });
5+
test('AgentCoreStack synthesizes with empty spec', () => {
6+
const app = new cdk.App();
7+
const stack = new AgentCoreStack(app, 'TestStack', {
8+
spec: {
9+
name: 'testproject',
10+
version: 1,
11+
agents: [],
12+
memories: [],
13+
credentials: [],
14+
},
15+
});
16+
const template = Template.fromStack(stack);
17+
template.hasOutput('StackNameOutput', {
18+
Description: 'Name of the CloudFormation Stack',
19+
});
1620
});

src/assets/cdk/tsconfig.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
"strictNullChecks": true,
1111
"noImplicitThis": true,
1212
"alwaysStrict": true,
13-
"noUnusedLocals": false,
14-
"noUnusedParameters": false,
13+
"noUnusedLocals": true,
14+
"noUnusedParameters": true,
1515
"noImplicitReturns": true,
16-
"noFallthroughCasesInSwitch": false,
16+
"noFallthroughCasesInSwitch": true,
1717
"inlineSourceMap": true,
1818
"inlineSources": true,
1919
"experimentalDecorators": true,
20-
"strictPropertyInitialization": false,
20+
"strictPropertyInitialization": true,
2121
"skipLibCheck": true,
2222
"typeRoots": ["./node_modules/@types"],
2323
"rootDir": ".",

src/assets/python/strands/base/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This is a project generated by the agentcore create basic CLI tool!
1+
This is a project generated by the AgentCore CLI!
22

33
# Layout
44

0 commit comments

Comments
 (0)