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