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

fix: move types to src dir to escape src / dist dirs in paths #10993

Merged
merged 1 commit into from Dec 16, 2022
Merged

fix: move types to src dir to escape src / dist dirs in paths #10993

merged 1 commit into from Dec 16, 2022

Conversation

dangreen
Copy link
Collaborator

@dangreen dangreen commented Dec 16, 2022

Files were moved:

types/tests -> test/types
types -> src/types

On build, types from src/types will be copied to dist/types

package.json:

"emitDeclarations": "tsc --emitDeclarationOnly && cp -R ./src/types/ ./dist/types/"

Fixes #10991

@dangreen dangreen marked this pull request as ready for review December 16, 2022 10:56
Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the issue fixed? By moving the types such that the relative paths match in dist/src?

@@ -52,7 +52,6 @@ jobs:
- 'karma.conf.js'
- 'package.json'
types:
- 'types/**'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: After this, type changes are detected as src and thus full build/coverrage will be executed in CI.

@dangreen
Copy link
Collaborator Author

dangreen commented Dec 16, 2022

@kurkle types/index.d.ts had references to the src directory that was not packaged into the package. The paths are now relative to the src directory and work correctly in src and in dist directories as well

@kurkle kurkle added type: bug type: types Typescript type changes labels Dec 16, 2022
@kurkle kurkle added this to the Version 4.1.1 milestone Dec 16, 2022
@etimberg etimberg merged commit 64a0278 into chartjs:master Dec 16, 2022
@dangreen dangreen deleted the fix-types-paths branch December 16, 2022 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug type: types Typescript type changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript and Type break on 4.1.0
3 participants