fyn 1.1.28 → 1.1.31
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 +185 -46
- package/package.json +3 -2
package/dist/fyn.js
CHANGED
|
@@ -1599,7 +1599,16 @@ const commands = {
|
|
|
1599
1599
|
alias: ["rum", "r"],
|
|
1600
1600
|
usage: "$0 $1 <command> [-- <args>...]",
|
|
1601
1601
|
exec: async (argv, parsed) => {
|
|
1602
|
-
|
|
1602
|
+
try {
|
|
1603
|
+
return await new FynCli(await pickOptions(argv, parsed.nixClap, !argv.opts.list)).run(argv);
|
|
1604
|
+
} catch (err) {
|
|
1605
|
+
if (err.errno !== undefined) {
|
|
1606
|
+
process.exit(err.errno);
|
|
1607
|
+
} else {
|
|
1608
|
+
logger.error("fyn run caught error without errno", err);
|
|
1609
|
+
process.exit(1);
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1603
1612
|
},
|
|
1604
1613
|
options: {
|
|
1605
1614
|
list: {
|
|
@@ -5753,7 +5762,7 @@ const {
|
|
|
5753
5762
|
const {
|
|
5754
5763
|
getDepSection,
|
|
5755
5764
|
makeDepStep
|
|
5756
|
-
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
5765
|
+
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/index.js");
|
|
5757
5766
|
|
|
5758
5767
|
const xaa = __webpack_require__("./lib/util/xaa.js");
|
|
5759
5768
|
|
|
@@ -7944,10 +7953,8 @@ class PkgInstaller {
|
|
|
7944
7953
|
}
|
|
7945
7954
|
|
|
7946
7955
|
async _buildLocalPkg(depInfo) {
|
|
7947
|
-
if (this._fyn._localPkgBuilder) {
|
|
7956
|
+
if (this._fyn._options.buildLocal && this._fyn._localPkgBuilder) {
|
|
7948
7957
|
await this._fyn._localPkgBuilder.waitForItem(depInfo.dir);
|
|
7949
|
-
} else {
|
|
7950
|
-
logger.error("pkg-installer: there is no this._fyn._localPkgBuilder");
|
|
7951
7958
|
}
|
|
7952
7959
|
}
|
|
7953
7960
|
|
|
@@ -8723,7 +8730,7 @@ const {
|
|
|
8723
8730
|
|
|
8724
8731
|
const {
|
|
8725
8732
|
PackageRef
|
|
8726
|
-
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
8733
|
+
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/index.js");
|
|
8727
8734
|
|
|
8728
8735
|
const WATCH_TIME = 5000; // consider meta cache stale after this much time (30 minutes)
|
|
8729
8736
|
|
|
@@ -9254,7 +9261,8 @@ class PkgSrcManager {
|
|
|
9254
9261
|
const packument = cached && cached.data && JSON.parse(cached.data);
|
|
9255
9262
|
foundCache = cached;
|
|
9256
9263
|
const stale = Date.now() - cached.refreshTime;
|
|
9257
|
-
|
|
9264
|
+
const since = (stale / 1000).toFixed(2);
|
|
9265
|
+
logger.debug(`found packument cache for '${pkgName}' - refreshed ${since}secs ago at ${cached.refreshTime}`);
|
|
9258
9266
|
|
|
9259
9267
|
if (this._fyn._options.refreshMeta !== true && cached && cached.refreshTime && stale < META_CACHE_STALE_TIME) {
|
|
9260
9268
|
cacheMemoized = true;
|
|
@@ -9264,7 +9272,7 @@ class PkgSrcManager {
|
|
|
9264
9272
|
const encKey = encodeURIComponent(cacheKey);
|
|
9265
9273
|
return nodeFetch(`${metaMemoizeUrl}?key=${encKey}`).then(res => {
|
|
9266
9274
|
if (res.status === 200) {
|
|
9267
|
-
logger.debug(
|
|
9275
|
+
logger.debug(`using memoized packument cache for '${pkgName}'`);
|
|
9268
9276
|
cacheMemoized = true;
|
|
9269
9277
|
this._metaStat.wait--;
|
|
9270
9278
|
return packument;
|
|
@@ -9277,7 +9285,8 @@ class PkgSrcManager {
|
|
|
9277
9285
|
}
|
|
9278
9286
|
}).catch(err => {
|
|
9279
9287
|
if (foundCache) {
|
|
9280
|
-
|
|
9288
|
+
const data = foundCache.data && foundCache.data.toString();
|
|
9289
|
+
logger.debug(`fail to process packument cache - ${err.message}; data ${data}`);
|
|
9281
9290
|
throw err;
|
|
9282
9291
|
}
|
|
9283
9292
|
|
|
@@ -9739,7 +9748,7 @@ const {
|
|
|
9739
9748
|
const {
|
|
9740
9749
|
FynpoConfigManager,
|
|
9741
9750
|
FynpoDepGraph
|
|
9742
|
-
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
9751
|
+
} = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/index.js");
|
|
9743
9752
|
/* eslint-disable no-magic-numbers, max-statements, no-empty, complexity, no-eval */
|
|
9744
9753
|
|
|
9745
9754
|
|
|
@@ -11237,7 +11246,7 @@ module.exports = __webpack_require__("./node_modules/.f/_/xaa/1.7.0/xaa/dist/xaa
|
|
|
11237
11246
|
|
|
11238
11247
|
/***/ }),
|
|
11239
11248
|
|
|
11240
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
11249
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/caching.js":
|
|
11241
11250
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11242
11251
|
|
|
11243
11252
|
"use strict";
|
|
@@ -11246,7 +11255,7 @@ module.exports = __webpack_require__("./node_modules/.f/_/xaa/1.7.0/xaa/dist/xaa
|
|
|
11246
11255
|
Object.defineProperty(exports, "__esModule", ({
|
|
11247
11256
|
value: true
|
|
11248
11257
|
}));
|
|
11249
|
-
exports.processOutput = exports.processLifecycleInput = exports.processInput = void 0;
|
|
11258
|
+
exports.processOutput = exports.processLifecycleInput = exports.processInput = exports.readHashDigest = void 0;
|
|
11250
11259
|
|
|
11251
11260
|
const tslib_1 = __webpack_require__("./node_modules/.f/_/tslib/2.1.0/tslib/tslib.es6.js");
|
|
11252
11261
|
|
|
@@ -11257,6 +11266,8 @@ const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_module
|
|
|
11257
11266
|
const fs_1 = (0, tslib_1.__importDefault)(__webpack_require__("fs"));
|
|
11258
11267
|
const path_1 = (0, tslib_1.__importDefault)(__webpack_require__("path"));
|
|
11259
11268
|
const crypto_1 = (0, tslib_1.__importDefault)(__webpack_require__("crypto"));
|
|
11269
|
+
|
|
11270
|
+
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
|
|
11260
11271
|
/**
|
|
11261
11272
|
* create a sha256 hash for some data
|
|
11262
11273
|
*
|
|
@@ -11264,19 +11275,40 @@ const crypto_1 = (0, tslib_1.__importDefault)(__webpack_require__("crypto"));
|
|
|
11264
11275
|
* @returns
|
|
11265
11276
|
*/
|
|
11266
11277
|
|
|
11278
|
+
|
|
11267
11279
|
function hashData1(data, encoding = "base64url") {
|
|
11268
11280
|
return crypto_1.default.createHash("sha256").update(data).digest(encoding);
|
|
11269
11281
|
}
|
|
11270
11282
|
|
|
11283
|
+
function makeBase64Url(hash) {
|
|
11284
|
+
return hash.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
11285
|
+
}
|
|
11286
|
+
|
|
11271
11287
|
function hashData2(data, encoding = "base64url") {
|
|
11272
11288
|
if (encoding === "base64url") {
|
|
11273
|
-
return hashData1(data, "base64")
|
|
11289
|
+
return makeBase64Url(hashData1(data, "base64"));
|
|
11274
11290
|
}
|
|
11275
11291
|
|
|
11276
11292
|
return hashData1(data, encoding);
|
|
11277
11293
|
}
|
|
11278
11294
|
|
|
11279
|
-
const
|
|
11295
|
+
const hasBase64Url = typeof crypto_1.default.createHash("sha256").digest("base64url") === "string";
|
|
11296
|
+
const hashData = hasBase64Url ? hashData1 : hashData2;
|
|
11297
|
+
exports.readHashDigest = hasBase64Url ? (hash, encoding = "base64url") => {
|
|
11298
|
+
hash.setEncoding(encoding);
|
|
11299
|
+
hash.end();
|
|
11300
|
+
return hash.read();
|
|
11301
|
+
} : (hash, encoding = "base64url") => {
|
|
11302
|
+
if (encoding === "base64url") {
|
|
11303
|
+
hash.setEncoding("base64");
|
|
11304
|
+
hash.end();
|
|
11305
|
+
return makeBase64Url(hash.read());
|
|
11306
|
+
}
|
|
11307
|
+
|
|
11308
|
+
hash.setEncoding(encoding);
|
|
11309
|
+
hash.end();
|
|
11310
|
+
return hash.read();
|
|
11311
|
+
};
|
|
11280
11312
|
/**
|
|
11281
11313
|
* generate sha256 has of a file
|
|
11282
11314
|
*
|
|
@@ -11337,17 +11369,6 @@ function makeMmPatterns(patterns, options = {
|
|
|
11337
11369
|
}) {
|
|
11338
11370
|
return [].concat(patterns).map(x => x && new minimatch_1.default.Minimatch(x, options)).filter(x => x);
|
|
11339
11371
|
}
|
|
11340
|
-
/**
|
|
11341
|
-
*
|
|
11342
|
-
* @param fullPath
|
|
11343
|
-
* @param patterns
|
|
11344
|
-
* @returns
|
|
11345
|
-
*/
|
|
11346
|
-
|
|
11347
|
-
|
|
11348
|
-
function checkMmMatch(fullPath, patterns) {
|
|
11349
|
-
return !lodash_1.default.isEmpty(patterns) && patterns.find(patternMm => patternMm.match(fullPath));
|
|
11350
|
-
}
|
|
11351
11372
|
/**
|
|
11352
11373
|
* Scan for files using include and exclude patterns
|
|
11353
11374
|
*
|
|
@@ -11359,21 +11380,46 @@ function checkMmMatch(fullPath, patterns) {
|
|
|
11359
11380
|
|
|
11360
11381
|
async function scanFiles(cwd, includes, excludes) {
|
|
11361
11382
|
const filter = (_file, _path, extras) => {
|
|
11362
|
-
if (!checkMmMatch(extras.dirFile, includes) || checkMmMatch(extras.dirFile, excludes)) {
|
|
11383
|
+
if (!(0, minimatch_group_1.checkMmMatch)(extras.dirFile, includes) || (0, minimatch_group_1.checkMmMatch)(extras.dirFile, excludes)) {
|
|
11363
11384
|
return false;
|
|
11364
11385
|
}
|
|
11365
11386
|
|
|
11366
11387
|
return true;
|
|
11367
11388
|
};
|
|
11368
11389
|
|
|
11390
|
+
const dirIncludes = includes.map(mx => (0, minimatch_group_1.deconstructMM)(mx));
|
|
11391
|
+
|
|
11392
|
+
const filterDir = (_file, _path, extras) => {
|
|
11393
|
+
const dir = `${extras.dirFile}/`; // add extra / to force matching directory
|
|
11394
|
+
|
|
11395
|
+
const inc = dirIncludes.find(di => (0, minimatch_group_1.checkMmMatch)(dir, di.mms));
|
|
11396
|
+
|
|
11397
|
+
if (inc) {
|
|
11398
|
+
const exc = (0, minimatch_group_1.checkMmMatch)(dir, excludes);
|
|
11399
|
+
|
|
11400
|
+
if (!exc) {
|
|
11401
|
+
return true;
|
|
11402
|
+
}
|
|
11403
|
+
}
|
|
11404
|
+
|
|
11405
|
+
return false;
|
|
11406
|
+
};
|
|
11407
|
+
|
|
11369
11408
|
return (await (0, filter_scan_dir_1.filterScanDir)({
|
|
11370
11409
|
cwd,
|
|
11371
11410
|
filter,
|
|
11372
|
-
filterDir
|
|
11411
|
+
filterDir,
|
|
11373
11412
|
fullStat: false,
|
|
11374
11413
|
concurrency: 500
|
|
11375
11414
|
})).sort();
|
|
11376
11415
|
}
|
|
11416
|
+
/**
|
|
11417
|
+
* process caching input rules and return result from it
|
|
11418
|
+
*
|
|
11419
|
+
* @param param0
|
|
11420
|
+
* @returns result from processing input rules
|
|
11421
|
+
*/
|
|
11422
|
+
|
|
11377
11423
|
|
|
11378
11424
|
async function processInput({
|
|
11379
11425
|
cwd,
|
|
@@ -11383,7 +11429,7 @@ async function processInput({
|
|
|
11383
11429
|
} = {
|
|
11384
11430
|
input: {}
|
|
11385
11431
|
}) {
|
|
11386
|
-
const files = await scanFiles(cwd, makeMmPatterns(input.include), makeMmPatterns(input.exclude));
|
|
11432
|
+
const files = await scanFiles(cwd, makeMmPatterns(input.include, input.minimatchOptions), makeMmPatterns(input.exclude, input.minimatchOptions));
|
|
11387
11433
|
const fileHashes = await hashFiles(cwd, files);
|
|
11388
11434
|
const data = {
|
|
11389
11435
|
env: lodash_1.default.pick(process.env, input.includeEnv),
|
|
@@ -11403,6 +11449,7 @@ async function processInput({
|
|
|
11403
11449
|
|
|
11404
11450
|
exports.processInput = processInput;
|
|
11405
11451
|
/**
|
|
11452
|
+
* process lifecycle caching input rules
|
|
11406
11453
|
*
|
|
11407
11454
|
* @param param0
|
|
11408
11455
|
* @returns
|
|
@@ -11431,7 +11478,7 @@ async function processLifecycleInput({
|
|
|
11431
11478
|
|
|
11432
11479
|
exports.processLifecycleInput = processLifecycleInput;
|
|
11433
11480
|
/**
|
|
11434
|
-
* Process build cache output
|
|
11481
|
+
* Process build cache output rules.
|
|
11435
11482
|
*
|
|
11436
11483
|
* @param param0
|
|
11437
11484
|
* @returns
|
|
@@ -11446,11 +11493,11 @@ async function processOutput({
|
|
|
11446
11493
|
} = {
|
|
11447
11494
|
output: {}
|
|
11448
11495
|
}) {
|
|
11449
|
-
const mmIncludes = makeMmPatterns(output.include);
|
|
11450
|
-
const mmExcludes = makeMmPatterns(output.exclude);
|
|
11496
|
+
const mmIncludes = makeMmPatterns(output.include, output.minimatchOptions);
|
|
11497
|
+
const mmExcludes = makeMmPatterns(output.exclude, output.minimatchOptions);
|
|
11451
11498
|
const files = await scanFiles(cwd, mmIncludes, mmExcludes);
|
|
11452
11499
|
preFiles = [].concat(preFiles).filter(x => {
|
|
11453
|
-
if (!x ||
|
|
11500
|
+
if (!x || (0, minimatch_group_1.unrollMmMatch)(x, mmExcludes)) {
|
|
11454
11501
|
return false;
|
|
11455
11502
|
}
|
|
11456
11503
|
|
|
@@ -11487,7 +11534,7 @@ exports.processOutput = processOutput;
|
|
|
11487
11534
|
|
|
11488
11535
|
/***/ }),
|
|
11489
11536
|
|
|
11490
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
11537
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/fynpo-config.js":
|
|
11491
11538
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11492
11539
|
|
|
11493
11540
|
"use strict";
|
|
@@ -11637,7 +11684,7 @@ exports.FynpoConfigManager = FynpoConfigManager;
|
|
|
11637
11684
|
|
|
11638
11685
|
/***/ }),
|
|
11639
11686
|
|
|
11640
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
11687
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js":
|
|
11641
11688
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11642
11689
|
|
|
11643
11690
|
"use strict";
|
|
@@ -11667,9 +11714,9 @@ const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_mod
|
|
|
11667
11714
|
const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
|
|
11668
11715
|
const semver_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/semver/7.3.5/semver/index.js"));
|
|
11669
11716
|
|
|
11670
|
-
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
11717
|
+
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
|
|
11671
11718
|
|
|
11672
|
-
const util_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
11719
|
+
const util_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/util.js");
|
|
11673
11720
|
|
|
11674
11721
|
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"));
|
|
11675
11722
|
const DepSectionMap = {
|
|
@@ -12390,7 +12437,7 @@ exports.FynpoDepGraph = FynpoDepGraph;
|
|
|
12390
12437
|
|
|
12391
12438
|
/***/ }),
|
|
12392
12439
|
|
|
12393
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
12440
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/index.js":
|
|
12394
12441
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12395
12442
|
|
|
12396
12443
|
"use strict";
|
|
@@ -12412,12 +12459,12 @@ const filter_scan_dir_1 = __webpack_require__("./node_modules/.f/_/filter-scan-d
|
|
|
12412
12459
|
const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/minimatch/3.0.4/minimatch/minimatch.js"));
|
|
12413
12460
|
const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
|
|
12414
12461
|
|
|
12415
|
-
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
12462
|
+
const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
|
|
12416
12463
|
|
|
12417
|
-
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
12418
|
-
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
12419
|
-
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
12420
|
-
exports.caching = (0, tslib_1.__importStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.
|
|
12464
|
+
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js"), exports);
|
|
12465
|
+
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/fynpo-config.js"), exports);
|
|
12466
|
+
(0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/util.js"), exports);
|
|
12467
|
+
exports.caching = (0, tslib_1.__importStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/caching.js"));
|
|
12421
12468
|
/**
|
|
12422
12469
|
* Take an array of packages and figure out their dependencies on each other
|
|
12423
12470
|
*
|
|
@@ -12673,8 +12720,8 @@ exports.makePkgDeps = makePkgDeps;
|
|
|
12673
12720
|
|
|
12674
12721
|
/***/ }),
|
|
12675
12722
|
|
|
12676
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
12677
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
12723
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/minimatch-group.js":
|
|
12724
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12678
12725
|
|
|
12679
12726
|
"use strict";
|
|
12680
12727
|
|
|
@@ -12682,7 +12729,12 @@ exports.makePkgDeps = makePkgDeps;
|
|
|
12682
12729
|
Object.defineProperty(exports, "__esModule", ({
|
|
12683
12730
|
value: true
|
|
12684
12731
|
}));
|
|
12685
|
-
exports.groupMM = void 0;
|
|
12732
|
+
exports.unrollMmMatch = exports.checkMmMatch = exports.deconstructMM = exports.groupMM = void 0;
|
|
12733
|
+
|
|
12734
|
+
const tslib_1 = __webpack_require__("./node_modules/.f/_/tslib/2.1.0/tslib/tslib.es6.js");
|
|
12735
|
+
|
|
12736
|
+
const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/minimatch/3.0.4/minimatch/minimatch.js"));
|
|
12737
|
+
const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
|
|
12686
12738
|
/**
|
|
12687
12739
|
* process a list of minimatch objects and group them by the string prefix of their patterns
|
|
12688
12740
|
*
|
|
@@ -12716,10 +12768,97 @@ function groupMM(mms, groups) {
|
|
|
12716
12768
|
}
|
|
12717
12769
|
|
|
12718
12770
|
exports.groupMM = groupMM;
|
|
12771
|
+
/**
|
|
12772
|
+
* process a minimatch pattern to group them for matching directories
|
|
12773
|
+
*
|
|
12774
|
+
* - needs to create a new pattern at every non-string part
|
|
12775
|
+
* @param pattern
|
|
12776
|
+
*/
|
|
12777
|
+
|
|
12778
|
+
function deconstructMM(m0) {
|
|
12779
|
+
const mms = [];
|
|
12780
|
+
const patterns = {
|
|
12781
|
+
m0,
|
|
12782
|
+
mms
|
|
12783
|
+
};
|
|
12784
|
+
const set = m0.set[0];
|
|
12785
|
+
const globParts = m0.globParts[0];
|
|
12786
|
+
const iParts = [];
|
|
12787
|
+
const {
|
|
12788
|
+
GLOBSTAR
|
|
12789
|
+
} = minimatch_1.default;
|
|
12790
|
+
|
|
12791
|
+
for (let ix = 0; ix < set.length; ix++) {
|
|
12792
|
+
const s = set[ix];
|
|
12793
|
+
const g = globParts[ix]; // if we hit something that's not string, then we need a mm with just the strings
|
|
12794
|
+
// because a dir like "src" will not match "src/*"
|
|
12795
|
+
|
|
12796
|
+
if (typeof s !== "string" && iParts.length > 0) {
|
|
12797
|
+
mms.push(new minimatch_1.default.Minimatch(iParts.join("/"), m0.options));
|
|
12798
|
+
}
|
|
12799
|
+
|
|
12800
|
+
if (ix === set.length - 1) {
|
|
12801
|
+
mms.push(m0);
|
|
12802
|
+
break;
|
|
12803
|
+
} else {
|
|
12804
|
+
iParts.push(g);
|
|
12805
|
+
|
|
12806
|
+
if (typeof s !== "string") {
|
|
12807
|
+
mms.push(new minimatch_1.default.Minimatch(iParts.join("/"), m0.options));
|
|
12808
|
+
}
|
|
12809
|
+
}
|
|
12810
|
+
|
|
12811
|
+
if (s === GLOBSTAR) {
|
|
12812
|
+
// a pattern ending in GLOBSTAR will match anything
|
|
12813
|
+
break;
|
|
12814
|
+
}
|
|
12815
|
+
}
|
|
12816
|
+
|
|
12817
|
+
return patterns;
|
|
12818
|
+
}
|
|
12819
|
+
|
|
12820
|
+
exports.deconstructMM = deconstructMM;
|
|
12821
|
+
/**
|
|
12822
|
+
* check that a path matches against a list of minimatch patterns
|
|
12823
|
+
*
|
|
12824
|
+
* @param fullPath
|
|
12825
|
+
* @param patterns
|
|
12826
|
+
* @returns the first pattern that match or false
|
|
12827
|
+
*/
|
|
12828
|
+
|
|
12829
|
+
function checkMmMatch(fullPath, patterns) {
|
|
12830
|
+
return !lodash_1.default.isEmpty(patterns) && patterns.find(patternMm => patternMm.match(fullPath));
|
|
12831
|
+
}
|
|
12832
|
+
|
|
12833
|
+
exports.checkMmMatch = checkMmMatch;
|
|
12834
|
+
/**
|
|
12835
|
+
* Take a full path and match each level of it to a list of minimatch patterns
|
|
12836
|
+
*
|
|
12837
|
+
* @param path
|
|
12838
|
+
* @param mms
|
|
12839
|
+
* @returns
|
|
12840
|
+
*/
|
|
12841
|
+
|
|
12842
|
+
function unrollMmMatch(path, mms) {
|
|
12843
|
+
const parts = path.split("/");
|
|
12844
|
+
let rp;
|
|
12845
|
+
|
|
12846
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
12847
|
+
rp = rp !== undefined ? rp + "/" + parts[i] : parts[i];
|
|
12848
|
+
|
|
12849
|
+
if (checkMmMatch(`${rp}/`, mms)) {
|
|
12850
|
+
return true;
|
|
12851
|
+
}
|
|
12852
|
+
}
|
|
12853
|
+
|
|
12854
|
+
return !!checkMmMatch(path, mms);
|
|
12855
|
+
}
|
|
12856
|
+
|
|
12857
|
+
exports.unrollMmMatch = unrollMmMatch;
|
|
12719
12858
|
|
|
12720
12859
|
/***/ }),
|
|
12721
12860
|
|
|
12722
|
-
/***/ "./node_modules/.f/_/@fynpo/base/1.1.
|
|
12861
|
+
/***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/util.js":
|
|
12723
12862
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12724
12863
|
|
|
12725
12864
|
"use strict";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fyn",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.31",
|
|
4
4
|
"description": "The package manager for fynpo, a zero setup monorepo manager",
|
|
5
5
|
"main": "./bin/fyn.js",
|
|
6
6
|
"homepage": "https://jchip.github.io/fynpo/",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"ci:check": "xrun xarc/check",
|
|
16
16
|
"coveralls": "cat coverage/lcov.info | coveralls",
|
|
17
17
|
"prepublishOnly": "xrun build",
|
|
18
|
-
"postpack": "publish-util-postpack"
|
|
18
|
+
"postpack": "publish-util-postpack",
|
|
19
|
+
"blah": "exit 5"
|
|
19
20
|
},
|
|
20
21
|
"bin": {
|
|
21
22
|
"0-npx-please-run-this-for-fyn": "./bin/fyn.js",
|