@percy/cli-exec 1.9.0 → 1.10.1

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
@@ -18,19 +18,19 @@ Usage:
18
18
  $ percy exec [options] -- <command>
19
19
 
20
20
  Subcommands:
21
- exec:start [options] Starts a local Percy snapshot server
22
- exec:stop [options] Stops a local running Percy snapshot server
23
- exec:ping [options] Pings a local running Percy snapshot server
21
+ exec:start [options] Starts a locally running Percy process
22
+ exec:stop [options] Stops a locally running Percy process
23
+ exec:ping [options] Pings a locally running Percy process
24
24
  help [command] Display command help
25
25
 
26
26
  Options:
27
- -P, --port [number] Local CLI server port (default: 5338)
28
27
  --parallel Marks the build as one of many parallel builds
29
28
  --partial Marks the build as a partial build
30
29
 
31
30
  Percy options:
32
31
  -c, --config <file> Config file path
33
32
  -d, --dry-run Print snapshot names only
33
+ -P, --port [number] Local CLI server port (default: 5338)
34
34
  -h, --allowed-hostname <hostname> Allowed hostnames to capture in asset discovery
35
35
  --disallowed-hostname <hostname> Disallowed hostnames to abort in asset discovery
36
36
  -t, --network-idle-timeout <ms> Asset discovery network idle timeout
@@ -50,18 +50,16 @@ Examples:
50
50
 
51
51
  ### `percy exec:start`
52
52
 
53
- Starts a local Percy snapshot server
53
+ Starts a locally running Percy process
54
54
 
55
55
  ```
56
56
  Usage:
57
57
  $ percy exec:start [options]
58
58
 
59
- Options:
60
- -P, --port [number] Local CLI server port (default: 5338)
61
-
62
59
  Percy options:
63
60
  -c, --config <file> Config file path
64
61
  -d, --dry-run Print snapshot names only
62
+ -P, --port [number] Local CLI server port (default: 5338)
65
63
  -h, --allowed-hostname <hostname> Allowed hostnames to capture in asset discovery
66
64
  --disallowed-hostname <hostname> Disallowed hostnames to abort in asset discovery
67
65
  -t, --network-idle-timeout <ms> Asset discovery network idle timeout
@@ -80,13 +78,13 @@ Examples:
80
78
 
81
79
  ### `percy exec:stop`
82
80
 
83
- Stops a local running Percy snapshot server
81
+ Stops a locally running Percy process
84
82
 
85
83
  ```
86
84
  Usage:
87
85
  $ percy exec:stop [options]
88
86
 
89
- Options:
87
+ Percy options:
90
88
  -P, --port [number] Local CLI server port (default: 5338)
91
89
 
92
90
  Global options:
@@ -98,13 +96,13 @@ Global options:
98
96
 
99
97
  ### `percy exec:ping`
100
98
 
101
- Pings a local running Percy snapshot server
99
+ Pings a locally running Percy process
102
100
 
103
101
  ```
104
102
  Usage:
105
103
  $ percy exec:ping [options]
106
104
 
107
- Options:
105
+ Percy options:
108
106
  -P, --port [number] Local CLI server port (default: 5338)
109
107
 
110
108
  Global options:
package/dist/exec.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import command from '@percy/cli-command';
2
- import * as common from './common.js';
3
2
  import start from './start.js';
4
3
  import stop from './stop.js';
5
4
  import ping from './ping.js';
@@ -7,7 +6,7 @@ export const exec = command('exec', {
7
6
  description: 'Start and stop Percy around a supplied command',
8
7
  usage: '[options] -- <command>',
9
8
  commands: [start, stop, ping],
10
- flags: [...common.flags, {
9
+ flags: [{
11
10
  name: 'parallel',
12
11
  description: 'Marks the build as one of many parallel builds',
13
12
  parse: () => {
@@ -23,6 +22,10 @@ export const exec = command('exec', {
23
22
 
24
23
  return !!((_process$env2 = process.env).PERCY_PARTIAL_BUILD || (_process$env2.PERCY_PARTIAL_BUILD = '1'));
25
24
  }
25
+ }, {
26
+ name: 'testing',
27
+ percyrc: 'testing',
28
+ hidden: true
26
29
  }],
27
30
  examples: ['$0 -- echo "percy is running around this echo command"', '$0 -- yarn test'],
28
31
  loose: ['Warning: Missing command separator (--),', 'some command options may not work as expected'].join(' '),
@@ -37,6 +40,8 @@ export const exec = command('exec', {
37
40
  log,
38
41
  exit
39
42
  }) {
43
+ var _percy$build;
44
+
40
45
  let [command, ...args] = argv; // command is required
41
46
 
42
47
  if (!command) {
@@ -72,6 +77,7 @@ export const exec = command('exec', {
72
77
 
73
78
 
74
79
  env.PERCY_SERVER_ADDRESS = percy === null || percy === void 0 ? void 0 : percy.address();
80
+ env.PERCY_BUILD_ID = percy === null || percy === void 0 ? void 0 : (_percy$build = percy.build) === null || _percy$build === void 0 ? void 0 : _percy$build.id;
75
81
  env.PERCY_LOGLEVEL = log.loglevel(); // run the provided command
76
82
 
77
83
  log.info(`Running "${[command, ...args].join(' ')}"`);
package/dist/ping.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import command from '@percy/cli-command';
2
- import * as common from './common.js';
2
+ import flags from '@percy/cli-command/flags';
3
3
  export const ping = command('ping', {
4
- description: 'Pings a local running Percy snapshot server',
5
- flags: common.flags,
4
+ description: 'Pings a locally running Percy process',
5
+ flags: [flags.port],
6
6
  percy: true
7
7
  }, async ({
8
8
  flags,
package/dist/start.js CHANGED
@@ -1,8 +1,6 @@
1
1
  import command from '@percy/cli-command';
2
- import * as common from './common.js';
3
2
  export const start = command('start', {
4
- description: 'Starts a local Percy snapshot server',
5
- flags: common.flags,
3
+ description: 'Starts a locally running Percy process',
6
4
  examples: ['$0 &> percy.log'],
7
5
  percy: {
8
6
  server: true
package/dist/stop.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import command from '@percy/cli-command';
2
- import * as common from './common.js';
2
+ import flags from '@percy/cli-command/flags';
3
3
  export const stop = command('stop', {
4
- description: 'Stops a local running Percy snapshot server',
5
- flags: common.flags,
4
+ description: 'Stops a locally running Percy process',
5
+ flags: [flags.port],
6
6
  percy: true
7
7
  }, async ({
8
8
  flags,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/cli-exec",
3
- "version": "1.9.0",
3
+ "version": "1.10.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,9 +32,9 @@
32
32
  ]
33
33
  },
34
34
  "dependencies": {
35
- "@percy/cli-command": "1.9.0",
35
+ "@percy/cli-command": "1.10.1",
36
36
  "cross-spawn": "^7.0.3",
37
37
  "which": "^2.0.2"
38
38
  },
39
- "gitHead": "3332a2a63802c58848d0a5fbdd3c7aadc076212b"
39
+ "gitHead": "3e16144300e8b49aab638ceb699630f4be71bb9f"
40
40
  }
package/dist/common.js DELETED
@@ -1,14 +0,0 @@
1
- export const flags = [{
2
- name: 'port',
3
- description: 'Local CLI server port',
4
- env: 'PERCY_SERVER_PORT',
5
- percyrc: 'port',
6
- type: 'number',
7
- parse: Number,
8
- default: 5338,
9
- short: 'P'
10
- }, {
11
- name: 'testing',
12
- percyrc: 'testing',
13
- hidden: true
14
- }];