fyn 1.1.30 → 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.
Files changed (2) hide show
  1. package/dist/fyn.js +110 -58
  2. package/package.json +1 -1
package/dist/fyn.js CHANGED
@@ -5762,7 +5762,7 @@ const {
5762
5762
  const {
5763
5763
  getDepSection,
5764
5764
  makeDepStep
5765
- } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/index.js");
5765
+ } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/index.js");
5766
5766
 
5767
5767
  const xaa = __webpack_require__("./lib/util/xaa.js");
5768
5768
 
@@ -7953,10 +7953,8 @@ class PkgInstaller {
7953
7953
  }
7954
7954
 
7955
7955
  async _buildLocalPkg(depInfo) {
7956
- if (this._fyn._localPkgBuilder) {
7956
+ if (this._fyn._options.buildLocal && this._fyn._localPkgBuilder) {
7957
7957
  await this._fyn._localPkgBuilder.waitForItem(depInfo.dir);
7958
- } else {
7959
- logger.error("pkg-installer: there is no this._fyn._localPkgBuilder");
7960
7958
  }
7961
7959
  }
7962
7960
 
@@ -8732,7 +8730,7 @@ const {
8732
8730
 
8733
8731
  const {
8734
8732
  PackageRef
8735
- } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/index.js");
8733
+ } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/index.js");
8736
8734
 
8737
8735
  const WATCH_TIME = 5000; // consider meta cache stale after this much time (30 minutes)
8738
8736
 
@@ -9263,7 +9261,8 @@ class PkgSrcManager {
9263
9261
  const packument = cached && cached.data && JSON.parse(cached.data);
9264
9262
  foundCache = cached;
9265
9263
  const stale = Date.now() - cached.refreshTime;
9266
- logger.debug("found", pkgName, "packument cache, refreshTime", cached.refreshTime, "since", (stale / 1000).toFixed(2), "secs");
9264
+ const since = (stale / 1000).toFixed(2);
9265
+ logger.debug(`found packument cache for '${pkgName}' - refreshed ${since}secs ago at ${cached.refreshTime}`);
9267
9266
 
9268
9267
  if (this._fyn._options.refreshMeta !== true && cached && cached.refreshTime && stale < META_CACHE_STALE_TIME) {
9269
9268
  cacheMemoized = true;
@@ -9273,7 +9272,7 @@ class PkgSrcManager {
9273
9272
  const encKey = encodeURIComponent(cacheKey);
9274
9273
  return nodeFetch(`${metaMemoizeUrl}?key=${encKey}`).then(res => {
9275
9274
  if (res.status === 200) {
9276
- logger.debug(pkgName, "using memoized packument cache");
9275
+ logger.debug(`using memoized packument cache for '${pkgName}'`);
9277
9276
  cacheMemoized = true;
9278
9277
  this._metaStat.wait--;
9279
9278
  return packument;
@@ -9286,7 +9285,8 @@ class PkgSrcManager {
9286
9285
  }
9287
9286
  }).catch(err => {
9288
9287
  if (foundCache) {
9289
- logger.debug("fail to process packument cache", err.message, "data", foundCache.data && foundCache.data.toString());
9288
+ const data = foundCache.data && foundCache.data.toString();
9289
+ logger.debug(`fail to process packument cache - ${err.message}; data ${data}`);
9290
9290
  throw err;
9291
9291
  }
9292
9292
 
@@ -9748,7 +9748,7 @@ const {
9748
9748
  const {
9749
9749
  FynpoConfigManager,
9750
9750
  FynpoDepGraph
9751
- } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/index.js");
9751
+ } = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/index.js");
9752
9752
  /* eslint-disable no-magic-numbers, max-statements, no-empty, complexity, no-eval */
9753
9753
 
9754
9754
 
@@ -11246,7 +11246,7 @@ module.exports = __webpack_require__("./node_modules/.f/_/xaa/1.7.0/xaa/dist/xaa
11246
11246
 
11247
11247
  /***/ }),
11248
11248
 
11249
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/caching.js":
11249
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/caching.js":
11250
11250
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11251
11251
 
11252
11252
  "use strict";
@@ -11255,7 +11255,7 @@ module.exports = __webpack_require__("./node_modules/.f/_/xaa/1.7.0/xaa/dist/xaa
11255
11255
  Object.defineProperty(exports, "__esModule", ({
11256
11256
  value: true
11257
11257
  }));
11258
- exports.processOutput = exports.processLifecycleInput = exports.processInput = void 0;
11258
+ exports.processOutput = exports.processLifecycleInput = exports.processInput = exports.readHashDigest = void 0;
11259
11259
 
11260
11260
  const tslib_1 = __webpack_require__("./node_modules/.f/_/tslib/2.1.0/tslib/tslib.es6.js");
11261
11261
 
@@ -11267,7 +11267,7 @@ const fs_1 = (0, tslib_1.__importDefault)(__webpack_require__("fs"));
11267
11267
  const path_1 = (0, tslib_1.__importDefault)(__webpack_require__("path"));
11268
11268
  const crypto_1 = (0, tslib_1.__importDefault)(__webpack_require__("crypto"));
11269
11269
 
11270
- const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
11270
+ const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
11271
11271
  /**
11272
11272
  * create a sha256 hash for some data
11273
11273
  *
@@ -11280,15 +11280,35 @@ function hashData1(data, encoding = "base64url") {
11280
11280
  return crypto_1.default.createHash("sha256").update(data).digest(encoding);
11281
11281
  }
11282
11282
 
11283
+ function makeBase64Url(hash) {
11284
+ return hash.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
11285
+ }
11286
+
11283
11287
  function hashData2(data, encoding = "base64url") {
11284
11288
  if (encoding === "base64url") {
11285
- return hashData1(data, "base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
11289
+ return makeBase64Url(hashData1(data, "base64"));
11286
11290
  }
11287
11291
 
11288
11292
  return hashData1(data, encoding);
11289
11293
  }
11290
11294
 
11291
- const hashData = typeof crypto_1.default.createHash("sha256").digest("base64url") === "string" ? hashData1 : hashData2;
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
+ };
11292
11312
  /**
11293
11313
  * generate sha256 has of a file
11294
11314
  *
@@ -11349,17 +11369,6 @@ function makeMmPatterns(patterns, options = {
11349
11369
  }) {
11350
11370
  return [].concat(patterns).map(x => x && new minimatch_1.default.Minimatch(x, options)).filter(x => x);
11351
11371
  }
11352
- /**
11353
- *
11354
- * @param fullPath
11355
- * @param patterns
11356
- * @returns
11357
- */
11358
-
11359
-
11360
- function checkMmMatch(fullPath, patterns) {
11361
- return !lodash_1.default.isEmpty(patterns) && patterns.find(patternMm => patternMm.match(fullPath));
11362
- }
11363
11372
  /**
11364
11373
  * Scan for files using include and exclude patterns
11365
11374
  *
@@ -11371,7 +11380,7 @@ function checkMmMatch(fullPath, patterns) {
11371
11380
 
11372
11381
  async function scanFiles(cwd, includes, excludes) {
11373
11382
  const filter = (_file, _path, extras) => {
11374
- 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)) {
11375
11384
  return false;
11376
11385
  }
11377
11386
 
@@ -11381,19 +11390,19 @@ async function scanFiles(cwd, includes, excludes) {
11381
11390
  const dirIncludes = includes.map(mx => (0, minimatch_group_1.deconstructMM)(mx));
11382
11391
 
11383
11392
  const filterDir = (_file, _path, extras) => {
11384
- const inc = dirIncludes.find(di => checkMmMatch(extras.dirFile, di.mms));
11393
+ const dir = `${extras.dirFile}/`; // add extra / to force matching directory
11385
11394
 
11386
- if (!inc) {
11387
- return false;
11388
- }
11395
+ const inc = dirIncludes.find(di => (0, minimatch_group_1.checkMmMatch)(dir, di.mms));
11389
11396
 
11390
- const exc = checkMmMatch(extras.dirFile, excludes);
11397
+ if (inc) {
11398
+ const exc = (0, minimatch_group_1.checkMmMatch)(dir, excludes);
11391
11399
 
11392
- if (exc) {
11393
- return false;
11400
+ if (!exc) {
11401
+ return true;
11402
+ }
11394
11403
  }
11395
11404
 
11396
- return true;
11405
+ return false;
11397
11406
  };
11398
11407
 
11399
11408
  return (await (0, filter_scan_dir_1.filterScanDir)({
@@ -11488,7 +11497,7 @@ async function processOutput({
11488
11497
  const mmExcludes = makeMmPatterns(output.exclude, output.minimatchOptions);
11489
11498
  const files = await scanFiles(cwd, mmIncludes, mmExcludes);
11490
11499
  preFiles = [].concat(preFiles).filter(x => {
11491
- if (!x || checkMmMatch(x, mmExcludes)) {
11500
+ if (!x || (0, minimatch_group_1.unrollMmMatch)(x, mmExcludes)) {
11492
11501
  return false;
11493
11502
  }
11494
11503
 
@@ -11525,7 +11534,7 @@ exports.processOutput = processOutput;
11525
11534
 
11526
11535
  /***/ }),
11527
11536
 
11528
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/fynpo-config.js":
11537
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/fynpo-config.js":
11529
11538
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11530
11539
 
11531
11540
  "use strict";
@@ -11675,7 +11684,7 @@ exports.FynpoConfigManager = FynpoConfigManager;
11675
11684
 
11676
11685
  /***/ }),
11677
11686
 
11678
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js":
11687
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js":
11679
11688
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11680
11689
 
11681
11690
  "use strict";
@@ -11705,9 +11714,9 @@ const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_mod
11705
11714
  const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
11706
11715
  const semver_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/semver/7.3.5/semver/index.js"));
11707
11716
 
11708
- const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
11717
+ const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
11709
11718
 
11710
- const util_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/util.js");
11719
+ const util_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/util.js");
11711
11720
 
11712
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"));
11713
11722
  const DepSectionMap = {
@@ -12428,7 +12437,7 @@ exports.FynpoDepGraph = FynpoDepGraph;
12428
12437
 
12429
12438
  /***/ }),
12430
12439
 
12431
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/index.js":
12440
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/index.js":
12432
12441
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12433
12442
 
12434
12443
  "use strict";
@@ -12450,12 +12459,12 @@ const filter_scan_dir_1 = __webpack_require__("./node_modules/.f/_/filter-scan-d
12450
12459
  const minimatch_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/minimatch/3.0.4/minimatch/minimatch.js"));
12451
12460
  const lodash_1 = (0, tslib_1.__importDefault)(__webpack_require__("./node_modules/.f/_/lodash/4.17.21/lodash/lodash.min.js"));
12452
12461
 
12453
- const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
12462
+ const minimatch_group_1 = __webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/minimatch-group.js");
12454
12463
 
12455
- (0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/fynpo-dep-graph.js"), exports);
12456
- (0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/fynpo-config.js"), exports);
12457
- (0, tslib_1.__exportStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/util.js"), exports);
12458
- exports.caching = (0, tslib_1.__importStar)(__webpack_require__("./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/caching.js"));
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"));
12459
12468
  /**
12460
12469
  * Take an array of packages and figure out their dependencies on each other
12461
12470
  *
@@ -12711,7 +12720,7 @@ exports.makePkgDeps = makePkgDeps;
12711
12720
 
12712
12721
  /***/ }),
12713
12722
 
12714
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/minimatch-group.js":
12723
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/minimatch-group.js":
12715
12724
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12716
12725
 
12717
12726
  "use strict";
@@ -12720,11 +12729,12 @@ exports.makePkgDeps = makePkgDeps;
12720
12729
  Object.defineProperty(exports, "__esModule", ({
12721
12730
  value: true
12722
12731
  }));
12723
- exports.deconstructMM = exports.groupMM = void 0;
12732
+ exports.unrollMmMatch = exports.checkMmMatch = exports.deconstructMM = exports.groupMM = void 0;
12724
12733
 
12725
12734
  const tslib_1 = __webpack_require__("./node_modules/.f/_/tslib/2.1.0/tslib/tslib.es6.js");
12726
12735
 
12727
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"));
12728
12738
  /**
12729
12739
  * process a list of minimatch objects and group them by the string prefix of their patterns
12730
12740
  *
@@ -12778,35 +12788,77 @@ function deconstructMM(m0) {
12778
12788
  GLOBSTAR
12779
12789
  } = minimatch_1.default;
12780
12790
 
12781
- for (let ix = 0; ix < set.length - 1; ix++) {
12791
+ for (let ix = 0; ix < set.length; ix++) {
12782
12792
  const s = set[ix];
12783
- const g = globParts[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/*"
12784
12795
 
12785
- if (typeof s !== "string" && s !== GLOBSTAR && iParts.length > 0) {
12796
+ if (typeof s !== "string" && iParts.length > 0) {
12786
12797
  mms.push(new minimatch_1.default.Minimatch(iParts.join("/"), m0.options));
12787
12798
  }
12788
12799
 
12789
- iParts.push(g);
12790
-
12791
- if (typeof s !== "string") {
12792
- mms.push(new minimatch_1.default.Minimatch(iParts.join("/"), m0.options));
12793
- } // a pattern ending in GLOBSTAR will match anything
12800
+ if (ix === set.length - 1) {
12801
+ mms.push(m0);
12802
+ break;
12803
+ } else {
12804
+ iParts.push(g);
12794
12805
 
12806
+ if (typeof s !== "string") {
12807
+ mms.push(new minimatch_1.default.Minimatch(iParts.join("/"), m0.options));
12808
+ }
12809
+ }
12795
12810
 
12796
12811
  if (s === GLOBSTAR) {
12797
- return patterns;
12812
+ // a pattern ending in GLOBSTAR will match anything
12813
+ break;
12798
12814
  }
12799
12815
  }
12800
12816
 
12801
- mms.push(m0);
12802
12817
  return patterns;
12803
12818
  }
12804
12819
 
12805
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;
12806
12858
 
12807
12859
  /***/ }),
12808
12860
 
12809
- /***/ "./node_modules/.f/_/@fynpo/base/1.1.12-fynlocal_h/@fynpo/base/dist/util.js":
12861
+ /***/ "./node_modules/.f/_/@fynpo/base/1.1.13-fynlocal_h/@fynpo/base/dist/util.js":
12810
12862
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12811
12863
 
12812
12864
  "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fyn",
3
- "version": "1.1.30",
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/",