@riboseinc/anafero-cli 0.0.42 → 0.0.43

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/build-site.mjs CHANGED
@@ -313125,6 +313125,7 @@ __export(anafero_exports, {
313125
313125
  gatherDescribedResourcesFromJsonifiedProseMirrorNode: () => gatherDescribedResourcesFromJsonifiedProseMirrorNode,
313126
313126
  gatherTextFromJsonifiedProseMirrorNode: () => gatherTextFromJsonifiedProseMirrorNode,
313127
313127
  getAllParentPaths: () => getAllParentPaths,
313128
+ isURIString: () => isURIString,
313128
313129
  makeDummyInMemoryCache: () => makeDummyInMemoryCache,
313129
313130
  parseModuleRef: () => parseModuleRef,
313130
313131
  stripLeadingSlash: () => stripLeadingSlash,
@@ -313192,6 +313193,38 @@ function getAllParentPaths(aPath) {
313192
313193
  return parents;
313193
313194
  }
313194
313195
 
313196
+ // ../anafero/URI.mts
313197
+ init_cjs_shim();
313198
+ function makeURI(input) {
313199
+ const match19 = ("" + input).match(pattern2);
313200
+ if (!match19) {
313201
+ throw new SyntaxError("Invalid URI");
313202
+ }
313203
+ return {
313204
+ protocol: match19[1],
313205
+ slashes: match19[2],
313206
+ authority: match19[3],
313207
+ host: match19[4],
313208
+ port: match19[5],
313209
+ path: match19[6] || match19[7] || match19[8],
313210
+ query: match19[9],
313211
+ hash: match19[10]
313212
+ };
313213
+ }
313214
+ function isURIString(input) {
313215
+ return ["urn:", "http:", "https:", "ftp:", "file:"].find((prefix) => input.startsWith(prefix)) !== void 0;
313216
+ if (input.startsWith("urn:")) {
313217
+ return true;
313218
+ }
313219
+ try {
313220
+ makeURI(input);
313221
+ return true;
313222
+ } catch (e3) {
313223
+ return false;
313224
+ }
313225
+ }
313226
+ var pattern2 = new RegExp("([A-Za-z][A-Za-z0-9+\\-.]{2,6}):(?:(//)(?:((?:[A-Za-z0-9\\-._~!$&'()*+,;=:]|%[0-9A-Fa-f]{2})*)@)?((?:\\[(?:(?:(?:(?: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\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)|)(?:\\?((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*))?(?:\\#((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*))?");
313227
+
313195
313228
  // ../firelight-gui/loader.mts
313196
313229
  init_cjs_shim();
313197
313230
 
@@ -316446,40 +316479,6 @@ function processAttributes(el, locateResource, reverseResource, onIntegrityViola
316446
316479
 
316447
316480
  // ../anafero/ContentReader.mts
316448
316481
  init_cjs_shim();
316449
-
316450
- // ../anafero/URI.mts
316451
- init_cjs_shim();
316452
- function makeURI(input) {
316453
- const match19 = ("" + input).match(pattern2);
316454
- if (!match19) {
316455
- throw new SyntaxError("Invalid URI");
316456
- }
316457
- return {
316458
- protocol: match19[1],
316459
- slashes: match19[2],
316460
- authority: match19[3],
316461
- host: match19[4],
316462
- port: match19[5],
316463
- path: match19[6] || match19[7] || match19[8],
316464
- query: match19[9],
316465
- hash: match19[10]
316466
- };
316467
- }
316468
- function isURIString(input) {
316469
- return ["urn:", "http:", "https:", "ftp:", "file:"].find((prefix) => input.startsWith(prefix)) !== void 0;
316470
- if (input.startsWith("urn:")) {
316471
- return true;
316472
- }
316473
- try {
316474
- makeURI(input);
316475
- return true;
316476
- } catch (e3) {
316477
- return false;
316478
- }
316479
- }
316480
- var pattern2 = new RegExp("([A-Za-z][A-Za-z0-9+\\-.]{2,6}):(?:(//)(?:((?:[A-Za-z0-9\\-._~!$&'()*+,;=:]|%[0-9A-Fa-f]{2})*)@)?((?:\\[(?:(?:(?:(?:[0-9A-Fa-f]{1,4}:){6}|::(?:[0-9A-Fa-f]{1,4}:){5}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}|(?:(?:[0-9A-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.mts
316483
316482
  var makeContentReader = async function(entryPointURI, storeAdapters, contentAdapter, { fetchBlob, reportProgress, decodeXML, cache: cache3 }) {
316484
316483
  let totalPathCount = 0;
316485
316484
  let totalRelationCount = 0;
@@ -316545,10 +316544,11 @@ var makeContentReader = async function(entryPointURI, storeAdapters, contentAdap
316545
316544
  }
316546
316545
  const maybeContributingRelations = contentAdapter.contributingToHierarchy.filter((r4) => r4[0] === relation.predicate).map((r4) => r4.slice(1));
316547
316546
  if (maybeContributingRelations.length > 0) {
316548
- return resolvePredicateChainsToFirstValue(
316547
+ const result = resolvePredicateChainsToFirstValue(
316549
316548
  relation.target,
316550
316549
  maybeContributingRelations
316551
316550
  );
316551
+ return result ? result.replaceAll(":", "_").replaceAll("/", "_") : result;
316552
316552
  }
316553
316553
  return null;
316554
316554
  }
@@ -316610,6 +316610,7 @@ var makeContentReader = async function(entryPointURI, storeAdapters, contentAdap
316610
316610
  }
316611
316611
  function getResourceGraph(resourceURI) {
316612
316612
  if (!cache3.has(`graphs/${resourceURI}`)) {
316613
+ cache3.add(`graphs/${resourceURI}`, []);
316613
316614
  const queue = [resourceURI];
316614
316615
  while (queue.length > 0) {
316615
316616
  const currentResource = queue.pop();
@@ -316679,10 +316680,10 @@ var makeContentReader = async function(entryPointURI, storeAdapters, contentAdap
316679
316680
  const maybePathComponent = maybeGetPathComponent(rel);
316680
316681
  if (maybePathComponent) {
316681
316682
  if (!isValidPathComponent(maybePathComponent)) {
316683
+ console.error("Generated path component is not valid", maybePathComponent, rel);
316682
316684
  throw new Error("Generated path component is not valid");
316683
316685
  }
316684
- const encodedComponent = maybePathComponent.replace(":", "_");
316685
- const newPath = pathPrefix ? `${pathPrefix}/${encodedComponent}` : encodedComponent;
316686
+ const newPath = pathPrefix ? `${pathPrefix}/${maybePathComponent}` : maybePathComponent;
316686
316687
  processHierarchy(rel.target, newPath, onProgress);
316687
316688
  } else {
316688
316689
  processResourceContents(rel.target, pathPrefix);
@@ -316751,16 +316752,16 @@ var makeContentReader = async function(entryPointURI, storeAdapters, contentAdap
316751
316752
  const validAdapters = storeAdapters.filter((mod) => mod.canResolve(resourceURI) && mod.readerFromBlob !== void 0);
316752
316753
  for (const mod of validAdapters) {
316753
316754
  try {
316754
- return (await mod.readerFromBlob(blob, { decodeXML }))[1];
316755
+ const reader = (await mod.readerFromBlob(blob, { decodeXML }))[1];
316756
+ return reader;
316755
316757
  } catch (e3) {
316756
- console.warn("Failed to create resource reader for URI", mod.name, resourceURI);
316757
316758
  }
316758
316759
  }
316759
- throw new Error("Failed to initialize resource reader");
316760
+ throw new Error(`Failed to initialize resource reader for ${resourceURI}`);
316760
316761
  }
316761
316762
  };
316762
316763
  function isValidPathComponent(val) {
316763
- return val.indexOf("/") < 0 && val.indexOf("#") < 0;
316764
+ return val.indexOf("/") < 0 && val.indexOf(":") < 0 && val.indexOf("#") < 0;
316764
316765
  }
316765
316766
  function joinFileURI(baseFileURI, fileURI) {
316766
316767
  const baseFilePath = baseFileURI.startsWith("file:") ? baseFileURI.split("file:")[1] : void 0;
@@ -316982,14 +316983,22 @@ ${inject.head ?? ""}`;
316982
316983
  for (const [, , o2] of relations) {
316983
316984
  if (o2.startsWith("file:")) {
316984
316985
  const filePath = o2.split("file:")[1];
316985
- const filename = encodeURIComponent(filePath);
316986
+ const filename = o2.replaceAll("/", "_").replaceAll(":", "_");
316986
316987
  if (!assetsToWrite[filename]) {
316987
- assetsToWrite[filename] = await fetchBlobAtThisVersion(filePath);
316988
- resourceGraph.push([resourceURI, "isDownloadableAt", filename]);
316989
- resourceMap[filename] = o2;
316990
- resourceDescriptions[o2] = {
316991
- labelInPlainText: filePath
316992
- };
316988
+ try {
316989
+ assetsToWrite[filename] = await fetchBlobAtThisVersion(filePath);
316990
+ resourceGraph.push([
316991
+ o2,
316992
+ "isDownloadableAt",
316993
+ filename
316994
+ ]);
316995
+ resourceMap[filename] = o2;
316996
+ resourceDescriptions[o2] = {
316997
+ labelInPlainText: filePath
316998
+ };
316999
+ } catch (e3) {
317000
+ console.error("Failed to fetch asset", filePath);
317001
+ }
316993
317002
  }
316994
317003
  }
316995
317004
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riboseinc/anafero-cli",
3
3
  "type": "module",
4
- "version": "0.0.42",
4
+ "version": "0.0.43",
5
5
  "packageManager": "yarn@4.5.0",
6
6
  "bin": {
7
7
  "build-site": "build-site.mjs"
Binary file
Binary file