@rindo/core 1.17.4 → 2.5.2

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.
Files changed (164) hide show
  1. package/LICENSE.md +27 -27
  2. package/bin/cli.ts +20 -0
  3. package/bin/rindo +51 -56
  4. package/cli/index.cjs +1263 -0
  5. package/cli/index.d.ts +1 -1
  6. package/cli/index.js +1232 -495
  7. package/cli/package.json +9 -4
  8. package/compiler/lib.d.ts +24 -0
  9. package/compiler/lib.dom.d.ts +20230 -0
  10. package/compiler/lib.dom.iterable.d.ts +351 -0
  11. package/compiler/lib.es2015.collection.d.ts +89 -0
  12. package/compiler/lib.es2015.core.d.ts +517 -0
  13. package/compiler/lib.es2015.d.ts +30 -0
  14. package/compiler/lib.es2015.generator.d.ts +79 -0
  15. package/compiler/lib.es2015.iterable.d.ts +505 -0
  16. package/compiler/lib.es2015.promise.d.ts +150 -0
  17. package/compiler/lib.es2015.proxy.d.ts +41 -0
  18. package/compiler/lib.es2015.reflect.d.ts +123 -0
  19. package/compiler/lib.es2015.symbol.d.ts +48 -0
  20. package/compiler/lib.es2015.symbol.wellknown.d.ts +324 -0
  21. package/compiler/lib.es2016.array.include.d.ts +118 -0
  22. package/compiler/lib.es2016.d.ts +22 -0
  23. package/compiler/lib.es2016.full.d.ts +25 -0
  24. package/compiler/lib.es2017.d.ts +26 -0
  25. package/compiler/lib.es2017.full.d.ts +25 -0
  26. package/compiler/lib.es2017.intl.d.ts +32 -0
  27. package/compiler/lib.es2017.object.d.ts +51 -0
  28. package/compiler/lib.es2017.sharedmemory.d.ts +137 -0
  29. package/compiler/lib.es2017.string.d.ts +47 -0
  30. package/compiler/lib.es2017.typedarrays.d.ts +55 -0
  31. package/compiler/lib.es2018.asyncgenerator.d.ts +79 -0
  32. package/compiler/lib.es2018.asynciterable.d.ts +45 -0
  33. package/compiler/lib.es2018.d.ts +26 -0
  34. package/compiler/lib.es2018.full.d.ts +25 -0
  35. package/compiler/lib.es2018.intl.d.ts +61 -0
  36. package/compiler/lib.es2018.promise.d.ts +32 -0
  37. package/compiler/lib.es2018.regexp.d.ts +39 -0
  38. package/compiler/lib.es2019.array.d.ts +85 -0
  39. package/compiler/lib.es2019.d.ts +25 -0
  40. package/compiler/lib.es2019.full.d.ts +25 -0
  41. package/compiler/lib.es2019.object.d.ts +35 -0
  42. package/compiler/lib.es2019.string.d.ts +33 -0
  43. package/compiler/lib.es2019.symbol.d.ts +26 -0
  44. package/compiler/lib.es2020.bigint.d.ts +728 -0
  45. package/compiler/lib.es2020.d.ts +27 -0
  46. package/compiler/lib.es2020.full.d.ts +25 -0
  47. package/compiler/lib.es2020.intl.d.ts +310 -0
  48. package/compiler/lib.es2020.promise.d.ts +50 -0
  49. package/compiler/lib.es2020.sharedmemory.d.ts +99 -0
  50. package/compiler/lib.es2020.string.d.ts +30 -0
  51. package/compiler/lib.es2020.symbol.wellknown.d.ts +39 -0
  52. package/compiler/lib.es5.d.ts +4435 -0
  53. package/compiler/lib.es6.d.ts +25 -0
  54. package/compiler/lib.esnext.d.ts +25 -0
  55. package/compiler/lib.esnext.full.d.ts +25 -0
  56. package/compiler/lib.esnext.intl.d.ts +32 -0
  57. package/compiler/lib.esnext.promise.d.ts +43 -0
  58. package/compiler/lib.esnext.string.d.ts +35 -0
  59. package/compiler/lib.esnext.weakref.d.ts +75 -0
  60. package/compiler/lib.scripthost.d.ts +327 -0
  61. package/compiler/lib.webworker.d.ts +6042 -0
  62. package/compiler/lib.webworker.importscripts.d.ts +26 -0
  63. package/compiler/lib.webworker.iterable.d.ts +166 -0
  64. package/compiler/package.json +3 -3
  65. package/compiler/rindo.d.ts +0 -16
  66. package/compiler/rindo.js +42738 -40541
  67. package/compiler/rindo.min.js +2 -15
  68. package/dependencies.json +73 -50
  69. package/dev-server/client/index.js +33 -10
  70. package/dev-server/client/package.json +3 -3
  71. package/dev-server/connector.html +3 -3
  72. package/dev-server/index.d.ts +3 -6
  73. package/dev-server/index.js +256 -252
  74. package/dev-server/package.json +3 -3
  75. package/dev-server/server-process.js +1738 -0
  76. package/dev-server/server-worker-thread.js +39 -0
  77. package/dev-server/templates/initial-load.html +160 -160
  78. package/dev-server/ws.js +1 -1
  79. package/internal/app-data/{index.cjs.js → index.cjs} +7 -5
  80. package/internal/app-data/index.d.ts +1 -0
  81. package/internal/app-data/index.js +7 -6
  82. package/internal/app-data/package.json +11 -5
  83. package/internal/client/css-shim.js +2 -2
  84. package/internal/client/dom.js +1 -1
  85. package/internal/client/index.js +193 -119
  86. package/internal/client/package.json +4 -3
  87. package/internal/client/{patch.js → patch-browser.js} +8 -24
  88. package/internal/client/patch-esm.js +23 -0
  89. package/internal/client/polyfills/css-shim.js +1 -1
  90. package/internal/client/polyfills/index.js +34 -34
  91. package/internal/client/shadow-css.js +9 -3
  92. package/internal/hydrate/index.js +305 -281
  93. package/internal/hydrate/package.json +2 -2
  94. package/internal/hydrate/runner.d.ts +24 -12
  95. package/internal/hydrate/runner.js +153 -124
  96. package/internal/hydrate/shadow-css.js +24 -24
  97. package/internal/package.json +5 -4
  98. package/internal/rindo-core/index.cjs +1 -0
  99. package/internal/rindo-core/index.d.ts +51 -2
  100. package/internal/rindo-core/index.js +15 -1
  101. package/internal/rindo-ext-modules.d.ts +41 -39
  102. package/internal/rindo-private.d.ts +93 -148
  103. package/internal/rindo-public-compiler.d.ts +231 -155
  104. package/internal/rindo-public-runtime.d.ts +42 -39
  105. package/internal/testing/index.js +144 -121
  106. package/internal/testing/package.json +2 -2
  107. package/internal/testing/shadow-css.js +24 -24
  108. package/mock-doc/index.cjs +4610 -0
  109. package/mock-doc/index.d.ts +12 -1
  110. package/mock-doc/index.js +177 -67
  111. package/mock-doc/package.json +11 -5
  112. package/package.json +132 -133
  113. package/readme.md +21 -95
  114. package/screenshot/compare/build/app.js +33 -33
  115. package/screenshot/compare/build/p-f4745c2f.entry.js +1 -1
  116. package/screenshot/connector-base.d.ts +1 -1
  117. package/screenshot/connector-local.d.ts +1 -1
  118. package/screenshot/index.js +63 -46
  119. package/screenshot/package.json +10 -3
  120. package/screenshot/pixel-match.js +54 -57
  121. package/screenshot/screenshot-compare.d.ts +1 -1
  122. package/screenshot/screenshot-fs.d.ts +1 -1
  123. package/sys/deno/index.js +1785 -0
  124. package/sys/deno/node-compat.js +2654 -0
  125. package/sys/deno/worker.js +44 -0
  126. package/sys/node/autoprefixer.js +8 -1
  127. package/sys/node/glob.js +1 -1
  128. package/sys/node/graceful-fs.js +1 -1
  129. package/sys/node/index.d.ts +1 -1
  130. package/sys/node/index.js +689 -705
  131. package/sys/node/node-fetch.js +1 -1
  132. package/sys/node/package.json +3 -3
  133. package/sys/node/prompts.js +1 -1
  134. package/sys/node/worker.js +38 -19
  135. package/testing/index.d.ts +3 -3
  136. package/testing/index.js +863 -749
  137. package/testing/jest/jest-config.d.ts +2 -89
  138. package/testing/jest/jest-environment.d.ts +1 -1
  139. package/testing/jest/jest-runner.d.ts +1 -1
  140. package/testing/jest/jest-screenshot.d.ts +1 -1
  141. package/testing/jest-preset.js +32 -32
  142. package/testing/matchers/events.d.ts +1 -1
  143. package/testing/matchers/screenshot.d.ts +1 -1
  144. package/testing/mock-fetch.d.ts +1 -1
  145. package/testing/mocks.d.ts +1 -1
  146. package/testing/package.json +3 -3
  147. package/testing/puppeteer/index.d.ts +1 -1
  148. package/testing/puppeteer/puppeteer-browser.d.ts +2 -2
  149. package/testing/puppeteer/puppeteer-declarations.d.ts +11 -11
  150. package/testing/puppeteer/puppeteer-element.d.ts +3 -3
  151. package/testing/puppeteer/puppeteer-emulate.d.ts +1 -1
  152. package/testing/puppeteer/puppeteer-events.d.ts +3 -3
  153. package/testing/puppeteer/puppeteer-page.d.ts +1 -1
  154. package/testing/puppeteer/puppeteer-screenshot.d.ts +2 -2
  155. package/testing/reset-build-conditionals.d.ts +1 -1
  156. package/testing/spec-page.d.ts +1 -1
  157. package/testing/test-transpile.d.ts +1 -1
  158. package/testing/testing-logger.d.ts +1 -1
  159. package/testing/testing-utils.d.ts +1 -1
  160. package/testing/testing.d.ts +1 -1
  161. package/cli/index.cjs.js +0 -524
  162. package/dev-server/content-type-db.json +0 -1
  163. package/dev-server/server-worker.js +0 -1570
  164. package/mock-doc/index.cjs.js +0 -4500
@@ -1,20 +1,22 @@
1
1
  'use strict';
2
2
 
3
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
4
6
 
5
- var fs = _interopDefault(require('fs'));
6
- var path = require('path');
7
- var path__default = _interopDefault(path);
8
- var os = require('os');
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
10
+ const path__default = /*#__PURE__*/_interopDefaultLegacy(path);
9
11
 
10
12
  function fileExists(filePath) {
11
13
  return new Promise(resolve => {
12
- fs.access(filePath, (err) => resolve(!err));
14
+ fs__default['default'].access(filePath, (err) => resolve(!err));
13
15
  });
14
16
  }
15
17
  function readFile(filePath) {
16
18
  return new Promise((resolve, reject) => {
17
- fs.readFile(filePath, 'utf-8', (err, data) => {
19
+ fs__default['default'].readFile(filePath, 'utf-8', (err, data) => {
18
20
  if (err) {
19
21
  reject(err);
20
22
  }
@@ -26,7 +28,7 @@ function readFile(filePath) {
26
28
  }
27
29
  function readFileBuffer(filePath) {
28
30
  return new Promise((resolve, reject) => {
29
- fs.readFile(filePath, (err, data) => {
31
+ fs__default['default'].readFile(filePath, (err, data) => {
30
32
  if (err) {
31
33
  reject(err);
32
34
  }
@@ -38,7 +40,7 @@ function readFileBuffer(filePath) {
38
40
  }
39
41
  function writeFile(filePath, data) {
40
42
  return new Promise((resolve, reject) => {
41
- fs.writeFile(filePath, data, (err) => {
43
+ fs__default['default'].writeFile(filePath, data, (err) => {
42
44
  if (err) {
43
45
  reject(err);
44
46
  }
@@ -50,14 +52,14 @@ function writeFile(filePath, data) {
50
52
  }
51
53
  function mkDir(filePath) {
52
54
  return new Promise(resolve => {
53
- fs.mkdir(filePath, () => {
55
+ fs__default['default'].mkdir(filePath, () => {
54
56
  resolve();
55
57
  });
56
58
  });
57
59
  }
58
60
  function rmDir(filePath) {
59
61
  return new Promise(resolve => {
60
- fs.rmdir(filePath, () => {
62
+ fs__default['default'].rmdir(filePath, () => {
61
63
  resolve();
62
64
  });
63
65
  });
@@ -65,7 +67,7 @@ function rmDir(filePath) {
65
67
  async function emptyDir(dir) {
66
68
  const files = await readDir(dir);
67
69
  const promises = files.map(async (fileName) => {
68
- const filePath = path__default.join(dir, fileName);
70
+ const filePath = path__default['default'].join(dir, fileName);
69
71
  const isDirFile = await isFile(filePath);
70
72
  if (isDirFile) {
71
73
  await unlink(filePath);
@@ -75,7 +77,7 @@ async function emptyDir(dir) {
75
77
  }
76
78
  async function readDir(dir) {
77
79
  return new Promise(resolve => {
78
- fs.readdir(dir, (err, files) => {
80
+ fs__default['default'].readdir(dir, (err, files) => {
79
81
  if (err) {
80
82
  resolve([]);
81
83
  }
@@ -87,7 +89,7 @@ async function readDir(dir) {
87
89
  }
88
90
  async function isFile(itemPath) {
89
91
  return new Promise(resolve => {
90
- fs.stat(itemPath, (err, stat) => {
92
+ fs__default['default'].stat(itemPath, (err, stat) => {
91
93
  if (err) {
92
94
  resolve(false);
93
95
  }
@@ -99,7 +101,7 @@ async function isFile(itemPath) {
99
101
  }
100
102
  async function unlink(filePath) {
101
103
  return new Promise(resolve => {
102
- fs.unlink(filePath, () => {
104
+ fs__default['default'].unlink(filePath, () => {
103
105
  resolve();
104
106
  });
105
107
  });
@@ -120,7 +122,8 @@ class ScreenshotConnector {
120
122
  this.buildAuthor = opts.buildAuthor;
121
123
  this.buildUrl = opts.buildUrl;
122
124
  this.previewUrl = opts.previewUrl;
123
- (this.buildTimestamp = typeof opts.buildTimestamp === 'number' ? opts.buildTimestamp : Date.now()), (this.cacheDir = opts.cacheDir);
125
+ (this.buildTimestamp = typeof opts.buildTimestamp === 'number' ? opts.buildTimestamp : Date.now()),
126
+ (this.cacheDir = opts.cacheDir);
124
127
  this.packageDir = opts.packageDir;
125
128
  this.rootDir = opts.rootDir;
126
129
  this.appNamespace = opts.appNamespace;
@@ -168,7 +171,12 @@ class ScreenshotConnector {
168
171
  this.logger.debug(`currentBuildDir: ${this.currentBuildDir}`);
169
172
  this.logger.debug(`cacheDir: ${this.cacheDir}`);
170
173
  await mkDir(this.screenshotDir);
171
- await Promise.all([mkDir(this.imagesDir), mkDir(this.buildsDir), mkDir(this.currentBuildDir), mkDir(this.cacheDir)]);
174
+ await Promise.all([
175
+ mkDir(this.imagesDir),
176
+ mkDir(this.buildsDir),
177
+ mkDir(this.currentBuildDir),
178
+ mkDir(this.cacheDir),
179
+ ]);
172
180
  }
173
181
  async pullMasterBuild() {
174
182
  /**/
@@ -182,7 +190,9 @@ class ScreenshotConnector {
182
190
  return masterBuild;
183
191
  }
184
192
  async completeBuild(masterBuild) {
185
- const filePaths = (await readDir(this.currentBuildDir)).map(f => path.join(this.currentBuildDir, f)).filter(f => f.endsWith('.json'));
193
+ const filePaths = (await readDir(this.currentBuildDir))
194
+ .map(f => path.join(this.currentBuildDir, f))
195
+ .filter(f => f.endsWith('.json'));
186
196
  const screenshots = await Promise.all(filePaths.map(async (f) => JSON.parse(await readFile(f))));
187
197
  this.sortScreenshots(screenshots);
188
198
  if (!masterBuild) {
@@ -441,7 +451,11 @@ const normalizePath = (path) => {
441
451
  if (normalized === '') {
442
452
  return '.';
443
453
  }
444
- if (rootPart === '' && secondPart && path.includes('/') && !secondPart.startsWith('.') && !secondPart.startsWith('@')) {
454
+ if (rootPart === '' &&
455
+ secondPart &&
456
+ path.includes('/') &&
457
+ !secondPart.startsWith('.') &&
458
+ !secondPart.startsWith('@')) {
445
459
  return './' + normalized;
446
460
  }
447
461
  return normalized;
@@ -512,7 +526,9 @@ const getEncodedRootLength = (path) => {
512
526
  // special case interpreted as "the machine from which the URL is being interpreted".
513
527
  const scheme = path.slice(0, schemeEnd);
514
528
  const authority = path.slice(authorityStart, authorityEnd);
515
- if (scheme === 'file' && (authority === '' || authority === 'localhost') && isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
529
+ if (scheme === 'file' &&
530
+ (authority === '' || authority === 'localhost') &&
531
+ isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
516
532
  const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
517
533
  if (volumeSeparatorEnd !== -1) {
518
534
  if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) {
@@ -533,7 +549,8 @@ const getEncodedRootLength = (path) => {
533
549
  // relative
534
550
  return 0;
535
551
  };
536
- const isVolumeCharacter = (charCode) => (charCode >= 97 /* a */ && charCode <= 122 /* z */) || (charCode >= 65 /* A */ && charCode <= 90 /* Z */);
552
+ const isVolumeCharacter = (charCode) => (charCode >= 97 /* a */ && charCode <= 122 /* z */) ||
553
+ (charCode >= 65 /* A */ && charCode <= 90 /* Z */);
537
554
  const getFileUrlVolumeSeparatorEnd = (url, start) => {
538
555
  const ch0 = url.charCodeAt(start);
539
556
  if (ch0 === 58 /* colon */)
@@ -610,31 +627,31 @@ class ScreenshotLocalConnector extends ScreenshotConnector {
610
627
  }
611
628
  }
612
629
  function createLocalCompareApp(namespace, appSrcUrl, imagesUrl, jsonpUrl, a, b) {
613
- return `<!doctype html>
614
- <html dir="ltr" lang="en">
615
- <head>
616
- <meta charset="utf-8">
617
- <title>Local ${namespace || ''} - Rindo Screenshot Visual Diff</title>
618
- <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
619
- <meta http-equiv="x-ua-compatible" content="IE=Edge">
620
- <link href="${appSrcUrl}/build/app.css" rel="stylesheet">
621
- <script type="module" src="${appSrcUrl}/build/app.esm.js"></script>
622
- <script nomodule src="${appSrcUrl}/build/app.js"></script>
623
- <link rel="icon" type="image/x-icon" href="${appSrcUrl}/assets/favicon.ico">
624
- </head>
625
- <body>
626
- <script>
627
- (function() {
628
- var app = document.createElement('screenshot-compare');
629
- app.appSrcUrl = '${appSrcUrl}';
630
- app.imagesUrl = '${imagesUrl}/';
631
- app.jsonpUrl = '${jsonpUrl}/';
632
- app.a = ${JSON.stringify(a)};
633
- app.b = ${JSON.stringify(b)};
634
- document.body.appendChild(app);
635
- })();
636
- </script>
637
- </body>
630
+ return `<!doctype html>
631
+ <html dir="ltr" lang="en">
632
+ <head>
633
+ <meta charset="utf-8">
634
+ <title>Local ${namespace || ''} - Rindo Screenshot Visual Diff</title>
635
+ <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
636
+ <meta http-equiv="x-ua-compatible" content="IE=Edge">
637
+ <link href="${appSrcUrl}/build/app.css" rel="stylesheet">
638
+ <script type="module" src="${appSrcUrl}/build/app.esm.js"></script>
639
+ <script nomodule src="${appSrcUrl}/build/app.js"></script>
640
+ <link rel="icon" type="image/x-icon" href="${appSrcUrl}/assets/favicon.ico">
641
+ </head>
642
+ <body>
643
+ <script>
644
+ (function() {
645
+ var app = document.createElement('screenshot-compare');
646
+ app.appSrcUrl = '${appSrcUrl}';
647
+ app.imagesUrl = '${imagesUrl}/';
648
+ app.jsonpUrl = '${jsonpUrl}/';
649
+ app.a = ${JSON.stringify(a)};
650
+ app.b = ${JSON.stringify(b)};
651
+ document.body.appendChild(app);
652
+ })();
653
+ </script>
654
+ </body>
638
655
  </html>`;
639
656
  }
640
657
 
@@ -1,8 +1,15 @@
1
1
  {
2
2
  "name": "@rindo/core/screenshot",
3
- "version": "0.0.0-dev.20221104122636",
3
+ "version": "2.5.2",
4
4
  "description": "Rindo Screenshot.",
5
- "main": "index.js",
6
- "types": "index.d.ts",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "files": [
8
+ "compare/",
9
+ "index.js",
10
+ "connector.js",
11
+ "local-connector.js",
12
+ "pixel-match.js"
13
+ ],
7
14
  "private": true
8
15
  }
@@ -1,13 +1,20 @@
1
1
  'use strict';
2
2
 
3
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
-
5
- var fs = _interopDefault(require('fs'));
6
- var util = _interopDefault(require('util'));
7
- var stream = _interopDefault(require('stream'));
8
- var zlib = _interopDefault(require('zlib'));
9
- var assert = _interopDefault(require('assert'));
10
- var buffer = _interopDefault(require('buffer'));
3
+ var fs = require('fs');
4
+ var util = require('util');
5
+ var Stream = require('stream');
6
+ var zlib = require('zlib');
7
+ var require$$0 = require('assert');
8
+ var require$$1 = require('buffer');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
13
+ var util__default = /*#__PURE__*/_interopDefaultLegacy(util);
14
+ var Stream__default = /*#__PURE__*/_interopDefaultLegacy(Stream);
15
+ var zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);
16
+ var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
17
+ var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
11
18
 
12
19
  var pixelmatch_1 = pixelmatch;
13
20
 
@@ -168,11 +175,11 @@ function grayPixel(img, i) {
168
175
 
169
176
  function createCommonjsModule(fn, basedir, module) {
170
177
  return module = {
171
- path: basedir,
172
- exports: {},
173
- require: function (path, base) {
174
- return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
175
- }
178
+ path: basedir,
179
+ exports: {},
180
+ require: function (path, base) {
181
+ return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
182
+ }
176
183
  }, fn(module, module.exports), module.exports;
177
184
  }
178
185
 
@@ -188,7 +195,7 @@ var chunkstream = createCommonjsModule(function (module) {
188
195
 
189
196
 
190
197
  var ChunkStream = module.exports = function() {
191
- stream.call(this);
198
+ Stream__default['default'].call(this);
192
199
 
193
200
  this._buffers = [];
194
201
  this._buffered = 0;
@@ -199,7 +206,7 @@ var ChunkStream = module.exports = function() {
199
206
  this._encoding = 'utf8';
200
207
  this.writable = true;
201
208
  };
202
- util.inherits(ChunkStream, stream);
209
+ util__default['default'].inherits(ChunkStream, Stream__default['default']);
203
210
 
204
211
 
205
212
  ChunkStream.prototype.read = function(length, callback) {
@@ -695,7 +702,7 @@ var FilterAsync = module.exports = function(bitmapInfo) {
695
702
 
696
703
  this._filter.start();
697
704
  };
698
- util.inherits(FilterAsync, chunkstream);
705
+ util__default['default'].inherits(FilterAsync, chunkstream);
699
706
  });
700
707
 
701
708
  var constants = {
@@ -1450,7 +1457,7 @@ var ParserAsync = module.exports = function(options) {
1450
1457
 
1451
1458
  this._parser.start();
1452
1459
  };
1453
- util.inherits(ParserAsync, chunkstream);
1460
+ util__default['default'].inherits(ParserAsync, chunkstream);
1454
1461
 
1455
1462
 
1456
1463
  ParserAsync.prototype._handleError = function(err) {
@@ -1479,7 +1486,7 @@ ParserAsync.prototype._handleError = function(err) {
1479
1486
  ParserAsync.prototype._inflateData = function(data) {
1480
1487
  if (!this._inflate) {
1481
1488
  if (this._bitmapInfo.interlace) {
1482
- this._inflate = zlib.createInflate();
1489
+ this._inflate = zlib__default['default'].createInflate();
1483
1490
 
1484
1491
  this._inflate.on('error', this.emit.bind(this, 'error'));
1485
1492
  this._filter.on('complete', this._complete.bind(this));
@@ -1489,9 +1496,9 @@ ParserAsync.prototype._inflateData = function(data) {
1489
1496
  else {
1490
1497
  var rowSize = ((this._bitmapInfo.width * this._bitmapInfo.bpp * this._bitmapInfo.depth + 7) >> 3) + 1;
1491
1498
  var imageSize = rowSize * this._bitmapInfo.height;
1492
- var chunkSize = Math.max(imageSize, zlib.Z_MIN_CHUNK);
1499
+ var chunkSize = Math.max(imageSize, zlib__default['default'].Z_MIN_CHUNK);
1493
1500
 
1494
- this._inflate = zlib.createInflate({ chunkSize: chunkSize });
1501
+ this._inflate = zlib__default['default'].createInflate({ chunkSize: chunkSize });
1495
1502
  var leftToInflate = imageSize;
1496
1503
 
1497
1504
  var emitError = this.emit.bind(this, 'error');
@@ -1928,7 +1935,7 @@ var Packer = module.exports = function(options) {
1928
1935
  options.deflateLevel = options.deflateLevel != null ? options.deflateLevel : 9;
1929
1936
  options.deflateStrategy = options.deflateStrategy != null ? options.deflateStrategy : 3;
1930
1937
  options.inputHasAlpha = options.inputHasAlpha != null ? options.inputHasAlpha : true;
1931
- options.deflateFactory = options.deflateFactory || zlib.createDeflate;
1938
+ options.deflateFactory = options.deflateFactory || zlib__default['default'].createDeflate;
1932
1939
  options.bitDepth = options.bitDepth || 8;
1933
1940
  // This is outputColorType
1934
1941
  options.colorType = (typeof options.colorType === 'number') ? options.colorType : constants.COLORTYPE_COLOR_ALPHA;
@@ -2030,7 +2037,7 @@ var packerAsync = createCommonjsModule(function (module) {
2030
2037
 
2031
2038
 
2032
2039
  var PackerAsync = module.exports = function(opt) {
2033
- stream.call(this);
2040
+ Stream__default['default'].call(this);
2034
2041
 
2035
2042
  var options = opt || {};
2036
2043
 
@@ -2039,7 +2046,7 @@ var PackerAsync = module.exports = function(opt) {
2039
2046
 
2040
2047
  this.readable = true;
2041
2048
  };
2042
- util.inherits(PackerAsync, stream);
2049
+ util__default['default'].inherits(PackerAsync, Stream__default['default']);
2043
2050
 
2044
2051
 
2045
2052
  PackerAsync.prototype.pack = function(data, width, height, gamma) {
@@ -2071,22 +2078,22 @@ PackerAsync.prototype.pack = function(data, width, height, gamma) {
2071
2078
 
2072
2079
  var syncInflate = createCommonjsModule(function (module, exports) {
2073
2080
 
2074
- var assert$1 = assert.ok;
2081
+ var assert = require$$0__default['default'].ok;
2075
2082
 
2076
2083
 
2077
2084
 
2078
- var kMaxLength = buffer.kMaxLength;
2085
+ var kMaxLength = require$$1__default['default'].kMaxLength;
2079
2086
 
2080
2087
  function Inflate(opts) {
2081
2088
  if (!(this instanceof Inflate)) {
2082
2089
  return new Inflate(opts);
2083
2090
  }
2084
2091
 
2085
- if (opts && opts.chunkSize < zlib.Z_MIN_CHUNK) {
2086
- opts.chunkSize = zlib.Z_MIN_CHUNK;
2092
+ if (opts && opts.chunkSize < zlib__default['default'].Z_MIN_CHUNK) {
2093
+ opts.chunkSize = zlib__default['default'].Z_MIN_CHUNK;
2087
2094
  }
2088
2095
 
2089
- zlib.Inflate.call(this, opts);
2096
+ zlib__default['default'].Inflate.call(this, opts);
2090
2097
 
2091
2098
  // Node 8 --> 9 compatibility check
2092
2099
  this._offset = this._offset === undefined ? this._outOffset : this._offset;
@@ -2117,7 +2124,7 @@ function _close(engine, callback) {
2117
2124
 
2118
2125
  Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) {
2119
2126
  if (typeof asyncCb === 'function') {
2120
- return zlib.Inflate._processChunk.call(this, chunk, flushFlag, asyncCb);
2127
+ return zlib__default['default'].Inflate._processChunk.call(this, chunk, flushFlag, asyncCb);
2121
2128
  }
2122
2129
 
2123
2130
  var self = this;
@@ -2141,7 +2148,7 @@ Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) {
2141
2148
  }
2142
2149
 
2143
2150
  var have = availOutBefore - availOutAfter;
2144
- assert$1(have >= 0, 'have should not go down');
2151
+ assert(have >= 0, 'have should not go down');
2145
2152
 
2146
2153
  if (have > 0) {
2147
2154
  var out = self._buffer.slice(self._offset, self._offset + have);
@@ -2176,7 +2183,7 @@ Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) {
2176
2183
  return false;
2177
2184
  }
2178
2185
 
2179
- assert$1(this._handle, 'zlib binding closed');
2186
+ assert(this._handle, 'zlib binding closed');
2180
2187
  do {
2181
2188
  var res = this._handle.writeSync(flushFlag,
2182
2189
  chunk, // in
@@ -2204,7 +2211,7 @@ Inflate.prototype._processChunk = function(chunk, flushFlag, asyncCb) {
2204
2211
  return buf;
2205
2212
  };
2206
2213
 
2207
- util.inherits(Inflate, zlib.Inflate);
2214
+ util__default['default'].inherits(Inflate, zlib__default['default'].Inflate);
2208
2215
 
2209
2216
  function zlibBufferSync(engine, buffer) {
2210
2217
  if (typeof buffer === 'string') {
@@ -2216,7 +2223,7 @@ function zlibBufferSync(engine, buffer) {
2216
2223
 
2217
2224
  var flushFlag = engine._finishFlushFlag;
2218
2225
  if (flushFlag == null) {
2219
- flushFlag = zlib.Z_FINISH;
2226
+ flushFlag = zlib__default['default'].Z_FINISH;
2220
2227
  }
2221
2228
 
2222
2229
  return engine._processChunk(buffer, flushFlag);
@@ -2231,9 +2238,6 @@ exports.Inflate = Inflate;
2231
2238
  exports.createInflate = createInflate;
2232
2239
  exports.inflateSync = inflateSync;
2233
2240
  });
2234
- var syncInflate_1 = syncInflate.Inflate;
2235
- var syncInflate_2 = syncInflate.createInflate;
2236
- var syncInflate_3 = syncInflate.inflateSync;
2237
2241
 
2238
2242
  var syncReader = createCommonjsModule(function (module) {
2239
2243
 
@@ -2311,11 +2315,11 @@ var filterParseSync = {
2311
2315
  process: process_1
2312
2316
  };
2313
2317
 
2314
- var hasSyncZlib = true;
2318
+ var hasSyncZlib$1 = true;
2315
2319
 
2316
2320
 
2317
- if (!zlib.deflateSync) {
2318
- hasSyncZlib = false;
2321
+ if (!zlib__default['default'].deflateSync) {
2322
+ hasSyncZlib$1 = false;
2319
2323
  }
2320
2324
 
2321
2325
 
@@ -2326,7 +2330,7 @@ if (!zlib.deflateSync) {
2326
2330
 
2327
2331
  var parserSync = function(buffer, options) {
2328
2332
 
2329
- if (!hasSyncZlib) {
2333
+ if (!hasSyncZlib$1) {
2330
2334
  throw new Error('To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0');
2331
2335
  }
2332
2336
 
@@ -2388,7 +2392,7 @@ var parserSync = function(buffer, options) {
2388
2392
 
2389
2393
  var inflatedData;
2390
2394
  if (metaData.interlace) {
2391
- inflatedData = zlib.inflateSync(inflateData);
2395
+ inflatedData = zlib__default['default'].inflateSync(inflateData);
2392
2396
  }
2393
2397
  else {
2394
2398
  var rowSize = ((metaData.width * metaData.bpp * metaData.depth + 7) >> 3) + 1;
@@ -2415,17 +2419,17 @@ var parserSync = function(buffer, options) {
2415
2419
  return metaData;
2416
2420
  };
2417
2421
 
2418
- var hasSyncZlib$1 = true;
2422
+ var hasSyncZlib = true;
2419
2423
 
2420
- if (!zlib.deflateSync) {
2421
- hasSyncZlib$1 = false;
2424
+ if (!zlib__default['default'].deflateSync) {
2425
+ hasSyncZlib = false;
2422
2426
  }
2423
2427
 
2424
2428
 
2425
2429
 
2426
2430
  var packerSync = function(metaData, opt) {
2427
2431
 
2428
- if (!hasSyncZlib$1) {
2432
+ if (!hasSyncZlib) {
2429
2433
  throw new Error('To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0');
2430
2434
  }
2431
2435
 
@@ -2448,7 +2452,7 @@ var packerSync = function(metaData, opt) {
2448
2452
  var filteredData = packer$1.filterData(metaData.data, metaData.width, metaData.height);
2449
2453
 
2450
2454
  // compress it
2451
- var compressedData = zlib.deflateSync(filteredData, packer$1.getDeflateOptions());
2455
+ var compressedData = zlib__default['default'].deflateSync(filteredData, packer$1.getDeflateOptions());
2452
2456
  filteredData = null;
2453
2457
 
2454
2458
  if (!compressedData || !compressedData.length) {
@@ -2487,7 +2491,7 @@ var png = createCommonjsModule(function (module, exports) {
2487
2491
 
2488
2492
 
2489
2493
  var PNG = exports.PNG = function(options) {
2490
- stream.call(this);
2494
+ Stream__default['default'].call(this);
2491
2495
 
2492
2496
  options = options || {}; // eslint-disable-line no-param-reassign
2493
2497
 
@@ -2523,7 +2527,7 @@ var PNG = exports.PNG = function(options) {
2523
2527
  this._packer.on('error', this.emit.bind(this, 'error'));
2524
2528
 
2525
2529
  };
2526
- util.inherits(PNG, stream);
2530
+ util__default['default'].inherits(PNG, Stream__default['default']);
2527
2531
 
2528
2532
  PNG.sync = pngSync;
2529
2533
 
@@ -2651,17 +2655,10 @@ PNG.prototype.adjustGamma = function() {
2651
2655
  PNG.adjustGamma(this);
2652
2656
  };
2653
2657
  });
2654
- var png_1 = png.PNG;
2655
2658
 
2656
2659
  function getMismatchedPixels(pixelMatchInput) {
2657
- const imgA = fs
2658
- .createReadStream(pixelMatchInput.imageAPath)
2659
- .pipe(new png_1())
2660
- .on('parsed', doneReading);
2661
- const imgB = fs
2662
- .createReadStream(pixelMatchInput.imageBPath)
2663
- .pipe(new png_1())
2664
- .on('parsed', doneReading);
2660
+ const imgA = fs__default['default'].createReadStream(pixelMatchInput.imageAPath).pipe(new png.PNG()).on('parsed', doneReading);
2661
+ const imgB = fs__default['default'].createReadStream(pixelMatchInput.imageBPath).pipe(new png.PNG()).on('parsed', doneReading);
2665
2662
  let filesRead = 0;
2666
2663
  function doneReading() {
2667
2664
  if (++filesRead < 2)
@@ -1,3 +1,3 @@
1
1
  /// <reference types="node" />
2
- import * as d from '@rindo/core/internal';
2
+ import type * as d from '@rindo/core/internal';
3
3
  export declare function compareScreenshot(emulateConfig: d.EmulateConfig, screenshotBuildData: d.ScreenshotBuildData, currentScreenshotBuf: Buffer, desc: string, width: number, height: number, testPath: string, pixelmatchThreshold: number): Promise<d.ScreenshotDiff>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import * as d from '@rindo/core/internal';
2
+ import type * as d from '@rindo/core/internal';
3
3
  export declare function writeScreenshotImage(imagePath: string, screenshotBuf: Buffer): Promise<void>;
4
4
  export declare function writeScreenshotData(dataDir: string, screenshotData: d.Screenshot): Promise<void>;
5
5
  export declare function readScreenshotData(dataDir: string, screenshotId: string): Promise<d.Screenshot>;