| 85 | 85 | | } |
| 86 | 86 | | |
| 87 | 87 | | function match(files, includes, excludes) { |
| 88 | | - | return micromatch(files, [ |
| 89 | | - | ...(includes ?? ["**/*"]), |
| 90 | | - | ...(excludes ?? []).map((pattern) => `!${pattern}`), |
| 91 | | - | ]); |
| 88 | + | return micromatch( |
| 89 | + | files, |
| 90 | + | [ |
| 91 | + | ...(includes ?? ["**/*"]), |
| 92 | + | ...(excludes ?? []).map((pattern) => `!${pattern}`), |
| 93 | + | ], |
| 94 | + | // dot:true so absolute paths whose ancestors include dot-prefixed |
| 95 | + | // segments still classify correctly. This helper feeds isPage / |
| 96 | + | // isLayout / isMiddleware / isApi / isResource via isTypeOf, which |
| 97 | + | // run on the absolute `src` produced by the chokidar add handler |
| 98 | + | // (`join(cwd, root, rawSrc)`). When a CLI ships its own pages and |
| 99 | + | // is launched via `npx` — where the package lives under |
| 100 | + | // `~/.npm/_npx/<hash>/...` — every classification would silently |
| 101 | + | // return false (manifest reports `0 pages`) because micromatch |
| 102 | + | // defaults to `dot:false` and rejects any path whose *ancestors* |
| 103 | + | // contain a dot-prefixed segment, not just the basename. Same |
| 104 | + | // trap as the fast-glob `dot:true` we already pass below for the |
| 105 | + | // initial-files scan; both layers must opt in. |
| 106 | + | { dot: true } |
| 107 | + | ); |
| 92 | 108 | | } |
| 93 | 109 | | |
| 94 | 110 | | function source(files, rootDir, root) { |