Skip to content

feat: add --snapshot flag to npm run package#807

Draft
Hweinstock wants to merge 2 commits intoaws:mainfrom
Hweinstock:feat/snapshot-package
Draft

feat: add --snapshot flag to npm run package#807
Hweinstock wants to merge 2 commits intoaws:mainfrom
Hweinstock:feat/snapshot-package

Conversation

@Hweinstock
Copy link
Copy Markdown
Contributor

Description

Problem

PR tarballs from different commits all have the same version (0.8.0), making it impossible to identify which commit a tarball came from once downloaded.

Solution

Add a package npm script (scripts/package.mjs) that wraps build + pack. When invoked with --snapshot, it appends the short git commit hash to the version (e.g. 0.8.0-sha.abc1234) so pre-release tarballs are self-documenting. The PR tarball workflow now uses this script.

Related Issue

N/A

Documentation PR

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ

  • I ran npm run typecheck

  • I ran npm run lint

  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

  • npm run package produces aws-agentcore-0.8.0.tgz

  • npm run package -- --snapshot produces aws-agentcore-0.8.0-sha.6e19463.tgz

  • package.json version restored correctly after snapshot build

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@github-actions github-actions bot added the size/s PR size: S label Apr 10, 2026
@github-actions github-actions bot added size/s PR size: S and removed size/s PR size: S labels Apr 10, 2026
@Hweinstock Hweinstock force-pushed the feat/snapshot-package branch from 51a8f50 to d8e4ebc Compare April 10, 2026 16:34
@github-actions github-actions bot added size/s PR size: S and removed size/s PR size: S labels Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant