Skip to content

Commit

Permalink
Fix getStore type + fix copy-types (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca authored Dec 3, 2021
1 parent 0e653f6 commit 89ef2bf
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
4 changes: 4 additions & 0 deletions config/copy-type-definition.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node

const shell = require('shelljs');
shell.cp('-R', './package/index.d.ts', './dist/index.d.ts');
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teaful",
"version": "0.9.0",
"version": "0.9.1",
"description": "Tiny, easy and powerful React state management (less than 1kb)",
"license": "MIT",
"keywords": [
Expand Down Expand Up @@ -59,8 +59,8 @@
"test:example:todo-list": "jest ./examples/todo-list",
"test:examples": "jest ./examples",
"test:watch": "jest ./package ./tests --watch",
"build-types": "cp ./package/index.d.ts ./dist/index.d.ts",
"build": "microbundle --jsx React.createElement --no-generateTypes && yarn build-types",
"copy-types": "node ./config/copy-type-definition.js",
"build": "microbundle --jsx React.createElement --no-generateTypes && yarn copy-types",
"dev": "microbundle watch",
"prepublish": "yarn build"
},
Expand Down Expand Up @@ -99,7 +99,8 @@
"microbundle": "0.14.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-test-renderer": "17.0.2"
"react-test-renderer": "17.0.2",
"shelljs": "0.8.4"
},
"bugs": "https://github.com/teafuljs/teaful/issues"
}
2 changes: 1 addition & 1 deletion package/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ declare module "teaful" {
}) => void;

type getStoreType<S extends initialStoreType> = {
[key in keyof S | string ]: S[key] extends initialStoreType
[key in keyof S]: S[key] extends initialStoreType
? useStoreType<S[key]> & HookDry<S[key]> : HookDry<S[key]>;
};

Expand Down
25 changes: 23 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2899,7 +2899,7 @@ glob-parent@^6.0.1:
dependencies:
is-glob "^4.0.3"

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

interpret@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==

is-absolute-url@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-3.0.3.tgz#96c6a22b6a23929b11ea0afb1836c36ad4a5d698"
Expand Down Expand Up @@ -4843,6 +4848,13 @@ read-pkg@^5.2.0:
parse-json "^5.0.0"
type-fest "^0.6.0"

rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=
dependencies:
resolve "^1.1.6"

regenerate-unicode-properties@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz#54d09c7115e1f53dc2314a974b32c1c344efe326"
Expand Down Expand Up @@ -4938,7 +4950,7 @@ [email protected]:
dependencies:
path-parse "^1.0.6"

resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0:
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0:
version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
Expand Down Expand Up @@ -5118,6 +5130,15 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==

shelljs@^0.8.4:
version "0.8.4"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"

side-channel@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
Expand Down

0 comments on commit 89ef2bf

Please sign in to comment.