skyline/docs/zh/develop/1-ready-to-work.md
Jingwei.Zhang 0213d8c6d6 feat: optimize configuration reading
Add config/config.yaml to set default configurations. Use the config/local_config.yaml to set the custom configurations

Change-Id: I22049e478b6440c765751c8f17663f36f33c277a
2023-05-31 11:41:19 +08:00

1.8 KiB
Raw Blame History

简体中文 | English

开发前准备

  • node 环境

    • package.json 中要求:"node": ">=10.22.0"

    • 验证 nodejs 版本

      node -v
      
  • yarn

    • 安装 yarn

      npm install -g yarn
      
  • 安装依赖包

    • 在项目根目录下执行,即package.json同级,需要耐心等待安装完成

      yarn install
      
  • 准备好可用的后端

    • 准备好可访问的后端,举个例子:https://172.20.154.250

    • 新增 config/local_config.yaml 中的 server 配置:

      server: https://172.20.154.250
      
  • 配置访问的 host 与 port

    • 默认配置在 config/config.yaml

      • host0.0.0.0
      • port8088
      • 如果当前配置无需变更,则下面的步骤无需操作
    • 新增 config/local_config.yaml

    • 添加 hostport 配置

      host: localhost
      port: 8080
      
  • 搭建完成

    • 在项目根目录下执行,即package.json同级

      yarn run dev
      
    • 使用 config/local_config.yamlconfig/config.yaml 中配置 的 hostport 访问即可,如http://localhost:8088

    • 开发使用的前端实时更新环境搞定。

生产环境使用的前端包

  • 具备符合要求的nodejsyarn

  • 在项目根目录下执行,即package.json同级

    yarn run build
    
  • 打包后的文件在dist目录,交给部署相关人员即可。

测试使用的前端包

  • 具备符合要求的nodejsyarn

  • 在项目根目录下执行,即package.json同级

    yarn run build:test
    
  • 打包后的文件在dist目录

  • 注意!!!这个测试包为了测出代码覆盖率的

  • 建议使用 nginx以完成带有代码覆盖率的 E2E 测试。