Skip to Content
微前端设计与实现
book

微前端设计与实现

by Luca Mezzalira
August 2022
Beginner to intermediate
270 pages
7h 38m
Chinese
Posts & Telecom Press
Content preview from 微前端设计与实现
144
7
版本控制
微前端仓库 安装依赖项
流水线初始化
克隆
微前端仓库
7-3:流水线初始化阶段的两个操作:克隆代码库和安装依赖项
快速克隆代码库非常重要。对于持续集成过程,我们不需要整个代码库的历史记录,因此
建议使用
depth
命令仅拉取最后一次提交,特别是采用
monorepo
方式时,代码库的大小
可能会快速增长。当版本控制系统中有很多历史记录的时候,使用
depth
命令会使克隆速
度大大提升。
git clone -–depth
[depth] [remote-url]
示例如下所示。
git clone -–depth 1 https://github.com/account/repository
7.1.3
 代码质量审查
在此阶段,我们将执行所有检查以确保代码符合公司标准。图
7-4
展示了从静态代码分析
到可视化回归测试的几个阶段。对于该项目,公司决定不仅使用单元测试和集成测试,还
希望确保代码具有长期可维护性,用户界面的集成遵循
UX
团队的设计指南
,在微前端中
开发公共库,并且遵循最小实现原则。
流水线初始化
克隆
微前端仓库
静态
代码分析
运行
集成测试
检查
必选模块
安装
依赖项
运行
单元测试
可视化
回归测试
构建
产物
代码质量审查 构建
7-4:代码质量审查包括单元测试、静态代码分析、可视化回归测试
ACME
公司使用
SonarQube
JavaScript
插件进行静态代码分析。它可以计算包括
循环复
杂度
cyclom
atic complexity
CYC
)在内的许多指标。循环复杂度指标可以帮助技术负责
人和架构师更好地了解团队的代码质量,针对项目的质量提供很多有用信息,但这一指标 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python语言及其应用(第2版)

Python语言及其应用(第2版)

Bill Lubanovic

Publisher Resources

ISBN: 9787115595089