ember-codemod-remove-ember-css-modules
Version:
Codemod to replace ember-css-modules with embroider-css-modules
23 lines (22 loc) • 672 B
JavaScript
import { join } from 'node:path';
import { updateTemplates } from '../../../utils/steps/update-templates/index.js';
function getFilePath(options) {
const { componentStructure } = options;
return function (entityName) {
let filePath = join('app/components', entityName);
if (componentStructure === 'nested') {
filePath += '/index';
}
filePath += '.hbs';
return filePath;
};
}
export function updateComponentTemplates(context, options) {
const customizations = {
getFilePath: getFilePath(options),
};
updateTemplates(context.components, {
customizations,
options,
});
}