Skip to content

Commit 9ca22c6

Browse files
Migrate @emotion/serialize to TypeScript (#2543)
* [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 <[email protected]>
1 parent 17fee4b commit 9ca22c6

File tree

5 files changed

+180
-143
lines changed

5 files changed

+180
-143
lines changed

.changeset/healthy-elephants-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/serialize': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

packages/css/types/tests-create-instance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const emotion0 = createEmotion({ key: 'bar' })
55
// $ExpectType Emotion
66
const emotion1 = createEmotion({
77
key: 'foo',
8-
container: document.head!,
8+
container: document.head,
99
nonce: 'fasefw'
1010
})
1111

packages/serialize/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "serialization utils for emotion",
55
"main": "dist/emotion-serialize.cjs.js",
66
"module": "dist/emotion-serialize.esm.js",
7-
"types": "types/index.d.ts",
7+
"types": "dist/emotion-serialize.cjs.d.ts",
88
"license": "MIT",
99
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/serialize",
1010
"publishConfig": {
@@ -26,8 +26,7 @@
2626
},
2727
"files": [
2828
"src",
29-
"dist",
30-
"types/*.d.ts"
29+
"dist"
3130
],
3231
"browser": {
3332
"./dist/emotion-serialize.cjs.js": "./dist/emotion-serialize.browser.cjs.js",

0 commit comments

Comments
 (0)