chakra-ui / panda

🐼 Universal, Type-Safe, CSS-in-JS Framework for Product Teams ⚡️
https://panda-css.com
MIT License
5.23k stars 236 forks source link

Incorrect path when using `forceConsistentTypeExtension` #1670

Closed jasisk closed 1 year ago

jasisk commented 1 year ago

Description

When I run codegen with a config enabling forceConsistentTypeExtension, the composition.d.mts ends up referencing an invalid path.

Specifically, in styled-system/types/composition.d.mts here:

/* eslint-disable */
import type {  CompositionStyleObject  } from './system-types.d.mts';
import type {  Token  } from '../tokens.d.mts';
//                            ^-- Cannot find module "../tokens.d.mts' or its corresponding type declarations.

Strangely, that same file is imported in styled-system/types/patterns.d.mts here but results in the following:

import type {  TokenCategory  } from '../tokens/index.d.mts';

... which does exist.

Link to Reproduction

https://stackblitz.com/~/github.com/jasisk/pandacss-bug

Steps to reproduce

  1. add "forceConsistentTypeExtension": true to panda.config.ts
  2. run panda codegen
  3. inspect ./styled-system/types/composition.d.mts

Attached demo repository is vanilla create-vite + panda with the appropriately reproducing panda config.

JS Framework

React (TS)

Panda CSS Version

0.18.2

Browser

N/A

Operating System

Additional Information

No response

segunadebayo commented 1 year ago

Good catch @jasisk

I just pushed a fix for this. We'll release an update shortly.

If the issue persists after upgrading, I'll re-open it.