Skip to content

Commit

Permalink
move glob exclude patterns to ignoreList
Browse files Browse the repository at this point in the history
  • Loading branch information
apellerano-pw committed Oct 14, 2024
1 parent de4e85a commit c98c60a
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit c98c60a

Please sign in to comment.