cypress 12.16.0 → 12.17.1

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "cypress",
3
- "version": "12.16.0",
3
+ "version": "12.17.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "postinstall": "node index.js --exec install",
7
7
  "size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";"
8
8
  },
9
9
  "dependencies": {
10
- "@cypress/request": "^2.88.10",
10
+ "@cypress/request": "^2.88.11",
11
11
  "@cypress/xvfb": "^1.2.4",
12
12
  "@types/node": "^14.14.31",
13
13
  "@types/sinonjs__fake-timers": "8.1.1",
@@ -44,7 +44,7 @@
44
44
  "pretty-bytes": "^5.6.0",
45
45
  "proxy-from-env": "1.0.0",
46
46
  "request-progress": "^3.0.0",
47
- "semver": "^7.3.2",
47
+ "semver": "^7.5.3",
48
48
  "supports-color": "^8.1.1",
49
49
  "tmp": "~0.2.1",
50
50
  "untildify": "^4.0.0",
@@ -118,8 +118,8 @@
118
118
  },
119
119
  "buildInfo": {
120
120
  "commitBranch": "develop",
121
- "commitSha": "4aacfaa5c18344ccaa9f6b8a2f3106fe269f4b0d",
122
- "commitDate": "2023-06-26T13:45:58.000Z",
121
+ "commitSha": "17ed1c9831054c5875e21d29c588a5ecb50edcbc",
122
+ "commitDate": "2023-07-10T16:34:12.000Z",
123
123
  "stable": true
124
124
  },
125
125
  "description": "Cypress is a next generation front end testing tool built for the modern web",
@@ -273,11 +273,29 @@ const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
273
273
  // Max safe segment length for coercion.
274
274
  const MAX_SAFE_COMPONENT_LENGTH = 16;
275
275
 
276
+ // Max safe length for a build identifier. The max length minus 6 characters for
277
+ // the shortest version with a build 0.0.0+BUILD.
278
+ const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;
279
+
280
+ const RELEASE_TYPES = [
281
+ 'major',
282
+ 'premajor',
283
+ 'minor',
284
+ 'preminor',
285
+ 'patch',
286
+ 'prepatch',
287
+ 'prerelease',
288
+ ];
289
+
276
290
  var constants = {
277
- SEMVER_SPEC_VERSION,
278
291
  MAX_LENGTH: MAX_LENGTH$1,
279
- MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
280
292
  MAX_SAFE_COMPONENT_LENGTH,
293
+ MAX_SAFE_BUILD_LENGTH,
294
+ MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
295
+ RELEASE_TYPES,
296
+ SEMVER_SPEC_VERSION,
297
+ FLAG_INCLUDE_PRERELEASE: 0b001,
298
+ FLAG_LOOSE: 0b010,
281
299
  };
282
300
 
