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

feat: add a typescript project to validate configuration using moduleResolution=bundler #580

Closed

Conversation

tbouffard
Copy link
Member

@tbouffard tbouffard commented Nov 20, 2023

WIP

Notes

This reproduces the issue mentioned in #390 (comment).

$ npm run build
> build
> tsc
src/index.ts:1:35 - error TS7016: Could not find a declaration file for module 'bpmn-visualization'.
'projects/typescript-config-validation/node_modules/bpmn-visualization/dist/bpmn-visualization.esm.js'
implicitly has an 'any' type.
There are types at 'projects/typescript-config-validation/node_modules/bpmn-visualization/dist/bpmn-visualization.d.ts',
but this result could not be resolved when respecting package.json "exports".
The 'bpmn-visualization' library may need to update its package.json or typings.

1 import { BpmnVisualization } from 'bpmn-visualization';
                                    ~~~~~~~~~~~~~~~~~~~~

Found 1 error in src/index.ts:1

@tbouffard tbouffard added the enhancement New feature or request label Nov 20, 2023
@@ -23,7 +23,7 @@ jobs:
with:
repository: 'process-analytics/bpmn-visualization-js'
# to test a specific feature under development, uncomment the following line and use the related branch
# ref: 'specific_branch'
ref: 'fix/package.json_exports_types'
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO revert this when process-analytics/bpmn-visualization-js#2972 has been merged

"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler", // this configuration requires to have types declaration in the package.json "exports" attribute
Copy link
Member Author

@tbouffard tbouffard Nov 20, 2023

Choose a reason for hiding this comment

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

Suggested change
"moduleResolution": "bundler", // this configuration requires to have types declaration in the package.json "exports" attribute
"moduleResolution": "bundler", // this configuration requires to have types declaration in the package.json "exports" field

@@ -45,6 +45,7 @@ jobs:
- javascript-vanilla-with-webpack
- typescript-angular
- typescript-lit-element
- typescript-moduleResolution-bundler
Copy link
Member Author

Choose a reason for hiding this comment

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

Until we have a released version of bpmn-visualization including the fix, we should exclude to build this project with the release version.
And restore it when the new release is available.

@tbouffard
Copy link
Member Author

Closing, this reproduction project is going to be directly integrated in bpmn-visualization with process-analytics/bpmn-visualization-js#2972.
This will give faster feedback.

@tbouffard tbouffard closed this Nov 21, 2023
@tbouffard tbouffard deleted the feat/validate_ts_project_moduleResolution_bundler branch November 21, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant