@percy/cli-exec 1.28.3 → 1.28.4-beta.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/dist/exec.js CHANGED
@@ -2,9 +2,7 @@ import command from '@percy/cli-command';
2
2
  import start from './start.js';
3
3
  import stop from './stop.js';
4
4
  import ping from './ping.js';
5
- import { getPackageJSON } from '@percy/cli-command/utils';
6
5
  import { waitForTimeout } from '@percy/client/utils';
7
- const pkg = getPackageJSON(import.meta.url);
8
6
  export const exec = command('exec', {
9
7
  description: 'Start and stop Percy around a supplied command',
10
8
  usage: '[options] -- <command>',
@@ -112,7 +110,6 @@ async function* spawn(cmd, args, percy) {
112
110
  default: crossSpawn
113
111
  } = await import('cross-spawn');
114
112
  let proc, closed, error;
115
- let errorMessage = '';
116
113
  try {
117
114
  proc = crossSpawn(cmd, args, {
118
115
  stdio: 'pipe'
@@ -127,30 +124,20 @@ async function* spawn(cmd, args, percy) {
127
124
  process.stdin.pipe(proc.stdin);
128
125
  if (proc.stderr) {
129
126
  proc.stderr.on('data', data => {
130
- errorMessage += data.toString();
127
+ var _percy$log;
128
+ const message = data.toString();
129
+ let entry = {
130
+ message,
131
+ timestamp: Date.now(),
132
+ type: 'ci'
133
+ };
134
+ percy === null || percy === void 0 ? void 0 : (_percy$log = percy.log) === null || _percy$log === void 0 ? void 0 : _percy$log.error(entry, null, true);
131
135
  process.stderr.write(`${data}`);
132
136
  });
133
137
  }
134
138
  proc.on('error', err => error = err);
135
139
  proc.on('close', code => {
136
140
  closed = code;
137
- if (code !== 0) {
138
- // Only send cli error when PERCY_CLIENT_ERROR_LOGS is set to true
139
- if (process.env.PERCY_CLIENT_ERROR_LOGS === 'false') {
140
- errorMessage = 'Log sharing is disabled';
141
- }
142
- // Only send event when there is a global error code and
143
- // percy token is present
144
- if (process.env.PERCY_TOKEN) {
145
- var _percy$client, _percy$build3;
146
- const myObject = {
147
- errorKind: 'cli',
148
- cliVersion: pkg.version,
149
- message: errorMessage
150
- };
151
- percy === null || percy === void 0 ? void 0 : (_percy$client = percy.client) === null || _percy$client === void 0 ? void 0 : _percy$client.sendBuildEvents(percy === null || percy === void 0 ? void 0 : (_percy$build3 = percy.build) === null || _percy$build3 === void 0 ? void 0 : _percy$build3.id, myObject);
152
- }
153
- }
154
141
  });
155
142
 
156
143
  // run until an event is triggered
package/dist/start.js CHANGED
@@ -30,6 +30,7 @@ export const start = command('start', {
30
30
  // run until stopped or terminated
31
31
  yield* yieldFor(() => percy.readyState >= 3);
32
32
  } catch (error) {
33
+ log.error(error);
33
34
  await percy.stop(true);
34
35
  throw error;
35
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/cli-exec",
3
- "version": "1.28.3",
3
+ "version": "1.28.4-beta.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "tag": "latest"
12
+ "tag": "beta"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=14"
@@ -33,9 +33,9 @@
33
33
  ]
34
34
  },
35
35
  "dependencies": {
36
- "@percy/cli-command": "1.28.3",
36
+ "@percy/cli-command": "1.28.4-beta.0",
37
37
  "cross-spawn": "^7.0.3",
38
38
  "which": "^2.0.2"
39
39
  },
40
- "gitHead": "5d41045921c7ac06329c4b72caaf291d34e3f699"
40
+ "gitHead": "fe4d7e944acd2081d901eb2eed202ccb64098576"
41
41
  }