Skip to content

Commit

Permalink
Migrate @emotion/serialize to TypeScript (#2543)
Browse files Browse the repository at this point in the history
* [serialize]: Convert to Typescript

* fix: Some tests

* chore: Revert unrelated change

* chore: Revert code behaviour changes

* chore: Revert toString method addition

* chore: Changeset

* fix: Add missing return of ComponentSelector

* fix: Export missing interfaces

* small tweaks

* fix stuff

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
  • Loading branch information
danilofuchs and Andarist authored Apr 19, 2022
1 parent 17fee4b commit 9ca22c6
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 143 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-elephants-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/serialize': minor
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
2 changes: 1 addition & 1 deletion packages/css/types/tests-create-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const emotion0 = createEmotion({ key: 'bar' })
// $ExpectType Emotion
const emotion1 = createEmotion({
key: 'foo',
container: document.head!,
container: document.head,
nonce: 'fasefw'
})

Expand Down
5 changes: 2 additions & 3 deletions packages/serialize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "serialization utils for emotion",
"main": "dist/emotion-serialize.cjs.js",
"module": "dist/emotion-serialize.esm.js",
"types": "types/index.d.ts",
"types": "dist/emotion-serialize.cjs.d.ts",
"license": "MIT",
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/serialize",
"publishConfig": {
Expand All @@ -26,8 +26,7 @@
},
"files": [
"src",
"dist",
"types/*.d.ts"
"dist"
],
"browser": {
"./dist/emotion-serialize.cjs.js": "./dist/emotion-serialize.browser.cjs.js",
Expand Down
Loading

0 comments on commit 9ca22c6

Please # to comment.