PwaManifestGenerator
A Rails engine and gem for generating and managing PWA (Progressive Web App) manifests with advanced configuration, validation, and Rails generator support.
Features
- Strongly-typed manifest builder with validation
- Rails generator to install and override
pwa/manifest.json.erb
- Supports all modern PWA manifest fields, including advanced keys (shortcuts, screenshots, edge_side_panel, etc.)
- Extensible and testable Ruby code
Installation
Add this line to your application's Gemfile:
gem 'pwa_manifest_generator', github: 'Dandush03/pwa_manifest_generator'
And then execute:
bundle install
Usage
Rails Setup
Run the install generator to copy the manifest template:
bin/rails generate pwa_manifest_generator:install
This will override app/views/pwa/manifest.json.erb
with a template that uses your Rails config.
Configuration Example
In an initializer (e.g. config/initializers/pwa.rb
):
PwaManifestGenerator::Builder.config do |pwa|
pwa.name = 'My App'
pwa.short_name = 'App'
pwa.start_url = '/'
end
Manifest Template
The generated manifest.json.erb
will use your configuration and output a valid PWA manifest.
Development
After checking out the repo, run bin/setup
to install dependencies. Run tests with:
rake test
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Dandush03/pwa_manifest_generator.
License
MIT License. See LICENSE.txt for details.