UNPKG

ember-codemod-pod-to-octane

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