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

bug: Missing @types/sortablejs dependency #9505

Closed
2 of 6 tasks
maxpatiiuk opened this issue Jun 4, 2024 · 2 comments
Closed
2 of 6 tasks

bug: Missing @types/sortablejs dependency #9505

maxpatiiuk opened this issue Jun 4, 2024 · 2 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. estimate - 2 Small fix or update, may require updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - medium Issue is non core or affecting less that 60% of people using the library

Comments

@maxpatiiuk
Copy link
Member

Check existing issues

Actual Behavior

Calcite typings are using types from the Sortablejs library, for example in this file:

// node_modules/@esri/calcite-components/dist/types/components/value-list/value-list.d.ts
import Sortable from "sortablejs";
...

Yet, @types/sortablejs is not included as a "dependency" (it's as devDependency instead, and in the root monorepo package.json rather than calcite-components's package.json)

This cause TypeScript errors for consumer of calcite package when they try to typecheck their app if they have "skipLibCheck":false in their tsconfig.json (otherwise, the type would get silently resolved to any - not ideal)

> npx tsc --noEmit
../../../node_modules/@esri/calcite-components/dist/types/components/value-list/value-list.d.ts:2:22 - error TS7016: Could not find a declaration file for module 'sortablejs'. '/Users/mak13180/site/esri/arcgis-web-components/node_modules/sortablejs/Sortable.min.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/sortablejs` if it exists or add a new declaration (.d.ts) file containing `declare module 'sortablejs';`

2 import Sortable from "sortablejs";
                       ~~~~~~~~~~~~

../../../node_modules/@esri/calcite-components/dist/types/utils/sortableComponent.d.ts:1:22 - error TS7016: Could not find a declaration file for module 'sortablejs'. '/Users/mak13180/site/esri/arcgis-web-components/node_modules/sortablejs/Sortable.min.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/sortablejs` if it exists or add a new declaration (.d.ts) file containing `declare module 'sortablejs';`

1 import Sortable from "sortablejs";

Expected Behavior

Since Calcite's types rely on Sortablejs types, @types/sortablejs must be made into a dependency

Reproduction Sample

https://github.com/maxpatiiuk/calcite-missing-dependency

Reproduction Steps

  1. Checkout the repository - git clone https://github.com/maxpatiiuk/calcite-missing-dependency
  2. Run npm install
  3. Run npx tsc
  4. See error

Reproduction Version

2.0.0

Relevant Info

See relevant articles:

Regression?

No response

Priority impact

impact - p3 - not time sensitive

Impact

No response

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Maps SDK for JavaScript

@maxpatiiuk maxpatiiuk added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jun 4, 2024
@github-actions github-actions bot added ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. calcite-components Issues specific to the @esri/calcite-components package. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive labels Jun 4, 2024
@geospatialem geospatialem added p - medium Issue is non core or affecting less that 60% of people using the library estimate - 2 Small fix or update, may require updates to tests. labels Jun 10, 2024
@geospatialem geospatialem added this to the 2024-08-27 - Aug Release milestone Jun 10, 2024
@geospatialem geospatialem removed the needs triage Planning workflow - pending design/dev review. label Jun 10, 2024
@jcfranco jcfranco self-assigned this Jul 16, 2024
@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. labels Jul 16, 2024
jcfranco added a commit that referenced this issue Jul 16, 2024
… resolve properly (#9786)

**Related Issue:** #9505

## Summary

This fixes a build issue for consumers unless @types/sortablejs is
installed locally.
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Jul 16, 2024
Copy link
Contributor

Installed and assigned for verification.

@github-actions github-actions bot assigned DitwanP and unassigned jcfranco Jul 16, 2024
@DitwanP
Copy link
Contributor

DitwanP commented Jul 16, 2024

🍡 Verified locally with using repo provided above on version 2.11.0-next.12

@DitwanP DitwanP closed this as completed Jul 16, 2024
@DitwanP DitwanP added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Jul 16, 2024
calcite-admin pushed a commit that referenced this issue Jul 30, 2024
… resolve properly (#9786)

**Related Issue:** #9505

## Summary

This fixes a build issue for consumers unless @types/sortablejs is
installed locally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. estimate - 2 Small fix or update, may require updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - medium Issue is non core or affecting less that 60% of people using the library
Projects
None yet
Development

No branches or pull requests

4 participants