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: package types imports #10546

Merged
merged 3 commits into from
Oct 25, 2023
Merged

fix: package types imports #10546

merged 3 commits into from
Oct 25, 2023

Conversation

evanSe
Copy link
Member

@evanSe evanSe commented Oct 22, 2023

Context

allows proper resolution of typescript types, prior to this fix you would get a error such as

Could not find a declaration file for module 'handsontable'. '/node_modules/handsontable/index.mjs' implicitly has an 'any' type.
  There are types at '/node_modules/handsontable/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'handsontable' library may need to update its package.json or typings.ts(7016)

this fix updates package.json to import types in the handsontable package, @handsontable/react, @handsontable/vue3, @handsontable/vue3

How has this been tested?

tested doing the following

  1. npx create-next-app@latest (make sure to keep typescript enabled)
  2. npm install handsontable@*locally packaged* @handsontable/react@*locally packaged*
  3. Open ./src/app/page.tsx
  4. Installed the react demo:
<HotTable
  data={[
    ['', 'Tesla', 'Volvo', 'Toyota', 'Ford'],
    ['2019', 10, 11, 12, 13],
    ['2020', 20, 11, 14, 13],
    ['2021', 30, 15, 12, 13]
  ]}
  rowHeaders={true}
  colHeaders={true}
  height="auto"
  licenseKey="non-commercial-and-evaluation" // for non-commercial use only
/>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature or improvement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Additional language file or change to the existing one (translations)

Related issue(s):

  1. [Bug]: Broken Typescript Types #10509

Affected project(s):

  • handsontable
  • @handsontable/angular
  • @handsontable/react
  • @handsontable/vue
  • @handsontable/vue3

Checklist:

@evanSe
Copy link
Member Author

evanSe commented Oct 24, 2023

Check with stackblitz and code sandbox

@evanSe evanSe requested a review from budnix October 24, 2023 12:43
handsontable/package.json Show resolved Hide resolved
@evanSe evanSe requested a review from budnix October 24, 2023 13:49
@evanSe evanSe self-assigned this Oct 25, 2023
@github-actions
Copy link

Launch the local version of documentation by running:

npm run docs:review 6f1370b41a1e7c7441a6935f46b0794e51ebe26b

@evanSe evanSe merged commit 21d91d0 into develop Oct 25, 2023
32 checks passed
@evanSe evanSe deleted the 10509-broken-typescript-types branch October 25, 2023 10: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.

None yet

2 participants