Skip to content

feat(assets): add AssetManager and CDK scaffold templates#1809

Open
tejaskash wants to merge 2 commits into
refactorfrom
feat/asset-manager-core
Open

feat(assets): add AssetManager and CDK scaffold templates#1809
tejaskash wants to merge 2 commits into
refactorfrom
feat/asset-manager-core

Conversation

@tejaskash

@tejaskash tejaskash commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces the asset embedding + rendering subsystem — the foundation for project scaffolding. AssetManager renders an asset tree from either Bun.embeddedFiles (compiled standalone binary) or the source filesystem (dev / node distribution), applying Handlebars templating with HTML escaping disabled and writing each file atomically.

This is PR 1 of 3 in a stacked series:

  1. this PR — core: AssetManager, atomicWrite, CDK templates, tooling ignores
  2. build: scripts/build.ts that bundles/embeds assets (stacks on this)
  3. wiring: thread AssetManager into FsProjectManager (stacks on this)

What's included

  • src/fs/atomicWrite — central temp-file + rename write util so a crashed render never leaves a half-written file behind
  • src/assetManagerAssetManager, types, barrel, unit tests, snapshot baseline
    • source vs embedded modes selected by embeddedFiles.length
    • Handlebars noEscape (assets are code/config, not HTML)
    • path-traversal guards on every output path
    • gitignore.template / npmignore.template.gitignore / .npmignore on render
  • src/assets/cdk — CDK project scaffold templates (payload copied verbatim to generated projects, not CLI source)
  • tooling: exclude src/assets from tsc, bun test, coverage, oxlint, prettier (the templates ship their own *.test.ts depending on packages the CLI doesn't install)
  • add handlebars dependency

Testing

  • bun run typecheck — clean
  • bun test — 266 pass, 1 snapshot
  • includes a byte-for-byte render snapshot of the full CDK tree

@github-actions github-actions Bot added agentcore-harness-reviewing AgentCore Harness review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Jul 22, 2026
@tejaskash
tejaskash force-pushed the feat/asset-manager-core branch 2 times, most recently from 7a9663a to 15433db Compare July 22, 2026 20:38
@codecov-commenter

codecov-commenter commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.03%. Comparing base (56f62e7) to head (356105c).

Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #1809      +/-   ##
============================================
+ Coverage     93.94%   94.03%   +0.08%     
============================================
  Files           122      125       +3     
  Lines          6462     6555      +93     
============================================
+ Hits           6071     6164      +93     
  Misses          391      391              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

tejaskash and others added 2 commits July 22, 2026 17:03
Introduce the asset embedding + rendering subsystem: AssetManager renders
asset trees from either Bun.embeddedFiles (compiled binary) or the source
filesystem (dev/node), applying Handlebars templating with HTML escaping
disabled and atomic writes.

- src/fs/atomicWrite: central temp-file + rename write util
- src/assetManager: AssetManager, types, barrel, tests, snapshot baseline
- src/assets/cdk: CDK project scaffold templates (payload, not source)
- tsconfig/bunfig/oxlint/prettier: exclude src/assets from all tooling
- add handlebars dependency
Remove comment about directory injection for testability.
@tejaskash
tejaskash force-pushed the feat/asset-manager-core branch from cafb131 to 356105c Compare July 22, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants