Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
29 lines
737 B
JavaScript
29 lines
737 B
JavaScript
import movePropIntoSlots from '../utils/movePropIntoSlots';
|
|
import replaceComponentsWithSlots from '../utils/replaceComponentsWithSlots';
|
|
|
|
/**
|
|
* @param {import('jscodeshift').FileInfo} file
|
|
* @param {import('jscodeshift').API} api
|
|
*/
|
|
export default function transformer(file, api, options) {
|
|
const j = api.jscodeshift;
|
|
const root = j(file.source);
|
|
const printOptions = options.printOptions;
|
|
|
|
replaceComponentsWithSlots(j, {
|
|
root,
|
|
packageName: options.packageName,
|
|
componentName: 'Backdrop',
|
|
});
|
|
|
|
movePropIntoSlots(j, {
|
|
root,
|
|
packageName: options.packageName,
|
|
componentName: 'Backdrop',
|
|
propName: 'TransitionComponent',
|
|
slotName: 'transition',
|
|
});
|
|
|
|
return root.toSource(printOptions);
|
|
}
|