diff --git a/README.md b/README.md index 503727e..183adda 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,27 @@ Replacing `` and `` with appropriate values. - [x] Popover - [x] Col - [x] Row -- [ ] Tag -- [ ] Timeline +- [x] Tag +- [x] Timeline +- [ ] Collapse - [ ] Pagination -- [ ] Form相关 \ No newline at end of file +- [ ] Select +- [ ] SelectProps +- [ ] DatePicker +- [ ] TimePicker +- [ ] Input +- [ ] InputNumber +- [ ] Radio +- [ ] Switch +- [ ] Checkbox +- [ ] Upload +- [ ] AutoComplete +- [ ] Dropdown +- [ ] Form +- [ ] FormInstance +- [ ] Icon +- [ ] Space +- [ ] Avatar +- [ ] List +- [ ] Alert +- [ ] Menu \ No newline at end of file diff --git a/bin/cli.js b/bin/cli.js index b8a1f7d..f227afc 100644 --- a/bin/cli.js +++ b/bin/cli.js @@ -58,7 +58,9 @@ const TRANSFORMER_INQUIRER_CHOICES = [ 'Slider', 'Popover', 'Col', - 'Row' + 'Row', + 'Tag', + 'Timeline' ] .sort((a, b) => a.localeCompare(b)) .map((v) => ({ diff --git a/transforms/Tag.js b/transforms/Tag.js new file mode 100644 index 0000000..8fb8d31 --- /dev/null +++ b/transforms/Tag.js @@ -0,0 +1,9 @@ +const { removeAntdImportAndAddSemiImport } = require('./utils') +module.exports = function transformer(file, api) { + const j = api.jscodeshift + const root = j(file.source) + + removeAntdImportAndAddSemiImport(j, root, 'Tag', 'Tag') + + return root.toSource() +} diff --git a/transforms/Timeline.js b/transforms/Timeline.js new file mode 100644 index 0000000..578b22f --- /dev/null +++ b/transforms/Timeline.js @@ -0,0 +1,9 @@ +const { removeAntdImportAndAddSemiImport } = require('./utils') +module.exports = function transformer(file, api) { + const j = api.jscodeshift + const root = j(file.source) + + removeAntdImportAndAddSemiImport(j, root, 'Timeline', 'Timeline') + + return root.toSource() +}