Skip to content

Commit

Permalink
Merge pull request #2555 from emotion-js/ts-migration
Browse files Browse the repository at this point in the history
TS migration
  • Loading branch information
emmatown authored May 17, 2024
2 parents 73f6881 + 1effaf9 commit fc74bee
Show file tree
Hide file tree
Showing 274 changed files with 2,251 additions and 3,538 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-clocks-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/unitless': minor
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
5 changes: 5 additions & 0 deletions .changeset/eighty-spies-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/css': minor
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
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.
5 changes: 5 additions & 0 deletions .changeset/hip-moons-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/memoize': minor
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
5 changes: 5 additions & 0 deletions .changeset/hot-yaks-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/is-prop-valid': minor
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
5 changes: 5 additions & 0 deletions .changeset/loud-hairs-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/weak-memoize': minor
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
5 changes: 5 additions & 0 deletions .changeset/lovely-zebras-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/eslint-plugin': patch
---

An empty css prop (`<div css />`) will now raise an error in the `@emotion/syntax-preference` rule instead of crashing on this case.
5 changes: 5 additions & 0 deletions .changeset/modern-penguins-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/eslint-plugin': minor
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
5 changes: 5 additions & 0 deletions .changeset/modern-tomatoes-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/css': patch
---

Fixed `options` parameter to `createEmotion` from `@emotion/css/create-instance` incorrectly being marked as optional when it's required.
9 changes: 9 additions & 0 deletions .changeset/neat-shoes-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@emotion/primitives-core': minor
---

author: @srmagura
pr: #2818
commit: 8546dd0

Source code has been migrated to TypeScript so from now on type declarations will be available in the published package.
5 changes: 5 additions & 0 deletions .changeset/old-years-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/utils': minor
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
5 changes: 5 additions & 0 deletions .changeset/sharp-trees-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/eslint-plugin': patch
---

Fixed a crash on empty css prop (`<div css />`) in the `@emotion/jsx-import` rule.
5 changes: 5 additions & 0 deletions .changeset/stale-dogs-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/hash': patch
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
5 changes: 5 additions & 0 deletions .changeset/thick-tips-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/sheet': minor
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
5 changes: 5 additions & 0 deletions .changeset/thirty-years-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/sheet': patch
---

Type declaration for `StyleSheet`'s constructor has been fixed. It incorrectly was specifying that `options` were optional when in reality they weren't.
5 changes: 5 additions & 0 deletions .changeset/wet-boxes-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/babel-plugin-jsx-pragmatic': minor
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
6 changes: 1 addition & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ coverage/
node_modules/
stylis.min.js
/demo/dist
flow-typed/

# This is to prevent ESLint parsing errors in the website which is written in
# TypeScript. TODO: Reenable once the codebase is converted to TypeScript.
/site/
/site/out
24 changes: 0 additions & 24 deletions .flowconfig

This file was deleted.

25 changes: 0 additions & 25 deletions .flowconfig-ci

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- ts-migration
pull_request:

permissions:
Expand All @@ -30,15 +31,15 @@ jobs:
uses: codecov/codecov-action@v1
if: ${{ matrix.platform == 'ubuntu-latest' && always() }}

flow:
name: Flow
typescript:
name: TypeScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/ci-setup

- name: Check Types
run: yarn flow:check
run: yarn tsc:all

test_react18:
name: Test React 18
Expand Down Expand Up @@ -70,7 +71,7 @@ jobs:
- name: ESLint
run: yarn lint:check

typescript:
dtslint:
name: dtslint
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ package-lock.json
!.yarn/versions

# Website
site/out
.next
/site/out
.next
3 changes: 0 additions & 3 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ overrides:
- files: 'docs/*.md'
options:
printWidth: 60
- files: '*.js'
options:
parser: flow
1 change: 0 additions & 1 deletion __mocks__/react-native.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @flow
/* eslint-env jest */

let components = [
Expand Down
1 change: 0 additions & 1 deletion __mocks__/react-primitives.js
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// @flow
export * from 'react-primitives/lib/index.web'
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let isTestFile = filename =>
module.exports = api => {
api.cache(true)
return {
presets: ['babel-preset-emotion-dev'],
presets: ['babel-preset-emotion-dev', '@babel/preset-typescript'],
overrides: [
{
test: filename =>
Expand Down
1 change: 0 additions & 1 deletion docs/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
- source-maps
- testing
- typescript
- flow
- eslint-plugin-react

# This loads the READMEs instead of files in docs/
Expand Down
115 changes: 0 additions & 115 deletions docs/flow.mdx

This file was deleted.

20 changes: 0 additions & 20 deletions flow-typed/npm/gatsby_vx.x.x.js

This file was deleted.

Loading

0 comments on commit fc74bee

Please sign in to comment.