Bot Builder Community - JavaScript 扩展项目教程
1. 项目的目录结构及介绍
botbuilder-community-js/
├── libraries/
│ ├── botbuilder-storage-mssql/
│ │ ├── README.md
│ │ └── ...
│ └── ...
├── samples/
│ └── ...
├── .editorconfig
├── .eslintignore
├── .eslintrc.json
├── .gitignore
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── azure-pipelines.yml
└── lerna.json
目录结构介绍
- libraries/: 包含各种扩展库,如
botbuilder-storage-mssql
等。 - samples/: 包含示例代码,帮助用户理解如何使用这些扩展。
- .editorconfig: 编辑器配置文件,用于统一代码风格。
- .eslintignore: ESLint 忽略文件,指定哪些文件或目录不需要进行代码检查。
- .eslintrc.json: ESLint 配置文件,定义代码检查规则。
- .gitignore: Git 忽略文件,指定哪些文件或目录不需要被 Git 管理。
- CODEOWNERS: 代码所有者文件,指定哪些人对哪些文件负责。
- CODE_OF_CONDUCT.md: 行为准则文件,定义项目参与者的行为规范。
- LICENSE: 许可证文件,定义项目的开源许可证。
- README.md: 项目介绍文件,包含项目的基本信息和使用说明。
- azure-pipelines.yml: Azure Pipelines 配置文件,用于持续集成和部署。
- lerna.json: Lerna 配置文件,用于管理多包仓库。
2. 项目的启动文件介绍
项目中没有明确的“启动文件”,因为这是一个扩展库项目,而不是一个可以直接运行的应用程序。每个扩展库都有自己的入口文件,通常位于 libraries/
目录下的相应子目录中。
例如,botbuilder-storage-mssql
扩展库的入口文件可能是 libraries/botbuilder-storage-mssql/index.js
或 libraries/botbuilder-storage-mssql/src/index.js
。
3. 项目的配置文件介绍
.editorconfig
# 定义编辑器配置,统一代码风格
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
.eslintrc.json
{
"extends": "eslint:recommended",
"rules": {
"no-console": "off"
},
"env": {
"node": true,
"es6": true
}
}
lerna.json
{
"packages": [
"libraries/*"
],
"version": "independent"
}
azure-pipelines.yml
# Azure Pipelines 配置文件,用于持续集成和部署
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
这些配置文件分别用于定义编辑器风格、代码检查规则、多包管理以及持续集成和部署的配置。