Skip to content

Commit 89ef2bf

Browse files
authored
Fix getStore type + fix copy-types (#58)
1 parent 0e653f6 commit 89ef2bf

File tree

4 files changed

+33
-7
lines changed

4 files changed

+33
-7
lines changed

config/copy-type-definition.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env node
2+
3+
const shell = require('shelljs');
4+
shell.cp('-R', './package/index.d.ts', './dist/index.d.ts');

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "teaful",
3-
"version": "0.9.0",
3+
"version": "0.9.1",
44
"description": "Tiny, easy and powerful React state management (less than 1kb)",
55
"license": "MIT",
66
"keywords": [
@@ -59,8 +59,8 @@
5959
"test:example:todo-list": "jest ./examples/todo-list",
6060
"test:examples": "jest ./examples",
6161
"test:watch": "jest ./package ./tests --watch",
62-
"build-types": "cp ./package/index.d.ts ./dist/index.d.ts",
63-
"build": "microbundle --jsx React.createElement --no-generateTypes && yarn build-types",
62+
"copy-types": "node ./config/copy-type-definition.js",
63+
"build": "microbundle --jsx React.createElement --no-generateTypes && yarn copy-types",
6464
"dev": "microbundle watch",
6565
"prepublish": "yarn build"
6666
},
@@ -99,7 +99,8 @@
9999
"microbundle": "0.14.2",
100100
"react": "17.0.2",
101101
"react-dom": "17.0.2",
102-
"react-test-renderer": "17.0.2"
102+
"react-test-renderer": "17.0.2",
103+
"shelljs": "0.8.4"
103104
},
104105
"bugs": "https://github.com/teafuljs/teaful/issues"
105106
}

package/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ declare module "teaful" {
2525
}) => void;
2626

2727
type getStoreType<S extends initialStoreType> = {
28-
[key in keyof S | string ]: S[key] extends initialStoreType
28+
[key in keyof S]: S[key] extends initialStoreType
2929
? useStoreType<S[key]> & HookDry<S[key]> : HookDry<S[key]>;
3030
};
3131

yarn.lock

+23-2
Original file line numberDiff line numberDiff line change
@@ -2899,7 +2899,7 @@ glob-parent@^6.0.1:
28992899
dependencies:
29002900
is-glob "^4.0.3"
29012901

2902-
glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
2902+
glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
29032903
version "7.2.0"
29042904
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
29052905
integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
@@ -3136,6 +3136,11 @@ internal-slot@^1.0.3:
31363136
has "^1.0.3"
31373137
side-channel "^1.0.4"
31383138

3139+
interpret@^1.0.0:
3140+
version "1.4.0"
3141+
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
3142+
integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==
3143+
31393144
is-absolute-url@^3.0.3:
31403145
version "3.0.3"
31413146
resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-3.0.3.tgz#96c6a22b6a23929b11ea0afb1836c36ad4a5d698"
@@ -4843,6 +4848,13 @@ read-pkg@^5.2.0:
48434848
parse-json "^5.0.0"
48444849
type-fest "^0.6.0"
48454850

4851+
rechoir@^0.6.2:
4852+
version "0.6.2"
4853+
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
4854+
integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=
4855+
dependencies:
4856+
resolve "^1.1.6"
4857+
48464858
regenerate-unicode-properties@^9.0.0:
48474859
version "9.0.0"
48484860
resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz#54d09c7115e1f53dc2314a974b32c1c344efe326"
@@ -4938,7 +4950,7 @@ [email protected]:
49384950
dependencies:
49394951
path-parse "^1.0.6"
49404952

4941-
resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0:
4953+
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0:
49424954
version "1.20.0"
49434955
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
49444956
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
@@ -5118,6 +5130,15 @@ shebang-regex@^3.0.0:
51185130
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
51195131
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
51205132

5133+
shelljs@^0.8.4:
5134+
version "0.8.4"
5135+
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
5136+
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
5137+
dependencies:
5138+
glob "^7.0.0"
5139+
interpret "^1.0.0"
5140+
rechoir "^0.6.2"
5141+
51215142
side-channel@^1.0.4:
51225143
version "1.0.4"
51235144
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"

0 commit comments

Comments
 (0)