refactor(tools): extract zip utilities into shared @aws-cdk/tools package#1512
Draft
mrgrain wants to merge 1 commit into
Draft
refactor(tools): extract zip utilities into shared @aws-cdk/tools package#1512mrgrain wants to merge 1 commit into
@aws-cdk/tools package#1512mrgrain wants to merge 1 commit into
Conversation
…ackage\n\nConsolidate the duplicated `zipDirectory` and `zipString` implementations\nfrom `cdk-assets-lib` and `toolkit-lib` into a new private `@aws-cdk/tools`\npackage. Each tool is bundled individually via esbuild and cherry-picked\nby consumers at pre-compile time, removing `archiver` as a direct\nruntime dependency from both packages.
Contributor
|
Total lines changed 1858 is greater than 1000. Please consider breaking this PR down. |
Contributor
Dependency ReviewThe following issues were found:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both
cdk-assets-libandtoolkit-libcarried their own copy of zip utilities (zipDirectory,zipString) wrappingarchiverandfast-glob. This duplication made it easy for the implementations to drift apart — thetoolkit-libversion had already lost the deterministic date reset, for example.This PR introduces a new private (unpublished)
@aws-cdk/toolspackage that hosts small, self-contained utilities. Each tool lives in its own subdirectory underlib/, gets compiled bytsc, and then bundled into a single file byesbuild. Consumer packages cherry-pick tools at pre-compile time via auseToolsoption on the newCdkTypeScriptWorkspaceprojen construct, which copies the bundled.jsand.d.tsintolib/private/tools/<name>/.The immediate benefit is that
archiveris no longer a direct runtime dependency of eithercdk-assets-libortoolkit-lib— it's bundled once in@aws-cdk/toolsand the output is vendored. Future utilities (e.g. hashing helpers, retry wrappers) can be added by simply creating a newlib/<tool>/index.tsin the tools package.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license