Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Formatter Laravel Package

phug/formatter

A formatting extension for Phug, the PHP Pug template engine. It pretty-prints and normalizes Pug source with configurable options, helping keep templates readable and consistent in Laravel and PHP projects.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature scoping for a template-authoring experience. If the roadmap includes a Pug/Jade template editor, preview surface, or CMS theme builder on a PHP stack, this package answers the "do we need to write a formatter?" question with "no." It converts the formatting requirement from a multi-sprint build into a dependency decision.
  • Build vs. buy (and vs. fork). The formatter is a narrow, well-bounded capability — normalizing Pug/AST-derived output — that is entirely non-differentiating for most products. Default position should be adopt over build, with the caveat that the tiny footprint (2 stars, 0 dependents) means budgeting for a vendored fork rather than assuming upstream support.
  • Diff and review noise reduction. Deterministic formatting of generated markup/templates makes snapshot tests, PR diffs, and code review across template changes meaningful again. This is a measurable developer-experience win and a plausible OKR line item for a platform team.
  • CI and linting integration. A formatter is the prerequisite for a "format check" step in CI alongside static analysis. This supports a roadmap item like "template quality gates" that would otherwise be blocked.
  • Interoperability with the Phug ecosystem. Adopting it is only rational as part of a broader Phug commitment; it strengthens the case for consolidating template rendering on Phug rather than mixing engines, which is itself a maintainability decision worth making explicitly.

When to Consider This Package

Adopt when all of the following hold:

  • The product already renders Pug/Jade templates through Phug (or is committed to doing so); the formatter is only useful inside that AST pipeline.
  • You need formatting as an internal tool — CI checks, editor integrations, migration scripts, snapshot normalization — rather than a user-facing feature with support expectations.
  • You are comfortable with an MIT-licensed dependency that has effectively zero community surface: no dependents, single-digit stars. Treat it as source you are adopting, not a vendor you are relying on, and plan to pin the version and keep a fork path open.
  • The release cadence (last release 2026-03-15) matters more to you than the star count — recent activity is the main signal that it is not abandoned.

Look elsewhere when:

  • Your templates are HTML/Twig/Blade rather than Pug — Prettier or the ecosystem-native formatter is the obvious answer, and this package offers nothing.
  • You need a formatter inside a JS/Node toolchain rather than a PHP one; the language boundary cost will exceed the benefit.
  • You require SLAs, security response commitments, or a maintainer you can escalate to — none of that exists here at 2 stars and 0 dependents.
  • Formatting is a shipped product feature (e.g., a customer-facing "format my template" button). The low opportunity score and thin adoption make it a poor foundation for anything users will file bugs against; in that case, wrap it thinly behind your own interface so it can be swapped.
  • The formatting output is expected to be byte-stable across versions — verify this yourself before committing; do not assume upstream compatibility guarantees exist.

How to Pitch It (Stakeholders)

To executives: A small, free (MIT) open-source component that removes a "nice-to-have" build from the roadmap. It normalizes template code so reviews, automated checks, and historical diffs stop generating noise. Cost is a dependency and a few days of integration, not a project. The risk is low and contained — it is a leaf utility, not infrastructure — and because it is MIT and small, we can vendor it outright if the maintainer ever stops.

To engineering: It slots into the existing Phug AST pipeline, so there is no new rendering model to learn. We get deterministic formatting for CI format-checks and snapshot tests. Be clear-eyed about the trade: near-zero adoption means near-zero upstream support, so we pin the version, wrap it behind our own formatter interface, and accept ownership of a fork if needed. If we are not already on Phug, this is not a reason to get on it.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel