@percy/cli 1.0.0-beta.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,22 +1,20 @@
1
1
  # Percy CLI
2
2
 
3
- ![Test](https://github.com/percy/cli/workflows/Test/badge.svg)
3
+ [![Test](https://github.com/percy/cli/workflows/Test/badge.svg)](https://github.com/percy/cli/actions)
4
4
 
5
- The Percy CLI is used to capture and upload snapshots to [percy.io](https://percy.io) from the
6
- command line.
5
+ The Percy CLI is used to interact with, and upload snapshots to, [percy.io](https://percy.io) via
6
+ the command line.
7
7
 
8
- ## Installation
9
-
10
- Using yarn:
11
-
12
- ```sh-session
13
- $ yarn add @percy/cli --dev
14
- ```
8
+ - [Installation](#installation)
9
+ - [Command Topics](#command-topics)
10
+ - [Advanced](#advanced)
11
+ - [Issues](#issues)
12
+ - [Developing](#developing)
15
13
 
16
- Using npm:
14
+ ## Installation
17
15
 
18
16
  ```sh-session
19
- $ npm install @percy/cli --save-dev
17
+ $ npm install --save-dev @percy/cli
20
18
  ```
21
19
 
22
20
  ## Command Topics
@@ -30,33 +28,36 @@ $ npm install @percy/cli --save-dev
30
28
  ### Advanced
31
29
 
32
30
  In addition to the CLI packages, this repo contains core libraries responsible for Percy's CI/CD
33
- integrations, Percy API communication, DOM snapshotting, and asset discovery.
31
+ integrations, Percy API communication, DOM serialization, asset discovery, etc.
34
32
 
35
33
  - [`@percy/core`](./packages/core#readme) - performs snapshot asset discovery and uploading
36
- - [`@percy/config`](./packages/config#readme) - loads Percy configuration files
34
+ - [`@percy/client`](./packages/client#readme) - handles communicating with the Percy API
37
35
  - [`@percy/dom`](./packages/dom#readme) - serializes DOM snapshots
38
36
  - [`@percy/env`](./packages/env#readme) - captures CI build environment variables
39
- - [`@percy/client`](./packages/client#readme) - handles communicating with the Percy API
37
+ - [`@percy/config`](./packages/config#readme) - loads Percy configuration files
40
38
  - [`@percy/logger`](./packages/logger#readme) - common logger used throughout the CLI
39
+ - [`@percy/sdk-utils`](./packages/sdk-utils#readme) - shared helpers for JavaScript SDKs
40
+ - [`@percy/cli-command`](./packages/cli-command#readme) - Percy CLI command framework
41
41
 
42
42
  ## Issues
43
43
 
44
44
  For problems directly related to the CLI, [add an issue on
45
45
  GitHub](https://github.com/percy/cli/issues/new).
46
46
 
47
- For other issues, [open a support request](https://percy.io).
47
+ For other issues, [open a support
48
+ request](https://www.browserstack.com/contact?ref=percy#technical-support).
48
49
 
49
50
  ## Developing
50
51
 
51
52
  This project is built with [lerna](https://lerna.js.org/). The core libaries and CLI plugins are
52
- located in [./packages](./packages). Run `yarn` to install dependencies after cloning the repo and use
53
- the following scripts for various development tasks:
53
+ located in [./packages](./packages). Run `yarn` to install dependencies after cloning the repo and
54
+ use the following scripts for various development tasks:
54
55
 
55
56
  - `yarn build` - build all packages
56
57
  - `yarn build:watch` - build and watch all packages in parallel
57
58
  - `yarn clean` - clean up build and coverage output
58
59
  - `yarn lint` - lint all packages
59
- - `yarn readme` - generate oclif readme usage
60
+ - `yarn readme` - generate cli commands readme usage
60
61
  - `yarn test` - run all tests, one package after another
61
62
  - `yarn test:coverage` - run all tests with coverage, one package after another
62
63
 
@@ -66,12 +67,3 @@ Individual package scripts can be invoked using yarn's
66
67
  ```sh-session
67
68
  $ yarn workspace @percy/core test
68
69
  ```
69
-
70
- ### Releasing
71
-
72
- 1. Run `yarn bump-version` and choose an appropriate version.
73
- 2. Commit the updated version with a matching commit (e.g. `🔖v1.0.0`).
74
- 3. Push the commit to GitHub and wait for CI to pass.
75
- 4. Run `yarn -s release-notes` to generate release notes since the last tag.
76
- 5. Create a new GitHub release using the release notes.
77
- 6. The GitHub release will trigger an [automated NPM release](https://github.com/percy/cli/actions?query=workflow%3ARelease).
package/bin/run.cjs ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+
3
+ // ensure that we're running within a supported node version
4
+ if (parseInt(process.version.split('.')[0].substring(1), 10) < 14) {
5
+ console.error(`Node ${process.version} is not supported. Percy only ` + (
6
+ 'supports current LTS versions of Node. Please upgrade to Node 14+'));
7
+ process.exit(1);
8
+ }
9
+
10
+ import('../dist/index.js')
11
+ .then(async ({ percy, checkForUpdate }) => {
12
+ await checkForUpdate();
13
+ await percy(process.argv.slice(2));
14
+ });
package/package.json CHANGED
@@ -1,43 +1,43 @@
1
1
  {
2
2
  "name": "@percy/cli",
3
- "version": "1.0.0-beta.9",
3
+ "version": "1.0.0",
4
4
  "license": "MIT",
5
- "main": "index.js",
6
- "bin": {
7
- "percy": "bin/run"
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/percy/cli",
8
+ "directory": "packages/cli"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
8
12
  },
9
13
  "files": [
10
- "bin",
11
- "index.js",
12
- "oclif.manifest.json"
14
+ "./bin",
15
+ "./dist"
13
16
  ],
14
- "scripts": {
15
- "lint": "eslint --ignore-path ../../.gitignore .",
16
- "postbuild": "oclif-dev manifest"
17
+ "engines": {
18
+ "node": ">=14"
17
19
  },
18
- "publishConfig": {
19
- "access": "public"
20
+ "bin": {
21
+ "percy": "./bin/run.cjs"
20
22
  },
21
- "oclif": {
22
- "bin": "percy",
23
- "plugins": [
24
- "@percy/cli-config",
25
- "@percy/cli-exec",
26
- "@percy/cli-build",
27
- "@percy/cli-snapshot",
28
- "@percy/cli-upload",
29
- "@oclif/plugin-help",
30
- "@oclif/plugin-plugins"
31
- ]
23
+ "main": "./dist/index.js",
24
+ "exports": "./dist/index.js",
25
+ "type": "module",
26
+ "scripts": {
27
+ "build": "node ../../scripts/build",
28
+ "lint": "eslint --ignore-path ../../.gitignore .",
29
+ "test": "node ../../scripts/test",
30
+ "test:coverage": "yarn test --coverage"
32
31
  },
33
32
  "dependencies": {
34
- "@oclif/plugin-help": "^3.1.0",
35
- "@oclif/plugin-plugins": "^1.7.10",
36
- "@percy/cli-build": "^1.0.0-beta.9",
37
- "@percy/cli-config": "^1.0.0-beta.9",
38
- "@percy/cli-exec": "^1.0.0-beta.9",
39
- "@percy/cli-snapshot": "^1.0.0-beta.9",
40
- "@percy/cli-upload": "^1.0.0-beta.9"
33
+ "@percy/cli-build": "1.0.0",
34
+ "@percy/cli-command": "1.0.0",
35
+ "@percy/cli-config": "1.0.0",
36
+ "@percy/cli-exec": "1.0.0",
37
+ "@percy/cli-snapshot": "1.0.0",
38
+ "@percy/cli-upload": "1.0.0",
39
+ "@percy/client": "1.0.0",
40
+ "@percy/logger": "1.0.0"
41
41
  },
42
- "gitHead": "57a2eeb90c7f5cdf8827c78be1e5c12df581f4b5"
42
+ "gitHead": "6df509421a60144e4f9f5d59dc57a5675372a0b2"
43
43
  }
package/bin/run DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require('@oclif/command').run()
4
- .then(require('@oclif/command/flush'))
5
- .catch(require('@oclif/errors/handle'))
package/bin/run.cmd DELETED
@@ -1,3 +0,0 @@
1
- @echo off
2
-
3
- node "%~dp0\run" %*
package/index.js DELETED
@@ -1,2 +0,0 @@
1
- // This package is a multi-command oclif CLI composed of plugins that provide
2
- // various functionalities for taking Percy snapshots.