283
301
  function createCommonjsModule(fn) {
@@ -286,22 +304,48 @@ function createCommonjsModule(fn) {
286
304
  }
287
305
 
288
306
  var re_1 = createCommonjsModule(function (module, exports) {
289
- const { MAX_SAFE_COMPONENT_LENGTH } = constants;
307
+ const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH } = constants;
290
308
 
291
309
  exports = module.exports = {};
292
310
 
293
311
  // The actual regexps go on exports.re
294
312
  const re = exports.re = [];
313
+ const safeRe = exports.safeRe = [];
295
314
  const src = exports.src = [];
296
315
  const t = exports.t = {};
297
316
  let R = 0;
298
317
 
318
+ const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
319
+
320
+ // Replace some greedy regex tokens to prevent regex dos issues. These regex are
321
+ // used internally via the safeRe object since all inputs in this library get
322
+ // normalized first to trim and collapse all extra whitespace. The original
323
+ // regexes are exported for userland consumption and lower level usage. A
324
+ // future breaking change could export the safer regex only with a note that
325
+ // all input should have extra whitespace removed.
326
+ const safeRegexReplacements = [
327
+ ['\\s', 1],
328
+ ['\\d', MAX_SAFE_COMPONENT_LENGTH],
329
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
330
+ ];
331
+
332
+ const makeSafeRegex = (value) => {
333
+ for (const [token, max] of safeRegexReplacements) {
334
+ value = value
335
+ .split(`${token}*`).join(`${token}{0,${max}}`)
336
+ .split(`${token}+`).join(`${token}{1,${max}}`);
337
+ }
338
+ return value
339
+ };
340
+
299
341
  const createToken = (name, value, isGlobal) => {
342
+ const safe = makeSafeRegex(value);
300
343
  const index = R++;
301
344
  debug_1(name, index, value);
302
345
  t[name] = index;
303
346
  src[index] = value;
304
347
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
348
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
305
349
  };
306
350
 
307
351
  // The following Regular Expressions can be used for tokenizing,
@@ -311,13 +355,13 @@ const createToken = (name, value, isGlobal) => {
311
355
  // A single `0`, or a non-zero digit followed by zero or more digits.
312
356
 
313
357
  createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
314
- createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');
358
+ createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
315
359
 
316
360
  // ## Non-numeric Identifier
317
361
  // Zero or more digits, followed by a letter or hyphen, and then zero or
318
362
  // more letters, digits, or hyphens.
319
363
 
320
- createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*');
364
+ createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
321
365
 
322
366
  // ## Main Version
323
367
  // Three dot-separated numeric identifiers.
@@ -352,7 +396,7 @@ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
352
396
  // ## Build Metadata Identifier
353
397
  // Any combination of digits, letters, or hyphens.
354
398
 
355
- createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');
399
+ createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
356
400
 
357
401
  // ## Build Metadata
358
402
  // Plus sign, followed by one or more period-separated build metadata
@@ -470,16 +514,20 @@ createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
470
514
  createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
471
515
  });
472
516
 
473
- // parse out just the options we care about so we always get a consistent
474
- // obj with keys in a consistent order.
475
- const opts = ['includePrerelease', 'loose', 'rtl'];
476
- const parseOptions = options =>
477
- !options ? {}
478
- : typeof options !== 'object' ? { loose: true }
479
- : opts.filter(k => options[k]).reduce((o, k) => {
480
- o[k] = true;
481
- return o
482
- }, {});
517
+ // parse out just the options we care about
518
+ const looseOption = Object.freeze({ loose: true });
519
+ const emptyOpts = Object.freeze({ });
520
+ const parseOptions = options => {
521
+ if (!options) {
522
+ return emptyOpts
523
+ }
524
+
525
+ if (typeof options !== 'object') {
526
+ return looseOption
527
+ }
528
+
529
+ return options
530
+ };
483
531
  var parseOptions_1 = parseOptions;
484
532
 
485
533
  const numeric = /^[0-9]+$/;
@@ -507,7 +555,7 @@ var identifiers = {
507
555
  };
508
556
 
509
557
  const { MAX_LENGTH, MAX_SAFE_INTEGER } = constants;
510
- const { re, t } = re_1;
558
+ const { safeRe: re, t } = re_1;
511
559
 
512
560
 
513
561
  const { compareIdentifiers } = identifiers;
@@ -523,7 +571,7 @@ class SemVer {
523
571
  version = version.version;
524
572
  }
525
573
  } else if (typeof version !== 'string') {
526
- throw new TypeError(`Invalid Version: ${version}`)
574
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
527
575
  }
528
576
 
