UNPKG

ember-codemod-remove-global-styles

Version:
16 lines (15 loc) 602 B
import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import { getClassToStyles } from '../utils/css/index.js'; import { analyzeComponents, analyzeRoutes } from './analyze-project/index.js'; export function analyzeProject(options) { const { projectRoot, src } = options; const stylesheet = readFileSync(join(projectRoot, src), 'utf8'); const classToStyles = getClassToStyles(stylesheet); const components = analyzeComponents(classToStyles, options); const routes = analyzeRoutes(classToStyles, options); return { components, routes, }; }