Repository navigation
Commit a13ebd9
committed
Extract update check utilities and refactor check for updates command
- for 'minimum wait time' to work in `apps/editor/src/commands/check-for-updates-command.ts`, we need to run the check independently in the command and only pass info to the frontend
- move 'fetch update info' to `apps/editor/src/utils`
- place is_newer in a separate folder-util, with necessary tests (keep them simple)
└── apps
└── editor
└── src
├── commands
│ ├── check-for-updates-command.ts
│ └── install-specific-version-command.ts
├── constants
│ └── values.ts
├── extension.ts
├── i18n
│ └── translations
│ └── commands
│ └── check-for-updates-command.ts
├── utils
│ ├── build-user-content.ts
│ ├── changes-integration
│ │ ├── diff-processor
│ │ │ ├── diff-processor.spec.ts
│ │ │ ├── diff-processor.ts
│ │ │ ├── index.ts
│ │ │ ├── test-cases
│ │ │ │ ├── deletion-only
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── empty-file
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── empty-file-2
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── failing
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── failing-2
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── generic-1
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── generic-2
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── generic-3
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── generic-4
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── generic-5
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── generic-6
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── generic-7
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── generic-8
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── generic-9
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── insert-start-end
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── loose-gap-match
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── multiple-hunks
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── redundant-new-empty-line
│ │ │ │ │ ├── diff.txt
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ └── original.txt
│ │ │ │ └── same-line-replace
│ │ │ │ ├── diff.txt
│ │ │ │ ├── expected.txt
│ │ │ │ └── original.txt
│ │ │ ├── types.ts
│ │ │ └── utils
│ │ │ ├── apply-blocks.ts
│ │ │ ├── empty-file-handler.ts
│ │ │ ├── match-blocks.ts
│ │ │ ├── normalize.ts
│ │ │ └── parse-blocks.ts
│ │ ├── search-replace-processor
│ │ │ ├── apply-search-replace-to-content
│ │ │ │ ├── apply-search-replace-to-content.spec.ts
│ │ │ │ ├── apply-search-replace-to-content.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── test-cases
│ │ │ │ ├── basic-conflict
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ ├── markers.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── deletion
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ ├── markers.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── multiple-conflicts
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ ├── markers.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── rst-syntax
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ ├── markers.txt
│ │ │ │ │ └── original.txt
│ │ │ │ ├── trailing-whitespace
│ │ │ │ │ ├── expected.txt
│ │ │ │ │ ├── markers.txt
│ │ │ │ │ └── original.txt
│ │ │ │ └── whitespace-issues
│ │ │ │ ├── expected.txt
│ │ │ │ ├── markers.txt
│ │ │ │ └── original.txt
│ │ │ ├── index.ts
│ │ │ ├── parse-search-replace-segments.ts
│ │ │ └── types.ts
│ │ └── truncations-processor
│ │ ├── index.ts
│ │ ├── test-cases
│ │ │ ├── basic
│ │ │ │ ├── expected.txt
│ │ │ │ ├── original.txt
│ │ │ │ └── truncated.txt
│ │ │ ├── edge-truncations
│ │ │ │ ├── expected.txt
│ │ │ │ ├── original.txt
│ │ │ │ └── truncated.txt
│ │ │ ├── multiple-truncations
│ │ │ │ ├── expected.txt
│ │ │ │ ├── original.txt
│ │ │ │ └── truncated.txt
│ │ │ └── update-after-truncation
│ │ │ ├── expected.txt
│ │ │ ├── original.txt
│ │ │ └── truncated.txt
│ │ ├── truncations-processor.spec.ts
│ │ ├── truncations-processor.ts
│ │ └── utils
│ │ ├── find-line-sequence.ts
│ │ └── is-truncation-line.ts
│ ├── fetch-update-info.ts
│ ├── is-newer
│ │ ├── index.ts
│ │ ├── is-newer.spec.ts
│ │ └── is-newer.ts
│ └── update-extension.ts
└── views
└── prompt
├── backend
│ ├── message-handlers
│ │ └── handle-update-extension.ts
│ ├── prompt-view-provider.ts
│ └── utils
│ └── check-for-updates.ts
├── frontend
│ ├── Home
│ │ └── Home.tsx
│ ├── Prompt.tsx
│ └── hooks
│ └── use-prompt
│ └── use-prompt.ts
└── types
└── messages.ts1 parent eeeb0ed commit a13ebd9
6 files changed
Lines changed: 165 additions & 114 deletions
File tree
- apps/editor/src
- commands
- utils
- is-newer
- views/prompt/backend/utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
24 | 41 | | |
25 | 42 | | |
26 | 43 | | |
27 | 44 | | |
28 | 45 | | |
29 | 46 | | |
30 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
31 | 54 | | |
32 | 55 | | |
33 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 5 | + | |
| 6 | + | |
62 | 7 | | |
63 | 8 | | |
64 | 9 | | |
| |||
140 | 85 | | |
141 | 86 | | |
142 | 87 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
0 commit comments