@tui-sandbox/library 8.0.2 → 9.0.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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [9.0.0](https://github.com/mikavilpas/tui-sandbox/compare/library-v8.0.2...library-v9.0.0) (2025-01-19)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * simplify the schema for MyTestDirectory ([#251](https://github.com/mikavilpas/tui-sandbox/issues/251))
9
+
10
+ ### Features
11
+
12
+ * simplify the schema for MyTestDirectory ([#251](https://github.com/mikavilpas/tui-sandbox/issues/251)) ([98f0e4f](https://github.com/mikavilpas/tui-sandbox/commit/98f0e4f9d3324a421ab6db3c81b50e6f578c0358))
13
+
3
14
  ## [8.0.2](https://github.com/mikavilpas/tui-sandbox/compare/library-v8.0.1...library-v8.0.2) (2025-01-18)
4
15
 
5
16
 
@@ -10,8 +10,6 @@ export declare function getDirectoryTree(path: string): TreeResult;
10
10
  type FileNode = {
11
11
  type: Type.FILE;
12
12
  name: string;
13
- extension: string | undefined;
14
- stem: string;
15
13
  };
16
14
  type DirectoryNode = {
17
15
  type: Type.DIRECTORY;
@@ -24,8 +24,6 @@ export function convertDree(root) {
24
24
  return {
25
25
  name: root.name,
26
26
  type: root.type,
27
- extension: root.extension,
28
- stem: root.extension ? root.name.slice(0, -root.extension.length) : root.name,
29
27
  };
30
28
  }
31
29
  const node = {
@@ -36,28 +36,13 @@ describe("dirtree", () => {
36
36
  name: z.literal(".config/"),
37
37
  type: z.literal("directory"),
38
38
  contents: z.object({
39
- ".gitkeep": z.object({
40
- name: z.literal(".gitkeep"),
41
- type: z.literal("file"),
42
- extension: z.literal(""),
43
- stem: z.literal(".gitkeep"),
44
- }),
39
+ ".gitkeep": z.object({ name: z.literal(".gitkeep"), type: z.literal("file") }),
45
40
  nvim: z.object({
46
41
  name: z.literal("nvim/"),
47
42
  type: z.literal("directory"),
48
43
  contents: z.object({
49
- "init.lua": z.object({
50
- name: z.literal("init.lua"),
51
- type: z.literal("file"),
52
- extension: z.literal("lua"),
53
- stem: z.literal("init."),
54
- }),
55
- "prepare.lua": z.object({
56
- name: z.literal("prepare.lua"),
57
- type: z.literal("file"),
58
- extension: z.literal("lua"),
59
- stem: z.literal("prepare."),
60
- }),
44
+ "init.lua": z.object({ name: z.literal("init.lua"), type: z.literal("file") }),
45
+ "prepare.lua": z.object({ name: z.literal("prepare.lua"), type: z.literal("file") }),
61
46
  }),
62
47
  }),
63
48
  }),
@@ -69,14 +54,10 @@ describe("dirtree", () => {
69
54
  "add_command_to_count_open_buffers.lua": z.object({
70
55
  name: z.literal("add_command_to_count_open_buffers.lua"),
71
56
  type: z.literal("file"),
72
- extension: z.literal("lua"),
73
- stem: z.literal("add_command_to_count_open_buffers."),
74
57
  }),
75
58
  "don't_crash_when_modification_contains_unescaped_characters\\".lua": z.object({
76
59
  name: z.literal("don't_crash_when_modification_contains_unescaped_characters\\".lua"),
77
60
  type: z.literal("file"),
78
- extension: z.literal("lua"),
79
- stem: z.literal("don't_crash_when_modification_contains_unescaped_characters\\"."),
80
61
  }),
81
62
  }),
82
63
  }),
@@ -84,60 +65,25 @@ describe("dirtree", () => {
84
65
  name: z.literal("dir with spaces/"),
85
66
  type: z.literal("directory"),
86
67
  contents: z.object({
87
- "file1.txt": z.object({
88
- name: z.literal("file1.txt"),
89
- type: z.literal("file"),
90
- extension: z.literal("txt"),
91
- stem: z.literal("file1."),
92
- }),
93
- "file2.txt": z.object({
94
- name: z.literal("file2.txt"),
95
- type: z.literal("file"),
96
- extension: z.literal("txt"),
97
- stem: z.literal("file2."),
98
- }),
68
+ "file1.txt": z.object({ name: z.literal("file1.txt"), type: z.literal("file") }),
69
+ "file2.txt": z.object({ name: z.literal("file2.txt"), type: z.literal("file") }),
99
70
  }),
100
71
  }),
101
- "file.txt": z.object({
102
- name: z.literal("file.txt"),
103
- type: z.literal("file"),
104
- extension: z.literal("txt"),
105
- stem: z.literal("file."),
106
- }),
107
- "initial-file.txt": z.object({
108
- name: z.literal("initial-file.txt"),
109
- type: z.literal("file"),
110
- extension: z.literal("txt"),
111
- stem: z.literal("initial-file."),
112
- }),
72
+ "file.txt": z.object({ name: z.literal("file.txt"), type: z.literal("file") }),
73
+ "initial-file.txt": z.object({ name: z.literal("initial-file.txt"), type: z.literal("file") }),
113
74
  "lua-project": z.object({
114
75
  name: z.literal("lua-project/"),
115
76
  type: z.literal("directory"),
116
77
  contents: z.object({
117
- "config.lua": z.object({
118
- name: z.literal("config.lua"),
119
- type: z.literal("file"),
120
- extension: z.literal("lua"),
121
- stem: z.literal("config."),
122
- }),
123
- "init.lua": z.object({
124
- name: z.literal("init.lua"),
125
- type: z.literal("file"),
126
- extension: z.literal("lua"),
127
- stem: z.literal("init."),
128
- }),
78
+ "config.lua": z.object({ name: z.literal("config.lua"), type: z.literal("file") }),
79
+ "init.lua": z.object({ name: z.literal("init.lua"), type: z.literal("file") }),
129
80
  }),
130
81
  }),
131
82
  "other-subdirectory": z.object({
132
83
  name: z.literal("other-subdirectory/"),
133
84
  type: z.literal("directory"),
134
85
  contents: z.object({
135
- "other-sub-file.txt": z.object({
136
- name: z.literal("other-sub-file.txt"),
137
- type: z.literal("file"),
138
- extension: z.literal("txt"),
139
- stem: z.literal("other-sub-file."),
140
- }),
86
+ "other-sub-file.txt": z.object({ name: z.literal("other-sub-file.txt"), type: z.literal("file") }),
141
87
  }),
142
88
  }),
143
89
  routes: z.object({
@@ -148,23 +94,11 @@ describe("dirtree", () => {
148
94
  name: z.literal("posts.$postId/"),
149
95
  type: z.literal("directory"),
150
96
  contents: z.object({
151
- "adjacent-file.txt": z.object({
152
- name: z.literal("adjacent-file.txt"),
153
- type: z.literal("file"),
154
- extension: z.literal("txt"),
155
- stem: z.literal("adjacent-file."),
156
- }),
157
- "route.tsx": z.object({
158
- name: z.literal("route.tsx"),
159
- type: z.literal("file"),
160
- extension: z.literal("tsx"),
161
- stem: z.literal("route."),
162
- }),
97
+ "adjacent-file.txt": z.object({ name: z.literal("adjacent-file.txt"), type: z.literal("file") }),
98
+ "route.tsx": z.object({ name: z.literal("route.tsx"), type: z.literal("file") }),
163
99
  "should-be-excluded-file.txt": z.object({
164
100
  name: z.literal("should-be-excluded-file.txt"),
165
101
  type: z.literal("file"),
166
- extension: z.literal("txt"),
167
- stem: z.literal("should-be-excluded-file."),
168
102
  }),
169
103
  }),
170
104
  }),
@@ -174,12 +108,7 @@ describe("dirtree", () => {
174
108
  name: z.literal("subdirectory/"),
175
109
  type: z.literal("directory"),
176
110
  contents: z.object({
177
- "subdirectory-file.txt": z.object({
178
- name: z.literal("subdirectory-file.txt"),
179
- type: z.literal("file"),
180
- extension: z.literal("txt"),
181
- stem: z.literal("subdirectory-file."),
182
- }),
111
+ "subdirectory-file.txt": z.object({ name: z.literal("subdirectory-file.txt"), type: z.literal("file") }),
183
112
  }),
184
113
  }),
185
114
  }),