@atlaspack/utils 2.14.5-canary.11 → 2.14.5-canary.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,117 @@
1
1
  # @atlaspack/utils
2
2
 
3
+ ## 2.16.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`c75bf55`](https://github.com/atlassian-labs/atlaspack/commit/c75bf553fff4decc285b5fd499a275853b18f8f2)]:
8
+ - @atlaspack/rust@3.4.0
9
+ - @atlaspack/logger@2.14.12
10
+
11
+ ## 2.16.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#659](https://github.com/atlassian-labs/atlaspack/pull/659) [`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529) Thanks [@benjervis](https://github.com/benjervis)! - Add the debug-tools system for altering the behaviour when attempting to identify issues.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [[`e8a60ff`](https://github.com/atlassian-labs/atlaspack/commit/e8a60ffbea41caef265786bbf73349771760081c)]:
20
+ - @atlaspack/feature-flags@2.18.4
21
+
22
+ ## 2.15.3
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [[`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be)]:
27
+ - @atlaspack/feature-flags@2.18.3
28
+
29
+ ## 2.15.2
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
34
+ - @atlaspack/feature-flags@2.18.2
35
+
36
+ ## 2.15.1
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [[`ef3d622`](https://github.com/atlassian-labs/atlaspack/commit/ef3d6228f4e006702198a19c61e051d194d325cb), [`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b), [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca)]:
41
+ - @atlaspack/logger@2.14.11
42
+ - @atlaspack/feature-flags@2.18.1
43
+
44
+ ## 2.15.0
45
+
46
+ ### Minor Changes
47
+
48
+ - [#622](https://github.com/atlassian-labs/atlaspack/pull/622) [`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c) Thanks [@benjervis](https://github.com/benjervis)! - Add the `setIntersectStatic` method that doesn't mutate the passed in Sets
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [[`10fbcfb`](https://github.com/atlassian-labs/atlaspack/commit/10fbcfbfa49c7a83da5d7c40983e36e87f524a75), [`85c52d3`](https://github.com/atlassian-labs/atlaspack/commit/85c52d3f7717b3c84a118d18ab98cfbfd71dcbd2)]:
53
+ - @atlaspack/feature-flags@2.18.0
54
+
55
+ ## 2.14.11
56
+
57
+ ### Patch Changes
58
+
59
+ - Updated dependencies [[`73ea3c4`](https://github.com/atlassian-labs/atlaspack/commit/73ea3c4d85d4401fdd15abcbf988237e890e7ad3), [`b1b3693`](https://github.com/atlassian-labs/atlaspack/commit/b1b369317c66f8a431c170df2ebba4fa5b2e38ef)]:
60
+ - @atlaspack/feature-flags@2.17.0
61
+
62
+ ## 2.14.10
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [[`35fdd4b`](https://github.com/atlassian-labs/atlaspack/commit/35fdd4b52da0af20f74667f7b8adfb2f90279b7c), [`6dd4ccb`](https://github.com/atlassian-labs/atlaspack/commit/6dd4ccb753541de32322d881f973d571dd57e4ca)]:
67
+ - @atlaspack/rust@3.3.5
68
+ - @atlaspack/logger@2.14.10
69
+
70
+ ## 2.14.9
71
+
72
+ ### Patch Changes
73
+
74
+ - Updated dependencies [[`124b7ff`](https://github.com/atlassian-labs/atlaspack/commit/124b7fff44f71aac9fbad289a9a9509b3dfc9aaa), [`e052521`](https://github.com/atlassian-labs/atlaspack/commit/e0525210850ed1606146eb86991049cf567c5dec), [`15c6d70`](https://github.com/atlassian-labs/atlaspack/commit/15c6d7000bd89da876bc590aa75b17a619a41896), [`e4d966c`](https://github.com/atlassian-labs/atlaspack/commit/e4d966c3c9c4292c5013372ae65b10d19d4bacc6), [`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818), [`42a775d`](https://github.com/atlassian-labs/atlaspack/commit/42a775de8eec638ad188f3271964170d8c04d84b), [`29c2f10`](https://github.com/atlassian-labs/atlaspack/commit/29c2f106de9679adfb5afa04e1910471dc65a427), [`f4da1e1`](https://github.com/atlassian-labs/atlaspack/commit/f4da1e120e73eeb5e8b8927f05e88f04d6148c7b), [`1ef91fc`](https://github.com/atlassian-labs/atlaspack/commit/1ef91fcc863fdd2831511937083dbbc1263b3d9d)]:
75
+ - @atlaspack/rust@3.3.4
76
+ - @atlaspack/feature-flags@2.16.0
77
+ - @atlaspack/logger@2.14.9
78
+
79
+ ## 2.14.8
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [[`30f6017`](https://github.com/atlassian-labs/atlaspack/commit/30f60175ba4d272c5fc193973c63bc298584775b), [`1ab0a27`](https://github.com/atlassian-labs/atlaspack/commit/1ab0a275aeca40350415e2b03e7440d1dddc6228), [`b8a4ae8`](https://github.com/atlassian-labs/atlaspack/commit/b8a4ae8f83dc0a83d8b145c5f729936ce52080a3)]:
84
+ - @atlaspack/feature-flags@2.15.1
85
+ - @atlaspack/rust@3.3.3
86
+ - @atlaspack/logger@2.14.8
87
+
88
+ ## 2.14.7
89
+
90
+ ### Patch Changes
91
+
92
+ - Updated dependencies [[`a1773d2`](https://github.com/atlassian-labs/atlaspack/commit/a1773d2a62d0ef7805ac7524621dcabcc1afe929), [`556d6ab`](https://github.com/atlassian-labs/atlaspack/commit/556d6ab8ede759fa7f37fcd3f4da336ef1c55e8f)]:
93
+ - @atlaspack/feature-flags@2.15.0
94
+ - @atlaspack/logger@2.14.7
95
+ - @atlaspack/rust@3.3.2
96
+
97
+ ## 2.14.6
98
+
99
+ ### Patch Changes
100
+
101
+ - Updated dependencies [[`e0f5337`](https://github.com/atlassian-labs/atlaspack/commit/e0f533757bd1019dbd108a04952c87da15286e09)]:
102
+ - @atlaspack/feature-flags@2.14.4
103
+ - @atlaspack/rust@3.3.1
104
+ - @atlaspack/logger@2.14.6
105
+
106
+ ## 2.14.5
107
+
108
+ ### Patch Changes
109
+
110
+ - Updated dependencies [[`11d6f16`](https://github.com/atlassian-labs/atlaspack/commit/11d6f16b6397dee2f217167e5c98b39edb63f7a7), [`e2ba0f6`](https://github.com/atlassian-labs/atlaspack/commit/e2ba0f69702656f3d1ce95ab1454e35062b13b39), [`d2c50c2`](https://github.com/atlassian-labs/atlaspack/commit/d2c50c2c020888b33bb25b8690d9320c2b69e2a6), [`46a90dc`](https://github.com/atlassian-labs/atlaspack/commit/46a90dccd019a26b222c878a92d23acc75dc67c5)]:
111
+ - @atlaspack/feature-flags@2.14.3
112
+ - @atlaspack/rust@3.3.0
113
+ - @atlaspack/logger@2.14.5
114
+
3
115
  ## 2.14.4
4
116
 
5
117
  ### Patch Changes
package/benchmark.js ADDED
@@ -0,0 +1,23 @@
1
+ require('@atlaspack/babel-register');
2
+ const b = require('benny');
3
+
4
+ const {setIntersect, setIntersectStatic} = require('./src/collection.js');
5
+
6
+ const setA = new Set([
7
+ 23, 25, 29, 29, 12, 16, 14, 23, 18, 19, 16, 24, 9, 29, 26,
8
+ ]);
9
+ const setB = new Set([24, 1, 3, 6, 1, 3, 1, 5, 20, 15, 21, 23, 13, 16, 6]);
10
+
11
+ b.suite(
12
+ 'Collection - set intersection',
13
+ b.add('Control', () => {
14
+ const setClone = new Set(setA);
15
+ return () => setIntersect(setClone, setB);
16
+ }),
17
+ b.add('setIntersectStatic', () => {
18
+ setIntersectStatic(setA, setB);
19
+ }),
20
+ b.configure({minSamples: 100}),
21
+ b.cycle(),
22
+ b.complete(),
23
+ );
package/lib/index.js CHANGED
@@ -3447,11 +3447,13 @@ $parcel$export(module.exports, "setDifference", () => $2ee306eb47a905ca$export$8
3447
3447
  $parcel$export(module.exports, "setSymmetricDifference", () => $2ee306eb47a905ca$export$be646fbd7a3fda37);
3448
3448
  $parcel$export(module.exports, "setEqual", () => $2ee306eb47a905ca$export$dd7d5a65a6b6780f);
3449
3449
  $parcel$export(module.exports, "setIntersect", () => $2ee306eb47a905ca$export$9404cfefeb010e68);
3450
+ $parcel$export(module.exports, "setIntersectStatic", () => $2ee306eb47a905ca$export$25266bb285978950);
3450
3451
  $parcel$export(module.exports, "setUnion", () => $2ee306eb47a905ca$export$667066422fa0af46);
3451
3452
  $parcel$export(module.exports, "resolveConfig", () => $cc7044c885d3b7c6$export$7eca4ea16d4c8343);
3452
3453
  $parcel$export(module.exports, "resolveConfigSync", () => $cc7044c885d3b7c6$export$d175e66e9fcd7b75);
3453
3454
  $parcel$export(module.exports, "loadConfig", () => $cc7044c885d3b7c6$export$c1a4367d4847eb06);
3454
3455
  $parcel$export(module.exports, "readConfig", () => $cc7044c885d3b7c6$export$f5327b421858c8cd);
3456
+ $parcel$export(module.exports, "debugTools", () => $ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a);
3455
3457
  $parcel$export(module.exports, "DefaultMap", () => $55fec6b523c8f068$export$674cd7dcb504ac5c);
3456
3458
  $parcel$export(module.exports, "DefaultWeakMap", () => $55fec6b523c8f068$export$4924f7ffab2ae440);
3457
3459
  $parcel$export(module.exports, "makeDeferredWithPromise", () => $355246d1b0980665$export$93f345b3f0dd27e7);
@@ -33886,7 +33888,7 @@ async function $d8ed9adb8bea7573$export$2e2bcd8739ae039(diagnostic, options, ter
33886
33888
  let { origin: origin, message: message, stack: stack, codeFrames: codeFrames, hints: hints, skipFormatting: skipFormatting, documentationURL: documentationURL } = diagnostic;
33887
33889
  const md = format === 'ansi' ? (0, ($parcel$interopDefault($iBiQ5$atlaspackmarkdownansi))) : (0, $96d5d01cd0db6227$export$2e2bcd8739ae039);
33888
33890
  const terminalLink = format === 'ansi' ? (0, (/*@__PURE__*/$parcel$interopDefault($b071885206b3ac48$exports))) : // eslint-disable-next-line no-unused-vars
33889
- (text, url)=>`<a href="${url}">${text}</a>`;
33891
+ (text, url, _)=>`<a href="${url}">${text}</a>`;
33890
33892
  const chalk = format === 'ansi' ? (0, ($parcel$interopDefault($iBiQ5$chalk))) : {
33891
33893
  gray: {
33892
33894
  underline: (v)=>`<span style="color: grey; text-decoration: underline;">${v}</span>`
@@ -33974,13 +33976,14 @@ class $8b0b2852bcb1a5b2$export$2e2bcd8739ae039 {
33974
33976
  add(fn) {
33975
33977
  new Promise((resolve, reject)=>{
33976
33978
  let i = this._count++;
33977
- this._queue.push(()=>fn().then((result)=>{
33979
+ let wrapped = ()=>fn().then((result)=>{
33978
33980
  this._results[i] = result;
33979
33981
  resolve(result);
33980
33982
  }, (err)=>{
33981
33983
  reject(err);
33982
33984
  throw err;
33983
- }));
33985
+ });
33986
+ this._queue.push(wrapped);
33984
33987
  for (const addFn of this._addSubscriptions)addFn();
33985
33988
  if (this._numRunning > 0 && this._numRunning < this._maxConcurrent) this._next();
33986
33989
  }).catch(()=>{});
@@ -34491,7 +34494,7 @@ function $7eb0d819da9341a5$export$2e2bcd8739ae039(fn, delay) {
34491
34494
 
34492
34495
  function $3817081e001856b1$export$2e2bcd8739ae039(fn, delay) {
34493
34496
  let lastCalled;
34494
- return function(...args) {
34497
+ return function throttled(...args) {
34495
34498
  if (lastCalled == null || lastCalled + delay <= Date.now()) {
34496
34499
  fn.call(this, ...args);
34497
34500
  lastCalled = Date.now();
@@ -36716,6 +36719,11 @@ function $2ee306eb47a905ca$export$be646fbd7a3fda37(a, b) {
36716
36719
  function $2ee306eb47a905ca$export$9404cfefeb010e68(a, b) {
36717
36720
  for (let entry of a)if (!b.has(entry)) a.delete(entry);
36718
36721
  }
36722
+ function $2ee306eb47a905ca$export$25266bb285978950(a, b) {
36723
+ let intersection = new Set();
36724
+ for (let entry of a)if (b.has(entry)) intersection.add(entry);
36725
+ return intersection;
36726
+ }
36719
36727
  function $2ee306eb47a905ca$export$667066422fa0af46(a, b) {
36720
36728
  return new Set([
36721
36729
  ...a,
@@ -36732,6 +36740,31 @@ function $2ee306eb47a905ca$export$dd7d5a65a6b6780f(a, b) {
36732
36740
 
36733
36741
 
36734
36742
 
36743
+ /*
36744
+ * These tools are intended for Atlaspack developers, to provide extra utilities
36745
+ * to make debugging Atlaspack issues more straightforward.
36746
+ *
36747
+ * To enable a tool, set the `ATLASPACK_DEBUG_TOOLS` environment variable to a
36748
+ * comma-separated list of tool names. For example:
36749
+ * `ATLASPACK_DEBUG_TOOLS="asset-file-names-in-output,simple-cli-reporter"`
36750
+ *
36751
+ * You can enable all tools by setting `ATLASPACK_DEBUG_TOOLS=all`.
36752
+ */ let $ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a = {
36753
+ 'asset-file-names-in-output': false,
36754
+ 'simple-cli-reporter': false
36755
+ };
36756
+ const $ffdf10a29a6c5be4$var$envVarValue = process.env.ATLASPACK_DEBUG_TOOLS ?? '';
36757
+ for (let tool of $ffdf10a29a6c5be4$var$envVarValue.split(',')){
36758
+ tool = tool.trim();
36759
+ if (tool === 'all') {
36760
+ for(let key in $ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a)$ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a[key] = true;
36761
+ break;
36762
+ } else if ($ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a.hasOwnProperty(tool)) $ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a[tool] = true;
36763
+ else if (tool === '') continue;
36764
+ else throw new Error(`Invalid debug tool option: ${tool}. Valid options are: ${Object.keys($ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a).join(', ')}`);
36765
+ }
36766
+
36767
+
36735
36768
  class $55fec6b523c8f068$export$674cd7dcb504ac5c extends Map {
36736
36769
  constructor(getDefault, entries){
36737
36770
  super(entries);
@@ -36807,6 +36840,16 @@ function $1e1fa42764ee5f95$export$3477f9615e12f61d(obj) {
36807
36840
  let $1e1fa42764ee5f95$var$testCache = {
36808
36841
  };
36809
36842
  function $1e1fa42764ee5f95$export$42462553d605d8cd(fs, filePath) {
36843
+ if (process.env.ATLASPACK_BUILD_ENV === 'test') // Development builds of these native modules are especially big and slow to hash.
36844
+ {
36845
+ if (/parcel-swc\.[^\\/]+\.node$|lightningcss.[^\\/]+.node$/.test(filePath)) {
36846
+ let cacheEntry = $1e1fa42764ee5f95$var$testCache[filePath];
36847
+ if (cacheEntry) return cacheEntry;
36848
+ let v = $1e1fa42764ee5f95$export$8a9ede1a78d6a1fe(fs.createReadStream(filePath));
36849
+ $1e1fa42764ee5f95$var$testCache[filePath] = v;
36850
+ return v;
36851
+ }
36852
+ }
36810
36853
  return $1e1fa42764ee5f95$export$8a9ede1a78d6a1fe(fs.createReadStream(filePath));
36811
36854
  }
36812
36855