@percy/core 1.31.2-beta.1 → 1.31.2-beta.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/dist/config.js CHANGED
@@ -85,6 +85,10 @@ export const configSchema = {
85
85
  type: 'boolean',
86
86
  default: false
87
87
  },
88
+ forceShadowAsLightDOM: {
89
+ type: 'boolean',
90
+ default: false
91
+ },
88
92
  enableLayout: {
89
93
  type: 'boolean'
90
94
  },
@@ -475,6 +479,9 @@ export const snapshotSchema = {
475
479
  disableShadowDOM: {
476
480
  $ref: '/config/snapshot#/properties/disableShadowDOM'
477
481
  },
482
+ forceShadowAsLightDOM: {
483
+ $ref: '/config/snapshot#/properties/forceShadowAsLightDOM'
484
+ },
478
485
  domTransformation: {
479
486
  $ref: '/config/snapshot#/properties/domTransformation'
480
487
  },
package/dist/discovery.js CHANGED
@@ -29,6 +29,7 @@ function debugSnapshotOptions(snapshot) {
29
29
  debugProp(snapshot, 'enableJavaScript');
30
30
  debugProp(snapshot, 'cliEnableJavaScript');
31
31
  debugProp(snapshot, 'disableShadowDOM');
32
+ debugProp(snapshot, 'forceShadowAsLightDOM');
32
33
  debugProp(snapshot, 'enableLayout');
33
34
  debugProp(snapshot, 'domTransformation');
34
35
  debugProp(snapshot, 'reshuffleInvalidTags');
package/dist/page.js CHANGED
@@ -183,6 +183,7 @@ export class Page {
183
183
  width,
184
184
  enableJavaScript,
185
185
  disableShadowDOM,
186
+ forceShadowAsLightDOM,
186
187
  domTransformation,
187
188
  reshuffleInvalidTags,
188
189
  ignoreCanvasSerializationErrors
@@ -222,6 +223,7 @@ export class Page {
222
223
  }), {
223
224
  enableJavaScript,
224
225
  disableShadowDOM,
226
+ forceShadowAsLightDOM,
225
227
  domTransformation,
226
228
  reshuffleInvalidTags,
227
229
  ignoreCanvasSerializationErrors
package/dist/percy.js CHANGED
@@ -13,7 +13,7 @@ import logger from '@percy/logger';
13
13
  import { getProxy } from '@percy/client/utils';
14
14
  import Browser from './browser.js';
15
15
  import Pako from 'pako';
16
- import { base64encode, generatePromise, yieldAll, yieldTo, redactSecrets, detectSystemProxyAndLog } from './utils.js';
16
+ import { base64encode, generatePromise, yieldAll, yieldTo, redactSecrets, detectSystemProxyAndLog, checkSDKVersion } from './utils.js';
17
17
  import { createPercyServer, createStaticServer } from './api.js';
18
18
  import { gatherSnapshots, createSnapshotsQueue, validateSnapshotOptions } from './snapshot.js';
19
19
  import { discoverSnapshotResources, createDiscoveryQueue } from './discovery.js';
@@ -113,6 +113,7 @@ export class Percy {
113
113
  // if there is none, stop it
114
114
  this.resetMonitoringId = null;
115
115
  this.monitoringCheckLastExecutedAt = null;
116
+ this.sdkInfoDisplayed = false;
116
117
 
117
118
  // generator methods are wrapped to autorun and return promises
118
119
  for (let m of ['start', 'stop', 'flush', 'idle', 'snapshot', 'upload']) {
@@ -433,6 +434,11 @@ export class Percy {
433
434
  return async function* () {
434
435
  let server;
435
436
  try {
437
+ // Check SDK version
438
+ if (!this.sdkInfoDisplayed && options.clientInfo) {
439
+ await checkSDKVersion(options.clientInfo);
440
+ this.sdkInfoDisplayed = true;
441
+ }
436
442
  if ('serve' in options) {
437
443
  // create and start a static server
438
444
  let {
package/dist/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import EventEmitter from 'events';
2
- import { sha256hash } from '@percy/client/utils';
2
+ import { sha256hash, request } from '@percy/client/utils';
3
3
  import { camelcase, merge } from '@percy/config/utils';
4
4
  import YAML from 'yaml';
5
5
  import path from 'path';
@@ -576,4 +576,68 @@ export async function* maybeScrollToBottom(page, discovery) {
576
576
  if (discovery.scrollToBottom && page.enableJavaScript) {
577
577
  yield page.eval('await scrollToBottom()');
578
578
  }
579
+ }
580
+
581
+ // Package to GitHub repo mapping
582
+ const PACKAGE_TO_REPO = {
583
+ '@percy/selenium-webdriver': 'percy-selenium-js',
584
+ '@percy/playwright': 'percy-playwright',
585
+ '@percy/appium-app': 'percy-appium-js',
586
+ '@percy/storybook': 'percy-storybook',
587
+ '@percy/ember': 'percy-ember',
588
+ '@percy/cypress': 'percy-cypress',
589
+ '@percy/puppeteer': 'percy-puppeteer',
590
+ '@percy/testcafe': 'percy-testcafe',
591
+ '@percy/nightwatch': 'percy-nightwatch',
592
+ 'percy-java-selenium': 'percy-selenium-java',
593
+ 'percy-playwright-java': 'percy-playwright-java',
594
+ 'percy-appium-dotnet': 'percy-appium-dotnet',
595
+ 'percy-selenium-dotnet': 'percy-selenium-dotnet',
596
+ 'percy-playwright-dotnet': 'percy-playwright-dotnet',
597
+ 'percy-playwright-python': 'percy-playwright-python',
598
+ 'percy-selenium-python': 'percy-selenium-python',
599
+ 'percy-selenium-ruby': 'percy-selenium-ruby',
600
+ 'percy-capybara': 'percy-capybara'
601
+ };
602
+
603
+ // Utility function to check SDK version updates
604
+ export async function checkSDKVersion(clientInfo) {
605
+ const log = logger('core:sdk-version');
606
+ try {
607
+ // Split on the last '/' to get package name and version
608
+ const lastSlashIndex = clientInfo.lastIndexOf('/');
609
+ if (lastSlashIndex === -1) {
610
+ log.debug(`Invalid clientInfo format: ${clientInfo}`);
611
+ return;
612
+ }
613
+ const packageName = clientInfo.substring(0, lastSlashIndex);
614
+ const currentVersion = clientInfo.substring(lastSlashIndex + 1);
615
+
616
+ // Get GitHub repo name from mapping
617
+ const repoName = PACKAGE_TO_REPO[packageName];
618
+ if (!repoName) {
619
+ log.debug(`No repo mapping found for package: ${packageName}`);
620
+ return;
621
+ }
622
+
623
+ // Fetch latest version from GitHub releases
624
+ const githubData = await request(`https://api.github.com/repos/percy/${repoName}/releases?page=1`, {
625
+ headers: {
626
+ 'User-Agent': '@percy/cli'
627
+ },
628
+ retries: 0
629
+ });
630
+ const latestRelease = githubData.find(r => !r.prerelease);
631
+ if (!latestRelease) {
632
+ return;
633
+ }
634
+ const latestVersion = latestRelease.tag_name.replace(/^v/, ''); // Remove 'v' prefix if present
635
+
636
+ log.debug(`[SDK Version Check] Current: ${currentVersion}, Latest: ${latestVersion}`);
637
+ if (currentVersion !== latestVersion) {
638
+ log.warn(`[SDK Update Available] ${packageName}: ${currentVersion} -> ${latestVersion}`);
639
+ }
640
+ } catch (error) {
641
+ log.debug('Could not check SDK version', error);
642
+ }
579
643
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.31.2-beta.1",
3
+ "version": "1.31.2-beta.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,12 +43,12 @@
43
43
  "test:types": "tsd"
44
44
  },
45
45
  "dependencies": {
46
- "@percy/client": "1.31.2-beta.1",
47
- "@percy/config": "1.31.2-beta.1",
48
- "@percy/dom": "1.31.2-beta.1",
49
- "@percy/logger": "1.31.2-beta.1",
50
- "@percy/monitoring": "1.31.2-beta.1",
51
- "@percy/webdriver-utils": "1.31.2-beta.1",
46
+ "@percy/client": "1.31.2-beta.3",
47
+ "@percy/config": "1.31.2-beta.3",
48
+ "@percy/dom": "1.31.2-beta.3",
49
+ "@percy/logger": "1.31.2-beta.3",
50
+ "@percy/monitoring": "1.31.2-beta.3",
51
+ "@percy/webdriver-utils": "1.31.2-beta.3",
52
52
  "content-disposition": "^0.5.4",
53
53
  "cross-spawn": "^7.0.3",
54
54
  "extract-zip": "^2.0.1",
@@ -61,5 +61,5 @@
61
61
  "ws": "^8.17.1",
62
62
  "yaml": "^2.4.1"
63
63
  },
64
- "gitHead": "c8ba03fdd3ab7543f741a68eb5c357e38b48129e"
64
+ "gitHead": "761ef7aef1d13d45afb0cedae50e6e82d84a3521"
65
65
  }