(file: string, specs: string[])
| 245 | ] |
| 246 | |
| 247 | async function findInternalDepsForFile(file: string, specs: string[]) { |
| 248 | const urls: string[] = [] |
| 249 | for (const s of specs) { |
| 250 | if (s.startsWith('./') || s.startsWith('../')) { |
| 251 | const p = await resolveLocalPath(file, s) |
| 252 | if (p) { |
| 253 | const u = await fsToNs(p) |
| 254 | if (u) urls.push(u) |
| 255 | } |
| 256 | } else if (s.startsWith('@/')) { |
| 257 | const p = await aliasToFs(s) |
| 258 | if (p) { |
| 259 | const u = await fsToNs(p) |
| 260 | if (u) urls.push(u) |
| 261 | } |
| 262 | } |
| 263 | } |
| 264 | return [...new Set(urls)] |
| 265 | } |
| 266 | |
| 267 | const blockSlugFromPage = (pagePath: string) => { |
| 268 | const rel = toPosix(path.relative(BLOCKS_DIR, path.dirname(pagePath))) |
no test coverage detected