diff --git a/scripts/generate-clients/index.js b/scripts/generate-clients/index.js index 53a3a6203266..564e84f8cf19 100644 --- a/scripts/generate-clients/index.js +++ b/scripts/generate-clients/index.js @@ -16,7 +16,6 @@ const { prettifyCode } = require("./code-prettify"); const { eslintFixCode } = require("./code-eslint-fix"); const { buildSmithyTypeScript } = require("./build-smithy-typescript"); const { SMITHY_TS_COMMIT } = require("./config"); -const s3Hack = require("./s3-hack"); const SMITHY_TS_DIR = path.normalize(path.join(__dirname, "..", "..", "..", "smithy-typescript")); const SDK_CLIENTS_DIR = path.normalize(path.join(__dirname, "..", "..", "clients")); @@ -77,7 +76,6 @@ const { (async () => { try { - require("../runtime-dependency-version-check/runtime-dep-version-check"); if (!noSmithyCheckout) { await buildSmithyTypeScript(repo, commit); } @@ -97,14 +95,7 @@ const { } if (!protocolTestsOnly) { - const undoS3 = s3Hack(); - try { - await generateClients(models || globs || DEFAULT_CODE_GEN_INPUT_DIR, batchSize); - undoS3(); - } catch (e) { - undoS3(); - throw e; - } + await generateClients(models || globs || DEFAULT_CODE_GEN_INPUT_DIR, batchSize); } if (!noPrivateClients) { @@ -148,6 +139,7 @@ const { } require("./customizations/workspaces-thin-client")(); + require("../runtime-dependency-version-check/runtime-dep-version-check"); } catch (e) { console.log(e); process.exit(1); diff --git a/scripts/generate-clients/s3-hack.js b/scripts/generate-clients/s3-hack.js deleted file mode 100644 index 02fc1c790a2d..000000000000 --- a/scripts/generate-clients/s3-hack.js +++ /dev/null @@ -1,31 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -const root = path.join(__dirname, "..", ".."); - -const s3ModelLocation = path.join(root, "codegen", "sdk-codegen", "aws-models", "s3.json"); - -const s3ModelText = fs.readFileSync(path.join(root, "codegen", "sdk-codegen", "aws-models", "s3.json"), "utf-8"); -const s3ModelObject = require(s3ModelLocation); - -/** - * Activates a hack for S3-express Smithy suppression. - * And another one for S3 Expires. - * - * @returns a function that undoes the hack. - */ -module.exports = function () { - s3ModelObject.metadata.suppressions = s3ModelObject.metadata.suppressions.filter((suppression) => { - return suppression.id !== "RuleSetAuthSchemes"; - }); - s3ModelObject.metadata.suppressions.push({ - id: "RuleSetAuthSchemes", - namespace: "com.amazonaws.s3", - }); - - fs.writeFileSync(s3ModelLocation, JSON.stringify(s3ModelObject, null, 2)); - - return () => { - fs.writeFileSync(s3ModelLocation, s3ModelText); - }; -}; diff --git a/scripts/generate-clients/single-service.js b/scripts/generate-clients/single-service.js index cedfa1f8fb4c..e4f82a48ba32 100644 --- a/scripts/generate-clients/single-service.js +++ b/scripts/generate-clients/single-service.js @@ -4,7 +4,6 @@ const { generateClient } = require("./code-gen"); const { codeOrdering } = require("./code-ordering"); const { copyToClients } = require("./copy-to-clients"); const { spawnProcess } = require("../utils/spawn-process"); -const s3Hack = require("./s3-hack"); const SDK_CLIENTS_DIR = normalize(join(__dirname, "..", "..", "clients")); @@ -15,14 +14,7 @@ const { solo } = yargs(process.argv.slice(2)) (async () => { try { - let afterGenerate = () => {}; - if (solo === "s3") { - afterGenerate = s3Hack(); - } await generateClient(solo); - if (solo === "s3") { - afterGenerate(); - } await copyToClients( normalize(join(__dirname, "..", "..", "codegen", "sdk-codegen", "build-single", solo)), SDK_CLIENTS_DIR,