@tui-sandbox/library 11.1.0 → 11.2.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.
- package/CHANGELOG.md +7 -0
- package/dist/browser/assets/{index-0fX9G5V_.js → index-D4YBlffP.js} +6 -6
- package/dist/browser/index.html +1 -1
- package/dist/src/client/MyNeovimConfigModification.d.ts +4 -0
- package/dist/src/client/MyNeovimConfigModification.js +2 -0
- package/dist/src/client/MyNeovimConfigModification.js.map +1 -0
- package/dist/src/client/MyNeovimConfigModification.test.d.ts +1 -0
- package/dist/src/client/MyNeovimConfigModification.test.js +13 -0
- package/dist/src/client/MyNeovimConfigModification.test.js.map +1 -0
- package/dist/src/server/cypress-support/contents.js +2 -1
- package/dist/src/server/cypress-support/contents.js.map +1 -1
- package/dist/src/server/dirtree/index.test.js +12 -0
- package/dist/src/server/dirtree/index.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/client/MyNeovimConfigModification.test.ts +24 -0
- package/src/client/MyNeovimConfigModification.ts +8 -0
- package/src/server/cypress-support/contents.ts +2 -1
- package/src/server/dirtree/index.test.ts +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tui-sandbox/library",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/mikavilpas/tui-sandbox"
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"@types/command-exists": "1.2.3",
|
|
33
33
|
"@types/cors": "2.8.19",
|
|
34
34
|
"@types/express": "5.0.3",
|
|
35
|
-
"@types/node": "24.0
|
|
35
|
+
"@types/node": "24.1.0",
|
|
36
36
|
"nodemon": "3.1.10",
|
|
37
|
-
"vite": "7.0.
|
|
37
|
+
"vite": "7.0.6",
|
|
38
38
|
"vitest": "3.2.4",
|
|
39
|
-
"zod": "4.0.
|
|
39
|
+
"zod": "4.0.10"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"cypress": "^13 || ^14",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
import type { MyNeovimConfigModification } from "./MyNeovimConfigModification.js"
|
|
3
|
+
|
|
4
|
+
const testDirectoryFiles = z.enum([
|
|
5
|
+
"config-modifications/add_command_to_count_open_buffers.lua",
|
|
6
|
+
"config-modifications/add_command_to_update_buffer_after_timeout.lua",
|
|
7
|
+
"config-modifications/don't_crash_when_modification_contains_unescaped_characters\".lua",
|
|
8
|
+
"config-modifications/subdir/subdir-modification.lua",
|
|
9
|
+
"config-modifications/subdir",
|
|
10
|
+
"config-modifications",
|
|
11
|
+
])
|
|
12
|
+
type MyTestDirectoryFile = z.infer<typeof testDirectoryFiles>
|
|
13
|
+
|
|
14
|
+
type result = MyNeovimConfigModification<MyTestDirectoryFile>
|
|
15
|
+
|
|
16
|
+
it("returns config-modifications recursively", () => {
|
|
17
|
+
assertType<
|
|
18
|
+
| "add_command_to_count_open_buffers.lua"
|
|
19
|
+
| "add_command_to_update_buffer_after_timeout.lua"
|
|
20
|
+
| "don't_crash_when_modification_contains_unescaped_characters\".lua"
|
|
21
|
+
| "subdir/subdir-modification.lua"
|
|
22
|
+
| "subdir"
|
|
23
|
+
>(1 as unknown as result)
|
|
24
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Returns all the available Neovim config-modifications, recursively.
|
|
2
|
+
* @type T - the MyTestDirectoryFile type, which is generated by tui-sandbox
|
|
3
|
+
*/
|
|
4
|
+
export type MyNeovimConfigModification<T extends string> = T extends `config-modifications/${infer Rest}`
|
|
5
|
+
? Rest extends ""
|
|
6
|
+
? never
|
|
7
|
+
: Rest
|
|
8
|
+
: never
|
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
StartNeovimGenericArguments,
|
|
24
24
|
TestDirectory,
|
|
25
25
|
} from "@tui-sandbox/library/dist/src/server/types"
|
|
26
|
+
import type { MyNeovimConfigModification } from "@tui-sandbox/library/src/client/MyNeovimConfigModification"
|
|
26
27
|
import type {
|
|
27
28
|
ExCommandClientInput,
|
|
28
29
|
LuaCodeClientInput,
|
|
@@ -85,7 +86,7 @@ export type MyStartNeovimServerArguments = OverrideProperties<
|
|
|
85
86
|
StartNeovimGenericArguments,
|
|
86
87
|
{
|
|
87
88
|
filename?: MyTestDirectoryFile | { openInVerticalSplits: MyTestDirectoryFile[] }
|
|
88
|
-
startupScriptModifications?: Array<
|
|
89
|
+
startupScriptModifications?: Array<MyNeovimConfigModification<MyTestDirectoryFile>>
|
|
89
90
|
}
|
|
90
91
|
>
|
|
91
92
|
|
|
@@ -79,6 +79,16 @@ describe("dirtree", () => {
|
|
|
79
79
|
name: z.literal("don't_crash_when_modification_contains_unescaped_characters\\".lua"),
|
|
80
80
|
type: z.literal("file"),
|
|
81
81
|
}),
|
|
82
|
+
subdir: z.object({
|
|
83
|
+
name: z.literal("subdir/"),
|
|
84
|
+
type: z.literal("directory"),
|
|
85
|
+
contents: z.object({
|
|
86
|
+
"subdir-modification.lua": z.object({
|
|
87
|
+
name: z.literal("subdir-modification.lua"),
|
|
88
|
+
type: z.literal("file"),
|
|
89
|
+
}),
|
|
90
|
+
}),
|
|
91
|
+
}),
|
|
82
92
|
}),
|
|
83
93
|
}),
|
|
84
94
|
"dir with spaces": z.object({
|
|
@@ -165,6 +175,8 @@ describe("dirtree", () => {
|
|
|
165
175
|
"config-modifications/add_command_to_count_open_buffers.lua",
|
|
166
176
|
"config-modifications/add_command_to_update_buffer_after_timeout.lua",
|
|
167
177
|
"config-modifications/don't_crash_when_modification_contains_unescaped_characters\\".lua",
|
|
178
|
+
"config-modifications/subdir/subdir-modification.lua",
|
|
179
|
+
"config-modifications/subdir",
|
|
168
180
|
"config-modifications",
|
|
169
181
|
"dir with spaces/file1.txt",
|
|
170
182
|
"dir with spaces/file2.txt",
|