529
577
  if (version.length > MAX_LENGTH) {
@@ -682,36 +730,36 @@ class SemVer {
682
730
 
683
731
  // preminor will bump the version up to the next minor release, and immediately
684
732
  // down to pre-release. premajor and prepatch work the same way.
685
- inc (release, identifier) {
733
+ inc (release, identifier, identifierBase) {
686
734
  switch (release) {
687
735
  case 'premajor':
688
736
  this.prerelease.length = 0;
689
737
  this.patch = 0;
690
738
  this.minor = 0;
691
739
  this.major++;
692
- this.inc('pre', identifier);
740
+ this.inc('pre', identifier, identifierBase);
693
741
  break
694
742
  case 'preminor':
695
743
  this.prerelease.length = 0;
696
744
  this.patch = 0;
697
745
  this.minor++;
698
- this.inc('pre', identifier);
746
+ this.inc('pre', identifier, identifierBase);
699
747
  break
700
748
  case 'prepatch':
701
749
  // If this is already a prerelease, it will bump to the next version
702
750
  // drop any prereleases that might already exist, since they are not
703
751
  // relevant at this point.
704
752
  this.prerelease.length = 0;
705
- this.inc('patch', identifier);
706
- this.inc('pre', identifier);
753
+ this.inc('patch', identifier, identifierBase);
754
+ this.inc('pre', identifier, identifierBase);
707
755
  break
708
756
  // If the input is a non-prerelease version, this acts the same as
709
757
  // prepatch.
710
758
  case 'prerelease':
711
759
  if (this.prerelease.length === 0) {
712
- this.inc('patch', identifier);
760
+ this.inc('patch', identifier, identifierBase);
713
761
  }
714
- this.inc('pre', identifier);
762
+ this.inc('pre', identifier, identifierBase);
715
763
  break
716
764
 
717
765
  case 'major':
@@ -753,9 +801,15 @@ class SemVer {
753
801
  break
754
802
  // This probably shouldn't be used publicly.
755
803
  // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
756
- case 'pre':
804
+ case 'pre': {
805
+ const base = Number(identifierBase) ? 1 : 0;
806
+
807
+ if (!identifier && identifierBase === false) {
808
+ throw new Error('invalid increment argument: identifier is empty')
809
+ }
810
+
757
811
  if (this.prerelease.length === 0) {
758
- this.prerelease = [0];
812
+ this.prerelease = [base];
759
813
  } else {
760
814
  let i = this.prerelease.length;
761
815
  while (--i >= 0) {
@@ -766,27 +820,36 @@ class SemVer {
766
820
  }
767
821
  if (i === -1) {
768
822
  // didn't increment anything
769
- this.prerelease.push(0);
823
+ if (identifier === this.prerelease.join('.') && identifierBase === false) {
824
+ throw new Error('invalid increment argument: identifier already exists')
825
+ }
826
+ this.prerelease.push(base);
770
827
  }
771
828
  }
772
829
  if (identifier) {
773
830
  // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
774
831
  // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
832
+ let prerelease = [identifier, base];
833
+ if (identifierBase === false) {
834
+ prerelease = [identifier];
835
+ }
775
836
  if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
776
837
  if (isNaN(this.prerelease[1])) {
777
- this.prerelease = [identifier, 0];
838
+ this.prerelease = prerelease;
778
839
  }
779
840
  } else {
780
- this.prerelease = [identifier, 0];
841
+ this.prerelease = prerelease;
781
842
  }
782
843
  }
783
844
  break
784
-
845
+ }
785
846
  default:
786
847
  throw new Error(`invalid increment argument: ${release}`)
787
848
  }
788
- this.format();
789
- this.raw = this.version;
849
+ this.raw = this.format();
850
+ if (this.build.length) {
851
+ this.raw += `+${this.build.join('.')}`;
852
+ }
790
853
  return this
791
854
  }
792
855
  }
@@ -253,11 +253,29 @@ const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
253
253
  // Max safe segment length for coercion.
254
254
  const MAX_SAFE_COMPONENT_LENGTH = 16;
255
255
 
256
+ // Max safe length for a build identifier. The max length minus 6 characters for
257
+ // the shortest version with a build 0.0.0+BUILD.
258
+ const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;
259
+
260
+ const RELEASE_TYPES = [
261
+ 'major',
262
+ 'premajor',
263
+ 'minor',
264
+ 'preminor',
265
+ 'patch',
266
+ 'prepatch',
267
+ 'prerelease',
268
+ ];
269
+
256
270
  var constants = {
257
- SEMVER_SPEC_VERSION,
258
271
  MAX_LENGTH: MAX_LENGTH$1,
259
- MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
260
272
  MAX_SAFE_COMPONENT_LENGTH,
273
+ MAX_SAFE_BUILD_LENGTH,
274
+ MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
275
+ RELEASE_TYPES,
276
+ SEMVER_SPEC_VERSION,
277
+ FLAG_INCLUDE_PRERELEASE: 0b001,
278
+ FLAG_LOOSE: 0b010,
261
279
  };
262
280
 
263
281
  function createCommonjsModule(fn) {
@@ -266,22 +284,48 @@ function createCommonjsModule(fn) {
266
284
  }
267
285
 
268
286
  var re_1 = createCommonjsModule(function (module, exports) {
269
- const { MAX_SAFE_COMPONENT_LENGTH } = constants;
287
+ const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH } = constants;
270
288
 
271
289
  exports = module.exports = {};
272
290
 
273
291
  // The actual regexps go on exports.re
274
292
  const re = exports.re = [];
293
+ const safeRe = exports.safeRe = [];
275
294
  const src = exports.src = [];
276
295
  const t = exports.t = {};
277
296
  let R = 0;
278
297
 
298
+ const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
299
+
300
+ // Replace some greedy regex tokens to prevent regex dos issues. These regex are
301
+ // used internally via the safeRe object since all inputs in this library get
302
+ // normalized first to trim and collapse all extra whitespace. The original
303
+ // regexes are exported for userland consumption and lower level usage. A
304
+ // future breaking change could export the safer regex only with a note that
305
+ // all input should have extra whitespace removed.
306
+ const safeRegexReplacements = [
307
+ ['\\s', 1],
308
+ ['\\d', MAX_SAFE_COMPONENT_LENGTH],
309
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
310
+ ];
311
+
312
+ const makeSafeRegex = (value) => {
313
+ for (const [token, max] of safeRegexReplacements) {
314
+ value = value
315
+ .split(`${token}*`).join(`${token}{0,${max}}`)
316
+ .split(`${token}+`).join(`${token}{1,${max}}`);
317
+ }
318
+ return value
319
+ };
320
+
279
321
  const createToken = (name, value, isGlobal) => {
322
+ const safe = makeSafeRegex(value);
280
323
  const index = R++;
281
324
  debug_1(name, index, value);
282
325
  t[name] = index;
283
326
  src[index] = value;
284
327
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
328
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
285
329
  };
286
330
 
287
331
  // The following Regular Expressions can be used for tokenizing,
@@ -291,13 +335,13 @@ const createToken = (name, value, isGlobal) => {
291
335
  // A single `0`, or a non-zero digit followed by zero or more digits.
292
336
 
293
337
  createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
294
- createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');
338
+ createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
295
339
 
296
340
  // ## Non-numeric Identifier
297
341
  // Zero or more digits, followed by a letter or hyphen, and then zero or
298
342
  // more letters, digits, or hyphens.
299
343
 
300
- createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*');
344
+ createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
301
345
 
302
346
  // ## Main Version
303
347
  // Three dot-separated numeric identifiers.
@@ -332,7 +376,7 @@ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
332
376
  // ## Build Metadata Identifier
333
377
  // Any combination of digits, letters, or hyphens.
334
378
 
335
- createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');
379
+ createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
336
380
 
337
381
  // ## Build Metadata
338
382
  // Plus sign, followed by one or more period-separated build metadata
@@ -450,16 +494,20 @@ createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
450
494
  createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
451
495
  });
452
496
 
453
- // parse out just the options we care about so we always get a consistent
454
- // obj with keys in a consistent order.
455
- const opts = ['includePrerelease', 'loose', 'rtl'];
456
- const parseOptions = options =>
457
- !options ? {}
458
- : typeof options !== 'object' ? { loose: true }
459
- : opts.filter(k => options[k]).reduce((o, k) => {
460
- o[k] = true;
461
- return o
462
- }, {});
497
+ // parse out just the options we care about
498
+ const looseOption = Object.freeze({ loose: true });
499
+ const emptyOpts = Object.freeze({ });
500
+ const parseOptions = options => {
501
+ if (!options) {
502
+ return emptyOpts
503
+ }
504
+
505
+ if (typeof options !== 'object') {
506
+ return looseOption
507
+ }
508
+
509
+ return options
510
+ };
463
511
  var parseOptions_1 = parseOptions;
464
512
 
465
513
  const numeric = /^[0-9]+$/;
@@ -487,7 +535,7 @@ var identifiers = {
487
535
  };
488
536
 
489
537
  const { MAX_LENGTH, MAX_SAFE_INTEGER } = constants;
490
- const { re, t } = re_1;
538
+ const { safeRe: re, t } = re_1;
491
539
 
492
540
 
493
541
  const { compareIdentifiers } = identifiers;
@@ -503,7 +551,7 @@ class SemVer {
503
551
  version = version.version;
504
552
  }
505
553
  } else if (typeof version !== 'string') {
506
- throw new TypeError(`Invalid Version: ${version}`)
554
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
507
555
  }
508
556
 
509
557
  if (version.length > MAX_LENGTH) {
@@ -662,36 +710,36 @@ class SemVer {
662
710
 
663
711
  // preminor will bump the version up to the next minor release, and immediately
664
712
  // down to pre-release. premajor and prepatch work the same way.
665
- inc (release, identifier) {
713
+ inc (release, identifier, identifierBase) {
666
714
  switch (release) {
667
715
  case 'premajor':
668
716
  this.prerelease.length = 0;
669
717
  this.patch = 0;
670
718
  this.minor = 0;
671
719
  this.major++;
672
- this.inc('pre', identifier);
720
+ this.inc('pre', identifier, identifierBase);
673
721
  break
674
722
  case 'preminor':
675
723
  this.prerelease.length = 0;
676
724
  this.patch = 0;
677
725
  this.minor++;
678
- this.inc('pre', identifier);
726
+ this.inc('pre', identifier, identifierBase);
679
727
  break
680
728
  case 'prepatch':
681
729
  // If this is already a prerelease, it will bump to the next version
682
730
  // drop any prereleases that might already exist, since they are not
683
731
  // relevant at this point.
684
732
  this.prerelease.length = 0;
685
- this.inc('patch', identifier);
686
- this.inc('pre', identifier);
733
+ this.inc('patch', identifier, identifierBase);
734
+ this.inc('pre', identifier, identifierBase);
687
735
  break
688
736
  // If the input is a non-prerelease version, this acts the same as
689
737
  // prepatch.
690
738
  case 'prerelease':
691
739
  if (this.prerelease.length === 0) {
692
- this.inc('patch', identifier);
740
+ this.inc('patch', identifier, identifierBase);
693
741
  }
694
- this.inc('pre', identifier);
742
+ this.inc('pre', identifier, identifierBase);
695
743
  break
696
744
 
697
745
  case 'major':
@@ -733,9 +781,15 @@ class SemVer {
733
781
  break
734
782
  // This probably shouldn't be used publicly.
735
783
  // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
736
- case 'pre':
784
+ case 'pre': {
785
+ const base = Number(identifierBase) ? 1 : 0;
786
+
787
+ if (!identifier && identifierBase === false) {
788
+ throw new Error('invalid increment argument: identifier is empty')
789
+ }
790
+
737
791
  if (this.prerelease.length === 0) {
738
- this.prerelease = [0];
792
+ this.prerelease = [base];
739
793
  } else {
740
794
  let i = this.prerelease.length;
741
795
  while (--i >= 0) {
@@ -746,27 +800,36 @@ class SemVer {
746
800
  }
747
801
  if (i === -1) {
748
802
  // didn't increment anything
749
- this.prerelease.push(0);
803
+ if (identifier === this.prerelease.join('.') && identifierBase === false) {
804
+ throw new Error('invalid increment argument: identifier already exists')
805
+ }
806
+ this.prerelease.push(base);
750
807
  }
751
808
  }
752
809
  if (identifier) {
753
810
  // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
754
811
  // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
812
+ let prerelease = [identifier, base];
813
+ if (identifierBase === false) {
814
+ prerelease = [identifier];
815
+ }
755
816
  if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
756
817
  if (isNaN(this.prerelease[1])) {
757
- this.prerelease = [identifier, 0];
818
+ this.prerelease = prerelease;
758
819
  }
759
820
  } else {
760
- this.prerelease = [identifier, 0];
821
+ this.prerelease = prerelease;
761
822
  }
762
823
  }
763
824
  break
764
-
825
+ }
765
826
  default:
766
827
  throw new Error(`invalid increment argument: ${release}`)
767
828
  }
768
- this.format();
769
- this.raw = this.version;
829
+ this.raw = this.format();
830
+ if (this.build.length) {
831
+ this.raw += `+${this.build.join('.')}`;
832
+ }
770
833
  return this
771
834
  }
772
835
  }
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@cypress/mount-utils": "0.0.0-development",
20
- "@types/semver": "7.3.9",
20
+ "@types/semver": "7.5.0",
21
21
  "@vitejs/plugin-react": "4.0.0",
22
22
  "axios": "0.21.2",
23
23
  "cypress": "0.0.0-development",
@@ -26,7 +26,7 @@
26
26
  "react-dom": "16.8.6",
27
27
  "react-router": "6.0.0-alpha.1",
28
28
  "react-router-dom": "6.0.0-alpha.1",
29
- "semver": "^7.3.2",
29
+ "semver": "^7.5.3",
30
30
  "typescript": "^4.7.4",
31
31
  "vite": "4.3.2",
32
32
  "vite-plugin-require-transform": "1.0.12"
@@ -282,11 +282,29 @@ const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
282
282
  // Max safe segment length for coercion.
283
283
  const MAX_SAFE_COMPONENT_LENGTH = 16;
284
284
 
285
+ // Max safe length for a build identifier. The max length minus 6 characters for
286
+ // the shortest version with a build 0.0.0+BUILD.
287
+ const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;
288
+
289
+ const RELEASE_TYPES = [
290
+ 'major',
291
+ 'premajor',
292
+ 'minor',
293
+ 'preminor',
294
+ 'patch',
295
+ 'prepatch',
296
+ 'prerelease',
297
+ ];
298
+
285
299
  var constants = {
286
- SEMVER_SPEC_VERSION,
287
300
  MAX_LENGTH: MAX_LENGTH$1,
288
- MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
289
301
  MAX_SAFE_COMPONENT_LENGTH,
302
+ MAX_SAFE_BUILD_LENGTH,
303
+ MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
304
+ RELEASE_TYPES,
305
+ SEMVER_SPEC_VERSION,
306
+ FLAG_INCLUDE_PRERELEASE: 0b001,
307
+ FLAG_LOOSE: 0b010,
290
308
  };
291
309
 
292
310
  function createCommonjsModule(fn) {
@@ -295,22 +313,48 @@ function createCommonjsModule(fn) {
295
313
  }
296
314
 
297
315
  createCommonjsModule(function (module, exports) {
298
- const { MAX_SAFE_COMPONENT_LENGTH } = constants;
316
+ const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH } = constants;
299
317
 
300
318
  exports = module.exports = {};
301
319
 
302
320
  // The actual regexps go on exports.re
303
321
  const re = exports.re = [];
322
+ const safeRe = exports.safeRe = [];
304
323
  const src = exports.src = [];
305
324
  const t = exports.t = {};
306
325
  let R = 0;
307
326
 
327
+ const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
328
+
329
+ // Replace some greedy regex tokens to prevent regex dos issues. These regex are
330
+ // used internally via the safeRe object since all inputs in this library get
331
+ // normalized first to trim and collapse all extra whitespace. The original
332
+ // regexes are exported for userland consumption and lower level usage. A
333
+ // future breaking change could export the safer regex only with a note that
334
+ // all input should have extra whitespace removed.
335
+ const safeRegexReplacements = [
336
+ ['\\s', 1],
337
+ ['\\d', MAX_SAFE_COMPONENT_LENGTH],
338
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
339
+ ];
340
+
341
+ const makeSafeRegex = (value) => {
342
+ for (const [token, max] of safeRegexReplacements) {
343
+ value = value
344
+ .split(`${token}*`).join(`${token}{0,${max}}`)
345
+ .split(`${token}+`).join(`${token}{1,${max}}`);
346
+ }
347
+ return value
348
+ };
349
+
308
350
  const createToken = (name, value, isGlobal) => {
351
+ const safe = makeSafeRegex(value);
309
352
  const index = R++;
310
353
  debug_1(name, index, value);
311
354
  t[name] = index;
312
355
  src[index] = value;
313
356
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
357
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
314
358
  };
315
359
 
316
360
  // The following Regular Expressions can be used for tokenizing,
@@ -320,13 +364,13 @@ const createToken = (name, value, isGlobal) => {
320
364
  // A single `0`, or a non-zero digit followed by zero or more digits.
321
365
 
322
366
  createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
323
- createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');
367
+ createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
324
368
 
325
369
  // ## Non-numeric Identifier
326
370
  // Zero or more digits, followed by a letter or hyphen, and then zero or
327
371
  // more letters, digits, or hyphens.
328
372
 
329
- createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*');
373
+ createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
330
374
 
331
375
  // ## Main Version
332
376
  // Three dot-separated numeric identifiers.
@@ -361,7 +405,7 @@ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
361
405
  // ## Build Metadata Identifier
362
406
  // Any combination of digits, letters, or hyphens.
363
407
 
364
- createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');
408
+ createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
365
409
 
366
410
  // ## Build Metadata
367
411
  // Plus sign, followed by one or more period-separated build metadata
@@ -261,11 +261,29 @@ const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
261
261
  // Max safe segment length for coercion.
262
262
  const MAX_SAFE_COMPONENT_LENGTH = 16;
263
263
 
264
+ // Max safe length for a build identifier. The max length minus 6 characters for
265
+ // the shortest version with a build 0.0.0+BUILD.
266
+ const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;
267
+
268
+ const RELEASE_TYPES = [
269
+ 'major',
270
+ 'premajor',
271
+ 'minor',
272
+ 'preminor',
273
+ 'patch',
274
+ 'prepatch',
275
+ 'prerelease',
276
+ ];
277
+
264
278
  var constants = {
265
- SEMVER_SPEC_VERSION,
266
279
  MAX_LENGTH: MAX_LENGTH$1,
267
- MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
268
280
  MAX_SAFE_COMPONENT_LENGTH,
281
+ MAX_SAFE_BUILD_LENGTH,
282
+ MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
283
+ RELEASE_TYPES,
284
+ SEMVER_SPEC_VERSION,
285
+ FLAG_INCLUDE_PRERELEASE: 0b001,
286
+ FLAG_LOOSE: 0b010,
269
287
  };
270
288
 
271
289
  function createCommonjsModule(fn) {
@@ -274,22 +292,48 @@ function createCommonjsModule(fn) {
274
292
  }
275
293
 
276
294
  createCommonjsModule(function (module, exports) {
277
- const { MAX_SAFE_COMPONENT_LENGTH } = constants;
295
+ const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH } = constants;
278
296
 
279
297
  exports = module.exports = {};
280
298
 
281
299
  // The actual regexps go on exports.re
282
300
  const re = exports.re = [];
301
+ const safeRe = exports.safeRe = [];
283
302
  const src = exports.src = [];
284
303
  const t = exports.t = {};
285
304
  let R = 0;
286
305
 
306
+ const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
307
+
308
+ // Replace some greedy regex tokens to prevent regex dos issues. These regex are
309
+ // used internally via the safeRe object since all inputs in this library get
310
+ // normalized first to trim and collapse all extra whitespace. The original
311
+ // regexes are exported for userland consumption and lower level usage. A
312
+ // future breaking change could export the safer regex only with a note that
313
+ // all input should have extra whitespace removed.
314
+ const safeRegexReplacements = [
315
+ ['\\s', 1],
316
+ ['\\d', MAX_SAFE_COMPONENT_LENGTH],
317
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
318
+ ];
319
+
320
+ const makeSafeRegex = (value) => {
321
+ for (const [token, max] of safeRegexReplacements) {
322
+ value = value
323
+ .split(`${token}*`).join(`${token}{0,${max}}`)
324
+ .split(`${token}+`).join(`${token}{1,${max}}`);
325
+ }
326
+ return value
327
+ };
328
+
287
329
  const createToken = (name, value, isGlobal) => {
330
+ const safe = makeSafeRegex(value);
288
331
  const index = R++;
289
332
  debug_1(name, index, value);
290
333
  t[name] = index;
291
334
  src[index] = value;
292
335
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
336
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
293
337
  };
294
338
 
295
339
  // The following Regular Expressions can be used for tokenizing,
@@ -299,13 +343,13 @@ const createToken = (name, value, isGlobal) => {
299
343
  // A single `0`, or a non-zero digit followed by zero or more digits.
300
344
 
301
345
  createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
302
- createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');
346
+ createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
303
347
 
304
348
  // ## Non-numeric Identifier
305
349
  // Zero or more digits, followed by a letter or hyphen, and then zero or
306
350
  // more letters, digits, or hyphens.
307
351
 
308
- createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*');
352
+ createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
309
353
 
310
354
  // ## Main Version
311
355
  // Three dot-separated numeric identifiers.
@@ -340,7 +384,7 @@ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
340
384
  // ## Build Metadata Identifier
341
385
  // Any combination of digits, letters, or hyphens.
342
386
 
343
- createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');
387
+ createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
344
388
 
345
389
  // ## Build Metadata
346
390
  // Plus sign, followed by one or more period-separated build metadata
@@ -187,8 +187,8 @@ declare namespace CypressCommandLine {
187
187
  interface AttemptResult {
188
188
  state: string
189
189
  error: TestError | null
190
- startedAt: dateTimeISO
191
- duration: ms
190
+ wallClockStartedAt: dateTimeISO
191
+ wallClockDuration: ms
192
192
  videoTimestamp: ms
193
193
  screenshots: ScreenshotInformation[]
194
194
  }
@@ -1901,15 +1901,17 @@ declare namespace Cypress {
1901
1901
  * cy.screenshot()
1902
1902
  * cy.get(".post").screenshot()
1903
1903
  */
1904
- screenshot(options?: Partial<Loggable & Timeoutable & ScreenshotOptions>): Chainable<null>
1904
+ screenshot(options?: Partial<Loggable & Timeoutable & ScreenshotOptions>): Chainable<Subject>
1905
+
1905
1906
  /**
1906
1907
  * Take a screenshot of the application under test and the Cypress Command Log and save under given filename.
1907
1908
  *
1908
1909
  * @see https://on.cypress.io/screenshot
1909
1910
  * @example
1911
+ * cy.screenshot("post-element")
1910
1912
  * cy.get(".post").screenshot("post-element")
1911
1913
  */
1912
- screenshot(fileName: string, options?: Partial<Loggable & Timeoutable & ScreenshotOptions>): Chainable<null>
1914
+ screenshot(fileName: string, options?: Partial<Loggable & Timeoutable & ScreenshotOptions>): Chainable<Subject>
1913
1915
 
1914
1916
  /**
1915
1917
  * Scroll an element into view.
@@ -6364,7 +6366,18 @@ declare namespace Cypress {
6364
6366
  stderr: string
6365
6367
  }
6366
6368
 
6367
- type FileReference = string | BufferType | FileReferenceObject
6369
+ type TypedArray =
6370
+ | Int8Array
6371
+ | Uint8Array
6372
+ | Uint8ClampedArray
6373
+ | Int16Array
6374
+ | Uint16Array
6375
+ | Int32Array
6376
+ | Uint32Array
6377
+ | Float32Array
6378
+ | Float64Array
6379
+
6380
+ type FileReference = string | BufferType | FileReferenceObject | TypedArray
6368
6381
  interface FileReferenceObject {
6369
6382
  /*
6370
6383
  * Buffers will be used as-is, while strings will be interpreted as an alias or a file path.