Skip to content

feat: add bootstrapFunctions, Svelte support, and fix broken exports#9

Merged
pierluigilenoci merged 2 commits into
mainfrom
feat/improvements-and-fixes
May 2, 2026
Merged

feat: add bootstrapFunctions, Svelte support, and fix broken exports#9
pierluigilenoci merged 2 commits into
mainfrom
feat/improvements-and-fixes

Conversation

@pierluigilenoci

@pierluigilenoci pierluigilenoci commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • fix(exports): The exports.".".import field pointed to ./dist/index.js but the build produces ./dist/index.mjs — consumers couldn't import the package
  • bootstrapFunctions: Implement the bootstrapFunctions option to sort class strings inside function calls like clsx(), cn(), classNames()
  • Svelte support: Add svelte parser that handles both Svelte 4 and Svelte 5 AST structures
  • CI improvements: Add format:check step, limit Dependabot to github-actions only, enforce 100% coverage thresholds

Changes

Area What
package.json Fix exports path (index.jsindex.mjs), add format:check script
src/traversal.ts sortStringNode helper, processJsxAst CallExpression handling, walkSvelte + processSvelteAst
src/index.ts Wire bootstrapFunctions option, register svelte parser
.github/dependabot.yml Remove npm ecosystem (Renovate handles it)
.github/workflows/ci.yml Add Format check step
vitest.config.ts Add 100% coverage thresholds
tests/ New snapshot.test.ts, expanded coverage.test.ts and e2e.test.ts
README.md Document Svelte support and bootstrapFunctions example

Test plan

  • pnpm run lint — passes
  • pnpm run typecheck — passes
  • pnpm run format:check — passes
  • pnpm run test:coverage — 88 tests, 100% coverage
  • pnpm run build && pnpm publish --dry-run — builds correctly
  • node -e "import('prettier-plugin-bootstrap')" — import works after fix

- 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

codecov Bot commented May 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e3c2cbf) to head (633f459).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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>
@pierluigilenoci pierluigilenoci changed the title feat: add bootstrapFunctions, Svelte support, and CI improvements feat: add bootstrapFunctions, Svelte support, and fix broken exports May 2, 2026
@pierluigilenoci pierluigilenoci merged commit 3d7395a into main May 2, 2026
5 checks passed
@pierluigilenoci pierluigilenoci deleted the feat/improvements-and-fixes branch May 2, 2026 17:16
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.

1 participant