@devicecloud.dev/dcd 3.4.2 → 3.4.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.
@@ -42,11 +42,9 @@ var EAndroidDevices;
42
42
  process.removeAllListeners('warning');
43
43
  process.on('warning', (warning) => {
44
44
  if (warning.name === 'DeprecationWarning' &&
45
- (warning.message.includes('punycode') ||
46
- warning.message.includes('Not sure what to do with typed value of type 0x4'))) {
45
+ warning.message.includes('punycode')) {
47
46
  return;
48
47
  }
49
- console.warn(warning);
50
48
  });
51
49
  class Cloud extends core_1.Command {
52
50
  static args = {
@@ -81,13 +79,24 @@ class Cloud extends core_1.Command {
81
79
  async run() {
82
80
  let output = null;
83
81
  try {
82
+ const { args, flags, raw } = await this.parse(Cloud);
83
+ let { 'additional-app-binary-ids': nonFlatAdditionalAppBinaryIds, 'additional-app-files': nonFlatAdditionalAppFiles, 'android-api-level': androidApiLevel, 'android-device': androidDevice, apiKey: apiKeyFlag, apiUrl, 'app-binary-id': appBinaryId, 'app-file': appFile, async, 'device-locale': deviceLocale, 'download-artifacts': downloadArtifacts, env, 'exclude-flows': excludeFlows, 'exclude-tags': excludeTags, flows, 'google-play': googlePlay, 'include-tags': includeTags, 'ignore-sha-check': ignoreShaCheck, 'ios-device': iOSDevice, 'ios-version': iOSVersion, 'maestro-version': maestroVersion, name, orientation, quiet, retry, report, 'runner-type': runnerType, 'x86-arch': x86Arch, json, ...rest } = flags;
84
+ // If in JSON mode, temporarily intercept stdout to suppress the warning
85
+ if (json) {
86
+ const originalStdoutWrite = process.stdout.write;
87
+ process.stdout.write = function (chunk, encodingOrCallback, cb) {
88
+ if (typeof chunk === 'string' &&
89
+ chunk.includes('Not sure what to do with typed value of type 0x4')) {
90
+ return true;
91
+ }
92
+ return originalStdoutWrite.call(process.stdout, chunk, encodingOrCallback, cb);
93
+ };
94
+ }
84
95
  const [major] = process.versions.node.split('.').map(Number);
85
96
  if (major < 18) {
86
97
  throw new Error(`You are using node version ${major}. DCD requires node version 18 or later`);
87
98
  }
88
99
  await this.versionCheck();
89
- const { args, flags, raw } = await this.parse(Cloud);
90
- let { 'additional-app-binary-ids': nonFlatAdditionalAppBinaryIds, 'additional-app-files': nonFlatAdditionalAppFiles, 'android-api-level': androidApiLevel, 'android-device': androidDevice, apiKey: apiKeyFlag, apiUrl, 'app-binary-id': appBinaryId, 'app-file': appFile, async, 'device-locale': deviceLocale, 'download-artifacts': downloadArtifacts, env, 'exclude-flows': excludeFlows, 'exclude-tags': excludeTags, flows, 'google-play': googlePlay, 'include-tags': includeTags, 'ignore-sha-check': ignoreShaCheck, 'ios-device': iOSDevice, 'ios-version': iOSVersion, 'maestro-version': maestroVersion, name, orientation, quiet, retry, report, 'runner-type': runnerType, 'x86-arch': x86Arch, json, ...rest } = flags;
91
100
  const apiKey = apiKeyFlag || process.env.DEVICE_CLOUD_API_KEY;
92
101
  if (!apiKey)
93
102
  throw new Error('You must provide an API key via --api-key flag or DEVICE_CLOUD_API_KEY environment variable');
@@ -416,5 +416,5 @@
416
416
  ]
417
417
  }
418
418
  },
419
- "version": "3.4.2"
419
+ "version": "3.4.3"
420
420
  }
package/package.json CHANGED
@@ -80,7 +80,7 @@
80
80
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
81
81
  "version": "oclif readme && git add README.md"
82
82
  },
83
- "version": "3.4.2",
83
+ "version": "3.4.3",
84
84
  "bugs": {
85
85
  "url": "https://discord.gg/gm3mJwcNw8"
86
86
  },