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