-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: simplify UnoCSS integration #270
feat!: simplify UnoCSS integration #270
Conversation
BREAKING CHANGES: - `@tutorialkit/astro` package no longer exports `unoCSSConfig`. Use `defineConfig` from `@tutorialkit/theme` instead. - `@tutorialkit/theme` package no longer exports `rules`, `shortcuts` and `theme`. - `@tutorialkit/theme` package exports `transitionTheme` from new entrypoint: `@tutorialkit/theme/transition-theme`.
Run & review this pull request in StackBlitz Codeflow. |
@Nemikolh what do you think about adding https://pkg.pr.new to TutorialKit? Verifying changes like this would be really great if I could use real published packages. Relying on linked ( |
Oh that would be really cool! I like a lot that idea 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wooow, impressive work! This looks insanely good. 😍
Good job 😃
@@ -47,7 +49,14 @@ export function extraIntegrations() { | |||
mdx(), | |||
UnoCSS({ | |||
configDeps: ['./theme.ts'], | |||
injectReset: true, | |||
injectReset: createRequire(root).resolve('@unocss/reset/tailwind.css'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I'm curious: why is the root needed? Is it because @unocss/reset
is not a dependency of @tutorialkit/astro
?
What about we add it as a dependency?
Or we could also keep the true
value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that is strange, could that be a bug in the unocss astro integration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also mentioned on UnoCSS:
Now that we don't require end-users (or template) to add @unocss/reset
as their dependency, it's likely causing a hoisting issue here, like mentioned on the issue. Using require.resolve
solves this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, thanks for the clarification!
This comment was marked as outdated.
This comment was marked as outdated.
/pkg-pr-new |
Changes of this PR are now deployed and running at AriPerkkio/tutorial-vite-plugin#21. @Nemikolh I'm trying to think of all kinds of scenarios that should be tested there, mainly focusing on trying to see that user's own |
@AriPerkkio Not that I can think of! We can always fix them later once we encounter them. Let's move forward with this PR |
This reverts commit 8d49ef8.
unoCSSConfig
from@tutorialkit/astro
#244Moves all configuration from
uno.config.ts
behind@tutorialkit/theme
and@tutorialkit/astro
packages. Users are no-longer needed to have complexuno.config.ts
files in their projects. In cases like #184 we no longer need to instruct users to modify theiruno.config.ts
- we can actually apply these in@tutorialkit
packages and just release them.Adds a custom
defineConfig
to@tutorialkit/theme
, that can be used to configure TutorialKit theme and add additional UnoCSS configurations:UnoCSS VS Code extension still works as expected:
Migration guide for projects:
In your
package.json
:In your
uno.config.ts
:BREAKING CHANGES:
@tutorialkit/astro
package no longer exportsunoCSSConfig
. UsedefineConfig
from@tutorialkit/theme
instead.@tutorialkit/theme
package no longer exportsrules
,shortcuts
andtheme
.@tutorialkit/theme
package exportstransitionTheme
from new entrypoint:@tutorialkit/theme/transition-theme
.