Dev/refactor duel
目的:规范文件夹结构,便于代码的阅读理解和增改。
-
将
ui/Duel
之中的组件按照message(提供额外信息)和play mat(决斗盘)进行划分 - 使用官方的组件英文名(墓地:graveyard,除外:banish zone)
- 将所有组件名字按照React规范改成大写开头的驼峰
-
ui/Duel/utils
单独作为文件夹,不同的方法单独放在不同的文件 -
加入
index.ts
统一往外导出组件 - 添加 eslint-plugin-simple-import-sort,使得导入更加规范
-
将从
JSON
直接导入的配置,改成从config
模块导入
重构后的文件夹结构:
.
├── Duel
│ ├── Layout.tsx
│ ├── Main.tsx
│ ├── Message
│ │ ├── index.ts
│ │ ├── Alert.tsx
│ │ ├── CardListModal.tsx
│ │ ├── CardModal.tsx
│ │ ├── CheckCardModal.tsx
│ │ ├── CheckCardModalV2.tsx
│ │ ├── CheckCardModalV3.tsx
│ │ ├── CheckCounterModal.tsx
│ │ ├── DragModal.tsx
│ │ ├── HintNotification.tsx
│ │ ├── OptionModal.tsx
│ │ ├── Phase.tsx
│ │ ├── PositionModal.tsx
│ │ ├── SendBox.tsx
│ │ ├── SortCardModal.tsx
│ │ ├── Status.tsx
│ │ ├── TimeLine.tsx
│ │ └── YesNoModal.tsx
│ ├── PlayMat
│ │ ├── index.tsx
│ │ ├── BanishedZone.tsx
│ │ ├── Deck.tsx
│ │ ├── ExtraDeck.tsx
│ │ ├── Field.tsx
│ │ ├── FixedSlot.tsx
│ │ ├── Graveyard.tsx
│ │ ├── Hands.tsx
│ │ ├── Magics.tsx
│ │ ├── Monsters.tsx
│ │ └── SingleSlot.tsx
│ ├── spring
│ │ ├── animated.ts
│ │ ├── customProps.ts
│ │ ├── index.ts
│ │ └── primitives.ts
│ └── utils
│ ├── cardSlot.ts
│ ├── index.ts
│ ├── interactTypeToString.ts
│ └── zip.ts
├── LazyLoad.tsx
├── Login.tsx
├── Mora.tsx
├── Neos.tsx
├── WaitRoom.tsx
└── editor.tsx
5 directories, 45 files