From 981ca258163e900e33ea5ddaaf4a260a608e2d81 Mon Sep 17 00:00:00 2001 From: mtt <85215373+mtt-artis@users.noreply.github.com> Date: Wed, 23 Aug 2023 09:52:48 +0200 Subject: [PATCH 1/6] feat/add cjs extension --- src/migration/file-migration-provider.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/migration/file-migration-provider.ts b/src/migration/file-migration-provider.ts index 9df33e173..d65f43b80 100644 --- a/src/migration/file-migration-provider.ts +++ b/src/migration/file-migration-provider.ts @@ -31,6 +31,7 @@ export class FileMigrationProvider implements MigrationProvider { for (const fileName of files) { if ( fileName.endsWith('.js') || + fileName.endsWith('.cjs') || (fileName.endsWith('.ts') && !fileName.endsWith('.d.ts')) || fileName.endsWith('.mjs') || (fileName.endsWith('.mts') && !fileName.endsWith('.d.mts')) From 2e5a04e92747ada0e7fc36d07f35d8905cae227c Mon Sep 17 00:00:00 2001 From: mtt <85215373+mtt-artis@users.noreply.github.com> Date: Wed, 23 Aug 2023 18:42:38 +0200 Subject: [PATCH 2/6] feat: ES Module loading with abolute path fails on windows --- src/migration/file-migration-provider.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/migration/file-migration-provider.ts b/src/migration/file-migration-provider.ts index d65f43b80..67789afe6 100644 --- a/src/migration/file-migration-provider.ts +++ b/src/migration/file-migration-provider.ts @@ -37,6 +37,7 @@ export class FileMigrationProvider implements MigrationProvider { (fileName.endsWith('.mts') && !fileName.endsWith('.d.mts')) ) { const migration = await import( + this.#props.protocol + /* webpackIgnore: true */ this.#props.path.join( this.#props.migrationFolder, fileName @@ -72,5 +73,6 @@ export interface FileMigrationProviderPath { export interface FileMigrationProviderProps { fs: FileMigrationProviderFS path: FileMigrationProviderPath - migrationFolder: string + migrationFolder: string, + protocole?: 'file://', } From 06c241fde86b319319249936928430e05fc2c9ca Mon Sep 17 00:00:00 2001 From: mtt <85215373+mtt-artis@users.noreply.github.com> Date: Wed, 23 Aug 2023 18:43:02 +0200 Subject: [PATCH 3/6] typo --- src/migration/file-migration-provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/migration/file-migration-provider.ts b/src/migration/file-migration-provider.ts index 67789afe6..6e2f343ed 100644 --- a/src/migration/file-migration-provider.ts +++ b/src/migration/file-migration-provider.ts @@ -74,5 +74,5 @@ export interface FileMigrationProviderProps { fs: FileMigrationProviderFS path: FileMigrationProviderPath migrationFolder: string, - protocole?: 'file://', + protocol?: 'file://', } From 8d660afc80d0db07e7b38fcbf594037224c9a6b9 Mon Sep 17 00:00:00 2001 From: mtt <85215373+mtt-artis@users.noreply.github.com> Date: Wed, 23 Aug 2023 18:48:24 +0200 Subject: [PATCH 4/6] typo not used to code on the github web editor :( --- src/migration/file-migration-provider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/migration/file-migration-provider.ts b/src/migration/file-migration-provider.ts index 6e2f343ed..8f0584919 100644 --- a/src/migration/file-migration-provider.ts +++ b/src/migration/file-migration-provider.ts @@ -73,6 +73,6 @@ export interface FileMigrationProviderPath { export interface FileMigrationProviderProps { fs: FileMigrationProviderFS path: FileMigrationProviderPath - migrationFolder: string, - protocol?: 'file://', + migrationFolder: string + protocol?: 'file://' } From 583070b96ab0e10717ff3d6a87d5b3b502d1c101 Mon Sep 17 00:00:00 2001 From: mtt <85215373+mtt-artis@users.noreply.github.com> Date: Thu, 24 Aug 2023 13:48:20 +0200 Subject: [PATCH 5/6] fix --- src/migration/file-migration-provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/migration/file-migration-provider.ts b/src/migration/file-migration-provider.ts index 8f0584919..aaad9f8a5 100644 --- a/src/migration/file-migration-provider.ts +++ b/src/migration/file-migration-provider.ts @@ -37,7 +37,7 @@ export class FileMigrationProvider implements MigrationProvider { (fileName.endsWith('.mts') && !fileName.endsWith('.d.mts')) ) { const migration = await import( - this.#props.protocol + + (this.#props.protocol ?? "") + /* webpackIgnore: true */ this.#props.path.join( this.#props.migrationFolder, fileName From d51764731ecc62b15479c64c5f4dc837ff753c8c Mon Sep 17 00:00:00 2001 From: mtt <85215373+mtt-artis@users.noreply.github.com> Date: Mon, 28 Aug 2023 11:33:31 +0200 Subject: [PATCH 6/6] fix --- src/migration/file-migration-provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/migration/file-migration-provider.ts b/src/migration/file-migration-provider.ts index aaad9f8a5..c97d88319 100644 --- a/src/migration/file-migration-provider.ts +++ b/src/migration/file-migration-provider.ts @@ -37,8 +37,8 @@ export class FileMigrationProvider implements MigrationProvider { (fileName.endsWith('.mts') && !fileName.endsWith('.d.mts')) ) { const migration = await import( - (this.#props.protocol ?? "") + /* webpackIgnore: true */ this.#props.path.join( + this.#props.protocol ?? "", this.#props.migrationFolder, fileName )