sveltejs / svelte-preprocess

A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
MIT License
1.73k stars 147 forks source link

chore(deps): update stylus to 0.59.0 #553

Closed katriellucas closed 3 weeks ago

katriellucas commented 1 year ago

Is your feature request related to a problem? Please describe. Level 4 CSS selector do not work on Stylus 0.55.0, (this was added on 0.58.0), since Stylus didn't reach 1.0 yet, major versions are still in middle numbers and being ignored, as of now, there is already a year gap since the latest release.

Describe the solution you'd like Update Stylus to 0.59.0

Describe alternatives you've considered There is no alternative solutions, it just has to be updated, maybe add support for minor versions?

How important is this feature to you? Note: Important, level 4 selector are used in part of my components, they don't work without them.

Additional context Nothing to add.

kaisermann commented 1 year ago

Hey @katriellucas 👋 we don't force a specific stylus version. stylus is defined as a peer dependency with the semver range: ^0.55.0. This should allow you to install 0.59.0 without problems. What kind of issue are you having?

woutdp commented 1 year ago

I'm experiencing the same issue.

Caret (^) doesn't apply the same way to major version 0 the same way as it does to 1 or above major versions. Here's an article about it: https://michaelsoolee.com/npm-pre-1-caret-rules/

Error output:

~ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: svelte-preprocess@4.10.7
npm ERR! Found: stylus@0.59.0
npm ERR! node_modules/stylus
npm ERR!   dev stylus@"^0.59.0" from the root project
npm ERR!   peerOptional stylus@"*" from vite@4.0.2
npm ERR!   node_modules/vite
npm ERR!     dev vite@"^4.0.2" from the root project
npm ERR!     peer vite@"^4.0.0" from @sveltejs/kit@1.0.1
npm ERR!     node_modules/@sveltejs/kit
npm ERR!       dev @sveltejs/kit@"^1.0.1" from the root project
npm ERR!       1 more (@sveltejs/adapter-node)
npm ERR!     2 more (@sveltejs/vite-plugin-svelte, vitefu)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional stylus@"^0.55.0" from svelte-preprocess@4.10.7
npm ERR! node_modules/svelte-preprocess
npm ERR!   dev svelte-preprocess@"^4.10.7" from the root project
npm ERR!   svelte-preprocess@"^4.0.0" from svelte-check@2.10.2
npm ERR!   node_modules/svelte-check
npm ERR!     dev svelte-check@"^2.10.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: stylus@0.55.0
npm ERR! node_modules/stylus
npm ERR!   peerOptional stylus@"^0.55.0" from svelte-preprocess@4.10.7
npm ERR!   node_modules/svelte-preprocess
npm ERR!     dev svelte-preprocess@"^4.10.7" from the root project
npm ERR!     svelte-preprocess@"^4.0.0" from svelte-check@2.10.2
npm ERR!     node_modules/svelte-check
npm ERR!       dev svelte-check@"^2.10.2" from the root project
dummdidumm commented 1 year ago

PR for this welcome! The one doing that should manually check that the latest stylus version still works with our preprocessor API, and if so, change the peerDependency to >=0.55