fyn 1.1.22 → 1.1.23
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/README.md +4 -3
- package/dist/fyn.js +272 -62
- package/dist/fyn.js.LICENSE.txt +81 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
[![NPM version][npm-image]][npm-url]
|
|
4
4
|
[![Apache 2.0 License][apache-2.0-blue-image]][apache-2.0-url]
|
|
5
|
-
[![Build Status][
|
|
5
|
+
[![Build Status][build-image]][build-url]
|
|
6
6
|
[![Coverage Status][coveralls-image]][coveralls-url]
|
|
7
|
-
[![Dependency Status][daviddm-image]][daviddm-url] [![devDependency Status][daviddm-dev-image]][daviddm-dev-url]
|
|
8
7
|
|
|
9
8
|
**fyn** is a node package manager that makes your disk a direct registry. It enables you to develop, publish, and test all your packages using local copies directly.
|
|
10
9
|
|
|
@@ -430,7 +429,7 @@ Other than benefiting from the massive package ecosystem and all the documents f
|
|
|
430
429
|
|
|
431
430
|
## License
|
|
432
431
|
|
|
433
|
-
Copyright (c) 2015-
|
|
432
|
+
Copyright (c) 2015-2021, WalmartLabs
|
|
434
433
|
|
|
435
434
|
Licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
|
|
436
435
|
|
|
@@ -465,3 +464,5 @@ Licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses
|
|
|
465
464
|
[npm link]: https://docs.npmjs.com/cli/link.html
|
|
466
465
|
[npm-lifecycle]: https://www.npmjs.com/package/npm-lifecycle
|
|
467
466
|
[npmlog]: https://www.npmjs.com/package/npmlog
|
|
467
|
+
[build-image]: https://github.com/jchip/fynpo/actions/workflows/ci.yml/badge.svg
|
|
468
|
+
[build-url]: https://github.com/jchip/fynpo/actions/workflows/ci.yml
|
package/dist/fyn.js
CHANGED
|
@@ -1682,10 +1682,13 @@ const nodeGyp = () => {
|
|
|
1682
1682
|
__webpack_require__("./node_modules/.f/_/node-gyp/8.4.1/node-gyp/bin/node-gyp.js");
|
|
1683
1683
|
};
|
|
1684
1684
|
|
|
1685
|
+
const hardLinkDir = __webpack_require__("./lib/util/hard-link-dir.js");
|
|
1686
|
+
|
|
1685
1687
|
module.exports = {
|
|
1686
1688
|
run,
|
|
1687
1689
|
fun,
|
|
1688
|
-
nodeGyp
|
|
1690
|
+
nodeGyp,
|
|
1691
|
+
hardLinkDir
|
|
1689
1692
|
};
|
|
1690
1693
|
|
|
1691
1694
|
/***/ }),
|
|
@@ -2468,7 +2471,7 @@ const {
|
|
|
2468
2471
|
AggregateError
|
|
2469
2472
|
} = __webpack_require__("./node_modules/.f/_/@jchip/error/1.0.3/@jchip/error/dist/index.js");
|
|
2470
2473
|
|
|
2471
|
-
const filterScanDir = __webpack_require__("./node_modules/.f/_/filter-scan-dir/1.
|
|
2474
|
+
const filterScanDir = __webpack_require__("./node_modules/.f/_/filter-scan-dir/1.5.0/filter-scan-dir/lib/index.js");
|
|
2472
2475
|
|
|
2473
2476
|
const Crypto = __webpack_require__("crypto");
|
|
2474
2477
|
/**
|
|
@@ -2619,6 +2622,16 @@ class FynCentral {
|
|
|
2619
2622
|
|
|
2620
2623
|
return info;
|
|
2621
2624
|
}
|
|
2625
|
+
/**
|
|
2626
|
+
* Get the hash of a npm package's extracted content.
|
|
2627
|
+
* - only consider the file names and their mtime and size because npm tar files
|
|
2628
|
+
* with a fixed timestamp to publish, so the mtime give us some assurance
|
|
2629
|
+
* to know if file changed.
|
|
2630
|
+
*
|
|
2631
|
+
* @param {*} integrity - shasum integrity for the package
|
|
2632
|
+
* @returns
|
|
2633
|
+
*/
|
|
2634
|
+
|
|
2622
2635
|
|
|
2623
2636
|
async getContentShasum(integrity) {
|
|
2624
2637
|
try {
|
|
@@ -2639,11 +2652,15 @@ class FynCentral {
|
|
|
2639
2652
|
cwd: packageDir,
|
|
2640
2653
|
filter,
|
|
2641
2654
|
filterDir: filter,
|
|
2642
|
-
|
|
2655
|
+
fullStat: true,
|
|
2656
|
+
// need full stat for mtimeMs and size prop
|
|
2657
|
+
concurrency: 500,
|
|
2658
|
+
sortFiles: false,
|
|
2659
|
+
// concurrency breaks sorting, sort files all at once after
|
|
2643
2660
|
includeDir: true
|
|
2644
2661
|
});
|
|
2645
2662
|
const hash = Crypto.createHash("sha512");
|
|
2646
|
-
const shaSum = hash.update(JSON.stringify(files)).digest("base64");
|
|
2663
|
+
const shaSum = hash.update(JSON.stringify(files.sort())).digest("base64");
|
|
2647
2664
|
return shaSum;
|
|
2648
2665
|
} catch (_err) {
|
|
2649
2666
|
return undefined;
|
|
@@ -10158,7 +10175,7 @@ async function cleanExtraDest(dest, destFiles) {
|
|
|
10158
10175
|
}
|
|
10159
10176
|
}
|
|
10160
10177
|
|
|
10161
|
-
const
|
|
10178
|
+
const SYM_FILES = Symbol("files");
|
|
10162
10179
|
/**
|
|
10163
10180
|
* Generate a tree of files using npm-pack that a package would publish with.
|
|
10164
10181
|
*
|
|
@@ -10166,26 +10183,27 @@ const FILES = Symbol("files");
|
|
|
10166
10183
|
* @returns
|
|
10167
10184
|
*/
|
|
10168
10185
|
|
|
10169
|
-
async function generatePackTree(path) {
|
|
10186
|
+
async function generatePackTree(path, _logger = logger) {
|
|
10170
10187
|
const files = await npmPacklist({
|
|
10171
10188
|
path,
|
|
10172
10189
|
includeSymlinks: fynTil.strToBool(process.env.FYN_LOCAL_PACK_SYMLINKS)
|
|
10173
10190
|
});
|
|
10174
|
-
|
|
10191
|
+
|
|
10192
|
+
_logger.debug(`local package linking - pack tree returned ${files.length} files to link`, JSON.stringify(files, null, 2));
|
|
10175
10193
|
|
|
10176
10194
|
if (files.length > 1000) {
|
|
10177
|
-
|
|
10195
|
+
_logger.warn(`Local linking package at ${path} has more than ${files.length} files.
|
|
10178
10196
|
>>> This is unusual, please check package .npmignore or 'files' in package.json <<<`);
|
|
10179
10197
|
}
|
|
10180
10198
|
|
|
10181
10199
|
const fmap = {
|
|
10182
|
-
[
|
|
10200
|
+
[SYM_FILES]: []
|
|
10183
10201
|
};
|
|
10184
10202
|
files.sort().forEach(filePath => {
|
|
10185
10203
|
const dir = Path.dirname(filePath);
|
|
10186
10204
|
|
|
10187
10205
|
if (dir === ".") {
|
|
10188
|
-
fmap[
|
|
10206
|
+
fmap[SYM_FILES].push(filePath);
|
|
10189
10207
|
return;
|
|
10190
10208
|
}
|
|
10191
10209
|
|
|
@@ -10194,13 +10212,13 @@ async function generatePackTree(path) {
|
|
|
10194
10212
|
dir.split("/").forEach(d => {
|
|
10195
10213
|
if (!dmap[d]) {
|
|
10196
10214
|
dmap[d] = {
|
|
10197
|
-
[
|
|
10215
|
+
[SYM_FILES]: []
|
|
10198
10216
|
};
|
|
10199
10217
|
}
|
|
10200
10218
|
|
|
10201
10219
|
dmap = dmap[d];
|
|
10202
10220
|
});
|
|
10203
|
-
dmap[
|
|
10221
|
+
dmap[SYM_FILES].push(Path.basename(filePath));
|
|
10204
10222
|
});
|
|
10205
10223
|
return fmap;
|
|
10206
10224
|
}
|
|
@@ -10362,7 +10380,7 @@ async function linkPackTree({
|
|
|
10362
10380
|
sym1,
|
|
10363
10381
|
sourceMaps
|
|
10364
10382
|
}) {
|
|
10365
|
-
const files = tree[
|
|
10383
|
+
const files = tree[SYM_FILES];
|
|
10366
10384
|
const destFiles = await prepDestDir(dest); //
|
|
10367
10385
|
// create hardlinks to files
|
|
10368
10386
|
//
|
|
@@ -10452,7 +10470,9 @@ module.exports = {
|
|
|
10452
10470
|
link,
|
|
10453
10471
|
linkFile,
|
|
10454
10472
|
copyFile,
|
|
10455
|
-
linkSym1
|
|
10473
|
+
linkSym1,
|
|
10474
|
+
generatePackTree,
|
|
10475
|
+
SYM_FILES
|
|
10456
10476
|
};
|
|
10457
10477
|
|
|
10458
10478
|
/***/ }),
|
|
@@ -11150,7 +11170,7 @@ const Path = __webpack_require__("path");
|
|
|
11150
11170
|
|
|
11151
11171
|
const mm = __webpack_require__("./node_modules/.f/_/minimatch/3.0.4/minimatch/minimatch.js");
|
|
11152
11172
|
|
|
11153
|
-
const filterScanDir = __webpack_require__("./node_modules/.f/_/filter-scan-dir/1.
|
|
11173
|
+
const filterScanDir = __webpack_require__("./node_modules/.f/_/filter-scan-dir/1.5.0/filter-scan-dir/lib/index.js");
|
|
11154
11174
|
|
|
11155
11175
|
async function _scanFileStats(dir, ignores, baseDir = "") {
|
|
11156
11176
|
const ignore = fullPath => ignores.find(pattern => mm(fullPath, pattern, {
|
|
@@ -11183,7 +11203,10 @@ async function _scanFileStats(dir, ignores, baseDir = "") {
|
|
|
11183
11203
|
dir: fullDir,
|
|
11184
11204
|
includeRoot: false,
|
|
11185
11205
|
filter,
|
|
11186
|
-
filterDir: filter
|
|
11206
|
+
filterDir: filter,
|
|
11207
|
+
concurrency: 500,
|
|
11208
|
+
fullStat: true // we need full stat to get the mtimeMs prop
|
|
11209
|
+
|
|
11187
11210
|
});
|
|
11188
11211
|
return {
|
|
11189
11212
|
latestMtimeMs,
|
|
@@ -11388,7 +11411,7 @@ const path_1 = (0, tslib_1.__importDefault)(__webpack_require__("path"));
|
|
|
11388
11411
|
|
|
11389
11412
|
const fs_1 = __webpack_require__("fs");
|
|
11390
11413
|
|
|
11391
|
-
const filter_scan_dir_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/filter-scan-dir/1.
|
|
11414
|
+
const filter_scan_dir_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/filter-scan-dir/1.5.0/filter-scan-dir/lib/index.js"));
|
|
11392
11415
|
const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/minimatch/3.0.4/minimatch/minimatch.js"));
|
|
11393
11416
|
const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
|
|
11394
11417
|
const semver_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/semver/7.3.5/semver/index.js"));
|
|
@@ -11735,7 +11758,7 @@ class FynpoDepGraph {
|
|
|
11735
11758
|
return false;
|
|
11736
11759
|
}
|
|
11737
11760
|
|
|
11738
|
-
return prefix === "." && groups[prefix] === null ? !dir.startsWith(".") : groups[prefix].find(save => save.mm.match(extras.dirFile));
|
|
11761
|
+
return prefix === "." && groups[prefix] === null ? !dir.startsWith(".") : Boolean(groups[prefix].find(save => save.mm.match(extras.dirFile)));
|
|
11739
11762
|
}
|
|
11740
11763
|
|
|
11741
11764
|
return false;
|
|
@@ -12132,7 +12155,7 @@ const path_1 = (0, tslib_1.__importDefault)(__webpack_require__("path"));
|
|
|
12132
12155
|
|
|
12133
12156
|
const fs_1 = __webpack_require__("fs");
|
|
12134
12157
|
|
|
12135
|
-
const filter_scan_dir_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/filter-scan-dir/1.
|
|
12158
|
+
const filter_scan_dir_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/filter-scan-dir/1.5.0/filter-scan-dir/lib/index.js"));
|
|
12136
12159
|
const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/minimatch/3.0.4/minimatch/minimatch.js"));
|
|
12137
12160
|
const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
|
|
12138
12161
|
|
|
@@ -12262,7 +12285,7 @@ async function readFynpoPackages({
|
|
|
12262
12285
|
filter: f => f === "package.json",
|
|
12263
12286
|
filterDir: (dir, _p, extras) => {
|
|
12264
12287
|
if (dir !== "node_modules") {
|
|
12265
|
-
return groups[prefix].find(save => save.mm.match(extras.dirFile));
|
|
12288
|
+
return Boolean(groups[prefix].find(save => save.mm.match(extras.dirFile)));
|
|
12266
12289
|
}
|
|
12267
12290
|
|
|
12268
12291
|
return false;
|
|
@@ -41678,21 +41701,32 @@ function entries(obj) {
|
|
|
41678
41701
|
|
|
41679
41702
|
/***/ }),
|
|
41680
41703
|
|
|
41681
|
-
/***/ "./node_modules/.f/_/filter-scan-dir/1.
|
|
41682
|
-
/***/ ((
|
|
41704
|
+
/***/ "./node_modules/.f/_/filter-scan-dir/1.5.0/filter-scan-dir/dist/filter-scan-dir.js":
|
|
41705
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
41683
41706
|
|
|
41684
41707
|
"use strict";
|
|
41685
41708
|
|
|
41686
|
-
/* eslint-disable max-statements, complexity, comma-dangle, max-params */
|
|
41709
|
+
/* eslint-disable max-statements, complexity, comma-dangle, max-params, max-depth */
|
|
41687
41710
|
|
|
41688
|
-
|
|
41711
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
41712
|
+
return mod && mod.__esModule ? mod : {
|
|
41713
|
+
"default": mod
|
|
41714
|
+
};
|
|
41715
|
+
};
|
|
41689
41716
|
|
|
41690
|
-
|
|
41717
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
41718
|
+
value: true
|
|
41719
|
+
}));
|
|
41720
|
+
exports.filterScanDirSync = exports.filterScanDir = void 0;
|
|
41721
|
+
|
|
41722
|
+
const fs_1 = __importDefault(__webpack_require__("fs"));
|
|
41723
|
+
|
|
41724
|
+
const path_1 = __importDefault(__webpack_require__("path"));
|
|
41691
41725
|
|
|
41692
|
-
const
|
|
41726
|
+
const util_1 = __importDefault(__webpack_require__("util"));
|
|
41693
41727
|
|
|
41694
41728
|
function makeExtrasData(file, fullFile, path, stat, options) {
|
|
41695
|
-
const dirFile = options.
|
|
41729
|
+
const dirFile = options._join2(path, file);
|
|
41696
41730
|
|
|
41697
41731
|
const ix = file.lastIndexOf(".");
|
|
41698
41732
|
|
|
@@ -41703,7 +41737,7 @@ function makeExtrasData(file, fullFile, path, stat, options) {
|
|
|
41703
41737
|
stat,
|
|
41704
41738
|
fullFile,
|
|
41705
41739
|
dirFile,
|
|
41706
|
-
ext: file.
|
|
41740
|
+
ext: file.substring(ix),
|
|
41707
41741
|
noExt: file.substring(0, ix)
|
|
41708
41742
|
};
|
|
41709
41743
|
} else {
|
|
@@ -41718,6 +41752,14 @@ function makeExtrasData(file, fullFile, path, stat, options) {
|
|
|
41718
41752
|
};
|
|
41719
41753
|
}
|
|
41720
41754
|
}
|
|
41755
|
+
/**
|
|
41756
|
+
* Add a file entry to the result
|
|
41757
|
+
*
|
|
41758
|
+
* @param result
|
|
41759
|
+
* @param options
|
|
41760
|
+
* @param extras
|
|
41761
|
+
*/
|
|
41762
|
+
|
|
41721
41763
|
|
|
41722
41764
|
function addResult(result, options, extras) {
|
|
41723
41765
|
const group = (options.grouping && typeof result === "string" ? result : result && result.group) || "files";
|
|
@@ -41732,6 +41774,14 @@ function addResult(result, options, extras) {
|
|
|
41732
41774
|
options.result[group].push(options.prependCwd ? extras.fullFile : extras.dirFile);
|
|
41733
41775
|
}
|
|
41734
41776
|
}
|
|
41777
|
+
/**
|
|
41778
|
+
* Process a directory entry
|
|
41779
|
+
*
|
|
41780
|
+
* @param options
|
|
41781
|
+
* @param extras
|
|
41782
|
+
* @returns
|
|
41783
|
+
*/
|
|
41784
|
+
|
|
41735
41785
|
|
|
41736
41786
|
function processDir(options, extras) {
|
|
41737
41787
|
const filterResult = options.filterDir ? options.filterDir(extras.file, extras.path, extras) : true;
|
|
@@ -41752,6 +41802,14 @@ function processDir(options, extras) {
|
|
|
41752
41802
|
skip: true
|
|
41753
41803
|
};
|
|
41754
41804
|
}
|
|
41805
|
+
/**
|
|
41806
|
+
* process a file entry
|
|
41807
|
+
*
|
|
41808
|
+
* @param options
|
|
41809
|
+
* @param extras
|
|
41810
|
+
* @returns
|
|
41811
|
+
*/
|
|
41812
|
+
|
|
41755
41813
|
|
|
41756
41814
|
function processFile(options, extras) {
|
|
41757
41815
|
if (options.ignoreExt.length > 0 && options.ignoreExt.indexOf(extras.ext) >= 0) {
|
|
@@ -41774,21 +41832,64 @@ function processFile(options, extras) {
|
|
|
41774
41832
|
|
|
41775
41833
|
return false;
|
|
41776
41834
|
}
|
|
41835
|
+
/**
|
|
41836
|
+
* get the result base on grouping enable flag
|
|
41837
|
+
*
|
|
41838
|
+
* @param options
|
|
41839
|
+
* @returns
|
|
41840
|
+
*/
|
|
41841
|
+
|
|
41777
41842
|
|
|
41778
41843
|
function getResult(options) {
|
|
41779
41844
|
return options.grouping ? Object.assign({
|
|
41780
41845
|
files: []
|
|
41781
41846
|
}, options.result) : options.result.files || [];
|
|
41782
41847
|
}
|
|
41848
|
+
/**
|
|
41849
|
+
* compare Dirent for sorting
|
|
41850
|
+
*
|
|
41851
|
+
* @param a
|
|
41852
|
+
* @param b
|
|
41853
|
+
* @returns
|
|
41854
|
+
*/
|
|
41855
|
+
|
|
41856
|
+
|
|
41857
|
+
const direntCmp = (a, b) => {
|
|
41858
|
+
/* istanbul ignore next */
|
|
41859
|
+
if (a.name === b.name) {
|
|
41860
|
+
/* istanbul ignore next */
|
|
41861
|
+
return 0;
|
|
41862
|
+
/* istanbul ignore next */
|
|
41863
|
+
} else if (a.name > b.name) {
|
|
41864
|
+
/* istanbul ignore next */
|
|
41865
|
+
return 1;
|
|
41866
|
+
} else {
|
|
41867
|
+
/* istanbul ignore next */
|
|
41868
|
+
return -1;
|
|
41869
|
+
}
|
|
41870
|
+
};
|
|
41871
|
+
/**
|
|
41872
|
+
* sync version of directory walk
|
|
41873
|
+
*
|
|
41874
|
+
* @param path
|
|
41875
|
+
* @param options
|
|
41876
|
+
* @param level
|
|
41877
|
+
* @returns
|
|
41878
|
+
*/
|
|
41879
|
+
|
|
41783
41880
|
|
|
41784
41881
|
function walkSync(path, options, level = 0) {
|
|
41785
41882
|
try {
|
|
41786
|
-
const dir = options.
|
|
41883
|
+
const dir = options._join2(options.dir, path);
|
|
41787
41884
|
|
|
41788
|
-
let files =
|
|
41885
|
+
let files = fs_1.default.readdirSync(dir, options.readdirOpts);
|
|
41789
41886
|
|
|
41790
41887
|
if (options.sortFiles) {
|
|
41791
|
-
|
|
41888
|
+
if (options.fullStat) {
|
|
41889
|
+
files = files.sort();
|
|
41890
|
+
} else {
|
|
41891
|
+
files = files.sort(direntCmp);
|
|
41892
|
+
}
|
|
41792
41893
|
}
|
|
41793
41894
|
|
|
41794
41895
|
const dirs = [];
|
|
@@ -41796,13 +41897,20 @@ function walkSync(path, options, level = 0) {
|
|
|
41796
41897
|
|
|
41797
41898
|
for (let ix = 0; !stop && ix < files.length; ix++) {
|
|
41798
41899
|
const file = files[ix];
|
|
41900
|
+
let extras;
|
|
41799
41901
|
|
|
41800
|
-
|
|
41902
|
+
if (options.fullStat) {
|
|
41903
|
+
const fullFile = options._join2(dir, file);
|
|
41801
41904
|
|
|
41802
|
-
|
|
41803
|
-
|
|
41905
|
+
const stat = fs_1.default.lstatSync(fullFile);
|
|
41906
|
+
extras = makeExtrasData(file, fullFile, path, stat, options);
|
|
41907
|
+
} else {
|
|
41908
|
+
const fullFile = options._join2(dir, file.name);
|
|
41804
41909
|
|
|
41805
|
-
|
|
41910
|
+
extras = makeExtrasData(file.name, fullFile, path, file, options);
|
|
41911
|
+
}
|
|
41912
|
+
|
|
41913
|
+
if (extras.stat.isDirectory()) {
|
|
41806
41914
|
dirs.push(extras);
|
|
41807
41915
|
} else {
|
|
41808
41916
|
stop = processFile(options, extras);
|
|
@@ -41833,17 +41941,29 @@ function walkSync(path, options, level = 0) {
|
|
|
41833
41941
|
return getResult(options);
|
|
41834
41942
|
}
|
|
41835
41943
|
|
|
41836
|
-
const asyncReaddir =
|
|
41837
|
-
const
|
|
41944
|
+
const asyncReaddir = util_1.default.promisify(fs_1.default.readdir);
|
|
41945
|
+
const asyncLStat = util_1.default.promisify(fs_1.default.lstat);
|
|
41946
|
+
/**
|
|
41947
|
+
* async version of dir walk
|
|
41948
|
+
*
|
|
41949
|
+
* @param path
|
|
41950
|
+
* @param options
|
|
41951
|
+
* @param level
|
|
41952
|
+
* @returns
|
|
41953
|
+
*/
|
|
41838
41954
|
|
|
41839
41955
|
async function walk(path, options, level = 0) {
|
|
41840
41956
|
try {
|
|
41841
|
-
const dir = options.
|
|
41957
|
+
const dir = options._join2(options.dir, path);
|
|
41842
41958
|
|
|
41843
|
-
let files = await asyncReaddir(dir);
|
|
41959
|
+
let files = await asyncReaddir(dir, options.readdirOpts);
|
|
41844
41960
|
|
|
41845
41961
|
if (options.sortFiles) {
|
|
41846
|
-
|
|
41962
|
+
if (options.fullStat) {
|
|
41963
|
+
files = files.sort();
|
|
41964
|
+
} else {
|
|
41965
|
+
files = files.sort(direntCmp);
|
|
41966
|
+
}
|
|
41847
41967
|
}
|
|
41848
41968
|
|
|
41849
41969
|
const dirs = [];
|
|
@@ -41851,13 +41971,20 @@ async function walk(path, options, level = 0) {
|
|
|
41851
41971
|
|
|
41852
41972
|
for (let ix = 0; !stop && ix < files.length; ix++) {
|
|
41853
41973
|
const file = files[ix];
|
|
41974
|
+
let extras;
|
|
41854
41975
|
|
|
41855
|
-
|
|
41976
|
+
if (options.fullStat) {
|
|
41977
|
+
const fullFile = options._join2(dir, file);
|
|
41856
41978
|
|
|
41857
|
-
|
|
41858
|
-
|
|
41979
|
+
const stat = await asyncLStat(fullFile);
|
|
41980
|
+
extras = makeExtrasData(file, fullFile, path, stat, options);
|
|
41981
|
+
} else {
|
|
41982
|
+
const fullFile = options._join2(dir, file.name);
|
|
41859
41983
|
|
|
41860
|
-
|
|
41984
|
+
extras = makeExtrasData(file.name, fullFile, path, file, options);
|
|
41985
|
+
}
|
|
41986
|
+
|
|
41987
|
+
if (extras.stat.isDirectory()) {
|
|
41861
41988
|
dirs.push(extras);
|
|
41862
41989
|
} else {
|
|
41863
41990
|
stop = processFile(options, extras);
|
|
@@ -41866,6 +41993,8 @@ async function walk(path, options, level = 0) {
|
|
|
41866
41993
|
|
|
41867
41994
|
|
|
41868
41995
|
if (!stop && dirs.length > 0) {
|
|
41996
|
+
let promises = [];
|
|
41997
|
+
|
|
41869
41998
|
for (let ix = 0; ix < dirs.length; ix++) {
|
|
41870
41999
|
const extras = dirs[ix];
|
|
41871
42000
|
const flags = processDir(options, extras);
|
|
@@ -41875,9 +42004,31 @@ async function walk(path, options, level = 0) {
|
|
|
41875
42004
|
}
|
|
41876
42005
|
|
|
41877
42006
|
if (!flags.skip && level < options.maxLevel) {
|
|
41878
|
-
|
|
42007
|
+
const walkP = walk(extras.dirFile, options, level + 1);
|
|
42008
|
+
|
|
42009
|
+
if (options.concurrency > 1) {
|
|
42010
|
+
if (options._concurrentCount < options.concurrency) {
|
|
42011
|
+
options._concurrentCount++;
|
|
42012
|
+
promises.push(walkP);
|
|
42013
|
+
} else if (promises.length) {
|
|
42014
|
+
await Promise.all(promises);
|
|
42015
|
+
options._concurrentCount -= promises.length;
|
|
42016
|
+
promises = [walkP];
|
|
42017
|
+
options._concurrentCount++;
|
|
42018
|
+
} else {
|
|
42019
|
+
await walkP;
|
|
42020
|
+
}
|
|
42021
|
+
} else {
|
|
42022
|
+
await walkP;
|
|
42023
|
+
}
|
|
41879
42024
|
}
|
|
41880
42025
|
}
|
|
42026
|
+
|
|
42027
|
+
if (promises.length) {
|
|
42028
|
+
await Promise.all(promises);
|
|
42029
|
+
options._concurrentCount -= promises.length;
|
|
42030
|
+
promises = [];
|
|
42031
|
+
}
|
|
41881
42032
|
}
|
|
41882
42033
|
} catch (err) {
|
|
41883
42034
|
if (options.rethrowError) {
|
|
@@ -41887,11 +42038,22 @@ async function walk(path, options, level = 0) {
|
|
|
41887
42038
|
|
|
41888
42039
|
return getResult(options);
|
|
41889
42040
|
}
|
|
42041
|
+
/**
|
|
42042
|
+
* make a copy of the user's options with proper defaults
|
|
42043
|
+
*
|
|
42044
|
+
* @param opts
|
|
42045
|
+
* @returns
|
|
42046
|
+
*/
|
|
42047
|
+
|
|
41890
42048
|
|
|
41891
|
-
function makeOptions(
|
|
41892
|
-
|
|
42049
|
+
function makeOptions(opts) {
|
|
42050
|
+
const options = typeof opts === "string" ? {
|
|
42051
|
+
cwd: opts
|
|
42052
|
+
} : opts;
|
|
42053
|
+
const sep = options.pathSep || path_1.default.posix.sep;
|
|
42054
|
+
let cwd = options.cwd || options.dir || process.cwd();
|
|
41893
42055
|
|
|
41894
|
-
if (!options.
|
|
42056
|
+
if (!options.hasOwnProperty("pathSep") && cwd.includes("\\")) {
|
|
41895
42057
|
cwd = cwd.replace(/\\/g, "/");
|
|
41896
42058
|
}
|
|
41897
42059
|
|
|
@@ -41909,33 +42071,82 @@ function makeOptions(options) {
|
|
|
41909
42071
|
}
|
|
41910
42072
|
|
|
41911
42073
|
return ext;
|
|
41912
|
-
};
|
|
42074
|
+
}; // `includeRoot` was renamed to `prependCwd`, this avoid breaking code still using that
|
|
42075
|
+
|
|
41913
42076
|
|
|
41914
|
-
const prependCwd = (options.hasOwnProperty("includeRoot") ? options.includeRoot : options.prependCwd) || false;
|
|
41915
|
-
|
|
41916
|
-
|
|
42077
|
+
const prependCwd = (options.hasOwnProperty("includeRoot") ? options.includeRoot : options.prependCwd) || false; // a simple and faster version of path.join that handles just 2
|
|
42078
|
+
// arguments using posix separator
|
|
42079
|
+
|
|
42080
|
+
const _join2 = (a, b) => a && b ? a + sep + b : a ? a : b; // eslint-disable-line
|
|
42081
|
+
|
|
42082
|
+
|
|
42083
|
+
const opts2 = Object.assign({
|
|
42084
|
+
_join2,
|
|
41917
42085
|
maxLevel: Infinity,
|
|
41918
42086
|
prefix: "",
|
|
41919
|
-
prependCwd
|
|
42087
|
+
prependCwd,
|
|
42088
|
+
fullStat: true,
|
|
42089
|
+
concurrency: 50,
|
|
42090
|
+
readdirOpts: undefined
|
|
41920
42091
|
}, options, {
|
|
41921
42092
|
dir: cwd,
|
|
41922
42093
|
result: {},
|
|
41923
42094
|
ignoreExt: [].concat(options.ignoreExt).map(cleanExt).filter(x => x),
|
|
41924
|
-
filterExt: [].concat(options.filterExt).map(cleanExt).filter(x => x)
|
|
42095
|
+
filterExt: [].concat(options.filterExt).map(cleanExt).filter(x => x),
|
|
42096
|
+
_concurrentCount: 0
|
|
41925
42097
|
});
|
|
42098
|
+
|
|
42099
|
+
if (!opts2.fullStat) {
|
|
42100
|
+
opts2.readdirOpts = {
|
|
42101
|
+
withFileTypes: true
|
|
42102
|
+
};
|
|
42103
|
+
}
|
|
42104
|
+
|
|
42105
|
+
return opts2;
|
|
41926
42106
|
}
|
|
42107
|
+
/**
|
|
42108
|
+
* async version of filter scan dir
|
|
42109
|
+
* @param options
|
|
42110
|
+
* @returns
|
|
42111
|
+
*/
|
|
42112
|
+
|
|
41927
42113
|
|
|
41928
|
-
function filterScanDir(options) {
|
|
42114
|
+
function filterScanDir(options = {}) {
|
|
41929
42115
|
const options2 = makeOptions(options);
|
|
41930
42116
|
return walk(options2.prefix, options2);
|
|
41931
42117
|
}
|
|
41932
42118
|
|
|
41933
|
-
filterScanDir
|
|
42119
|
+
exports.filterScanDir = filterScanDir;
|
|
42120
|
+
/** sync version of filter scan dir */
|
|
42121
|
+
|
|
42122
|
+
function filterScanDirSync(options = {}) {
|
|
41934
42123
|
const options2 = makeOptions(options);
|
|
41935
42124
|
return walkSync(options2.prefix, options2);
|
|
41936
|
-
}
|
|
42125
|
+
}
|
|
41937
42126
|
|
|
41938
|
-
|
|
42127
|
+
exports.filterScanDirSync = filterScanDirSync;
|
|
42128
|
+
|
|
42129
|
+
/***/ }),
|
|
42130
|
+
|
|
42131
|
+
/***/ "./node_modules/.f/_/filter-scan-dir/1.5.0/filter-scan-dir/lib/index.js":
|
|
42132
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
42133
|
+
|
|
42134
|
+
const fsd = __webpack_require__("./node_modules/.f/_/filter-scan-dir/1.5.0/filter-scan-dir/dist/filter-scan-dir.js");
|
|
42135
|
+
|
|
42136
|
+
const asyncApi = options => fsd.filterScanDir(options);
|
|
42137
|
+
|
|
42138
|
+
Object.defineProperties(asyncApi, {
|
|
42139
|
+
sync: {
|
|
42140
|
+
value: fsd.filterScanDirSync
|
|
42141
|
+
},
|
|
42142
|
+
filterScanDir: {
|
|
42143
|
+
value: fsd.filterScanDir
|
|
42144
|
+
},
|
|
42145
|
+
filterScanDirSync: {
|
|
42146
|
+
value: fsd.filterScanDirSync
|
|
42147
|
+
}
|
|
42148
|
+
});
|
|
42149
|
+
module.exports = asyncApi;
|
|
41939
42150
|
|
|
41940
42151
|
/***/ }),
|
|
41941
42152
|
|
|
@@ -56133,7 +56344,7 @@ function retryThrow(path, opts, er) {
|
|
|
56133
56344
|
/***/ (function(module, exports, __webpack_require__) {
|
|
56134
56345
|
|
|
56135
56346
|
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
56136
|
-
|
|
56347
|
+
/**
|
|
56137
56348
|
* @license
|
|
56138
56349
|
* Lodash <https://lodash.com/>
|
|
56139
56350
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -60682,10 +60893,9 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
|
60682
60893
|
},
|
|
60683
60894
|
be = de();
|
|
60684
60895
|
|
|
60685
|
-
|
|
60896
|
+
"function" == typeof define && "object" == typeof define.amd && define.amd ? (re._ = be, define(function () {
|
|
60686
60897
|
return be;
|
|
60687
|
-
}).
|
|
60688
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))) : 0;
|
|
60898
|
+
})) : ue ? ((ue.exports = be)._ = be, ee._ = be) : re._ = be;
|
|
60689
60899
|
}).call(this);
|
|
60690
60900
|
|
|
60691
60901
|
/***/ }),
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
object-assign
|
|
3
|
+
(c) Sindre Sorhus
|
|
4
|
+
@license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*!
|
|
8
|
+
* depd
|
|
9
|
+
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
10
|
+
* MIT Licensed
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/*!
|
|
14
|
+
* depd
|
|
15
|
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
16
|
+
* MIT Licensed
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/*!
|
|
20
|
+
* depd
|
|
21
|
+
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
22
|
+
* MIT Licensed
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/*!
|
|
26
|
+
* depd
|
|
27
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
28
|
+
* MIT Licensed
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/*!
|
|
32
|
+
* humanize-ms - index.js
|
|
33
|
+
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
|
|
34
|
+
* MIT Licensed
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/*!
|
|
38
|
+
* negotiator
|
|
39
|
+
* Copyright(c) 2012 Federico Romero
|
|
40
|
+
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
|
41
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
42
|
+
* MIT Licensed
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/*! *****************************************************************************
|
|
46
|
+
Copyright (c) Microsoft Corporation.
|
|
47
|
+
|
|
48
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
49
|
+
purpose with or without fee is hereby granted.
|
|
50
|
+
|
|
51
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
52
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
53
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
54
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
55
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
56
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
57
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
58
|
+
***************************************************************************** */
|
|
59
|
+
|
|
60
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @license
|
|
64
|
+
* Lodash <https://lodash.com/>
|
|
65
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
66
|
+
* Released under MIT license <https://lodash.com/license>
|
|
67
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
68
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @preserve
|
|
73
|
+
* JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
|
|
74
|
+
*
|
|
75
|
+
* @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
|
|
76
|
+
* @see http://github.com/homebrewing/brauhaus-diff
|
|
77
|
+
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
|
|
78
|
+
* @see http://github.com/garycourt/murmurhash-js
|
|
79
|
+
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
|
|
80
|
+
* @see http://sites.google.com/site/murmurhash/
|
|
81
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fyn",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.23",
|
|
4
4
|
"description": "A node package manager, fast, workspace, and better productivity and efficiency",
|
|
5
5
|
"main": "./bin/fyn.js",
|
|
6
6
|
"homepage": "https://www.electrode.io/fynpo/",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"postpack": "publish-util-postpack"
|
|
19
19
|
},
|
|
20
20
|
"bin": {
|
|
21
|
+
"0-npx-please-run-this-for-fyn": "./bin/fyn.js",
|
|
21
22
|
"fyn": "./bin/fyn.js",
|
|
22
23
|
"fun": "./bin/fun.js"
|
|
23
24
|
},
|