Skip to content

Commit 72ed591

Browse files
authored
fix: Tidy up type provision (#764)
* fix(types): Import Svelte types in client instead of top-level types We import Svelte to hoist its ambient '*.svelte' module type declaration. However, this depends on browser/DOM types, which TS consumers not implementing for the browser may not have active (e.g. if building a storage connector or plugin), so it makes sense to only import this in the client itself where consumers will need `"lib": ["dom"]` in their tsconfig.json or equivalent. * fix(types): Move '@types/koa' from dev dependency to dependency Koa types are used directly in `src/types.ts`, so need to be installed for TS consumers.
1 parent 7dc8c29 commit 72ed591

4 files changed

Lines changed: 27 additions & 34 deletions

File tree

package-lock.json

Lines changed: 25 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
"@testing-library/svelte": "^1.9.0",
8585
"@types/enzyme": "^3.10.5",
8686
"@types/jest": "^24.0.0",
87-
"@types/koa": "^2.11.3",
8887
"@types/koa-router": "^7.4.0",
8988
"@types/koa__cors": "^3.0.1",
9089
"@types/react": "^16.9.36",
@@ -148,6 +147,7 @@
148147
},
149148
"dependencies": {
150149
"@koa/cors": "^2.2.1",
150+
"@types/koa": "^2.11.3",
151151
"flatted": "^0.2.3",
152152
"immer": "^1.8.0",
153153
"koa": "^2.7.0",

src/client/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* https://opensource.org/licenses/MIT.
77
*/
88

9+
import 'svelte';
910
import {
1011
Dispatch,
1112
StoreEnhancer,

src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Object } from 'ts-toolbelt';
22
import Koa from 'koa';
33
import { Store as ReduxStore } from 'redux';
4-
import 'svelte';
54
import * as ActionCreators from './core/action-creators';
65
import { Flow } from './core/flow';
76
import { CreateGameReducer } from './core/reducer';

0 commit comments

Comments
 (0)