ember-codemod-pod-to-octane
Version:
Codemod to un-pod Ember apps, addons, and engines
20 lines (19 loc) • 648 B
JavaScript
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];
});
}