UNPKG

ember-codemod-pod-to-octane

Version:
20 lines (19 loc) 648 B
import { findFiles } from '@codemod-utils/files'; import { renamePodPath } from '../../../../../utils/files/index.js'; export function mapRouteTemplates(options) { const { projectRoot } = options; const podDir = 'addon'; const filePaths = findFiles(`${podDir}/**/template.hbs`, { ignoreList: ['addon/components/**'], projectRoot, }); return filePaths.map((oldFilePath) => { const newFilePath = renamePodPath(oldFilePath, { podDir, replace: (key) => { return `addon/templates/${key}`; }, }); return [oldFilePath, newFilePath]; }); }