From cef037237ec77bb8ad1dbf7e55dfe398cbe5bcfd Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2024 18:49:51 -0800 Subject: [PATCH 1/6] chore: append *.ts extension for imports --- .vscode/settings.json | 3 +- .../getClientReqRespTypesMap.ts | 2 +- .../getClientTypesMap.ts | 6 +- ...ClientTypesMapWithKeysRemovedFromValues.ts | 4 +- .../generateClientTypesMap/getTypesSource.ts | 2 +- .../hasKeyReferenceInClientTypesMap.ts | 2 +- scripts/generateClientTypesMap/index.ts | 6 +- .../getClientNameWithLocalSuffix.ts | 2 +- .../getClientNamesSortedByPackageName.ts | 2 +- .../getGlobalImportEqualsInput.ts | 4 +- .../getGlobalImportEqualsOutput.ts | 8 +- .../getGlobalImportInput.ts | 4 +- .../getGlobalImportOutput.ts | 8 +- .../getGlobalImportStarInput.ts | 4 +- .../getGlobalImportStarOutput.ts | 8 +- .../getGlobalRequireInput.ts | 4 +- .../getGlobalRequireOutput.ts | 8 +- .../getGlobalRequirePropertyInput.ts | 4 +- .../getGlobalRequirePropertyOutput.ts | 2 +- .../getGlobalRequirePropertyWithNameInput.ts | 6 +- .../getGlobalRequirePropertyWithNameOutput.ts | 2 +- .../getServiceImportDeepAllInput.ts | 2 +- .../getServiceImportDeepInput.ts | 6 +- .../getServiceImportDeepOutput.ts | 8 +- .../getServiceImportDeepStarInput.ts | 6 +- .../getServiceImportDeepStarOutput.ts | 2 +- .../getServiceImportDeepStarWithNameInput.ts | 8 +- .../getServiceImportDeepStarWithNameOutput.ts | 2 +- .../getServiceImportDeepWithNameInput.ts | 8 +- .../getServiceImportDeepWithNameOutput.ts | 10 +-- .../getServiceImportEqualsInput.ts | 6 +- .../getServiceImportEqualsOutput.ts | 8 +- .../getServiceImportEqualsWithNameInput.ts | 8 +- .../getServiceImportEqualsWithNameOutput.ts | 10 +-- .../getServiceImportInput.ts | 4 +- .../getServiceImportOutput.ts | 8 +- .../getServiceImportWithNameInput.ts | 6 +- .../getServiceImportWithNameOutput.ts | 10 +-- .../getServiceRequireDeepAllInput.ts | 2 +- .../getServiceRequireDeepInput.ts | 6 +- .../getServiceRequireDeepOutput.ts | 8 +- .../getServiceRequireDeepWithNameInput.ts | 8 +- .../getServiceRequireDeepWithNameOutput.ts | 10 +-- .../getServiceRequireInput.ts | 4 +- .../getServiceRequireOutput.ts | 2 +- .../getServiceRequireWithNameInput.ts | 6 +- .../getServiceRequireWithNameOutput.ts | 10 +-- .../getV3ClientsNewExpressionCode.ts | 2 +- .../getV3PackageImportEqualsCode.ts | 4 +- .../getV3PackageImportsCode.ts | 4 +- .../getV3PackageRequiresCode.ts | 4 +- scripts/generateNewClientTests/index.ts | 76 +++++++++---------- scripts/testUpdatedIdentifiers/index.ts | 2 +- src/cli.ts | 2 +- src/transforms/index.ts | 2 +- .../apis/addEmptyObjectForUndefined.ts | 2 +- .../apis/addNotSupportedClientComments.ts | 10 +-- .../apis/getClientApiCallExpression.ts | 2 +- .../apis/getClientIdNamesFromNewExpr.ts | 4 +- .../apis/getClientIdThisExpressions.ts | 2 +- .../v2-to-v3/apis/getClientIdentifiers.ts | 8 +- .../apis/getClientIdentifiersRecord.ts | 4 +- .../apis/getClientWaiterCallExpression.ts | 2 +- .../v2-to-v3/apis/getClientWaiterStates.ts | 2 +- .../v2-to-v3/apis/getS3SignedUrlApiNames.ts | 2 +- src/transforms/v2-to-v3/apis/index.ts | 40 +++++----- .../apis/isS3CreatePresignedPostApiUsed.ts | 2 +- .../v2-to-v3/apis/isS3GetSignedUrlApiUsed.ts | 2 +- .../v2-to-v3/apis/isS3UploadApiUsed.ts | 2 +- .../v2-to-v3/apis/removePromiseCalls.ts | 4 +- .../v2-to-v3/apis/renameErrorCodeWithName.ts | 2 +- .../v2-to-v3/apis/replaceAwsError.ts | 2 +- .../v2-to-v3/apis/replaceAwsIdentity.ts | 4 +- .../apis/replaceS3CreatePresignedPostApi.ts | 4 +- .../v2-to-v3/apis/replaceS3GetSignedUrlApi.ts | 6 +- .../v2-to-v3/apis/replaceS3UploadApi.ts | 4 +- .../v2-to-v3/apis/replaceWaiterApi.ts | 14 ++-- src/transforms/v2-to-v3/aws-util/index.ts | 2 +- .../aws-util/replaceAwsUtilArrayFunctions.ts | 2 +- .../v2-to-v3/aws-util/replaceAwsUtilCopy.ts | 2 +- .../aws-util/replaceAwsUtilFunctions.ts | 4 +- .../getDynamoDBDocClientArgs.ts | 2 +- .../getDynamoDBForDocClient.ts | 2 +- .../getNewClientExpression.ts | 2 +- .../getObjectWithUpdatedAwsConfigKeys.ts | 2 +- .../v2-to-v3/client-instances/index.ts | 8 +- .../client-instances/replaceAwsConfig.ts | 2 +- .../client-instances/replaceClientCreation.ts | 4 +- .../replaceDocClientCreation.ts | 11 ++- .../client-names/getClientMetadataRecord.ts | 6 +- .../getClientNamesFromDeepImport.ts | 2 +- .../client-names/getClientNamesFromGlobal.ts | 6 +- .../client-names/getClientNamesRecord.ts | 14 ++-- .../client-names/getNamesFromNewExpr.ts | 4 +- .../client-names/getV3ClientName.spec.ts | 4 +- .../v2-to-v3/client-names/getV3ClientName.ts | 2 +- .../getV3ClientPackageName.spec.ts | 4 +- .../client-names/getV3ClientPackageName.ts | 2 +- src/transforms/v2-to-v3/client-names/index.ts | 8 +- .../v2-to-v3/config/CLIENT_NAMES_MAP.ts | 2 +- .../config/CLIENT_PACKAGE_NAMES_MAP.ts | 2 +- src/transforms/v2-to-v3/config/index.ts | 18 ++--- .../v2-to-v3/modules/addClientModules.ts | 14 ++-- .../v2-to-v3/modules/addNamedModule.ts | 8 +- .../modules/getClientTSTypeRefCount.ts | 4 +- .../modules/getGlobalNameFromModule.ts | 8 +- .../v2-to-v3/modules/getImportType.ts | 8 +- .../v2-to-v3/modules/getNewExpressionCount.ts | 6 +- .../getRequireDeclaratorsWithObjectPattern.ts | 2 +- .../getRequireDeclaratorsWithProperty.ts | 2 +- src/transforms/v2-to-v3/modules/hasImport.ts | 2 +- .../v2-to-v3/modules/hasImportEquals.ts | 2 +- src/transforms/v2-to-v3/modules/hasRequire.ts | 2 +- .../importEqualsModule/addDefaultModule.ts | 4 +- .../importEqualsModule/addNamedModule.ts | 10 +-- .../getImportEqualsDeclarations.ts | 2 +- .../importEqualsModule/getImportSpecifiers.ts | 4 +- .../modules/importEqualsModule/index.ts | 8 +- .../importEqualsModule/removeImportEquals.ts | 4 +- .../modules/importModule/addNamedModule.ts | 6 +- .../importModule/getImportDeclarations.ts | 2 +- .../importModule/getImportSpecifiers.ts | 4 +- .../v2-to-v3/modules/importModule/index.ts | 8 +- .../modules/importModule/removeImport.ts | 4 +- src/transforms/v2-to-v3/modules/index.ts | 16 ++-- .../v2-to-v3/modules/removeModules.ts | 8 +- .../modules/requireModule/addNamedModule.ts | 8 +- .../requireModule/getImportSpecifiers.ts | 4 +- .../requireModule/getRequireDeclarators.ts | 2 +- .../v2-to-v3/modules/requireModule/index.ts | 8 +- .../modules/requireModule/removeRequire.ts | 6 +- src/transforms/v2-to-v3/modules/types.ts | 2 +- src/transforms/v2-to-v3/transformer.spec.ts | 2 +- src/transforms/v2-to-v3/transformer.ts | 16 ++-- .../v2-to-v3/ts-type/getClientTypeNames.ts | 6 +- .../v2-to-v3/ts-type/getV3ClientType.ts | 6 +- .../v2-to-v3/ts-type/getV3ClientTypes.ts | 4 +- src/transforms/v2-to-v3/ts-type/index.ts | 12 +-- .../ts-type/replaceTSTypeReference.ts | 13 +++- .../v2-to-v3/utils/getClientDeepImportPath.ts | 2 +- src/transforms/v2-to-v3/utils/index.ts | 18 ++--- .../v2-to-v3/utils/isTypeScriptFile.spec.ts | 2 +- src/utils/getHelpParagraph.ts | 4 +- src/utils/getJsCodeshiftParser.ts | 2 +- src/utils/getTransformDescription.ts | 2 +- src/utils/getTransforms.ts | 2 +- src/utils/index.ts | 8 +- tsconfig.json | 1 + 148 files changed, 438 insertions(+), 426 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 35e1b0c36..b22952f78 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,6 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "biomejs.biome", "editor.rulers": [80, 120], - "editor.tabSize": 2 + "editor.tabSize": 2, + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/scripts/generateClientTypesMap/getClientReqRespTypesMap.ts b/scripts/generateClientTypesMap/getClientReqRespTypesMap.ts index 2fd644270..f9528bb44 100644 --- a/scripts/generateClientTypesMap/getClientReqRespTypesMap.ts +++ b/scripts/generateClientTypesMap/getClientReqRespTypesMap.ts @@ -1,6 +1,6 @@ import jscodeshift from "jscodeshift"; -import { getTypesSource } from "./getTypesSource"; +import { getTypesSource } from "./getTypesSource.ts"; export const getClientReqRespTypesMap = async ( clientName: string diff --git a/scripts/generateClientTypesMap/getClientTypesMap.ts b/scripts/generateClientTypesMap/getClientTypesMap.ts index 2ceafa173..3c3acdbd7 100644 --- a/scripts/generateClientTypesMap/getClientTypesMap.ts +++ b/scripts/generateClientTypesMap/getClientTypesMap.ts @@ -1,8 +1,8 @@ import jscodeshift from "jscodeshift"; -import { CLIENT_NAMES_MAP, DOCUMENT_CLIENT } from "../../src/transforms/v2-to-v3/config"; -import { getClientTypesMapWithKeysRemovedFromValues } from "./getClientTypesMapWithKeysRemovedFromValues"; -import { getTypesSource } from "./getTypesSource"; +import { CLIENT_NAMES_MAP, DOCUMENT_CLIENT } from "../../src/transforms/v2-to-v3/config/index.ts"; +import { getClientTypesMapWithKeysRemovedFromValues } from "./getClientTypesMapWithKeysRemovedFromValues/index.ts"; +import { getTypesSource } from "./getTypesSource/index.ts"; const TYPES_TO_SKIP = ["apiVersion", "ClientConfiguration"]; const ElementTypeToNativeTypeMap = { diff --git a/scripts/generateClientTypesMap/getClientTypesMapWithKeysRemovedFromValues.ts b/scripts/generateClientTypesMap/getClientTypesMapWithKeysRemovedFromValues.ts index 78de1664f..6012becb8 100644 --- a/scripts/generateClientTypesMap/getClientTypesMapWithKeysRemovedFromValues.ts +++ b/scripts/generateClientTypesMap/getClientTypesMapWithKeysRemovedFromValues.ts @@ -1,5 +1,5 @@ -import { hasKeyReferenceInClientTypesMap } from "./hasKeyReferenceInClientTypesMap"; -import { hasKeyReferenceInValue } from "./hasKeyReferenceinValue"; +import { hasKeyReferenceInClientTypesMap } from "./hasKeyReferenceInClientTypesMap/index.ts"; +import { hasKeyReferenceInValue } from "./hasKeyReferenceinValue/index.ts"; /** * Checks if any of the values have reference to key, and replaces them recursively. diff --git a/scripts/generateClientTypesMap/getTypesSource.ts b/scripts/generateClientTypesMap/getTypesSource.ts index d5ae903cd..e19924ee1 100644 --- a/scripts/generateClientTypesMap/getTypesSource.ts +++ b/scripts/generateClientTypesMap/getTypesSource.ts @@ -1,7 +1,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; import type { JSCodeshift } from "jscodeshift"; -import { DOCUMENT_CLIENT } from "../../src/transforms/v2-to-v3/config"; +import { DOCUMENT_CLIENT } from "../../src/transforms/v2-to-v3/config/index.ts"; export const getTypesSource = (j: JSCodeshift, clientName: string) => { const typesPath = diff --git a/scripts/generateClientTypesMap/hasKeyReferenceInClientTypesMap.ts b/scripts/generateClientTypesMap/hasKeyReferenceInClientTypesMap.ts index ad68e3053..76592723a 100644 --- a/scripts/generateClientTypesMap/hasKeyReferenceInClientTypesMap.ts +++ b/scripts/generateClientTypesMap/hasKeyReferenceInClientTypesMap.ts @@ -1,4 +1,4 @@ -import { hasKeyReferenceInValue } from "./hasKeyReferenceinValue"; +import { hasKeyReferenceInValue } from "./hasKeyReferenceinValue/index.ts"; /** * Checks if any of the values in the clientTypesMap has a reference to any of the keys. diff --git a/scripts/generateClientTypesMap/index.ts b/scripts/generateClientTypesMap/index.ts index 3362adcd2..bb877d500 100644 --- a/scripts/generateClientTypesMap/index.ts +++ b/scripts/generateClientTypesMap/index.ts @@ -8,9 +8,9 @@ import { DOCUMENT_CLIENT, DYNAMODB, DYNAMODB_DOCUMENT_CLIENT, -} from "../../src/transforms/v2-to-v3/config"; -import { getClientReqRespTypesMap } from "./getClientReqRespTypesMap"; -import { getClientTypesMap } from "./getClientTypesMap"; +} from "../../src/transforms/v2-to-v3/config/index.ts"; +import { getClientReqRespTypesMap } from "./getClientReqRespTypesMap.ts"; +import { getClientTypesMap } from "./getClientTypesMap.ts"; const execAsync = promisify(exec); diff --git a/scripts/generateNewClientTests/getClientNameWithLocalSuffix.ts b/scripts/generateNewClientTests/getClientNameWithLocalSuffix.ts index aac78f82a..74f9697c0 100644 --- a/scripts/generateNewClientTests/getClientNameWithLocalSuffix.ts +++ b/scripts/generateNewClientTests/getClientNameWithLocalSuffix.ts @@ -1,4 +1,4 @@ -import { LOCAL_NAME_SUFFIX } from "./config"; +import { LOCAL_NAME_SUFFIX } from "./config/index.ts"; export const getClientNameWithLocalSuffix = (clientName: string) => `${clientName}${LOCAL_NAME_SUFFIX}`; diff --git a/scripts/generateNewClientTests/getClientNamesSortedByPackageName.ts b/scripts/generateNewClientTests/getClientNamesSortedByPackageName.ts index 125c3295f..a3b6c626a 100644 --- a/scripts/generateNewClientTests/getClientNamesSortedByPackageName.ts +++ b/scripts/generateNewClientTests/getClientNamesSortedByPackageName.ts @@ -1,4 +1,4 @@ -import { CLIENT_PACKAGE_NAMES_MAP } from "../../src/transforms/v2-to-v3/config"; +import { CLIENT_PACKAGE_NAMES_MAP } from "../../src/transforms/v2-to-v3/config/index.ts"; export const getClientNamesSortedByPackageName = (clientsToTest: string[]) => Object.keys( diff --git a/scripts/generateNewClientTests/getGlobalImportEqualsInput.ts b/scripts/generateNewClientTests/getGlobalImportEqualsInput.ts index ce1ac15e8..39b235ac2 100644 --- a/scripts/generateNewClientTests/getGlobalImportEqualsInput.ts +++ b/scripts/generateNewClientTests/getGlobalImportEqualsInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getGlobalImportEqualsInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalImportEqualsOutput.ts b/scripts/generateNewClientTests/getGlobalImportEqualsOutput.ts index 05a919a49..4ea206b90 100644 --- a/scripts/generateNewClientTests/getGlobalImportEqualsOutput.ts +++ b/scripts/generateNewClientTests/getGlobalImportEqualsOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode/index.ts"; export const getGlobalImportEqualsOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalImportInput.ts b/scripts/generateNewClientTests/getGlobalImportInput.ts index aa66b83d3..ad3ae47a7 100644 --- a/scripts/generateNewClientTests/getGlobalImportInput.ts +++ b/scripts/generateNewClientTests/getGlobalImportInput.ts @@ -1,5 +1,5 @@ -import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/config"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/config/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getGlobalImportInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalImportOutput.ts b/scripts/generateNewClientTests/getGlobalImportOutput.ts index f17efcbea..b7b9f81af 100644 --- a/scripts/generateNewClientTests/getGlobalImportOutput.ts +++ b/scripts/generateNewClientTests/getGlobalImportOutput.ts @@ -1,7 +1,7 @@ -import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/config"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode"; +import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/config/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; export const getGlobalImportOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalImportStarInput.ts b/scripts/generateNewClientTests/getGlobalImportStarInput.ts index e0cb69723..ee60a5ff9 100644 --- a/scripts/generateNewClientTests/getGlobalImportStarInput.ts +++ b/scripts/generateNewClientTests/getGlobalImportStarInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getGlobalImportStarInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalImportStarOutput.ts b/scripts/generateNewClientTests/getGlobalImportStarOutput.ts index a5c757857..726825974 100644 --- a/scripts/generateNewClientTests/getGlobalImportStarOutput.ts +++ b/scripts/generateNewClientTests/getGlobalImportStarOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; export const getGlobalImportStarOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalRequireInput.ts b/scripts/generateNewClientTests/getGlobalRequireInput.ts index 096e17c2f..f7b092a8e 100644 --- a/scripts/generateNewClientTests/getGlobalRequireInput.ts +++ b/scripts/generateNewClientTests/getGlobalRequireInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getGlobalRequireInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalRequireOutput.ts b/scripts/generateNewClientTests/getGlobalRequireOutput.ts index 5917a71ab..93447b860 100644 --- a/scripts/generateNewClientTests/getGlobalRequireOutput.ts +++ b/scripts/generateNewClientTests/getGlobalRequireOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode/index.ts"; export const getGlobalRequireOutput = () => { let content = "\n\n"; diff --git a/scripts/generateNewClientTests/getGlobalRequirePropertyInput.ts b/scripts/generateNewClientTests/getGlobalRequirePropertyInput.ts index 4616afebc..02b9cbd61 100644 --- a/scripts/generateNewClientTests/getGlobalRequirePropertyInput.ts +++ b/scripts/generateNewClientTests/getGlobalRequirePropertyInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getGlobalRequirePropertyInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalRequirePropertyOutput.ts b/scripts/generateNewClientTests/getGlobalRequirePropertyOutput.ts index 9c8e5d619..f10e26d09 100644 --- a/scripts/generateNewClientTests/getGlobalRequirePropertyOutput.ts +++ b/scripts/generateNewClientTests/getGlobalRequirePropertyOutput.ts @@ -1,3 +1,3 @@ -import { getServiceRequireDeepOutput } from "./getServiceRequireDeepOutput"; +import { getServiceRequireDeepOutput } from "./getServiceRequireDeepOutput/index.ts"; export const getGlobalRequirePropertyOutput = getServiceRequireDeepOutput; diff --git a/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameInput.ts b/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameInput.ts index eb6bb50bd..08362bd71 100644 --- a/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameInput.ts +++ b/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getGlobalRequirePropertyWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameOutput.ts b/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameOutput.ts index e8ff2f5a7..fd35e8252 100644 --- a/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameOutput.ts +++ b/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameOutput.ts @@ -1,3 +1,3 @@ -import { getServiceRequireDeepWithNameOutput } from "./getServiceRequireDeepWithNameOutput"; +import { getServiceRequireDeepWithNameOutput } from "./getServiceRequireDeepWithNameOutput/index.ts"; export const getGlobalRequirePropertyWithNameOutput = getServiceRequireDeepWithNameOutput; diff --git a/scripts/generateNewClientTests/getServiceImportDeepAllInput.ts b/scripts/generateNewClientTests/getServiceImportDeepAllInput.ts index 768d394bb..fadd48e24 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepAllInput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepAllInput.ts @@ -1,3 +1,3 @@ -import { getServiceImportInput } from "./getServiceImportInput"; +import { getServiceImportInput } from "./getServiceImportInput/index.ts"; export const getServiceImportDeepAllInput = () => getServiceImportInput("aws-sdk/clients/all"); diff --git a/scripts/generateNewClientTests/getServiceImportDeepInput.ts b/scripts/generateNewClientTests/getServiceImportDeepInput.ts index b1cb95623..96ceb88b1 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepInput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientDeepImportPath } from "./getClientDeepImportPath"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceImportDeepInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportDeepOutput.ts b/scripts/generateNewClientTests/getServiceImportDeepOutput.ts index 5b7f5f8f7..29f39b8e8 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; export const getServiceImportDeepOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportDeepStarInput.ts b/scripts/generateNewClientTests/getServiceImportDeepStarInput.ts index 50cc7fca2..65684767b 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepStarInput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepStarInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientDeepImportPath } from "./getClientDeepImportPath"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceImportDeepStarInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportDeepStarOutput.ts b/scripts/generateNewClientTests/getServiceImportDeepStarOutput.ts index 14ce7fe81..c32a7565f 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepStarOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepStarOutput.ts @@ -1,3 +1,3 @@ -import { getServiceImportDeepOutput } from "./getServiceImportDeepOutput"; +import { getServiceImportDeepOutput } from "./getServiceImportDeepOutput/index.ts"; export const getServiceImportDeepStarOutput = getServiceImportDeepOutput; diff --git a/scripts/generateNewClientTests/getServiceImportDeepStarWithNameInput.ts b/scripts/generateNewClientTests/getServiceImportDeepStarWithNameInput.ts index b4506cf04..491aa40d2 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepStarWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepStarWithNameInput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientDeepImportPath } from "./getClientDeepImportPath"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceImportDeepStarWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportDeepStarWithNameOutput.ts b/scripts/generateNewClientTests/getServiceImportDeepStarWithNameOutput.ts index 3c419a908..1fab50483 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepStarWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepStarWithNameOutput.ts @@ -1,3 +1,3 @@ -import { getServiceImportDeepWithNameOutput } from "./getServiceImportDeepWithNameOutput"; +import { getServiceImportDeepWithNameOutput } from "./getServiceImportDeepWithNameOutput/index.ts"; export const getServiceImportDeepStarWithNameOutput = getServiceImportDeepWithNameOutput; diff --git a/scripts/generateNewClientTests/getServiceImportDeepWithNameInput.ts b/scripts/generateNewClientTests/getServiceImportDeepWithNameInput.ts index f8dc4c11f..755441e14 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepWithNameInput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientDeepImportPath } from "./getClientDeepImportPath"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceImportDeepWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportDeepWithNameOutput.ts b/scripts/generateNewClientTests/getServiceImportDeepWithNameOutput.ts index 353c98b78..44e46459b 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepWithNameOutput.ts @@ -1,8 +1,8 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; export const getServiceImportDeepWithNameOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportEqualsInput.ts b/scripts/generateNewClientTests/getServiceImportEqualsInput.ts index 0a9a916a4..41cec0cae 100644 --- a/scripts/generateNewClientTests/getServiceImportEqualsInput.ts +++ b/scripts/generateNewClientTests/getServiceImportEqualsInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientDeepImportPath } from "./getClientDeepImportPath"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceImportEqualsInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportEqualsOutput.ts b/scripts/generateNewClientTests/getServiceImportEqualsOutput.ts index f74eed5f7..41fe361f3 100644 --- a/scripts/generateNewClientTests/getServiceImportEqualsOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportEqualsOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode/index.ts"; export const getServiceImportEqualsOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportEqualsWithNameInput.ts b/scripts/generateNewClientTests/getServiceImportEqualsWithNameInput.ts index 6f77ffd5a..bb374315f 100644 --- a/scripts/generateNewClientTests/getServiceImportEqualsWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceImportEqualsWithNameInput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientDeepImportPath } from "./getClientDeepImportPath"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceImportEqualsWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportEqualsWithNameOutput.ts b/scripts/generateNewClientTests/getServiceImportEqualsWithNameOutput.ts index e3ea5e360..66c1577de 100644 --- a/scripts/generateNewClientTests/getServiceImportEqualsWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportEqualsWithNameOutput.ts @@ -1,8 +1,8 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode/index.ts"; export const getServiceImportEqualsWithNameOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportInput.ts b/scripts/generateNewClientTests/getServiceImportInput.ts index 4bfb176ca..fabf2f9e5 100644 --- a/scripts/generateNewClientTests/getServiceImportInput.ts +++ b/scripts/generateNewClientTests/getServiceImportInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceImportInput = (path?: string) => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportOutput.ts b/scripts/generateNewClientTests/getServiceImportOutput.ts index 3b4a714e6..f63240c11 100644 --- a/scripts/generateNewClientTests/getServiceImportOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; export const getServiceImportOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportWithNameInput.ts b/scripts/generateNewClientTests/getServiceImportWithNameInput.ts index e56028e9a..929d14231 100644 --- a/scripts/generateNewClientTests/getServiceImportWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceImportWithNameInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceImportWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportWithNameOutput.ts b/scripts/generateNewClientTests/getServiceImportWithNameOutput.ts index 29af90033..f07f23b25 100644 --- a/scripts/generateNewClientTests/getServiceImportWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportWithNameOutput.ts @@ -1,8 +1,8 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; export const getServiceImportWithNameOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceRequireDeepAllInput.ts b/scripts/generateNewClientTests/getServiceRequireDeepAllInput.ts index 21abf404e..25a612ee5 100644 --- a/scripts/generateNewClientTests/getServiceRequireDeepAllInput.ts +++ b/scripts/generateNewClientTests/getServiceRequireDeepAllInput.ts @@ -1,3 +1,3 @@ -import { getServiceRequireInput } from "./getServiceRequireInput"; +import { getServiceRequireInput } from "./getServiceRequireInput/index.ts"; export const getServiceRequireDeepAllInput = () => getServiceRequireInput("aws-sdk/clients/all"); diff --git a/scripts/generateNewClientTests/getServiceRequireDeepInput.ts b/scripts/generateNewClientTests/getServiceRequireDeepInput.ts index f96eb396b..a219cc1e9 100644 --- a/scripts/generateNewClientTests/getServiceRequireDeepInput.ts +++ b/scripts/generateNewClientTests/getServiceRequireDeepInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientDeepImportPath } from "./getClientDeepImportPath"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceRequireDeepInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceRequireDeepOutput.ts b/scripts/generateNewClientTests/getServiceRequireDeepOutput.ts index 791c526bd..403ef1e3f 100644 --- a/scripts/generateNewClientTests/getServiceRequireDeepOutput.ts +++ b/scripts/generateNewClientTests/getServiceRequireDeepOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode/index.ts"; export const getServiceRequireDeepOutput = () => { let content = "\n\n"; diff --git a/scripts/generateNewClientTests/getServiceRequireDeepWithNameInput.ts b/scripts/generateNewClientTests/getServiceRequireDeepWithNameInput.ts index 773e49bd6..6c4bc4309 100644 --- a/scripts/generateNewClientTests/getServiceRequireDeepWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceRequireDeepWithNameInput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientDeepImportPath } from "./getClientDeepImportPath"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceRequireDeepWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceRequireDeepWithNameOutput.ts b/scripts/generateNewClientTests/getServiceRequireDeepWithNameOutput.ts index 0fb42a7b4..3149c2ed6 100644 --- a/scripts/generateNewClientTests/getServiceRequireDeepWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceRequireDeepWithNameOutput.ts @@ -1,8 +1,8 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode/index.ts"; export const getServiceRequireDeepWithNameOutput = () => { let content = "\n\n"; diff --git a/scripts/generateNewClientTests/getServiceRequireInput.ts b/scripts/generateNewClientTests/getServiceRequireInput.ts index dc279c0a4..36368cf75 100644 --- a/scripts/generateNewClientTests/getServiceRequireInput.ts +++ b/scripts/generateNewClientTests/getServiceRequireInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceRequireInput = (path?: string) => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceRequireOutput.ts b/scripts/generateNewClientTests/getServiceRequireOutput.ts index 39b62652d..2f7041797 100644 --- a/scripts/generateNewClientTests/getServiceRequireOutput.ts +++ b/scripts/generateNewClientTests/getServiceRequireOutput.ts @@ -1,3 +1,3 @@ -import { getGlobalRequireOutput } from "./getGlobalRequireOutput"; +import { getGlobalRequireOutput } from "./getGlobalRequireOutput/index.ts"; export const getServiceRequireOutput = getGlobalRequireOutput; diff --git a/scripts/generateNewClientTests/getServiceRequireWithNameInput.ts b/scripts/generateNewClientTests/getServiceRequireWithNameInput.ts index 33ac39e03..5e5103840 100644 --- a/scripts/generateNewClientTests/getServiceRequireWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceRequireWithNameInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; export const getServiceRequireWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceRequireWithNameOutput.ts b/scripts/generateNewClientTests/getServiceRequireWithNameOutput.ts index 2c1155314..4ee4e94e1 100644 --- a/scripts/generateNewClientTests/getServiceRequireWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceRequireWithNameOutput.ts @@ -1,8 +1,8 @@ -import { CLIENTS_TO_TEST } from "./config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode"; -import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode"; +import { CLIENTS_TO_TEST } from "./config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; +import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode/index.ts"; export const getServiceRequireWithNameOutput = () => { let content = "\n\n"; diff --git a/scripts/generateNewClientTests/getV3ClientsNewExpressionCode.ts b/scripts/generateNewClientTests/getV3ClientsNewExpressionCode.ts index 6d6b2bab9..58821b4cb 100644 --- a/scripts/generateNewClientTests/getV3ClientsNewExpressionCode.ts +++ b/scripts/generateNewClientTests/getV3ClientsNewExpressionCode.ts @@ -1,4 +1,4 @@ -import { CLIENT_NAMES_MAP } from "../../src/transforms/v2-to-v3/config"; +import { CLIENT_NAMES_MAP } from "../../src/transforms/v2-to-v3/config/index.ts"; export const getV3ClientsNewExpressionCode = (clientsToTest: string[]) => { let content = ""; diff --git a/scripts/generateNewClientTests/getV3PackageImportEqualsCode.ts b/scripts/generateNewClientTests/getV3PackageImportEqualsCode.ts index 3e2e9e15a..cdd871593 100644 --- a/scripts/generateNewClientTests/getV3PackageImportEqualsCode.ts +++ b/scripts/generateNewClientTests/getV3PackageImportEqualsCode.ts @@ -2,8 +2,8 @@ import { type CLIENT_NAMES, CLIENT_NAMES_MAP, CLIENT_PACKAGE_NAMES_MAP, -} from "../../src/transforms/v2-to-v3/config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; +} from "../../src/transforms/v2-to-v3/config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; export interface V3PackageImportEqualsCodeOptions { useLocalSuffix?: boolean; diff --git a/scripts/generateNewClientTests/getV3PackageImportsCode.ts b/scripts/generateNewClientTests/getV3PackageImportsCode.ts index 1b456d068..799b5a15b 100644 --- a/scripts/generateNewClientTests/getV3PackageImportsCode.ts +++ b/scripts/generateNewClientTests/getV3PackageImportsCode.ts @@ -2,8 +2,8 @@ import { type CLIENT_NAMES, CLIENT_NAMES_MAP, CLIENT_PACKAGE_NAMES_MAP, -} from "../../src/transforms/v2-to-v3/config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; +} from "../../src/transforms/v2-to-v3/config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; export interface V3PackageImportsCodeOptions { useLocalSuffix?: boolean; diff --git a/scripts/generateNewClientTests/getV3PackageRequiresCode.ts b/scripts/generateNewClientTests/getV3PackageRequiresCode.ts index c6aa47ec0..db58690bb 100644 --- a/scripts/generateNewClientTests/getV3PackageRequiresCode.ts +++ b/scripts/generateNewClientTests/getV3PackageRequiresCode.ts @@ -2,8 +2,8 @@ import { type CLIENT_NAMES, CLIENT_NAMES_MAP, CLIENT_PACKAGE_NAMES_MAP, -} from "../../src/transforms/v2-to-v3/config"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix"; +} from "../../src/transforms/v2-to-v3/config/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; export interface V3PackageRequiresCodeOptions { useLocalSuffix?: boolean; diff --git a/scripts/generateNewClientTests/index.ts b/scripts/generateNewClientTests/index.ts index dd17bef8c..2a533ee98 100644 --- a/scripts/generateNewClientTests/index.ts +++ b/scripts/generateNewClientTests/index.ts @@ -3,44 +3,44 @@ import { writeFile } from "node:fs/promises"; import { join } from "node:path"; -import { getGlobalImportEqualsInput } from "./getGlobalImportEqualsInput"; -import { getGlobalImportEqualsOutput } from "./getGlobalImportEqualsOutput"; -import { getGlobalImportInput } from "./getGlobalImportInput"; -import { getGlobalImportOutput } from "./getGlobalImportOutput"; -import { getGlobalImportStarInput } from "./getGlobalImportStarInput"; -import { getGlobalImportStarOutput } from "./getGlobalImportStarOutput"; -import { getGlobalRequireInput } from "./getGlobalRequireInput"; -import { getGlobalRequireOutput } from "./getGlobalRequireOutput"; -import { getGlobalRequirePropertyInput } from "./getGlobalRequirePropertyInput"; -import { getGlobalRequirePropertyOutput } from "./getGlobalRequirePropertyOutput"; -import { getGlobalRequirePropertyWithNameInput } from "./getGlobalRequirePropertyWithNameInput"; -import { getGlobalRequirePropertyWithNameOutput } from "./getGlobalRequirePropertyWithNameOutput"; -import { getServiceImportDeepAllInput } from "./getServiceImportDeepAllInput"; -import { getServiceImportDeepInput } from "./getServiceImportDeepInput"; -import { getServiceImportDeepOutput } from "./getServiceImportDeepOutput"; -import { getServiceImportDeepStarInput } from "./getServiceImportDeepStarInput"; -import { getServiceImportDeepStarOutput } from "./getServiceImportDeepStarOutput"; -import { getServiceImportDeepStarWithNameInput } from "./getServiceImportDeepStarWithNameInput"; -import { getServiceImportDeepStarWithNameOutput } from "./getServiceImportDeepStarWithNameOutput"; -import { getServiceImportDeepWithNameInput } from "./getServiceImportDeepWithNameInput"; -import { getServiceImportDeepWithNameOutput } from "./getServiceImportDeepWithNameOutput"; -import { getServiceImportEqualsInput } from "./getServiceImportEqualsInput"; -import { getServiceImportEqualsOutput } from "./getServiceImportEqualsOutput"; -import { getServiceImportEqualsWithNameInput } from "./getServiceImportEqualsWithNameInput"; -import { getServiceImportEqualsWithNameOutput } from "./getServiceImportEqualsWithNameOutput"; -import { getServiceImportInput } from "./getServiceImportInput"; -import { getServiceImportOutput } from "./getServiceImportOutput"; -import { getServiceImportWithNameInput } from "./getServiceImportWithNameInput"; -import { getServiceImportWithNameOutput } from "./getServiceImportWithNameOutput"; -import { getServiceRequireDeepAllInput } from "./getServiceRequireDeepAllInput"; -import { getServiceRequireDeepInput } from "./getServiceRequireDeepInput"; -import { getServiceRequireDeepOutput } from "./getServiceRequireDeepOutput"; -import { getServiceRequireDeepWithNameInput } from "./getServiceRequireDeepWithNameInput"; -import { getServiceRequireDeepWithNameOutput } from "./getServiceRequireDeepWithNameOutput"; -import { getServiceRequireInput } from "./getServiceRequireInput"; -import { getServiceRequireOutput } from "./getServiceRequireOutput"; -import { getServiceRequireWithNameInput } from "./getServiceRequireWithNameInput"; -import { getServiceRequireWithNameOutput } from "./getServiceRequireWithNameOutput"; +import { getGlobalImportEqualsInput } from "./getGlobalImportEqualsInput.ts"; +import { getGlobalImportEqualsOutput } from "./getGlobalImportEqualsOutput.ts"; +import { getGlobalImportInput } from "./getGlobalImportInput.ts"; +import { getGlobalImportOutput } from "./getGlobalImportOutput.ts"; +import { getGlobalImportStarInput } from "./getGlobalImportStarInput.ts"; +import { getGlobalImportStarOutput } from "./getGlobalImportStarOutput.ts"; +import { getGlobalRequireInput } from "./getGlobalRequireInput.ts"; +import { getGlobalRequireOutput } from "./getGlobalRequireOutput.ts"; +import { getGlobalRequirePropertyInput } from "./getGlobalRequirePropertyInput.ts"; +import { getGlobalRequirePropertyOutput } from "./getGlobalRequirePropertyOutput.ts"; +import { getGlobalRequirePropertyWithNameInput } from "./getGlobalRequirePropertyWithNameInput.ts"; +import { getGlobalRequirePropertyWithNameOutput } from "./getGlobalRequirePropertyWithNameOutput.ts"; +import { getServiceImportDeepAllInput } from "./getServiceImportDeepAllInput.ts"; +import { getServiceImportDeepInput } from "./getServiceImportDeepInput.ts"; +import { getServiceImportDeepOutput } from "./getServiceImportDeepOutput.ts"; +import { getServiceImportDeepStarInput } from "./getServiceImportDeepStarInput.ts"; +import { getServiceImportDeepStarOutput } from "./getServiceImportDeepStarOutput.ts"; +import { getServiceImportDeepStarWithNameInput } from "./getServiceImportDeepStarWithNameInput.ts"; +import { getServiceImportDeepStarWithNameOutput } from "./getServiceImportDeepStarWithNameOutput.ts"; +import { getServiceImportDeepWithNameInput } from "./getServiceImportDeepWithNameInput.ts"; +import { getServiceImportDeepWithNameOutput } from "./getServiceImportDeepWithNameOutput.ts"; +import { getServiceImportEqualsInput } from "./getServiceImportEqualsInput.ts"; +import { getServiceImportEqualsOutput } from "./getServiceImportEqualsOutput.ts"; +import { getServiceImportEqualsWithNameInput } from "./getServiceImportEqualsWithNameInput.ts"; +import { getServiceImportEqualsWithNameOutput } from "./getServiceImportEqualsWithNameOutput.ts"; +import { getServiceImportInput } from "./getServiceImportInput.ts"; +import { getServiceImportOutput } from "./getServiceImportOutput.ts"; +import { getServiceImportWithNameInput } from "./getServiceImportWithNameInput.ts"; +import { getServiceImportWithNameOutput } from "./getServiceImportWithNameOutput.ts"; +import { getServiceRequireDeepAllInput } from "./getServiceRequireDeepAllInput.ts"; +import { getServiceRequireDeepInput } from "./getServiceRequireDeepInput.ts"; +import { getServiceRequireDeepOutput } from "./getServiceRequireDeepOutput.ts"; +import { getServiceRequireDeepWithNameInput } from "./getServiceRequireDeepWithNameInput.ts"; +import { getServiceRequireDeepWithNameOutput } from "./getServiceRequireDeepWithNameOutput.ts"; +import { getServiceRequireInput } from "./getServiceRequireInput.ts"; +import { getServiceRequireOutput } from "./getServiceRequireOutput.ts"; +import { getServiceRequireWithNameInput } from "./getServiceRequireWithNameInput.ts"; +import { getServiceRequireWithNameOutput } from "./getServiceRequireWithNameOutput.ts"; const codegenComment = `// This file is generated by scripts/generateNewClientTests/index.ts // Do not edit this file directly. Instead, edit the script and run it to regenerate this file.`; diff --git a/scripts/testUpdatedIdentifiers/index.ts b/scripts/testUpdatedIdentifiers/index.ts index 948df084e..ef456ad22 100644 --- a/scripts/testUpdatedIdentifiers/index.ts +++ b/scripts/testUpdatedIdentifiers/index.ts @@ -6,7 +6,7 @@ import { promisify } from "node:util"; import { CLIENT_NAMES_MAP as CLIENT_NAMES_MAP_TO_PUBLISH, CLIENT_PACKAGE_NAMES_MAP as PACKAGE_NAMES_MAP_TO_PUBLISH, -} from "../../src/transforms/v2-to-v3/config"; +} from "../../src/transforms/v2-to-v3/config/index.ts"; const execAsync = promisify(exec); diff --git a/src/cli.ts b/src/cli.ts index 5e5572cdf..d1c7ee916 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -30,7 +30,7 @@ import { getJsCodeshiftParser, getTransforms, getUpdatedTransformFile, -} from "./utils"; +} from "./utils/index.ts"; const args = process.argv; const transforms = getTransforms(); diff --git a/src/transforms/index.ts b/src/transforms/index.ts index eea524d65..7ad3e9360 100644 --- a/src/transforms/index.ts +++ b/src/transforms/index.ts @@ -1 +1 @@ -export * from "./types"; +export * from "./types.ts"; diff --git a/src/transforms/v2-to-v3/apis/addEmptyObjectForUndefined.ts b/src/transforms/v2-to-v3/apis/addEmptyObjectForUndefined.ts index 88594a68b..b27d08b1c 100644 --- a/src/transforms/v2-to-v3/apis/addEmptyObjectForUndefined.ts +++ b/src/transforms/v2-to-v3/apis/addEmptyObjectForUndefined.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; +import type { ClientIdentifier } from "../types.ts"; // Adds an empty object, if undefined is passed for optional parameters. export const addEmptyObjectForUndefined = ( diff --git a/src/transforms/v2-to-v3/apis/addNotSupportedClientComments.ts b/src/transforms/v2-to-v3/apis/addNotSupportedClientComments.ts index 293b29b42..311ad6981 100644 --- a/src/transforms/v2-to-v3/apis/addNotSupportedClientComments.ts +++ b/src/transforms/v2-to-v3/apis/addNotSupportedClientComments.ts @@ -1,10 +1,10 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { FUNCTION_TYPE_LIST, NOT_SUPPORTED_COMMENT, S3 } from "../config"; -import type { ClientIdentifier } from "../types"; -import { getClientApiCallExpression } from "./getClientApiCallExpression"; -import { getClientWaiterCallExpression } from "./getClientWaiterCallExpression"; -import { getClientWaiterStates } from "./getClientWaiterStates"; +import { FUNCTION_TYPE_LIST, NOT_SUPPORTED_COMMENT, S3 } from "../config/index.ts"; +import type { ClientIdentifier } from "../types.ts"; +import { getClientApiCallExpression } from "./getClientApiCallExpression.ts"; +import { getClientWaiterCallExpression } from "./getClientWaiterCallExpression.ts"; +import { getClientWaiterStates } from "./getClientWaiterStates.ts"; export interface CommentsForUnsupportedAPIsOptions { v2ClientName: string; diff --git a/src/transforms/v2-to-v3/apis/getClientApiCallExpression.ts b/src/transforms/v2-to-v3/apis/getClientApiCallExpression.ts index bf5cde722..ba0cbd547 100644 --- a/src/transforms/v2-to-v3/apis/getClientApiCallExpression.ts +++ b/src/transforms/v2-to-v3/apis/getClientApiCallExpression.ts @@ -1,6 +1,6 @@ import type { CallExpression } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; +import type { ClientIdentifier } from "../types.ts"; export const getClientApiCallExpression = ( clientId: ClientIdentifier, diff --git a/src/transforms/v2-to-v3/apis/getClientIdNamesFromNewExpr.ts b/src/transforms/v2-to-v3/apis/getClientIdNamesFromNewExpr.ts index d2596eff8..d837a38f5 100644 --- a/src/transforms/v2-to-v3/apis/getClientIdNamesFromNewExpr.ts +++ b/src/transforms/v2-to-v3/apis/getClientIdNamesFromNewExpr.ts @@ -6,11 +6,11 @@ import type { NewExpression, } from "jscodeshift"; -import { DOCUMENT_CLIENT, DYNAMODB, DYNAMODB_DOCUMENT_CLIENT } from "../config"; +import { DOCUMENT_CLIENT, DYNAMODB, DYNAMODB_DOCUMENT_CLIENT } from "../config/index.ts"; import { getClientNewExpressionFromGlobalName, getClientNewExpressionFromLocalName, -} from "../utils"; +} from "../utils/index.ts"; export interface GetClientIdNamesFromNewExprOptions { v2ClientName: string; diff --git a/src/transforms/v2-to-v3/apis/getClientIdThisExpressions.ts b/src/transforms/v2-to-v3/apis/getClientIdThisExpressions.ts index fe9334f5c..7c1909290 100644 --- a/src/transforms/v2-to-v3/apis/getClientIdThisExpressions.ts +++ b/src/transforms/v2-to-v3/apis/getClientIdThisExpressions.ts @@ -1,5 +1,5 @@ import type { Collection, Identifier, JSCodeshift, MemberExpression } from "jscodeshift"; -import type { ThisMemberExpression } from "../types"; +import type { ThisMemberExpression } from "../types.ts"; const thisMemberExpression = { type: "MemberExpression", object: { type: "ThisExpression" } }; diff --git a/src/transforms/v2-to-v3/apis/getClientIdentifiers.ts b/src/transforms/v2-to-v3/apis/getClientIdentifiers.ts index 5844bf173..f057ed885 100644 --- a/src/transforms/v2-to-v3/apis/getClientIdentifiers.ts +++ b/src/transforms/v2-to-v3/apis/getClientIdentifiers.ts @@ -1,9 +1,9 @@ import type { Collection, Identifier, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; -import { getClientIdNamesFromNewExpr } from "./getClientIdNamesFromNewExpr"; -import { getClientIdNamesFromTSTypeRef } from "./getClientIdNamesFromTSTypeRef"; -import { getClientIdThisExpressions } from "./getClientIdThisExpressions"; +import type { ClientIdentifier } from "../types.ts"; +import { getClientIdNamesFromNewExpr } from "./getClientIdNamesFromNewExpr.ts"; +import { getClientIdNamesFromTSTypeRef } from "./getClientIdNamesFromTSTypeRef.ts"; +import { getClientIdThisExpressions } from "./getClientIdThisExpressions.ts"; export interface GetClientIdentifiersOptions { v2ClientName: string; diff --git a/src/transforms/v2-to-v3/apis/getClientIdentifiersRecord.ts b/src/transforms/v2-to-v3/apis/getClientIdentifiersRecord.ts index 8394c9f55..098d82c5f 100644 --- a/src/transforms/v2-to-v3/apis/getClientIdentifiersRecord.ts +++ b/src/transforms/v2-to-v3/apis/getClientIdentifiersRecord.ts @@ -1,7 +1,7 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifiersRecord } from "../types"; -import { getClientIdentifiers } from "./getClientIdentifiers"; +import type { ClientIdentifiersRecord } from "../types.ts"; +import { getClientIdentifiers } from "./getClientIdentifiers.ts"; export interface GetClientIdentifiersRecordOptions { v2GlobalName?: string; diff --git a/src/transforms/v2-to-v3/apis/getClientWaiterCallExpression.ts b/src/transforms/v2-to-v3/apis/getClientWaiterCallExpression.ts index 12d387899..a9940af39 100644 --- a/src/transforms/v2-to-v3/apis/getClientWaiterCallExpression.ts +++ b/src/transforms/v2-to-v3/apis/getClientWaiterCallExpression.ts @@ -1,6 +1,6 @@ import type { CallExpression } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; +import type { ClientIdentifier } from "../types.ts"; export const getClientWaiterCallExpression = ( clientId: ClientIdentifier, diff --git a/src/transforms/v2-to-v3/apis/getClientWaiterStates.ts b/src/transforms/v2-to-v3/apis/getClientWaiterStates.ts index f76cb40e8..d9fe60e3d 100644 --- a/src/transforms/v2-to-v3/apis/getClientWaiterStates.ts +++ b/src/transforms/v2-to-v3/apis/getClientWaiterStates.ts @@ -1,5 +1,5 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; +import type { ClientIdentifier } from "../types.ts"; export const getClientWaiterStates = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/apis/getS3SignedUrlApiNames.ts b/src/transforms/v2-to-v3/apis/getS3SignedUrlApiNames.ts index 92576b5a9..e545fcbfa 100644 --- a/src/transforms/v2-to-v3/apis/getS3SignedUrlApiNames.ts +++ b/src/transforms/v2-to-v3/apis/getS3SignedUrlApiNames.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; +import type { ClientIdentifier } from "../types.ts"; export const getS3SignedUrlApiNames = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/apis/index.ts b/src/transforms/v2-to-v3/apis/index.ts index 84b453f95..d194ebeaf 100644 --- a/src/transforms/v2-to-v3/apis/index.ts +++ b/src/transforms/v2-to-v3/apis/index.ts @@ -1,20 +1,20 @@ -export * from "./addEmptyObjectForUndefined"; -export * from "./addNotSupportedClientComments"; -export * from "./addPromiseRemovalComments"; -export * from "./getClientIdentifiersRecord"; -export * from "./getClientWaiterStates"; -export * from "./getCommandName"; -export * from "./getS3SignedUrlApiNames"; -export * from "./getV3ClientWaiterApiName"; -export * from "./isS3CreatePresignedPostApiUsed"; -export * from "./isS3GetSignedUrlApiUsed"; -export * from "./isS3UploadApiUsed"; -export * from "./removePromiseCalls"; -export * from "./renameErrorCodeWithName"; -export * from "./replaceAwsEndpoint"; -export * from "./replaceAwsError"; -export * from "./replaceAwsIdentity"; -export * from "./replaceS3CreatePresignedPostApi"; -export * from "./replaceS3GetSignedUrlApi"; -export * from "./replaceS3UploadApi"; -export * from "./replaceWaiterApi"; +export * from "./addEmptyObjectForUndefined.ts"; +export * from "./addNotSupportedClientComments.ts"; +export * from "./addPromiseRemovalComments.ts"; +export * from "./getClientIdentifiersRecord.ts"; +export * from "./getClientWaiterStates.ts"; +export * from "./getCommandName.ts"; +export * from "./getS3SignedUrlApiNames.ts"; +export * from "./getV3ClientWaiterApiName.ts"; +export * from "./isS3CreatePresignedPostApiUsed.ts"; +export * from "./isS3GetSignedUrlApiUsed.ts"; +export * from "./isS3UploadApiUsed.ts"; +export * from "./removePromiseCalls.ts"; +export * from "./renameErrorCodeWithName.ts"; +export * from "./replaceAwsEndpoint.ts"; +export * from "./replaceAwsError.ts"; +export * from "./replaceAwsIdentity.ts"; +export * from "./replaceS3CreatePresignedPostApi.ts"; +export * from "./replaceS3GetSignedUrlApi.ts"; +export * from "./replaceS3UploadApi.ts"; +export * from "./replaceWaiterApi.ts"; diff --git a/src/transforms/v2-to-v3/apis/isS3CreatePresignedPostApiUsed.ts b/src/transforms/v2-to-v3/apis/isS3CreatePresignedPostApiUsed.ts index 5b54377c5..4fe947486 100644 --- a/src/transforms/v2-to-v3/apis/isS3CreatePresignedPostApiUsed.ts +++ b/src/transforms/v2-to-v3/apis/isS3CreatePresignedPostApiUsed.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; +import type { ClientIdentifier } from "../types.ts"; export const isS3CreatePresignedPostApiUsed = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/apis/isS3GetSignedUrlApiUsed.ts b/src/transforms/v2-to-v3/apis/isS3GetSignedUrlApiUsed.ts index 4bf17e14d..8c77c8663 100644 --- a/src/transforms/v2-to-v3/apis/isS3GetSignedUrlApiUsed.ts +++ b/src/transforms/v2-to-v3/apis/isS3GetSignedUrlApiUsed.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; +import type { ClientIdentifier } from "../types.ts"; export const isS3GetSignedUrlApiUsed = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/apis/isS3UploadApiUsed.ts b/src/transforms/v2-to-v3/apis/isS3UploadApiUsed.ts index fccca6cc2..cfca5604a 100644 --- a/src/transforms/v2-to-v3/apis/isS3UploadApiUsed.ts +++ b/src/transforms/v2-to-v3/apis/isS3UploadApiUsed.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; +import type { ClientIdentifier } from "../types.ts"; export const isS3UploadApiUsed = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/apis/removePromiseCalls.ts b/src/transforms/v2-to-v3/apis/removePromiseCalls.ts index 8730dd238..b03204e30 100644 --- a/src/transforms/v2-to-v3/apis/removePromiseCalls.ts +++ b/src/transforms/v2-to-v3/apis/removePromiseCalls.ts @@ -1,7 +1,7 @@ import type { Collection, Identifier, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; -import { removePromiseForCallExpression } from "./removePromiseForCallExpression"; +import type { ClientIdentifier } from "../types.ts"; +import { removePromiseForCallExpression } from "./removePromiseForCallExpression.ts"; export interface RemovePromiseCallsOptions { v2GlobalName?: string; diff --git a/src/transforms/v2-to-v3/apis/renameErrorCodeWithName.ts b/src/transforms/v2-to-v3/apis/renameErrorCodeWithName.ts index cd21fb4e1..03f4e0fdd 100644 --- a/src/transforms/v2-to-v3/apis/renameErrorCodeWithName.ts +++ b/src/transforms/v2-to-v3/apis/renameErrorCodeWithName.ts @@ -7,7 +7,7 @@ import type { JSCodeshift, } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; +import type { ClientIdentifier } from "../types.ts"; const FUNCTION_EXPRESSION_TYPES = ["ArrowFunctionExpression", "FunctionExpression"]; diff --git a/src/transforms/v2-to-v3/apis/replaceAwsError.ts b/src/transforms/v2-to-v3/apis/replaceAwsError.ts index 04afc0683..e1691ee14 100644 --- a/src/transforms/v2-to-v3/apis/replaceAwsError.ts +++ b/src/transforms/v2-to-v3/apis/replaceAwsError.ts @@ -1,5 +1,5 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { type ImportType, addNamedModule } from "../modules"; +import { type ImportType, addNamedModule } from "../modules/index.ts"; export interface ReplaceAwsErrorOptions { v2GlobalName?: string; diff --git a/src/transforms/v2-to-v3/apis/replaceAwsIdentity.ts b/src/transforms/v2-to-v3/apis/replaceAwsIdentity.ts index 04f62ea9f..d3f28f293 100644 --- a/src/transforms/v2-to-v3/apis/replaceAwsIdentity.ts +++ b/src/transforms/v2-to-v3/apis/replaceAwsIdentity.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift, NewExpression } from "jscodeshift"; -import { AWS_CREDENTIALS_MAP, AWS_TOKEN_MAP } from "../config"; -import { type ImportType, addNamedModule } from "../modules"; +import { AWS_CREDENTIALS_MAP, AWS_TOKEN_MAP } from "../config/index.ts"; +import { type ImportType, addNamedModule } from "../modules/index.ts"; export interface ReplaceAwsCredentialsOptions { v2GlobalName?: string; diff --git a/src/transforms/v2-to-v3/apis/replaceS3CreatePresignedPostApi.ts b/src/transforms/v2-to-v3/apis/replaceS3CreatePresignedPostApi.ts index 7a489b087..515ec45e0 100644 --- a/src/transforms/v2-to-v3/apis/replaceS3CreatePresignedPostApi.ts +++ b/src/transforms/v2-to-v3/apis/replaceS3CreatePresignedPostApi.ts @@ -1,7 +1,7 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; -import { getClientApiCallExpression } from "./getClientApiCallExpression"; +import type { ClientIdentifier } from "../types.ts"; +import { getClientApiCallExpression } from "./getClientApiCallExpression.ts"; // Updates `s3.createPresignedPost(params)` API with `await createPresignedPost(s3, params)` API. export const replaceS3CreatePresignedPostApi = ( diff --git a/src/transforms/v2-to-v3/apis/replaceS3GetSignedUrlApi.ts b/src/transforms/v2-to-v3/apis/replaceS3GetSignedUrlApi.ts index 2533fc8e8..a63110ec9 100644 --- a/src/transforms/v2-to-v3/apis/replaceS3GetSignedUrlApi.ts +++ b/src/transforms/v2-to-v3/apis/replaceS3GetSignedUrlApi.ts @@ -1,8 +1,8 @@ import type { Collection, JSCodeshift, NewExpression, ObjectExpression } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; -import { getClientApiCallExpression } from "./getClientApiCallExpression"; -import { getCommandName } from "./getCommandName"; +import type { ClientIdentifier } from "../types.ts"; +import { getClientApiCallExpression } from "./getClientApiCallExpression.ts"; +import { getCommandName } from "./getCommandName.ts"; // Updates `s3.getSignedUrl()` API with `await getSignedUrl(s3, command)` API. export const replaceS3GetSignedUrlApi = ( diff --git a/src/transforms/v2-to-v3/apis/replaceS3UploadApi.ts b/src/transforms/v2-to-v3/apis/replaceS3UploadApi.ts index 293011540..d5314a878 100644 --- a/src/transforms/v2-to-v3/apis/replaceS3UploadApi.ts +++ b/src/transforms/v2-to-v3/apis/replaceS3UploadApi.ts @@ -1,7 +1,7 @@ import type { Collection, Identifier, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; -import { getClientApiCallExpression } from "./getClientApiCallExpression"; +import type { ClientIdentifier } from "../types.ts"; +import { getClientApiCallExpression } from "./getClientApiCallExpression.ts"; // Updates `s3.upload()` API with `new Upload()` API. export const replaceS3UploadApi = ( diff --git a/src/transforms/v2-to-v3/apis/replaceWaiterApi.ts b/src/transforms/v2-to-v3/apis/replaceWaiterApi.ts index 03348d267..039cf7610 100644 --- a/src/transforms/v2-to-v3/apis/replaceWaiterApi.ts +++ b/src/transforms/v2-to-v3/apis/replaceWaiterApi.ts @@ -1,12 +1,12 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ClientIdentifier } from "../types"; -import { getArgsWithoutWaiterConfig } from "./getArgsWithoutWaiterConfig"; -import { getClientWaiterCallExpression } from "./getClientWaiterCallExpression"; -import { getClientWaiterStates } from "./getClientWaiterStates"; -import { getV3ClientWaiterApiName } from "./getV3ClientWaiterApiName"; -import { getWaiterConfig } from "./getWaiterConfig"; -import { getWaiterConfigValue } from "./getWaiterConfigValue"; +import type { ClientIdentifier } from "../types.ts"; +import { getArgsWithoutWaiterConfig } from "./getArgsWithoutWaiterConfig.ts"; +import { getClientWaiterCallExpression } from "./getClientWaiterCallExpression.ts"; +import { getClientWaiterStates } from "./getClientWaiterStates.ts"; +import { getV3ClientWaiterApiName } from "./getV3ClientWaiterApiName.ts"; +import { getWaiterConfig } from "./getWaiterConfig.ts"; +import { getWaiterConfigValue } from "./getWaiterConfigValue.ts"; // Updates .waitFor() API with waitUntil* API. export const replaceWaiterApi = ( diff --git a/src/transforms/v2-to-v3/aws-util/index.ts b/src/transforms/v2-to-v3/aws-util/index.ts index 7a3f7be95..a7d0336b1 100644 --- a/src/transforms/v2-to-v3/aws-util/index.ts +++ b/src/transforms/v2-to-v3/aws-util/index.ts @@ -1 +1 @@ -export * from "./replaceAwsUtilFunctions"; +export * from "./replaceAwsUtilFunctions.ts"; diff --git a/src/transforms/v2-to-v3/aws-util/replaceAwsUtilArrayFunctions.ts b/src/transforms/v2-to-v3/aws-util/replaceAwsUtilArrayFunctions.ts index 474d85cdd..9ca0946ba 100644 --- a/src/transforms/v2-to-v3/aws-util/replaceAwsUtilArrayFunctions.ts +++ b/src/transforms/v2-to-v3/aws-util/replaceAwsUtilArrayFunctions.ts @@ -1,5 +1,5 @@ import type { Collection, FunctionExpression, Identifier, JSCodeshift } from "jscodeshift"; -import { getAwsUtilCallExpression } from "./getAwsUtilCallExpression"; +import { getAwsUtilCallExpression } from "./getAwsUtilCallExpression.ts"; export const replaceAwsUtilArrayFunctions = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/aws-util/replaceAwsUtilCopy.ts b/src/transforms/v2-to-v3/aws-util/replaceAwsUtilCopy.ts index 51173e271..6916de64c 100644 --- a/src/transforms/v2-to-v3/aws-util/replaceAwsUtilCopy.ts +++ b/src/transforms/v2-to-v3/aws-util/replaceAwsUtilCopy.ts @@ -1,5 +1,5 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { getAwsUtilCallExpression } from "./getAwsUtilCallExpression"; +import { getAwsUtilCallExpression } from "./getAwsUtilCallExpression.ts"; export const replaceAwsUtilCopy = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/aws-util/replaceAwsUtilFunctions.ts b/src/transforms/v2-to-v3/aws-util/replaceAwsUtilFunctions.ts index 220cdab01..e4a9671db 100644 --- a/src/transforms/v2-to-v3/aws-util/replaceAwsUtilFunctions.ts +++ b/src/transforms/v2-to-v3/aws-util/replaceAwsUtilFunctions.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { replaceAwsUtilArrayFunctions } from "./replaceAwsUtilArrayFunctions"; -import { replaceAwsUtilCopy } from "./replaceAwsUtilCopy"; +import { replaceAwsUtilArrayFunctions } from "./replaceAwsUtilArrayFunctions.ts"; +import { replaceAwsUtilCopy } from "./replaceAwsUtilCopy.ts"; export const replaceAwsUtilFunctions = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/client-instances/getDynamoDBDocClientArgs.ts b/src/transforms/v2-to-v3/client-instances/getDynamoDBDocClientArgs.ts index 8d467e839..5c5bae2b2 100644 --- a/src/transforms/v2-to-v3/client-instances/getDynamoDBDocClientArgs.ts +++ b/src/transforms/v2-to-v3/client-instances/getDynamoDBDocClientArgs.ts @@ -1,5 +1,5 @@ import type { ASTPath, JSCodeshift, NewExpression } from "jscodeshift"; -import { getDynamoDBForDocClient } from "./getDynamoDBForDocClient"; +import { getDynamoDBForDocClient } from "./getDynamoDBForDocClient.ts"; export const getDynamoDBDocClientArgs = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/client-instances/getDynamoDBForDocClient.ts b/src/transforms/v2-to-v3/client-instances/getDynamoDBForDocClient.ts index 6d50af0dd..a611b899a 100644 --- a/src/transforms/v2-to-v3/client-instances/getDynamoDBForDocClient.ts +++ b/src/transforms/v2-to-v3/client-instances/getDynamoDBForDocClient.ts @@ -1,6 +1,6 @@ import type { ASTPath, JSCodeshift, NewExpression } from "jscodeshift"; -import { DYNAMODB } from "../config"; +import { DYNAMODB } from "../config/index.ts"; export const getDynamoDBForDocClient = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts b/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts index 2181fbb7c..82daeb483 100644 --- a/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts +++ b/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts @@ -1,5 +1,5 @@ import type { ASTPath, JSCodeshift, NewExpression, ObjectExpression } from "jscodeshift"; -import { getObjectWithUpdatedAwsConfigKeys } from "./getObjectWithUpdatedAwsConfigKeys"; +import { getObjectWithUpdatedAwsConfigKeys } from "./getObjectWithUpdatedAwsConfigKeys.ts"; export interface GetNewClientExpressionOptions { v2ClientNewExpression: ASTPath; diff --git a/src/transforms/v2-to-v3/client-instances/getObjectWithUpdatedAwsConfigKeys.ts b/src/transforms/v2-to-v3/client-instances/getObjectWithUpdatedAwsConfigKeys.ts index 334627e58..18cc0d9d8 100644 --- a/src/transforms/v2-to-v3/client-instances/getObjectWithUpdatedAwsConfigKeys.ts +++ b/src/transforms/v2-to-v3/client-instances/getObjectWithUpdatedAwsConfigKeys.ts @@ -1,5 +1,5 @@ import type { JSCodeshift, ObjectExpression } from "jscodeshift"; -import { AWS_CONFIG_KEY_MAP } from "../config"; +import { AWS_CONFIG_KEY_MAP } from "../config/index.ts"; const getRenameComment = (keyName: string, newKeyName: string) => ` The key ${keyName} is renamed to ${newKeyName}.`; diff --git a/src/transforms/v2-to-v3/client-instances/index.ts b/src/transforms/v2-to-v3/client-instances/index.ts index 345b477ca..2f5a3ee80 100644 --- a/src/transforms/v2-to-v3/client-instances/index.ts +++ b/src/transforms/v2-to-v3/client-instances/index.ts @@ -1,4 +1,4 @@ -export * from "./getAwsGlobalConfig"; -export * from "./replaceAwsConfig"; -export * from "./replaceClientCreation"; -export * from "./replaceDocClientCreation"; +export * from "./getAwsGlobalConfig.ts"; +export * from "./replaceAwsConfig.ts"; +export * from "./replaceClientCreation.ts"; +export * from "./replaceDocClientCreation.ts"; diff --git a/src/transforms/v2-to-v3/client-instances/replaceAwsConfig.ts b/src/transforms/v2-to-v3/client-instances/replaceAwsConfig.ts index 444752417..68f4768c5 100644 --- a/src/transforms/v2-to-v3/client-instances/replaceAwsConfig.ts +++ b/src/transforms/v2-to-v3/client-instances/replaceAwsConfig.ts @@ -1,5 +1,5 @@ import type { Collection, JSCodeshift, ObjectExpression } from "jscodeshift"; -import { getObjectWithUpdatedAwsConfigKeys } from "./getObjectWithUpdatedAwsConfigKeys"; +import { getObjectWithUpdatedAwsConfigKeys } from "./getObjectWithUpdatedAwsConfigKeys.ts"; export interface ReplaceAwsConfigOptions { v2GlobalName?: string; diff --git a/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts b/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts index 8521db075..5462fc947 100644 --- a/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts +++ b/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts @@ -2,8 +2,8 @@ import type { Collection, JSCodeshift, ObjectExpression } from "jscodeshift"; import { getClientNewExpressionFromGlobalName, getClientNewExpressionFromLocalName, -} from "../utils"; -import { getNewClientExpression } from "./getNewClientExpression"; +} from "../utils/index.ts"; +import { getNewClientExpression } from "./getNewClientExpression.ts"; export interface ReplaceClientCreationOptions { v2ClientName: string; diff --git a/src/transforms/v2-to-v3/client-instances/replaceDocClientCreation.ts b/src/transforms/v2-to-v3/client-instances/replaceDocClientCreation.ts index 50b71a9ed..dca1c07e3 100644 --- a/src/transforms/v2-to-v3/client-instances/replaceDocClientCreation.ts +++ b/src/transforms/v2-to-v3/client-instances/replaceDocClientCreation.ts @@ -1,11 +1,16 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { DOCUMENT_CLIENT, DYNAMODB, DYNAMODB_DOCUMENT, DYNAMODB_DOCUMENT_CLIENT } from "../config"; +import { + DOCUMENT_CLIENT, + DYNAMODB, + DYNAMODB_DOCUMENT, + DYNAMODB_DOCUMENT_CLIENT, +} from "../config/index.ts"; import { getClientNewExpressionFromGlobalName, getClientNewExpressionFromLocalName, -} from "../utils"; -import { getDynamoDBDocClientArgs } from "./getDynamoDBDocClientArgs"; +} from "../utils/index.ts"; +import { getDynamoDBDocClientArgs } from "./getDynamoDBDocClientArgs.ts"; export interface ReplaceDocClientCreationOptions { v2ClientName: string; diff --git a/src/transforms/v2-to-v3/client-names/getClientMetadataRecord.ts b/src/transforms/v2-to-v3/client-names/getClientMetadataRecord.ts index 967297f71..1aa06df8a 100644 --- a/src/transforms/v2-to-v3/client-names/getClientMetadataRecord.ts +++ b/src/transforms/v2-to-v3/client-names/getClientMetadataRecord.ts @@ -1,6 +1,6 @@ -import type { ClientMetadataRecord } from "../types"; -import { getV3ClientName } from "./getV3ClientName"; -import { getV3ClientPackageName } from "./getV3ClientPackageName"; +import type { ClientMetadataRecord } from "../types.ts"; +import { getV3ClientName } from "./getV3ClientName.ts"; +import { getV3ClientPackageName } from "./getV3ClientPackageName.ts"; export const getClientMetadataRecord = ( v2ClientNamesRecord: Record diff --git a/src/transforms/v2-to-v3/client-names/getClientNamesFromDeepImport.ts b/src/transforms/v2-to-v3/client-names/getClientNamesFromDeepImport.ts index 2f6e45197..0bba59ee9 100644 --- a/src/transforms/v2-to-v3/client-names/getClientNamesFromDeepImport.ts +++ b/src/transforms/v2-to-v3/client-names/getClientNamesFromDeepImport.ts @@ -1,4 +1,4 @@ -import { CLIENT_NAMES, PACKAGE_NAME } from "../config"; +import { CLIENT_NAMES, PACKAGE_NAME } from "../config/index.ts"; const DEEP_IMPORT_PATH_REGEXP = new RegExp(`${PACKAGE_NAME}/clients/([\\w]*)`, "g"); diff --git a/src/transforms/v2-to-v3/client-names/getClientNamesFromGlobal.ts b/src/transforms/v2-to-v3/client-names/getClientNamesFromGlobal.ts index bfc0fb9e2..a0c80a080 100644 --- a/src/transforms/v2-to-v3/client-names/getClientNamesFromGlobal.ts +++ b/src/transforms/v2-to-v3/client-names/getClientNamesFromGlobal.ts @@ -1,8 +1,8 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { CLIENT_NAMES } from "../config"; -import { getNamesFromNewExpr } from "./getNamesFromNewExpr"; -import { getNamesFromTSQualifiedName } from "./getNamesFromTSQualifiedName"; +import { CLIENT_NAMES } from "../config/index.ts"; +import { getNamesFromNewExpr } from "./getNamesFromNewExpr.ts"; +import { getNamesFromTSQualifiedName } from "./getNamesFromTSQualifiedName.ts"; export const getClientNamesFromGlobal = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/client-names/getClientNamesRecord.ts b/src/transforms/v2-to-v3/client-names/getClientNamesRecord.ts index 6117d819f..e1e0a4404 100644 --- a/src/transforms/v2-to-v3/client-names/getClientNamesRecord.ts +++ b/src/transforms/v2-to-v3/client-names/getClientNamesRecord.ts @@ -1,12 +1,12 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { CLIENT_NAMES, PACKAGE_NAME } from "../config"; -import { ImportType } from "../modules"; -import * as importEqualsModule from "../modules/importEqualsModule"; -import * as importModule from "../modules/importModule"; -import * as requireModule from "../modules/requireModule"; -import { getClientDeepImportPath } from "../utils"; -import { getClientNamesFromDeepImport } from "./getClientNamesFromDeepImport"; +import { CLIENT_NAMES, PACKAGE_NAME } from "../config/index.ts"; +import * as importEqualsModule from "../modules/importEqualsModule/index.ts"; +import * as importModule from "../modules/importModule/index.ts"; +import { ImportType } from "../modules/index.ts"; +import * as requireModule from "../modules/requireModule/index.ts"; +import { getClientDeepImportPath } from "../utils/index.ts"; +import { getClientNamesFromDeepImport } from "./getClientNamesFromDeepImport.ts"; export const getClientNamesRecord = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/client-names/getNamesFromNewExpr.ts b/src/transforms/v2-to-v3/client-names/getNamesFromNewExpr.ts index 5a8e1f712..512b73cce 100644 --- a/src/transforms/v2-to-v3/client-names/getNamesFromNewExpr.ts +++ b/src/transforms/v2-to-v3/client-names/getNamesFromNewExpr.ts @@ -1,7 +1,7 @@ import type { Collection, Identifier, JSCodeshift, MemberExpression } from "jscodeshift"; -import { DYNAMODB_DOCUMENT_CLIENT } from "../config"; -import { getClientNewExpressionFromGlobalName } from "../utils"; +import { DYNAMODB_DOCUMENT_CLIENT } from "../config/index.ts"; +import { getClientNewExpressionFromGlobalName } from "../utils/index.ts"; export const getNamesFromNewExpr = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/client-names/getV3ClientName.spec.ts b/src/transforms/v2-to-v3/client-names/getV3ClientName.spec.ts index 14e15dc2c..dd171feb1 100644 --- a/src/transforms/v2-to-v3/client-names/getV3ClientName.spec.ts +++ b/src/transforms/v2-to-v3/client-names/getV3ClientName.spec.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "vitest"; -import { CLIENT_NAMES_MAP } from "../config"; -import { getV3ClientName } from "./getV3ClientName"; +import { CLIENT_NAMES_MAP } from "../config/index.ts"; +import { getV3ClientName } from "./getV3ClientName.ts"; describe(getV3ClientName.name, () => { it.each(Object.entries(CLIENT_NAMES_MAP))("getV3ClientName('%s') === '%s'", (input, output) => { diff --git a/src/transforms/v2-to-v3/client-names/getV3ClientName.ts b/src/transforms/v2-to-v3/client-names/getV3ClientName.ts index df7ac506f..fafffee0b 100644 --- a/src/transforms/v2-to-v3/client-names/getV3ClientName.ts +++ b/src/transforms/v2-to-v3/client-names/getV3ClientName.ts @@ -1,4 +1,4 @@ -import { CLIENT_NAMES_MAP } from "../config"; +import { CLIENT_NAMES_MAP } from "../config/index.ts"; // Returns v3 client name for the provided v2 client name. export const getV3ClientName = (clientName: string) => { diff --git a/src/transforms/v2-to-v3/client-names/getV3ClientPackageName.spec.ts b/src/transforms/v2-to-v3/client-names/getV3ClientPackageName.spec.ts index 867f96b28..cf165873c 100644 --- a/src/transforms/v2-to-v3/client-names/getV3ClientPackageName.spec.ts +++ b/src/transforms/v2-to-v3/client-names/getV3ClientPackageName.spec.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "vitest"; -import { CLIENT_PACKAGE_NAMES_MAP } from "../config"; -import { getV3ClientPackageName } from "./getV3ClientPackageName"; +import { CLIENT_PACKAGE_NAMES_MAP } from "../config/index.ts"; +import { getV3ClientPackageName } from "./getV3ClientPackageName.ts"; describe(getV3ClientPackageName.name, () => { it.each(Object.entries(CLIENT_PACKAGE_NAMES_MAP))( diff --git a/src/transforms/v2-to-v3/client-names/getV3ClientPackageName.ts b/src/transforms/v2-to-v3/client-names/getV3ClientPackageName.ts index 553dbcf15..dbf3d4642 100644 --- a/src/transforms/v2-to-v3/client-names/getV3ClientPackageName.ts +++ b/src/transforms/v2-to-v3/client-names/getV3ClientPackageName.ts @@ -1,4 +1,4 @@ -import { CLIENT_PACKAGE_NAMES_MAP } from "../config"; +import { CLIENT_PACKAGE_NAMES_MAP } from "../config/index.ts"; // Returns v3 client package name for the provided v2 client name. export const getV3ClientPackageName = (clientName: string) => { diff --git a/src/transforms/v2-to-v3/client-names/index.ts b/src/transforms/v2-to-v3/client-names/index.ts index efe0b5a10..26efcbe58 100644 --- a/src/transforms/v2-to-v3/client-names/index.ts +++ b/src/transforms/v2-to-v3/client-names/index.ts @@ -1,4 +1,4 @@ -export * from "./getClientMetadataRecord"; -export * from "./getClientNamesFromDeepImport"; -export * from "./getClientNamesFromGlobal"; -export * from "./getClientNamesRecord"; +export * from "./getClientMetadataRecord.ts"; +export * from "./getClientNamesFromDeepImport.ts"; +export * from "./getClientNamesFromGlobal.ts"; +export * from "./getClientNamesRecord.ts"; diff --git a/src/transforms/v2-to-v3/config/CLIENT_NAMES_MAP.ts b/src/transforms/v2-to-v3/config/CLIENT_NAMES_MAP.ts index 42bdcb1b8..667be6229 100644 --- a/src/transforms/v2-to-v3/config/CLIENT_NAMES_MAP.ts +++ b/src/transforms/v2-to-v3/config/CLIENT_NAMES_MAP.ts @@ -1,4 +1,4 @@ -import { CLIENT_NAMES } from "./CLIENT_NAMES"; +import { CLIENT_NAMES } from "./CLIENT_NAMES.ts"; // The key is the client name in v2, and value is the client name in v3. export const CLIENT_NAMES_MAP: Record = { diff --git a/src/transforms/v2-to-v3/config/CLIENT_PACKAGE_NAMES_MAP.ts b/src/transforms/v2-to-v3/config/CLIENT_PACKAGE_NAMES_MAP.ts index ea8a175ce..06b6eb234 100644 --- a/src/transforms/v2-to-v3/config/CLIENT_PACKAGE_NAMES_MAP.ts +++ b/src/transforms/v2-to-v3/config/CLIENT_PACKAGE_NAMES_MAP.ts @@ -1,4 +1,4 @@ -import { CLIENT_NAMES } from "./CLIENT_NAMES"; +import { CLIENT_NAMES } from "./CLIENT_NAMES.ts"; // The key is the client name in v2, and value is the client package name in v3. export const CLIENT_PACKAGE_NAMES_MAP: Record = { diff --git a/src/transforms/v2-to-v3/config/index.ts b/src/transforms/v2-to-v3/config/index.ts index 283e95279..b074ccaa7 100644 --- a/src/transforms/v2-to-v3/config/index.ts +++ b/src/transforms/v2-to-v3/config/index.ts @@ -1,9 +1,9 @@ -export * from "./AWS_CONFIG_KEY_MAP"; -export * from "./AWS_CREDENTIALS_MAP"; -export * from "./AWS_TOKEN_MAP"; -export * from "./CLIENT_NAMES"; -export * from "./CLIENT_NAMES_MAP"; -export * from "./CLIENT_PACKAGE_NAMES_MAP"; -export * from "./CLIENT_REQ_RESP_TYPES_MAP"; -export * from "./CLIENT_TYPES_MAP"; -export * from "./constants"; +export * from "./AWS_CONFIG_KEY_MAP.ts"; +export * from "./AWS_CREDENTIALS_MAP.ts"; +export * from "./AWS_TOKEN_MAP.ts"; +export * from "./CLIENT_NAMES.ts"; +export * from "./CLIENT_NAMES_MAP.ts"; +export * from "./CLIENT_PACKAGE_NAMES_MAP.ts"; +export * from "./CLIENT_REQ_RESP_TYPES_MAP.ts"; +export * from "./CLIENT_TYPES_MAP.ts"; +export * from "./constants.ts"; diff --git a/src/transforms/v2-to-v3/modules/addClientModules.ts b/src/transforms/v2-to-v3/modules/addClientModules.ts index aa2f2a524..ceca123fc 100644 --- a/src/transforms/v2-to-v3/modules/addClientModules.ts +++ b/src/transforms/v2-to-v3/modules/addClientModules.ts @@ -8,20 +8,20 @@ import { isS3CreatePresignedPostApiUsed, isS3GetSignedUrlApiUsed, isS3UploadApiUsed, -} from "../apis"; +} from "../apis/index.ts"; import { DOCUMENT_CLIENT, DYNAMODB, DYNAMODB_DOCUMENT, DYNAMODB_DOCUMENT_CLIENT, S3, -} from "../config"; -import { getV3ClientTypes } from "../ts-type"; -import { addNamedModule } from "./addNamedModule"; -import { getClientTSTypeRefCount } from "./getClientTSTypeRefCount"; -import { getNewExpressionCount } from "./getNewExpressionCount"; +} from "../config/index.ts"; +import { getV3ClientTypes } from "../ts-type/index.ts"; +import { addNamedModule } from "./addNamedModule.ts"; +import { getClientTSTypeRefCount } from "./getClientTSTypeRefCount.ts"; +import { getNewExpressionCount } from "./getNewExpressionCount.ts"; -import type { ClientModulesOptions } from "./types"; +import type { ClientModulesOptions } from "./types.ts"; export const addClientModules = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/addNamedModule.ts b/src/transforms/v2-to-v3/modules/addNamedModule.ts index 82092fd33..7659781dc 100644 --- a/src/transforms/v2-to-v3/modules/addNamedModule.ts +++ b/src/transforms/v2-to-v3/modules/addNamedModule.ts @@ -1,9 +1,9 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import * as importEqualsModule from "./importEqualsModule"; -import * as importModule from "./importModule"; -import * as requireModule from "./requireModule"; -import { ImportType, type ModulesOptions } from "./types"; +import * as importEqualsModule from "./importEqualsModule/index.ts"; +import * as importModule from "./importModule/index.ts"; +import * as requireModule from "./requireModule/index.ts"; +import { ImportType, type ModulesOptions } from "./types.ts"; export const addNamedModule = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/getClientTSTypeRefCount.ts b/src/transforms/v2-to-v3/modules/getClientTSTypeRefCount.ts index 40d3b2478..5ceb147d4 100644 --- a/src/transforms/v2-to-v3/modules/getClientTSTypeRefCount.ts +++ b/src/transforms/v2-to-v3/modules/getClientTSTypeRefCount.ts @@ -1,7 +1,7 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { getTSQualifiedNameFromClientName } from "../ts-type"; -import type { ClientModulesOptions } from "./types"; +import { getTSQualifiedNameFromClientName } from "../ts-type/index.ts"; +import type { ClientModulesOptions } from "./types.ts"; export const getClientTSTypeRefCount = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/getGlobalNameFromModule.ts b/src/transforms/v2-to-v3/modules/getGlobalNameFromModule.ts index f765ee29a..38ff2f303 100644 --- a/src/transforms/v2-to-v3/modules/getGlobalNameFromModule.ts +++ b/src/transforms/v2-to-v3/modules/getGlobalNameFromModule.ts @@ -1,9 +1,9 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { PACKAGE_NAME } from "../config"; -import { getImportSpecifiers as getImportEqualsSpecifiers } from "../modules/importEqualsModule"; -import { getImportSpecifiers } from "./importModule"; -import { getRequireDeclarators } from "./requireModule"; +import { PACKAGE_NAME } from "../config/index.ts"; +import { getImportSpecifiers as getImportEqualsSpecifiers } from "../modules/importEqualsModule/index.ts"; +import { getImportSpecifiers } from "./importModule/index.ts"; +import { getRequireDeclarators } from "./requireModule/index.ts"; export const getGlobalNameFromModule = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/getImportType.ts b/src/transforms/v2-to-v3/modules/getImportType.ts index 5d687a473..8d7dc0309 100644 --- a/src/transforms/v2-to-v3/modules/getImportType.ts +++ b/src/transforms/v2-to-v3/modules/getImportType.ts @@ -1,8 +1,8 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { hasImport } from "./hasImport"; -import { hasImportEquals } from "./hasImportEquals"; -import { hasRequire } from "./hasRequire"; -import { ImportType } from "./types"; +import { hasImport } from "./hasImport.ts"; +import { hasImportEquals } from "./hasImportEquals.ts"; +import { hasRequire } from "./hasRequire.ts"; +import { ImportType } from "./types.ts"; export const getImportType = (j: JSCodeshift, source: Collection) => hasImport(j, source) diff --git a/src/transforms/v2-to-v3/modules/getNewExpressionCount.ts b/src/transforms/v2-to-v3/modules/getNewExpressionCount.ts index cf756b2cc..fc7fd1842 100644 --- a/src/transforms/v2-to-v3/modules/getNewExpressionCount.ts +++ b/src/transforms/v2-to-v3/modules/getNewExpressionCount.ts @@ -1,11 +1,11 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { DOCUMENT_CLIENT, DYNAMODB, DYNAMODB_DOCUMENT_CLIENT } from "../config"; +import { DOCUMENT_CLIENT, DYNAMODB, DYNAMODB_DOCUMENT_CLIENT } from "../config/index.ts"; import { getClientNewExpressionFromGlobalName, getClientNewExpressionFromLocalName, -} from "../utils"; -import type { ClientModulesOptions } from "./types"; +} from "../utils/index.ts"; +import type { ClientModulesOptions } from "./types.ts"; export const getNewExpressionCount = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/getRequireDeclaratorsWithObjectPattern.ts b/src/transforms/v2-to-v3/modules/getRequireDeclaratorsWithObjectPattern.ts index 577d22b0f..5e9efa465 100644 --- a/src/transforms/v2-to-v3/modules/getRequireDeclaratorsWithObjectPattern.ts +++ b/src/transforms/v2-to-v3/modules/getRequireDeclaratorsWithObjectPattern.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { getRequireDeclarators } from "./requireModule"; +import { getRequireDeclarators } from "./requireModule/index.ts"; export interface GetRequireDeclaratorsWithObjectPattern { identifierName: string; diff --git a/src/transforms/v2-to-v3/modules/getRequireDeclaratorsWithProperty.ts b/src/transforms/v2-to-v3/modules/getRequireDeclaratorsWithProperty.ts index db25ccbaa..3d605c582 100644 --- a/src/transforms/v2-to-v3/modules/getRequireDeclaratorsWithProperty.ts +++ b/src/transforms/v2-to-v3/modules/getRequireDeclaratorsWithProperty.ts @@ -1,5 +1,5 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { getRequireDeclarators } from "./requireModule"; +import { getRequireDeclarators } from "./requireModule/index.ts"; export interface GetRequireDeclaratorsWithPropertyOptions { localName?: string; diff --git a/src/transforms/v2-to-v3/modules/hasImport.ts b/src/transforms/v2-to-v3/modules/hasImport.ts index a20dd9323..a7f5d1aea 100644 --- a/src/transforms/v2-to-v3/modules/hasImport.ts +++ b/src/transforms/v2-to-v3/modules/hasImport.ts @@ -1,5 +1,5 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { getImportDeclarations } from "./importModule"; +import { getImportDeclarations } from "./importModule/index.ts"; export const hasImport = (j: JSCodeshift, source: Collection) => getImportDeclarations(j, source).size() > 0; diff --git a/src/transforms/v2-to-v3/modules/hasImportEquals.ts b/src/transforms/v2-to-v3/modules/hasImportEquals.ts index e44bae64e..c956633bc 100644 --- a/src/transforms/v2-to-v3/modules/hasImportEquals.ts +++ b/src/transforms/v2-to-v3/modules/hasImportEquals.ts @@ -1,5 +1,5 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { getImportEqualsDeclarations } from "./importEqualsModule"; +import { getImportEqualsDeclarations } from "./importEqualsModule/index.ts"; export const hasImportEquals = (j: JSCodeshift, source: Collection) => getImportEqualsDeclarations(j, source).size() > 0; diff --git a/src/transforms/v2-to-v3/modules/hasRequire.ts b/src/transforms/v2-to-v3/modules/hasRequire.ts index 7317180a4..13bc1826f 100644 --- a/src/transforms/v2-to-v3/modules/hasRequire.ts +++ b/src/transforms/v2-to-v3/modules/hasRequire.ts @@ -1,5 +1,5 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { getRequireDeclarators } from "./requireModule"; +import { getRequireDeclarators } from "./requireModule/index.ts"; export const hasRequire = (j: JSCodeshift, source: Collection) => getRequireDeclarators(j, source).size() > 0; diff --git a/src/transforms/v2-to-v3/modules/importEqualsModule/addDefaultModule.ts b/src/transforms/v2-to-v3/modules/importEqualsModule/addDefaultModule.ts index 206438b18..fb45bb4ac 100644 --- a/src/transforms/v2-to-v3/modules/importEqualsModule/addDefaultModule.ts +++ b/src/transforms/v2-to-v3/modules/importEqualsModule/addDefaultModule.ts @@ -1,7 +1,7 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { getImportEqualsDeclarations, getImportSpecifiers } from "../importEqualsModule"; -import { getDefaultName } from "./getDefaultName"; +import { getImportEqualsDeclarations, getImportSpecifiers } from "../importEqualsModule/index.ts"; +import { getDefaultName } from "./getDefaultName.ts"; export const addDefaultModule = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/importEqualsModule/addNamedModule.ts b/src/transforms/v2-to-v3/modules/importEqualsModule/addNamedModule.ts index 76fcc94bc..9c092a991 100644 --- a/src/transforms/v2-to-v3/modules/importEqualsModule/addNamedModule.ts +++ b/src/transforms/v2-to-v3/modules/importEqualsModule/addNamedModule.ts @@ -1,10 +1,10 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ModulesOptions } from "../types"; -import { addDefaultModule } from "./addDefaultModule"; -import { getDefaultName } from "./getDefaultName"; -import { getImportEqualsDeclarations } from "./getImportEqualsDeclarations"; -import { getImportSpecifiers } from "./getImportSpecifiers"; +import type { ModulesOptions } from "../types.ts"; +import { addDefaultModule } from "./addDefaultModule.ts"; +import { getDefaultName } from "./getDefaultName.ts"; +import { getImportEqualsDeclarations } from "./getImportEqualsDeclarations.ts"; +import { getImportSpecifiers } from "./getImportSpecifiers.ts"; export const addNamedModule = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/importEqualsModule/getImportEqualsDeclarations.ts b/src/transforms/v2-to-v3/modules/importEqualsModule/getImportEqualsDeclarations.ts index 658ffbc4a..d4866d019 100644 --- a/src/transforms/v2-to-v3/modules/importEqualsModule/getImportEqualsDeclarations.ts +++ b/src/transforms/v2-to-v3/modules/importEqualsModule/getImportEqualsDeclarations.ts @@ -1,5 +1,5 @@ import type { Collection, JSCodeshift, TSExternalModuleReference } from "jscodeshift"; -import { PACKAGE_NAME } from "../../config"; +import { PACKAGE_NAME } from "../../config/index.ts"; export const getImportEqualsDeclarations = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/importEqualsModule/getImportSpecifiers.ts b/src/transforms/v2-to-v3/modules/importEqualsModule/getImportSpecifiers.ts index 4dc2c79f6..aeeac9e6f 100644 --- a/src/transforms/v2-to-v3/modules/importEqualsModule/getImportSpecifiers.ts +++ b/src/transforms/v2-to-v3/modules/importEqualsModule/getImportSpecifiers.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ImportSpecifierType } from "../types"; -import { getImportEqualsDeclarations } from "./getImportEqualsDeclarations"; +import type { ImportSpecifierType } from "../types.ts"; +import { getImportEqualsDeclarations } from "./getImportEqualsDeclarations.ts"; export const getImportSpecifiers = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/importEqualsModule/index.ts b/src/transforms/v2-to-v3/modules/importEqualsModule/index.ts index 8d7745866..15af9aad7 100644 --- a/src/transforms/v2-to-v3/modules/importEqualsModule/index.ts +++ b/src/transforms/v2-to-v3/modules/importEqualsModule/index.ts @@ -1,4 +1,4 @@ -export * from "./addNamedModule"; -export * from "./getImportEqualsDeclarations"; -export * from "./getImportSpecifiers"; -export * from "./removeImportEquals"; +export * from "./addNamedModule.ts"; +export * from "./getImportEqualsDeclarations.ts"; +export * from "./getImportSpecifiers.ts"; +export * from "./removeImportEquals.ts"; diff --git a/src/transforms/v2-to-v3/modules/importEqualsModule/removeImportEquals.ts b/src/transforms/v2-to-v3/modules/importEqualsModule/removeImportEquals.ts index d66141e9e..32ae40f89 100644 --- a/src/transforms/v2-to-v3/modules/importEqualsModule/removeImportEquals.ts +++ b/src/transforms/v2-to-v3/modules/importEqualsModule/removeImportEquals.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { removeDeclaration } from "../removeDeclaration"; -import { getImportEqualsDeclarations } from "./getImportEqualsDeclarations"; +import { removeDeclaration } from "../removeDeclaration.ts"; +import { getImportEqualsDeclarations } from "./getImportEqualsDeclarations.ts"; const isAnotherSpecifier = (j: JSCodeshift, source: Collection, localName: string) => source.find(j.TSImportEqualsDeclaration, { id: { name: localName } }).size() > 1; diff --git a/src/transforms/v2-to-v3/modules/importModule/addNamedModule.ts b/src/transforms/v2-to-v3/modules/importModule/addNamedModule.ts index 8a06e8d6b..b8d256483 100644 --- a/src/transforms/v2-to-v3/modules/importModule/addNamedModule.ts +++ b/src/transforms/v2-to-v3/modules/importModule/addNamedModule.ts @@ -1,8 +1,8 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { getImportDeclarations, getImportSpecifiers } from "../importModule"; -import { importSpecifierCompareFn } from "../importSpecifierCompareFn"; -import type { ModulesOptions } from "../types"; +import { getImportDeclarations, getImportSpecifiers } from "../importModule/index.ts"; +import { importSpecifierCompareFn } from "../importSpecifierCompareFn.ts"; +import type { ModulesOptions } from "../types.ts"; export const addNamedModule = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/importModule/getImportDeclarations.ts b/src/transforms/v2-to-v3/modules/importModule/getImportDeclarations.ts index 174076190..3fa2ddeeb 100644 --- a/src/transforms/v2-to-v3/modules/importModule/getImportDeclarations.ts +++ b/src/transforms/v2-to-v3/modules/importModule/getImportDeclarations.ts @@ -1,5 +1,5 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { PACKAGE_NAME } from "../../config"; +import { PACKAGE_NAME } from "../../config/index.ts"; export const getImportDeclarations = (j: JSCodeshift, source: Collection, path?: string) => source.find(j.ImportDeclaration).filter((importDeclaration) => { diff --git a/src/transforms/v2-to-v3/modules/importModule/getImportSpecifiers.ts b/src/transforms/v2-to-v3/modules/importModule/getImportSpecifiers.ts index 3e11bcb33..f5c597af7 100644 --- a/src/transforms/v2-to-v3/modules/importModule/getImportSpecifiers.ts +++ b/src/transforms/v2-to-v3/modules/importModule/getImportSpecifiers.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ImportSpecifierType } from "../types"; -import { getImportDeclarations } from "./getImportDeclarations"; +import type { ImportSpecifierType } from "../types.ts"; +import { getImportDeclarations } from "./getImportDeclarations.ts"; export const getImportSpecifiers = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/importModule/index.ts b/src/transforms/v2-to-v3/modules/importModule/index.ts index 221c4daa6..fc6a67617 100644 --- a/src/transforms/v2-to-v3/modules/importModule/index.ts +++ b/src/transforms/v2-to-v3/modules/importModule/index.ts @@ -1,4 +1,4 @@ -export * from "./addNamedModule"; -export * from "./getImportDeclarations"; -export * from "./getImportSpecifiers"; -export * from "./removeImport"; +export * from "./addNamedModule.ts"; +export * from "./getImportDeclarations.ts"; +export * from "./getImportSpecifiers.ts"; +export * from "./removeImport.ts"; diff --git a/src/transforms/v2-to-v3/modules/importModule/removeImport.ts b/src/transforms/v2-to-v3/modules/importModule/removeImport.ts index 6c969d862..2e80bf6d2 100644 --- a/src/transforms/v2-to-v3/modules/importModule/removeImport.ts +++ b/src/transforms/v2-to-v3/modules/importModule/removeImport.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { removeDeclaration } from "../removeDeclaration"; -import { getImportDeclarations } from "./getImportDeclarations"; +import { removeDeclaration } from "../removeDeclaration.ts"; +import { getImportDeclarations } from "./getImportDeclarations.ts"; const isAnotherSpecifier = (j: JSCodeshift, source: Collection, localName: string) => source diff --git a/src/transforms/v2-to-v3/modules/index.ts b/src/transforms/v2-to-v3/modules/index.ts index c56efae7d..abe9a819f 100644 --- a/src/transforms/v2-to-v3/modules/index.ts +++ b/src/transforms/v2-to-v3/modules/index.ts @@ -1,8 +1,8 @@ -export * from "./addClientModules"; -export * from "./addNamedModule"; -export * from "./getGlobalNameFromModule"; -export * from "./getImportType"; -export * from "./getRequireDeclaratorsWithProperty"; -export * from "./removeModules"; -export * from "./replaceDeepImport"; -export * from "./types"; +export * from "./addClientModules.ts"; +export * from "./addNamedModule.ts"; +export * from "./getGlobalNameFromModule.ts"; +export * from "./getImportType.ts"; +export * from "./getRequireDeclaratorsWithProperty.ts"; +export * from "./removeModules.ts"; +export * from "./replaceDeepImport.ts"; +export * from "./types.ts"; diff --git a/src/transforms/v2-to-v3/modules/removeModules.ts b/src/transforms/v2-to-v3/modules/removeModules.ts index a3523f549..a09687cae 100644 --- a/src/transforms/v2-to-v3/modules/removeModules.ts +++ b/src/transforms/v2-to-v3/modules/removeModules.ts @@ -1,8 +1,8 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { removeImportEquals } from "./importEqualsModule"; -import { removeImport } from "./importModule"; -import { removeRequire } from "./requireModule"; -import { ImportType } from "./types"; +import { removeImportEquals } from "./importEqualsModule/index.ts"; +import { removeImport } from "./importModule/index.ts"; +import { removeRequire } from "./requireModule/index.ts"; +import { ImportType } from "./types.ts"; export const removeModules = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/requireModule/addNamedModule.ts b/src/transforms/v2-to-v3/modules/requireModule/addNamedModule.ts index d39bc227f..bcdd4936a 100644 --- a/src/transforms/v2-to-v3/modules/requireModule/addNamedModule.ts +++ b/src/transforms/v2-to-v3/modules/requireModule/addNamedModule.ts @@ -1,9 +1,9 @@ import type { Collection, JSCodeshift, ObjectPattern } from "jscodeshift"; -import { PACKAGE_NAME } from "../../config"; -import { objectPatternPropertyCompareFn } from "../objectPatternPropertyCompareFn"; -import { getRequireDeclarators } from "../requireModule"; -import type { ModulesOptions } from "../types"; +import { PACKAGE_NAME } from "../../config/index.ts"; +import { objectPatternPropertyCompareFn } from "../objectPatternPropertyCompareFn.ts"; +import { getRequireDeclarators } from "../requireModule/index.ts"; +import type { ModulesOptions } from "../types.ts"; export const addNamedModule = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/requireModule/getImportSpecifiers.ts b/src/transforms/v2-to-v3/modules/requireModule/getImportSpecifiers.ts index 2b4076e16..1ac6da13d 100644 --- a/src/transforms/v2-to-v3/modules/requireModule/getImportSpecifiers.ts +++ b/src/transforms/v2-to-v3/modules/requireModule/getImportSpecifiers.ts @@ -1,6 +1,6 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import type { ImportSpecifierType } from "../types"; -import { getRequireDeclarators } from "./getRequireDeclarators"; +import type { ImportSpecifierType } from "../types.ts"; +import { getRequireDeclarators } from "./getRequireDeclarators.ts"; export const getImportSpecifiers = ( j: JSCodeshift, diff --git a/src/transforms/v2-to-v3/modules/requireModule/getRequireDeclarators.ts b/src/transforms/v2-to-v3/modules/requireModule/getRequireDeclarators.ts index fbfbec602..1dc9ceecb 100644 --- a/src/transforms/v2-to-v3/modules/requireModule/getRequireDeclarators.ts +++ b/src/transforms/v2-to-v3/modules/requireModule/getRequireDeclarators.ts @@ -1,5 +1,5 @@ import type { CallExpression, Collection, JSCodeshift, VariableDeclarator } from "jscodeshift"; -import { PACKAGE_NAME } from "../../config"; +import { PACKAGE_NAME } from "../../config/index.ts"; const isValidRequireCallExpression = (callExpression: CallExpression, path?: string) => { if (callExpression.arguments.length !== 1) { diff --git a/src/transforms/v2-to-v3/modules/requireModule/index.ts b/src/transforms/v2-to-v3/modules/requireModule/index.ts index 94c734d58..45f25b185 100644 --- a/src/transforms/v2-to-v3/modules/requireModule/index.ts +++ b/src/transforms/v2-to-v3/modules/requireModule/index.ts @@ -1,4 +1,4 @@ -export * from "./addNamedModule"; -export * from "./getImportSpecifiers"; -export * from "./getRequireDeclarators"; -export * from "./removeRequire"; +export * from "./addNamedModule.ts"; +export * from "./getImportSpecifiers.ts"; +export * from "./getRequireDeclarators.ts"; +export * from "./removeRequire.ts"; diff --git a/src/transforms/v2-to-v3/modules/requireModule/removeRequire.ts b/src/transforms/v2-to-v3/modules/requireModule/removeRequire.ts index d50254822..16882be2a 100644 --- a/src/transforms/v2-to-v3/modules/requireModule/removeRequire.ts +++ b/src/transforms/v2-to-v3/modules/requireModule/removeRequire.ts @@ -6,9 +6,9 @@ import type { ObjectPattern, VariableDeclarator, } from "jscodeshift"; -import { removeDeclaration } from "../removeDeclaration"; -import type { ImportSpecifierType } from "../types"; -import { getRequireDeclarators } from "./getRequireDeclarators"; +import { removeDeclaration } from "../removeDeclaration.ts"; +import type { ImportSpecifierType } from "../types.ts"; +import { getRequireDeclarators } from "./getRequireDeclarators.ts"; // ToDo: create utility to share with requireModule/addNamedModule const isAnotherSpecifier = (j: JSCodeshift, source: Collection, localName: string) => diff --git a/src/transforms/v2-to-v3/modules/types.ts b/src/transforms/v2-to-v3/modules/types.ts index 1343cdbed..f7969db42 100644 --- a/src/transforms/v2-to-v3/modules/types.ts +++ b/src/transforms/v2-to-v3/modules/types.ts @@ -1,4 +1,4 @@ -import type { ClientIdentifier } from "../types"; +import type { ClientIdentifier } from "../types.ts"; export interface ClientModulesOptions { v2ClientName: string; diff --git a/src/transforms/v2-to-v3/transformer.spec.ts b/src/transforms/v2-to-v3/transformer.spec.ts index b80da59e3..ad1ad8879 100644 --- a/src/transforms/v2-to-v3/transformer.spec.ts +++ b/src/transforms/v2-to-v3/transformer.spec.ts @@ -4,7 +4,7 @@ import { join } from "node:path"; import jscodeshift from "jscodeshift"; import { describe, expect, it } from "vitest"; -import transform from "./transformer"; +import transform from "./transformer/index.ts"; describe("v2-to-v3", () => { const inputFileRegex = /(.*).input.[jt]sx?$/; diff --git a/src/transforms/v2-to-v3/transformer.ts b/src/transforms/v2-to-v3/transformer.ts index db2fbb475..104ce514e 100644 --- a/src/transforms/v2-to-v3/transformer.ts +++ b/src/transforms/v2-to-v3/transformer.ts @@ -14,28 +14,28 @@ import { replaceS3GetSignedUrlApi, replaceS3UploadApi, replaceWaiterApi, -} from "./apis"; -import { replaceAwsUtilFunctions } from "./aws-util"; +} from "./apis/index.ts"; +import { replaceAwsUtilFunctions } from "./aws-util/index.ts"; import { getAwsGlobalConfig, replaceAwsConfig, replaceClientCreation, replaceDocClientCreation, -} from "./client-instances"; +} from "./client-instances/index.ts"; import { getClientMetadataRecord, getClientNamesFromGlobal, getClientNamesRecord, -} from "./client-names"; -import { NOT_SUPPORTED_COMMENT, PACKAGE_NAME, S3 } from "./config"; +} from "./client-names/index.ts"; +import { NOT_SUPPORTED_COMMENT, PACKAGE_NAME, S3 } from "./config/index.ts"; import { addClientModules, getGlobalNameFromModule, getImportType, removeModules, replaceDeepImport, -} from "./modules"; -import { removeTypesFromTSQualifiedName, replaceTSTypeReference } from "./ts-type"; +} from "./modules/index.ts"; +import { removeTypesFromTSQualifiedName, replaceTSTypeReference } from "./ts-type/index.ts"; import { IndentationType, getFormattedSourceString, @@ -44,7 +44,7 @@ import { getValueIndentedWithTabs, isTrailingCommaUsed, isTypeScriptFile, -} from "./utils"; +} from "./utils/index.ts"; const transformer = async (file: FileInfo, api: API) => { const j = isTypeScriptFile(file.path) ? api.jscodeshift.withParser("ts") : api.jscodeshift; diff --git a/src/transforms/v2-to-v3/ts-type/getClientTypeNames.ts b/src/transforms/v2-to-v3/ts-type/getClientTypeNames.ts index 2dd0c08cb..7256d98db 100644 --- a/src/transforms/v2-to-v3/ts-type/getClientTypeNames.ts +++ b/src/transforms/v2-to-v3/ts-type/getClientTypeNames.ts @@ -1,11 +1,11 @@ import type { Collection, JSCodeshift, TSQualifiedName, TSTypeReference } from "jscodeshift"; -import { getImportSpecifiers } from "../modules/importModule"; -import { getClientDeepImportPath } from "../utils"; +import { getImportSpecifiers } from "../modules/importModule/index.ts"; +import { getClientDeepImportPath } from "../utils/index.ts"; import { type DeepPartial, getTSQualifiedNameFromClientName, -} from "./getTSQualifiedNameFromClientName"; +} from "./getTSQualifiedNameFromClientName.ts"; export interface GetClientTypeNamesOptions { v2ClientName: string; diff --git a/src/transforms/v2-to-v3/ts-type/getV3ClientType.ts b/src/transforms/v2-to-v3/ts-type/getV3ClientType.ts index ca612fe3a..df453f7be 100644 --- a/src/transforms/v2-to-v3/ts-type/getV3ClientType.ts +++ b/src/transforms/v2-to-v3/ts-type/getV3ClientType.ts @@ -1,8 +1,8 @@ import type { JSCodeshift, TSType } from "jscodeshift"; -import { CLIENT_TYPES_MAP } from "../config"; -import { CLIENT_REQ_RESP_TYPES_MAP } from "../config/CLIENT_REQ_RESP_TYPES_MAP"; -import { getTypeForString } from "./getTypeForString"; +import { CLIENT_REQ_RESP_TYPES_MAP } from "../config/CLIENT_REQ_RESP_TYPES_MAP.ts"; +import { CLIENT_TYPES_MAP } from "../config/index.ts"; +import { getTypeForString } from "./getTypeForString.ts"; export interface GetV3ClientTypeOptions { v2ClientLocalName: string; diff --git a/src/transforms/v2-to-v3/ts-type/getV3ClientTypes.ts b/src/transforms/v2-to-v3/ts-type/getV3ClientTypes.ts index dfc3b5c39..6f4fe83fd 100644 --- a/src/transforms/v2-to-v3/ts-type/getV3ClientTypes.ts +++ b/src/transforms/v2-to-v3/ts-type/getV3ClientTypes.ts @@ -1,7 +1,7 @@ import type { Collection, JSCodeshift } from "jscodeshift"; -import { CLIENT_REQ_RESP_TYPES_MAP, CLIENT_TYPES_MAP } from "../config"; -import { type GetClientTypeNamesOptions, getClientTypeNames } from "./getClientTypeNames"; +import { CLIENT_REQ_RESP_TYPES_MAP, CLIENT_TYPES_MAP } from "../config/index.ts"; +import { type GetClientTypeNamesOptions, getClientTypeNames } from "./getClientTypeNames.ts"; const arrayBracketRegex = /<([\w]+)>/g; const recordBracketRegex = //g; diff --git a/src/transforms/v2-to-v3/ts-type/index.ts b/src/transforms/v2-to-v3/ts-type/index.ts index 0a05be4c1..65db2be84 100644 --- a/src/transforms/v2-to-v3/ts-type/index.ts +++ b/src/transforms/v2-to-v3/ts-type/index.ts @@ -1,6 +1,6 @@ -export * from "./getClientTypeNames"; -export * from "./getTSQualifiedNameFromClientName"; -export * from "./getV3ClientType"; -export * from "./getV3ClientTypes"; -export * from "./removeTypesFromTSQualifiedName"; -export * from "./replaceTSTypeReference"; +export * from "./getClientTypeNames.ts"; +export * from "./getTSQualifiedNameFromClientName.ts"; +export * from "./getV3ClientType.ts"; +export * from "./getV3ClientTypes.ts"; +export * from "./removeTypesFromTSQualifiedName.ts"; +export * from "./replaceTSTypeReference.ts"; diff --git a/src/transforms/v2-to-v3/ts-type/replaceTSTypeReference.ts b/src/transforms/v2-to-v3/ts-type/replaceTSTypeReference.ts index 88208a6b7..5664979ff 100644 --- a/src/transforms/v2-to-v3/ts-type/replaceTSTypeReference.ts +++ b/src/transforms/v2-to-v3/ts-type/replaceTSTypeReference.ts @@ -1,9 +1,14 @@ import type { Collection, Identifier, JSCodeshift, TSQualifiedName } from "jscodeshift"; -import { DOCUMENT_CLIENT, DYNAMODB, DYNAMODB_DOCUMENT, DYNAMODB_DOCUMENT_CLIENT } from "../config"; -import { getClientTypeNames } from "./getClientTypeNames"; -import { getTSQualifiedNameFromClientName } from "./getTSQualifiedNameFromClientName"; -import { getV3ClientType } from "./getV3ClientType"; +import { + DOCUMENT_CLIENT, + DYNAMODB, + DYNAMODB_DOCUMENT, + DYNAMODB_DOCUMENT_CLIENT, +} from "../config/index.ts"; +import { getClientTypeNames } from "./getClientTypeNames.ts"; +import { getTSQualifiedNameFromClientName } from "./getTSQualifiedNameFromClientName.ts"; +import { getV3ClientType } from "./getV3ClientType.ts"; export interface ReplaceTSTypeReferenceOptions { v2ClientName: string; diff --git a/src/transforms/v2-to-v3/utils/getClientDeepImportPath.ts b/src/transforms/v2-to-v3/utils/getClientDeepImportPath.ts index 5d7c0f280..8b8e07132 100644 --- a/src/transforms/v2-to-v3/utils/getClientDeepImportPath.ts +++ b/src/transforms/v2-to-v3/utils/getClientDeepImportPath.ts @@ -1,4 +1,4 @@ -import { PACKAGE_NAME } from "../config"; +import { PACKAGE_NAME } from "../config/index.ts"; export const getClientDeepImportPath = (v2ClientName: string) => `${PACKAGE_NAME}/clients/${v2ClientName.toLowerCase()}`; diff --git a/src/transforms/v2-to-v3/utils/index.ts b/src/transforms/v2-to-v3/utils/index.ts index 45a1144c3..684ec1d4a 100644 --- a/src/transforms/v2-to-v3/utils/index.ts +++ b/src/transforms/v2-to-v3/utils/index.ts @@ -1,9 +1,9 @@ -export * from "./getClientDeepImportPath"; -export * from "./getClientNewExpressionFromGlobalName"; -export * from "./getClientNewExpressionFromLocalName"; -export * from "./getFormattedSourceString"; -export * from "./getMostUsedIndentationType"; -export * from "./getMostUsedStringLiteralQuote"; -export * from "./getValueIndentedWithTabs"; -export * from "./isTrailingCommaUsed"; -export * from "./isTypeScriptFile"; +export * from "./getClientDeepImportPath.ts"; +export * from "./getClientNewExpressionFromGlobalName.ts"; +export * from "./getClientNewExpressionFromLocalName.ts"; +export * from "./getFormattedSourceString.ts"; +export * from "./getMostUsedIndentationType.ts"; +export * from "./getMostUsedStringLiteralQuote.ts"; +export * from "./getValueIndentedWithTabs.ts"; +export * from "./isTrailingCommaUsed.ts"; +export * from "./isTypeScriptFile.ts"; diff --git a/src/transforms/v2-to-v3/utils/isTypeScriptFile.spec.ts b/src/transforms/v2-to-v3/utils/isTypeScriptFile.spec.ts index 05b4e50b8..6c1ebe8a8 100644 --- a/src/transforms/v2-to-v3/utils/isTypeScriptFile.spec.ts +++ b/src/transforms/v2-to-v3/utils/isTypeScriptFile.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { isTypeScriptFile } from "./isTypeScriptFile"; +import { isTypeScriptFile } from "./isTypeScriptFile/index.ts"; describe(isTypeScriptFile.name, () => { it.each([ diff --git a/src/utils/getHelpParagraph.ts b/src/utils/getHelpParagraph.ts index a7112d1c5..9e9992ec8 100644 --- a/src/utils/getHelpParagraph.ts +++ b/src/utils/getHelpParagraph.ts @@ -1,5 +1,5 @@ -import type { AwsSdkJsCodemodTransform } from "../transforms"; -import { getTransformDescription } from "./getTransformDescription"; +import type { AwsSdkJsCodemodTransform } from "../transforms/index.ts"; +import { getTransformDescription } from "./getTransformDescription.ts"; const separator = "-".repeat(95); diff --git a/src/utils/getJsCodeshiftParser.ts b/src/utils/getJsCodeshiftParser.ts index 3bedaf12b..d80f5e09a 100644 --- a/src/utils/getJsCodeshiftParser.ts +++ b/src/utils/getJsCodeshiftParser.ts @@ -8,7 +8,7 @@ import { dirname, join } from "node:path"; import { DEFAULT_EXTENSIONS } from "@babel/core"; import argsParser from "jscodeshift/dist/argsParser"; -import { version } from "../../package.json"; +import { version } from "../../package.json/index.ts"; const requirePackage = (name: string) => { const entry = require.resolve(name); diff --git a/src/utils/getTransformDescription.ts b/src/utils/getTransformDescription.ts index 7b6cf968d..f2928ef77 100644 --- a/src/utils/getTransformDescription.ts +++ b/src/utils/getTransformDescription.ts @@ -1,4 +1,4 @@ -import type { AwsSdkJsCodemodTransform } from "../transforms"; +import type { AwsSdkJsCodemodTransform } from "../transforms/index.ts"; const getWrappedBlocks = (sentence: string, blockLength: number): string[] => { const words = sentence.split(" "); diff --git a/src/utils/getTransforms.ts b/src/utils/getTransforms.ts index 778cb1456..49f35af9c 100644 --- a/src/utils/getTransforms.ts +++ b/src/utils/getTransforms.ts @@ -1,7 +1,7 @@ import { readdirSync } from "node:fs"; import { join } from "node:path"; -import type { AwsSdkJsCodemodTransform } from "../transforms"; +import type { AwsSdkJsCodemodTransform } from "../transforms/index.ts"; export const getTransforms = () => readdirSync(join(__dirname, "..", "transforms"), { withFileTypes: true }) diff --git a/src/utils/index.ts b/src/utils/index.ts index 7c3b2db54..ef39b58d0 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,4 +1,4 @@ -export * from "./getHelpParagraph"; -export * from "./getJsCodeshiftParser"; -export * from "./getTransforms"; -export * from "./getUpdatedTransformFile"; +export * from "./getHelpParagraph.ts"; +export * from "./getJsCodeshiftParser.ts"; +export * from "./getTransforms.ts"; +export * from "./getUpdatedTransformFile.ts"; diff --git a/tsconfig.json b/tsconfig.json index 731c69a36..763e0452c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "outDir": "dist", "resolveJsonModule": true, + "rewriteRelativeImportExtensions": true, "rootDir": "src" }, "exclude": ["dist", "**/__fixtures__/**", "**/*.spec.ts", "scripts"] From 325a3bf829f17033c36bda2681e953a0d612c332 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2024 18:51:59 -0800 Subject: [PATCH 2/6] chore: remove tsx and use node --experimental-strip-types --- package-lock.json | 492 ---------------------------------------------- package.json | 7 +- 2 files changed, 3 insertions(+), 496 deletions(-) diff --git a/package-lock.json b/package-lock.json index d05893e83..64b5b5e08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,6 @@ "@types/jscodeshift": "^0.12.0", "@types/node": "^16.18.101", "aws-sdk": "2.1692.0", - "tsx": "^4.7.1", "typescript": "~5.7.2", "vitest": "~2.0.1" }, @@ -1029,414 +1028,6 @@ "prettier": "^2.7.1" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", - "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", - "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", - "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", - "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", - "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", - "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", - "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", - "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", - "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", - "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", - "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", - "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", - "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", - "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", - "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", - "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", - "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", - "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", - "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", - "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", - "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", - "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", - "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", - "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", @@ -2457,46 +2048,6 @@ "node": ">= 0.4" } }, - "node_modules/esbuild": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", - "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.23.1", - "@esbuild/android-arm": "0.23.1", - "@esbuild/android-arm64": "0.23.1", - "@esbuild/android-x64": "0.23.1", - "@esbuild/darwin-arm64": "0.23.1", - "@esbuild/darwin-x64": "0.23.1", - "@esbuild/freebsd-arm64": "0.23.1", - "@esbuild/freebsd-x64": "0.23.1", - "@esbuild/linux-arm": "0.23.1", - "@esbuild/linux-arm64": "0.23.1", - "@esbuild/linux-ia32": "0.23.1", - "@esbuild/linux-loong64": "0.23.1", - "@esbuild/linux-mips64el": "0.23.1", - "@esbuild/linux-ppc64": "0.23.1", - "@esbuild/linux-riscv64": "0.23.1", - "@esbuild/linux-s390x": "0.23.1", - "@esbuild/linux-x64": "0.23.1", - "@esbuild/netbsd-x64": "0.23.1", - "@esbuild/openbsd-arm64": "0.23.1", - "@esbuild/openbsd-x64": "0.23.1", - "@esbuild/sunos-x64": "0.23.1", - "@esbuild/win32-arm64": "0.23.1", - "@esbuild/win32-ia32": "0.23.1", - "@esbuild/win32-x64": "0.23.1" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -2830,19 +2381,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-tsconfig": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz", - "integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -3918,16 +3456,6 @@ "node": ">=8" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -4289,26 +3817,6 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, - "node_modules/tsx": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.2.tgz", - "integrity": "sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.23.0", - "get-tsconfig": "^4.7.5" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, "node_modules/typescript": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", diff --git a/package.json b/package.json index 69e93d475..738bf3e31 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,10 @@ "scripts": { "build": "tsc", "format": "biome format --write", - "generate:map": "tsx scripts/generateClientTypesMap", - "generate:tests": "tsx scripts/generateNewClientTests", + "generate:map": "node --experimental-strip-types scripts/generateClientTypesMap/index.ts", + "generate:tests": "node --experimental-strip-types scripts/generateNewClientTests/index.ts", "lint": "biome lint --write", - "release": "tsx scripts/testUpdatedIdentifiers && npm run build && changeset publish", + "release": "node --experimental-strip-types scripts/testUpdatedIdentifiers/index.ts && npm run build && changeset publish", "test": "vitest", "version": "changeset version && npm i --package-lock-only" }, @@ -52,7 +52,6 @@ "@types/jscodeshift": "^0.12.0", "@types/node": "^16.18.101", "aws-sdk": "2.1692.0", - "tsx": "^4.7.1", "typescript": "~5.7.2", "vitest": "~2.0.1" }, From 500eb1edecdefa65d0b1ca174a817b5df457a794 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2024 18:57:42 -0800 Subject: [PATCH 3/6] chore(scripts): update generateClientTypesMap to work with strip-types --- scripts/generateClientTypesMap/getClientTypesMap.ts | 4 ++-- .../getClientTypesMapWithKeysRemovedFromValues.ts | 4 ++-- scripts/generateClientTypesMap/getTypesSource.ts | 3 +++ .../generateClientTypesMap/hasKeyReferenceInClientTypesMap.ts | 2 +- scripts/generateClientTypesMap/index.ts | 2 ++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/generateClientTypesMap/getClientTypesMap.ts b/scripts/generateClientTypesMap/getClientTypesMap.ts index 3c3acdbd7..18e254fdb 100644 --- a/scripts/generateClientTypesMap/getClientTypesMap.ts +++ b/scripts/generateClientTypesMap/getClientTypesMap.ts @@ -1,8 +1,8 @@ import jscodeshift from "jscodeshift"; import { CLIENT_NAMES_MAP, DOCUMENT_CLIENT } from "../../src/transforms/v2-to-v3/config/index.ts"; -import { getClientTypesMapWithKeysRemovedFromValues } from "./getClientTypesMapWithKeysRemovedFromValues/index.ts"; -import { getTypesSource } from "./getTypesSource/index.ts"; +import { getClientTypesMapWithKeysRemovedFromValues } from "./getClientTypesMapWithKeysRemovedFromValues.ts"; +import { getTypesSource } from "./getTypesSource.ts"; const TYPES_TO_SKIP = ["apiVersion", "ClientConfiguration"]; const ElementTypeToNativeTypeMap = { diff --git a/scripts/generateClientTypesMap/getClientTypesMapWithKeysRemovedFromValues.ts b/scripts/generateClientTypesMap/getClientTypesMapWithKeysRemovedFromValues.ts index 6012becb8..46e792478 100644 --- a/scripts/generateClientTypesMap/getClientTypesMapWithKeysRemovedFromValues.ts +++ b/scripts/generateClientTypesMap/getClientTypesMapWithKeysRemovedFromValues.ts @@ -1,5 +1,5 @@ -import { hasKeyReferenceInClientTypesMap } from "./hasKeyReferenceInClientTypesMap/index.ts"; -import { hasKeyReferenceInValue } from "./hasKeyReferenceinValue/index.ts"; +import { hasKeyReferenceInClientTypesMap } from "./hasKeyReferenceInClientTypesMap.ts"; +import { hasKeyReferenceInValue } from "./hasKeyReferenceinValue.ts"; /** * Checks if any of the values have reference to key, and replaces them recursively. diff --git a/scripts/generateClientTypesMap/getTypesSource.ts b/scripts/generateClientTypesMap/getTypesSource.ts index e19924ee1..92cee1f23 100644 --- a/scripts/generateClientTypesMap/getTypesSource.ts +++ b/scripts/generateClientTypesMap/getTypesSource.ts @@ -3,6 +3,9 @@ import { join } from "node:path"; import type { JSCodeshift } from "jscodeshift"; import { DOCUMENT_CLIENT } from "../../src/transforms/v2-to-v3/config/index.ts"; +// @ts-expect-error import.meta.dirname is defined in Node.js 22.x used for development. +const __dirname = import.meta.dirname; + export const getTypesSource = (j: JSCodeshift, clientName: string) => { const typesPath = clientName === DOCUMENT_CLIENT diff --git a/scripts/generateClientTypesMap/hasKeyReferenceInClientTypesMap.ts b/scripts/generateClientTypesMap/hasKeyReferenceInClientTypesMap.ts index 76592723a..61637392b 100644 --- a/scripts/generateClientTypesMap/hasKeyReferenceInClientTypesMap.ts +++ b/scripts/generateClientTypesMap/hasKeyReferenceInClientTypesMap.ts @@ -1,4 +1,4 @@ -import { hasKeyReferenceInValue } from "./hasKeyReferenceinValue/index.ts"; +import { hasKeyReferenceInValue } from "./hasKeyReferenceinValue.ts"; /** * Checks if any of the values in the clientTypesMap has a reference to any of the keys. diff --git a/scripts/generateClientTypesMap/index.ts b/scripts/generateClientTypesMap/index.ts index bb877d500..9a0254f3e 100644 --- a/scripts/generateClientTypesMap/index.ts +++ b/scripts/generateClientTypesMap/index.ts @@ -12,6 +12,8 @@ import { import { getClientReqRespTypesMap } from "./getClientReqRespTypesMap.ts"; import { getClientTypesMap } from "./getClientTypesMap.ts"; +// @ts-expect-error import.meta.dirname is defined in Node.js 22.x used for development. +const __dirname = import.meta.dirname; const execAsync = promisify(exec); (async () => { From 9eda31d5c5f1a2df7f1f7951c245fd6c0645870c Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:04:41 -0800 Subject: [PATCH 4/6] chore(scripts): update generateNewClientTests to work with strip-types --- .../getClientNameWithLocalSuffix.ts | 2 +- .../getGlobalImportEqualsInput.ts | 4 ++-- .../getGlobalImportEqualsOutput.ts | 8 ++++---- scripts/generateNewClientTests/getGlobalImportInput.ts | 2 +- .../generateNewClientTests/getGlobalImportOutput.ts | 6 +++--- .../generateNewClientTests/getGlobalImportStarInput.ts | 4 ++-- .../getGlobalImportStarOutput.ts | 8 ++++---- .../generateNewClientTests/getGlobalRequireInput.ts | 4 ++-- .../generateNewClientTests/getGlobalRequireOutput.ts | 8 ++++---- .../getGlobalRequirePropertyInput.ts | 4 ++-- .../getGlobalRequirePropertyOutput.ts | 2 +- .../getGlobalRequirePropertyWithNameInput.ts | 6 +++--- .../getGlobalRequirePropertyWithNameOutput.ts | 2 +- .../getServiceImportDeepAllInput.ts | 2 +- .../getServiceImportDeepInput.ts | 6 +++--- .../getServiceImportDeepOutput.ts | 8 ++++---- .../getServiceImportDeepStarInput.ts | 6 +++--- .../getServiceImportDeepStarOutput.ts | 2 +- .../getServiceImportDeepStarWithNameInput.ts | 8 ++++---- .../getServiceImportDeepStarWithNameOutput.ts | 2 +- .../getServiceImportDeepWithNameInput.ts | 8 ++++---- .../getServiceImportDeepWithNameOutput.ts | 10 +++++----- .../getServiceImportEqualsInput.ts | 6 +++--- .../getServiceImportEqualsOutput.ts | 8 ++++---- .../getServiceImportEqualsWithNameInput.ts | 8 ++++---- .../getServiceImportEqualsWithNameOutput.ts | 10 +++++----- .../generateNewClientTests/getServiceImportInput.ts | 4 ++-- .../generateNewClientTests/getServiceImportOutput.ts | 8 ++++---- .../getServiceImportWithNameInput.ts | 6 +++--- .../getServiceImportWithNameOutput.ts | 10 +++++----- .../getServiceRequireDeepAllInput.ts | 2 +- .../getServiceRequireDeepInput.ts | 6 +++--- .../getServiceRequireDeepOutput.ts | 8 ++++---- .../getServiceRequireDeepWithNameInput.ts | 8 ++++---- .../getServiceRequireDeepWithNameOutput.ts | 10 +++++----- .../generateNewClientTests/getServiceRequireInput.ts | 4 ++-- .../generateNewClientTests/getServiceRequireOutput.ts | 2 +- .../getServiceRequireWithNameInput.ts | 6 +++--- .../getServiceRequireWithNameOutput.ts | 10 +++++----- .../getV3PackageImportEqualsCode.ts | 2 +- .../generateNewClientTests/getV3PackageImportsCode.ts | 2 +- .../generateNewClientTests/getV3PackageRequiresCode.ts | 2 +- scripts/generateNewClientTests/index.ts | 3 +++ 43 files changed, 120 insertions(+), 117 deletions(-) diff --git a/scripts/generateNewClientTests/getClientNameWithLocalSuffix.ts b/scripts/generateNewClientTests/getClientNameWithLocalSuffix.ts index 74f9697c0..1ec805b6f 100644 --- a/scripts/generateNewClientTests/getClientNameWithLocalSuffix.ts +++ b/scripts/generateNewClientTests/getClientNameWithLocalSuffix.ts @@ -1,4 +1,4 @@ -import { LOCAL_NAME_SUFFIX } from "./config/index.ts"; +import { LOCAL_NAME_SUFFIX } from "./config.ts"; export const getClientNameWithLocalSuffix = (clientName: string) => `${clientName}${LOCAL_NAME_SUFFIX}`; diff --git a/scripts/generateNewClientTests/getGlobalImportEqualsInput.ts b/scripts/generateNewClientTests/getGlobalImportEqualsInput.ts index 39b235ac2..b93ebc6b4 100644 --- a/scripts/generateNewClientTests/getGlobalImportEqualsInput.ts +++ b/scripts/generateNewClientTests/getGlobalImportEqualsInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getGlobalImportEqualsInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalImportEqualsOutput.ts b/scripts/generateNewClientTests/getGlobalImportEqualsOutput.ts index 4ea206b90..26c8d1920 100644 --- a/scripts/generateNewClientTests/getGlobalImportEqualsOutput.ts +++ b/scripts/generateNewClientTests/getGlobalImportEqualsOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode.ts"; export const getGlobalImportEqualsOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalImportInput.ts b/scripts/generateNewClientTests/getGlobalImportInput.ts index ad3ae47a7..95aba446f 100644 --- a/scripts/generateNewClientTests/getGlobalImportInput.ts +++ b/scripts/generateNewClientTests/getGlobalImportInput.ts @@ -1,5 +1,5 @@ import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/config/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getGlobalImportInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalImportOutput.ts b/scripts/generateNewClientTests/getGlobalImportOutput.ts index b7b9f81af..3650b65fa 100644 --- a/scripts/generateNewClientTests/getGlobalImportOutput.ts +++ b/scripts/generateNewClientTests/getGlobalImportOutput.ts @@ -1,7 +1,7 @@ import { CLIENT_NAMES } from "../../src/transforms/v2-to-v3/config/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode.ts"; export const getGlobalImportOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalImportStarInput.ts b/scripts/generateNewClientTests/getGlobalImportStarInput.ts index ee60a5ff9..f9ab492e2 100644 --- a/scripts/generateNewClientTests/getGlobalImportStarInput.ts +++ b/scripts/generateNewClientTests/getGlobalImportStarInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getGlobalImportStarInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalImportStarOutput.ts b/scripts/generateNewClientTests/getGlobalImportStarOutput.ts index 726825974..04906d863 100644 --- a/scripts/generateNewClientTests/getGlobalImportStarOutput.ts +++ b/scripts/generateNewClientTests/getGlobalImportStarOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode.ts"; export const getGlobalImportStarOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalRequireInput.ts b/scripts/generateNewClientTests/getGlobalRequireInput.ts index f7b092a8e..bfe15b54f 100644 --- a/scripts/generateNewClientTests/getGlobalRequireInput.ts +++ b/scripts/generateNewClientTests/getGlobalRequireInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getGlobalRequireInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalRequireOutput.ts b/scripts/generateNewClientTests/getGlobalRequireOutput.ts index 93447b860..bdbf64205 100644 --- a/scripts/generateNewClientTests/getGlobalRequireOutput.ts +++ b/scripts/generateNewClientTests/getGlobalRequireOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode.ts"; export const getGlobalRequireOutput = () => { let content = "\n\n"; diff --git a/scripts/generateNewClientTests/getGlobalRequirePropertyInput.ts b/scripts/generateNewClientTests/getGlobalRequirePropertyInput.ts index 02b9cbd61..61236363a 100644 --- a/scripts/generateNewClientTests/getGlobalRequirePropertyInput.ts +++ b/scripts/generateNewClientTests/getGlobalRequirePropertyInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getGlobalRequirePropertyInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalRequirePropertyOutput.ts b/scripts/generateNewClientTests/getGlobalRequirePropertyOutput.ts index f10e26d09..6224f9a75 100644 --- a/scripts/generateNewClientTests/getGlobalRequirePropertyOutput.ts +++ b/scripts/generateNewClientTests/getGlobalRequirePropertyOutput.ts @@ -1,3 +1,3 @@ -import { getServiceRequireDeepOutput } from "./getServiceRequireDeepOutput/index.ts"; +import { getServiceRequireDeepOutput } from "./getServiceRequireDeepOutput.ts"; export const getGlobalRequirePropertyOutput = getServiceRequireDeepOutput; diff --git a/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameInput.ts b/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameInput.ts index 08362bd71..d5352612e 100644 --- a/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameInput.ts +++ b/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getGlobalRequirePropertyWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameOutput.ts b/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameOutput.ts index fd35e8252..4d36abd85 100644 --- a/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameOutput.ts +++ b/scripts/generateNewClientTests/getGlobalRequirePropertyWithNameOutput.ts @@ -1,3 +1,3 @@ -import { getServiceRequireDeepWithNameOutput } from "./getServiceRequireDeepWithNameOutput/index.ts"; +import { getServiceRequireDeepWithNameOutput } from "./getServiceRequireDeepWithNameOutput.ts"; export const getGlobalRequirePropertyWithNameOutput = getServiceRequireDeepWithNameOutput; diff --git a/scripts/generateNewClientTests/getServiceImportDeepAllInput.ts b/scripts/generateNewClientTests/getServiceImportDeepAllInput.ts index fadd48e24..bce838623 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepAllInput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepAllInput.ts @@ -1,3 +1,3 @@ -import { getServiceImportInput } from "./getServiceImportInput/index.ts"; +import { getServiceImportInput } from "./getServiceImportInput.ts"; export const getServiceImportDeepAllInput = () => getServiceImportInput("aws-sdk/clients/all"); diff --git a/scripts/generateNewClientTests/getServiceImportDeepInput.ts b/scripts/generateNewClientTests/getServiceImportDeepInput.ts index 96ceb88b1..caa4b75e5 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepInput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceImportDeepInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportDeepOutput.ts b/scripts/generateNewClientTests/getServiceImportDeepOutput.ts index 29f39b8e8..0a2c82946 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode.ts"; export const getServiceImportDeepOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportDeepStarInput.ts b/scripts/generateNewClientTests/getServiceImportDeepStarInput.ts index 65684767b..ad5919eb4 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepStarInput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepStarInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceImportDeepStarInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportDeepStarOutput.ts b/scripts/generateNewClientTests/getServiceImportDeepStarOutput.ts index c32a7565f..80510c94f 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepStarOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepStarOutput.ts @@ -1,3 +1,3 @@ -import { getServiceImportDeepOutput } from "./getServiceImportDeepOutput/index.ts"; +import { getServiceImportDeepOutput } from "./getServiceImportDeepOutput.ts"; export const getServiceImportDeepStarOutput = getServiceImportDeepOutput; diff --git a/scripts/generateNewClientTests/getServiceImportDeepStarWithNameInput.ts b/scripts/generateNewClientTests/getServiceImportDeepStarWithNameInput.ts index 491aa40d2..f599bffdc 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepStarWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepStarWithNameInput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceImportDeepStarWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportDeepStarWithNameOutput.ts b/scripts/generateNewClientTests/getServiceImportDeepStarWithNameOutput.ts index 1fab50483..a6c50a6eb 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepStarWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepStarWithNameOutput.ts @@ -1,3 +1,3 @@ -import { getServiceImportDeepWithNameOutput } from "./getServiceImportDeepWithNameOutput/index.ts"; +import { getServiceImportDeepWithNameOutput } from "./getServiceImportDeepWithNameOutput.ts"; export const getServiceImportDeepStarWithNameOutput = getServiceImportDeepWithNameOutput; diff --git a/scripts/generateNewClientTests/getServiceImportDeepWithNameInput.ts b/scripts/generateNewClientTests/getServiceImportDeepWithNameInput.ts index 755441e14..27a65a4a2 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepWithNameInput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceImportDeepWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportDeepWithNameOutput.ts b/scripts/generateNewClientTests/getServiceImportDeepWithNameOutput.ts index 44e46459b..352d85e73 100644 --- a/scripts/generateNewClientTests/getServiceImportDeepWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportDeepWithNameOutput.ts @@ -1,8 +1,8 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode.ts"; export const getServiceImportDeepWithNameOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportEqualsInput.ts b/scripts/generateNewClientTests/getServiceImportEqualsInput.ts index 41cec0cae..bd6ded9a6 100644 --- a/scripts/generateNewClientTests/getServiceImportEqualsInput.ts +++ b/scripts/generateNewClientTests/getServiceImportEqualsInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceImportEqualsInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportEqualsOutput.ts b/scripts/generateNewClientTests/getServiceImportEqualsOutput.ts index 41fe361f3..57e33ffea 100644 --- a/scripts/generateNewClientTests/getServiceImportEqualsOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportEqualsOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode.ts"; export const getServiceImportEqualsOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportEqualsWithNameInput.ts b/scripts/generateNewClientTests/getServiceImportEqualsWithNameInput.ts index bb374315f..c6bfac94c 100644 --- a/scripts/generateNewClientTests/getServiceImportEqualsWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceImportEqualsWithNameInput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceImportEqualsWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportEqualsWithNameOutput.ts b/scripts/generateNewClientTests/getServiceImportEqualsWithNameOutput.ts index 66c1577de..130e472c0 100644 --- a/scripts/generateNewClientTests/getServiceImportEqualsWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportEqualsWithNameOutput.ts @@ -1,8 +1,8 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode.ts"; export const getServiceImportEqualsWithNameOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportInput.ts b/scripts/generateNewClientTests/getServiceImportInput.ts index fabf2f9e5..36a11a24c 100644 --- a/scripts/generateNewClientTests/getServiceImportInput.ts +++ b/scripts/generateNewClientTests/getServiceImportInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceImportInput = (path?: string) => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportOutput.ts b/scripts/generateNewClientTests/getServiceImportOutput.ts index f63240c11..f0b8dad77 100644 --- a/scripts/generateNewClientTests/getServiceImportOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode.ts"; export const getServiceImportOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportWithNameInput.ts b/scripts/generateNewClientTests/getServiceImportWithNameInput.ts index 929d14231..7a1c4962b 100644 --- a/scripts/generateNewClientTests/getServiceImportWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceImportWithNameInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceImportWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceImportWithNameOutput.ts b/scripts/generateNewClientTests/getServiceImportWithNameOutput.ts index f07f23b25..4fda2c4ec 100644 --- a/scripts/generateNewClientTests/getServiceImportWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceImportWithNameOutput.ts @@ -1,8 +1,8 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageImportsCode } from "./getV3PackageImportsCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageImportsCode } from "./getV3PackageImportsCode.ts"; export const getServiceImportWithNameOutput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceRequireDeepAllInput.ts b/scripts/generateNewClientTests/getServiceRequireDeepAllInput.ts index 25a612ee5..90c00d221 100644 --- a/scripts/generateNewClientTests/getServiceRequireDeepAllInput.ts +++ b/scripts/generateNewClientTests/getServiceRequireDeepAllInput.ts @@ -1,3 +1,3 @@ -import { getServiceRequireInput } from "./getServiceRequireInput/index.ts"; +import { getServiceRequireInput } from "./getServiceRequireInput.ts"; export const getServiceRequireDeepAllInput = () => getServiceRequireInput("aws-sdk/clients/all"); diff --git a/scripts/generateNewClientTests/getServiceRequireDeepInput.ts b/scripts/generateNewClientTests/getServiceRequireDeepInput.ts index a219cc1e9..31617f310 100644 --- a/scripts/generateNewClientTests/getServiceRequireDeepInput.ts +++ b/scripts/generateNewClientTests/getServiceRequireDeepInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceRequireDeepInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceRequireDeepOutput.ts b/scripts/generateNewClientTests/getServiceRequireDeepOutput.ts index 403ef1e3f..879433671 100644 --- a/scripts/generateNewClientTests/getServiceRequireDeepOutput.ts +++ b/scripts/generateNewClientTests/getServiceRequireDeepOutput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode.ts"; export const getServiceRequireDeepOutput = () => { let content = "\n\n"; diff --git a/scripts/generateNewClientTests/getServiceRequireDeepWithNameInput.ts b/scripts/generateNewClientTests/getServiceRequireDeepWithNameInput.ts index 6c4bc4309..420cd4aa9 100644 --- a/scripts/generateNewClientTests/getServiceRequireDeepWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceRequireDeepWithNameInput.ts @@ -1,7 +1,7 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientDeepImportPath } from "./getClientDeepImportPath/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientDeepImportPath } from "./getClientDeepImportPath.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceRequireDeepWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceRequireDeepWithNameOutput.ts b/scripts/generateNewClientTests/getServiceRequireDeepWithNameOutput.ts index 3149c2ed6..72966d95e 100644 --- a/scripts/generateNewClientTests/getServiceRequireDeepWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceRequireDeepWithNameOutput.ts @@ -1,8 +1,8 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode.ts"; export const getServiceRequireDeepWithNameOutput = () => { let content = "\n\n"; diff --git a/scripts/generateNewClientTests/getServiceRequireInput.ts b/scripts/generateNewClientTests/getServiceRequireInput.ts index 36368cf75..77c59262a 100644 --- a/scripts/generateNewClientTests/getServiceRequireInput.ts +++ b/scripts/generateNewClientTests/getServiceRequireInput.ts @@ -1,5 +1,5 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceRequireInput = (path?: string) => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceRequireOutput.ts b/scripts/generateNewClientTests/getServiceRequireOutput.ts index 2f7041797..fe58f6cc2 100644 --- a/scripts/generateNewClientTests/getServiceRequireOutput.ts +++ b/scripts/generateNewClientTests/getServiceRequireOutput.ts @@ -1,3 +1,3 @@ -import { getGlobalRequireOutput } from "./getGlobalRequireOutput/index.ts"; +import { getGlobalRequireOutput } from "./getGlobalRequireOutput.ts"; export const getServiceRequireOutput = getGlobalRequireOutput; diff --git a/scripts/generateNewClientTests/getServiceRequireWithNameInput.ts b/scripts/generateNewClientTests/getServiceRequireWithNameInput.ts index 5e5103840..27b06d5b8 100644 --- a/scripts/generateNewClientTests/getServiceRequireWithNameInput.ts +++ b/scripts/generateNewClientTests/getServiceRequireWithNameInput.ts @@ -1,6 +1,6 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getV2ClientsNewExpressionCode } from "./getV2ClientsNewExpressionCode.ts"; export const getServiceRequireWithNameInput = () => { let content = ""; diff --git a/scripts/generateNewClientTests/getServiceRequireWithNameOutput.ts b/scripts/generateNewClientTests/getServiceRequireWithNameOutput.ts index 4ee4e94e1..d5c4f18e8 100644 --- a/scripts/generateNewClientTests/getServiceRequireWithNameOutput.ts +++ b/scripts/generateNewClientTests/getServiceRequireWithNameOutput.ts @@ -1,8 +1,8 @@ -import { CLIENTS_TO_TEST } from "./config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; -import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName/index.ts"; -import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode/index.ts"; -import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode/index.ts"; +import { CLIENTS_TO_TEST } from "./config.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; +import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName.ts"; +import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode.ts"; +import { getV3PackageRequiresCode } from "./getV3PackageRequiresCode.ts"; export const getServiceRequireWithNameOutput = () => { let content = "\n\n"; diff --git a/scripts/generateNewClientTests/getV3PackageImportEqualsCode.ts b/scripts/generateNewClientTests/getV3PackageImportEqualsCode.ts index cdd871593..234b043d5 100644 --- a/scripts/generateNewClientTests/getV3PackageImportEqualsCode.ts +++ b/scripts/generateNewClientTests/getV3PackageImportEqualsCode.ts @@ -3,7 +3,7 @@ import { CLIENT_NAMES_MAP, CLIENT_PACKAGE_NAMES_MAP, } from "../../src/transforms/v2-to-v3/config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; export interface V3PackageImportEqualsCodeOptions { useLocalSuffix?: boolean; diff --git a/scripts/generateNewClientTests/getV3PackageImportsCode.ts b/scripts/generateNewClientTests/getV3PackageImportsCode.ts index 799b5a15b..f8c15c3b3 100644 --- a/scripts/generateNewClientTests/getV3PackageImportsCode.ts +++ b/scripts/generateNewClientTests/getV3PackageImportsCode.ts @@ -3,7 +3,7 @@ import { CLIENT_NAMES_MAP, CLIENT_PACKAGE_NAMES_MAP, } from "../../src/transforms/v2-to-v3/config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; export interface V3PackageImportsCodeOptions { useLocalSuffix?: boolean; diff --git a/scripts/generateNewClientTests/getV3PackageRequiresCode.ts b/scripts/generateNewClientTests/getV3PackageRequiresCode.ts index db58690bb..a6738c21d 100644 --- a/scripts/generateNewClientTests/getV3PackageRequiresCode.ts +++ b/scripts/generateNewClientTests/getV3PackageRequiresCode.ts @@ -3,7 +3,7 @@ import { CLIENT_NAMES_MAP, CLIENT_PACKAGE_NAMES_MAP, } from "../../src/transforms/v2-to-v3/config/index.ts"; -import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix/index.ts"; +import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix.ts"; export interface V3PackageRequiresCodeOptions { useLocalSuffix?: boolean; diff --git a/scripts/generateNewClientTests/index.ts b/scripts/generateNewClientTests/index.ts index 2a533ee98..6efbc3fc6 100644 --- a/scripts/generateNewClientTests/index.ts +++ b/scripts/generateNewClientTests/index.ts @@ -42,6 +42,9 @@ import { getServiceRequireOutput } from "./getServiceRequireOutput.ts"; import { getServiceRequireWithNameInput } from "./getServiceRequireWithNameInput.ts"; import { getServiceRequireWithNameOutput } from "./getServiceRequireWithNameOutput.ts"; +// @ts-expect-error import.meta.dirname is defined in Node.js 22.x used for development. +const __dirname = import.meta.dirname; + const codegenComment = `// This file is generated by scripts/generateNewClientTests/index.ts // Do not edit this file directly. Instead, edit the script and run it to regenerate this file.`; From 9155be63ff2db44b1920f21245017aab3427accf Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:31:32 -0800 Subject: [PATCH 5/6] test: fix imports --- src/transforms/v2-to-v3/transformer.spec.ts | 2 +- src/transforms/v2-to-v3/utils/isTypeScriptFile.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transforms/v2-to-v3/transformer.spec.ts b/src/transforms/v2-to-v3/transformer.spec.ts index ad1ad8879..3bc8cbde3 100644 --- a/src/transforms/v2-to-v3/transformer.spec.ts +++ b/src/transforms/v2-to-v3/transformer.spec.ts @@ -4,7 +4,7 @@ import { join } from "node:path"; import jscodeshift from "jscodeshift"; import { describe, expect, it } from "vitest"; -import transform from "./transformer/index.ts"; +import transform from "./transformer.ts"; describe("v2-to-v3", () => { const inputFileRegex = /(.*).input.[jt]sx?$/; diff --git a/src/transforms/v2-to-v3/utils/isTypeScriptFile.spec.ts b/src/transforms/v2-to-v3/utils/isTypeScriptFile.spec.ts index 6c1ebe8a8..ff90b8fed 100644 --- a/src/transforms/v2-to-v3/utils/isTypeScriptFile.spec.ts +++ b/src/transforms/v2-to-v3/utils/isTypeScriptFile.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { isTypeScriptFile } from "./isTypeScriptFile/index.ts"; +import { isTypeScriptFile } from "./isTypeScriptFile.ts"; describe(isTypeScriptFile.name, () => { it.each([ From 23772717fbab9074795aadfccfb06ea72b69d61f Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:32:46 -0800 Subject: [PATCH 6/6] chore: npx changset --- .changeset/twelve-students-attend.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/twelve-students-attend.md diff --git a/.changeset/twelve-students-attend.md b/.changeset/twelve-students-attend.md new file mode 100644 index 000000000..7f8dd8622 --- /dev/null +++ b/.changeset/twelve-students-attend.md @@ -0,0 +1,5 @@ +--- +"aws-sdk-js-codemod": minor +--- + +Use node --experimental-strip-types