@tui-sandbox/library 7.5.4 → 7.5.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tui-sandbox/library",
3
- "version": "7.5.4",
3
+ "version": "7.5.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@catppuccin/palette": "1.7.1",
11
- "@trpc/client": "11.0.0-rc.666",
12
- "@trpc/server": "11.0.0-rc.666",
11
+ "@trpc/client": "11.0.0-rc.682",
12
+ "@trpc/server": "11.0.0-rc.682",
13
13
  "@xterm/addon-attach": "0.11.0",
14
14
  "@xterm/addon-fit": "0.10.0",
15
15
  "@xterm/xterm": "5.5.0",
@@ -22,7 +22,7 @@
22
22
  "node-pty": "1.0.0",
23
23
  "prettier": "3.4.2",
24
24
  "tsx": "4.19.2",
25
- "type-fest": "4.30.2",
25
+ "type-fest": "4.31.0",
26
26
  "winston": "3.17.0",
27
27
  "zod": "3.24.1"
28
28
  },
@@ -33,7 +33,7 @@
33
33
  "@types/express": "5.0.0",
34
34
  "@types/node": "22.10.2",
35
35
  "nodemon": "3.1.9",
36
- "vite": "6.0.5",
36
+ "vite": "6.0.6",
37
37
  "vitest": "2.1.8"
38
38
  },
39
39
  "peerDependencies": {
@@ -22,7 +22,6 @@ import type {
22
22
  StartNeovimGenericArguments,
23
23
  TestDirectory,
24
24
  } from "@tui-sandbox/library/dist/src/server/types"
25
- import assert from "assert"
26
25
  import type { OverrideProperties } from "type-fest"
27
26
  import type { MyTestDirectory, MyTestDirectoryFile } from "../../MyTestDirectory"
28
27
 
@@ -111,7 +110,14 @@ declare global {
111
110
 
112
111
  afterEach(async () => {
113
112
  if (!testWindow) return
114
- await testWindow.runExCommand({ command: "messages", log: true })
113
+ const timeout = new Promise<void>((resolve, reject) =>
114
+ setTimeout(() => {
115
+ Cypress.log({ name: "timeout when waiting for :messages to finish. Neovim might be stuck." })
116
+ reject("timeout when waiting for :messages to finish. Neovim might be stuck.")
117
+ }, 5_000)
118
+ )
119
+
120
+ await Promise.race([timeout, testWindow.runExCommand({ command: "messages" })])
115
121
  })
116
122
  `
117
123
 
@@ -73,6 +73,12 @@ describe("dirtree", () => {
73
73
  extension: z.literal("lua"),
74
74
  stem: z.literal("add_command_to_count_open_buffers."),
75
75
  }),
76
+ "don't_crash_when_modification_contains_unescaped_characters\\".lua": z.object({
77
+ name: z.literal("don't_crash_when_modification_contains_unescaped_characters\\".lua"),
78
+ type: z.literal("file"),
79
+ extension: z.literal("lua"),
80
+ stem: z.literal("don't_crash_when_modification_contains_unescaped_characters\\"."),
81
+ }),
76
82
  }),
77
83
  }),
78
84
  "dir with spaces": z.object({
@@ -173,6 +179,7 @@ describe("dirtree", () => {
173
179
  ".config/nvim",
174
180
  ".config",
175
181
  "config-modifications/add_command_to_count_open_buffers.lua",
182
+ "config-modifications/don't_crash_when_modification_contains_unescaped_characters\\".lua",
176
183
  "config-modifications",
177
184
  "dir with spaces/file1.txt",
178
185
  "dir with spaces/file2.txt",
@@ -8,7 +8,7 @@ export async function jsonToZod(object: unknown, name: string = "schema"): Promi
8
8
  const parse = (o: unknown, seen: object[]): string => {
9
9
  switch (typeof o) {
10
10
  case "string":
11
- return `z.literal("${o}")`
11
+ return `z.literal("${o.replaceAll('"', `\\"`)}")`
12
12
  case "number":
13
13
  return "z.number()"
14
14
  case "bigint":
@@ -37,7 +37,10 @@ export async function jsonToZod(object: unknown, name: string = "schema"): Promi
37
37
  }
38
38
  }
39
39
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
40
- return `z.object({${Object.entries(o).map(([k, v]) => `'${k}':${parse(v, seen)}`)}})`
40
+ return `z.object({${Object.entries(o).map(([k, v]) => {
41
+ const key = k.replaceAll("'", "\\'")
42
+ return `'${key}':${parse(v, seen)}`
43
+ })}})`
41
44
  case "undefined":
42
45
  return "z.undefined()"
43
46
  case "function":
@@ -47,7 +50,6 @@ export async function jsonToZod(object: unknown, name: string = "schema"): Promi
47
50
  return "z.unknown()"
48
51
  }
49
52
  }
50
-
51
53
  const prettierConfig = await resolveConfig(__filename)
52
54
 
53
55
  return format(`import {z} from "zod"\n\nexport const ${name}=${parse(object, [])}`, {
@@ -107,13 +107,14 @@ export class NeovimApplication {
107
107
 
108
108
  if (startArgs.startupScriptModifications) {
109
109
  for (const modification of startArgs.startupScriptModifications) {
110
- const file = path.join(testDirectory.rootPathAbsolute, "config-modifications", modification)
110
+ let file = path.join(testDirectory.rootPathAbsolute, "config-modifications", modification)
111
111
  try {
112
112
  await access(file)
113
113
  } catch (e) {
114
114
  throw new Error(`startupScriptModifications file does not exist: ${file}. Error: ${String(e)}`)
115
115
  }
116
116
 
117
+ file = file.replaceAll("'", "\\'")
117
118
  neovimArguments.push("-c", `lua dofile('${file}')`)
118
119
  }
119
120
  }