feat: ecosystem improvements — public API, new options, CJS, regex attrs#12
Merged
Conversation
2ebeba8 to
9e1710c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 5 +1
Lines 549 635 +86
Branches 82 104 +22
=========================================
+ Hits 549 635 +86 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9e1710c to
ae0f028
Compare
- Public sorting API via `prettier-plugin-bootstrap/sorter` with `createSorter()` - New options: bootstrapPreserveWhitespace, bootstrapPreserveDuplicates, bootstrapVersion - Regex pattern support in bootstrapAttributes (e.g. `/^data-class/`) - File-level ignore comment (`prettier-bootstrap-ignore`) - Dual ESM+CJS build output - Prettier version matrix in CI (3.0.0 + latest) - Test fixtures with snapshot testing - Expanded README: Why section, Plugin Compatibility, TypeScript config, FAQ - FUNDING.yml for GitHub Sponsors Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
ae0f028 to
add9e36
Compare
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
Comprehensive feature release bringing the plugin in line with ecosystem best practices observed in popular Prettier plugins (tailwindcss, svelte, astro, organize-imports, sort-imports).
New Features
import { createSorter } from 'prettier-plugin-bootstrap/sorter'for programmatic use in linters, codemods, and build toolsbootstrapPreserveWhitespace— preserve original multi-space/tab separators between classesbootstrapPreserveDuplicates— set tofalseto remove duplicate class namesbootstrapAttributes— patterns like/^data-class/match dynamic attribute names<!-- prettier-bootstrap-ignore -->skips sorting for an entire filebootstrapVersion— declared option for future version-specific sorting rulesInfrastructure
3.0.0+ latest3.x)FUNDING.ymlfor GitHub SponsorsDocumentation
Stats
Test plan
pnpm run lint— cleanpnpm run format:check— cleanpnpm run typecheck— cleanpnpm run test:coverage— 121 tests, 100% coveragepnpm run build— produces index.mjs, index.cjs, sorter.mjs, sorter.cjs + type declarationsnode -e "import('./dist/index.mjs')"— OKnode -e "require('./dist/index.cjs')"— OKnode -e "import('./dist/sorter.mjs')"— OKpnpm publish --dry-run— valid package