{"id":20829779,"url":"https://github.com/pdf/bower-vendor","last_synced_at":"2025-05-07T22:10:47.491Z","repository":{"id":8513195,"uuid":"10125672","full_name":"pdf/bower-vendor","owner":"pdf","description":"Vendor the bower assets you want for Ruby on Rails. Inspired by bower-installer.  DEPRECATED: I recommend using rails-assets instead","archived":false,"fork":false,"pushed_at":"2014-04-15T08:41:37.000Z","size":204,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-21T01:20:02.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rails-assets.org","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pdf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-17T14:58:09.000Z","updated_at":"2022-02-01T09:58:28.000Z","dependencies_parsed_at":"2022-08-24T13:39:52.106Z","dependency_job_id":null,"html_url":"https://github.com/pdf/bower-vendor","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdf%2Fbower-vendor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdf%2Fbower-vendor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdf%2Fbower-vendor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdf%2Fbower-vendor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdf","download_url":"https://codeload.github.com/pdf/bower-vendor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252961841,"owners_count":21832197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T23:21:59.621Z","updated_at":"2025-05-07T22:10:47.441Z","avatar_url":"https://github.com/pdf.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED\n\nI recommend using [rails-assets](https://rails-assets.org) instead.\n\n# BowerVendor\n\nVendor the bower assets you want for Ruby on Rails.  Inspired by [bower-installer](https://github.com/blittle/bower-installer).\n\n## Installation\n\nAdd this line to your Rails application's Gemfile:\n\n```ruby\ngem 'bower-vendor'\n```\n\nAnd then execute:\n\n```shell\nbundle\nrails generate bower_vendor:configure\n```\n\n## Usage\n\nAdd bower packages to the `bower.json` file in your Rails root as normal, then\nexecute:\n\n```shell\nrails generate bower_vendor:install\n```\n\nTo automatically vendor files specified by the bower package's `main` attribute\nto the appropriate vendor directory.\n\nFiles are vendored based on file extension under:\n\n`vendor/assets/(javascripts|stylesheets|images|media)/[package-name]`\n\nCurrently supported file extensions are:\n* `javascripts`: `.js` `.coffee`\n* `stylesheets`: `.css` `.scss` `.sass` `.less`\n* `images`: `.gif` `.png` `.jpg` `.svg`\n* `media`: `.*` (everything else)\n\nThe following generators are available:\n\n### Available Generators\n\n`rails generate bower_vendor:install [options]`\n\n    Options:\n      [--update]                    # Update bower assets (ie - `bower update`)\n      [--skip-git-ignore]           # Add vendored bower asset package directories to .gitignore\n      [--force-clean]               # Clean vendored bower assets without prompting\n      [--skip-clean]                # Skip cleaning vendored bower assets\n      [--include-dev-dependencies]  # Include bower devDependencies\n     \n    Runtime options:\n      -f, [--force]    # Overwrite files that already exist\n      -p, [--pretend]  # Run but do not make any changes\n      -q, [--quiet]    # Suppress status output\n      -s, [--skip]     # Skip files that already exist\n     \n    Vendor bower assets based on bower.json\n\n`rails generate bower_vendor:clean [options]`\n\n    Options:\n      [--force]   # Delete vendored bower assets without prompting\n      [--cached]  # Delete only the bower cache from tmp/bower_components\n     \n    Runtime options:\n      -p, [--pretend]  # Run but do not make any changes\n      -q, [--quiet]    # Suppress status output\n      -s, [--skip]     # Skip files that already exist\n     \n    Cleans bower assets (CAUTION: Vendored asset directories for all bower packages will be deleted!)\n\n### Configuring installed assets\n\nTake the following example bower package:\n\n```json\n{\n  \"name\": \"widgets\",\n  \"repo\": \"pdf/widgets\",\n  \"description\": \"Now with more widgets!\",\n  \"version\": \"0.0.1\",\n  \"main\": [\n    \"build/dir/js/widgets.js\",\n    \"build/dir/css/widgets.css\",\n  ]\n}\n```\n\nLet's add `widgets` to our application's `bower.json`, like so:\n\n```json\n{\n  \"dependencies\": {\n    \"widgets\": \"~0.0.1\"\n  }\n}\n```\n\nThis is a contrived example, but it exists in the real world - if we were to\ninstall this using bower directly, we'd end up with some pretty ugly paths to\nreference in our application.  It might look something like this:\n\n    components/widgets/build/dir/js/widgets.js\n    components/widgets/build/dir/js/widgets-super.js\n    components/widgets/build/dir/css/widgets.css\n    components/widgets/src/cruft/widgets.coffee\n    components/widgets/src/widgets.scss\n    components/widgets/.ilikedonuts\n\nHowever, if we instead vendor the bower package by executing\n`rails g bower_vendor:install --force-clean`, we end up with just the following\nfiles added to our project space:\n\n    vendor/assets/javascripts/widgets/widgets.js\n    vendor/assets/stylesheets/widgets/widgets.css\n\nMuch nicer.\n\nSimply `require` them in your `application.js` or `application.css`:\n\n```javascript\n//= require 'widgets/widgets'\n```\n\n### Advanced bower.json\n(Hat-tip to [bower-installer](https://github.com/blittle/bower-installer) for the inspiration)\n\nIf the bower package's `main` attribute does not include all the files you want\nto vendor (or files you want to omit from vendoring), you can override the\nvendored files using a `sources` attribute with a key of the package name,\ncontaining an array of source files to install, like so:\n\n```json\n{\n  \"dependencies\": {\n    \"widgets\": \"~0.0.1\"\n  },\n  \"sources\": {\n    \"widgets\": [\n      \"build/dir/js/widgets.js\",\n      \"build/dir/js/widgets-super.js\",\n      \"build/dir/css/widgets.css\"\n    ]\n  }\n}\n```\n\nWhich will result in the following files being vendored:\n\n    vendor/assets/javascripts/widgets/widgets.js\n    vendor/assets/javascripts/widgets/widgets-super.js\n    vendor/assets/stylesheets/widgets/widgets.css\n\nYou can also override the destination path/filename, by using a hash of source\npaths to destinations instead of an array, like so:\n\n```json\n{\n  \"dependencies\": {\n    \"widgets\": \"~0.0.1\"\n  },\n  \"sources\": {\n    \"widgets\": {\n      \"build/dir/js/widgets.js\": \"widgets.js\",\n      \"build/dir/js/widgets-super.js\": \"super/widgets-super.js\",\n      \"build/dir/css/widgets.css\": \"my_widgets.css\"\n    }\n  }\n}\n```\n\nResulting in the following:\n\n    vendor/assets/javascripts/widgets/widgets.js\n    vendor/assets/javascripts/widgets/super/widgets-super.js\n    vendor/assets/stylesheets/widgets/my_widgets.css\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdf%2Fbower-vendor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdf%2Fbower-vendor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdf%2Fbower-vendor/lists"}