## History
### 2.5.35(2024-09-03)
- 规范依赖输出,增加可读性
### 2.5.26(2024-8-13)
- 弃用 tl upgrade,改用 pip3 install tdf_tool --upgrade
### 2.5.23(2024-8-9)
- deps 命令使用flutter pub deps --json命令获取壳模块直接依赖后,采用递归方式构建完整依赖树(原 deps 命令)
### 2.4.16(2024-4-29)
- 修复 tl module open 命令偶现复用上一个 vscode 窗口的问题;(改为每次新建一个 vscode)
### 2.4.15(2024-4-24)
- 该版本包含自身版本控制逻辑
- 若远端存在新版本,会有提示更新(1.重大更新(强制),2.api更新(强制),3.小功能更新,4.无功能更新,5.异常更新)
- 提供远端版本查看链接,可以自行查看版本更新文案自行选择是否更新 tl 命令
### 2.4.13(2024-4-23)
- 新增tl 版本号校验,以便及时告知开发者更新最新版本号
### 2.4.11(2024-4-20)
- 修复路由丢失问题;
### 2.4.7(2024-4-20)
- tl router start 替换为 tl annotation start
- 新增支持通过下标指定模块执行脚本
- 针对新增的 api 自动注册文件,增加 tl 版本号标注,以便出现文件生成不一致,可进行比对
### 2.1.00
- 路由功能支持flutter版本3.3.10,兼容flutter版本2.2.3;
### 2.0.61
- Flutter国际化字符串整合;
### 2.0.38
- 路由生成完后增加路由相关代码format(解决windows代码生成后顺序错乱);
### 2.0.01
- Cli 框架升级;
- 代码重构;
### **1.1.00(2022-4-28)**
- 国际化解决输出json中包含转义字符的问题,如\n;
- 四类语言输出文件自动格式化
### **1.0.55(2022-4-28)**
- 国际化key使用中文(依照ios项目开发形式);
### **1.0.53(2022-4-28)**
- 国际化流程中,兼容解决部分json解析失败问题,譬如字符串中包含"="符号;
> 错误日志如:Unterminated string starting at: line 1 column 5650 (char 5649)
### **1.0.50(2022-4-28)**
- 国际化增加繁体字翻译;
## 帮助文档
```shell
NAME
tdf_tool - 二维火 Flutter 脚手架工具,包含项目构建,依赖分析,git等功能。。
SYNOPSIS
tdf_tool GROUP | COMMAND
DESCRIPTION
二维火 Flutter 脚手架工具,包含项目构建,依赖分析,git等功能。。
GROUPS
GROUP is one of the following:
module
模块相关工具: tdf_tool module -h 查看详情
package
封包工具相关:tdf_tool package -h 查看详情
translate
国际化相关:tdf_tool translate -h 查看详情
COMMANDS
COMMAND is one of the following:
git
tdf_tool git【git 命令】:批量操作 git 命令, 例如 tdf_tool git push
router
tdf_tool router:会以交互式进行路由操作,对指定的模块执行路由生成和路由注册逻辑
upgrade
tdf_tool upgrade:升级插件到最新版本
```
## 插件安装方式
安装python包
```
pip3 install tdf-tool --user
```
安装并更新python包
```
pip3 install --upgrade tdf-tool --user
```
安装测试环境python包
```
pip3 install -i https://test.pypi.org/simple/ tdf-tool --user
```
安装并更新测试环境python包
```
pip3 install --upgrade -i https://test.pypi.org/simple/ tdf-tool --user
```
## 工具使用流程说明
### 1.准备工作
- 确保python的bin插件目录已经被配置到环境变量中(这一步不满足的话,插件安装之后是无法识别到本插件命令的)
- 在~目录下,创建.tdf_tool_config文件并配置相关必需属性如下
```json
git_private_token=***
```
git_private_token是gitlab的token
获取途径:进入gitlab页面,点击右上角头像,选择Preferences,选择左侧列表中的AccessToken进行创建
**上述步骤如果没有做,会在使用插件时,会有提示**
### 2.初始化
#### i.进入壳目录(确保执行命令在壳目录内)
#### ii.执行tdf_tool module init
- 判断当前目录是否存在tdf_cache,若不存在,则会自动创建tdf_cache
- 自动读取当前壳模块名称,写入initial_config.json配置文件;
- 读取当前壳分支,写入initial_config.json配置文件;
- 交互式提示用户输入需要开发的模块名并写入initial_config.json配置文件的moduleNameList列表字段中
- !退出,即输入完成
- 自动clone所有开发模块到 ```../.tdf_flutter``` 隐藏目录中;
- 将所有开发模块分支切换至与壳一致;
- 自动分析依赖树,并**由下至上**对所有模块自动执行```flutter pub upgrade```;
#### iii.开发过程中
##### 1.开发模块添加
- 若是有新模块需要添加入开发模块中,可直接修改initial_config.json配置文件,修改moduleNameList字段;
- 执行tdf_tool deps更新依赖
##### 2.新开发模块添加
- 添加新模块后,会提示找不到模块,实际查找的是```tdf_cache```文件夹中的module_config.json文件;
- 如果没有找到该模块,则可以执行```tdf_tool module-update```,更新远程module_config.json文件;
- 删掉本地的module_config.json文件,重新执行命令即可,脚本会自动判断本地是否存在该配置文件,如果不存在会**下载**;
<span style="color:#ff0000">请确保gitlab仓库的新开发模块master分支是一个flutter模块,如果判定不是flutter模块,则会报错(判定条件为存在pubspec.yaml文件)</span>
### 3.版本控制
版本控制请使用tdf_tool命令,命令详情可使用 ```tdf_tool -h``` 查看,现已支持大部分命令,若有特殊命令需要执行,可以使用 ```tdf_tool <git命令>``` ,如:```tdf_tool git add .```
### 4.自动打包发布
暂未接入打包工具,预计下一季度进行支持;
**<span style="color:#ff0000">FAQ</span>**
windows系统请使用bash命令;
## 额外功能说明
### 1.二维数组表达依赖树
生成一个二维数组,可根据该二维数组的数据进行**并发**打tag,每一层的模块,都可以同时进行打tag发布操作,减少发布耗时;
```json
[
["tdf_channel", "tdf_event", "tdf_network"],
["tdf_widgets"],
["tdf_smart_devices", "tdf_account_module"],
["flutter_reset_module"]
]
```
如上数据,数组中每一个节点中的模块均可同时打tag,节点之间需要由上至下的顺序进行tag操作
### 2.插件更新
执行 ```tdf_tool upgrade```
### 3.远程模块配置文件更新
执行 ```tdf_tool module module_update```
## 依赖树分析原理
采用有向有/无环图进行依赖树的分析
数据结构采用如下:
```python
class DependencyNode:
def __init__(self):
self.nodeName = ''
self.parent = [] # 父亲节点列表
self.children = [] # 子孙节点列表
self.delete = False
```
![dependency](./README_DIR/dependency.png)
如上图1:一个正常的依赖树表示;
如上图2:对图1中,依赖树所有节点去重,变换为图2有向图;
**分析流程:**
**依赖图构建**
```python
# 生成依赖图
def _generateDependenciesMap(self):
for package in self.__moduleDependenciesMap:
for module in moduleNameList:
if package == module:
# 到这一步表明当前这个模块属于开发模块且在当前模块的依赖模块列表中,是当前模块的子模块
self._mNodeDict[self.__moduleName].children.append(package)
self._mNodeDict[package].parent.append(self.__moduleName)
```
- 共5个节点
- node构建:
- ```python
{
"模块1":{
"nodeNmae": "模块1",
"parent": [],
"children": ["模块2","模块3","模块4","模块5"],
"delete": False
},
"模块2":{
"nodeNmae": "模块2",
"parent": ["模块1"],
"children": ["模块4","模块5"],
"delete": False
}
"模块3":{
"nodeNmae": "模块3",
"parent": ["模块1"],
"children": ["模块5"],
"delete": False
}
"模块4":{
"nodeNmae": "模块4",
"parent": ["模块1","模块2"],
"children": [],
"delete": False
}
"模块5":{
"nodeNmae": "模块5",
"parent": ["模块1","模块2","模块3"],
"children": [],
"delete": False
}
}
```
**依赖图解析伪代码(以一维数组为例)**
```python
# 返回二维数组,用于并发打tag
def _generateDependenciesOrder(self):
resList = []
while 存在节点delete属性不为True:
for:查找子节点为0的节点
设置节点delete属性为True
for:deleteItemList = 拿到所有delete属性为true的节点
for:遍历所有节点,如果节点的子节点中包含deleteItemList的节点,则将其从子节点列表中删除
```
- **initial_config.json文件说明**
```json
{
"featureBranch": "feature/test_dev_1", // 开发分支
"shellName": "flutter_reset_module",
// 项目需要开发的模块,可自由配置
"moduleNameList": [
"flutter_reset_module",
"tdf_smart_devices",
"tdf_widgets",
"tdf_channel"
]
}
```
- **module_config.json文件说明**
```json
{
"flutter_globalyun_us_module": {
"id": "11111"
"type": "shell",
"git": "git@git.2dfire.net:app/flutter/app/flutter_globalyun_us_module.git"
},
"tdf_router_anno": {
"type": "base",
"git": "git@git.2dfire.net:app/flutter/app/tdf_router_anno.git"
},
}
//语意
{
"模块名":{
"id": 项目gitlab id
"类型": gitlab group名
"git": gitlab地址
}
}
```
## 后续计划
<span style="color:#ff0000">**问题:**</span>由于现在flutter ci 【lint】【tag】任务脚本成功率过于低,很多时候是因为项目模块的配置问题导致的,且后续会接入一键打tag工具
方案:在执行统一push前,对所有模块的项目配置信息进行校验,确保数据规范;
## 插件打包发布命令
**插件打包命令**
```
poetry build
```
**插件发布命令**
```
poetry publish
```
## vscode 调试配置 ##
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "i18n",
"type": "python",
"request": "launch",
"pythonpath": "/Users/admin/Library/Caches/pypoetry/virtualenvs/tdf-tool-_Qh8vdX_-py3.11/bin/python", // python路径
"cwd": "${workspaceFolder}",
"module": "poetry",
// "justMyCode": false,
"args": [
"run",
"tl",
"i18n",
"reflow",
"start",
]
}
]
}
```
Raw data
{
"_id": null,
"home_page": "https://git.2dfire.net/app/flutter/tools/package_tools",
"name": "tdf_tool",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0.0,>=3.9.0",
"maintainer_email": null,
"keywords": "tdf, tdf-tool, tdf_tool",
"author": "Jian Xu",
"author_email": "3386218996@qq.com",
"download_url": "https://files.pythonhosted.org/packages/c9/4c/e271c5b38bc92f9b25fe867a484654f1403c5e69d25eb522ae81de9804e8/tdf_tool-2.5.48.tar.gz",
"platform": null,
"description": "## History\n\n### 2.5.35\uff082024-09-03\uff09\n- \u89c4\u8303\u4f9d\u8d56\u8f93\u51fa\uff0c\u589e\u52a0\u53ef\u8bfb\u6027\n\n### 2.5.26\uff082024-8-13\uff09\n- \u5f03\u7528 tl upgrade\uff0c\u6539\u7528 pip3 install tdf_tool --upgrade\n\n### 2.5.23\uff082024-8-9\uff09\n- deps \u547d\u4ee4\u4f7f\u7528flutter pub deps --json\u547d\u4ee4\u83b7\u53d6\u58f3\u6a21\u5757\u76f4\u63a5\u4f9d\u8d56\u540e\uff0c\u91c7\u7528\u9012\u5f52\u65b9\u5f0f\u6784\u5efa\u5b8c\u6574\u4f9d\u8d56\u6811\uff08\u539f deps \u547d\u4ee4\uff09\n\n### 2.4.16\uff082024-4-29\uff09\n- \u4fee\u590d tl module open \u547d\u4ee4\u5076\u73b0\u590d\u7528\u4e0a\u4e00\u4e2a vscode \u7a97\u53e3\u7684\u95ee\u9898\uff1b\uff08\u6539\u4e3a\u6bcf\u6b21\u65b0\u5efa\u4e00\u4e2a vscode\uff09\n\n### 2.4.15\uff082024-4-24\uff09\n\n- \u8be5\u7248\u672c\u5305\u542b\u81ea\u8eab\u7248\u672c\u63a7\u5236\u903b\u8f91\n- \u82e5\u8fdc\u7aef\u5b58\u5728\u65b0\u7248\u672c\uff0c\u4f1a\u6709\u63d0\u793a\u66f4\u65b0\uff081.\u91cd\u5927\u66f4\u65b0(\u5f3a\u5236)\uff0c2.api\u66f4\u65b0(\u5f3a\u5236)\uff0c3.\u5c0f\u529f\u80fd\u66f4\u65b0\uff0c4.\u65e0\u529f\u80fd\u66f4\u65b0\uff0c5.\u5f02\u5e38\u66f4\u65b0\uff09\n- \u63d0\u4f9b\u8fdc\u7aef\u7248\u672c\u67e5\u770b\u94fe\u63a5\uff0c\u53ef\u4ee5\u81ea\u884c\u67e5\u770b\u7248\u672c\u66f4\u65b0\u6587\u6848\u81ea\u884c\u9009\u62e9\u662f\u5426\u66f4\u65b0 tl \u547d\u4ee4\n\n### 2.4.13\uff082024-4-23\uff09\n\n- \u65b0\u589etl \u7248\u672c\u53f7\u6821\u9a8c\uff0c\u4ee5\u4fbf\u53ca\u65f6\u544a\u77e5\u5f00\u53d1\u8005\u66f4\u65b0\u6700\u65b0\u7248\u672c\u53f7\n\n### 2.4.11\uff082024-4-20\uff09\n\n- \u4fee\u590d\u8def\u7531\u4e22\u5931\u95ee\u9898\uff1b\n\n### 2.4.7\uff082024-4-20\uff09\n\n- tl router start \u66ff\u6362\u4e3a tl annotation start\n- \u65b0\u589e\u652f\u6301\u901a\u8fc7\u4e0b\u6807\u6307\u5b9a\u6a21\u5757\u6267\u884c\u811a\u672c\n- \u9488\u5bf9\u65b0\u589e\u7684 api \u81ea\u52a8\u6ce8\u518c\u6587\u4ef6\uff0c\u589e\u52a0 tl \u7248\u672c\u53f7\u6807\u6ce8\uff0c\u4ee5\u4fbf\u51fa\u73b0\u6587\u4ef6\u751f\u6210\u4e0d\u4e00\u81f4\uff0c\u53ef\u8fdb\u884c\u6bd4\u5bf9\n\n### 2.1.00\n\n- \u8def\u7531\u529f\u80fd\u652f\u6301flutter\u7248\u672c3.3.10\uff0c\u517c\u5bb9flutter\u7248\u672c2.2.3\uff1b\n\n### 2.0.61\n\n- Flutter\u56fd\u9645\u5316\u5b57\u7b26\u4e32\u6574\u5408\uff1b\n\n### 2.0.38\n\n- \u8def\u7531\u751f\u6210\u5b8c\u540e\u589e\u52a0\u8def\u7531\u76f8\u5173\u4ee3\u7801format\uff08\u89e3\u51b3windows\u4ee3\u7801\u751f\u6210\u540e\u987a\u5e8f\u9519\u4e71\uff09\uff1b\n\n### 2.0.01\n\n- Cli \u6846\u67b6\u5347\u7ea7\uff1b\n- \u4ee3\u7801\u91cd\u6784\uff1b\n\n### **1.1.00\uff082022-4-28\uff09**\n\n- \u56fd\u9645\u5316\u89e3\u51b3\u8f93\u51fajson\u4e2d\u5305\u542b\u8f6c\u4e49\u5b57\u7b26\u7684\u95ee\u9898\uff0c\u5982\\n\uff1b\n- \u56db\u7c7b\u8bed\u8a00\u8f93\u51fa\u6587\u4ef6\u81ea\u52a8\u683c\u5f0f\u5316\n\n### **1.0.55\uff082022-4-28\uff09**\n\n- \u56fd\u9645\u5316key\u4f7f\u7528\u4e2d\u6587\uff08\u4f9d\u7167ios\u9879\u76ee\u5f00\u53d1\u5f62\u5f0f\uff09\uff1b\n\n### **1.0.53\uff082022-4-28\uff09**\n\n- \u56fd\u9645\u5316\u6d41\u7a0b\u4e2d\uff0c\u517c\u5bb9\u89e3\u51b3\u90e8\u5206json\u89e3\u6790\u5931\u8d25\u95ee\u9898\uff0c\u8b6c\u5982\u5b57\u7b26\u4e32\u4e2d\u5305\u542b\"=\"\u7b26\u53f7\uff1b\n\n> \u9519\u8bef\u65e5\u5fd7\u5982\uff1aUnterminated string starting at: line 1 column 5650 (char 5649)\n\n### **1.0.50\uff082022-4-28\uff09**\n\n- \u56fd\u9645\u5316\u589e\u52a0\u7e41\u4f53\u5b57\u7ffb\u8bd1\uff1b\n\n## \u5e2e\u52a9\u6587\u6863\n\n```shell\nNAME\n tdf_tool - \u4e8c\u7ef4\u706b Flutter \u811a\u624b\u67b6\u5de5\u5177\uff0c\u5305\u542b\u9879\u76ee\u6784\u5efa\uff0c\u4f9d\u8d56\u5206\u6790\uff0cgit\u7b49\u529f\u80fd\u3002\u3002\n\nSYNOPSIS\n tdf_tool GROUP | COMMAND\n\nDESCRIPTION\n \u4e8c\u7ef4\u706b Flutter \u811a\u624b\u67b6\u5de5\u5177\uff0c\u5305\u542b\u9879\u76ee\u6784\u5efa\uff0c\u4f9d\u8d56\u5206\u6790\uff0cgit\u7b49\u529f\u80fd\u3002\u3002\n\nGROUPS\n GROUP is one of the following:\n\n module\n \u6a21\u5757\u76f8\u5173\u5de5\u5177\uff1a tdf_tool module -h \u67e5\u770b\u8be6\u60c5\n\n package\n \u5c01\u5305\u5de5\u5177\u76f8\u5173\uff1atdf_tool package -h \u67e5\u770b\u8be6\u60c5\n\n translate\n \u56fd\u9645\u5316\u76f8\u5173\uff1atdf_tool translate -h \u67e5\u770b\u8be6\u60c5\n\nCOMMANDS\n COMMAND is one of the following:\n\n git\n tdf_tool git\u3010git \u547d\u4ee4\u3011\uff1a\u6279\u91cf\u64cd\u4f5c git \u547d\u4ee4, \u4f8b\u5982 tdf_tool git push\n\n router\n tdf_tool router\uff1a\u4f1a\u4ee5\u4ea4\u4e92\u5f0f\u8fdb\u884c\u8def\u7531\u64cd\u4f5c\uff0c\u5bf9\u6307\u5b9a\u7684\u6a21\u5757\u6267\u884c\u8def\u7531\u751f\u6210\u548c\u8def\u7531\u6ce8\u518c\u903b\u8f91\n\n upgrade\n tdf_tool upgrade\uff1a\u5347\u7ea7\u63d2\u4ef6\u5230\u6700\u65b0\u7248\u672c\n \n```\n\n## \u63d2\u4ef6\u5b89\u88c5\u65b9\u5f0f\n\n\u5b89\u88c5python\u5305\n\n```\npip3 install tdf-tool --user\n```\n\n\u5b89\u88c5\u5e76\u66f4\u65b0python\u5305\n\n```\npip3 install --upgrade tdf-tool --user\n```\n\n\u5b89\u88c5\u6d4b\u8bd5\u73af\u5883python\u5305\n\n```\npip3 install -i https://test.pypi.org/simple/ tdf-tool --user\n```\n\n\u5b89\u88c5\u5e76\u66f4\u65b0\u6d4b\u8bd5\u73af\u5883python\u5305\n\n```\npip3 install --upgrade -i https://test.pypi.org/simple/ tdf-tool --user\n```\n\n## \u5de5\u5177\u4f7f\u7528\u6d41\u7a0b\u8bf4\u660e\n\n### 1.\u51c6\u5907\u5de5\u4f5c\n\n- \u786e\u4fddpython\u7684bin\u63d2\u4ef6\u76ee\u5f55\u5df2\u7ecf\u88ab\u914d\u7f6e\u5230\u73af\u5883\u53d8\u91cf\u4e2d\uff08\u8fd9\u4e00\u6b65\u4e0d\u6ee1\u8db3\u7684\u8bdd\uff0c\u63d2\u4ef6\u5b89\u88c5\u4e4b\u540e\u662f\u65e0\u6cd5\u8bc6\u522b\u5230\u672c\u63d2\u4ef6\u547d\u4ee4\u7684\uff09\n\n- \u5728~\u76ee\u5f55\u4e0b\uff0c\u521b\u5efa.tdf_tool_config\u6587\u4ef6\u5e76\u914d\u7f6e\u76f8\u5173\u5fc5\u9700\u5c5e\u6027\u5982\u4e0b\n\n```json\ngit_private_token=***\n```\n\ngit_private_token\u662fgitlab\u7684token\n\n\u83b7\u53d6\u9014\u5f84\uff1a\u8fdb\u5165gitlab\u9875\u9762\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u5934\u50cf\uff0c\u9009\u62e9Preferences\uff0c\u9009\u62e9\u5de6\u4fa7\u5217\u8868\u4e2d\u7684AccessToken\u8fdb\u884c\u521b\u5efa\n\n**\u4e0a\u8ff0\u6b65\u9aa4\u5982\u679c\u6ca1\u6709\u505a\uff0c\u4f1a\u5728\u4f7f\u7528\u63d2\u4ef6\u65f6\uff0c\u4f1a\u6709\u63d0\u793a**\n\n### 2.\u521d\u59cb\u5316\n\n#### i.\u8fdb\u5165\u58f3\u76ee\u5f55\uff08\u786e\u4fdd\u6267\u884c\u547d\u4ee4\u5728\u58f3\u76ee\u5f55\u5185\uff09\n\n#### ii.\u6267\u884ctdf_tool module init\n\n- \u5224\u65ad\u5f53\u524d\u76ee\u5f55\u662f\u5426\u5b58\u5728tdf_cache\uff0c\u82e5\u4e0d\u5b58\u5728\uff0c\u5219\u4f1a\u81ea\u52a8\u521b\u5efatdf_cache\n- \u81ea\u52a8\u8bfb\u53d6\u5f53\u524d\u58f3\u6a21\u5757\u540d\u79f0\uff0c\u5199\u5165initial_config.json\u914d\u7f6e\u6587\u4ef6\uff1b\n- \u8bfb\u53d6\u5f53\u524d\u58f3\u5206\u652f\uff0c\u5199\u5165initial_config.json\u914d\u7f6e\u6587\u4ef6\uff1b\n- \u4ea4\u4e92\u5f0f\u63d0\u793a\u7528\u6237\u8f93\u5165\u9700\u8981\u5f00\u53d1\u7684\u6a21\u5757\u540d\u5e76\u5199\u5165initial_config.json\u914d\u7f6e\u6587\u4ef6\u7684moduleNameList\u5217\u8868\u5b57\u6bb5\u4e2d\n- \uff01\u9000\u51fa\uff0c\u5373\u8f93\u5165\u5b8c\u6210\n- \u81ea\u52a8clone\u6240\u6709\u5f00\u53d1\u6a21\u5757\u5230 ```../.tdf_flutter``` \u9690\u85cf\u76ee\u5f55\u4e2d\uff1b\n- \u5c06\u6240\u6709\u5f00\u53d1\u6a21\u5757\u5206\u652f\u5207\u6362\u81f3\u4e0e\u58f3\u4e00\u81f4\uff1b\n- \u81ea\u52a8\u5206\u6790\u4f9d\u8d56\u6811\uff0c\u5e76**\u7531\u4e0b\u81f3\u4e0a**\u5bf9\u6240\u6709\u6a21\u5757\u81ea\u52a8\u6267\u884c```flutter pub upgrade```;\n\n#### iii.\u5f00\u53d1\u8fc7\u7a0b\u4e2d\n\n##### 1.\u5f00\u53d1\u6a21\u5757\u6dfb\u52a0\n\n- \u82e5\u662f\u6709\u65b0\u6a21\u5757\u9700\u8981\u6dfb\u52a0\u5165\u5f00\u53d1\u6a21\u5757\u4e2d\uff0c\u53ef\u76f4\u63a5\u4fee\u6539initial_config.json\u914d\u7f6e\u6587\u4ef6\uff0c\u4fee\u6539moduleNameList\u5b57\u6bb5\uff1b\n- \u6267\u884ctdf_tool deps\u66f4\u65b0\u4f9d\u8d56\n\n##### 2.\u65b0\u5f00\u53d1\u6a21\u5757\u6dfb\u52a0\n\n- \u6dfb\u52a0\u65b0\u6a21\u5757\u540e\uff0c\u4f1a\u63d0\u793a\u627e\u4e0d\u5230\u6a21\u5757\uff0c\u5b9e\u9645\u67e5\u627e\u7684\u662f```tdf_cache```\u6587\u4ef6\u5939\u4e2d\u7684module_config.json\u6587\u4ef6\uff1b\n- \u5982\u679c\u6ca1\u6709\u627e\u5230\u8be5\u6a21\u5757\uff0c\u5219\u53ef\u4ee5\u6267\u884c```tdf_tool module-update```,\u66f4\u65b0\u8fdc\u7a0bmodule_config.json\u6587\u4ef6\uff1b\n- \u5220\u6389\u672c\u5730\u7684module_config.json\u6587\u4ef6\uff0c\u91cd\u65b0\u6267\u884c\u547d\u4ee4\u5373\u53ef\uff0c\u811a\u672c\u4f1a\u81ea\u52a8\u5224\u65ad\u672c\u5730\u662f\u5426\u5b58\u5728\u8be5\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u4f1a**\u4e0b\u8f7d**\uff1b\n\n<span style=\"color:#ff0000\">\u8bf7\u786e\u4fddgitlab\u4ed3\u5e93\u7684\u65b0\u5f00\u53d1\u6a21\u5757master\u5206\u652f\u662f\u4e00\u4e2aflutter\u6a21\u5757\uff0c\u5982\u679c\u5224\u5b9a\u4e0d\u662fflutter\u6a21\u5757\uff0c\u5219\u4f1a\u62a5\u9519\uff08\u5224\u5b9a\u6761\u4ef6\u4e3a\u5b58\u5728pubspec.yaml\u6587\u4ef6\uff09</span>\n\n### 3.\u7248\u672c\u63a7\u5236\n\n\u7248\u672c\u63a7\u5236\u8bf7\u4f7f\u7528tdf_tool\u547d\u4ee4\uff0c\u547d\u4ee4\u8be6\u60c5\u53ef\u4f7f\u7528 ```tdf_tool -h``` \u67e5\u770b\uff0c\u73b0\u5df2\u652f\u6301\u5927\u90e8\u5206\u547d\u4ee4\uff0c\u82e5\u6709\u7279\u6b8a\u547d\u4ee4\u9700\u8981\u6267\u884c\uff0c\u53ef\u4ee5\u4f7f\u7528 ```tdf_tool <git\u547d\u4ee4>``` \uff0c\u5982\uff1a```tdf_tool git add .```\n\n### 4.\u81ea\u52a8\u6253\u5305\u53d1\u5e03\n\n\u6682\u672a\u63a5\u5165\u6253\u5305\u5de5\u5177\uff0c\u9884\u8ba1\u4e0b\u4e00\u5b63\u5ea6\u8fdb\u884c\u652f\u6301\uff1b\n\n**<span style=\"color:#ff0000\">FAQ</span>**\n\nwindows\u7cfb\u7edf\u8bf7\u4f7f\u7528bash\u547d\u4ee4\uff1b\n\n## \u989d\u5916\u529f\u80fd\u8bf4\u660e\n\n### 1.\u4e8c\u7ef4\u6570\u7ec4\u8868\u8fbe\u4f9d\u8d56\u6811\n\n\u751f\u6210\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4\uff0c\u53ef\u6839\u636e\u8be5\u4e8c\u7ef4\u6570\u7ec4\u7684\u6570\u636e\u8fdb\u884c**\u5e76\u53d1**\u6253tag\uff0c\u6bcf\u4e00\u5c42\u7684\u6a21\u5757\uff0c\u90fd\u53ef\u4ee5\u540c\u65f6\u8fdb\u884c\u6253tag\u53d1\u5e03\u64cd\u4f5c\uff0c\u51cf\u5c11\u53d1\u5e03\u8017\u65f6\uff1b\n\n```json\n[\n [\"tdf_channel\", \"tdf_event\", \"tdf_network\"], \n [\"tdf_widgets\"], \n [\"tdf_smart_devices\", \"tdf_account_module\"], \n [\"flutter_reset_module\"]\n]\n```\n\n\u5982\u4e0a\u6570\u636e\uff0c\u6570\u7ec4\u4e2d\u6bcf\u4e00\u4e2a\u8282\u70b9\u4e2d\u7684\u6a21\u5757\u5747\u53ef\u540c\u65f6\u6253tag\uff0c\u8282\u70b9\u4e4b\u95f4\u9700\u8981\u7531\u4e0a\u81f3\u4e0b\u7684\u987a\u5e8f\u8fdb\u884ctag\u64cd\u4f5c\n\n### 2.\u63d2\u4ef6\u66f4\u65b0\n\n\u6267\u884c ```tdf_tool upgrade```\n\n### 3.\u8fdc\u7a0b\u6a21\u5757\u914d\u7f6e\u6587\u4ef6\u66f4\u65b0\n\n\u6267\u884c ```tdf_tool module module_update```\n\n## \u4f9d\u8d56\u6811\u5206\u6790\u539f\u7406\n\n\u91c7\u7528\u6709\u5411\u6709/\u65e0\u73af\u56fe\u8fdb\u884c\u4f9d\u8d56\u6811\u7684\u5206\u6790\n\n\u6570\u636e\u7ed3\u6784\u91c7\u7528\u5982\u4e0b\uff1a\n\n```python\nclass DependencyNode:\n def __init__(self):\n self.nodeName = ''\n self.parent = [] # \u7236\u4eb2\u8282\u70b9\u5217\u8868\n self.children = [] # \u5b50\u5b59\u8282\u70b9\u5217\u8868\n self.delete = False\n```\n\n![dependency](./README_DIR/dependency.png)\n\n\u5982\u4e0a\u56fe1\uff1a\u4e00\u4e2a\u6b63\u5e38\u7684\u4f9d\u8d56\u6811\u8868\u793a\uff1b\n\n\u5982\u4e0a\u56fe2\uff1a\u5bf9\u56fe1\u4e2d\uff0c\u4f9d\u8d56\u6811\u6240\u6709\u8282\u70b9\u53bb\u91cd\uff0c\u53d8\u6362\u4e3a\u56fe2\u6709\u5411\u56fe\uff1b\n\n**\u5206\u6790\u6d41\u7a0b\uff1a**\n\n**\u4f9d\u8d56\u56fe\u6784\u5efa**\n\n```python\n# \u751f\u6210\u4f9d\u8d56\u56fe\n def _generateDependenciesMap(self):\n for package in self.__moduleDependenciesMap:\n for module in moduleNameList:\n if package == module:\n # \u5230\u8fd9\u4e00\u6b65\u8868\u660e\u5f53\u524d\u8fd9\u4e2a\u6a21\u5757\u5c5e\u4e8e\u5f00\u53d1\u6a21\u5757\u4e14\u5728\u5f53\u524d\u6a21\u5757\u7684\u4f9d\u8d56\u6a21\u5757\u5217\u8868\u4e2d\uff0c\u662f\u5f53\u524d\u6a21\u5757\u7684\u5b50\u6a21\u5757\n self._mNodeDict[self.__moduleName].children.append(package)\n self._mNodeDict[package].parent.append(self.__moduleName)\n```\n\n- \u51715\u4e2a\u8282\u70b9\n\n - node\u6784\u5efa\uff1a\n\n - ```python\n {\n \"\u6a21\u57571\":{\n \"nodeNmae\": \"\u6a21\u57571\",\n \"parent\": [],\n \"children\": [\"\u6a21\u57572\",\"\u6a21\u57573\",\"\u6a21\u57574\",\"\u6a21\u57575\"],\n \"delete\": False\n },\n \"\u6a21\u57572\":{\n \"nodeNmae\": \"\u6a21\u57572\",\n \"parent\": [\"\u6a21\u57571\"],\n \"children\": [\"\u6a21\u57574\",\"\u6a21\u57575\"],\n \"delete\": False\n }\n \"\u6a21\u57573\":{\n \"nodeNmae\": \"\u6a21\u57573\",\n \"parent\": [\"\u6a21\u57571\"],\n \"children\": [\"\u6a21\u57575\"],\n \"delete\": False\n }\n \"\u6a21\u57574\":{\n \"nodeNmae\": \"\u6a21\u57574\",\n \"parent\": [\"\u6a21\u57571\",\"\u6a21\u57572\"],\n \"children\": [],\n \"delete\": False\n }\n \"\u6a21\u57575\":{\n \"nodeNmae\": \"\u6a21\u57575\",\n \"parent\": [\"\u6a21\u57571\",\"\u6a21\u57572\",\"\u6a21\u57573\"],\n \"children\": [],\n \"delete\": False\n }\n }\n ```\n\n**\u4f9d\u8d56\u56fe\u89e3\u6790\u4f2a\u4ee3\u7801\uff08\u4ee5\u4e00\u7ef4\u6570\u7ec4\u4e3a\u4f8b\uff09**\n\n```python\n# \u8fd4\u56de\u4e8c\u7ef4\u6570\u7ec4\uff0c\u7528\u4e8e\u5e76\u53d1\u6253tag\n def _generateDependenciesOrder(self):\n resList = []\n while \u5b58\u5728\u8282\u70b9delete\u5c5e\u6027\u4e0d\u4e3aTrue:\n \n for\uff1a\u67e5\u627e\u5b50\u8282\u70b9\u4e3a0\u7684\u8282\u70b9\n \u8bbe\u7f6e\u8282\u70b9delete\u5c5e\u6027\u4e3aTrue\n \n for\uff1adeleteItemList = \u62ff\u5230\u6240\u6709delete\u5c5e\u6027\u4e3atrue\u7684\u8282\u70b9\n\n for\uff1a\u904d\u5386\u6240\u6709\u8282\u70b9\uff0c\u5982\u679c\u8282\u70b9\u7684\u5b50\u8282\u70b9\u4e2d\u5305\u542bdeleteItemList\u7684\u8282\u70b9\uff0c\u5219\u5c06\u5176\u4ece\u5b50\u8282\u70b9\u5217\u8868\u4e2d\u5220\u9664\n```\n\n- **initial_config.json\u6587\u4ef6\u8bf4\u660e**\n\n ```json\n {\n \"featureBranch\": \"feature/test_dev_1\", // \u5f00\u53d1\u5206\u652f\n \"shellName\": \"flutter_reset_module\",\n // \u9879\u76ee\u9700\u8981\u5f00\u53d1\u7684\u6a21\u5757,\u53ef\u81ea\u7531\u914d\u7f6e\n \"moduleNameList\": [\n \"flutter_reset_module\",\n \"tdf_smart_devices\",\n \"tdf_widgets\",\n \"tdf_channel\"\n ]\n }\n ```\n\n- **module_config.json\u6587\u4ef6\u8bf4\u660e**\n\n ```json\n {\n \"flutter_globalyun_us_module\": {\n \"id\": \"11111\"\n \"type\": \"shell\",\n \"git\": \"git@git.2dfire.net:app/flutter/app/flutter_globalyun_us_module.git\"\n },\n \"tdf_router_anno\": {\n \"type\": \"base\",\n \"git\": \"git@git.2dfire.net:app/flutter/app/tdf_router_anno.git\"\n },\n }\n //\u8bed\u610f\n {\n \"\u6a21\u5757\u540d\":{\n \"id\": \u9879\u76eegitlab id\n \"\u7c7b\u578b\": gitlab group\u540d\n \"git\": gitlab\u5730\u5740\n }\n }\n ```\n\n## \u540e\u7eed\u8ba1\u5212\n\n<span style=\"color:#ff0000\">**\u95ee\u9898\uff1a**</span>\u7531\u4e8e\u73b0\u5728flutter ci \u3010lint\u3011\u3010tag\u3011\u4efb\u52a1\u811a\u672c\u6210\u529f\u7387\u8fc7\u4e8e\u4f4e\uff0c\u5f88\u591a\u65f6\u5019\u662f\u56e0\u4e3a\u9879\u76ee\u6a21\u5757\u7684\u914d\u7f6e\u95ee\u9898\u5bfc\u81f4\u7684\uff0c\u4e14\u540e\u7eed\u4f1a\u63a5\u5165\u4e00\u952e\u6253tag\u5de5\u5177\n\n\u65b9\u6848\uff1a\u5728\u6267\u884c\u7edf\u4e00push\u524d\uff0c\u5bf9\u6240\u6709\u6a21\u5757\u7684\u9879\u76ee\u914d\u7f6e\u4fe1\u606f\u8fdb\u884c\u6821\u9a8c\uff0c\u786e\u4fdd\u6570\u636e\u89c4\u8303\uff1b\n\n## \u63d2\u4ef6\u6253\u5305\u53d1\u5e03\u547d\u4ee4\n\n**\u63d2\u4ef6\u6253\u5305\u547d\u4ee4**\n\n```\npoetry build\n```\n\n**\u63d2\u4ef6\u53d1\u5e03\u547d\u4ee4**\n\n```\npoetry publish\n```\n\n## vscode \u8c03\u8bd5\u914d\u7f6e ##\n\n```json\n{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"name\": \"i18n\",\n \"type\": \"python\",\n \"request\": \"launch\",\n \"pythonpath\": \"/Users/admin/Library/Caches/pypoetry/virtualenvs/tdf-tool-_Qh8vdX_-py3.11/bin/python\", // python\u8def\u5f84\n \"cwd\": \"${workspaceFolder}\",\n \"module\": \"poetry\",\n // \"justMyCode\": false,\n \"args\": [\n \"run\",\n \"tl\",\n \"i18n\",\n \"reflow\",\n \"start\",\n ]\n }\n ]\n}\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "\u4e8c\u7ef4\u706b flutter \u811a\u624b\u67b6\u5de5\u5177",
"version": "2.5.48",
"project_urls": {
"Homepage": "https://git.2dfire.net/app/flutter/tools/package_tools",
"Repository": "https://git.2dfire.net/app/flutter/tools/package_tools.git"
},
"split_keywords": [
"tdf",
" tdf-tool",
" tdf_tool"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0c645b62ea46894a29f7e4ac224d880e49c5f0418c934eaba7ae17f5e02b83ad",
"md5": "94dd7a23de873888cc1d2557ee52784e",
"sha256": "8325848e82b65a9ec9b9439ed5bc18fd6ecf5899ad1634d96d7b90f1454b71dd"
},
"downloads": -1,
"filename": "tdf_tool-2.5.48-py3-none-any.whl",
"has_sig": false,
"md5_digest": "94dd7a23de873888cc1d2557ee52784e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.9.0",
"size": 111813,
"upload_time": "2024-11-22T03:22:47",
"upload_time_iso_8601": "2024-11-22T03:22:47.424786Z",
"url": "https://files.pythonhosted.org/packages/0c/64/5b62ea46894a29f7e4ac224d880e49c5f0418c934eaba7ae17f5e02b83ad/tdf_tool-2.5.48-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c94ce271c5b38bc92f9b25fe867a484654f1403c5e69d25eb522ae81de9804e8",
"md5": "1085b26f0ff71bef2b260eb3ae84ed6c",
"sha256": "826010549d4cf4c4f3b57d8a8ea421e4136d6dcb8c807f12db9f0c1e52d68a3e"
},
"downloads": -1,
"filename": "tdf_tool-2.5.48.tar.gz",
"has_sig": false,
"md5_digest": "1085b26f0ff71bef2b260eb3ae84ed6c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.9.0",
"size": 441606,
"upload_time": "2024-11-22T03:22:49",
"upload_time_iso_8601": "2024-11-22T03:22:49.624517Z",
"url": "https://files.pythonhosted.org/packages/c9/4c/e271c5b38bc92f9b25fe867a484654f1403c5e69d25eb522ae81de9804e8/tdf_tool-2.5.48.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-22 03:22:49",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "tdf_tool"
}