Skip to content

Commit 8efb285

Browse files
committed
refactor(assets): rename to kebab-case, doc types, sync cdk pins
Address review feedback from @Hweinstock: - rename AssetManager.ts -> manager.ts (only non-React .ts in the repo with an uppercase name; feature dirs use role-named lowercase files like core/project/manager.tsx). - document AssetFile vs EmbeddedFile so the distinction between a resolved tree entry and a raw Bun.embeddedFiles blob is explicit. - sync src/assets/cdk/package.json to the minor-version pins landed in #1777 (aws-cdk-lib ~2.261.0, @aws/agentcore-cdk 0.1.0-alpha.45, etc.).
1 parent f7ea873 commit 8efb285

6 files changed

Lines changed: 24 additions & 11 deletions

File tree

src/assetManager/__snapshots__/AssetManager.test.ts.snap renamed to src/assetManager/__snapshots__/manager.test.ts.snap

File renamed without changes.

src/assetManager/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { AssetManager } from "./AssetManager";
1+
export { AssetManager } from "./manager";
22
export { ASSET_NAMES, type AssetName, type AssetVariables } from "./types";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, test } from "bun:test";
22
import { mkdtemp, mkdir, readdir, rm } from "node:fs/promises";
33
import { join, relative, resolve } from "node:path";
44
import { tmpdir } from "node:os";
5-
import { AssetManager, resolveSourceRoot } from "./AssetManager";
5+
import { AssetManager, resolveSourceRoot } from "./manager";
66

77
const tempDirectories: string[] = [];
88

src/assetManager/types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,23 @@ export const ASSET_NAMES = ["cdk"] as const;
33
export type AssetName = (typeof ASSET_NAMES)[number];
44

55
export type AssetVariables = Record<string, unknown>;
6+
7+
/**
8+
* A single asset resolved to its position within an asset tree, ready to
9+
* render. `relativePath` is relative to the asset root (e.g. `bin/cdk.ts`),
10+
* regardless of whether the bytes came from disk or an embedded blob.
11+
*/
612
export interface AssetFile {
713
relativePath: string;
814
text(): Promise<string>;
915
}
16+
17+
/**
18+
* A raw file embedded in the compiled binary, as exposed by `Bun.embeddedFiles`.
19+
* `name` is the full build-time virtual path (e.g.
20+
* `agentcore-assets/src/assets/cdk/bin/cdk.ts`), which the manager strips down
21+
* to an `AssetFile.relativePath`.
22+
*/
1023
export interface EmbeddedFile {
1124
readonly name: string;
1225
text(): Promise<string>;

src/assets/cdk/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
"format:check": "prettier --check ."
1515
},
1616
"devDependencies": {
17-
"@types/jest": "^29.5.14",
18-
"@types/node": "^24.10.1",
19-
"jest": "^29.7.0",
20-
"ts-jest": "^29.2.5",
21-
"aws-cdk": "2.1126.0",
22-
"prettier": "^3.4.2",
17+
"@types/jest": "~29.5.14",
18+
"@types/node": "~24.13.3",
19+
"jest": "~29.7.0",
20+
"ts-jest": "~29.4.11",
21+
"aws-cdk": "~2.1126.0",
22+
"prettier": "~3.9.5",
2323
"typescript": "~5.9.3"
2424
},
2525
"dependencies": {
26-
"@aws/agentcore-cdk": "^0.1.0-alpha.19",
27-
"aws-cdk-lib": "^2.248.0",
28-
"constructs": "^10.0.0"
26+
"@aws/agentcore-cdk": "0.1.0-alpha.45",
27+
"aws-cdk-lib": "~2.261.0",
28+
"constructs": "~10.7.0"
2929
}
3030
}

0 commit comments

Comments
 (0)