@vizzly-testing/cli 0.7.2 → 0.8.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 +1 -1
- package/dist/commands/upload.js +3 -1
- package/dist/sdk/index.js +1 -1
- package/dist/services/api-service.js +6 -1
- package/dist/types/sdk/index.d.ts +1 -1
- package/dist/utils/config-loader.js +1 -1
- package/dist/utils/console-ui.js +2 -1
- package/dist/utils/environment-config.js +1 -1
- package/docs/api-reference.md +1 -1
- package/docs/doctor-command.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -368,7 +368,7 @@ Check if Vizzly is enabled in the current environment.
|
|
|
368
368
|
|
|
369
369
|
### Core Configuration
|
|
370
370
|
- `VIZZLY_TOKEN`: API authentication token. Example: `export VIZZLY_TOKEN=your-token`.
|
|
371
|
-
- `VIZZLY_API_URL`: Override API base URL. Default: `https://vizzly.dev`.
|
|
371
|
+
- `VIZZLY_API_URL`: Override API base URL. Default: `https://app.vizzly.dev`.
|
|
372
372
|
- `VIZZLY_LOG_LEVEL`: Logger level. One of `debug`, `info`, `warn`, `error`. Example: `export VIZZLY_LOG_LEVEL=debug`.
|
|
373
373
|
|
|
374
374
|
### Parallel Builds
|
package/dist/commands/upload.js
CHANGED
|
@@ -190,7 +190,9 @@ export async function uploadCommand(screenshotsPath, options = {}, globalOptions
|
|
|
190
190
|
// Silent fail on cleanup
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
// Use user-friendly error message if available
|
|
194
|
+
const errorMessage = error?.getUserMessage ? error.getUserMessage() : error.message;
|
|
195
|
+
ui.error(errorMessage || 'Upload failed', error);
|
|
194
196
|
}
|
|
195
197
|
}
|
|
196
198
|
|
package/dist/sdk/index.js
CHANGED
|
@@ -30,7 +30,7 @@ import { VizzlyError } from '../errors/vizzly-error.js';
|
|
|
30
30
|
*
|
|
31
31
|
* const vizzly = await createVizzly({
|
|
32
32
|
* apiKey: process.env.VIZZLY_TOKEN,
|
|
33
|
-
* apiUrl: 'https://vizzly.dev',
|
|
33
|
+
* apiUrl: 'https://app.vizzly.dev',
|
|
34
34
|
* server: {
|
|
35
35
|
* port: 3003,
|
|
36
36
|
* enabled: true
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { URLSearchParams } from 'url';
|
|
7
|
-
import { VizzlyError } from '../errors/vizzly-error.js';
|
|
7
|
+
import { VizzlyError, AuthError } from '../errors/vizzly-error.js';
|
|
8
8
|
import crypto from 'crypto';
|
|
9
9
|
import { getPackageVersion } from '../utils/package-info.js';
|
|
10
10
|
import { getApiUrl, getApiToken, getUserAgent } from '../utils/environment-config.js';
|
|
@@ -58,6 +58,11 @@ export class ApiService {
|
|
|
58
58
|
} catch {
|
|
59
59
|
// ignore
|
|
60
60
|
}
|
|
61
|
+
|
|
62
|
+
// Handle authentication errors with user-friendly messages
|
|
63
|
+
if (response.status === 401) {
|
|
64
|
+
throw new AuthError('Invalid or expired API token. Please check your VIZZLY_TOKEN environment variable and ensure it is valid.');
|
|
65
|
+
}
|
|
61
66
|
throw new VizzlyError(`API request failed: ${response.status}${errorText ? ` - ${errorText}` : ''} (URL: ${url})`);
|
|
62
67
|
}
|
|
63
68
|
return response.json();
|
|
@@ -64,7 +64,7 @@ export async function loadConfig(configPath = null, cliOverrides = {}) {
|
|
|
64
64
|
const envApiUrl = getApiUrl();
|
|
65
65
|
const envParallelId = getParallelId();
|
|
66
66
|
if (envApiKey) config.apiKey = envApiKey;
|
|
67
|
-
if (envApiUrl !== 'https://vizzly.dev') config.apiUrl = envApiUrl;
|
|
67
|
+
if (envApiUrl !== 'https://app.vizzly.dev') config.apiUrl = envApiUrl;
|
|
68
68
|
if (envParallelId) config.parallelId = envParallelId;
|
|
69
69
|
|
|
70
70
|
// 3. Apply CLI overrides (highest priority)
|
package/dist/utils/console-ui.js
CHANGED
|
@@ -43,9 +43,10 @@ export class ConsoleUI {
|
|
|
43
43
|
timestamp: new Date().toISOString()
|
|
44
44
|
};
|
|
45
45
|
if (error instanceof Error) {
|
|
46
|
+
const errorMessage = error.getUserMessage ? error.getUserMessage() : error.message;
|
|
46
47
|
errorData.error = {
|
|
47
48
|
name: error.name,
|
|
48
|
-
message:
|
|
49
|
+
message: errorMessage,
|
|
49
50
|
...(this.verbose && {
|
|
50
51
|
stack: error.stack
|
|
51
52
|
})
|
package/docs/api-reference.md
CHANGED
|
@@ -470,7 +470,7 @@ Configuration loaded via cosmiconfig in this order:
|
|
|
470
470
|
{
|
|
471
471
|
// API Configuration
|
|
472
472
|
apiKey: string, // API token (from VIZZLY_TOKEN)
|
|
473
|
-
apiUrl: string, // API base URL (default: 'https://vizzly.dev')
|
|
473
|
+
apiUrl: string, // API base URL (default: 'https://app.vizzly.dev')
|
|
474
474
|
project: string, // Project ID override
|
|
475
475
|
|
|
476
476
|
// Server Configuration (for run command)
|
package/docs/doctor-command.md
CHANGED
|
@@ -30,7 +30,7 @@ vizzly doctor --json
|
|
|
30
30
|
|
|
31
31
|
## Environment Variables
|
|
32
32
|
|
|
33
|
-
- `VIZZLY_API_URL` — Override the API base URL (default: `https://vizzly.dev`)
|
|
33
|
+
- `VIZZLY_API_URL` — Override the API base URL (default: `https://app.vizzly.dev`)
|
|
34
34
|
- `VIZZLY_TOKEN` — API token used only when `--api` is provided
|
|
35
35
|
|
|
36
36
|
## Exit Codes
|