npm 中文文档 npm 中文文档
指南
npmjs.com (opens new window)
指南
npmjs.com (opens new window)
  • 快速入门

    • npm 是什么?
    • npm 安装和更新
    • npm 防止权限错误
    • npm package.json 文件
    • npm 安装包
    • npm 更新包
    • npm 卸载包
    • npm 创建 Node.js 模块
    • npm 发布和更新包
    • npm 使用语义化版本
    • npm 使用 Dist-tags 标记包
    • npm 包和模块的了解
  • 命令行
  • 配置 npm

Percy CLI


Test

The Percy CLI is used to interact with, and upload snapshots to, percy.io via the command line.

Installation
Command Topics
Advanced
Issues
Developing

Installation


  1. ``` session
  2. $ npm install --save-dev @percy/cli
  3. ```

Command Topics


percy exec - capture and upload snapshots
percy snapshot - snapshot a static directory or a list of pages
percy upload - upload a static directory of images
percy config - manage configuration files
percy build - interact with Percy builds

Advanced


In addition to the CLI packages, this repo contains core libraries responsible for Percy's CI/CD integrations, Percy API communication, DOM serialization, asset discovery, etc.

@percy/core - performs snapshot asset discovery and uploading
@percy/client - handles communicating with the Percy API
@percy/dom - serializes DOM snapshots
@percy/env - captures CI build environment variables
@percy/config - loads Percy configuration files
@percy/logger - common logger used throughout the CLI
@percy/sdk-utils - shared helpers for JavaScript SDKs
@percy/cli-command - Percy CLI command framework

Issues


For problems directly related to the CLI, add an issue onGitHub.

For other issues, open a supportrequest.

Developing


This project is built with lerna. The core libaries and CLI plugins are located in ./packages. Run yarn to install dependencies after cloning the repo and use the following scripts for various development tasks:

yarn build - build all packages

yarn build:watch - build and watch all packages in parallel

yarn clean - clean up build and coverage output

yarn lint - lint all packages

yarn readme - generate cli commands readme usage

yarn test - run all tests, one package after another

yarn test:coverage - run all tests with coverage, one package after another

yarn global:link - links all packages being developed as global.

requires yarn build to be run before consuming.
we can then consume this package using yarn link @percy/[core|cli..]
Note: linking is only required once, subsequent changes for development requires running build command.

yarn global:unlink - unlinks all packages globally

Individual package scripts can be invoked using yarn's workspace command. For example:

  1. ``` session
  2. $ yarn workspace @percy/core test
  3. ```

How to update Chromium revision?


check in Core Package's readme here.
Last Updated: 2023-09-02 10:22:36