cschroeter / park-ui

Beautifully designed components built with Ark UI and Panda CSS that work with a variety of JS frameworks.
https://park-ui.com
MIT License
1.75k stars 75 forks source link

support tsconfig.json references #390

Closed s97712 closed 3 months ago

s97712 commented 4 months ago

Here’s my tsconfig.json file. I’m referencing other configurations, but park-ui isn’t handling it properly.

{
  "files": [],
  "references": [
    {
      "path": "./tsconfig.app.json"
    },
    {
      "path": "./tsconfig.node.json"
    }
  ]
}
Soufou69 commented 4 months ago

Hey, You should check this : #377

Edit: #385 is similar

cschroeter commented 4 months ago

@s97712 @Soufou69

Resolving tsconfig.json might not be the best approach. Instead, if a "valid" tsconfig isn't found, we should prompt the user for a path alias and its resolution.

Example:

"paths": {
  "~/*": ["./src/*"]
}

We can then save the alias and path (value) in park-ui.json.

Updated Park UI Configuration

{
  "$schema": "https://park-ui.com/registry/latest/schema.json",
  "importAlias": "~/*",
  "jsFramework": "react",
  "outputPaths": {
    "componentsDir": "~/components/ui",
    "libDir": "~/lib"
  },
  "paths": {
    "~/*": ["./src/*"]
  }
}
cschroeter commented 3 months ago

@s97712 @Soufou69

I've updated the CLI so that a tsconfig.json is no longer required to install components. This benefits users with setups like nx workspaces that lack a tsconfig.json file.