Commit 72b5c73
authored
Use "callsites" instead of regex for current directory matching (#1015)
- adopted from https://github.com/sindresorhus/callsites
- ~wip: have to test whether same trick works on Bun~
works on bun
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Replaces regex-based path extraction with `callsites` for
`getCallerDirectory`, fixing Windows path handling and removing the old
helper and its tests.
>
> - **Template utils (`packages/js-sdk/src/template/utils.ts`)**:
> - Replace regex-based extraction with `callsites` and update
`getCallerDirectory` to use `CallSite.getFileName()` and `path.dirname`.
> - Remove `matchFileDir` helper.
> - **Tests**:
> - Delete `packages/js-sdk/tests/template/utils/matchFileDir.test.ts`.
> - **Changeset**:
> - Add patch note: fixes default context directory for Windows paths.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
effab6d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 45d782f commit 72b5c73
File tree
3 files changed
+27
-114
lines changed- .changeset
- packages/js-sdk
- src/template
- tests/template/utils
3 files changed
+27
-114
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
206 | 189 | | |
207 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
208 | 194 | | |
209 | 195 | | |
210 | 196 | | |
| |||
215 | 201 | | |
216 | 202 | | |
217 | 203 | | |
218 | | - | |
219 | | - | |
220 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
221 | 208 | | |
222 | 209 | | |
223 | | - | |
224 | | - | |
225 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
226 | 213 | | |
227 | 214 | | |
228 | | - | |
229 | | - | |
| 215 | + | |
230 | 216 | | |
231 | 217 | | |
232 | 218 | | |
| |||
Lines changed: 0 additions & 78 deletions
This file was deleted.
0 commit comments