Based on PRD.md - Created: October 3, 2025
This implementation plan breaks down the Bundle::Namespace plugin development into actionable tasks, organized by phase and priority.
- Gem structure created
- Basic module scaffold exists
- Create plugin registration system
-
lib/bundle/namespace/plugin.rb- Main plugin class -
lib/bundle/namespace/hooks.rb- Bundler hook integration - Register with Bundler plugin system
-
-
lib/bundle/namespace/dependency_extension.rb- Extend Bundler::Dependency -
lib/bundle/namespace/registry.rb- Track namespace mappings -
lib/bundle/namespace/errors.rb- Custom error classes
-
lib/bundle/namespace/dsl_extension.rb- Add namespace macro- Implement
namespace(*namespaces, &block)method - Track namespace stack with
@namespaces - Modify dependency creation to include namespace metadata
- Support both block syntax and option syntax
- Implement
-
spec/bundle/namespace/dsl_extension_spec.rb- DSL tests -
spec/bundle/namespace/registry_spec.rb- Registry tests -
spec/bundle/namespace/dependency_extension_spec.rb- Dependency tests
-
lib/bundle/namespace/source_extensions.rb- Extend Bundler::Source::Rubygems
- Implement namespace-aware spec lookups
- Add namespace path construction (//)
- Implement namespace detection for sources
-
lib/bundle/namespace/resolver_extension.rb- Extend Bundler::Resolver
- Modify package identification to include namespace
- Update version filtering logic
- Add conflict detection for namespaced gems
-
lib/bundle/namespace/specification_extension.rb- Track namespace in gem specifications
- Modify spec comparison to include namespace
-
spec/integration/namespace_resolution_spec.rb -
spec/integration/source_namespace_spec.rb
-
lib/bundle/namespace/lockfile_generator.rb- Create YAML structure (source -> namespace -> gem)
- Generate bundle-namespace-lock.yaml
- Hook into Bundler's lockfile generation
-
lib/bundle/namespace/lockfile_parser.rb- Parse YAML lockfile
- Validate structure
- Merge namespace data into resolution
-
lib/bundle/namespace/lockfile_validator.rb- Check consistency between Gemfile, Gemfile.lock, and namespace lockfile
- Detect stale namespace entries
- Warn on conflicts
-
spec/integration/lockfile_generation_spec.rb -
spec/integration/lockfile_parsing_spec.rb
- Implement all error classes from errors.rb
- Add helpful error messages
- Create error recovery strategies
-
lib/bundle/namespace/configuration.rb- Support .bundle/config integration
- Implement strict_mode
- Implement warn_on_missing
- Custom lockfile path
- Update README.md with usage examples
- Add YARD documentation to all public APIs
- Create USAGE.md with detailed examples
- Add inline code comments
- Profile namespace checking overhead
- Optimize hot paths
- Add benchmarking suite
- Version 0.1.0 release
- Announce to community
- Gather feedback
- Update gemspec with proper metadata
- Create error classes
- Create registry class
- Create plugin registration
- Implement DSL extension module
- Add namespace tracking
- Support both syntaxes (block and option)
- Write tests
- Extend dependency to store namespace
- Update dependency comparison
- Write tests
- Wire up plugin to Bundler
- Test basic namespace declaration
- Verify no breakage of existing functionality
lib/bundle/namespace/
├── version.rb (exists)
├── plugin.rb (new) - Main plugin entry point
├── hooks.rb (new) - Bundler hook registration
├── errors.rb (new) - Custom error classes
├── registry.rb (new) - Namespace tracking
├── configuration.rb (new) - Plugin configuration
├── dsl_extension.rb (new) - Gemfile DSL enhancement
├── dependency_extension.rb (new) - Dependency enhancement
├── source_extensions.rb (new) - Source enhancements
├── resolver_extension.rb (new) - Resolver enhancement
├── specification_extension.rb (new) - Spec enhancement
├── lockfile_generator.rb (new) - YAML lockfile generation
├── lockfile_parser.rb (new) - YAML lockfile parsing
└── lockfile_validator.rb (new) - Lockfile validation
spec/bundle/namespace/
├── namespace_spec.rb (exists)
├── dsl_extension_spec.rb (new)
├── registry_spec.rb (new)
├── dependency_extension_spec.rb (new)
├── lockfile_generator_spec.rb (new)
└── ... (more test files)
spec/integration/
├── namespace_resolution_spec.rb (new)
├── lockfile_generation_spec.rb (new)
└── ... (more integration tests)
# In gemspec
spec.add_dependency("bundler", ">= 2.3.0")
# Development dependencies
spec.add_development_dependency("rspec", "~> 3.12")
spec.add_development_dependency("rake", "~> 13.0")
spec.add_development_dependency("rubocop", "~> 1.50")
spec.add_development_dependency("yard", "~> 0.9")- Test each module in isolation
- Mock Bundler internals
- 95%+ coverage target
- Use actual Gemfile processing
- Test with mock gem servers
- Verify lockfile generation
- Test with Bundler 2.3.x, 2.4.x, 2.5.x
- Test with Ruby 2.7, 3.0, 3.1, 3.2, 3.3
- Plugin loads without errors
- DSL namespace block can be parsed
- Dependencies track namespace metadata
- Tests pass
- Namespaced gems can be resolved (with mock source)
- Non-namespaced gems still work
- Namespace conflicts are detected
- bundle-namespace-lock.yaml is generated
- Lockfile is parsed correctly
- Validation detects inconsistencies
- All tests pass
- Documentation complete
- Performance impact < 5%
- Beta release published
Next Steps: Begin Phase 1 implementation starting with gemspec update and core infrastructure.