ember-codemod-pod-to-octane
Version:
Codemod to un-pod Ember apps, addons, and engines
19 lines (18 loc) • 613 B
JavaScript
import { findFiles } from '@codemod-utils/files';
import { renamePodPath } from '../../../../../utils/files/index.js';
export function mapComponentClasses(options) {
const { projectRoot } = options;
const podDir = 'app/components';
const filePaths = findFiles(`${podDir}/**/component.js`, {
projectRoot,
});
return filePaths.map((oldFilePath) => {
const newFilePath = renamePodPath(oldFilePath, {
podDir,
replace: (key) => {
return `app/components/${key}`;
},
});
return [oldFilePath, newFilePath];
});
}