Skip to content

Commit

Permalink
refactor: use getCoreNextImportsForFile
Browse files Browse the repository at this point in the history
  • Loading branch information
talkor committed Nov 17, 2024
1 parent bc5e161 commit 7050219
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { CORE_IMPORT_PATH } from "../../../src/consts";
import { wrap, renameImportPath, getImports } from "../../../src/utils";
import { wrap, renameImportPath, getCoreNextImportsForFile } from "../../../src/utils";
import { TransformationContext } from "../../../types";

/**
* 1. Changes imports from 'monday-ui-react-core/next' to 'monday-ui-react-core'
*/
function transform({ root }: TransformationContext) {
const imports = getImports(root, `${CORE_IMPORT_PATH}/next`);
const imports = getCoreNextImportsForFile(root);

imports.forEach(importPath => {
renameImportPath(importPath, CORE_IMPORT_PATH);
Expand Down

0 comments on commit 7050219

Please sign in to comment.