Skip to content

Types not being exported in a robust way  #18

@smallsaucepan

Description

@smallsaucepan

Hi @luizbarboza. We're quite keen to use polyclip-ts over in Turfjs. However having some issues gettings the types imported e.g.

index.ts(10,27): error TS7016: Could not find a declaration file for module 'polyclip-ts'. '/Users/james/Code/turf/cmurphy23/node_modules/.pnpm/polyclip-ts@0.16.6/node_modules/polyclip-ts/dist/index.js' implicitly has an 'any' type.
  There are types at '/Users/james/Code/turf/cmurphy23/packages/turf-intersect/node_modules/polyclip-ts/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'polyclip-ts' library may need to update its package.json or typings.

One fix would be to flesh out the exports section of polyclip-ts/package.json, so would be happy to prepare a PR for that. However, without packaging CJS version of the library as well, the best we could hope for from arethetypeswrong would be:

Screenshot 2024-10-26 at 7 19 28 PM

Would you like a PR that will generate and export CJS also? Or do you prefer to stick with ESM only?

Thanks for maintaining the package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions