lody 0.70.2 → 0.71.0

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.
@@ -3,8 +3,8 @@ import { readFile, mkdir, writeFile, rename } from "node:fs/promises";
3
3
  import os__default from "node:os";
4
4
  import path__default from "node:path";
5
5
  import process from "node:process";
6
- const reviewViewerVersion = "0.70.1";
7
- const reviewViewerSha256 = "104f9704142897f65c7477ec9e68dccd8a109536123a4cda9b8cfb28d28ce361";
6
+ const reviewViewerVersion = "0.71.0";
7
+ const reviewViewerSha256 = "e395b367a7644fe83bc050d0c646810914a2844824fd2b5d11d24ae4f55b6893";
8
8
  const reviewViewerFileName = "standalone.html";
9
9
  const DEFAULT_CDN_BASES = ["https://cdn.jsdelivr.net/npm", "https://unpkg.com"];
10
10
  function cacheDir() {
@@ -4765,40 +4765,40 @@ function preprocess(fn, schema) {
4765
4765
  }
4766
4766
  export {
4767
4767
  $constructor as $,
4768
- looseObject as A,
4769
- optional as B,
4770
- datetime as C,
4771
- custom as D,
4772
- toJSONSchema as E,
4773
- ZodOptional as F,
4768
+ datetime as A,
4769
+ custom as B,
4770
+ toJSONSchema as C,
4771
+ ZodOptional as D,
4772
+ int as E,
4773
+ url as F,
4774
4774
  tuple as G,
4775
4775
  NEVER as N,
4776
4776
  ZodNumber as Z,
4777
4777
  _coercedNumber as _,
4778
4778
  _enum as a,
4779
- array as b,
4780
- boolean as c,
4779
+ boolean as b,
4780
+ array as c,
4781
4781
  discriminatedUnion as d,
4782
- ZodError as e,
4783
- unknown as f,
4782
+ unknown as e,
4783
+ ZodError as f,
4784
4784
  _null as g,
4785
- intersection as h,
4786
- int as i,
4787
- url as j,
4788
- normalizeParams as k,
4785
+ normalizeParams as h,
4786
+ $ZodObject as i,
4787
+ defineLazy as j,
4788
+ $ZodType as k,
4789
4789
  literal as l,
4790
- $ZodObject as m,
4790
+ parse$1 as m,
4791
4791
  number as n,
4792
4792
  object as o,
4793
4793
  preprocess as p,
4794
- defineLazy as q,
4794
+ safeParse$1 as q,
4795
4795
  record as r,
4796
4796
  string as s,
4797
- $ZodType as t,
4797
+ parseAsync$1 as t,
4798
4798
  union as u,
4799
- parse$1 as v,
4800
- safeParse$1 as w,
4801
- parseAsync$1 as x,
4802
- safeParseAsync$1 as y,
4803
- clone as z
4799
+ safeParseAsync$1 as v,
4800
+ clone as w,
4801
+ looseObject as x,
4802
+ intersection as y,
4803
+ optional as z
4804
4804
  };
@@ -0,0 +1,84 @@
1
+ import path__default from "node:path";
2
+ const CODE_COLLAB_IGNORED_DIRECTORY_NAMES = /* @__PURE__ */ new Set([
3
+ ".git",
4
+ "node_modules",
5
+ ".next",
6
+ "dist",
7
+ "build",
8
+ "target"
9
+ ]);
10
+ function shouldIgnoreWorkspaceWatchFilename(filename) {
11
+ return filename.replaceAll("\\", "/").split("/").filter(Boolean).some((segment) => CODE_COLLAB_IGNORED_DIRECTORY_NAMES.has(segment));
12
+ }
13
+ function normalizeWorkspaceWatchFilename(filename) {
14
+ const value = Buffer.isBuffer(filename) ? filename.toString("utf8") : filename;
15
+ if (!value || value.includes("\0") || path__default.isAbsolute(value)) {
16
+ return null;
17
+ }
18
+ const normalized = path__default.posix.normalize(value.replaceAll("\\", "/"));
19
+ return normalized === ".." || normalized.startsWith("../") ? null : normalized;
20
+ }
21
+ function isRecord(value) {
22
+ return typeof value === "object" && value !== null;
23
+ }
24
+ function isGenerationMessage(value) {
25
+ return isRecord(value) && typeof value.type === "string" && typeof value.generation === "number" && Number.isSafeInteger(value.generation) && value.generation >= 0;
26
+ }
27
+ function isStringArray(value) {
28
+ return Array.isArray(value) && value.every((item) => typeof item === "string");
29
+ }
30
+ function parseWorkspaceWatchParentMessage(value) {
31
+ if (!isGenerationMessage(value)) return null;
32
+ if (value.type === "code-collab-watch/shutdown") {
33
+ return { type: value.type, generation: value.generation };
34
+ }
35
+ if (value.type === "code-collab-watch/replace-roots" && Number.isSafeInteger(value.revision) && typeof value.revision === "number" && isStringArray(value.roots)) {
36
+ return {
37
+ type: value.type,
38
+ generation: value.generation,
39
+ revision: value.revision,
40
+ roots: value.roots
41
+ };
42
+ }
43
+ return null;
44
+ }
45
+ function parseWorkspaceWatchChildMessage(value) {
46
+ if (!isGenerationMessage(value)) return null;
47
+ if (value.type === "code-collab-watch/dirty" && typeof value.root === "string") {
48
+ return { type: value.type, generation: value.generation, root: value.root };
49
+ }
50
+ if (value.type === "code-collab-watch/error" && typeof value.root === "string" && typeof value.code === "string") {
51
+ return {
52
+ type: value.type,
53
+ generation: value.generation,
54
+ root: value.root,
55
+ code: value.code
56
+ };
57
+ }
58
+ if (value.type === "code-collab-watch/ready" && typeof value.revision === "number" && Number.isSafeInteger(value.revision) && isStringArray(value.watchedRoots)) {
59
+ return {
60
+ type: value.type,
61
+ generation: value.generation,
62
+ revision: value.revision,
63
+ watchedRoots: value.watchedRoots
64
+ };
65
+ }
66
+ if (value.type === "code-collab-watch/stats" && typeof value.watcherCount === "number" && typeof value.rssBytes === "number" && typeof value.reconfigurationCount === "number" && typeof value.uptimeMs === "number") {
67
+ return {
68
+ type: value.type,
69
+ generation: value.generation,
70
+ watcherCount: value.watcherCount,
71
+ rssBytes: value.rssBytes,
72
+ reconfigurationCount: value.reconfigurationCount,
73
+ uptimeMs: value.uptimeMs
74
+ };
75
+ }
76
+ return null;
77
+ }
78
+ export {
79
+ CODE_COLLAB_IGNORED_DIRECTORY_NAMES as C,
80
+ parseWorkspaceWatchParentMessage as a,
81
+ normalizeWorkspaceWatchFilename as n,
82
+ parseWorkspaceWatchChildMessage as p,
83
+ shouldIgnoreWorkspaceWatchFilename as s
84
+ };