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/typescript definitions build #85

Merged
merged 9 commits into from
Jul 18, 2024

Conversation

Tristan-WorkGH
Copy link
Member

Please check if the PR fulfills these requirements

  • [x The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

No.

What kind of change does this PR introduce?

  • there was missing .d.ts for js files
  • Vite configuration wasn't ISO with commons-ui

What is the current behavior?

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

As TypeScript resolve unknown entrypoint as any, maybe users using TypeScript might need to adjust a little the types.

Other information:

Full list of changes:

  • add .tgz builds to .gitignore, to avoid accidental commits
  • add .d.ts for exposed exports
    • some little/simple files are directly migrated
      • some errors/inconsistencies found are ignored nd placed as TODO for future full migration to TS
    • also migrated demo
    • some type are keep as unknown because it ask too much time to find structure content
    • export in dts file only what is exported in src/index as it's only temporary
  • update Vite config to be more ISO with commons-ui
    • no need for vite-plugin-externalize-deps, we externalize all libs
    • we import svg as react components with vite-plugin-svgr
    • missing jsx config in tsconfig.json (affect IDE introspection)
  • deck.gl/mapbox.gl/luma.gl have officially typescript definitions in v9, for actually v8, need module override
  • remove file extension in import ... from ...
  • import raw file as-is with Vite ?raw capability (permit to have file not embedded in a giant string in sources)
    • src/components/network-map-viewer/network/layers/arrow-layer-fragment.frag
    • src/components/network-map-viewer/network/layers/arrow-layer-vertex.vert
    • src/components/network-map-viewer/network/layers/arrow-layer.js

@Tristan-WorkGH Tristan-WorkGH self-assigned this Jul 16, 2024
* remove extensions in imports
* unecessary text block for glsl files
* fix svg raw text to react components
* unecessary vite-plugin-externalize-deps (out of sync with commons-ui)

Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
> TS17004: Cannot use JSX unless the `--jsx` flag is provided.

Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
@Tristan-WorkGH Tristan-WorkGH force-pushed the fix/typescript-definitions-build branch from e47cedc to ab4f667 Compare July 16, 2024 08:47
@Tristan-WorkGH Tristan-WorkGH requested a review from Meklo July 16, 2024 11:36
demo/src/App.tsx Show resolved Hide resolved
src/components/network-map-viewer/network/network-map.d.ts Outdated Show resolved Hide resolved
src/deckgl.d.ts Show resolved Hide resolved
demo/src/diagram-viewers/add-diagrams.ts Outdated Show resolved Hide resolved
demo/src/diagram-viewers/add-diagrams.ts Outdated Show resolved Hide resolved
Signed-off-by: Tristan Chuine <tristan.chuine_externe@rte-france.com>
@Tristan-WorkGH Tristan-WorkGH force-pushed the fix/typescript-definitions-build branch from 0c60d2a to bd04020 Compare July 17, 2024 14:19
@Tristan-WorkGH Tristan-WorkGH requested a review from Meklo July 17, 2024 15:13
@Tristan-WorkGH Tristan-WorkGH merged commit 82205ec into main Jul 18, 2024
4 checks passed
@Tristan-WorkGH Tristan-WorkGH deleted the fix/typescript-definitions-build branch July 18, 2024 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants