Skip to content

feat: handle user style existence#1700

Merged
meteorlxy merged 3 commits into
mainfrom
user-style-improvement
May 14, 2026
Merged

feat: handle user style existence#1700
meteorlxy merged 3 commits into
mainfrom
user-style-improvement

Conversation

@Mister-Hope
Copy link
Copy Markdown
Member

@Mister-Hope Mister-Hope commented May 9, 2026

Ecosystem is planning to decouple user style logic from palette plugins, so now user style file updates should be handled in core.

Copilot AI review requested due to automatic review settings May 9, 2026 02:11
@coveralls
Copy link
Copy Markdown

coveralls commented May 9, 2026

Coverage Report for CI Build 25589227347

Coverage decreased (-1.1%) to 72.664%

Details

  • Coverage decreased (-1.1%) from the base build.
  • Patch coverage: 17 uncovered changes across 3 files (2 of 19 lines covered, 10.53%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
packages/cli/src/commands/dev/watchUserStyleFile.ts 9 1 11.11%
packages/core/src/app/prepare/prepareUserStyle.ts 8 1 12.5%
packages/cli/src/commands/dev/dev.ts 2 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1053
Covered Lines: 762
Line Coverage: 72.36%
Relevant Branches: 520
Covered Branches: 381
Branch Coverage: 73.27%
Branches in Coverage %: Yes
Coverage Strength: 43.89 hits per line

💛 - Coveralls

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 generate internal/userStyle.js only importing the user style when the file exists.
  • Switch the client entry to always import @internal/userStyle, and remove the previous userStyle import 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.

Comment thread packages/core/src/app/prepare/index.ts
Comment thread packages/core/src/app/prepare/prepareUserStyle.ts Outdated
Comment thread packages/client/src/app.ts
Comment thread packages/cli/src/commands/dev/watchUserStyleFile.ts Outdated
@Mister-Hope Mister-Hope requested a review from meteorlxy May 9, 2026 02:32
@meteorlxy meteorlxy merged commit 0080107 into main May 14, 2026
18 checks passed
@meteorlxy meteorlxy deleted the user-style-improvement branch May 14, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants