Skip to content

Conversation

@Convly
Copy link
Member

@Convly Convly commented May 10, 2022

What does it do?

Add a first basis for the Strapi class typings. This is only the first iteration and it is likely to evolve in the next beta releases.

Why is it needed?

Without proper typings, using Strapi with TS is hard and doesn't make a lot of sense.

How to test it?

Create a typescript project and try using the Strapi type exported from @strapi/strapi

@Convly
Copy link
Member Author

Convly commented May 10, 2022

Note: In the future, we'll work on providing types for more layers & will start to replace the "unknown" typings with more explicit ones.

@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #13281 (40dede5) into features/typescript (3f53cff) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@                   Coverage Diff                   @@
##           features/typescript   #13281      +/-   ##
=======================================================
- Coverage                48.23%   48.20%   -0.04%     
=======================================================
  Files                      245      251       +6     
  Lines                     8782     8954     +172     
  Branches                  1960     2008      +48     
=======================================================
+ Hits                      4236     4316      +80     
- Misses                    3735     3820      +85     
- Partials                   811      818       +7     
Flag Coverage Δ
unit 48.20% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/core/admin/server/services/user.js 83.49% <ø> (ø)
...erver/services/schema-builder/component-builder.js 14.03% <ø> (ø)
...er/services/schema-builder/content-type-builder.js 8.73% <ø> (ø)
...pe-builder/server/services/schema-builder/index.js 10.14% <ø> (ø)
...r/server/services/schema-builder/schema-handler.js 3.57% <ø> (ø)
packages/core/upload/server/bootstrap.js 66.66% <ø> (-3.61%) ⬇️
packages/core/utils/lib/hooks.js 89.65% <ø> (ø)
packages/core/utils/lib/sanitize/index.js 53.84% <ø> (-5.25%) ⬇️
.../server/services/helpers/build-component-schema.js 90.62% <ø> (ø)
.../services/helpers/utils/clean-schema-attributes.js 14.70% <ø> (ø)
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c250186...40dede5. Read the comment docs.

@Convly Convly requested a review from Bassel17 May 16, 2022 09:08
Copy link
Member

@Bassel17 Bassel17 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Convly Convly merged commit a41040f into features/typescript May 16, 2022
@Convly Convly deleted the typescript/strapi-global-typings branch May 16, 2022 15:22
@strapi-bot
Copy link

This pull request has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/strapi-v4-2-0-fourth-beta-for-typescript-support/18869/1

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.

5 participants