@atlaspack/utils 2.14.5-canary.12 → 2.14.5-canary.120
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 +103 -0
- package/benchmark.js +23 -0
- package/lib/index.js +54 -4
- package/lib/index.js.map +1 -1
- package/package.json +10 -8
- package/src/collection.js +10 -0
- package/src/debug-tools.js +45 -0
- package/src/index.js +6 -1
- package/src/progress-message.js +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,108 @@
|
|
|
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
|
+
|
|
3
106
|
## 2.14.5
|
|
4
107
|
|
|
5
108
|
### 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,15 +3447,18 @@ $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);
|
|
3458
3460
|
$parcel$export(module.exports, "getProgressMessage", () => $c7ef478f9ae183ff$export$d28945a2f2ba5e30);
|
|
3461
|
+
$parcel$export(module.exports, "getPackageProgressMessage", () => $c7ef478f9ae183ff$export$df997a457f5acd40);
|
|
3459
3462
|
$parcel$export(module.exports, "isGlob", () => $15bfa4acd6ec1793$export$f3a2344a73dbdd42);
|
|
3460
3463
|
$parcel$export(module.exports, "isGlobMatch", () => $15bfa4acd6ec1793$export$16e6d319a883f04e);
|
|
3461
3464
|
$parcel$export(module.exports, "globMatch", () => $15bfa4acd6ec1793$export$73b12c6cc27aa6c0);
|
|
@@ -33886,7 +33889,7 @@ async function $d8ed9adb8bea7573$export$2e2bcd8739ae039(diagnostic, options, ter
|
|
|
33886
33889
|
let { origin: origin, message: message, stack: stack, codeFrames: codeFrames, hints: hints, skipFormatting: skipFormatting, documentationURL: documentationURL } = diagnostic;
|
|
33887
33890
|
const md = format === 'ansi' ? (0, ($parcel$interopDefault($iBiQ5$atlaspackmarkdownansi))) : (0, $96d5d01cd0db6227$export$2e2bcd8739ae039);
|
|
33888
33891
|
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>`;
|
|
33892
|
+
(text, url, _)=>`<a href="${url}">${text}</a>`;
|
|
33890
33893
|
const chalk = format === 'ansi' ? (0, ($parcel$interopDefault($iBiQ5$chalk))) : {
|
|
33891
33894
|
gray: {
|
|
33892
33895
|
underline: (v)=>`<span style="color: grey; text-decoration: underline;">${v}</span>`
|
|
@@ -33974,13 +33977,14 @@ class $8b0b2852bcb1a5b2$export$2e2bcd8739ae039 {
|
|
|
33974
33977
|
add(fn) {
|
|
33975
33978
|
new Promise((resolve, reject)=>{
|
|
33976
33979
|
let i = this._count++;
|
|
33977
|
-
|
|
33980
|
+
let wrapped = ()=>fn().then((result)=>{
|
|
33978
33981
|
this._results[i] = result;
|
|
33979
33982
|
resolve(result);
|
|
33980
33983
|
}, (err)=>{
|
|
33981
33984
|
reject(err);
|
|
33982
33985
|
throw err;
|
|
33983
|
-
})
|
|
33986
|
+
});
|
|
33987
|
+
this._queue.push(wrapped);
|
|
33984
33988
|
for (const addFn of this._addSubscriptions)addFn();
|
|
33985
33989
|
if (this._numRunning > 0 && this._numRunning < this._maxConcurrent) this._next();
|
|
33986
33990
|
}).catch(()=>{});
|
|
@@ -34491,7 +34495,7 @@ function $7eb0d819da9341a5$export$2e2bcd8739ae039(fn, delay) {
|
|
|
34491
34495
|
|
|
34492
34496
|
function $3817081e001856b1$export$2e2bcd8739ae039(fn, delay) {
|
|
34493
34497
|
let lastCalled;
|
|
34494
|
-
return function(...args) {
|
|
34498
|
+
return function throttled(...args) {
|
|
34495
34499
|
if (lastCalled == null || lastCalled + delay <= Date.now()) {
|
|
34496
34500
|
fn.call(this, ...args);
|
|
34497
34501
|
lastCalled = Date.now();
|
|
@@ -36716,6 +36720,11 @@ function $2ee306eb47a905ca$export$be646fbd7a3fda37(a, b) {
|
|
|
36716
36720
|
function $2ee306eb47a905ca$export$9404cfefeb010e68(a, b) {
|
|
36717
36721
|
for (let entry of a)if (!b.has(entry)) a.delete(entry);
|
|
36718
36722
|
}
|
|
36723
|
+
function $2ee306eb47a905ca$export$25266bb285978950(a, b) {
|
|
36724
|
+
let intersection = new Set();
|
|
36725
|
+
for (let entry of a)if (b.has(entry)) intersection.add(entry);
|
|
36726
|
+
return intersection;
|
|
36727
|
+
}
|
|
36719
36728
|
function $2ee306eb47a905ca$export$667066422fa0af46(a, b) {
|
|
36720
36729
|
return new Set([
|
|
36721
36730
|
...a,
|
|
@@ -36732,6 +36741,31 @@ function $2ee306eb47a905ca$export$dd7d5a65a6b6780f(a, b) {
|
|
|
36732
36741
|
|
|
36733
36742
|
|
|
36734
36743
|
|
|
36744
|
+
/*
|
|
36745
|
+
* These tools are intended for Atlaspack developers, to provide extra utilities
|
|
36746
|
+
* to make debugging Atlaspack issues more straightforward.
|
|
36747
|
+
*
|
|
36748
|
+
* To enable a tool, set the `ATLASPACK_DEBUG_TOOLS` environment variable to a
|
|
36749
|
+
* comma-separated list of tool names. For example:
|
|
36750
|
+
* `ATLASPACK_DEBUG_TOOLS="asset-file-names-in-output,simple-cli-reporter"`
|
|
36751
|
+
*
|
|
36752
|
+
* You can enable all tools by setting `ATLASPACK_DEBUG_TOOLS=all`.
|
|
36753
|
+
*/ let $ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a = {
|
|
36754
|
+
'asset-file-names-in-output': false,
|
|
36755
|
+
'simple-cli-reporter': false
|
|
36756
|
+
};
|
|
36757
|
+
const $ffdf10a29a6c5be4$var$envVarValue = process.env.ATLASPACK_DEBUG_TOOLS ?? '';
|
|
36758
|
+
for (let tool of $ffdf10a29a6c5be4$var$envVarValue.split(',')){
|
|
36759
|
+
tool = tool.trim();
|
|
36760
|
+
if (tool === 'all') {
|
|
36761
|
+
for(let key in $ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a)$ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a[key] = true;
|
|
36762
|
+
break;
|
|
36763
|
+
} else if ($ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a.hasOwnProperty(tool)) $ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a[tool] = true;
|
|
36764
|
+
else if (tool === '') continue;
|
|
36765
|
+
else throw new Error(`Invalid debug tool option: ${tool}. Valid options are: ${Object.keys($ffdf10a29a6c5be4$export$1e74ad2a9c1ed72a).join(', ')}`);
|
|
36766
|
+
}
|
|
36767
|
+
|
|
36768
|
+
|
|
36735
36769
|
class $55fec6b523c8f068$export$674cd7dcb504ac5c extends Map {
|
|
36736
36770
|
constructor(getDefault, entries){
|
|
36737
36771
|
super(entries);
|
|
@@ -36778,9 +36812,15 @@ function $c7ef478f9ae183ff$export$d28945a2f2ba5e30(event) {
|
|
|
36778
36812
|
return `Packaging ${event.bundle.displayName}...`;
|
|
36779
36813
|
case 'optimizing':
|
|
36780
36814
|
return `Optimizing ${event.bundle.displayName}...`;
|
|
36815
|
+
case 'packagingAndOptimizing':
|
|
36816
|
+
return $c7ef478f9ae183ff$export$df997a457f5acd40(event.completeBundles, event.totalBundles);
|
|
36781
36817
|
}
|
|
36782
36818
|
return null;
|
|
36783
36819
|
}
|
|
36820
|
+
function $c7ef478f9ae183ff$export$df997a457f5acd40(completeBundles, totalBundles) {
|
|
36821
|
+
let percent = Math.floor(completeBundles / totalBundles * 100);
|
|
36822
|
+
return `Packaging bundles ${completeBundles}/${totalBundles} (${percent}%)`;
|
|
36823
|
+
}
|
|
36784
36824
|
|
|
36785
36825
|
|
|
36786
36826
|
|
|
@@ -36807,6 +36847,16 @@ function $1e1fa42764ee5f95$export$3477f9615e12f61d(obj) {
|
|
|
36807
36847
|
let $1e1fa42764ee5f95$var$testCache = {
|
|
36808
36848
|
};
|
|
36809
36849
|
function $1e1fa42764ee5f95$export$42462553d605d8cd(fs, filePath) {
|
|
36850
|
+
if (process.env.ATLASPACK_BUILD_ENV === 'test') // Development builds of these native modules are especially big and slow to hash.
|
|
36851
|
+
{
|
|
36852
|
+
if (/parcel-swc\.[^\\/]+\.node$|lightningcss.[^\\/]+.node$/.test(filePath)) {
|
|
36853
|
+
let cacheEntry = $1e1fa42764ee5f95$var$testCache[filePath];
|
|
36854
|
+
if (cacheEntry) return cacheEntry;
|
|
36855
|
+
let v = $1e1fa42764ee5f95$export$8a9ede1a78d6a1fe(fs.createReadStream(filePath));
|
|
36856
|
+
$1e1fa42764ee5f95$var$testCache[filePath] = v;
|
|
36857
|
+
return v;
|
|
36858
|
+
}
|
|
36859
|
+
}
|
|
36810
36860
|
return $1e1fa42764ee5f95$export$8a9ede1a78d6a1fe(fs.createReadStream(filePath));
|
|
36811
36861
|
}
|
|
36812
36862
|
|