table-library / react-table-library

:bento: React Table Library
https://react-table-library.com
MIT License
737 stars 45 forks source link

Generated types have broken references #145

Open adidahiya opened 8 months ago

adidahiya commented 8 months ago

It seems like the types (presumably generated by rollup) in @table-library/react-table-library/table/Table/index.d.ts have broken references to modules within this monorepo:

declare const Table: React.ForwardRefExoticComponent<Pick<{
    data: import("@table-library/react-table-library/types/table").Data<TableNode>;
    theme?: Theme | undefined;
    layout?: Layout | undefined;
    sort?: import("../../types").Sort<TableNode> | undefined;
    pagination?: import("../../types").Pagination<TableNode> | undefined;
    select?: import("../../types").Select<TableNode> | undefined;
    tree?: import("../../types").Tree<TableNode> | undefined;
    onInit?: import("@table-library/react-table-library/types/table").OnInitFunction | undefined;
    children?: ((nodes: import("@table-library/react-table-library/types/table").ExtendedNode<TableNode>[]) => React.ReactNode) | undefined;
} & import("@table-library/react-table-library/types/table").RestProps, string> & React.RefAttributes<unknown>>;

unpkg link

The import("../../types") expressions should probably be emitted as import("@table-library/react-table-library/types") instead.

This causes issues with downstream TS compilation:

../../node_modules/@table-library/react-table-library/table/Table/index.d.ts:12:19 - error TS7016: Could not find a declaration file for module '../../types'. '/Users/adi/Developer/repos/personal/raga/node_modules/@table-library/react-table-library/types.js' implicitly has an 'any' type.

12     tree?: import("../../types").Tree<TableNode> | undefined;
                     ~~~~~~~~~~~~~

Found 4 errors in the same file, starting at: ../../node_modules/@table-library/react-table-library/table/Table/index.d.ts:9

Environment:

I can work around these by setting skipLibCheck: true, but this is a band-aid fix which may cause other legitimate compiler errors to be swallowed, and I do not wish to use that as a long-term solution.