dub-stack / chakra-radix-colors

This package provides the @radix-ui/colors in a chakra project.
MIT License
16 stars 0 forks source link

Generate theme types for intellisense #36

Open SpencerDuball opened 2 years ago

SpencerDuball commented 2 years ago

See https://chakra-ui.com/docs/styled-system/theming/advanced#theme-typings to understand how to get theme typings that can be used with intellisense by supported IDEs.

SpencerDuball commented 2 years ago
➜  npx chakra-cli tokens node_modules/@dub-stack/chakra-radix-colors/dist/index.js

 Chakra UI CLI  v1.9.0 by Chakra UI
Generate theme typings for autocomplete

✖ An error occurred
TypeError: Cannot read properties of undefined (reading 'message')
    at UU (/Users/sduball/LocalStorage/packages/tool-doc-handsome/node_modules/prettier/parser-typescript.js:280:5888)
    at Object.zU [as parse] (/Users/sduball/LocalStorage/packages/tool-doc-handsome/node_modules/prettier/parser-typescript.js:280:6241)
    at Object.parse (/Users/sduball/LocalStorage/packages/tool-doc-handsome/node_modules/prettier/index.js:7361:23)
    at coreFormat (/Users/sduball/LocalStorage/packages/tool-doc-handsome/node_modules/prettier/index.js:8672:18)
    at formatWithCursor2 (/Users/sduball/LocalStorage/packages/tool-doc-handsome/node_modules/prettier/index.js:8864:18)
    at /Users/sduball/LocalStorage/packages/tool-doc-handsome/node_modules/prettier/index.js:39174:12
    at format (/Users/sduball/LocalStorage/packages/tool-doc-handsome/node_modules/prettier/index.js:39188:12)
    at _callee$ (/Users/sduball/LocalStorage/packages/tool-doc-handsome/node_modules/@chakra-ui/cli/src/utils/format-with-prettier.ts:5:10)
    at tryCatch (/Users/sduball/LocalStorage/packages/tool-doc-handsome/node_modules/regenerator-runtime/runtime.js:63:40)
    at Generator.invoke [as _invoke] (/Users/sduball/LocalStorage/packages/tool-doc-handsome/node_modules/regenerator-runtime/runtime.js:294:22)

May not be possible at this time, this is the error I receive. This will only affect the intellisense for VSCode, so not a major issue. Will respond back with created issue on @chakra-ui/react if there is not an existing one.

SpencerDuball commented 2 years ago

Related issue on @chakra-ui/react #5219, this appears to be an issue with prettier. This is pretty minor so will not fix this until the prettier issue is resolved, forcing users to downgrade prettier would be a worse experience than not having the typing support.