@riboseinc/anafero-cli 0.0.46 → 0.0.47

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
@@ -316514,7 +316514,6 @@ var makeContentReader = async function(entryPointURI, storeAdapters, findContent
316514
316514
  async function expandURI(uri) {
316515
316515
  const originalURI2 = originalURIs[uri];
316516
316516
  const isFileURI = (originalURI2 ?? uri).startsWith("file:");
316517
- console.debug("Expanding URI", uri, originalURI2, entryPointURI2);
316518
316517
  let expanded;
316519
316518
  if (isFileURI) {
316520
316519
  const normalizedFileURI = originalURI2 ?? normalizeFileURI(
@@ -316845,21 +316844,24 @@ var makeContentReader = async function(entryPointURI, storeAdapters, findContent
316845
316844
  function isValidPathComponent(val) {
316846
316845
  return val.indexOf("/") < 0 && val.indexOf(":") < 0 && val.indexOf("#") < 0;
316847
316846
  }
316848
- function normalizeFileURI(rawFileURI, baseFileURI) {
316849
- const fileURI = rawFileURI.startsWith("./") ? rawFileURI.split("./")[1] : rawFileURI;
316850
- if (fileURI.startsWith("./") || fileURI.startsWith("../")) {
316851
- throw new Error("Malformed file URI");
316847
+ function unprefixLocalPath(filePath) {
316848
+ return filePath.startsWith("./") ? filePath.split("./")[1] : filePath;
316849
+ }
316850
+ function normalizeFileURI(fileURI, baseFileURI) {
316851
+ const normalizedPath = unprefixLocalPath(fileURI.split("file:")[1]);
316852
+ if (normalizedPath.startsWith("./") || normalizedPath.startsWith("../")) {
316853
+ throw new Error("Malformed path in file URI");
316852
316854
  }
316855
+ const normalizedURI = `file:${normalizedPath}`;
316853
316856
  if (baseFileURI === void 0) {
316854
- return fileURI;
316857
+ return normalizedURI;
316855
316858
  }
316856
- const baseFilePath = baseFileURI.startsWith("file:") ? baseFileURI.split("file:")[1] : void 0;
316857
- if (!baseFilePath) {
316859
+ const basePath = baseFileURI.startsWith("file:") ? unprefixLocalPath(baseFileURI.split("file:")[1]) : void 0;
316860
+ if (!basePath) {
316858
316861
  throw new Error("Trying to normalize a file: URI, but base URI is not using that scheme");
316859
316862
  }
316860
- const filePath = fileURI.split("file:")[1];
316861
- const dirname3 = baseFilePath.indexOf("/") >= 1 ? baseFilePath.slice(0, baseFilePath.lastIndexOf("/")) : "";
316862
- return filePath.startsWith("/") ? fileURI : `file:${dirname3}${dirname3 ? "/" : ""}${filePath}`;
316863
+ const dirname3 = basePath.indexOf("/") >= 1 ? basePath.slice(0, basePath.lastIndexOf("/")) : "";
316864
+ return normalizedPath.startsWith("/") ? normalizedURI : `file:${dirname3}${dirname3 ? "/" : ""}${normalizedPath}`;
316863
316865
  }
316864
316866
 
316865
316867
  // ../anafero/process.mts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riboseinc/anafero-cli",
3
3
  "type": "module",
4
- "version": "0.0.46",
4
+ "version": "0.0.47",
5
5
  "packageManager": "yarn@4.5.0",
6
6
  "bin": {
7
7
  "build-site": "build-site.mjs"
index aa16391..7d99155 100644
Binary file