From c98c60a63359c86e9694d58df1cc46b491b2cfe0 Mon Sep 17 00:00:00 2001 From: Andrew Pellerano <23562652+apellerano-pw@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:42:28 -0400 Subject: [PATCH] move glob exclude patterns to ignoreList --- .../create-file-path-maps/app/map-route-stylesheets.ts | 10 ++++------ .../create-file-path-maps/app/map-route-templates.ts | 10 ++++------ .../tests/map-route-controllers.ts | 3 ++- .../create-file-path-maps/tests/map-route-routes.ts | 3 ++- .../steps/create-file-path-maps/tests/map-services.ts | 3 ++- .../addon/map-route-stylesheets.ts | 3 ++- .../create-file-path-maps/addon/map-route-templates.ts | 3 ++- .../create-file-path-maps/app/map-route-templates.ts | 3 ++- .../tests/map-route-controllers.ts | 10 ++++------ .../create-file-path-maps/tests/map-route-routes.ts | 3 ++- .../steps/create-file-path-maps/tests/map-services.ts | 10 ++++------ 11 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/migration/app/steps/create-file-path-maps/app/map-route-stylesheets.ts b/src/migration/app/steps/create-file-path-maps/app/map-route-stylesheets.ts index a6e66e8..d2ce98d 100644 --- a/src/migration/app/steps/create-file-path-maps/app/map-route-stylesheets.ts +++ b/src/migration/app/steps/create-file-path-maps/app/map-route-stylesheets.ts @@ -11,12 +11,10 @@ import { renamePodPath } from '../../../../../utils/files/index.js'; export function mapRouteStylesheets(options: Options): FilePathMapEntries { const { podPath, projectRoot } = options; - const filePaths = findFiles( - join('app', podPath, '!(components)/**/styles.{css,scss}'), - { - projectRoot, - }, - ); + const filePaths = findFiles(join('app', podPath, '**/styles.{css,scss}'), { + ignoreList: [join('app', podPath, 'components', '**')], + projectRoot, + }); return filePaths.map((oldFilePath) => { const newFilePath = renamePodPath(oldFilePath, { diff --git a/src/migration/app/steps/create-file-path-maps/app/map-route-templates.ts b/src/migration/app/steps/create-file-path-maps/app/map-route-templates.ts index 267d8bd..90815ee 100644 --- a/src/migration/app/steps/create-file-path-maps/app/map-route-templates.ts +++ b/src/migration/app/steps/create-file-path-maps/app/map-route-templates.ts @@ -11,12 +11,10 @@ import { renamePodPath } from '../../../../../utils/files/index.js'; export function mapRouteTemplates(options: Options): FilePathMapEntries { const { podPath, projectRoot } = options; - const filePaths = findFiles( - join('app', podPath, '!(components)/**/template.hbs'), - { - projectRoot, - }, - ); + const filePaths = findFiles(join('app', podPath, '**/template.hbs'), { + ignoreList: [join('app', podPath, 'components', '**')], + projectRoot, + }); return filePaths.map((oldFilePath) => { const newFilePath = renamePodPath(oldFilePath, { diff --git a/src/migration/app/steps/create-file-path-maps/tests/map-route-controllers.ts b/src/migration/app/steps/create-file-path-maps/tests/map-route-controllers.ts index 0dac7a7..b91e050 100644 --- a/src/migration/app/steps/create-file-path-maps/tests/map-route-controllers.ts +++ b/src/migration/app/steps/create-file-path-maps/tests/map-route-controllers.ts @@ -15,8 +15,9 @@ export function mapRouteControllers(options: Options): FilePathMapEntries { Case 1: Didn't pass the --pod flag, but configured { usePods: true } in .ember-cli */ const filePaths1 = findFiles( - join('tests/unit', podPath, '!(controllers)/**/controller-test.{js,ts}'), + join('tests/unit', podPath, '**/controller-test.{js,ts}'), { + ignoreList: [join('tests/unit', podPath, 'controllers', '**')], projectRoot, }, ); diff --git a/src/migration/app/steps/create-file-path-maps/tests/map-route-routes.ts b/src/migration/app/steps/create-file-path-maps/tests/map-route-routes.ts index f7fbdf6..318c415 100644 --- a/src/migration/app/steps/create-file-path-maps/tests/map-route-routes.ts +++ b/src/migration/app/steps/create-file-path-maps/tests/map-route-routes.ts @@ -15,8 +15,9 @@ export function mapRouteRoutes(options: Options): FilePathMapEntries { Case 1: Didn't pass the --pod flag, but configured { usePods: true } in .ember-cli */ const filePaths1 = findFiles( - join('tests/unit', podPath, '!(routes)/**/route-test.{js,ts}'), + join('tests/unit', podPath, '**/route-test.{js,ts}'), { + ignoreList: [join('tests/unit', podPath, 'routes', '**')], projectRoot, }, ); diff --git a/src/migration/app/steps/create-file-path-maps/tests/map-services.ts b/src/migration/app/steps/create-file-path-maps/tests/map-services.ts index edb8257..4ac0669 100644 --- a/src/migration/app/steps/create-file-path-maps/tests/map-services.ts +++ b/src/migration/app/steps/create-file-path-maps/tests/map-services.ts @@ -12,8 +12,9 @@ export function mapServices(options: Options): FilePathMapEntries { const { podPath, projectRoot } = options; const filePaths = findFiles( - join('tests/unit', podPath, '!(services)/**/service-test.{js,ts}'), + join('tests/unit', podPath, '**/service-test.{js,ts}'), { + ignoreList: [join('tests/unit', podPath, 'services', '**')], projectRoot, }, ); diff --git a/src/migration/v1-addon/steps/create-file-path-maps/addon/map-route-stylesheets.ts b/src/migration/v1-addon/steps/create-file-path-maps/addon/map-route-stylesheets.ts index 40434e5..91876b5 100644 --- a/src/migration/v1-addon/steps/create-file-path-maps/addon/map-route-stylesheets.ts +++ b/src/migration/v1-addon/steps/create-file-path-maps/addon/map-route-stylesheets.ts @@ -9,7 +9,8 @@ import { renamePodPath } from '../../../../../utils/files/index.js'; export function mapRouteStylesheets(options: Options): FilePathMapEntries { const { projectRoot } = options; - const filePaths = findFiles('addon/!(components)/**/styles.{css,scss}', { + const filePaths = findFiles('addon/**/styles.{css,scss}', { + ignoreList: ['addon/components/**'], projectRoot, }); diff --git a/src/migration/v1-addon/steps/create-file-path-maps/addon/map-route-templates.ts b/src/migration/v1-addon/steps/create-file-path-maps/addon/map-route-templates.ts index 302c4f4..6bf26c2 100644 --- a/src/migration/v1-addon/steps/create-file-path-maps/addon/map-route-templates.ts +++ b/src/migration/v1-addon/steps/create-file-path-maps/addon/map-route-templates.ts @@ -9,7 +9,8 @@ import { renamePodPath } from '../../../../../utils/files/index.js'; export function mapRouteTemplates(options: Options): FilePathMapEntries { const { projectRoot } = options; - const filePaths = findFiles('addon/!(components)/**/template.hbs', { + const filePaths = findFiles('addon/**/template.hbs', { + ignoreList: ['addon/components/**'], projectRoot, }); diff --git a/src/migration/v1-addon/steps/create-file-path-maps/app/map-route-templates.ts b/src/migration/v1-addon/steps/create-file-path-maps/app/map-route-templates.ts index 978ff48..6f25706 100644 --- a/src/migration/v1-addon/steps/create-file-path-maps/app/map-route-templates.ts +++ b/src/migration/v1-addon/steps/create-file-path-maps/app/map-route-templates.ts @@ -9,7 +9,8 @@ import { renamePodPath } from '../../../../../utils/files/index.js'; export function mapRouteTemplates(options: Options): FilePathMapEntries { const { projectRoot } = options; - const filePaths = findFiles('app/!(components)/**/template.js', { + const filePaths = findFiles('app/**/template.js', { + ignoreList: ['app/components/**'], projectRoot, }); diff --git a/src/migration/v1-addon/steps/create-file-path-maps/tests/map-route-controllers.ts b/src/migration/v1-addon/steps/create-file-path-maps/tests/map-route-controllers.ts index 6373948..8614c37 100644 --- a/src/migration/v1-addon/steps/create-file-path-maps/tests/map-route-controllers.ts +++ b/src/migration/v1-addon/steps/create-file-path-maps/tests/map-route-controllers.ts @@ -12,12 +12,10 @@ export function mapRouteControllers(options: Options): FilePathMapEntries { /* Case 1: Didn't pass the --pod flag, but configured { usePods: true } in .ember-cli */ - const filePaths1 = findFiles( - 'tests/unit/!(controllers)/**/controller-test.{js,ts}', - { - projectRoot, - }, - ); + const filePaths1 = findFiles('tests/unit/**/controller-test.{js,ts}', { + ignoreList: ['tests/unit/controllers/**'], + projectRoot, + }); const filePathMap1 = filePaths1.map((oldFilePath) => { const newFilePath = renamePodPath(oldFilePath, { diff --git a/src/migration/v1-addon/steps/create-file-path-maps/tests/map-route-routes.ts b/src/migration/v1-addon/steps/create-file-path-maps/tests/map-route-routes.ts index 4ea3f38..b936fb3 100644 --- a/src/migration/v1-addon/steps/create-file-path-maps/tests/map-route-routes.ts +++ b/src/migration/v1-addon/steps/create-file-path-maps/tests/map-route-routes.ts @@ -12,7 +12,8 @@ export function mapRouteRoutes(options: Options): FilePathMapEntries { /* Case 1: Didn't pass the --pod flag, but configured { usePods: true } in .ember-cli */ - const filePaths1 = findFiles('tests/unit/!(routes)/**/route-test.{js,ts}', { + const filePaths1 = findFiles('tests/unit/**/route-test.{js,ts}', { + ignoreList: ['tests/unit/routes/**'], projectRoot, }); diff --git a/src/migration/v1-addon/steps/create-file-path-maps/tests/map-services.ts b/src/migration/v1-addon/steps/create-file-path-maps/tests/map-services.ts index 2212d0d..b5f8582 100644 --- a/src/migration/v1-addon/steps/create-file-path-maps/tests/map-services.ts +++ b/src/migration/v1-addon/steps/create-file-path-maps/tests/map-services.ts @@ -9,12 +9,10 @@ import { renamePodPath } from '../../../../../utils/files/index.js'; export function mapServices(options: Options): FilePathMapEntries { const { projectRoot } = options; - const filePaths = findFiles( - 'tests/unit/!(services)/**/service-test.{js,ts}', - { - projectRoot, - }, - ); + const filePaths = findFiles('tests/unit/**/service-test.{js,ts}', { + ignoreList: ['tests/unit/services/**'], + projectRoot, + }); return filePaths.map((oldFilePath) => { const newFilePath = renamePodPath(oldFilePath, {