chore(scripts): client tarball generation with canonical name#7893
Conversation
| 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" }); |
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
/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}`); |
There was a problem hiding this comment.
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" }); |
There was a problem hiding this comment.
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.
|
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. |
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
*.integ.spec.ts) or E2E tests.@public,@internaltags and enabled doc generation on the package. Remember that access level annotations go below the description, not above.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.