Skip to content

Commit

Permalink
fix(cli): resolve ts-config from dirname
Browse files Browse the repository at this point in the history
  • Loading branch information
TimKolberger committed Oct 3, 2021
1 parent e1b2034 commit 236efcb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/loud-poets-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@chakra-ui/cli": patch
---

Fixed an issue where the CLI failed with
`SyntaxError: JSON5: invalid character`.
3 changes: 2 additions & 1 deletion tooling/cli/src/scripts/read-theme-file.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ async function importTheme(path: string) {
async function readTheme(themeFilePath: string) {
const cwd = process.cwd()
const absoluteThemePath = path.join(cwd, themeFilePath)
const absoluteThemeDir = path.dirname(absoluteThemePath)

const tsConfig = tsConfigPaths.loadConfig(absoluteThemePath)
const tsConfig = tsConfigPaths.loadConfig(absoluteThemeDir)
if (tsConfig.resultType === "success") {
tsNode.register({
// use the TS projects own tsconfig file
Expand Down

0 comments on commit 236efcb

Please sign in to comment.