@devicecloud.dev/dcd 5.4.1-beta.1 → 5.5.0-beta.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.
@@ -21,7 +21,7 @@ import { isEncryptionEnabled } from '../utils/envelope.js';
21
21
  import { detectCiContext, isCI } from '../utils/ci.js';
22
22
  import { CliError, coerceArray, collectRepeatedFlag, getCliVersion, getUpgradeCommand, logger, parseIntFlag, validateEnum, } from '../utils/cli.js';
23
23
  import { fetchCompatibilityData, } from '../utils/compatibility.js';
24
- import { renderNotices } from '../services/notices.service.js';
24
+ import { platformFromAppFile, renderNotices } from '../services/notices.service.js';
25
25
  import { resolveApiUrl } from '../utils/config-store.js';
26
26
  import { downloadExpoUrl, extractTarGz, findAppBundle, isUrl } from '../utils/expo.js';
27
27
  import { colors, formatId, formatUrl, getConsoleUrl, } from '../utils/styling.js';
@@ -323,13 +323,28 @@ export const cloudCommand = defineCommand({
323
323
  // returned with the compatibility data. Replaces the previously hardcoded
324
324
  // iOS-16 deprecation warning — that is now a seeded notice gated on the
325
325
  // selected iOS version below. Honours --json via out/warnOut.
326
- renderNotices(compatibilityData.notices, {
326
+ const visibleNotices = renderNotices(compatibilityData.notices, {
327
+ platform: platformFromAppFile(finalAppFile),
327
328
  ios_version: iOSVersion,
329
+ ios_device: iOSDevice,
328
330
  android_api_level: androidApiLevel,
331
+ android_device: androidDevice,
332
+ // Resolved (what the run will use) and requested (undefined when the
333
+ // customer relied on the default), so a notice can target either.
334
+ maestro_version: resolvedMaestroVersion,
335
+ requested_maestro_version: maestroVersion,
329
336
  cli_version: cliVersion,
330
337
  ci_provider: ciContext.provider,
331
338
  ci_wrapper_version: ciContext.wrapperVersion,
332
339
  }, { out });
340
+ // --json suppresses the rendered lines, so the payload carries them instead.
341
+ const noticesForJson = visibleNotices.map((n) => ({
342
+ slug: n.slug,
343
+ level: n.level,
344
+ title: n.title,
345
+ body: n.body,
346
+ learnMoreUrl: n.learnMoreUrl,
347
+ }));
333
348
  deviceValidationService.validateAndroidDevice(androidApiLevel, androidDevice, googlePlay, compatibilityData, { debug, logger: (m) => out(m) });
334
349
  // Validate every device-matrix cell up front — each on its own, against
335
350
  // the same compatibility matrix — so an unsupported cell fails fast,
@@ -670,6 +685,7 @@ export const cloudCommand = defineCommand({
670
685
  tags: testMetadataMap[r.test_file_name]?.tags || [],
671
686
  })),
672
687
  uploadId: results[0].test_upload_id,
688
+ notices: noticesForJson,
673
689
  };
674
690
  if (jsonFileFlag) {
675
691
  const jsonFilePath = jsonFileName || `${results[0].test_upload_id}_dcd.json`;
@@ -775,7 +791,7 @@ export const cloudCommand = defineCommand({
775
791
  warnLogger: (m) => warnOut(m),
776
792
  });
777
793
  }
778
- const jsonOutput = pollingResult;
794
+ const jsonOutput = { ...pollingResult, notices: noticesForJson };
779
795
  if (jsonFileFlag) {
780
796
  const jsonFilePath = jsonFileName || `${results[0].test_upload_id}_dcd.json`;
781
797
  writeJSONFile(jsonFilePath, jsonOutput, {
@@ -42,4 +42,10 @@ export interface RenderNoticesOptions {
42
42
  * payload instead of printing. `opts.out` is the caller's `--json`-gated
43
43
  * emitter, so under `--json` nothing prints but the list is still returned.
44
44
  */
45
+ /**
46
+ * Best-effort platform from the app artifact's extension, so a notice can be
47
+ * targeted at one platform (e.g. "you rely on the default Android API level")
48
+ * without firing on the other platform's runs.
49
+ */
50
+ export declare function platformFromAppFile(appFile: string | undefined): 'android' | 'ios' | undefined;
45
51
  export declare function renderNotices(notices: Notice[] | undefined, ctx: NoticeContext, opts: RenderNoticesOptions): Notice[];
@@ -72,6 +72,21 @@ function renderNotice(notice, opts) {
72
72
  * payload instead of printing. `opts.out` is the caller's `--json`-gated
73
73
  * emitter, so under `--json` nothing prints but the list is still returned.
74
74
  */
75
+ /**
76
+ * Best-effort platform from the app artifact's extension, so a notice can be
77
+ * targeted at one platform (e.g. "you rely on the default Android API level")
78
+ * without firing on the other platform's runs.
79
+ */
80
+ export function platformFromAppFile(appFile) {
81
+ if (!appFile)
82
+ return undefined;
83
+ const ext = appFile.split('?')[0].toLowerCase().match(/.([a-z0-9]+)$/)?.[1];
84
+ if (ext === 'apk' || ext === 'aab')
85
+ return 'android';
86
+ if (ext === 'zip' || ext === 'app' || ext === 'ipa')
87
+ return 'ios';
88
+ return undefined;
89
+ }
75
90
  export function renderNotices(notices, ctx, opts) {
76
91
  if (!notices || notices.length === 0)
77
92
  return [];
package/package.json CHANGED
@@ -59,7 +59,7 @@
59
59
  "type": "git",
60
60
  "url": "https://devicecloud.dev"
61
61
  },
62
- "version": "5.4.1-beta.1",
62
+ "version": "5.5.0-beta.1",
63
63
  "bugs": {
64
64
  "url": "https://discord.gg/gm3mJwcNw8"
65
65
  },