diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 000000000..0d7e3838e --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,207 @@ +{ + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": false, + "contributors": [ + { + "login": "binggg", + "name": "Booker Zhao", + "avatar_url": "https://avatars2.githubusercontent.com/u/7686861?v=4", + "profile": "http://bookerzhao.com", + "contributions": [ + "infra", + "test", + "code", + "plugin" + ] + }, + { + "login": "starkwang", + "name": "Weijia Wang", + "avatar_url": "https://avatars0.githubusercontent.com/u/10933333?v=4", + "profile": "https://twitter.com/_WeijiaWang_", + "contributions": [ + "code" + ] + }, + { + "login": "chhpt", + "name": "hengechang", + "avatar_url": "https://avatars2.githubusercontent.com/u/19288423?v=4", + "profile": "https://github.com/chhpt", + "contributions": [ + "code", + "infra" + ] + }, + { + "login": "lt5c", + "name": "Zijie Zhou", + "avatar_url": "https://avatars0.githubusercontent.com/u/9676050?v=4", + "profile": "https://github.com/lt5c", + "contributions": [ + "code", + "plugin", + "talk" + ] + }, + { + "login": "qinmudi", + "name": "erikqin", + "avatar_url": "https://avatars1.githubusercontent.com/u/2224413?v=4", + "profile": "http://www.qinmudi.cn/", + "contributions": [ + "code", + "maintenance", + "example" + ] + }, + { + "login": "shenghanqin", + "name": "Hanqin", + "avatar_url": "https://avatars3.githubusercontent.com/u/6348297?v=4", + "profile": "https://www.xiaoxili.com/", + "contributions": [ + "bug" + ] + }, + { + "login": "zemzheng", + "name": "Zem", + "avatar_url": "https://avatars3.githubusercontent.com/u/650956?v=4", + "profile": "https://github.com/zemzheng", + "contributions": [ + "code" + ] + }, + { + "login": "magentaqin", + "name": "magenta", + "avatar_url": "https://avatars0.githubusercontent.com/u/30370223?v=4", + "profile": "https://github.com/magentaqin", + "contributions": [ + "blog", + "code" + ] + }, + { + "login": "SmartCodeDavid", + "name": "TIANXIANG LAN", + "avatar_url": "https://avatars0.githubusercontent.com/u/30002112?v=4", + "profile": "https://github.com/SmartCodeDavid", + "contributions": [ + "content" + ] + }, + { + "login": "fanyegong", + "name": "liyuanfeng", + "avatar_url": "https://avatars0.githubusercontent.com/u/12660343?v=4", + "profile": "https://github.com/fanyegong", + "contributions": [ + "code" + ] + }, + { + "login": "bestony", + "name": "白宦成", + "avatar_url": "https://avatars1.githubusercontent.com/u/13283837?v=4", + "profile": "https://www.ixiqin.com/", + "contributions": [ + "code" + ] + }, + { + "login": "yiliang114", + "name": "易良", + "avatar_url": "https://avatars0.githubusercontent.com/u/11473889?v=4", + "profile": "https://yiliang.site", + "contributions": [ + "code" + ] + }, + { + "login": "shryzhang", + "name": "Sherry Zhang", + "avatar_url": "https://avatars1.githubusercontent.com/u/18062954?v=4", + "profile": "https://github.com/shryzhang", + "contributions": [ + "code", + "blog" + ] + }, + { + "login": "Realybig", + "name": "RealyBig", + "avatar_url": "https://avatars3.githubusercontent.com/u/10878451?v=4", + "profile": "https://github.com/Realybig", + "contributions": [ + "code" + ] + }, + { + "login": "oe", + "name": "Saiya", + "avatar_url": "https://avatars2.githubusercontent.com/u/1655294?v=4", + "profile": "http://evecalm.com", + "contributions": [ + "talk", + "bug" + ] + }, + { + "login": "mirageql", + "name": "mirageql", + "avatar_url": "https://avatars1.githubusercontent.com/u/69442876?v=4", + "profile": "https://github.com/mirageql", + "contributions": [ + "code", + "blog" + ] + }, + { + "login": "TabSpace", + "name": "Tab Liang", + "avatar_url": "https://avatars0.githubusercontent.com/u/550449?v=4", + "profile": "https://github.com/TabSpace", + "contributions": [ + "code" + ] + }, + { + "login": "juukee", + "name": "juukee", + "avatar_url": "https://avatars0.githubusercontent.com/u/28680837?v=4", + "profile": "https://github.com/juukee", + "contributions": [ + "bug" + ] + }, + { + "login": "liulinboyi", + "name": "Albert Liu", + "avatar_url": "https://avatars1.githubusercontent.com/u/41336612?v=4", + "profile": "https://blog.heyliubo.top", + "contributions": [ + "code" + ] + }, + { + "login": "SearchFan", + "name": "SearchFan", + "avatar_url": "https://avatars1.githubusercontent.com/u/42856891?v=4", + "profile": "https://github.com/SearchFan", + "contributions": [ + "bug" + ] + } + ], + "contributorsPerLine": 7, + "projectName": "cloudbase-framework", + "projectOwner": "TencentCloudBase", + "repoType": "github", + "repoHost": "https://github.com", + "skipCi": true +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..2cd3daa6b --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.ts linguist-language=JavaScript diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..dd84ea782 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..bbcbbe7d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..3a4d0af5f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,9 @@ +Fixs # + +Changes in this pull request + +- +- +- + +@binggg diff --git a/.github/workflows/baseline-init.yml b/.github/workflows/baseline-init.yml new file mode 100644 index 000000000..631b54211 --- /dev/null +++ b/.github/workflows/baseline-init.yml @@ -0,0 +1,43 @@ +# This is a basic workflow to help you get started with Actions + +name: Baseline-Init + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [master] + pull_request: + branches: [master] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Install Deps + run: | + sudo npm install -g @cloudbase/cli@beta lerna@3.20.2 + cd scripts && npm install && cd .. + + - name: Login + run: cloudbase login --apiKeyId ${{ secrets.SECRET_ID }} --apiKey ${{ secrets.SECRET_KEY }} + + # Runs a set of commands using the runners shell + - name: Build + run: | + npm run bootstrap + npm run build + + # Runs a set of commands using the runners shell + - name: Init Template + run: | + sudo CLOUDBASE_FX_ENV=dev envId=${{ secrets.ENV_ID }} node scripts/local-e2e.js diff --git a/.github/workflows/deploy-json-schema.yml b/.github/workflows/deploy-json-schema.yml new file mode 100644 index 000000000..73c099b6c --- /dev/null +++ b/.github/workflows/deploy-json-schema.yml @@ -0,0 +1,36 @@ +# This is a basic workflow to help you get started with Actions + +name: Deploy JSON Schema + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [master] + tags: + - v* + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Install Deps + run: | + sudo npm install -g @cloudbase/cli@latest + - name: Login + run: cloudbase login --apiKeyId ${{ secrets.SECRET_ID }} --apiKey ${{ secrets.SECRET_KEY }} + + # Runs a set of commands using the runners shell + - name: Deploy Schema + run: | + cloudbase hosting:deploy -e ${{ secrets.ENV_ID }} packages/cloudbaserc-json-schema/dist/cloudbaserc-json-schema.json schema/${{github.ref}}.json + cloudbase hosting:deploy -e ${{ secrets.ENV_ID }} packages/cloudbaserc-json-schema/dist/cloudbaserc-json-schema.json schema/latest.json diff --git a/.gitignore b/.gitignore index b1918f5f6..4975cb724 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,15 @@ yarn-debug.log* yarn-error.log* lerna-debug.log* +# # 请不要追踪 lock 文件 +# npm 发布版本时不会携带 lock 文件 +# 不跟踪 lock 文件可以在持续集成时验证依赖的模块版本升级时的表现 +**/package-lock.json +package-lock.json + +**/yarn.lock +yarn.lock + # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..b6a72fe42 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "templates"] + path = templates + url = https://github.com/TencentCloudBase/cloudbase-templates diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..29f10f9e0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,184 @@ +# Changelog + +## [1.1.6] - 2020-09-15 + +### Bugfixes + +- 修复函数部署偶现失败的问题 + +## [1.0.1] - 2020-09-03 + +### Bugfixes + +- 修复部分版本机器创建文件夹失败的问题 + +## [1.0.0] - 2020-08-25 + +### Features + +- 新增 智能部署命令 @henghenchhptg +- 新增 基于 JSON Schema 的配置语法智能提示 +- 新增 Next 插件 (#70) @fanyegong +- 新增 Next SSR 应用模板 (#70) @fanyegong +- 支持 App Entrypoint +- Deno 插件应用进程改为默认使用 denon 来管理 (#69) @TabSpace +- Container 插件调整云应用最大副本数 + +## [0.9.0] - 2020-08-17 + +### Features + +- 新增 Deno 插件一键部署 Deno 应用(#63) @TabSpace +- 新增 Framework run 命令 (#68) @lt5c +- 新增 Deno 应用模板(#63) @TabSpace +- 新增 Taro 应用模板(#66) @qinmudi +- 支持自动检测和部署 Pagic 应用 (Deno 静态网站生成器) +- 优化 Container 插件部署错误日志信息 + +## [0.8.2] - 2020-08-13 + +### Features + +- Container 插件支持指定镜像/git 仓库地址来部署服务 + +## [0.8.0] - 2020-08-11 + +### Features + +- 新增 uni-app 应用模板(#59) @qinmudi +- 支持自动检测 Nuxt SSR 应用 +- Nuxt 插件支持自定义 npm 安装命令(#57) @Realybig + +### Bugfixes + +- 修复插件系统官方插件版本和内核版本不匹配的问题 +- 修复部分情况下 env 文件解析失败的问题 +- 修复 Node 插件在子目录下 package.json 路径问题 + +## [0.7.0] - 2020-07-28 + +### Features + +- Website 插件支持注入自定义环境变量 (#50) +- Website 插件自定义 pakcage 安装命令(#46) +- Node 插件支持 Vercel 类型应用(#49) +- Framework 内核支持自定义应用名 +- 支持自动检测 Koa 应用(#52) +- 配置文件模板变量支持从进程环境变量传入 +- 新增 Omi 应用模板 + +### Bugfixes + +- 修复 --verbose 参数输出 debug 日志失效的问题 +- 修复部分 node 版本和 os 版本无法创建插件仓库的问题 + +## [0.6.0] - 2020-07-28 + +### Features + +- cloudbaserc 配置文件支持模板变量 +- 支持指定模式 `mode` 来选择不同的配置 +- 提升插件安装和依赖安装速度 +- 支持自动检测 Dockerfile 项目生成云应用配置 +- 云应用插件支持注入环境变量 +- 支持自动检测 Hexo、Gatsbyjs 项目 + +### Bugfixes + +- 修复了函数插件修复默认参数不符的问题 +- 修复了设置 HTTPS_PROXY 代理未生效的问题 + +## [0.5.0] - 2020-07-23 + +### Features + +- Node 插件支持 Egg 框架部署 + +## [0.4.1] - 2020-07-22 + +### Bugfixes + +- Node 插件优化对依赖的处理 +- 修复了 Node8 下运行异常的问题 +- 修复了 Website 插件 `ignore` 选项失效的问题 + +## [0.4.0] - 2020-07-13 + +### Features + +- Node 插件支持异步 app(支持 Nest 应用/Next SSR 场景) +- Node 插件支持非项目根目录 Node 应用 +- 新增 Nest 应用模板 + +### Bugfixes + +- Node 插件修复不支持应用当前目录存在 index 文件的 bug + +## [0.3] - 2020-06-28 + +### Features + +- 新增 Database 插件支持声明式部署云数据库集合 +- Node 插件函数模式新增 VPC、环境变量等高级配置 +- Dart 应用模板新增集成云开发 Dart 服务端 SDK +- 新增 React 全栈应用示例模板(静态网站+云函数+云数据库) +- 框架插件系统支持本地构建和本地测试 + +## [0.3.1] - 2020-07-01 + +### Bugfixes + +- 修复包年包月环境部署非网站资源报错的问题 +- 修复数据库插件创建索引失败的问题 + +## [0.3] - 2020-06-28 + +### Features + +- 新增 Database 插件支持声明式部署云数据库集合 +- Node 插件函数模式新增 VPC、环境变量等高级配置 +- Dart 应用模板新增集成云开发 Dart 服务端 SDK +- 新增 React 全栈应用示例模板(静态网站+云函数+云数据库) +- 框架插件系统支持本地构建和本地测试 + +### Docs + +- 新增开发贡献指南 + +### Bugfixes + +- 修复自动检测框架模式下修改默认参数保存异常的问题 + +## [0.2] - 2020-06-19 + +### Features + +- 新增 Container 插件支持云应用部署 +- Node 插件新增支持函数和云应用两种模式部署 +- 新增 Dart 插件,支持部署 Flutter 后端 Dart 云应用 +- 新增 Node.js 云应用模板 +- 新增 Aqueduct (Dart Server) 云应用模板 +- 新增 2 套 React 全栈应用模板 + +### Bugfixes + +- 修复 Windows 命令行显示的问题 +- 修复子目录初始化项目配置路径寻址的问题 + +## [0.1] - 2020-06-09 + +### Features + +- 实现 Framework Core 功能 +- 支持插件机制 +- 支持自动检测框架和语言生成插件配置 +- 新增 Webstie 插件支持静态网站部署 +- 新增 Node 插件支持函数方式部署 Node 应用 +- 新增 Nuxt 插件支持 Nuxt SSR 项目 +- 新增 Vue 应用模板 +- 新增 VuePress 应用模板 +- 新增 Nuxt SPA 应用模板 +- 新增 Nuxt SSR 应用模板 +- 新增 Koa 应用模板 +- 新增 Express 应用模板 +- 新增 Node.js、PHP、Java 函数应用模板 diff --git a/CLI_GUIDE.md b/CLI_GUIDE.md new file mode 100644 index 000000000..23413e2f3 --- /dev/null +++ b/CLI_GUIDE.md @@ -0,0 +1,101 @@ +# CloudBase CLI 命令行工具使用指南 + +## 1. 开通云开发环境 + +开发者可以根据下面的身份角色参考指引进行开通和创建。 + +- [微信小程序开发者](#wx-miniprogram) +- [腾讯云开发者](#tencent-cloud) +- [QQ 小程序开发者](#qq-miniprogram) + +#### 微信小程序开发者 + +##### 开通云开发环境 + +- 注册小程序账号:在微信公共平台进行申请并提交相应资料。[前往注册](https://mp.weixin.qq.com/) +- 下载微信开发者工具:简单高效地开发和调试小程序,并可预览和发布。 [前往下载](https://developers.weixin.qq.com/miniprogram/dev/devtools/nightly.html) +- 开通云开发:在开发者工具中点击“云开发” 按钮开通,开通后会自动开通环境 + +##### 切换按量计费 + +- 下载最新的[ Nightly Build 版本的微信开发者工具](https://developers.weixin.qq.com/miniprogram/dev/devtools/nightly.html), 登录微信开发者工具-云开发控制台 + +- 在【云开发控制台】-【设置】-【环境设置】-【支付方式】中点击切换【按量付费】即可。 + +注意:这里需要先保证腾讯云账户中是有充值金额的哦~ + +![](https://main.qcloudimg.com/raw/bc4f7048d2bf3e85e4adf46cc8f2cb1c.png) + +#### 腾讯云开发者 + +##### 开通并创建按量付费环境 + +- 注册腾讯云账号,并完成实名认证 + +- 进入[云开发控制台](https://console.cloud.tencent.com/tcb),授权开通云开发 + +- 点击进入控制台[创建按量计费环境](https://console.cloud.tencent.com/tcb/env/index?action=CreateEnv)(温馨提示,无资源消耗时,按量计费不产生任何费用) + +##### 切换包年包月计费方式为按量计费 + +如果已经开通过云开发环境,需要在计费模式中切换计费方式为按量计费 + +- 登录腾讯云云开发控制台 + +- 在[云开发 CloudBase 控制台-环境-资源购买](https://console.cloud.tencent.com/tcb/env/resource) 中的【计费模式】中点击【切换按量付费】即可。 + +![](https://main.qcloudimg.com/raw/3d01c3ab51c8bc195c6ea8d435363ad5.jpg) + +#### QQ 小程序开发者 + +##### 开通环境 + +在 QQ 小程序开发者工具工具栏左侧,点击 “云开发” 按钮即可打开云控制台、根据提示开通云开发、创建云环境 + +##### 切换为按量计费 + +- 在[云开发 CloudBase 控制台-环境-资源购买](https://console.cloud.tencent.com/tcb/env/resource) 中的【计费模式】中点击【切换按量付费】即可。 + +![](https://main.qcloudimg.com/raw/3d01c3ab51c8bc195c6ea8d435363ad5.jpg) + + + +注:首次开通云开发环境后,需等待大约 3 分钟方可正常使用 + +## 2.下载安装云开发命令行工具 + +云开发官方提供命令行工具(CLI):cloudbase/cli。可以使用 CLI 进行云开发资源管控、函数部署等。下面是安装过程: + +**第 1 步:确保安装了 Node.js 和 npm** +如果本机没有安装 Node.js , 建议从[ **Node.js 官网**](https://nodejs.org/zh-cn/)下载二进制文件直接安装,建议选择版本为 LTS。 + +**第 2 步:安装 cloudbase/cli** +现在,可以使用 npm 来安装 cloudbase/cli 了,打开命令行终端,输入如下命令: + +```bash +npm i -g @cloudbase/cli +``` + +**第 3 步:测试安装是否成功**
如果安装过程没有错误提示,一般就是安装成功了。下面,我们可以继续输入命令: + +```bash +cloudbase -v +``` + +如果看到输出版本号,说明已经安装成功。 + +## 3. 登录云开发 + +在命令行输入命令 + +```bash +cloudbase login +``` + +在打开的浏览器页面内完成登录腾讯云控制台进行授权 + +登录方式请选择微信公众号登录,使用自己的小程序账号进行登录授权 + +![](https://main.qcloudimg.com/raw/f3b7cbdc3d8ca3f3c212203a4b84782a.png) + +在登录完成后,在云开发授权页面点击授权 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..55f8fdf98 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at bookerzhao@tencent.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..55645ab7c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,147 @@ +# CloudBase Framework 开发贡献指南 + +## 成为贡献者 + +感谢您有兴趣成为 CloudBase Framework 社区贡献者! + +您可以选择如下的贡献方式: + +- [贡献一篇技术文章](./community/posts/README.md) +- 贡献代码,提交 Pull Request +- 反馈 bug,提交 Issue +- 在技术会议上发表技术演讲 + +我们会将您加入[我们的贡献者名单](https://github.com/TencentCloudBase/cloudbase-framework#contributors-) + +## 开发脚本 + +### 本地开发 + +```bash +npm install +npm run bootstrap +npm run dev +``` + +### 本地测试框架和插件 + +```bash +npm run link +# 在项目中使用本地框架 +CLOUDBASE_FX_ENV=dev cloudbase framework:deploy +``` + +### 执行完整端到端部署测试 + +下面的脚本会将 CloudBase CLI 支持的模板逐一进行部署 + +```bash +# 注意 $SecretId $SecretKey $EnvId 需要换成真实的值 +cloudbase login --apiKeyId $SecretId --apiKey $SecretKey +npm install +npm run bootstrap +npm run build +CLOUDBASE_FX_ENV=dev envId=$EnvId node scripts/local-e2e.js +``` + +## 提交代码规范 + +遵循`Angular`提出的[Angular 提交信息规范](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines) + +请使用 `npm run commit` 进行提交代码,提交格式如下: + + (): + + + +