File tree Expand file tree Collapse file tree 5 files changed +31
-6
lines changed
packages/custom-properties Expand file tree Collapse file tree 5 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,5 @@ node_modules
5
5
dist
6
6
coverage
7
7
.DS_Store
8
- .rts2_cache *
8
+ .rts2_cache *
9
+ .idea
Original file line number Diff line number Diff line change 2
2
"name" : " @theme-ui/custom-properties" ,
3
3
"description" : " Generate CSS custom properties for use with Theme UI" ,
4
4
"version" : " 0.3.0" ,
5
+ "source" : " src/index.ts" ,
5
6
"main" : " dist/index.js" ,
6
7
"module" : " dist/index.esm.js" ,
8
+ "types" : " dist/index.d.ts" ,
7
9
"author" :
" Alex Page <[email protected] >" ,
8
10
"license" : " MIT" ,
9
11
"scripts" : {
10
- "prepare" : " microbundle --no-compress" ,
11
- "watch" : " microbundle watch --no-compress"
12
+ "prepare" : " microbundle --no-compress --tsconfig tsconfig.json " ,
13
+ "watch" : " microbundle watch --no-compress --tsconfig tsconfig.json "
12
14
},
13
15
"publishConfig" : {
14
16
"access" : " public"
15
17
},
16
18
"dependencies" : {
17
19
"pluralize" : " ^8.0.0"
20
+ },
21
+ "devDependencies" : {
22
+ "@theme-ui/core" : " ^0.3.1" ,
23
+ "@types/pluralize" : " ^0.0.29"
18
24
}
19
25
}
Original file line number Diff line number Diff line change 1
1
import pluralize from 'pluralize'
2
+ import { Theme } from '@theme-ui/core'
2
3
3
- export default ( theme , prefix ) => {
4
- const customProperties = { }
4
+ interface CustomProperties {
5
+ [ key : string ] : string | number
6
+ }
7
+
8
+ export default ( theme : Theme , prefix ?: string ) => {
9
+ const customProperties : CustomProperties = { }
5
10
6
- const generateProperties = ( object , previousKey ) => {
11
+ const generateProperties = ( object : object , previousKey ?: string ) => {
7
12
Object . entries ( object ) . forEach ( ( [ key , value ] ) => {
8
13
let formattedKey = pluralize ( key , 1 )
9
14
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "resolveJsonModule" : true ,
4
+ "esModuleInterop" : true ,
5
+ "moduleResolution" : " node" ,
6
+ "strict" : true
7
+ }
8
+ }
Original file line number Diff line number Diff line change 3506
3506
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
3507
3507
integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==
3508
3508
3509
+ "@types/pluralize@^0.0.29":
3510
+ version "0.0.29"
3511
+ resolved "https://registry.yarnpkg.com/@types/pluralize/-/pluralize-0.0.29.tgz#6ffa33ed1fc8813c469b859681d09707eb40d03c"
3512
+ integrity sha512-BYOID+l2Aco2nBik+iYS4SZX0Lf20KPILP5RGmM1IgzdwNdTs0eebiFriOPcej1sX9mLnSoiNte5zcFxssgpGA==
3513
+
3509
3514
"@types/prop-types@*":
3510
3515
version "15.7.3"
3511
3516
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
You can’t perform that action at this time.
0 commit comments