-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use workspace package versions in protocol test codegen (#1399)
- Loading branch information
Showing
5 changed files
with
115 additions
and
79 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* | ||
* Script to be run after protocol test codegen to set the smithy dependencies | ||
* to workspace:^ | ||
* | ||
*/ | ||
|
||
const path = require("node:path"); | ||
const fs = require("node:fs"); | ||
|
||
const root = path.join(__dirname, ".."); | ||
|
||
const private = path.join(root, "private"); | ||
|
||
const privatePackages = fs.readdirSync(private); | ||
|
||
for (const dir of privatePackages) { | ||
const pkgJsonPath = path.join(private, dir, "package.json"); | ||
if (fs.existsSync(pkgJsonPath)) { | ||
const pkgJson = require(pkgJsonPath); | ||
for (const dep in pkgJson.dependencies ?? {}) { | ||
if (dep.startsWith("@smithy/")) { | ||
pkgJson.dependencies[dep] = "workspace:^"; | ||
} | ||
} | ||
for (const dep in pkgJson.devDependencies ?? {}) { | ||
if (dep.startsWith("@smithy/")) { | ||
pkgJson.dependencies[dep] = "workspace:^"; | ||
} | ||
} | ||
fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + "\n"); | ||
} | ||
} |
This file contains 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