From c43259dd3639b59a5e0841947e4d5e3d690b60ea Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Fri, 22 Dec 2023 16:14:15 +0100 Subject: [PATCH] Minimal changes to the typescript client --- .../typescript/src/cli/migrations/builder.ts | 17 ++--------------- clients/typescript/src/cli/migrations/index.ts | 2 -- .../typescript/src/cli/migrations/migrate.ts | 2 +- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/clients/typescript/src/cli/migrations/builder.ts b/clients/typescript/src/cli/migrations/builder.ts index fe4aad5bb4..c19d1bf885 100644 --- a/clients/typescript/src/cli/migrations/builder.ts +++ b/clients/typescript/src/cli/migrations/builder.ts @@ -71,22 +71,9 @@ export async function getMigrationNames( * @param migrationsFolder Folder where migrations are stored. * @returns An array of migrations. */ -async function loadMigrations( +export async function loadMigrations( migrationsFolder: string ): Promise { - const migrationMetaDatas = await loadMigrationsMetaData(migrationsFolder) - return migrationMetaDatas.map(makeMigration) -} - - -/** - * Loads the meta data of all migrations that are present in the provided migrations folder. - * @param migrationsFolder Folder where migrations are stored. - * @returns An array of migrations meta data. - */ -export async function loadMigrationsMetaData( - migrationsFolder: string -): Promise { const dirNames = await getMigrationNames(migrationsFolder) const migrationPaths = dirNames.map((dirName) => path.join(migrationsFolder, dirName, 'metadata.json') @@ -94,7 +81,7 @@ export async function loadMigrationsMetaData( const migrationMetaDatas = await Promise.all( migrationPaths.map(readMetadataFile) ) - return migrationMetaDatas + return migrationMetaDatas.map(makeMigration) } /** diff --git a/clients/typescript/src/cli/migrations/index.ts b/clients/typescript/src/cli/migrations/index.ts index 00c3f842dc..e148bc41c9 100644 --- a/clients/typescript/src/cli/migrations/index.ts +++ b/clients/typescript/src/cli/migrations/index.ts @@ -1,3 +1 @@ export { handleGenerate } from './handler' -export { fetchMigrations } from './migrate' -export { loadMigrationsMetaData } from './builder' \ No newline at end of file diff --git a/clients/typescript/src/cli/migrations/migrate.ts b/clients/typescript/src/cli/migrations/migrate.ts index 9a15d26536..7e4c3cdd88 100644 --- a/clients/typescript/src/cli/migrations/migrate.ts +++ b/clients/typescript/src/cli/migrations/migrate.ts @@ -464,7 +464,7 @@ async function executeShellCommand( * Fetches the migrations from the provided endpoint, * unzips them and writes them to the `writeTo` location. */ -export async function fetchMigrations( +async function fetchMigrations( endpoint: string, writeTo: string, tmpFolder: string