@swell/cli 2.9.33 → 2.9.35

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.
@@ -5,6 +5,7 @@ import Conf from 'conf';
5
5
  import * as fs from 'node:fs/promises';
6
6
  import * as path from 'node:path';
7
7
  const schema = {
8
+ ai: { type: 'object' },
8
9
  compatibilities: { type: 'object' },
9
10
  description: { type: 'string' },
10
11
  extensions: { type: 'array' },
@@ -9,6 +9,9 @@ export declare const PUSH_CONCURRENCY = 3;
9
9
  * configuration that developers define.
10
10
  */
11
11
  export interface App {
12
+ ai?: {
13
+ description: string;
14
+ } | null;
12
15
  categories?: string[];
13
16
  client?: any;
14
17
  client_id?: string;
@@ -112,6 +115,7 @@ export interface AppConflict {
112
115
  type: 'app' | 'integration';
113
116
  }
114
117
  export declare enum SwellJsonFields {
118
+ AI = "ai",
115
119
  DESCRIPTION = "description",
116
120
  EXTENSIONS = "extensions",
117
121
  ID = "id",
@@ -22,6 +22,7 @@ export function sameIntegrations(a, b) {
22
22
  }
23
23
  export var SwellJsonFields;
24
24
  (function (SwellJsonFields) {
25
+ SwellJsonFields["AI"] = "ai";
25
26
  SwellJsonFields["DESCRIPTION"] = "description";
26
27
  SwellJsonFields["EXTENSIONS"] = "extensions";
27
28
  SwellJsonFields["ID"] = "id";
@@ -4,9 +4,11 @@ import { filePathExistsAsync, writeFile } from '../apps/index.js';
4
4
  import { APPS_SDK_VERSION } from './component.js';
5
5
  import { mockRequestTemplate, setupGlobalsTemplate, tsconfigTemplate, unitTestTemplate, vitestConfigTemplate, } from './tests/templates/index.js';
6
6
  const TEST_DEV_DEPENDENCIES = {
7
- // npm 10 cannot resolve vitest 4.1 next to the plugin; vitest 5 needs Node 22.12 or later
7
+ // npm 10 cannot resolve vitest 4.1 next to the plugin; vitest 5 needs Node 22.12 or later.
8
+ // npm 10 also crashes ("reading 'edgesOut'") on vitest 5.0 since 5.1.0 came out: vitest's
9
+ // optional peers (@vitest/browser-*) resolve to 5.1, which wants vitest 5.1
8
10
  '@cloudflare/vitest-plugin': '1.4.x',
9
- vitest: '5.0.x',
11
+ vitest: '5.1.x',
10
12
  '@swell/app-types': 'latest',
11
13
  '@swell/apps-sdk': APPS_SDK_VERSION,
12
14
  };
@@ -52,10 +52,9 @@ export class LoggedItem {
52
52
  break;
53
53
  }
54
54
  case 'api': {
55
- request = [
56
- style.logMethod(logMessage.method.toUpperCase()),
57
- logMessage.url,
58
- ].join(' ');
55
+ request = [methodLabel(logMessage.method), logMessage.url]
56
+ .filter(Boolean)
57
+ .join(' ');
59
58
  break;
60
59
  }
61
60
  default: {
@@ -87,7 +86,7 @@ export class LoggedItem {
87
86
  const { event } = logMessage;
88
87
  const { logs, method, name } = logMessage;
89
88
  const logLines = this.prepareConsoleLines(logs);
90
- return `Function ${event ? `${event.hook ? `${event.hook}:` : ''}${event.type} >` : ''} ${style.logMethod(method.toUpperCase())} /${name} ${logLines ? `\n${logLines}` : ''}`;
89
+ return `Function ${event ? `${event.hook ? `${event.hook}:` : ''}${event.type} >` : ''} ${methodLabel(method)} /${name} ${logLines ? `\n${logLines}` : ''}`;
91
90
  }
92
91
  prepareConsoleLines(logs) {
93
92
  return logs
@@ -111,3 +110,11 @@ export class LoggedItem {
111
110
  .join('\n');
112
111
  }
113
112
  }
113
+ /**
114
+ * A request method for display; some entries, such as hook rejections, have none.
115
+ * @param {unknown} method the logged method
116
+ * @returns {string} the styled method, or an empty string
117
+ */
118
+ function methodLabel(method) {
119
+ return method ? style.logMethod(String(method).toUpperCase()) : '';
120
+ }
@@ -3991,5 +3991,5 @@
3991
3991
  ]
3992
3992
  }
3993
3993
  },
3994
- "version": "2.9.33"
3994
+ "version": "2.9.35"
3995
3995
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swell/cli",
3
- "version": "2.9.33",
3
+ "version": "2.9.35",
4
4
  "type": "module",
5
5
  "description": "Swell's command line interface/utility",
6
6
  "keywords": [