@capawesome/cli 2.0.2 → 2.0.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [2.0.3](https://github.com/capawesome-team/cli/compare/v2.0.2...v2.0.3) (2025-08-26)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * `--version` was no longer supported ([526819b](https://github.com/capawesome-team/cli/commit/526819bebb2e5296380183fa4ec331b364376718))
11
+ * do not capture HTTP errors ([83f93e2](https://github.com/capawesome-team/cli/commit/83f93e21fc706e3245f349891e76501385dea03b))
12
+
5
13
  ## [2.0.2](https://github.com/capawesome-team/cli/compare/v2.0.1...v2.0.2) (2025-08-24)
6
14
 
7
15
 
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import updateService from './services/update.js';
4
4
  import { getMessageFromUnknownError } from './utils/error.js';
5
5
  import { defineConfig, processConfig, ZliError } from '@robingenz/zli';
6
6
  import * as Sentry from '@sentry/node';
7
+ import { AxiosError } from 'axios';
7
8
  import consola from 'consola';
8
9
  import pkg from '../package.json' with { type: 'json' };
9
10
  const config = defineConfig({
@@ -33,9 +34,12 @@ const config = defineConfig({
33
34
  },
34
35
  });
35
36
  const captureException = async (error) => {
36
- // Check if the error is from the CLI itself
37
+ // Ignore errors from the CLI itself (e.g. "No command found.")
37
38
  if (error instanceof ZliError) {
38
- // Ignore CLI errors like "No command found."
39
+ return;
40
+ }
41
+ // Ignore failed HTTP requests
42
+ if (error instanceof AxiosError) {
39
43
  return;
40
44
  }
41
45
  const environment = await configService.getValueForKey('ENVIRONMENT');
@@ -0,0 +1,33 @@
1
+ import { defineConfig, processConfig } from '@robingenz/zli';
2
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
3
+ import pkg from '../package.json' with { type: 'json' };
4
+ const config = defineConfig({
5
+ meta: {
6
+ name: pkg.name,
7
+ version: pkg.version,
8
+ description: pkg.description,
9
+ },
10
+ commands: {},
11
+ });
12
+ describe('CLI', () => {
13
+ let consoleSpy;
14
+ let processExitSpy;
15
+ beforeEach(() => {
16
+ consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
17
+ processExitSpy = vi.spyOn(process, 'exit').mockImplementation(() => undefined);
18
+ });
19
+ afterEach(() => {
20
+ vi.restoreAllMocks();
21
+ });
22
+ it('should display version when --version flag is used', () => {
23
+ try {
24
+ processConfig(config, ['--version']);
25
+ }
26
+ catch (error) {
27
+ // The processConfig function calls process.exit which we mock
28
+ // so we continue execution and check the mocks
29
+ }
30
+ expect(consoleSpy).toHaveBeenCalledWith(pkg.version);
31
+ expect(processExitSpy).toHaveBeenCalledWith(0);
32
+ });
33
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/cli",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -49,7 +49,7 @@
49
49
  ],
50
50
  "dependencies": {
51
51
  "@clack/prompts": "0.7.0",
52
- "@robingenz/zli": "0.1.4",
52
+ "@robingenz/zli": "0.1.5",
53
53
  "@sentry/node": "8.55.0",
54
54
  "archiver": "7.0.1",
55
55
  "axios": "1.8.4",