Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theming.types.d.ts generated by CLI not being loaded? #8430

Open
1 of 3 tasks
0x33dm opened this issue Apr 11, 2024 · 2 comments
Open
1 of 3 tasks

theming.types.d.ts generated by CLI not being loaded? #8430

0x33dm opened this issue Apr 11, 2024 · 2 comments

Comments

@0x33dm
Copy link

0x33dm commented Apr 11, 2024

Description

When i run $chakra-cli tokens path/to/theme, i expected to get intellisense on VSCode but i don't.

The CLI simply says "✨ Done in 0.83s." but nothing changes on my project.

I checked the file node_modules/@chakra-ui/styled-system/dist/theming.types.d.ts and it has been updated with the tokens from my theme.

Also nothing on my git three changed ( as the file is changed inside of node_modules which is ignored ) so if i update the theme and commit to git none of my team mates will get Intellisense unless they run the command again manually on their side.

Moreover, I believe this file is supposed to be loaded somewhere ( and it wasn't i believe because i started from the next.js with chakra-ui example on their repository and it might be out of data? ), so i set it to be included in my tsconfig.json.

Perhaps the CLI should check the tsconfig.json file and see if the theme is added somehow?

Here is how my tsconfig.json looks like:

#tsconfig.json

  "include": [
    "next-env.d.ts",
    "node_modules/@chakra-ui/styled-system/dist/theming.types.d.ts",
    "**/*.ts",
    "**/*.tsx"
  ],

and also changed my exclude rule to be like so:

#tsconfig.json

  "exclude": [
    "node_modules",
    "!node_modules/@chakra-ui/styled-system/dist/theming.types.d.ts"
  ]

and it doesn't work. even if i remove completely the "exclude" property from my tsconfig.json i can't get Intellisense for the tokens.

Link to Reproduction

https://codesandbox.io/p/sandbox/cold-cdn-kd9sgg?file=%2Fsrc%2Findex.tsx%3A7%2C39&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522cluvgd93t00062v6jugpg2sip%2522%252C%2522sizes%2522%253A%255B100%252C0%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522cluvgd93t00022v6jp4dna6ng%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522cluvgd93t00032v6j9wk98u29%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522cluvgd93t00052v6jjs0usw7o%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522cluvgd93t00022v6jp4dna6ng%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522cluvgd93t00012v6jksiaq5m8%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252Fsrc%252Findex.tsx%2522%252C%2522state%2522%253A%2522IDLE%2522%252C%2522initialSelections%2522%253A%255B%257B%2522startLineNumber%2522%253A7%252C%2522startColumn%2522%253A39%252C%2522endLineNumber%2522%253A7%252C%2522endColumn%2522%253A39%257D%255D%257D%255D%252C%2522id%2522%253A%2522cluvgd93t00022v6jp4dna6ng%2522%252C%2522activeTabId%2522%253A%2522cluvgd93t00012v6jksiaq5m8%2522%257D%252C%2522cluvgd93t00052v6jjs0usw7o%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522cluvgd93t00042v6jto5uv3a1%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A0%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522id%2522%253A%2522cluvgd93t00052v6jjs0usw7o%2522%252C%2522activeTabId%2522%253A%2522cluvgd93t00042v6jto5uv3a1%2522%257D%252C%2522cluvgd93t00032v6j9wk98u29%2522%253A%257B%2522tabs%2522%253A%255B%255D%252C%2522id%2522%253A%2522cluvgd93t00032v6j9wk98u29%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Afalse%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

Steps to reproduce

I'm testing it instance when filling the prop 'color' for @chakra-ui/react/Text component.

Chakra UI Version

2.8.2

Browser

Chrome / VSCode

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

@veloware
Copy link

veloware commented Apr 12, 2024

Have you tried -

image

I have to do this in webstorm sometimes before the tokens will be picked up

Also nothing on my git three changed ( as the file is changed inside of node_modules which is ignored ) so if i update the theme and commit to git none of my team mates will get Intellisense unless they run the command again manually on their side.

You could setup a dependencies script (https://docs.npmjs.com/cli/v10/using-npm/scripts#dependencies) that would run the CLI?

@0x33dm
Copy link
Author

0x33dm commented Apr 12, 2024

Have you tried -

image I have to do this in webstorm sometimes before the tokens will be picked up

Also nothing on my git three changed ( as the file is changed inside of node_modules which is ignored ) so if i update the theme and commit to git none of my team mates will get Intellisense unless they run the command again manually on their side.

You could setup a dependencies script (https://docs.npmjs.com/cli/v10/using-npm/scripts#dependencies) that would run the CLI?

i have tried and it didn't work, it doesn't work for me even for the default tokens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants