@riboseinc/anafero-cli 0.0.42 → 0.0.44

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/bootstrap.js CHANGED
@@ -39048,35 +39048,35 @@ schema (${ast._tag}): ${ast}`;
39048
39048
  STRING_KEYWORD_PATTERN = ".*";
39049
39049
  NUMBER_KEYWORD_PATTERN = "[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?";
39050
39050
  getTemplateLiteralRegExp = (ast) => {
39051
- let pattern3 = `^${escape(ast.head)}`;
39051
+ let pattern4 = `^${escape(ast.head)}`;
39052
39052
  for (const span2 of ast.spans) {
39053
39053
  if (isStringKeyword(span2.type)) {
39054
- pattern3 += STRING_KEYWORD_PATTERN;
39054
+ pattern4 += STRING_KEYWORD_PATTERN;
39055
39055
  } else if (isNumberKeyword(span2.type)) {
39056
- pattern3 += NUMBER_KEYWORD_PATTERN;
39056
+ pattern4 += NUMBER_KEYWORD_PATTERN;
39057
39057
  }
39058
- pattern3 += escape(span2.literal);
39058
+ pattern4 += escape(span2.literal);
39059
39059
  }
39060
- pattern3 += "$";
39061
- return new RegExp(pattern3);
39060
+ pattern4 += "$";
39061
+ return new RegExp(pattern4);
39062
39062
  };
39063
39063
  getTemplateLiteralCapturingRegExp = (ast) => {
39064
- let pattern3 = `^`;
39064
+ let pattern4 = `^`;
39065
39065
  if (ast.head !== "") {
39066
- pattern3 += `(${escape(ast.head)})`;
39066
+ pattern4 += `(${escape(ast.head)})`;
39067
39067
  }
39068
39068
  for (const span2 of ast.spans) {
39069
39069
  if (isStringKeyword(span2.type)) {
39070
- pattern3 += `(${STRING_KEYWORD_PATTERN})`;
39070
+ pattern4 += `(${STRING_KEYWORD_PATTERN})`;
39071
39071
  } else if (isNumberKeyword(span2.type)) {
39072
- pattern3 += `(${NUMBER_KEYWORD_PATTERN})`;
39072
+ pattern4 += `(${NUMBER_KEYWORD_PATTERN})`;
39073
39073
  }
39074
39074
  if (span2.literal !== "") {
39075
- pattern3 += `(${escape(span2.literal)})`;
39075
+ pattern4 += `(${escape(span2.literal)})`;
39076
39076
  }
39077
39077
  }
39078
- pattern3 += "$";
39079
- return new RegExp(pattern3);
39078
+ pattern4 += "$";
39079
+ return new RegExp(pattern4);
39080
39080
  };
39081
39081
  getNumberIndexedAccess = (ast) => {
39082
39082
  switch (ast._tag) {
@@ -47029,7 +47029,7 @@ schema (${ast._tag}): ${ast}`;
47029
47029
  }));
47030
47030
  PatternTypeId = /* @__PURE__ */ Symbol.for("@effect/schema/TypeId/Pattern");
