Skip to content

[v5] Export internal types #1235

Description

@apancutt

With v5 now being ESM and using the exports field in package.json, we're no longer able to pluck out internal types for use in our own libraries.

Just one example (of many), if we wanted to implement a camelCase(value: string, options?: CamelCaseOptions) function we now need to copy/paste the CamelCaseOptions type from type-fest since it is no longer exposed.

Regarding #676 - I realize these types are lacking docs/tests so should not be included in the top-level export, but developers should be able to opt-in to using them (like we could pre-v5).

Suggestion: add the following to the exports field:

"./source/internal": {
  "types": "./source/internal/index.d.ts"
},
"./source/*": {
  "types": "./source/*/index.d.ts"
}

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