fyn 1.1.29 → 1.1.32

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.
Files changed (2) hide show
  1. package/dist/fyn.js +198 -52
  2. package/package.json +1 -1
package/dist/fyn.js CHANGED
@@ -1073,13 +1073,21 @@ class FynCli {
1073
1073
  }
1074
1074
  }));
1075
1075
 
1076
- const env = npmLifecycle.initEnv(process.env, this.fyn.production);
1076
+ const env = npmLifecycle.initEnv(process.env, this.fyn.production); // add fynpo top dir node_modules/.bin to PATH
1077
+
1078
+ if (this._config._fynpo.config) {
1079
+ xsh.envPath.addToFront(Path.join(this._config._fynpo.dir, "node_modules/.bin"), env);
1080
+ }
1081
+
1077
1082
  setupNodeGypEnv(env);
1078
1083
  return Promise.each(_scripts, s => _.get(pkg, ["scripts", s]) && this.runScript(pkg, s, Object.assign({}, env)));
1079
1084
  }
1080
1085
 
1081
1086
  async run(argv, script = "") {
1082
- this._config._fynpo = false;
1087
+ if (!this._config._fynpo) {
1088
+ this._config._fynpo = {};
1089
+ }
1090
+
1083
1091
  script = script || argv.args.script;
1084
1092
 
1085
1093
  if (argv.opts.list || !script) {
@@ -1313,7 +1321,8 @@ const pickOptions = async (argv, nixClap, checkFynpo = true) => {
1313
1321
  return {
1314
1322
  opts: argv.opts,
1315
1323
  rcData,
1316
- _cliSource: argv.source
1324
+ _cliSource: argv.source,
1325
+ _fynpo: fynpo
1317
1326
  };
1318
1327
  };
1319
1328
 
@@ -1600,7 +1609,8 @@ const commands = {
1600
1609
  usage: "$0 $1 <command> [-- <args>...]",
1601
1610
  exec: async (argv, parsed) => {
1602
1611
  try {
1603
- return await new FynCli(await pickOptions(argv, parsed.nixClap, !argv.opts.list)).run(argv);
1612
+ const options = await pickOptions(argv, parsed.nixClap, !argv.opts.list);
1613
+ return await new FynCli(options).run(argv);
1604
1614
  } catch (err) {
1605
1615
  if (err.errno !== undefined) {
1606
1616
  process.exit(err.errno);
@@ -4076,7 +4086,11 @@ class LifecycleScripts {
4076
4086
  // this._addNpmPackageConfig(this._appPkg.config, env);
4077
4087
  // this._addNpmPackageConfig(this._pkg.config, env);
4078
4088
  const env = Object.assign({}, npmConfigEnv(this._pkg, this._fyn.allrc || {}), override);
4079
- setupNodeGypEnv(env);
4089
+ setupNodeGypEnv(env); // add fynpo node_modules/.bin to PATH
4090
+
4091
+ if (this._fyn.isFynpo) {
4092
+ xsh.envPath.addToFront(Path.join(this._fyn._fynpo.dir, "node_modules/.bin"), env);
4093
+ }
4080
4094
 
4081
4095
  if (this._appDir) {
4082
4096
  xsh.envPath.addToFront(Path.join(this._appDir, "node_modules/.bin"), env);
@@ -5762,7 +5776,7 @@ const {
5762
5776
  const {
5763
5777
  getDepSection,
5764
5778
  makeDepStep
5765
- } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/index.js");
5779
+ } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/index.js");
5766
5780
 
5767
5781
  const xaa = __webpack_require__("./lib/util/xaa.js");
5768
5782
 
@@ -7953,10 +7967,8 @@ class PkgInstaller {
7953
7967
  }
7954
7968
 
7955
7969
  async _buildLocalPkg(depInfo) {
7956
- if (this._fyn._localPkgBuilder) {
7970
+ if (this._fyn._options.buildLocal && this._fyn._localPkgBuilder) {
7957
7971
  await this._fyn._localPkgBuilder.waitForItem(depInfo.dir);
7958
- } else {
7959
- logger.error("pkg-installer: there is no this._fyn._localPkgBuilder");
7960
7972
  }
7961
7973
  }
7962
7974
 
@@ -8732,7 +8744,7 @@ const {
8732
8744
 
8733
8745
  const {
8734
8746
  PackageRef
8735
- } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/index.js");
8747
+ } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/index.js");
8736
8748
 
8737
8749
  const WATCH_TIME = 5000; // consider meta cache stale after this much time (30 minutes)
8738
8750
 
@@ -9263,7 +9275,8 @@ class PkgSrcManager {
9263
9275
  const packument = cached && cached.data && JSON.parse(cached.data);
9264
9276
  foundCache = cached;
9265
9277
  const stale = Date.now() - cached.refreshTime;
9266
- logger.debug("found", pkgName, "packument cache, refreshTime", cached.refreshTime, "since", (stale / 1000).toFixed(2), "secs");
9278
+ const since = (stale / 1000).toFixed(2);
9279
+ logger.debug(`found packument cache for '${pkgName}' - refreshed ${since}secs ago at ${cached.refreshTime}`);
9267
9280
 
9268
9281
  if (this._fyn._options.refreshMeta !== true && cached && cached.refreshTime && stale < META_CACHE_STALE_TIME) {
9269
9282
  cacheMemoized = true;
@@ -9273,7 +9286,7 @@ class PkgSrcManager {
9273
9286
  const encKey = encodeURIComponent(cacheKey);
9274
9287
  return nodeFetch(`${metaMemoizeUrl}?key=${encKey}`).then(res => {
9275
9288
  if (res.status === 200) {
9276
- logger.debug(pkgName, "using memoized packument cache");
9289
+ logger.debug(`using memoized packument cache for '${pkgName}'`);
9277
9290
  cacheMemoized = true;
9278
9291
  this._metaStat.wait--;
9279
9292
  return packument;
@@ -9286,7 +9299,8 @@ class PkgSrcManager {
9286
9299
  }
9287
9300
  }).catch(err => {
9288
9301
  if (foundCache) {
9289
- logger.debug("fail to process packument cache", err.message, "data", foundCache.data && foundCache.data.toString());
9302
+ const data = foundCache.data && foundCache.data.toString();
9303
+ logger.debug(`fail to process packument cache - ${err.message}; data ${data}`);
9290
9304
  throw err;
9291
9305
  }
9292
9306
 
@@ -9748,7 +9762,7 @@ const {
9748
9762
  const {
9749
9763
  FynpoConfigManager,
9750
9764
  FynpoDepGraph
9751
- } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/index.js");
9765
+ } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/index.js");
9752
9766
  /* eslint-disable no-magic-numbers, max-statements, no-empty, complexity, no-eval */
9753
9767
 
9754
9768
 
@@ -11246,7 +11260,7 @@ module.exports = __webpack_require__("./node_modules/.f/_/xaa/1.7.0/xaa/dist/xaa
11246
11260
 
11247
11261
  /***/ }),
11248
11262
 
11249
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/caching.js":
11263
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/caching.js":
11250
11264
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11251
11265
 
11252
11266
  "use strict";
@@ -11255,7 +11269,7 @@ module.exports = __webpack_require__("./node_modules/.f/_/xaa/1.7.0/xaa/dist/xaa
11255
11269
  Object.defineProperty(exports, "__esModule", ({
11256
11270
  value: true
11257
11271
  }));
11258
- exports.processOutput = exports.processLifecycleInput = exports.processInput = void 0;
11272
+ exports.processOutput = exports.processLifecycleInput = exports.processInput = exports.readHashDigest = void 0;
11259
11273
 
11260
11274
  const tslib_1 = __webpack_require__("./node_modules/.f/_/tslib/2.1.0/tslib/tslib.es6.js");
11261
11275
 
@@ -11266,6 +11280,8 @@ const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_module
11266
11280
  const fs_1 = (0, tslib_1.__importDefault)(__webpack_require__("fs"));
11267
11281
  const path_1 = (0, tslib_1.__importDefault)(__webpack_require__("path"));
11268
11282
  const crypto_1 = (0, tslib_1.__importDefault)(__webpack_require__("crypto"));
11283
+
11284
+ const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
11269
11285
  /**
11270
11286
  * create a sha256 hash for some data
11271
11287
  *
@@ -11273,19 +11289,40 @@ const crypto_1 = (0, tslib_1.__importDefault)(__webpack_require__("crypto"));
11273
11289
  * @returns
11274
11290
  */
11275
11291
 
11292
+
11276
11293
  function hashData1(data, encoding = "base64url") {
11277
11294
  return crypto_1.default.createHash("sha256").update(data).digest(encoding);
11278
11295
  }
11279
11296
 
11297
+ function makeBase64Url(hash) {
11298
+ return hash.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
11299
+ }
11300
+
11280
11301
  function hashData2(data, encoding = "base64url") {
11281
11302
  if (encoding === "base64url") {
11282
- return hashData1(data, "base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
11303
+ return makeBase64Url(hashData1(data, "base64"));
11283
11304
  }
11284
11305
 
11285
11306
  return hashData1(data, encoding);
11286
11307
  }
11287
11308
 
11288
- const hashData = typeof crypto_1.default.createHash("sha256").digest("base64url") === "string" ? hashData1 : hashData2;
11309
+ const hasBase64Url = typeof crypto_1.default.createHash("sha256").digest("base64url") === "string";
11310
+ const hashData = hasBase64Url ? hashData1 : hashData2;
11311
+ exports.readHashDigest = hasBase64Url ? (hash, encoding = "base64url") => {
11312
+ hash.setEncoding(encoding);
11313
+ hash.end();
11314
+ return hash.read();
11315
+ } : (hash, encoding = "base64url") => {
11316
+ if (encoding === "base64url") {
11317
+ hash.setEncoding("base64");
11318
+ hash.end();
11319
+ return makeBase64Url(hash.read());
11320
+ }
11321
+
11322
+ hash.setEncoding(encoding);
11323
+ hash.end();
11324
+ return hash.read();
11325
+ };
11289
11326
  /**
11290
11327
  * generate sha256 has of a file
11291
11328
  *
@@ -11346,17 +11383,6 @@ function makeMmPatterns(patterns, options = {
11346
11383
  }) {
11347
11384
  return [].concat(patterns).map(x => x && new minimatch_1.default.Minimatch(x, options)).filter(x => x);
11348
11385
  }
11349
- /**
11350
- *
11351
- * @param fullPath
11352
- * @param patterns
11353
- * @returns
11354
- */
11355
-
11356
-
11357
- function checkMmMatch(fullPath, patterns) {
11358
- return !lodash_1.default.isEmpty(patterns) && patterns.find(patternMm => patternMm.match(fullPath));
11359
- }
11360
11386
  /**
11361
11387
  * Scan for files using include and exclude patterns
11362
11388
  *
@@ -11368,21 +11394,46 @@ function checkMmMatch(fullPath, patterns) {
11368
11394
 
11369
11395
  async function scanFiles(cwd, includes, excludes) {
11370
11396
  const filter = (_file, _path, extras) => {
11371
- if (!checkMmMatch(extras.dirFile, includes) || checkMmMatch(extras.dirFile, excludes)) {
11397
+ if (!(0, minimatch_group_1.checkMmMatch)(extras.dirFile, includes) || (0, minimatch_group_1.checkMmMatch)(extras.dirFile, excludes)) {
11372
11398
  return false;
11373
11399
  }
11374
11400
 
11375
11401
  return true;
11376
11402
  };
11377
11403
 
11404
+ const dirIncludes = includes.map(mx => (0, minimatch_group_1.deconstructMM)(mx));
11405
+
11406
+ const filterDir = (_file, _path, extras) => {
11407
+ const dir = `${extras.dirFile}/`; // add extra / to force matching directory
11408
+
11409
+ const inc = dirIncludes.find(di => (0, minimatch_group_1.checkMmMatch)(dir, di.mms));
11410
+
11411
+ if (inc) {
11412
+ const exc = (0, minimatch_group_1.checkMmMatch)(dir, excludes);
11413
+
11414
+ if (!exc) {
11415
+ return true;
11416
+ }
11417
+ }
11418
+
11419
+ return false;
11420
+ };
11421
+
11378
11422
  return (await (0, filter_scan_dir_1.filterScanDir)({
11379
11423
  cwd,
11380
11424
  filter,
11381
- filterDir: filter,
11425
+ filterDir,
11382
11426
  fullStat: false,
11383
11427
  concurrency: 500
11384
11428
  })).sort();
11385
11429
  }
11430
+ /**
11431
+ * process caching input rules and return result from it
11432
+ *
11433
+ * @param param0
11434
+ * @returns result from processing input rules
11435
+ */
11436
+
11386
11437
 
11387
11438
  async function processInput({
11388
11439
  cwd,
@@ -11392,7 +11443,7 @@ async function processInput({
11392
11443
  } = {
11393
11444
  input: {}
11394
11445
  }) {
11395
- const files = await scanFiles(cwd, makeMmPatterns(input.include), makeMmPatterns(input.exclude));
11446
+ const files = await scanFiles(cwd, makeMmPatterns(input.include, input.minimatchOptions), makeMmPatterns(input.exclude, input.minimatchOptions));
11396
11447
  const fileHashes = await hashFiles(cwd, files);
11397
11448
  const data = {
11398
11449
  env: lodash_1.default.pick(process.env, input.includeEnv),
@@ -11412,6 +11463,7 @@ async function processInput({
11412
11463
 
11413
11464
  exports.processInput = processInput;
11414
11465
  /**
11466
+ * process lifecycle caching input rules
11415
11467
  *
11416
11468
  * @param param0
11417
11469
  * @returns
@@ -11440,7 +11492,7 @@ async function processLifecycleInput({
11440
11492
 
11441
11493
  exports.processLifecycleInput = processLifecycleInput;
11442
11494
  /**
11443
- * Process build cache output file config.
11495
+ * Process build cache output rules.
11444
11496
  *
11445
11497
  * @param param0
11446
11498
  * @returns
@@ -11455,11 +11507,11 @@ async function processOutput({
11455
11507
  } = {
11456
11508
  output: {}
11457
11509
  }) {
11458
- const mmIncludes = makeMmPatterns(output.include);
11459
- const mmExcludes = makeMmPatterns(output.exclude);
11510
+ const mmIncludes = makeMmPatterns(output.include, output.minimatchOptions);
11511
+ const mmExcludes = makeMmPatterns(output.exclude, output.minimatchOptions);
11460
11512
  const files = await scanFiles(cwd, mmIncludes, mmExcludes);
11461
11513
  preFiles = [].concat(preFiles).filter(x => {
11462
- if (!x || checkMmMatch(x, mmExcludes)) {
11514
+ if (!x || (0, minimatch_group_1.unrollMmMatch)(x, mmExcludes)) {
11463
11515
  return false;
11464
11516
  }
11465
11517
 
@@ -11483,12 +11535,13 @@ async function processOutput({
11483
11535
  } //
11484
11536
 
11485
11537
 
11538
+ const now = Date.now();
11486
11539
  return {
11487
11540
  files: allFiles,
11488
11541
  data,
11489
11542
  hash,
11490
- access: Date.now(),
11491
- create: Date.now()
11543
+ access: now,
11544
+ create: now
11492
11545
  };
11493
11546
  }
11494
11547
 
@@ -11496,7 +11549,7 @@ exports.processOutput = processOutput;
11496
11549
 
11497
11550
  /***/ }),
11498
11551
 
11499
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/fynpo-config.js":
11552
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/fynpo-config.js":
11500
11553
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11501
11554
 
11502
11555
  "use strict";
@@ -11646,7 +11699,7 @@ exports.FynpoConfigManager = FynpoConfigManager;
11646
11699
 
11647
11700
  /***/ }),
11648
11701
 
11649
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js":
11702
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js":
11650
11703
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11651
11704
 
11652
11705
  "use strict";
@@ -11676,9 +11729,9 @@ const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_mod
11676
11729
  const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
11677
11730
  const semver_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/semver/7.3.5/semver/index.js"));
11678
11731
 
11679
- const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
11732
+ const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
11680
11733
 
11681
- const util_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/util.js");
11734
+ const util_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/util.js");
11682
11735
 
11683
11736
  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"));
11684
11737
  const DepSectionMap = {
@@ -12399,7 +12452,7 @@ exports.FynpoDepGraph = FynpoDepGraph;
12399
12452
 
12400
12453
  /***/ }),
12401
12454
 
12402
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/index.js":
12455
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/index.js":
12403
12456
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12404
12457
 
12405
12458
  "use strict";
@@ -12421,12 +12474,12 @@ const filter_scan_dir_1 = __webpack_require__("./node_modules/.f/_/filter-scan-d
12421
12474
  const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/minimatch/3.0.4/minimatch/minimatch.js"));
12422
12475
  const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
12423
12476
 
12424
- const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
12477
+ const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
12425
12478
 
12426
- (0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js"), exports);
12427
- (0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/fynpo-config.js"), exports);
12428
- (0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/util.js"), exports);
12429
- exports.caching = (0, tslib_1.__importStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/caching.js"));
12479
+ (0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js"), exports);
12480
+ (0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/fynpo-config.js"), exports);
12481
+ (0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/util.js"), exports);
12482
+ exports.caching = (0, tslib_1.__importStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/caching.js"));
12430
12483
  /**
12431
12484
  * Take an array of packages and figure out their dependencies on each other
12432
12485
  *
@@ -12682,8 +12735,8 @@ exports.makePkgDeps = makePkgDeps;
12682
12735
 
12683
12736
  /***/ }),
12684
12737
 
12685
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/minimatch-group.js":
12686
- /***/ ((__unused_webpack_module, exports) => {
12738
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/minimatch-group.js":
12739
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12687
12740
 
12688
12741
  "use strict";
12689
12742
 
@@ -12691,7 +12744,12 @@ exports.makePkgDeps = makePkgDeps;
12691
12744
  Object.defineProperty(exports, "__esModule", ({
12692
12745
  value: true
12693
12746
  }));
12694
- exports.groupMM = void 0;
12747
+ exports.unrollMmMatch = exports.checkMmMatch = exports.deconstructMM = exports.groupMM = void 0;
12748
+
12749
+ const tslib_1 = __webpack_require__("./node_modules/.f/_/tslib/2.1.0/tslib/tslib.es6.js");
12750
+
12751
+ const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/minimatch/3.0.4/minimatch/minimatch.js"));
12752
+ const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
12695
12753
  /**
12696
12754
  * process a list of minimatch objects and group them by the string prefix of their patterns
12697
12755
  *
@@ -12725,10 +12783,98 @@ function groupMM(mms, groups) {
12725
12783
  }
12726
12784
 
12727
12785
  exports.groupMM = groupMM;
12786
+ /**
12787
+ * process a minimatch pattern to group them for matching directories
12788
+ *
12789
+ * - needs to create a new pattern at every non-string part
12790
+ * @param m0 minimatch pattern
12791
+ */
12792
+
12793
+ function deconstructMM(m0) {
12794
+ const mms = [];
12795
+ const patterns = {
12796
+ m0,
12797
+ mms
12798
+ };
12799
+ const set = m0.set[0];
12800
+ const globParts = m0.globParts[0];
12801
+ const iParts = [];
12802
+ const {
12803
+ GLOBSTAR
12804
+ } = minimatch_1.default;
12805
+
12806
+ for (let ix = 0; ix < set.length; ix++) {
12807
+ const s = set[ix];
12808
+ const g = globParts[ix]; // if we hit something that's not string, then we need a mm with just the strings
12809
+ // because a dir like "src" will not match "src/*"
12810
+
12811
+ if (typeof s !== "string" && iParts.length > 0) {
12812
+ mms.push(new minimatch_1.default.Minimatch(iParts.join("/"), m0.options));
12813
+ }
12814
+
12815
+ if (ix === set.length - 1) {
12816
+ mms.push(m0);
12817
+ break;
12818
+ } else {
12819
+ iParts.push(g);
12820
+
12821
+ if (typeof s !== "string") {
12822
+ mms.push(new minimatch_1.default.Minimatch(iParts.join("/"), m0.options));
12823
+ }
12824
+ }
12825
+
12826
+ if (s === GLOBSTAR) {
12827
+ // a pattern ending in GLOBSTAR will match anything
12828
+ break;
12829
+ }
12830
+ }
12831
+
12832
+ return patterns;
12833
+ }
12834
+
12835
+ exports.deconstructMM = deconstructMM;
12836
+ /**
12837
+ * check that a path matches against a list of minimatch patterns
12838
+ *
12839
+ * @param fullPath
12840
+ * @param patterns
12841
+ * @returns the first pattern that match or false
12842
+ */
12843
+
12844
+ function checkMmMatch(fullPath, patterns) {
12845
+ return !lodash_1.default.isEmpty(patterns) && patterns.find(patternMm => patternMm.match(fullPath));
12846
+ }
12847
+
12848
+ exports.checkMmMatch = checkMmMatch;
12849
+ /**
12850
+ * Take a full path and match each level of it to a list of minimatch patterns
12851
+ *
12852
+ * @param path
12853
+ * @param mms
12854
+ * @returns
12855
+ */
12856
+
12857
+ function unrollMmMatch(path, mms) {
12858
+ const parts = path.split("/");
12859
+ let rp;
12860
+
12861
+ for (let i = 0; i < parts.length - 1; i++) {
12862
+ rp = rp !== undefined ? rp + "/" + parts[i] : parts[i];
12863
+ const m1 = checkMmMatch(`${rp}/`, mms);
12864
+
12865
+ if (m1) {
12866
+ return m1;
12867
+ }
12868
+ }
12869
+
12870
+ return checkMmMatch(path, mms);
12871
+ }
12872
+
12873
+ exports.unrollMmMatch = unrollMmMatch;
12728
12874
 
12729
12875
  /***/ }),
12730
12876
 
12731
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/util.js":
12877
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.14-fynlocal_h/@fynpo/base/dist/util.js":
12732
12878
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12733
12879
 
12734
12880
  "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fyn",
3
- "version": "1.1.29",
3
+ "version": "1.1.32",
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/",