fyn 1.1.33 → 1.1.36
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/dist/fyn.js +127 -55
- package/package.json +1 -1
package/dist/fyn.js
CHANGED
|
@@ -542,6 +542,8 @@ const {
|
|
|
542
542
|
setupNodeGypEnv
|
|
543
543
|
} = __webpack_require__("./lib/util/setup-node-gyp.js");
|
|
544
544
|
|
|
545
|
+
const hardLinkDir = __webpack_require__("./lib/util/hard-link-dir.js");
|
|
546
|
+
|
|
545
547
|
const xsh = __webpack_require__("./node_modules/.f/_/xsh/0.4.5/xsh/lib/index.js");
|
|
546
548
|
|
|
547
549
|
function checkNewVersion(npmConfig) {
|
|
@@ -864,6 +866,27 @@ class FynCli {
|
|
|
864
866
|
logger.error("No package was removed");
|
|
865
867
|
return false;
|
|
866
868
|
}
|
|
869
|
+
|
|
870
|
+
async syncLocalLinks() {
|
|
871
|
+
await this.fyn._initializePkg();
|
|
872
|
+
const {
|
|
873
|
+
localPkgLinks
|
|
874
|
+
} = this.fyn._installConfig;
|
|
875
|
+
|
|
876
|
+
if (!_.isEmpty(localPkgLinks)) {
|
|
877
|
+
for (const vdir in localPkgLinks) {
|
|
878
|
+
const tgtDir = Path.join(this.fyn._cwd, vdir);
|
|
879
|
+
const srcDir = Path.join(this.fyn._cwd, localPkgLinks[vdir].srcDir);
|
|
880
|
+
await hardLinkDir.link(srcDir, tgtDir, {
|
|
881
|
+
sourceMaps: localPkgLinks[vdir].sourceMaps
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
logger.info(`refreshed linked files for local packages`);
|
|
886
|
+
} else {
|
|
887
|
+
logger.info(`There are no local packages`);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
867
890
|
/*
|
|
868
891
|
* npm scripts execution order on install
|
|
869
892
|
* 1. preinstall
|
|
@@ -1671,6 +1694,21 @@ const commands = {
|
|
|
1671
1694
|
type: "boolean"
|
|
1672
1695
|
}
|
|
1673
1696
|
}
|
|
1697
|
+
},
|
|
1698
|
+
"sync-local": {
|
|
1699
|
+
desc: "Refresh locally linked package files",
|
|
1700
|
+
alias: "sl",
|
|
1701
|
+
|
|
1702
|
+
async exec(argv, parsed) {
|
|
1703
|
+
try {
|
|
1704
|
+
const opts = await pickOptions(argv, parsed.nixClap, true);
|
|
1705
|
+
const cli = new FynCli(opts);
|
|
1706
|
+
return cli.syncLocalLinks();
|
|
1707
|
+
} catch (err) {
|
|
1708
|
+
process.exit(1);
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1674
1712
|
}
|
|
1675
1713
|
};
|
|
1676
1714
|
|
|
@@ -2532,6 +2570,7 @@ const Crypto = __webpack_require__("crypto");
|
|
|
2532
2570
|
* ]
|
|
2533
2571
|
* }
|
|
2534
2572
|
* ```
|
|
2573
|
+
*
|
|
2535
2574
|
* @param {*} tree - the dir tree
|
|
2536
2575
|
* @param {*} output - output object
|
|
2537
2576
|
* @param {*} baseDir - base dir path
|
|
@@ -2674,7 +2713,7 @@ class FynCentral {
|
|
|
2674
2713
|
* to know if file changed.
|
|
2675
2714
|
*
|
|
2676
2715
|
* @param {*} integrity - shasum integrity for the package
|
|
2677
|
-
* @returns
|
|
2716
|
+
* @returns void
|
|
2678
2717
|
*/
|
|
2679
2718
|
|
|
2680
2719
|
|
|
@@ -2802,9 +2841,16 @@ class FynCentral {
|
|
|
2802
2841
|
}
|
|
2803
2842
|
|
|
2804
2843
|
_untarStream(tarStream, targetDir) {
|
|
2805
|
-
|
|
2806
|
-
|
|
2844
|
+
// since we are using objects to store directory tree we have to
|
|
2845
|
+
// create objects without the normal prototypes to avoid name conflict
|
|
2846
|
+
// with file names
|
|
2847
|
+
const newDirObj = () => {
|
|
2848
|
+
const n = Object.create(null);
|
|
2849
|
+
n["/"] = Object.create(null);
|
|
2850
|
+
return n;
|
|
2807
2851
|
};
|
|
2852
|
+
|
|
2853
|
+
const dirTree = newDirObj();
|
|
2808
2854
|
const strip = 1;
|
|
2809
2855
|
const untarStream = Tar.x({
|
|
2810
2856
|
strip,
|
|
@@ -2815,9 +2861,7 @@ class FynCentral {
|
|
|
2815
2861
|
const isDir = entry.type === "Directory";
|
|
2816
2862
|
const dirs = parts.slice(strip, isDir ? parts.length : parts.length - 1);
|
|
2817
2863
|
const wtree = dirs.reduce((wt, dir) => {
|
|
2818
|
-
return wt[dir] || (wt[dir] =
|
|
2819
|
-
"/": {}
|
|
2820
|
-
});
|
|
2864
|
+
return wt[dir] || (wt[dir] = newDirObj());
|
|
2821
2865
|
}, dirTree);
|
|
2822
2866
|
if (isDir) return;
|
|
2823
2867
|
const fname = parts[parts.length - 1];
|
|
@@ -2904,7 +2948,7 @@ class FynCentral {
|
|
|
2904
2948
|
} else {
|
|
2905
2949
|
logger.debug("storing tar to central store", pkgId, integrity);
|
|
2906
2950
|
await this._storeTarStream(info, stream);
|
|
2907
|
-
stream = undefined;
|
|
2951
|
+
stream = undefined; // eslint-disable-line
|
|
2908
2952
|
|
|
2909
2953
|
this._map.set(integrity, info);
|
|
2910
2954
|
|
|
@@ -3402,6 +3446,10 @@ class Fyn {
|
|
|
3402
3446
|
|
|
3403
3447
|
getInstallConfigFile() {
|
|
3404
3448
|
return Path.join(this.getFvDir(FYN_INSTALL_CONFIG_FILE));
|
|
3449
|
+
}
|
|
3450
|
+
|
|
3451
|
+
setLocalPkgLinks(localLinks) {
|
|
3452
|
+
this._installConfig.localPkgLinks = localLinks;
|
|
3405
3453
|
} // save the config to outputDir
|
|
3406
3454
|
|
|
3407
3455
|
|
|
@@ -3735,7 +3783,7 @@ class Fyn {
|
|
|
3735
3783
|
* - Rare but could occur if fyn is used for monorepo and user has script
|
|
3736
3784
|
* that run concurrent installs
|
|
3737
3785
|
*
|
|
3738
|
-
* @returns {boolean} if lock was acquired
|
|
3786
|
+
* @returns {Promise<boolean>} if lock was acquired
|
|
3739
3787
|
*/
|
|
3740
3788
|
|
|
3741
3789
|
|
|
@@ -4387,7 +4435,7 @@ class LocalPkgBuilder {
|
|
|
4387
4435
|
|
|
4388
4436
|
async processItem(item) {
|
|
4389
4437
|
if (!_.isEmpty(this._failedItems)) {
|
|
4390
|
-
return;
|
|
4438
|
+
return {};
|
|
4391
4439
|
}
|
|
4392
4440
|
|
|
4393
4441
|
const dispPath = Path.relative(this._options.fyn._cwd, item.fullPath);
|
|
@@ -4517,7 +4565,7 @@ module.exports = new CliLogger();
|
|
|
4517
4565
|
|
|
4518
4566
|
"use strict";
|
|
4519
4567
|
|
|
4520
|
-
/* eslint-disable no-magic-numbers, max-statements */
|
|
4568
|
+
/* eslint-disable no-magic-numbers, max-statements, no-param-reassign */
|
|
4521
4569
|
|
|
4522
4570
|
const MAX_PENDING_SHOW = 10;
|
|
4523
4571
|
|
|
@@ -4589,7 +4637,7 @@ module.exports = {
|
|
|
4589
4637
|
|
|
4590
4638
|
"use strict";
|
|
4591
4639
|
|
|
4592
|
-
/* eslint-disable global-require, max-statements */
|
|
4640
|
+
/* eslint-disable global-require, max-statements, no-param-reassign */
|
|
4593
4641
|
|
|
4594
4642
|
const Fs = __webpack_require__("./lib/util/file-ops.js");
|
|
4595
4643
|
|
|
@@ -5238,7 +5286,7 @@ module.exports = PkgDepLinker;
|
|
|
5238
5286
|
|
|
5239
5287
|
"use strict";
|
|
5240
5288
|
|
|
5241
|
-
/* eslint-disable no-magic-numbers */
|
|
5289
|
+
/* eslint-disable no-magic-numbers, no-param-reassign */
|
|
5242
5290
|
|
|
5243
5291
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5244
5292
|
|
|
@@ -5786,7 +5834,7 @@ module.exports = PkgDepLocker;
|
|
|
5786
5834
|
|
|
5787
5835
|
"use strict";
|
|
5788
5836
|
|
|
5789
|
-
/* eslint-disable no-magic-numbers, max-params, max-statements, complexity */
|
|
5837
|
+
/* eslint-disable no-magic-numbers, max-params, max-statements, complexity, no-param-reassign */
|
|
5790
5838
|
|
|
5791
5839
|
const _ = __webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js");
|
|
5792
5840
|
|
|
@@ -5826,7 +5874,7 @@ const {
|
|
|
5826
5874
|
const {
|
|
5827
5875
|
getDepSection,
|
|
5828
5876
|
makeDepStep
|
|
5829
|
-
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
5877
|
+
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/index.js");
|
|
5830
5878
|
|
|
5831
5879
|
const xaa = __webpack_require__("./lib/util/xaa.js");
|
|
5832
5880
|
|
|
@@ -7652,7 +7700,7 @@ const {
|
|
|
7652
7700
|
LOCK_RSEMVERS,
|
|
7653
7701
|
SEMVER
|
|
7654
7702
|
} = __webpack_require__("./lib/symbols.js");
|
|
7655
|
-
/* eslint-disable max-statements,no-magic-numbers,no-empty,complexity,prefer-template,max-len, max-depth */
|
|
7703
|
+
/* eslint-disable max-statements,no-magic-numbers,no-empty,complexity,prefer-template,max-len, max-depth, no-param-reassign */
|
|
7656
7704
|
|
|
7657
7705
|
|
|
7658
7706
|
class PkgInstaller {
|
|
@@ -7662,6 +7710,7 @@ class PkgInstaller {
|
|
|
7662
7710
|
this._depLinker = new PkgDepLinker({
|
|
7663
7711
|
fyn: this._fyn
|
|
7664
7712
|
});
|
|
7713
|
+
this._localLinks = {};
|
|
7665
7714
|
}
|
|
7666
7715
|
|
|
7667
7716
|
async install() {
|
|
@@ -7700,6 +7749,8 @@ class PkgInstaller {
|
|
|
7700
7749
|
this.preInstall = undefined;
|
|
7701
7750
|
this.postInstall = undefined;
|
|
7702
7751
|
this.toLink = undefined;
|
|
7752
|
+
|
|
7753
|
+
this._fyn.setLocalPkgLinks(this._localLinks);
|
|
7703
7754
|
});
|
|
7704
7755
|
}
|
|
7705
7756
|
|
|
@@ -7714,8 +7765,15 @@ class PkgInstaller {
|
|
|
7714
7765
|
const vdir = this._fyn.getInstalledPkgDir(depInfo.name, depInfo.version, depInfo);
|
|
7715
7766
|
|
|
7716
7767
|
if (depInfo.local === "hard") {
|
|
7768
|
+
const {
|
|
7769
|
+
sourceMaps
|
|
7770
|
+
} = this._fyn._options;
|
|
7771
|
+
this._localLinks[Path.relative(this._fyn._cwd, vdir)] = {
|
|
7772
|
+
srcDir: Path.relative(this._fyn._cwd, depInfo.dir),
|
|
7773
|
+
sourceMaps
|
|
7774
|
+
};
|
|
7717
7775
|
await hardLinkDir.link(depInfo.dir, vdir, {
|
|
7718
|
-
sourceMaps
|
|
7776
|
+
sourceMaps
|
|
7719
7777
|
});
|
|
7720
7778
|
} else {
|
|
7721
7779
|
// await this._depLinker.symlinkLocalPackage(vdir, depInfo.dir);
|
|
@@ -8326,7 +8384,7 @@ module.exports = PkgInstaller;
|
|
|
8326
8384
|
|
|
8327
8385
|
"use strict";
|
|
8328
8386
|
|
|
8329
|
-
/* eslint-disable max-nested-callbacks */
|
|
8387
|
+
/* eslint-disable max-nested-callbacks, no-param-reassign */
|
|
8330
8388
|
|
|
8331
8389
|
const assert = __webpack_require__("assert");
|
|
8332
8390
|
|
|
@@ -8725,7 +8783,7 @@ module.exports = PkgOptResolver;
|
|
|
8725
8783
|
// - npm registry
|
|
8726
8784
|
//
|
|
8727
8785
|
|
|
8728
|
-
/* eslint-disable no-magic-numbers, prefer-template, max-statements */
|
|
8786
|
+
/* eslint-disable no-magic-numbers, prefer-template, max-statements, no-param-reassign */
|
|
8729
8787
|
|
|
8730
8788
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
8731
8789
|
|
|
@@ -8802,7 +8860,7 @@ const {
|
|
|
8802
8860
|
|
|
8803
8861
|
const {
|
|
8804
8862
|
PackageRef
|
|
8805
|
-
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
8863
|
+
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/index.js");
|
|
8806
8864
|
|
|
8807
8865
|
const WATCH_TIME = 5000; // consider meta cache stale after this much time (30 minutes)
|
|
8808
8866
|
|
|
@@ -9571,7 +9629,7 @@ module.exports = {
|
|
|
9571
9629
|
|
|
9572
9630
|
"use strict";
|
|
9573
9631
|
|
|
9574
|
-
/* eslint-disable max-params */
|
|
9632
|
+
/* eslint-disable max-params, no-param-reassign */
|
|
9575
9633
|
|
|
9576
9634
|
const _ = __webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js");
|
|
9577
9635
|
|
|
@@ -9820,7 +9878,7 @@ const {
|
|
|
9820
9878
|
const {
|
|
9821
9879
|
FynpoConfigManager,
|
|
9822
9880
|
FynpoDepGraph
|
|
9823
|
-
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
9881
|
+
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/index.js");
|
|
9824
9882
|
/* eslint-disable no-magic-numbers, max-statements, no-empty, complexity, no-eval */
|
|
9825
9883
|
|
|
9826
9884
|
|
|
@@ -10275,11 +10333,18 @@ async function generatePackTree(path, _logger = logger) {
|
|
|
10275
10333
|
if (files.length > 1000) {
|
|
10276
10334
|
_logger.warn(`Local linking package at ${path} has more than ${files.length} files.
|
|
10277
10335
|
>>> This is unusual, please check package .npmignore or 'files' in package.json <<<`);
|
|
10278
|
-
}
|
|
10336
|
+
} // since we are using objects to store directory tree we have to
|
|
10337
|
+
// create objects without the normal prototypes to avoid name conflict
|
|
10338
|
+
// with file names
|
|
10339
|
+
|
|
10279
10340
|
|
|
10280
|
-
const
|
|
10281
|
-
|
|
10341
|
+
const newDirObj = () => {
|
|
10342
|
+
const n = Object.create(null);
|
|
10343
|
+
n[SYM_FILES] = [];
|
|
10344
|
+
return n;
|
|
10282
10345
|
};
|
|
10346
|
+
|
|
10347
|
+
const fmap = newDirObj();
|
|
10283
10348
|
files.sort().forEach(filePath => {
|
|
10284
10349
|
const dir = Path.dirname(filePath);
|
|
10285
10350
|
|
|
@@ -10292,9 +10357,7 @@ async function generatePackTree(path, _logger = logger) {
|
|
|
10292
10357
|
|
|
10293
10358
|
dir.split("/").forEach(d => {
|
|
10294
10359
|
if (!dmap[d]) {
|
|
10295
|
-
dmap[d] =
|
|
10296
|
-
[SYM_FILES]: []
|
|
10297
|
-
};
|
|
10360
|
+
dmap[d] = newDirObj();
|
|
10298
10361
|
}
|
|
10299
10362
|
|
|
10300
10363
|
dmap = dmap[d];
|
|
@@ -10573,7 +10636,7 @@ module.exports = __webpack_require__("./node_modules/.f/_/item-queue/1.1.2/item-
|
|
|
10573
10636
|
|
|
10574
10637
|
"use strict";
|
|
10575
10638
|
|
|
10576
|
-
/* eslint-disable no-magic-numbers */
|
|
10639
|
+
/* eslint-disable no-magic-numbers, no-param-reassign */
|
|
10577
10640
|
|
|
10578
10641
|
const chalk = __webpack_require__("./node_modules/.f/_/chalk/4.1.2/chalk/source/index.js");
|
|
10579
10642
|
|
|
@@ -10685,6 +10748,7 @@ module.exports = ItemQueue;
|
|
|
10685
10748
|
|
|
10686
10749
|
"use strict";
|
|
10687
10750
|
|
|
10751
|
+
/* eslint-disable no-param-reassign */
|
|
10688
10752
|
|
|
10689
10753
|
const Promise = __webpack_require__("./node_modules/.f/_/bluebird/3.7.2/bluebird/js/release/bluebird.js");
|
|
10690
10754
|
|
|
@@ -11318,7 +11382,7 @@ module.exports = __webpack_require__("./node_modules/.f/_/xaa/1.7.0/xaa/dist/xaa
|
|
|
11318
11382
|
|
|
11319
11383
|
/***/ }),
|
|
11320
11384
|
|
|
11321
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
11385
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/caching.js":
|
|
11322
11386
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11323
11387
|
|
|
11324
11388
|
"use strict";
|
|
@@ -11339,7 +11403,7 @@ const fs_1 = (0, tslib_1.__importDefault)(__webpack_require__("fs"));
|
|
|
11339
11403
|
const path_1 = (0, tslib_1.__importDefault)(__webpack_require__("path"));
|
|
11340
11404
|
const crypto_1 = (0, tslib_1.__importDefault)(__webpack_require__("crypto"));
|
|
11341
11405
|
|
|
11342
|
-
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
11406
|
+
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
|
|
11343
11407
|
/**
|
|
11344
11408
|
* create a sha256 hash for some data
|
|
11345
11409
|
*
|
|
@@ -11607,7 +11671,7 @@ exports.processOutput = processOutput;
|
|
|
11607
11671
|
|
|
11608
11672
|
/***/ }),
|
|
11609
11673
|
|
|
11610
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
11674
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/fynpo-config.js":
|
|
11611
11675
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11612
11676
|
|
|
11613
11677
|
"use strict";
|
|
@@ -11757,7 +11821,7 @@ exports.FynpoConfigManager = FynpoConfigManager;
|
|
|
11757
11821
|
|
|
11758
11822
|
/***/ }),
|
|
11759
11823
|
|
|
11760
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
11824
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js":
|
|
11761
11825
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11762
11826
|
|
|
11763
11827
|
"use strict";
|
|
@@ -11787,9 +11851,9 @@ const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_mod
|
|
|
11787
11851
|
const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
|
|
11788
11852
|
const semver_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/semver/7.3.5/semver/index.js"));
|
|
11789
11853
|
|
|
11790
|
-
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
11854
|
+
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
|
|
11791
11855
|
|
|
11792
|
-
const util_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
11856
|
+
const util_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/util.js");
|
|
11793
11857
|
|
|
11794
11858
|
const is_path_inside_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/is-path-inside/3.0.3/is-path-inside/index.js"));
|
|
11795
11859
|
const DepSectionMap = {
|
|
@@ -11961,12 +12025,12 @@ class FynpoDepGraph {
|
|
|
11961
12025
|
this._options = _objectSpread({
|
|
11962
12026
|
cwd: process.cwd()
|
|
11963
12027
|
}, options);
|
|
11964
|
-
this.depMapByPath =
|
|
11965
|
-
this.resolvedCache =
|
|
12028
|
+
this.depMapByPath = Object.create(null);
|
|
12029
|
+
this.resolvedCache = Object.create(null);
|
|
11966
12030
|
this.packages = {
|
|
11967
|
-
byId:
|
|
11968
|
-
byName:
|
|
11969
|
-
byPath:
|
|
12031
|
+
byId: Object.create(null),
|
|
12032
|
+
byName: Object.create(null),
|
|
12033
|
+
byPath: Object.create(null)
|
|
11970
12034
|
};
|
|
11971
12035
|
}
|
|
11972
12036
|
/**
|
|
@@ -11979,10 +12043,13 @@ class FynpoDepGraph {
|
|
|
11979
12043
|
await this.readPackages();
|
|
11980
12044
|
}
|
|
11981
12045
|
|
|
11982
|
-
this.
|
|
12046
|
+
this.resolveDirectDeps(); // we don't need indirect deps
|
|
12047
|
+
// topo sort works with only direct deps
|
|
12048
|
+
// this.resolveIndirectDeps();
|
|
11983
12049
|
}
|
|
11984
12050
|
/**
|
|
11985
12051
|
* update package depdencies map
|
|
12052
|
+
*
|
|
11986
12053
|
* - re-entrant safe
|
|
11987
12054
|
*/
|
|
11988
12055
|
|
|
@@ -12000,7 +12067,9 @@ class FynpoDepGraph {
|
|
|
12000
12067
|
|
|
12001
12068
|
getTopoSortPackagePaths() {
|
|
12002
12069
|
const depRecords = {};
|
|
12003
|
-
const changed = [];
|
|
12070
|
+
const changed = []; //
|
|
12071
|
+
// first start with packages that has zero local dependencies
|
|
12072
|
+
//
|
|
12004
12073
|
|
|
12005
12074
|
for (const path in this.depMapByPath) {
|
|
12006
12075
|
const depData = this.depMapByPath[path];
|
|
@@ -12018,12 +12087,14 @@ class FynpoDepGraph {
|
|
|
12018
12087
|
const sorted = [];
|
|
12019
12088
|
|
|
12020
12089
|
while (changed.length > 0) {
|
|
12090
|
+
// remove the zero local dependencies packages from queue
|
|
12021
12091
|
const record = depRecords[changed.pop()];
|
|
12022
12092
|
/* istanbul ignore else */
|
|
12023
12093
|
|
|
12024
12094
|
if (record.count === 0) {
|
|
12095
|
+
// add package to result
|
|
12025
12096
|
record.count = -1;
|
|
12026
|
-
sorted.push(record.depData.pkgInfo.path);
|
|
12097
|
+
sorted.push(record.depData.pkgInfo.path); // subtract depdendencies count for all packages depending on the removed package
|
|
12027
12098
|
|
|
12028
12099
|
for (const path in record.depData.dependentsByPath) {
|
|
12029
12100
|
const record2 = depRecords[path];
|
|
@@ -12202,7 +12273,7 @@ class FynpoDepGraph {
|
|
|
12202
12273
|
byName
|
|
12203
12274
|
} = this.packages;
|
|
12204
12275
|
|
|
12205
|
-
if (byName
|
|
12276
|
+
if (byName[pkgJson.name]) {
|
|
12206
12277
|
byName[pkgJson.name].push(pkgInfo);
|
|
12207
12278
|
} else {
|
|
12208
12279
|
byName[pkgJson.name] = [pkgInfo];
|
|
@@ -12296,8 +12367,8 @@ class FynpoDepGraph {
|
|
|
12296
12367
|
if (!depMapByPath[path]) {
|
|
12297
12368
|
depMapByPath[path] = {
|
|
12298
12369
|
pkgInfo: byPath[path],
|
|
12299
|
-
localDepsByPath:
|
|
12300
|
-
dependentsByPath:
|
|
12370
|
+
localDepsByPath: Object.create(null),
|
|
12371
|
+
dependentsByPath: Object.create(null)
|
|
12301
12372
|
};
|
|
12302
12373
|
}
|
|
12303
12374
|
}
|
|
@@ -12359,7 +12430,7 @@ class FynpoDepGraph {
|
|
|
12359
12430
|
const dataPkg = this.depMapByPath[pkgInfo.path];
|
|
12360
12431
|
const dataDep = this.depMapByPath[depPkg.path]; // check circular
|
|
12361
12432
|
|
|
12362
|
-
if (dataDep.localDepsByPath
|
|
12433
|
+
if (dataDep.localDepsByPath[pkgInfo.path]) {
|
|
12363
12434
|
// remember circular package's path
|
|
12364
12435
|
if (!dataPkg.pathOfCirculars) {
|
|
12365
12436
|
dataPkg.pathOfCirculars = [];
|
|
@@ -12452,6 +12523,7 @@ class FynpoDepGraph {
|
|
|
12452
12523
|
/**
|
|
12453
12524
|
* Figure out all the packages' indirect dependencies on other local packages
|
|
12454
12525
|
*
|
|
12526
|
+
* TODO: very inefficient. optimize this.
|
|
12455
12527
|
*/
|
|
12456
12528
|
|
|
12457
12529
|
|
|
@@ -12483,7 +12555,7 @@ class FynpoDepGraph {
|
|
|
12483
12555
|
} // check if pkg is already part of localDeps
|
|
12484
12556
|
|
|
12485
12557
|
|
|
12486
|
-
if (!dataPkg.localDepsByPath
|
|
12558
|
+
if (!dataPkg.localDepsByPath[depInfo.path]) {
|
|
12487
12559
|
change++;
|
|
12488
12560
|
this.addDep(pkgInfo, depInfo, sec, stepsCopy);
|
|
12489
12561
|
} // resolve further with deps of depPkg
|
|
@@ -12510,7 +12582,7 @@ exports.FynpoDepGraph = FynpoDepGraph;
|
|
|
12510
12582
|
|
|
12511
12583
|
/***/ }),
|
|
12512
12584
|
|
|
12513
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
12585
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/index.js":
|
|
12514
12586
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12515
12587
|
|
|
12516
12588
|
"use strict";
|
|
@@ -12532,12 +12604,12 @@ const filter_scan_dir_1 = __webpack_require__("./node_modules/.f/_/filter-scan-d
|
|
|
12532
12604
|
const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/minimatch/3.0.4/minimatch/minimatch.js"));
|
|
12533
12605
|
const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
|
|
12534
12606
|
|
|
12535
|
-
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
12607
|
+
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
|
|
12536
12608
|
|
|
12537
|
-
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
12538
|
-
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
12539
|
-
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
12540
|
-
exports.caching = (0, tslib_1.__importStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
12609
|
+
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js"), exports);
|
|
12610
|
+
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/fynpo-config.js"), exports);
|
|
12611
|
+
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/util.js"), exports);
|
|
12612
|
+
exports.caching = (0, tslib_1.__importStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/caching.js"));
|
|
12541
12613
|
/**
|
|
12542
12614
|
* Take an array of packages and figure out their dependencies on each other
|
|
12543
12615
|
*
|
|
@@ -12793,7 +12865,7 @@ exports.makePkgDeps = makePkgDeps;
|
|
|
12793
12865
|
|
|
12794
12866
|
/***/ }),
|
|
12795
12867
|
|
|
12796
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
12868
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/minimatch-group.js":
|
|
12797
12869
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12798
12870
|
|
|
12799
12871
|
"use strict";
|
|
@@ -12932,7 +13004,7 @@ exports.unrollMmMatch = unrollMmMatch;
|
|
|
12932
13004
|
|
|
12933
13005
|
/***/ }),
|
|
12934
13006
|
|
|
12935
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
13007
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.15-fynlocal_h/@fynpo/base/dist/util.js":
|
|
12936
13008
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12937
13009
|
|
|
12938
13010
|
"use strict";
|