sindresorhus / globby

User-friendly glob matching
MIT License
2.53k stars 129 forks source link

Type imports from `fast-glob` are incorrect #268

Closed moltar closed 3 months ago

moltar commented 3 months ago

https://github.com/sindresorhus/globby/blob/b0d7330942a3d36a12056f3a1257f676a534b6ea/index.d.ts#L1-L2

The fast-glob package does not export the Entry type, which results in build failures when using Rollup:

RollupError: "Entry" is not exported by "../../node_modules/.pnpm/globby@14.0.1/node_modules/fast-glob/out/index.d.ts", imported by "../../node_modules/.pnpm/syncpack@12.3.3_typescript@5.4.5/node_modules/globby/index.d.ts". at getRollupError (.../node_modules/.pnpm/rollup@4.18.0/node_modules/rollup/dist/shared/parseAst.js:282:41)

Because fast-glob exports a namespace:

declare namespace FastGlob {
    type Options = OptionsInternal;
    type Entry = EntryInternal;

Source: https://www.npmjs.com/package/fast-glob?activeTab=code

screenshot-20240630T105212-M3rH0eFb@2x