Skip to content

chore(scripts): client tarball generation with canonical name#7893

Merged
kuhe merged 1 commit intomainfrom
kuhe/chore/tarball
Mar 27, 2026
Merged

chore(scripts): client tarball generation with canonical name#7893
kuhe merged 1 commit intomainfrom
kuhe/chore/tarball

Conversation

@kuhe
Copy link
Copy Markdown
Contributor

@kuhe kuhe commented Mar 26, 2026

Issue

follows #7866

Description

This updates the client tarball script to avoid using yarn and disrupting the developer's node_modules folder.

see diff inline PR comments

Testing

manual testing, and script now includes a smoke test

Checklist

  • If the PR is a feature, add integration tests (*.integ.spec.ts) or E2E tests.
    • It's not a feature.
  • My E2E tests are resilient to concurrent i/o.
    • I didn't write any E2E tests.
  • I added access level annotations e.g. @public, @internal tags and enabled doc generation on the package. Remember that access level annotations go below the description, not above.
    • I didn't add any public functions.
  • Streams - how do they work?? My WebStream readers/locks are properly lifecycled. Node.js stream backpressure is handled. Error handling.
    • No streams here.

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

@kuhe kuhe requested a review from a team as a code owner March 26, 2026 20:49
writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + "\n");

// Running yarn will install dependencies in workspace `node_modules` folder.
execSync("yarn workspaces focus --production", { cwd: tmpDir, stdio: "inherit" });
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this deletes all the devDeps from the repo root, which interrupts other development when testing this script


writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + "\n");

// Copy production dependencies from root node_modules (no symlinks, no npm install).
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/node_modules/*

from the workspace root are copied into

/temp-tarball
  /client-dynamodb
    /node_modules/*

for whatever the client itself needs (and transitive closure flattened)

const workspaceDirs = ["clients", "lib", "packages", "packages-internal"];
const filesToCopy = ["dist-cjs", "dist-es", "dist-types", "package.json", "README.md", "LICENSE"];

const monorepoDependencies = readdirSync(join(nodeModulesDir, "@aws-sdk")).map((name) => `@aws-sdk/${name}`);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For monorepo interdependencies, we instead copy from their versioned built location

e.g.

/packages-internal
  /core
    /dist-cjs
    /dist-es
    /dist-types
    package.json

goes to

/temp-tarball
  /client-dynamodb
    /node_modules/
      /@aws-sdk
        /core
          /dist-cjs
          /dist-es
          /dist-types
          package.json

const smokeDir = join(tmpDir, "smoke-test");
mkdirSync(smokeDir, { recursive: true });
writeFileSync(join(smokeDir, "package.json"), JSON.stringify({ private: true }));
execFileSync("npm", ["install", "--offline", tarballPath], { cwd: smokeDir, stdio: "inherit" });
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the smoke test, we install from the tarball in offline mode and do an import (but no other initialization).

Other smoke test actions could be added in the future.

The tarball will sit at ./clients/client-dynamodb/aws-sdk-client-dynamodb-{version}.tgz or something like that. It will have the canonical package name.

@kuhe kuhe merged commit 742196a into main Mar 27, 2026
7 checks passed
@kuhe kuhe deleted the kuhe/chore/tarball branch March 27, 2026 01:48
@github-actions
Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants