feat: add bootstrapFunctions, Svelte support, and fix broken exports#9
Merged
Conversation
- Implement bootstrapFunctions option to sort class strings inside function calls like clsx(), cn(), classNames() - Add Svelte parser support (Svelte 4 & 5 AST structures) - Add format:check script and CI step - Limit Dependabot to github-actions only (npm handled by Renovate) - Add 100% coverage thresholds in vitest config - Add snapshot tests for full formatting output verification - Update README with Svelte docs and bootstrapFunctions example Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 4 4
Lines 426 549 +123
Branches 57 82 +25
==========================================
+ Hits 426 549 +123 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The exports field pointed to ./dist/index.js but tsdown produces ./dist/index.mjs. This caused import failures for consumers. Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
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.
Summary
exports.".".importfield pointed to./dist/index.jsbut the build produces./dist/index.mjs— consumers couldn't import the packagebootstrapFunctionsoption to sort class strings inside function calls likeclsx(),cn(),classNames()svelteparser that handles both Svelte 4 and Svelte 5 AST structuresformat:checkstep, limit Dependabot togithub-actionsonly, enforce 100% coverage thresholdsChanges
package.jsonindex.js→index.mjs), addformat:checkscriptsrc/traversal.tssortStringNodehelper,processJsxAstCallExpression handling,walkSvelte+processSvelteAstsrc/index.tsbootstrapFunctionsoption, registersvelteparser.github/dependabot.ymlnpmecosystem (Renovate handles it).github/workflows/ci.ymlFormat checkstepvitest.config.tstests/snapshot.test.ts, expandedcoverage.test.tsande2e.test.tsREADME.mdbootstrapFunctionsexampleTest plan
pnpm run lint— passespnpm run typecheck— passespnpm run format:check— passespnpm run test:coverage— 88 tests, 100% coveragepnpm run build && pnpm publish --dry-run— builds correctlynode -e "import('prettier-plugin-bootstrap')"— import works after fix