Replace gobuffalo/meta dependency with minimal internal/meta package#2425
Merged
paganotoni merged 5 commits intomainfrom Mar 20, 2026
Merged
Replace gobuffalo/meta dependency with minimal internal/meta package#2425paganotoni merged 5 commits intomainfrom
paganotoni merged 5 commits intomainfrom
Conversation
This change removes the external gobuffalo/meta dependency and replaces it with a minimal internal implementation. The internal package contains only the functionality Buffalo actually uses: - App.Root - project root directory - App.WithPop - detects database.yml presence - BuildTags - type alias for plugin build tags Benefits: - Removes transitive dependency on gobuffalo/envy - Smaller dependency tree (meta -> envy -> flect + go-internal) - ~38 lines of internal code vs 400+ lines of external dependencies - Same API, zero external dependencies
The internal/meta package now fully replicates the behavior of the original gobuffalo/meta package: - First attempts to load metadata from config/buffalo-app.toml - Falls back to auto-detection if the file doesn't exist - Auto-detection checks for database.yml to set WithPop - App struct now includes all fields from the original: Name, Bin, VCS, WithPop, WithSQLite, WithWebpack, WithNodeJs, WithYarn, WithDocker, WithGrifts, AsWeb, AsAPI
Reduced App struct from 12 fields to only the 2 fields actually used: - Root: for locating config files and plugins folder - WithPop: for auto-adding buffalo-pop plugin The TOML decoder ignores extra fields in buffalo-app.toml, so parsing still works correctly with the minimal struct. This keeps the package focused on its single purpose: supporting the plugin system.
The fileExists helper was only used once, so inline it to reduce the package to a single exported function. The logic is clearer: - Check for TOML config file - If WithPop not set from TOML, check for database.yml
- Added comprehensive tests for New() function - Added TOML struct tags for snake_case field names (with_pop) - Fixed TOML priority logic to return early when config exists - TOML config now takes full precedence over auto-detection
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.
This change removes the external gobuffalo/meta dependency and replaces it
with a minimal internal implementation. The internal package contains only
the functionality Buffalo actually uses:
Benefits: