@atlaspack/utils 2.17.2 → 2.17.3-typescript-08dcc1c9b.0

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 (70) hide show
  1. package/LICENSE +201 -0
  2. package/lib/DefaultMap.js +0 -4
  3. package/lib/config.js +3 -1
  4. package/lib/debug-tools.js +1 -0
  5. package/lib/generateCertificate.js +2 -0
  6. package/lib/glob.js +14 -4
  7. package/lib/index.js +164 -9
  8. package/lib/is-url.js +2 -0
  9. package/lib/objectHash.js +0 -1
  10. package/lib/prettyDiagnostic.js +3 -5
  11. package/lib/schema.js +38 -19
  12. package/lib/shared-buffer.js +1 -1
  13. package/lib/urlJoin.js +1 -1
  14. package/package.json +18 -13
  15. package/src/{DefaultMap.js → DefaultMap.ts} +8 -12
  16. package/src/Deferred.ts +26 -0
  17. package/src/{PromiseQueue.js → PromiseQueue.ts} +41 -36
  18. package/src/{TapStream.js → TapStream.ts} +8 -7
  19. package/src/{alternatives.js → alternatives.ts} +14 -15
  20. package/src/{ansi-html.js → ansi-html.ts} +0 -1
  21. package/src/{blob.js → blob.ts} +2 -4
  22. package/src/{bundle-url.js → bundle-url.ts} +3 -5
  23. package/src/{collection.js → collection.ts} +14 -21
  24. package/src/{config.js → config.ts} +18 -19
  25. package/src/{countLines.js → countLines.ts} +0 -2
  26. package/src/{debounce.js → debounce.ts} +3 -5
  27. package/src/{debug-tools.js → debug-tools.ts} +6 -8
  28. package/src/{dependency-location.js → dependency-location.ts} +15 -11
  29. package/src/{escape-html.js → escape-html.ts} +5 -3
  30. package/src/{generateBuildMetrics.js → generateBuildMetrics.ts} +16 -18
  31. package/src/{generateCertificate.js → generateCertificate.ts} +8 -5
  32. package/src/{getCertificate.js → getCertificate.ts} +5 -3
  33. package/src/{getExisting.js → getExisting.ts} +4 -3
  34. package/src/{getModuleParts.js → getModuleParts.ts} +3 -2
  35. package/src/{getRootDir.js → getRootDir.ts} +0 -2
  36. package/src/{glob.js → glob.ts} +16 -11
  37. package/src/{hash.js → hash.ts} +22 -17
  38. package/src/{http-server.js → http-server.ts} +32 -38
  39. package/src/{index.js → index.ts} +7 -8
  40. package/src/{is-url.js → is-url.ts} +1 -2
  41. package/src/{isDirectoryInside.js → isDirectoryInside.ts} +0 -1
  42. package/src/{objectHash.js → objectHash.ts} +1 -4
  43. package/src/{openInBrowser.js → openInBrowser.ts} +2 -4
  44. package/src/{parseCSSImport.js → parseCSSImport.ts} +0 -2
  45. package/src/{path.js → path.ts} +1 -3
  46. package/src/{prettifyTime.js → prettifyTime.ts} +0 -2
  47. package/src/{prettyDiagnostic.js → prettyDiagnostic.ts} +22 -20
  48. package/src/{progress-message.js → progress-message.ts} +3 -2
  49. package/src/{relativeBundlePath.js → relativeBundlePath.ts} +3 -3
  50. package/src/{relativeUrl.js → relativeUrl.ts} +0 -1
  51. package/src/{replaceBundleReferences.js → replaceBundleReferences.ts} +54 -36
  52. package/src/{schema.js → schema.ts} +158 -141
  53. package/src/{shared-buffer.js → shared-buffer.ts} +6 -4
  54. package/src/{sourcemap.js → sourcemap.ts} +16 -6
  55. package/src/{stream.js → stream.ts} +29 -21
  56. package/src/throttle.ts +13 -0
  57. package/src/{urlJoin.js → urlJoin.ts} +1 -3
  58. package/test/{DefaultMap.test.js → DefaultMap.test.ts} +4 -6
  59. package/test/{PromiseQueue.test.js → PromiseQueue.test.ts} +5 -6
  60. package/test/{collection.test.js → collection.test.ts} +0 -2
  61. package/test/{config.test.js → config.test.ts} +0 -3
  62. package/test/{objectHash.test.js → objectHash.test.ts} +4 -5
  63. package/test/{prettifyTime.test.js → prettifyTime.test.ts} +0 -1
  64. package/test/{replaceBundleReferences.test.js → replaceBundleReferences.test.ts} +0 -32
  65. package/test/{sourcemap.test.js → sourcemap.test.ts} +0 -1
  66. package/test/{throttle.test.js → throttle.test.ts} +1 -3
  67. package/test/{urlJoin.test.js → urlJoin.test.ts} +0 -2
  68. package/tsconfig.json +4 -0
  69. package/src/Deferred.js +0 -23
  70. package/src/throttle.js +0 -15
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright (c) 2024 Atlassian US., Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/lib/DefaultMap.js CHANGED
@@ -17,8 +17,6 @@ class DefaultMap extends Map {
17
17
  ret = this._getDefault(key);
18
18
  this.set(key, ret);
19
19
  }
20
-
21
- // $FlowFixMe
22
20
  return ret;
23
21
  }
24
22
  }
@@ -38,8 +36,6 @@ class DefaultWeakMap extends WeakMap {
38
36
  ret = this._getDefault(key);
39
37
  this.set(key, ret);
40
38
  }
41
-
42
- // $FlowFixMe
43
39
  return ret;
44
40
  }
45
41
  }
package/lib/config.js CHANGED
@@ -50,6 +50,9 @@ function _lruCache() {
50
50
  return data;
51
51
  }
52
52
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
53
+ // @ts-expect-error TS7016
54
+
55
+ // @ts-expect-error TS2351
53
56
  const configCache = new (_lruCache().default)({
54
57
  max: 500
55
58
  });
@@ -81,7 +84,6 @@ async function loadConfig(fs, filepath, filenames, projectRoot, opts) {
81
84
  let extname = _path().default.extname(configFile).slice(1);
82
85
  if (extname === 'js' || extname === 'cjs') {
83
86
  let output = {
84
- // $FlowFixMe
85
87
  config: (0, _clone().default)(module.require(configFile)),
86
88
  files: [{
87
89
  filePath: configFile
@@ -14,6 +14,7 @@ exports.debugTools = void 0;
14
14
  *
15
15
  * You can enable all tools by setting `ATLASPACK_DEBUG_TOOLS=all`.
16
16
  */
17
+
17
18
  let debugTools = exports.debugTools = {
18
19
  'asset-file-names-in-output': false,
19
20
  'simple-cli-reporter': false
@@ -26,6 +26,8 @@ function _logger() {
26
26
  return data;
27
27
  }
28
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
+ // @ts-expect-error TS7016
30
+
29
31
  async function generateCertificate(fs, cacheDir, host) {
30
32
  let certDirectory = cacheDir;
31
33
  const privateKeyPath = _path().default.join(certDirectory, 'private.pem');
package/lib/glob.js CHANGED
@@ -34,6 +34,12 @@ var _path = require("./path");
34
34
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
35
35
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
36
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
+ // @ts-expect-error TS7016
38
+
39
+ // @ts-expect-error TS2305
40
+
41
+ // @ts-expect-error TS7016
42
+
37
43
  function isGlob(p) {
38
44
  return (0, _isGlob2().default)((0, _path.normalizeSeparators)(p));
39
45
  }
@@ -49,32 +55,34 @@ function globToRegex(glob, opts) {
49
55
  return (0, _micromatch().makeRe)(glob, opts);
50
56
  }
51
57
  function globSync(p, fs, options) {
52
- // $FlowFixMe
53
58
  options = {
54
59
  ...options,
55
60
  fs: {
61
+ // @ts-expect-error TS7006
56
62
  statSync: p => {
57
63
  return fs.statSync(p);
58
64
  },
65
+ // @ts-expect-error TS7006
59
66
  lstatSync: p => {
60
67
  // Our FileSystem interface doesn't have lstat support at the moment,
61
68
  // but this is fine for our purposes since we follow symlinks by default.
62
69
  return fs.statSync(p);
63
70
  },
71
+ // @ts-expect-error TS7006
64
72
  readdirSync: (p, opts) => {
65
73
  return fs.readdirSync(p, opts);
66
74
  }
67
75
  }
68
76
  };
69
77
 
70
- // $FlowFixMe
78
+ // @ts-expect-error TS2322
71
79
  return _fastGlob().default.sync((0, _path.normalizeSeparators)(p), options);
72
80
  }
73
81
  function glob(p, fs, options) {
74
- // $FlowFixMe
75
82
  options = {
76
83
  ...options,
77
84
  fs: {
85
+ // @ts-expect-error TS7006
78
86
  stat: async (p, cb) => {
79
87
  try {
80
88
  cb(null, await fs.stat(p));
@@ -82,6 +90,7 @@ function glob(p, fs, options) {
82
90
  cb(err);
83
91
  }
84
92
  },
93
+ // @ts-expect-error TS7006
85
94
  lstat: async (p, cb) => {
86
95
  // Our FileSystem interface doesn't have lstat support at the moment,
87
96
  // but this is fine for our purposes since we follow symlinks by default.
@@ -91,6 +100,7 @@ function glob(p, fs, options) {
91
100
  cb(err);
92
101
  }
93
102
  },
103
+ // @ts-expect-error TS7006
94
104
  readdir: async (p, opts, cb) => {
95
105
  if (typeof opts === 'function') {
96
106
  cb = opts;
@@ -105,6 +115,6 @@ function glob(p, fs, options) {
105
115
  }
106
116
  };
107
117
 
108
- // $FlowFixMe Added in Flow 0.121.0 upgrade in #4381
118
+ // @ts-expect-error TS2322
109
119
  return (0, _fastGlob().default)((0, _path.normalizeSeparators)(p), options);
110
120
  }
package/lib/index.js CHANGED
@@ -3,6 +3,84 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _exportNames = {
7
+ resolveConfig: true,
8
+ resolveConfigSync: true,
9
+ loadConfig: true,
10
+ readConfig: true,
11
+ makeDeferredWithPromise: true,
12
+ generateBuildMetrics: true,
13
+ createHTTPServer: true,
14
+ normalizePath: true,
15
+ normalizeSeparators: true,
16
+ relativePath: true,
17
+ prettyDiagnostic: true,
18
+ validateSchema: true,
19
+ fuzzySearch: true,
20
+ countLines: true,
21
+ generateCertificate: true,
22
+ getCertificate: true,
23
+ getModuleParts: true,
24
+ getRootDir: true,
25
+ isDirectoryInside: true,
26
+ isURL: true,
27
+ objectHash: true,
28
+ prettifyTime: true,
29
+ PromiseQueue: true,
30
+ TapStream: true,
31
+ urlJoin: true,
32
+ relativeUrl: true,
33
+ createDependencyLocation: true,
34
+ debounce: true,
35
+ throttle: true,
36
+ openInBrowser: true,
37
+ findAlternativeNodeModules: true,
38
+ findAlternativeFiles: true,
39
+ blobToBuffer: true,
40
+ blobToString: true,
41
+ unique: true,
42
+ objectSortedEntries: true,
43
+ objectSortedEntriesDeep: true,
44
+ setDifference: true,
45
+ setSymmetricDifference: true,
46
+ setEqual: true,
47
+ setIntersect: true,
48
+ setIntersectStatic: true,
49
+ setUnion: true,
50
+ debugTools: true,
51
+ DefaultMap: true,
52
+ DefaultWeakMap: true,
53
+ getProgressMessage: true,
54
+ getPackageProgressMessage: true,
55
+ isGlob: true,
56
+ isGlobMatch: true,
57
+ globMatch: true,
58
+ globSync: true,
59
+ glob: true,
60
+ globToRegex: true,
61
+ hashStream: true,
62
+ hashObject: true,
63
+ hashFile: true,
64
+ SharedBuffer: true,
65
+ replaceURLReferences: true,
66
+ replaceInlineReferences: true,
67
+ measureStreamLength: true,
68
+ readableFromStringOrBuffer: true,
69
+ bufferStream: true,
70
+ blobToStream: true,
71
+ streamFromPromise: true,
72
+ fallbackStream: true,
73
+ relativeBundlePath: true,
74
+ ansiHtml: true,
75
+ escapeHTML: true,
76
+ SOURCEMAP_RE: true,
77
+ SOURCEMAP_EXTENSIONS: true,
78
+ matchSourceMappingURL: true,
79
+ loadSourceMapUrl: true,
80
+ loadSourceMap: true,
81
+ remapSourceLocation: true,
82
+ stripAnsi: true
83
+ };
6
84
  Object.defineProperty(exports, "DefaultMap", {
7
85
  enumerable: true,
8
86
  get: function () {
@@ -459,8 +537,91 @@ Object.defineProperty(exports, "validateSchema", {
459
537
  return _schema.default;
460
538
  }
461
539
  });
540
+ var _config = require("./config");
541
+ Object.keys(_config).forEach(function (key) {
542
+ if (key === "default" || key === "__esModule") return;
543
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
544
+ if (key in exports && exports[key] === _config[key]) return;
545
+ Object.defineProperty(exports, key, {
546
+ enumerable: true,
547
+ get: function () {
548
+ return _config[key];
549
+ }
550
+ });
551
+ });
552
+ var _Deferred = require("./Deferred");
553
+ Object.keys(_Deferred).forEach(function (key) {
554
+ if (key === "default" || key === "__esModule") return;
555
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
556
+ if (key in exports && exports[key] === _Deferred[key]) return;
557
+ Object.defineProperty(exports, key, {
558
+ enumerable: true,
559
+ get: function () {
560
+ return _Deferred[key];
561
+ }
562
+ });
563
+ });
564
+ var _generateBuildMetrics = _interopRequireWildcard(require("./generateBuildMetrics"));
565
+ Object.keys(_generateBuildMetrics).forEach(function (key) {
566
+ if (key === "default" || key === "__esModule") return;
567
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
568
+ if (key in exports && exports[key] === _generateBuildMetrics[key]) return;
569
+ Object.defineProperty(exports, key, {
570
+ enumerable: true,
571
+ get: function () {
572
+ return _generateBuildMetrics[key];
573
+ }
574
+ });
575
+ });
576
+ var _httpServer = require("./http-server");
577
+ Object.keys(_httpServer).forEach(function (key) {
578
+ if (key === "default" || key === "__esModule") return;
579
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
580
+ if (key in exports && exports[key] === _httpServer[key]) return;
581
+ Object.defineProperty(exports, key, {
582
+ enumerable: true,
583
+ get: function () {
584
+ return _httpServer[key];
585
+ }
586
+ });
587
+ });
588
+ var _path = require("./path");
589
+ Object.keys(_path).forEach(function (key) {
590
+ if (key === "default" || key === "__esModule") return;
591
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
592
+ if (key in exports && exports[key] === _path[key]) return;
593
+ Object.defineProperty(exports, key, {
594
+ enumerable: true,
595
+ get: function () {
596
+ return _path[key];
597
+ }
598
+ });
599
+ });
600
+ var _prettyDiagnostic = _interopRequireWildcard(require("./prettyDiagnostic"));
601
+ Object.keys(_prettyDiagnostic).forEach(function (key) {
602
+ if (key === "default" || key === "__esModule") return;
603
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
604
+ if (key in exports && exports[key] === _prettyDiagnostic[key]) return;
605
+ Object.defineProperty(exports, key, {
606
+ enumerable: true,
607
+ get: function () {
608
+ return _prettyDiagnostic[key];
609
+ }
610
+ });
611
+ });
612
+ var _schema = _interopRequireWildcard(require("./schema"));
613
+ Object.keys(_schema).forEach(function (key) {
614
+ if (key === "default" || key === "__esModule") return;
615
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
616
+ if (key in exports && exports[key] === _schema[key]) return;
617
+ Object.defineProperty(exports, key, {
618
+ enumerable: true,
619
+ get: function () {
620
+ return _schema[key];
621
+ }
622
+ });
623
+ });
462
624
  var _countLines = _interopRequireDefault(require("./countLines"));
463
- var _generateBuildMetrics = _interopRequireDefault(require("./generateBuildMetrics"));
464
625
  var _generateCertificate = _interopRequireDefault(require("./generateCertificate"));
465
626
  var _getCertificate = _interopRequireDefault(require("./getCertificate"));
466
627
  var _getModuleParts = _interopRequireDefault(require("./getModuleParts"));
@@ -469,9 +630,7 @@ var _isDirectoryInside = _interopRequireDefault(require("./isDirectoryInside"));
469
630
  var _isUrl = _interopRequireDefault(require("./is-url"));
470
631
  var _objectHash = _interopRequireDefault(require("./objectHash"));
471
632
  var _prettifyTime = _interopRequireDefault(require("./prettifyTime"));
472
- var _prettyDiagnostic = _interopRequireDefault(require("./prettyDiagnostic"));
473
633
  var _PromiseQueue = _interopRequireDefault(require("./PromiseQueue"));
474
- var _schema = _interopRequireWildcard(require("./schema"));
475
634
  var _TapStream = _interopRequireDefault(require("./TapStream"));
476
635
  var _urlJoin = _interopRequireDefault(require("./urlJoin"));
477
636
  var _relativeUrl = _interopRequireDefault(require("./relativeUrl"));
@@ -482,16 +641,12 @@ var _openInBrowser = _interopRequireDefault(require("./openInBrowser"));
482
641
  var _alternatives = require("./alternatives");
483
642
  var _blob = require("./blob");
484
643
  var _collection = require("./collection");
485
- var _config = require("./config");
486
644
  var _debugTools = require("./debug-tools");
487
645
  var _DefaultMap = require("./DefaultMap");
488
- var _Deferred = require("./Deferred");
489
646
  var _progressMessage = require("./progress-message");
490
647
  var _glob = require("./glob");
491
648
  var _hash = require("./hash");
492
649
  var _sharedBuffer = require("./shared-buffer");
493
- var _httpServer = require("./http-server");
494
- var _path = require("./path");
495
650
  var _replaceBundleReferences = require("./replaceBundleReferences");
496
651
  var _stream = require("./stream");
497
652
  var _relativeBundlePath = require("./relativeBundlePath");
@@ -505,6 +660,6 @@ function _stripAnsi() {
505
660
  };
506
661
  return data;
507
662
  }
663
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
508
664
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
509
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
510
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
665
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
package/lib/is-url.js CHANGED
@@ -12,6 +12,8 @@ function _isUrl() {
12
12
  return data;
13
13
  }
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ // @ts-expect-error TS7016
16
+
15
17
  // Matches anchor (ie: #raptors)
16
18
  const ANCHOR_REGEXP = /^#/;
17
19
 
package/lib/objectHash.js CHANGED
@@ -12,7 +12,6 @@ function _crypto() {
12
12
  return data;
13
13
  }
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
- // $FlowFixMe
16
15
  function objectHash(object) {
17
16
  let hash = _crypto().default.createHash('md5');
18
17
  for (let key of Object.keys(object).sort()) {
@@ -47,10 +47,10 @@ function _snarkdown() {
47
47
  return data;
48
48
  }
49
49
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
50
- // $FlowFixMe
51
50
  /* eslint-disable import/no-extraneous-dependencies */
52
- // $FlowFixMe
51
+
53
52
  /* eslint-enable import/no-extraneous-dependencies */
53
+
54
54
  async function prettyDiagnostic(diagnostic, options, terminalWidth, format = 'ansi') {
55
55
  let {
56
56
  origin,
@@ -94,9 +94,7 @@ async function prettyDiagnostic(diagnostic, options, terminalWidth, format = 'an
94
94
  formattedCodeFrame = (0, _codeframe().default)(code, highlights, {
95
95
  useColor: true,
96
96
  syntaxHighlighting: true,
97
- language:
98
- // $FlowFixMe sketchy null checks do not matter here...
99
- codeFrame.language || (filePath != null ? _path().default.extname(filePath).substr(1) : undefined),
97
+ language: codeFrame.language || (filePath != null ? _path().default.extname(filePath).substr(1) : undefined),
100
98
  terminalWidth
101
99
  });
102
100
  }