Skip to content

Commit

Permalink
chore: some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bekacru committed Jul 5, 2023
1 parent d4c7ebc commit 1617aa7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cli/src/utils/get-initial-values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const getInitialValues = async () => {
const cssDir = stylesDir ?? dir
const css = (await findCssFile(cssDir)) ?? "globals.css"
const paths = tsconfig?.compilerOptions?.paths
//find the alias for dir TODO://if there is no ts alias like @ we need to handle it better this is not ideal workaround
const alias = paths
? Object.keys(paths)
.find((key) => paths[key].toString().includes(dir))
Expand All @@ -17,7 +18,6 @@ export const getInitialValues = async () => {
"@"
: dir.replace(".", "")
const twConfig = await findTwConfig("./")

return {
DEFAULT_TAILWIND_CSS: `${cssDir}/${css}`,
DEFAULT_COMPONENTS: `${alias}/components`,
Expand All @@ -28,6 +28,7 @@ export const getInitialValues = async () => {
}
}

//find common global css files
const findCssFile = async (dir: string) => {
const files = await fs.readdir(dir || "./")
return files.find((file) => {
Expand Down

0 comments on commit 1617aa7

Please sign in to comment.