47031
47031
  pattern = (regex, annotations5) => (self) => {
47032
- const pattern3 = regex.source;
47032
+ const pattern4 = regex.source;
47033
47033
  return self.pipe(filter7((a2) => {
47034
47034
  regex.lastIndex = 0;
47035
47035
  return regex.test(a2);
@@ -47040,9 +47040,9 @@ schema (${ast._tag}): ${ast}`;
47040
47040
  regex
47041
47041
  }
47042
47042
  },
47043
- description: `a string matching the pattern ${pattern3}`,
47043
+ description: `a string matching the pattern ${pattern4}`,
47044
47044
  jsonSchema: {
47045
- pattern: pattern3
47045
+ pattern: pattern4
47046
47046
  },
47047
47047
  arbitrary: () => (fc) => fc.stringMatching(regex),
47048
47048
  ...annotations5
@@ -75359,17 +75359,17 @@ schema (${ast._tag}): ${ast}`;
75359
75359
  STRING_KEYWORD_PATTERN2 = ".*";
75360
75360
  NUMBER_KEYWORD_PATTERN2 = "[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?";
75361
75361
  getTemplateLiteralRegExp2 = (ast) => {
75362
- let pattern3 = `^${escape(ast.head)}`;
75362
+ let pattern4 = `^${escape(ast.head)}`;
75363
75363
  for (const span2 of ast.spans) {
75364
75364
  if (isStringKeyword2(span2.type)) {
75365
- pattern3 += STRING_KEYWORD_PATTERN2;
75365
+ pattern4 += STRING_KEYWORD_PATTERN2;
75366
75366
  } else if (isNumberKeyword2(span2.type)) {
75367
- pattern3 += NUMBER_KEYWORD_PATTERN2;
75367
+ pattern4 += NUMBER_KEYWORD_PATTERN2;
75368
75368
  }
75369
- pattern3 += escape(span2.literal);
75369
+ pattern4 += escape(span2.literal);
75370
75370
  }
75371
- pattern3 += "$";
75372
- return new RegExp(pattern3);
75371
+ pattern4 += "$";
75372
+ return new RegExp(pattern4);
75373
75373
  };
75374
75374
  record3 = (key, value3) => {
75375
75375
  const propertySignatures = [];
@@ -93279,35 +93279,35 @@ schema (${ast._tag}): ${ast}`;
93279
93279
  STRING_KEYWORD_PATTERN3 = ".*";
93280
93280
  NUMBER_KEYWORD_PATTERN3 = "[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?";
93281
93281
  getTemplateLiteralRegExp3 = (ast) => {
93282
- let pattern3 = `^${escape(ast.head)}`;
93282
+ let pattern4 = `^${escape(ast.head)}`;
93283
93283
  for (const span2 of ast.spans) {
93284
93284
  if (isStringKeyword3(span2.type)) {
93285
- pattern3 += STRING_KEYWORD_PATTERN3;
93285
+ pattern4 += STRING_KEYWORD_PATTERN3;
93286
93286
  } else if (isNumberKeyword3(span2.type)) {
93287
- pattern3 += NUMBER_KEYWORD_PATTERN3;
93287
+ pattern4 += NUMBER_KEYWORD_PATTERN3;
93288
93288
  }
93289
- pattern3 += escape(span2.literal);
93289
+ pattern4 += escape(span2.literal);
93290
93290
  }
93291
- pattern3 += "$";
93292
- return new RegExp(pattern3);
93291
+ pattern4 += "$";
93292
+ return new RegExp(pattern4);
93293
93293
  };
93294
93294
  getTemplateLiteralCapturingRegExp3 = (ast) => {
93295
- let pattern3 = `^`;
93295
+ let pattern4 = `^`;
93296
93296
  if (ast.head !== "") {
93297
- pattern3 += `(${escape(ast.head)})`;
93297
+ pattern4 += `(${escape(ast.head)})`;
93298
93298
  }
93299
93299
  for (const span2 of ast.spans) {
93300
93300
  if (isStringKeyword3(span2.type)) {
93301
- pattern3 += `(${STRING_KEYWORD_PATTERN3})`;
93301
+ pattern4 += `(${STRING_KEYWORD_PATTERN3})`;
93302
93302
  } else if (isNumberKeyword3(span2.type)) {
93303
- pattern3 += `(${NUMBER_KEYWORD_PATTERN3})`;
93303
+ pattern4 += `(${NUMBER_KEYWORD_PATTERN3})`;
93304
93304
  }
93305
93305
  if (span2.literal !== "") {
93306
- pattern3 += `(${escape(span2.literal)})`;
93306
+ pattern4 += `(${escape(span2.literal)})`;
93307
93307
  }
93308
93308
  }
93309
- pattern3 += "$";
93310
- return new RegExp(pattern3);
93309
+ pattern4 += "$";
93310
+ return new RegExp(pattern4);
93311
93311
  };
93312
93312
  typeAST3 = (ast) => {
93313
93313
  switch (ast._tag) {
@@ -94853,7 +94853,7 @@ schema (${ast._tag}): ${ast}`;
94853
94853
  }));
94854
94854
  PatternSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/Pattern");
94855
94855
  pattern2 = (regex, annotations5) => (self) => {
94856
- const pattern3 = regex.source;
94856
+ const pattern4 = regex.source;
94857
94857
  return self.pipe(filter10((a2) => {
94858
94858
  regex.lastIndex = 0;
94859
94859
  return regex.test(a2);
@@ -94862,9 +94862,9 @@ schema (${ast._tag}): ${ast}`;
94862
94862
  [PatternSchemaId]: {
94863
94863
  regex
94864
94864
  },
94865
- description: `a string matching the pattern ${pattern3}`,
94865
+ description: `a string matching the pattern ${pattern4}`,
94866
94866
  jsonSchema: {
94867
- pattern: pattern3
94867
+ pattern: pattern4
94868
94868
  },
94869
94869
  arbitrary: () => (fc) => fc.stringMatching(regex),
94870
94870
  ...annotations5
@@ -95039,6 +95039,43 @@ schema (${ast._tag}): ${ast}`;
95039
95039
  }
95040
95040
  });
95041
95041
 
95042
+ // ../anafero/URI.mts
95043
+ function makeURI(input) {
95044
+ const match10 = ("" + input).match(pattern3);
95045
+ if (!match10) {
95046
+ throw new SyntaxError("Invalid URI");
95047
+ }
95048
+ return {
95049
+ protocol: match10[1],
95050
+ slashes: match10[2],
95051
+ authority: match10[3],
95052
+ host: match10[4],
95053
+ port: match10[5],
95054
+ path: match10[6] || match10[7] || match10[8],
95055
+ query: match10[9],
95056
+ hash: match10[10]
95057
+ };
95058
+ }
95059
+ function isURIString(input) {
95060
+ return ["urn:", "http:", "https:", "ftp:", "file:"].find((prefix) => input.startsWith(prefix)) !== void 0;
95061
+ if (input.startsWith("urn:")) {
95062
+ return true;
95063
+ }
95064
+ try {
95065
+ makeURI(input);
95066
+ return true;
95067
+ } catch (e2) {
95068
+ return false;
95069
+ }
95070
+ }
95071
+ var pattern3;
95072
+ var init_URI = __esm({
95073
+ "../anafero/URI.mts"() {
95074
+ "use strict";
95075
+ pattern3 = 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-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::)(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)|[Vv][0-9A-Fa-f]+\\.[A-Za-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|(?:[A-Za-z0-9\\-._~!$&'()*+,;=]|%[0-9A-Fa-f]{2})*))(?::([0-9]*))?((?:/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)|/((?:(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)?)|((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)|)(?:\\?((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*))?(?:\\#((?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*))?");
95076
+ }
95077
+ });
95078
+
95042
95079
  // ../anafero/index.mts
95043
95080
  var anafero_exports = {};
95044
95081
  __export(anafero_exports, {
@@ -95061,6 +95098,7 @@ schema (${ast._tag}): ${ast}`;
95061
95098
  gatherDescribedResourcesFromJsonifiedProseMirrorNode: () => gatherDescribedResourcesFromJsonifiedProseMirrorNode,
95062
95099
  gatherTextFromJsonifiedProseMirrorNode: () => gatherTextFromJsonifiedProseMirrorNode,
95063
95100
  getAllParentPaths: () => getAllParentPaths,
95101
+ isURIString: () => isURIString,
95064
95102
  makeDummyInMemoryCache: () => makeDummyInMemoryCache,
95065
95103
  parseModuleRef: () => parseModuleRef,
95066
95104
  stripLeadingSlash: () => stripLeadingSlash,
@@ -95081,6 +95119,7 @@ schema (${ast._tag}): ${ast}`;
95081
95119
  init_moduleRef();
95082
95120
  init_cache();
95083
95121
  init_path_utils();
95122
+ init_URI();
95084
95123
  }
95085
95124
  });
95086
95125
 
@@ -131219,7 +131258,10 @@ schema (${ast._tag}): ${ast}`;
131219
131258
  const pageMap = (0, import_react212.useMemo)(
131220
131259
  function computePageMap() {
131221
131260
  const pageMap2 = { ...resourceMap };
131222
- for (const key of Object.keys(pageMap2).filter((p) => p.includes("#"))) {
131261
+ for (const key of Object.keys(pageMap2).filter((p) => (
131262
+ // Exclude in-page resources from page map
131263
+ p.includes("#") || p.includes(".")
131264
+ ))) {
131223
131265
  delete pageMap2[key];
131224
131266
  }
131225
131267
  return pageMap2;