feat: handle user style existence#1700
Merged
Merged
Conversation
Coverage Report for CI Build 25589227347Coverage decreased (-1.1%) to 72.664%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
This PR refactors how userStyle is injected into the client bundle by generating a dedicated internal temp module (@internal/userStyle) and importing it from the client entry, while also adding a dev watcher to update that temp module when the style file is created or deleted.
Changes:
- Add
prepareUserStyle()to generateinternal/userStyle.jsonly importing the user style when the file exists. - Switch the client entry to always import
@internal/userStyle, and remove the previoususerStyleimport injection from the client-configs temp entry. - Add a dev-mode watcher to re-generate the user-style temp module on add/unlink events.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/app/prepare/prepareUserStyle.ts | New temp file generator for @internal/userStyle, with existence check. |
| packages/core/src/app/prepare/prepareClientConfigs.ts | Removes prior userStyle import injection from the client-configs entry. |
| packages/core/src/app/prepare/index.ts | Exports the new prepareUserStyle() helper. |
| packages/client/src/types/internal/userStyle.d.ts | Adds type declaration for the new @internal/userStyle module. |
| packages/client/src/app.ts | Adds side-effect import of @internal/userStyle from the client entry. |
| packages/cli/src/commands/dev/watchUserStyleFile.ts | New chokidar watcher to re-run prepareUserStyle() on style file add/unlink. |
| packages/cli/src/commands/dev/index.ts | Exports the new watcher helper. |
| packages/cli/src/commands/dev/dev.ts | Registers the user-style watcher when app.options.userStyle is set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
meteorlxy
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ecosystem is planning to decouple user style logic from palette plugins, so now user style file updates should be handled in core.