nerdgram1337 1.4.3 → 1.4.5

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.
@@ -26,6 +26,17 @@ function httpFail(status, message, code, details) {
26
26
  // server/src/thumbnails.ts
27
27
  import * as cheerio from "cheerio";
28
28
 
29
+ // server/src/readError.ts
30
+ var READ_REASONS = {
31
+ EIO: "The file may still be syncing or the folder may be unavailable on this computer",
32
+ EACCES: "This computer does not have permission to read the file",
33
+ EPERM: "This computer does not have permission to read the file",
34
+ ENOENT: "The file was removed or renamed before it could be read",
35
+ EBUSY: "The file is busy and could not be read",
36
+ ETIMEDOUT: "Reading the file timed out. The folder may be slow or unavailable"
37
+ };
38
+ var KNOWN_READ_ERRNOS = new Set(Object.keys(READ_REASONS));
39
+
29
40
  // server/src/svgImage.ts
30
41
  function svgForImage(svg) {
31
42
  if (!/xlink:/i.test(svg) || /xmlns:xlink\s*=/i.test(svg)) return svg;
package/dist/cli.js CHANGED
@@ -102,7 +102,7 @@ not changed. --undo restores that replace and skips a file edited since.
102
102
  `;
103
103
  var renderModule = null;
104
104
  function loadRender() {
105
- renderModule ??= import("./chunk-YNM3RGIQ.js");
105
+ renderModule ??= import("./chunk-BOMYBBJ6.js");
106
106
  return renderModule;
107
107
  }
108
108
  async function loadLint() {
@@ -378,16 +378,21 @@ async function lintCommand(parsed, io) {
378
378
  const result = await callApi(base, requireToken(token), "GET", apiPath);
379
379
  const body = result.json;
380
380
  if (body.diagrams) {
381
+ const unreadable = body.unreadable ?? [];
381
382
  diagnostics = body.diagrams.flatMap(
382
383
  (diagram) => diagram.diagnostics.map((item) => ({ ...item, message: `${diagram.path}: ${item.message}` }))
383
384
  );
385
+ const lines2 = [
386
+ ...unreadable.map((item) => item.message),
387
+ ...diagnostics.map((item) => `${item.ruleId}: ${item.message}`)
388
+ ];
384
389
  writeOut(
385
390
  io,
386
391
  isJson(parsed.flags),
387
- { checked: body.checked ?? 0, diagrams: body.diagrams },
388
- diagnostics.map((item) => `${item.ruleId}: ${item.message}`).join("\n") || `Checked ${body.checked ?? 0} diagrams.`
392
+ { checked: body.checked ?? 0, diagrams: body.diagrams, unreadable },
393
+ lines2.join("\n") || `Checked ${body.checked ?? 0} diagrams.`
389
394
  );
390
- const failed2 = body.diagrams.some(
395
+ const failed2 = unreadable.length > 0 || body.diagrams.some(
391
396
  (diagram) => diagram.diagnostics.some((item) => item.severity === "error" || strict && diagram.diagnostics.length > 0)
392
397
  );
393
398
  return failed2 ? 1 : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nerdgram1337",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "Command-line client for a local NerdGram1337 server",
5
5
  "type": "module",
6
6
  "license": "MIT",