Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Published npm packages .d.ts files referring to src dir #4678

Open
cmdcolin opened this issue Nov 23, 2024 · 2 comments
Open

Published npm packages .d.ts files referring to src dir #4678

cmdcolin opened this issue Nov 23, 2024 · 2 comments
Labels
bug Something isn't working low priority

Comments

@cmdcolin
Copy link
Collaborator

see https://www.npmjs.com/package/@jbrowse/react-linear-genome-view/v/2.17.0?activeTab=code

downloading the zip is better cause viewing the code on page is slow but @jbrowse/react-linear-genome-view/dist/createViewState.d.ts

            highlight: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType>>, [undefined]>>;

this causes confusion in the typescript compilation of embedded components

i don't know exactly why it's behaving this way

strategies to fix

possibly multiple could be investigated

strategy 1: publish src dir

one strategy to fix this is to include src dir in our published releases

pros: could fix this, can enable source maps
cons: sometimes leads people to import from the src dir which is not intended usage

stategy 2: investigate why it's doing this

e.g. git bisect to see how long this has been happening?

pros: systematically uncover issue
cons: hard to do

strategy 3: investigate alternative monorepo setups

our codebase alternately refers to src at dev time and dist at prod time. my hypothesis is that there is a confusion in this case

possible systems include nx and turborepo. i'm not super into nx. don't know much about turborepo. maybe there is a better usage of lerna also

pros: more 'industry standard' maybe, reduced weirdness from our src/dist swapping
cons: more complexity of build tooling

@cmdcolin cmdcolin added the bug Something isn't working label Nov 23, 2024
@cmdcolin
Copy link
Collaborator Author

note that we used to publish src dirs but it was removed after overture (https://www.overture.bio/) team said it caused them trouble

@cmdcolin
Copy link
Collaborator Author

i think turning on skipLibCheck:true fixes this, so maybe low priority. similar skipLibCheck issue hre GMOD/bam-js#97

@cmdcolin cmdcolin changed the title Typescript errors in embedded components due to published npm packages .d.ts files referring to src dir Published npm packages .d.ts files referring to src dir Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority
Projects
None yet
Development

No branches or pull requests

1 participant