-
Notifications
You must be signed in to change notification settings - Fork 353
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(builder): improve the logs of checkSyntax, add code frame #4578
Conversation
🦋 Changeset detectedLatest commit: 7d540be The changes in this PR will be included in the next version bump. This PR includes changesets to release 254 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #4578 +/- ##
==========================================
- Coverage 57.59% 53.85% -3.75%
==========================================
Files 672 657 -15
Lines 17794 17985 +191
Branches 3876 4149 +273
==========================================
- Hits 10249 9685 -564
- Misses 6934 7644 +710
- Partials 611 656 +45 ☔ View full report in Codecov by Sentry. |
Summary
Old:
New:
🤖 Generated by Copilot at e9e235b
This pull request improves the
CheckSyntaxPlugin
in the@modern-js/builder-shared
and@modern-js/builder
packages by adding colors, symbols, and code frames to the error logs. It also refactors some code to use constants and relative filepaths. It updates the tests and the documentation to reflect the changes.Details
🤖 Generated by Copilot at e9e235b
@modern-js/builder-shared
and@modern-js/builder
packages (link)HTML_REGEX
andJSON_REGEX
constants toconstants.ts
and use them infallback.ts
to exclude HTML and JSON files from theresourceRuleFallback
function (link, link, link)CheckSyntaxPlugin
by using thechalk
module, themakeCodeFrame
function, and therootPath
parameter ingenerateError.ts
,printErrors.ts
, andindex.ts
(link, link, link, link, link, link, link, link, link)makeCodeFrame
function inCheckSyntaxPlugin.test.ts
and use thetoMatchInlineSnapshot
method to compare the output (link, link)rootPath
property from theapi.context.rootPath
value to thebuilderPluginCheckSyntax
function call incheckSyntax.ts
(link)checkSyntax.md
(link, link)Related Issue
Checklist
pnpm run change
.