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

@pandacss/config package includes node_modules #705

Closed yukukotani closed 1 year ago

yukukotani commented 1 year ago

Description

The distribution of @pandacss/config includes node_modules directory which contains preset-base and preset-panda. Those packages depend on @pandacss/types with version workspace:* and it causes the error below on npm i.

npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*

ref: https://www.npmjs.com/package/@pandacss/config/v/0.3.1?activeTab=code

Link to Reproduction

https://www.npmjs.com/package/@pandacss/config/v/0.3.1?activeTab=code

Steps to reproduce

  1. npx create-next-app@latest --use-npm
  2. npm install -D @pandacss/dev

JS Framework

No response

Panda CSS Version

0.3.1

Browser

No response

Operating System

Additional Information

No response

segunadebayo commented 1 year ago

@astahmer Could this be because of the bundledDependencies field in package.json?

Can we get rid of it?

astahmer commented 1 year ago

Can't say for sure as I didnt try it yet (i'm away this weekend) but this might be the issue yes

The point of having bundledDependencies here is to make the extension working in the IDE even if a user didnt yet install node_modules (with pnpm i or something similar) in the opened workspace

But I also remember putting that bundledDependencies directly in the vscode package at some point so, we will have to test it to confirm that this one (in the config package) is necessary


in the meantime, since in the npmrc we already have those:

link-workspace-packages=true
prefer-workspace-packages=true

another fix might be to use versions instead of workspace dependencies

segunadebayo commented 1 year ago

Removed the bundledDependencies from the config package since it's already listed in the vscode package