├── .circleci └── config.yml ├── .gitignore ├── .rubocop.yml ├── CHANGELOG.md ├── Gemfile ├── LICENSE.txt ├── README.md ├── Rakefile ├── examples ├── demo_app-brunch │ ├── .babelrc │ ├── .gitattributes │ ├── .gitignore │ ├── .ruby-version │ ├── Gemfile │ ├── Gemfile.lock │ ├── README.md │ ├── Rakefile │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ ├── .keep │ │ │ │ └── ruby-logo.png │ │ │ └── stylesheets │ │ │ │ ├── packs │ │ │ │ └── application.scss │ │ │ │ └── ruby-blurb.scss │ │ ├── channels │ │ │ └── application_cable │ │ │ │ ├── channel.rb │ │ │ │ └── connection.rb │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ └── home_controller.rb │ │ ├── helpers │ │ │ └── application_helper.rb │ │ ├── javascript │ │ │ └── packs │ │ │ │ └── application.js │ │ ├── jobs │ │ │ └── application_job.rb │ │ ├── mailers │ │ │ └── application_mailer.rb │ │ ├── models │ │ │ ├── application_record.rb │ │ │ └── concerns │ │ │ │ └── .keep │ │ └── views │ │ │ ├── home │ │ │ └── index.html.erb │ │ │ └── layouts │ │ │ ├── application.html.erb │ │ │ ├── mailer.html.erb │ │ │ └── mailer.text.erb │ ├── bin │ │ ├── bundle │ │ ├── rails │ │ ├── rake │ │ ├── setup │ │ ├── spring │ │ └── yarn │ ├── brunch-config.js │ ├── config.ru │ ├── config │ │ ├── application.rb │ │ ├── boot.rb │ │ ├── cable.yml │ │ ├── credentials.yml.enc │ │ ├── database.yml │ │ ├── environment.rb │ │ ├── environments │ │ │ ├── development.rb │ │ │ ├── production.rb │ │ │ └── test.rb │ │ ├── initializers │ │ │ ├── application_controller_renderer.rb │ │ │ ├── backtrace_silencers.rb │ │ │ ├── content_security_policy.rb │ │ │ ├── cookies_serializer.rb │ │ │ ├── filter_parameter_logging.rb │ │ │ ├── inflections.rb │ │ │ ├── mime_types.rb │ │ │ ├── permissions_policy.rb │ │ │ └── wrap_parameters.rb │ │ ├── locales │ │ │ └── en.yml │ │ ├── puma.rb │ │ ├── routes.rb │ │ ├── spring.rb │ │ └── storage.yml │ ├── db │ │ ├── schema.rb │ │ └── seeds.rb │ ├── lib │ │ └── tasks │ │ │ └── .keep │ ├── log │ │ └── .keep │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── 404.html │ │ ├── 422.html │ │ ├── 500.html │ │ ├── apple-touch-icon-precomposed.png │ │ ├── apple-touch-icon.png │ │ ├── favicon.ico │ │ └── robots.txt │ ├── storage │ │ └── .keep │ ├── test │ │ ├── application_system_test_case.rb │ │ ├── channels │ │ │ └── application_cable │ │ │ │ └── connection_test.rb │ │ ├── controllers │ │ │ └── .keep │ │ ├── fixtures │ │ │ └── files │ │ │ │ └── .keep │ │ ├── helpers │ │ │ └── .keep │ │ ├── integration │ │ │ ├── .keep │ │ │ └── external_asset_pipeline_integration_test.rb │ │ ├── mailers │ │ │ └── .keep │ │ ├── models │ │ │ └── .keep │ │ ├── system │ │ │ └── .keep │ │ └── test_helper.rb │ ├── tmp │ │ ├── .keep │ │ └── pids │ │ │ └── .keep │ ├── vendor │ │ └── .keep │ └── yarn.lock ├── demo_app-gulp-alt │ ├── .babelrc │ ├── .gitattributes │ ├── .gitignore │ ├── .ruby-version │ ├── Gemfile │ ├── Gemfile.lock │ ├── Procfile.dev │ ├── README.md │ ├── Rakefile │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ ├── .keep │ │ │ │ └── ruby-logo.png │ │ │ └── stylesheets │ │ │ │ ├── packs │ │ │ │ └── application.scss │ │ │ │ └── ruby-blurb.scss │ │ ├── channels │ │ │ └── application_cable │ │ │ │ ├── channel.rb │ │ │ │ └── connection.rb │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ └── home_controller.rb │ │ ├── helpers │ │ │ └── application_helper.rb │ │ ├── javascript │ │ │ └── packs │ │ │ │ └── application.js │ │ ├── jobs │ │ │ └── application_job.rb │ │ ├── mailers │ │ │ └── application_mailer.rb │ │ ├── models │ │ │ ├── application_record.rb │ │ │ └── concerns │ │ │ │ └── .keep │ │ └── views │ │ │ ├── home │ │ │ └── index.html.erb │ │ │ └── layouts │ │ │ ├── application.html.erb │ │ │ ├── mailer.html.erb │ │ │ └── mailer.text.erb │ ├── bin │ │ ├── bundle │ │ ├── rails │ │ ├── rake │ │ ├── setup │ │ ├── spring │ │ └── yarn │ ├── config.ru │ ├── config │ │ ├── application.rb │ │ ├── boot.rb │ │ ├── cable.yml │ │ ├── credentials.yml.enc │ │ ├── database.yml │ │ ├── environment.rb │ │ ├── environments │ │ │ ├── development.rb │ │ │ ├── production.rb │ │ │ └── test.rb │ │ ├── initializers │ │ │ ├── application_controller_renderer.rb │ │ │ ├── backtrace_silencers.rb │ │ │ ├── content_security_policy.rb │ │ │ ├── cookies_serializer.rb │ │ │ ├── external_asset_pipeline.rb │ │ │ ├── filter_parameter_logging.rb │ │ │ ├── inflections.rb │ │ │ ├── mime_types.rb │ │ │ ├── permissions_policy.rb │ │ │ └── wrap_parameters.rb │ │ ├── locales │ │ │ └── en.yml │ │ ├── puma.rb │ │ ├── routes.rb │ │ ├── spring.rb │ │ └── storage.yml │ ├── db │ │ ├── schema.rb │ │ └── seeds.rb │ ├── gulpfile.js │ ├── lib │ │ └── tasks │ │ │ ├── .keep │ │ │ └── assets │ │ │ ├── build-images.js │ │ │ ├── build-styles.js │ │ │ ├── build.js │ │ │ ├── util │ │ │ └── revision-asset.js │ │ │ └── watch.js │ ├── log │ │ └── .keep │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── 404.html │ │ ├── 422.html │ │ ├── 500.html │ │ ├── apple-touch-icon-precomposed.png │ │ ├── apple-touch-icon.png │ │ ├── favicon.ico │ │ └── robots.txt │ ├── storage │ │ └── .keep │ ├── test │ │ ├── application_system_test_case.rb │ │ ├── channels │ │ │ └── application_cable │ │ │ │ └── connection_test.rb │ │ ├── controllers │ │ │ └── .keep │ │ ├── fixtures │ │ │ └── files │ │ │ │ └── .keep │ │ ├── helpers │ │ │ └── .keep │ │ ├── integration │ │ │ ├── .keep │ │ │ └── external_asset_pipeline_integration_test.rb │ │ ├── mailers │ │ │ └── .keep │ │ ├── models │ │ │ └── .keep │ │ ├── system │ │ │ └── .keep │ │ └── test_helper.rb │ ├── tmp │ │ ├── .keep │ │ └── pids │ │ │ └── .keep │ ├── vendor │ │ └── .keep │ ├── webpack.config.js │ └── yarn.lock ├── demo_app-gulp │ ├── .babelrc │ ├── .gitattributes │ ├── .gitignore │ ├── .ruby-version │ ├── Gemfile │ ├── Gemfile.lock │ ├── Procfile.dev │ ├── README.md │ ├── Rakefile │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ ├── .keep │ │ │ │ └── ruby-logo.png │ │ │ └── stylesheets │ │ │ │ ├── packs │ │ │ │ └── application.scss │ │ │ │ └── ruby-blurb.scss │ │ ├── channels │ │ │ └── application_cable │ │ │ │ ├── channel.rb │ │ │ │ └── connection.rb │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ └── home_controller.rb │ │ ├── helpers │ │ │ └── application_helper.rb │ │ ├── javascript │ │ │ └── packs │ │ │ │ └── application.js │ │ ├── jobs │ │ │ └── application_job.rb │ │ ├── mailers │ │ │ └── application_mailer.rb │ │ ├── models │ │ │ ├── application_record.rb │ │ │ └── concerns │ │ │ │ └── .keep │ │ └── views │ │ │ ├── home │ │ │ └── index.html.erb │ │ │ └── layouts │ │ │ ├── application.html.erb │ │ │ ├── mailer.html.erb │ │ │ └── mailer.text.erb │ ├── bin │ │ ├── bundle │ │ ├── rails │ │ ├── rake │ │ ├── setup │ │ ├── spring │ │ └── yarn │ ├── config.ru │ ├── config │ │ ├── application.rb │ │ ├── boot.rb │ │ ├── cable.yml │ │ ├── credentials.yml.enc │ │ ├── database.yml │ │ ├── environment.rb │ │ ├── environments │ │ │ ├── development.rb │ │ │ ├── production.rb │ │ │ └── test.rb │ │ ├── initializers │ │ │ ├── application_controller_renderer.rb │ │ │ ├── backtrace_silencers.rb │ │ │ ├── content_security_policy.rb │ │ │ ├── cookies_serializer.rb │ │ │ ├── filter_parameter_logging.rb │ │ │ ├── inflections.rb │ │ │ ├── mime_types.rb │ │ │ ├── permissions_policy.rb │ │ │ └── wrap_parameters.rb │ │ ├── locales │ │ │ └── en.yml │ │ ├── puma.rb │ │ ├── routes.rb │ │ ├── spring.rb │ │ └── storage.yml │ ├── db │ │ ├── schema.rb │ │ └── seeds.rb │ ├── gulpfile.js │ ├── lib │ │ └── tasks │ │ │ ├── .keep │ │ │ └── assets │ │ │ ├── build-images.js │ │ │ ├── build-styles.js │ │ │ ├── build.js │ │ │ ├── util │ │ │ └── revision-asset.js │ │ │ └── watch.js │ ├── log │ │ └── .keep │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── 404.html │ │ ├── 422.html │ │ ├── 500.html │ │ ├── apple-touch-icon-precomposed.png │ │ ├── apple-touch-icon.png │ │ ├── favicon.ico │ │ └── robots.txt │ ├── storage │ │ └── .keep │ ├── test │ │ ├── application_system_test_case.rb │ │ ├── channels │ │ │ └── application_cable │ │ │ │ └── connection_test.rb │ │ ├── controllers │ │ │ └── .keep │ │ ├── fixtures │ │ │ └── files │ │ │ │ └── .keep │ │ ├── helpers │ │ │ └── .keep │ │ ├── integration │ │ │ ├── .keep │ │ │ └── external_asset_pipeline_integration_test.rb │ │ ├── mailers │ │ │ └── .keep │ │ ├── models │ │ │ └── .keep │ │ ├── system │ │ │ └── .keep │ │ └── test_helper.rb │ ├── tmp │ │ ├── .keep │ │ └── pids │ │ │ └── .keep │ ├── vendor │ │ └── .keep │ ├── webpack.config.js │ └── yarn.lock ├── demo_app-rails5 │ ├── .babelrc │ ├── .gitignore │ ├── .ruby-version │ ├── Gemfile │ ├── Gemfile.lock │ ├── README.md │ ├── Rakefile │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ └── .keep │ │ │ └── stylesheets │ │ │ │ └── application.css │ │ ├── channels │ │ │ └── application_cable │ │ │ │ ├── channel.rb │ │ │ │ └── connection.rb │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ └── home_controller.rb │ │ ├── helpers │ │ │ └── application_helper.rb │ │ ├── javascript │ │ │ └── packs │ │ │ │ └── application.js │ │ ├── jobs │ │ │ └── application_job.rb │ │ ├── mailers │ │ │ └── application_mailer.rb │ │ ├── models │ │ │ ├── application_record.rb │ │ │ └── concerns │ │ │ │ └── .keep │ │ └── views │ │ │ ├── home │ │ │ └── index.html.erb │ │ │ └── layouts │ │ │ ├── application.html.erb │ │ │ ├── mailer.html.erb │ │ │ └── mailer.text.erb │ ├── bin │ │ ├── bundle │ │ ├── rails │ │ ├── rake │ │ ├── setup │ │ ├── spring │ │ ├── update │ │ └── yarn │ ├── config.ru │ ├── config │ │ ├── application.rb │ │ ├── boot.rb │ │ ├── cable.yml │ │ ├── credentials.yml.enc │ │ ├── database.yml │ │ ├── environment.rb │ │ ├── environments │ │ │ ├── development.rb │ │ │ ├── production.rb │ │ │ └── test.rb │ │ ├── initializers │ │ │ ├── application_controller_renderer.rb │ │ │ ├── assets.rb │ │ │ ├── backtrace_silencers.rb │ │ │ ├── content_security_policy.rb │ │ │ ├── cookies_serializer.rb │ │ │ ├── filter_parameter_logging.rb │ │ │ ├── inflections.rb │ │ │ ├── mime_types.rb │ │ │ └── wrap_parameters.rb │ │ ├── locales │ │ │ └── en.yml │ │ ├── puma.rb │ │ ├── routes.rb │ │ ├── spring.rb │ │ └── storage.yml │ ├── db │ │ ├── schema.rb │ │ └── seeds.rb │ ├── lib │ │ └── tasks │ │ │ └── .keep │ ├── log │ │ └── .keep │ ├── package.json │ ├── public │ │ ├── 404.html │ │ ├── 422.html │ │ ├── 500.html │ │ ├── apple-touch-icon-precomposed.png │ │ ├── apple-touch-icon.png │ │ ├── favicon.ico │ │ └── robots.txt │ ├── storage │ │ └── .keep │ ├── test │ │ ├── application_system_test_case.rb │ │ ├── controllers │ │ │ └── .keep │ │ ├── fixtures │ │ │ ├── .keep │ │ │ └── files │ │ │ │ └── .keep │ │ ├── helpers │ │ │ └── .keep │ │ ├── integration │ │ │ ├── .keep │ │ │ └── external_asset_pipeline_integration_test.rb │ │ ├── mailers │ │ │ └── .keep │ │ ├── models │ │ │ └── .keep │ │ ├── system │ │ │ └── .keep │ │ └── test_helper.rb │ ├── tmp │ │ └── .keep │ ├── vendor │ │ └── .keep │ ├── webpack.config.js │ └── yarn.lock ├── demo_app-rollup │ ├── .babelrc │ ├── .gitattributes │ ├── .gitignore │ ├── .ruby-version │ ├── Gemfile │ ├── Gemfile.lock │ ├── README.md │ ├── Rakefile │ ├── app │ │ ├── assets │ │ │ ├── config │ │ │ │ └── manifest.js │ │ │ ├── images │ │ │ │ └── .keep │ │ │ └── stylesheets │ │ │ │ └── application.css │ │ ├── channels │ │ │ └── application_cable │ │ │ │ ├── channel.rb │ │ │ │ └── connection.rb │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ └── home_controller.rb │ │ ├── helpers │ │ │ └── application_helper.rb │ │ ├── javascript │ │ │ └── packs │ │ │ │ └── application.js │ │ ├── jobs │ │ │ └── application_job.rb │ │ ├── mailers │ │ │ └── application_mailer.rb │ │ ├── models │ │ │ ├── application_record.rb │ │ │ └── concerns │ │ │ │ └── .keep │ │ └── views │ │ │ ├── home │ │ │ └── index.html.erb │ │ │ └── layouts │ │ │ ├── application.html.erb │ │ │ ├── mailer.html.erb │ │ │ └── mailer.text.erb │ ├── bin │ │ ├── bundle │ │ ├── rails │ │ ├── rake │ │ ├── setup │ │ ├── spring │ │ └── yarn │ ├── config.ru │ ├── config │ │ ├── application.rb │ │ ├── boot.rb │ │ ├── cable.yml │ │ ├── credentials.yml.enc │ │ ├── database.yml │ │ ├── environment.rb │ │ ├── environments │ │ │ ├── development.rb │ │ │ ├── production.rb │ │ │ └── test.rb │ │ ├── initializers │ │ │ ├── application_controller_renderer.rb │ │ │ ├── assets.rb │ │ │ ├── backtrace_silencers.rb │ │ │ ├── content_security_policy.rb │ │ │ ├── cookies_serializer.rb │ │ │ ├── filter_parameter_logging.rb │ │ │ ├── inflections.rb │ │ │ ├── mime_types.rb │ │ │ ├── permissions_policy.rb │ │ │ └── wrap_parameters.rb │ │ ├── locales │ │ │ └── en.yml │ │ ├── puma.rb │ │ ├── routes.rb │ │ ├── spring.rb │ │ └── storage.yml │ ├── db │ │ ├── schema.rb │ │ └── seeds.rb │ ├── lib │ │ └── tasks │ │ │ └── .keep │ ├── log │ │ └── .keep │ ├── package.json │ ├── public │ │ ├── 404.html │ │ ├── 422.html │ │ ├── 500.html │ │ ├── apple-touch-icon-precomposed.png │ │ ├── apple-touch-icon.png │ │ ├── favicon.ico │ │ └── robots.txt │ ├── rollup.config.js │ ├── storage │ │ └── .keep │ ├── test │ │ ├── application_system_test_case.rb │ │ ├── channels │ │ │ └── application_cable │ │ │ │ └── connection_test.rb │ │ ├── controllers │ │ │ └── .keep │ │ ├── fixtures │ │ │ └── files │ │ │ │ └── .keep │ │ ├── helpers │ │ │ └── .keep │ │ ├── integration │ │ │ ├── .keep │ │ │ └── external_asset_pipeline_integration_test.rb │ │ ├── mailers │ │ │ └── .keep │ │ ├── models │ │ │ └── .keep │ │ ├── system │ │ │ └── .keep │ │ └── test_helper.rb │ ├── tmp │ │ ├── .keep │ │ └── pids │ │ │ └── .keep │ ├── vendor │ │ └── .keep │ └── yarn.lock └── demo_app │ ├── .babelrc │ ├── .gitattributes │ ├── .gitignore │ ├── .ruby-version │ ├── Gemfile │ ├── Gemfile.lock │ ├── README.md │ ├── Rakefile │ ├── app │ ├── assets │ │ ├── config │ │ │ └── manifest.js │ │ ├── images │ │ │ └── .keep │ │ └── stylesheets │ │ │ └── application.css │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ ├── controllers │ │ ├── application_controller.rb │ │ ├── concerns │ │ │ └── .keep │ │ └── home_controller.rb │ ├── helpers │ │ └── application_helper.rb │ ├── javascript │ │ └── packs │ │ │ └── application.js │ ├── jobs │ │ └── application_job.rb │ ├── mailers │ │ └── application_mailer.rb │ ├── models │ │ ├── application_record.rb │ │ └── concerns │ │ │ └── .keep │ └── views │ │ ├── home │ │ └── index.html.erb │ │ └── layouts │ │ ├── application.html.erb │ │ ├── mailer.html.erb │ │ └── mailer.text.erb │ ├── bin │ ├── bundle │ ├── rails │ ├── rake │ ├── setup │ ├── spring │ └── yarn │ ├── config.ru │ ├── config │ ├── application.rb │ ├── boot.rb │ ├── cable.yml │ ├── credentials.yml.enc │ ├── database.yml │ ├── environment.rb │ ├── environments │ │ ├── development.rb │ │ ├── production.rb │ │ └── test.rb │ ├── initializers │ │ ├── application_controller_renderer.rb │ │ ├── assets.rb │ │ ├── backtrace_silencers.rb │ │ ├── content_security_policy.rb │ │ ├── cookies_serializer.rb │ │ ├── filter_parameter_logging.rb │ │ ├── inflections.rb │ │ ├── mime_types.rb │ │ ├── permissions_policy.rb │ │ └── wrap_parameters.rb │ ├── locales │ │ └── en.yml │ ├── puma.rb │ ├── routes.rb │ ├── spring.rb │ └── storage.yml │ ├── db │ ├── schema.rb │ └── seeds.rb │ ├── lib │ └── tasks │ │ └── .keep │ ├── log │ └── .keep │ ├── package.json │ ├── public │ ├── 404.html │ ├── 422.html │ ├── 500.html │ ├── apple-touch-icon-precomposed.png │ ├── apple-touch-icon.png │ ├── favicon.ico │ └── robots.txt │ ├── storage │ └── .keep │ ├── test │ ├── application_system_test_case.rb │ ├── channels │ │ └── application_cable │ │ │ └── connection_test.rb │ ├── controllers │ │ └── .keep │ ├── fixtures │ │ └── files │ │ │ └── .keep │ ├── helpers │ │ └── .keep │ ├── integration │ │ ├── .keep │ │ └── external_asset_pipeline_integration_test.rb │ ├── mailers │ │ └── .keep │ ├── models │ │ └── .keep │ ├── system │ │ └── .keep │ └── test_helper.rb │ ├── tmp │ ├── .keep │ └── pids │ │ └── .keep │ ├── vendor │ └── .keep │ ├── webpack.config.js │ └── yarn.lock ├── external_asset_pipeline.gemspec ├── lib ├── external_asset_pipeline.rb └── external_asset_pipeline │ ├── configuration.rb │ ├── dev_server.rb │ ├── helper.rb │ ├── manifest.rb │ ├── priority_manifest.rb │ ├── railtie.rb │ ├── server_manifest.rb │ └── version.rb ├── script ├── bootstrap ├── console ├── lint └── test └── test ├── .rubocop.yml ├── external_asset_pipeline ├── configuration_test.rb ├── dev_server_test.rb ├── helper_test.rb ├── logger_double.rb ├── manifest_test.rb ├── priority_manifest_test.rb ├── server_double.rb └── server_manifest_test.rb ├── external_asset_pipeline_test.rb ├── integration └── external_asset_pipeline_integration_test.rb ├── test_app └── public │ ├── assets │ ├── .asset-manifest.json │ └── manifest.json │ └── packs │ ├── manifest.json │ └── manifest_with_prefixed_values.json └── test_helper.rb /.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /_yardoc/ 4 | /coverage/ 5 | /doc/ 6 | /pkg/ 7 | /spec/reports/ 8 | /tmp/ 9 | /Gemfile.lock 10 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | NewCops: enable 3 | TargetRubyVersion: 2.5.5 4 | Exclude: 5 | - examples/**/* 6 | - vendor/bundle/**/* 7 | 8 | Layout/LineLength: 9 | Max: 80 10 | 11 | Style/Documentation: 12 | Enabled: false 13 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | gemspec 6 | 7 | gem 'minitest', '~> 5.11' 8 | gem 'rake', '~> 12.3' 9 | 10 | group :development, :test do 11 | gem 'rubocop' 12 | end 13 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Richard Macklin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark the yarn lockfile as having been generated. 7 | yarn.lock linguist-generated 8 | 9 | # Mark any vendored files as having been vendored. 10 | vendor/* linguist-vendored 11 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-* 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore pidfiles, but keep the directory. 21 | /tmp/pids/* 22 | !/tmp/pids/ 23 | !/tmp/pids/.keep 24 | 25 | # Ignore uploaded files in development. 26 | /storage/* 27 | !/storage/.keep 28 | 29 | /public/assets 30 | .byebug_history 31 | 32 | # Ignore master key for decrypting credentials and more. 33 | /config/master.key 34 | 35 | /public/packs 36 | /public/packs-test 37 | /node_modules 38 | /yarn-error.log 39 | yarn-debug.log* 40 | .yarn-integrity 41 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.6.1 2 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/app/assets/images/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/assets/images/ruby-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/app/assets/images/ruby-logo.png -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/assets/stylesheets/packs/application.scss: -------------------------------------------------------------------------------- 1 | @import '../ruby-blurb'; 2 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/assets/stylesheets/ruby-blurb.scss: -------------------------------------------------------------------------------- 1 | .ruby-blurb { 2 | background: image-url('ruby-logo.png') no-repeat left 8px; 3 | background-size: 62px 62px; 4 | margin: 0 0 15px -4px; 5 | padding: 15px 0 0 74px; 6 | 7 | h2 { 8 | font-family: 'Noto Sans', 'Helvetica Neue', Helvetica, sans-serif; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | class HomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/javascript/packs/application.js: -------------------------------------------------------------------------------- 1 | import * as ActiveStorage from '@rails/activestorage'; 2 | import '@rails/ujs'; 3 | import Turbolinks from 'turbolinks'; 4 | 5 | Turbolinks.start(); 6 | ActiveStorage.start(); 7 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/app/models/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/views/home/index.html.erb: -------------------------------------------------------------------------------- 1 |

Home#index

2 | 3 |
4 |

Ruby is fun

5 |
6 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DemoApp 5 | 6 | <%= csrf_meta_tags %> 7 | <%= csp_meta_tag %> 8 | 9 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 10 | <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> 11 | 12 | 13 | 14 | <%= yield %> 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | APP_PATH = File.expand_path('../config/application', __dir__) 4 | require_relative "../config/boot" 5 | require "rails/commands" 6 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | require_relative "../config/boot" 4 | require "rake" 5 | Rake.application.run 6 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path('..', __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # Install JavaScript dependencies 21 | system! 'bin/yarn' 22 | 23 | # puts "\n== Copying sample files ==" 24 | # unless File.exist?('config/database.yml') 25 | # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' 26 | # end 27 | 28 | puts "\n== Preparing database ==" 29 | system! 'bin/rails db:prepare' 30 | 31 | puts "\n== Removing old logs and tempfiles ==" 32 | system! 'bin/rails log:clear tmp:clear' 33 | 34 | puts "\n== Restarting application server ==" 35 | system! 'bin/rails restart' 36 | end 37 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) 3 | gem "bundler" 4 | require "bundler" 5 | 6 | # Load Spring without loading other gems in the Gemfile, for speed. 7 | Bundler.locked_gems&.specs&.find { |spec| spec.name == "spring" }&.tap do |spring| 8 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 9 | gem "spring", spring.version 10 | require "spring/binstub" 11 | rescue Gem::LoadError 12 | # Ignore when Spring is not installed. 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | yarn = ENV["PATH"].split(File::PATH_SEPARATOR). 5 | select { |dir| File.expand_path(dir) != __dir__ }. 6 | product(["yarn", "yarn.cmd", "yarn.ps1"]). 7 | map { |dir, file| File.expand_path(file, dir) }. 8 | find { |file| File.executable?(file) } 9 | 10 | if yarn 11 | exec yarn, *ARGV 12 | else 13 | $stderr.puts "Yarn executable was not detected in the system." 14 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 15 | exit 1 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: demo_app_production 11 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | vxtg4pPKbAkOSkchm3PAAlCd7NtuzSnWWAOObmraPqiKN1Ifxb33nkir3vUfR/Xswg3toKpGNUuiGu7mci0/Vx+xkB/oSrNmMUYz6te8ju/Ys8aUNdhfk6dG1fECaNwsMICvSGSXE6Yp9DjjztHAn0h9QuPL/EKQawtcym9lbz3WjfB14UIcuE3DIJWdTnipG4nSU+NMu55/trILNeFiU8hwrZi4pJPTMZfUODtjk8wJ3Sj6CydnIegMrt10xLMBSJi/yle468er45UWSA2XxoGgXZIuaKHd45lHksJZsnSuYuVzX0mvmk+9boazEvtc0Ut9LCJXjHkdDN8UB5D0OPQiZ4Ja9Ht6wg3b8ePJqnS9MbWHwUiAGYqybQ2AddnP0r7t7AtEPq/GqD5o7w2Vnj7ahDbib3pxC4lf--uEO2JbmjlSZgzy90--OQYCaMH0BT9A/dJLr3Yz6Q== -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite. Versions 3.8.0 and up are supported. 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code 7 | # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". 8 | Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] 9 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [ 5 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 6 | ] 7 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root to: 'home#index' 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/spring.rb: -------------------------------------------------------------------------------- 1 | Spring.watch( 2 | ".ruby-version", 3 | ".rbenv-vars", 4 | "tmp/restart.txt", 5 | "tmp/caching-dev.txt" 6 | ) 7 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket 23 | 24 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 0) do 14 | 15 | end 16 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/lib/tasks/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/log/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-app", 3 | "private": true, 4 | "dependencies": { 5 | "@rails/activestorage": "^6.1.3", 6 | "@rails/ujs": "^6.1.3", 7 | "turbolinks": "^5.2.0" 8 | }, 9 | "devDependencies": { 10 | "@babel/core": "^7.13.15", 11 | "@babel/preset-env": "^7.13.15", 12 | "babel-brunch": "^7.0.1", 13 | "brunch": "^2.10.17", 14 | "clean-css-brunch": "^2.10.0", 15 | "fingerprint-brunch": "^2.0.7", 16 | "glob": "^7.1.6", 17 | "node-sass-asset-functions": "^0.1.0", 18 | "sass-brunch": "^2.10.8", 19 | "terser-brunch": "^3.0.0" 20 | }, 21 | "scripts": { 22 | "build": "brunch build", 23 | "watch": "brunch watch" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/postcss.config.js: -------------------------------------------------------------------------------- 1 | const cssnano = require('cssnano'); 2 | 3 | module.exports = { 4 | plugins: [ 5 | cssnano(), 6 | ], 7 | }; 8 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /examples/demo_app-brunch/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/public/apple-touch-icon.png -------------------------------------------------------------------------------- /examples/demo_app-brunch/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/public/favicon.ico -------------------------------------------------------------------------------- /examples/demo_app-brunch/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/storage/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/test/controllers/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/test/fixtures/files/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/test/helpers/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/test/integration/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/integration/external_asset_pipeline_integration_test.rb: -------------------------------------------------------------------------------- 1 | ../../../../test/integration/external_asset_pipeline_integration_test.rb -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/test/mailers/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/test/models/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/test/system/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | # parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /examples/demo_app-brunch/tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/tmp/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/tmp/pids/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/tmp/pids/.keep -------------------------------------------------------------------------------- /examples/demo_app-brunch/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-brunch/vendor/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark the yarn lockfile as having been generated. 7 | yarn.lock linguist-generated 8 | 9 | # Mark any vendored files as having been vendored. 10 | vendor/* linguist-vendored 11 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-* 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore pidfiles, but keep the directory. 21 | /tmp/pids/* 22 | !/tmp/pids/ 23 | !/tmp/pids/.keep 24 | 25 | # Ignore uploaded files in development. 26 | /storage/* 27 | !/storage/.keep 28 | 29 | /public/assets 30 | .byebug_history 31 | 32 | # Ignore master key for decrypting credentials and more. 33 | /config/master.key 34 | 35 | /public/packs 36 | /public/packs-test 37 | /node_modules 38 | /yarn-error.log 39 | yarn-debug.log* 40 | .yarn-integrity 41 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.6.1 2 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/Procfile.dev: -------------------------------------------------------------------------------- 1 | # Note: we are using `npm run` rather than `bin/yarn` because yarn does not wait 2 | # does not forward the SIGTERM signal to its children before exiting: 3 | # https://github.com/yarnpkg/yarn/issues/4667 4 | # which can end up leaving orphaned processes. 5 | # 6 | gulp: npm run watch:gulp 7 | webpack: npm run watch:webpack 8 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/app/assets/images/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/assets/images/ruby-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/app/assets/images/ruby-logo.png -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/assets/stylesheets/packs/application.scss: -------------------------------------------------------------------------------- 1 | @import '../ruby-blurb'; 2 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/assets/stylesheets/ruby-blurb.scss: -------------------------------------------------------------------------------- 1 | .ruby-blurb { 2 | background: image-url('ruby-logo.png') no-repeat left 8px; 3 | background-size: 62px 62px; 4 | margin: 0 0 15px -4px; 5 | padding: 15px 0 0 74px; 6 | 7 | h2 { 8 | font-family: 'Noto Sans', 'Helvetica Neue', Helvetica, sans-serif; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | class HomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | def external_asset_pipeline_manifest 3 | DemoApp.external_asset_pipeline_manifest 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/javascript/packs/application.js: -------------------------------------------------------------------------------- 1 | import * as ActiveStorage from '@rails/activestorage'; 2 | import Rails from '@rails/ujs'; 3 | import Turbolinks from 'turbolinks'; 4 | 5 | Rails.start(); 6 | Turbolinks.start(); 7 | ActiveStorage.start(); 8 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/app/models/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/views/home/index.html.erb: -------------------------------------------------------------------------------- 1 |

Home#index

2 | 3 |
4 |

Ruby is fun

5 |
6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DemoApp 5 | 6 | <%= csrf_meta_tags %> 7 | <%= csp_meta_tag %> 8 | 9 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 10 | <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> 11 | 12 | 13 | 14 | <%= yield %> 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | APP_PATH = File.expand_path('../config/application', __dir__) 4 | require_relative "../config/boot" 5 | require "rails/commands" 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | require_relative "../config/boot" 4 | require "rake" 5 | Rake.application.run 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path('..', __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # Install JavaScript dependencies 21 | system! 'bin/yarn' 22 | 23 | # puts "\n== Copying sample files ==" 24 | # unless File.exist?('config/database.yml') 25 | # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' 26 | # end 27 | 28 | puts "\n== Preparing database ==" 29 | system! 'bin/rails db:prepare' 30 | 31 | puts "\n== Removing old logs and tempfiles ==" 32 | system! 'bin/rails log:clear tmp:clear' 33 | 34 | puts "\n== Restarting application server ==" 35 | system! 'bin/rails restart' 36 | end 37 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) 3 | gem "bundler" 4 | require "bundler" 5 | 6 | # Load Spring without loading other gems in the Gemfile, for speed. 7 | Bundler.locked_gems&.specs&.find { |spec| spec.name == "spring" }&.tap do |spring| 8 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 9 | gem "spring", spring.version 10 | require "spring/binstub" 11 | rescue Gem::LoadError 12 | # Ignore when Spring is not installed. 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | yarn = ENV["PATH"].split(File::PATH_SEPARATOR). 5 | select { |dir| File.expand_path(dir) != __dir__ }. 6 | product(["yarn", "yarn.cmd", "yarn.ps1"]). 7 | map { |dir, file| File.expand_path(file, dir) }. 8 | find { |file| File.executable?(file) } 9 | 10 | if yarn 11 | exec yarn, *ARGV 12 | else 13 | $stderr.puts "Yarn executable was not detected in the system." 14 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 15 | exit 1 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: demo_app_production 11 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | vxtg4pPKbAkOSkchm3PAAlCd7NtuzSnWWAOObmraPqiKN1Ifxb33nkir3vUfR/Xswg3toKpGNUuiGu7mci0/Vx+xkB/oSrNmMUYz6te8ju/Ys8aUNdhfk6dG1fECaNwsMICvSGSXE6Yp9DjjztHAn0h9QuPL/EKQawtcym9lbz3WjfB14UIcuE3DIJWdTnipG4nSU+NMu55/trILNeFiU8hwrZi4pJPTMZfUODtjk8wJ3Sj6CydnIegMrt10xLMBSJi/yle468er45UWSA2XxoGgXZIuaKHd45lHksJZsnSuYuVzX0mvmk+9boazEvtc0Ut9LCJXjHkdDN8UB5D0OPQiZ4Ja9Ht6wg3b8ePJqnS9MbWHwUiAGYqybQ2AddnP0r7t7AtEPq/GqD5o7w2Vnj7ahDbib3pxC4lf--uEO2JbmjlSZgzy90--OQYCaMH0BT9A/dJLr3Yz6Q== -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite. Versions 3.8.0 and up are supported. 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code 7 | # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". 8 | Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] 9 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/initializers/external_asset_pipeline.rb: -------------------------------------------------------------------------------- 1 | DemoApp.external_asset_pipeline_manifest = 2 | ExternalAssetPipeline::PriorityManifest.new( 3 | ExternalAssetPipeline::Manifest.new( 4 | Rails.application.config.external_asset_pipeline.dup.configure do |config| 5 | config.manifest_filename = 'webpack-manifest.json' 6 | end 7 | ), 8 | ExternalAssetPipeline::Manifest.new( 9 | Rails.application.config.external_asset_pipeline.dup.configure do |config| 10 | config.manifest_filename = 'gulp-manifest.json' 11 | end 12 | ) 13 | ) 14 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [ 5 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 6 | ] 7 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root to: 'home#index' 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/config/spring.rb: -------------------------------------------------------------------------------- 1 | Spring.watch( 2 | ".ruby-version", 3 | ".rbenv-vars", 4 | "tmp/restart.txt", 5 | "tmp/caching-dev.txt" 6 | ) 7 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 0) do 14 | 15 | end 16 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/gulpfile.js: -------------------------------------------------------------------------------- 1 | module.exports = require('require-dir')('./lib/tasks/assets'); 2 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/lib/tasks/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/lib/tasks/assets/build-images.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const cache = require('gulp-cached'); 3 | 4 | const revisionAsset = require('./util/revision-asset'); 5 | 6 | const FILES = ['app/assets/images/**/*']; 7 | 8 | function buildImages() { 9 | return revisionAsset(gulp.src(FILES).pipe(cache('images'))); 10 | } 11 | 12 | buildImages.description = 'Build images (fingerprint and output to destination)'; 13 | buildImages.files = FILES; 14 | 15 | module.exports = buildImages; 16 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/lib/tasks/assets/build.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const buildStylesTask = require('./build-styles'); 3 | 4 | const build = gulp.parallel(buildStylesTask); 5 | 6 | build.description = 'Build all static assets'; 7 | 8 | module.exports = build; 9 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/lib/tasks/assets/util/revision-asset.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const rev = require('gulp-rev'); 3 | 4 | function revisionAsset(input, sourcemapOptions) { 5 | return ( 6 | input 7 | .pipe(rev()) 8 | .pipe(gulp.dest('public/packs', sourcemapOptions)) 9 | .pipe(rev.manifest({ 10 | base: 'public/packs', 11 | merge: true, 12 | path: 'public/packs/gulp-manifest.json' 13 | })) 14 | .pipe(gulp.dest('public/packs')) 15 | ); 16 | } 17 | 18 | module.exports = revisionAsset; 19 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/log/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-app", 3 | "private": true, 4 | "dependencies": { 5 | "@rails/activestorage": "^6.1.3", 6 | "@rails/ujs": "^6.1.3", 7 | "turbolinks": "^5.2.0" 8 | }, 9 | "devDependencies": { 10 | "@babel/core": "^7.13.15", 11 | "@babel/preset-env": "^7.13.15", 12 | "@rmacklin/sass-graph": "^3.0.3-pr100", 13 | "babel-loader": "^8.2.2", 14 | "cssnano": "^4.1.11", 15 | "glob": "^7.1.6", 16 | "gulp": "^4.0.2", 17 | "gulp-cached": "^1.1.1", 18 | "gulp-changed-in-place": "^2.3.0", 19 | "gulp-postcss": "^8.0.0", 20 | "gulp-rev": "^9.0.0", 21 | "gulp-rev-rewrite": "^1.1.4", 22 | "gulp-sass": "^4.1.0", 23 | "node-sass-asset-functions": "^0.1.0", 24 | "require-dir": "^1.2.0", 25 | "touch": "^3.1.0", 26 | "webpack": "^4.46.0", 27 | "webpack-assets-manifest": "^4.0.5", 28 | "webpack-cli": "^3.3.12" 29 | }, 30 | "scripts": { 31 | "build": "gulp build && webpack", 32 | "watch:gulp": "gulp watch", 33 | "watch:webpack": "webpack --watch", 34 | "watch": "foreman start -f Procfile.dev" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/postcss.config.js: -------------------------------------------------------------------------------- 1 | const cssnano = require('cssnano'); 2 | 3 | module.exports = { 4 | plugins: [ 5 | cssnano(), 6 | ], 7 | }; 8 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/public/apple-touch-icon.png -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/public/favicon.ico -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/storage/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/test/controllers/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/test/fixtures/files/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/test/helpers/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/test/integration/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/integration/external_asset_pipeline_integration_test.rb: -------------------------------------------------------------------------------- 1 | ../../../../test/integration/external_asset_pipeline_integration_test.rb -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/test/mailers/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/test/models/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/test/system/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | # parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/tmp/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/tmp/pids/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/tmp/pids/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp-alt/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp-alt/vendor/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark the yarn lockfile as having been generated. 7 | yarn.lock linguist-generated 8 | 9 | # Mark any vendored files as having been vendored. 10 | vendor/* linguist-vendored 11 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-* 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore pidfiles, but keep the directory. 21 | /tmp/pids/* 22 | !/tmp/pids/ 23 | !/tmp/pids/.keep 24 | 25 | # Ignore uploaded files in development. 26 | /storage/* 27 | !/storage/.keep 28 | 29 | /public/assets 30 | .byebug_history 31 | 32 | # Ignore master key for decrypting credentials and more. 33 | /config/master.key 34 | 35 | /public/packs 36 | /public/packs-test 37 | /node_modules 38 | /yarn-error.log 39 | yarn-debug.log* 40 | .yarn-integrity 41 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.6.1 2 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/Procfile.dev: -------------------------------------------------------------------------------- 1 | # Note: we are using `npm run` rather than `bin/yarn` because yarn does not wait 2 | # does not forward the SIGTERM signal to its children before exiting: 3 | # https://github.com/yarnpkg/yarn/issues/4667 4 | # which can end up leaving orphaned processes. 5 | # 6 | gulp: npm run watch:gulp 7 | webpack: npm run watch:webpack 8 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/app/assets/images/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/assets/images/ruby-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/app/assets/images/ruby-logo.png -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/assets/stylesheets/packs/application.scss: -------------------------------------------------------------------------------- 1 | @import '../ruby-blurb'; 2 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/assets/stylesheets/ruby-blurb.scss: -------------------------------------------------------------------------------- 1 | .ruby-blurb { 2 | background: image-url('ruby-logo.png') no-repeat left 8px; 3 | background-size: 62px 62px; 4 | margin: 0 0 15px -4px; 5 | padding: 15px 0 0 74px; 6 | 7 | h2 { 8 | font-family: 'Noto Sans', 'Helvetica Neue', Helvetica, sans-serif; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | class HomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/javascript/packs/application.js: -------------------------------------------------------------------------------- 1 | import * as ActiveStorage from '@rails/activestorage'; 2 | import Rails from '@rails/ujs'; 3 | import Turbolinks from 'turbolinks'; 4 | 5 | Rails.start(); 6 | Turbolinks.start(); 7 | ActiveStorage.start(); 8 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/app/models/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/views/home/index.html.erb: -------------------------------------------------------------------------------- 1 |

Home#index

2 | 3 |
4 |

Ruby is fun

5 |
6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DemoApp 5 | 6 | <%= csrf_meta_tags %> 7 | <%= csp_meta_tag %> 8 | 9 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 10 | <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> 11 | 12 | 13 | 14 | <%= yield %> 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | APP_PATH = File.expand_path('../config/application', __dir__) 4 | require_relative "../config/boot" 5 | require "rails/commands" 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | require_relative "../config/boot" 4 | require "rake" 5 | Rake.application.run 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path('..', __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # Install JavaScript dependencies 21 | system! 'bin/yarn' 22 | 23 | # puts "\n== Copying sample files ==" 24 | # unless File.exist?('config/database.yml') 25 | # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' 26 | # end 27 | 28 | puts "\n== Preparing database ==" 29 | system! 'bin/rails db:prepare' 30 | 31 | puts "\n== Removing old logs and tempfiles ==" 32 | system! 'bin/rails log:clear tmp:clear' 33 | 34 | puts "\n== Restarting application server ==" 35 | system! 'bin/rails restart' 36 | end 37 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) 3 | gem "bundler" 4 | require "bundler" 5 | 6 | # Load Spring without loading other gems in the Gemfile, for speed. 7 | Bundler.locked_gems&.specs&.find { |spec| spec.name == "spring" }&.tap do |spring| 8 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 9 | gem "spring", spring.version 10 | require "spring/binstub" 11 | rescue Gem::LoadError 12 | # Ignore when Spring is not installed. 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | yarn = ENV["PATH"].split(File::PATH_SEPARATOR). 5 | select { |dir| File.expand_path(dir) != __dir__ }. 6 | product(["yarn", "yarn.cmd", "yarn.ps1"]). 7 | map { |dir, file| File.expand_path(file, dir) }. 8 | find { |file| File.executable?(file) } 9 | 10 | if yarn 11 | exec yarn, *ARGV 12 | else 13 | $stderr.puts "Yarn executable was not detected in the system." 14 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 15 | exit 1 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: demo_app_production 11 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | vxtg4pPKbAkOSkchm3PAAlCd7NtuzSnWWAOObmraPqiKN1Ifxb33nkir3vUfR/Xswg3toKpGNUuiGu7mci0/Vx+xkB/oSrNmMUYz6te8ju/Ys8aUNdhfk6dG1fECaNwsMICvSGSXE6Yp9DjjztHAn0h9QuPL/EKQawtcym9lbz3WjfB14UIcuE3DIJWdTnipG4nSU+NMu55/trILNeFiU8hwrZi4pJPTMZfUODtjk8wJ3Sj6CydnIegMrt10xLMBSJi/yle468er45UWSA2XxoGgXZIuaKHd45lHksJZsnSuYuVzX0mvmk+9boazEvtc0Ut9LCJXjHkdDN8UB5D0OPQiZ4Ja9Ht6wg3b8ePJqnS9MbWHwUiAGYqybQ2AddnP0r7t7AtEPq/GqD5o7w2Vnj7ahDbib3pxC4lf--uEO2JbmjlSZgzy90--OQYCaMH0BT9A/dJLr3Yz6Q== -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite. Versions 3.8.0 and up are supported. 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code 7 | # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". 8 | Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] 9 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [ 5 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 6 | ] 7 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root to: 'home#index' 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/spring.rb: -------------------------------------------------------------------------------- 1 | Spring.watch( 2 | ".ruby-version", 3 | ".rbenv-vars", 4 | "tmp/restart.txt", 5 | "tmp/caching-dev.txt" 6 | ) 7 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket 23 | 24 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 0) do 14 | 15 | end 16 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/gulpfile.js: -------------------------------------------------------------------------------- 1 | module.exports = require('require-dir')('./lib/tasks/assets'); 2 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/lib/tasks/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/lib/tasks/assets/build-images.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const cache = require('gulp-cached'); 3 | 4 | const revisionAsset = require('./util/revision-asset'); 5 | 6 | const FILES = ['app/assets/images/**/*']; 7 | 8 | function buildImages() { 9 | return revisionAsset(gulp.src(FILES).pipe(cache('images'))); 10 | } 11 | 12 | buildImages.description = 'Build images (fingerprint and output to destination)'; 13 | buildImages.files = FILES; 14 | 15 | module.exports = buildImages; 16 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/lib/tasks/assets/build.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const buildStylesTask = require('./build-styles'); 3 | 4 | const build = gulp.parallel(buildStylesTask); 5 | 6 | build.description = 'Build all static assets'; 7 | 8 | module.exports = build; 9 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/lib/tasks/assets/util/revision-asset.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const rev = require('gulp-rev'); 3 | 4 | function revisionAsset(input, sourcemapOptions) { 5 | return ( 6 | input 7 | .pipe(rev()) 8 | .pipe(gulp.dest('public/packs', sourcemapOptions)) 9 | .pipe(rev.manifest({ 10 | base: 'public/packs', 11 | merge: true, 12 | path: 'public/packs/manifest.json' 13 | })) 14 | .pipe(gulp.dest('public/packs')) 15 | ); 16 | } 17 | 18 | module.exports = revisionAsset; 19 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/log/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-app", 3 | "private": true, 4 | "dependencies": { 5 | "@rails/activestorage": "^6.1.3", 6 | "@rails/ujs": "^6.1.3", 7 | "turbolinks": "^5.2.0" 8 | }, 9 | "devDependencies": { 10 | "@babel/core": "^7.13.15", 11 | "@babel/preset-env": "^7.13.15", 12 | "@rmacklin/sass-graph": "^3.0.3-pr100", 13 | "babel-loader": "^8.2.2", 14 | "cssnano": "^4.1.11", 15 | "glob": "^7.1.6", 16 | "gulp": "^4.0.2", 17 | "gulp-cached": "^1.1.1", 18 | "gulp-changed-in-place": "^2.3.0", 19 | "gulp-postcss": "^8.0.0", 20 | "gulp-rev": "^9.0.0", 21 | "gulp-rev-rewrite": "^1.1.4", 22 | "gulp-sass": "^4.1.0", 23 | "node-sass-asset-functions": "^0.1.0", 24 | "require-dir": "^1.2.0", 25 | "touch": "^3.1.0", 26 | "webpack": "^4.46.0", 27 | "webpack-assets-manifest": "^4.0.5", 28 | "webpack-cli": "^3.3.12" 29 | }, 30 | "scripts": { 31 | "build": "gulp build && webpack", 32 | "watch:gulp": "gulp watch", 33 | "watch:webpack": "webpack --watch", 34 | "watch": "foreman start -f Procfile.dev" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/postcss.config.js: -------------------------------------------------------------------------------- 1 | const cssnano = require('cssnano'); 2 | 3 | module.exports = { 4 | plugins: [ 5 | cssnano(), 6 | ], 7 | }; 8 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /examples/demo_app-gulp/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/public/apple-touch-icon.png -------------------------------------------------------------------------------- /examples/demo_app-gulp/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/public/favicon.ico -------------------------------------------------------------------------------- /examples/demo_app-gulp/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/storage/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/test/controllers/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/test/fixtures/files/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/test/helpers/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/test/integration/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/integration/external_asset_pipeline_integration_test.rb: -------------------------------------------------------------------------------- 1 | ../../../../test/integration/external_asset_pipeline_integration_test.rb -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/test/mailers/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/test/models/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/test/system/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | # parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /examples/demo_app-gulp/tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/tmp/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/tmp/pids/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/tmp/pids/.keep -------------------------------------------------------------------------------- /examples/demo_app-gulp/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-gulp/vendor/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore uploaded files in development 21 | /storage/* 22 | !/storage/.keep 23 | 24 | /node_modules 25 | /yarn-error.log 26 | 27 | /public/assets 28 | /public/packs 29 | .byebug_history 30 | 31 | # Ignore master key for decrypting credentials and more. 32 | /config/master.key 33 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.6.1 -------------------------------------------------------------------------------- /examples/demo_app-rails5/README.md: -------------------------------------------------------------------------------- 1 | # ExternalAssetPipeline Demo with Webpack (using Rails 5) 2 | 3 | This example is the same as [`demo_app`](../demo_app) but using rails 5 (instead 4 | of rails 6). It uses [`webpack`] with [`webpack-assets-manifest`] to build the 5 | assets and generate the manifest. Refer to the [`package.json`](./package.json) 6 | and [`webpack.config.js`](./webpack.config.js) to see the specifics. 7 | 8 | [`webpack`]: https://webpack.js.org 9 | [`webpack-assets-manifest`]: https://github.com/webdeveric/webpack-assets-manifest 10 | 11 | ## Working with assets 12 | 13 | ### Watch mode (incremental recompilation) 14 | 15 | `bin/yarn watch` 16 | 17 | ### Development build 18 | 19 | `bin/yarn build` 20 | 21 | ### Production build 22 | 23 | `NODE_ENV=production bin/yarn build` 24 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/app/assets/images/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's 6 | * vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS 10 | * files in this directory. Styles in this file should be added after the last require_* statement. 11 | * It is generally better to create a new file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | class HomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/javascript/packs/application.js: -------------------------------------------------------------------------------- 1 | import * as ActiveStorage from 'activestorage'; 2 | import Rails from 'rails-ujs'; 3 | import Turbolinks from 'turbolinks'; 4 | 5 | Rails.start(); 6 | ActiveStorage.start(); 7 | Turbolinks.start(); 8 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/app/models/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/views/home/index.html.erb: -------------------------------------------------------------------------------- 1 |

Home#index

2 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DemoApp 5 | <%= csrf_meta_tags %> 6 | <%= csp_meta_tag %> 7 | 8 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 9 | <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> 10 | 11 | 12 | 13 | <%= yield %> 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'fileutils' 3 | include FileUtils 4 | 5 | # path to your application root. 6 | APP_ROOT = File.expand_path('..', __dir__) 7 | 8 | def system!(*args) 9 | system(*args) || abort("\n== Command #{args} failed ==") 10 | end 11 | 12 | chdir APP_ROOT do 13 | # This script is a starting point to setup your application. 14 | # Add necessary setup steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # Install JavaScript dependencies if using Yarn 21 | # system('bin/yarn') 22 | 23 | # puts "\n== Copying sample files ==" 24 | # unless File.exist?('config/database.yml') 25 | # cp 'config/database.yml.sample', 'config/database.yml' 26 | # end 27 | 28 | puts "\n== Preparing database ==" 29 | system! 'bin/rails db:setup' 30 | 31 | puts "\n== Removing old logs and tempfiles ==" 32 | system! 'bin/rails log:clear tmp:clear' 33 | 34 | puts "\n== Restarting application server ==" 35 | system! 'bin/rails restart' 36 | end 37 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) 11 | spring = lockfile.specs.detect { |spec| spec.name == "spring" } 12 | if spring 13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 14 | gem 'spring', spring.version 15 | require 'spring/binstub' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/bin/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'fileutils' 3 | include FileUtils 4 | 5 | # path to your application root. 6 | APP_ROOT = File.expand_path('..', __dir__) 7 | 8 | def system!(*args) 9 | system(*args) || abort("\n== Command #{args} failed ==") 10 | end 11 | 12 | chdir APP_ROOT do 13 | # This script is a way to update your development environment automatically. 14 | # Add necessary update steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # Install JavaScript dependencies if using Yarn 21 | # system('bin/yarn') 22 | 23 | puts "\n== Updating database ==" 24 | system! 'bin/rails db:migrate' 25 | 26 | puts "\n== Removing old logs and tempfiles ==" 27 | system! 'bin/rails log:clear tmp:clear' 28 | 29 | puts "\n== Restarting application server ==" 30 | system! 'bin/rails restart' 31 | end 32 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | begin 5 | exec "yarnpkg", *ARGV 6 | rescue Errno::ENOENT 7 | $stderr.puts "Yarn executable was not detected in the system." 8 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 9 | exit 1 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative 'boot' 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | require 'external_asset_pipeline/railtie' 10 | 11 | module DemoApp 12 | class Application < Rails::Application 13 | # Initialize configuration defaults for originally generated Rails version. 14 | config.load_defaults 5.2 15 | 16 | config.external_asset_pipeline.fall_back_to_sprockets = true 17 | 18 | # Settings in config/environments/* take precedence over those specified here. 19 | # Application configuration can go into files in config/initializers 20 | # -- all .rb files in that directory are automatically loaded after loading 21 | # the framework and any gems in your application. 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: demo_app_production 11 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | vxtg4pPKbAkOSkchm3PAAlCd7NtuzSnWWAOObmraPqiKN1Ifxb33nkir3vUfR/Xswg3toKpGNUuiGu7mci0/Vx+xkB/oSrNmMUYz6te8ju/Ys8aUNdhfk6dG1fECaNwsMICvSGSXE6Yp9DjjztHAn0h9QuPL/EKQawtcym9lbz3WjfB14UIcuE3DIJWdTnipG4nSU+NMu55/trILNeFiU8hwrZi4pJPTMZfUODtjk8wJ3Sj6CydnIegMrt10xLMBSJi/yle468er45UWSA2XxoGgXZIuaKHd45lHksJZsnSuYuVzX0mvmk+9boazEvtc0Ut9LCJXjHkdDN8UB5D0OPQiZ4Ja9Ht6wg3b8ePJqnS9MbWHwUiAGYqybQ2AddnP0r7t7AtEPq/GqD5o7w2Vnj7ahDbib3pxC4lf--uEO2JbmjlSZgzy90--OQYCaMH0BT9A/dJLr3Yz6Q== -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | # Add Yarn node_modules folder to the asset load path. 9 | Rails.application.config.assets.paths << Rails.root.join('node_modules') 10 | 11 | # Precompile additional assets. 12 | # application.js, application.css, and all non-JS/CSS in the app/assets 13 | # folder are already added. 14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 15 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/initializers/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Define an application-wide content security policy 4 | # For further information see the following documentation 5 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy 6 | 7 | # Rails.application.config.content_security_policy do |policy| 8 | # policy.default_src :self, :https 9 | # policy.font_src :self, :https, :data 10 | # policy.img_src :self, :https, :data 11 | # policy.object_src :none 12 | # policy.script_src :self, :https 13 | # policy.style_src :self, :https 14 | 15 | # # Specify URI for violation reports 16 | # # policy.report_uri "/csp-violation-report-endpoint" 17 | # end 18 | 19 | # If you are using UJS then enable automatic nonce generation 20 | # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } 21 | 22 | # Report CSP violations to a specified URI 23 | # For further information see the following documentation: 24 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only 25 | # Rails.application.config.content_security_policy_report_only = true 26 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at http://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root to: 'home#index' 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/spring.rb: -------------------------------------------------------------------------------- 1 | %w[ 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ].each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket 23 | 24 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # Note that this schema.rb definition is the authoritative source for your 6 | # database schema. If you need to create the application database on another 7 | # system, you should be using db:schema:load, not running all the migrations 8 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 9 | # you'll amass, the slower it'll run and the greater likelihood for issues). 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 0) do 14 | 15 | end 16 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/lib/tasks/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/log/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo_app", 3 | "private": true, 4 | "dependencies": { 5 | "activestorage": "^5.2.3", 6 | "rails-ujs": "^5.2.3", 7 | "turbolinks": "^5.2.0" 8 | }, 9 | "devDependencies": { 10 | "@babel/core": "^7.5.5", 11 | "@babel/preset-env": "^7.5.5", 12 | "babel-loader": "^8.0.6", 13 | "glob": "^7.1.4", 14 | "webpack": "^4.39.3", 15 | "webpack-assets-manifest": "^3.1.1", 16 | "webpack-cli": "^3.3.7", 17 | "webpack-dev-server": "^3.8.0" 18 | }, 19 | "resolutions": { 20 | "sockjs-client": "1.5.2" 21 | }, 22 | "scripts": { 23 | "build": "webpack", 24 | "watch": "webpack --watch" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /examples/demo_app-rails5/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/public/apple-touch-icon.png -------------------------------------------------------------------------------- /examples/demo_app-rails5/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/public/favicon.ico -------------------------------------------------------------------------------- /examples/demo_app-rails5/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/storage/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/test/controllers/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/test/fixtures/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/test/fixtures/files/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/test/helpers/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/test/integration/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/integration/external_asset_pipeline_integration_test.rb: -------------------------------------------------------------------------------- 1 | ../../../../test/integration/external_asset_pipeline_integration_test.rb -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/test/mailers/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/test/models/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/test/system/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require_relative '../config/environment' 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /examples/demo_app-rails5/tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/tmp/.keep -------------------------------------------------------------------------------- /examples/demo_app-rails5/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rails5/vendor/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark the yarn lockfile as having been generated. 7 | yarn.lock linguist-generated 8 | 9 | # Mark any vendored files as having been vendored. 10 | vendor/* linguist-vendored 11 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-* 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore pidfiles, but keep the directory. 21 | /tmp/pids/* 22 | !/tmp/pids/ 23 | !/tmp/pids/.keep 24 | 25 | # Ignore uploaded files in development. 26 | /storage/* 27 | !/storage/.keep 28 | 29 | /public/assets 30 | .byebug_history 31 | 32 | # Ignore master key for decrypting credentials and more. 33 | /config/master.key 34 | 35 | /public/packs 36 | /public/packs-test 37 | /node_modules 38 | /yarn-error.log 39 | yarn-debug.log* 40 | .yarn-integrity 41 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.6.1 2 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/README.md: -------------------------------------------------------------------------------- 1 | # ExternalAssetPipeline Demo with Rollup 2 | 3 | This example uses [`rollup`] with [`rollup-plugin-fingerprint`] to build the 4 | assets and generate the manifest. Refer to the [`package.json`](./package.json) 5 | and [`rollup.config.js`](./rollup.config.js) to see the specifics. 6 | 7 | [`rollup`]: https://rollupjs.org 8 | [`rollup-plugin-fingerprint`]: https://github.com/rmacklin/rollup-plugin-fingerprint 9 | 10 | ## Working with assets 11 | 12 | ### Watch mode (incremental recompilation) 13 | 14 | `bin/yarn watch` 15 | 16 | ### Development build 17 | 18 | `bin/yarn build` 19 | 20 | ### Production build 21 | 22 | `NODE_ENV=production bin/yarn build` 23 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/app/assets/images/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's 6 | * vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS 10 | * files in this directory. Styles in this file should be added after the last require_* statement. 11 | * It is generally better to create a new file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | class HomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/javascript/packs/application.js: -------------------------------------------------------------------------------- 1 | import * as ActiveStorage from '@rails/activestorage'; 2 | import '@rails/ujs'; 3 | import Turbolinks from 'turbolinks'; 4 | 5 | Turbolinks.start(); 6 | ActiveStorage.start(); 7 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/app/models/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/views/home/index.html.erb: -------------------------------------------------------------------------------- 1 |

Home#index

2 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DemoApp 5 | 6 | <%= csrf_meta_tags %> 7 | <%= csp_meta_tag %> 8 | 9 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 10 | <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> 11 | 12 | 13 | 14 | <%= yield %> 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | APP_PATH = File.expand_path('../config/application', __dir__) 4 | require_relative "../config/boot" 5 | require "rails/commands" 6 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | require_relative "../config/boot" 4 | require "rake" 5 | Rake.application.run 6 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path('..', __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # Install JavaScript dependencies 21 | system! 'bin/yarn' 22 | 23 | # puts "\n== Copying sample files ==" 24 | # unless File.exist?('config/database.yml') 25 | # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' 26 | # end 27 | 28 | puts "\n== Preparing database ==" 29 | system! 'bin/rails db:prepare' 30 | 31 | puts "\n== Removing old logs and tempfiles ==" 32 | system! 'bin/rails log:clear tmp:clear' 33 | 34 | puts "\n== Restarting application server ==" 35 | system! 'bin/rails restart' 36 | end 37 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) 3 | gem "bundler" 4 | require "bundler" 5 | 6 | # Load Spring without loading other gems in the Gemfile, for speed. 7 | Bundler.locked_gems&.specs&.find { |spec| spec.name == "spring" }&.tap do |spring| 8 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 9 | gem "spring", spring.version 10 | require "spring/binstub" 11 | rescue Gem::LoadError 12 | # Ignore when Spring is not installed. 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | yarn = ENV["PATH"].split(File::PATH_SEPARATOR). 5 | select { |dir| File.expand_path(dir) != __dir__ }. 6 | product(["yarn", "yarn.cmd", "yarn.ps1"]). 7 | map { |dir, file| File.expand_path(file, dir) }. 8 | find { |file| File.executable?(file) } 9 | 10 | if yarn 11 | exec yarn, *ARGV 12 | else 13 | $stderr.puts "Yarn executable was not detected in the system." 14 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 15 | exit 1 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails/all" 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | require "external_asset_pipeline/railtie" 10 | 11 | module DemoApp 12 | class Application < Rails::Application 13 | # Initialize configuration defaults for originally generated Rails version. 14 | config.load_defaults 6.1 15 | 16 | config.external_asset_pipeline.fall_back_to_sprockets = true 17 | 18 | # Configuration for the application, engines, and railties goes here. 19 | # 20 | # These settings can be overridden in specific environments using the files 21 | # in config/environments, which are processed later. 22 | # 23 | # config.time_zone = "Central Time (US & Canada)" 24 | # config.eager_load_paths << Rails.root.join("extras") 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: demo_app_production 11 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | vxtg4pPKbAkOSkchm3PAAlCd7NtuzSnWWAOObmraPqiKN1Ifxb33nkir3vUfR/Xswg3toKpGNUuiGu7mci0/Vx+xkB/oSrNmMUYz6te8ju/Ys8aUNdhfk6dG1fECaNwsMICvSGSXE6Yp9DjjztHAn0h9QuPL/EKQawtcym9lbz3WjfB14UIcuE3DIJWdTnipG4nSU+NMu55/trILNeFiU8hwrZi4pJPTMZfUODtjk8wJ3Sj6CydnIegMrt10xLMBSJi/yle468er45UWSA2XxoGgXZIuaKHd45lHksJZsnSuYuVzX0mvmk+9boazEvtc0Ut9LCJXjHkdDN8UB5D0OPQiZ4Ja9Ht6wg3b8ePJqnS9MbWHwUiAGYqybQ2AddnP0r7t7AtEPq/GqD5o7w2Vnj7ahDbib3pxC4lf--uEO2JbmjlSZgzy90--OQYCaMH0BT9A/dJLr3Yz6Q== -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite. Versions 3.8.0 and up are supported. 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | # Add Yarn node_modules folder to the asset load path. 9 | Rails.application.config.assets.paths << Rails.root.join('node_modules') 10 | 11 | # Precompile additional assets. 12 | # application.js, application.css, and all non-JS/CSS in the app/assets 13 | # folder are already added. 14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 15 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code 7 | # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". 8 | Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] 9 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [ 5 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 6 | ] 7 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root to: 'home#index' 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/config/spring.rb: -------------------------------------------------------------------------------- 1 | Spring.watch( 2 | ".ruby-version", 3 | ".rbenv-vars", 4 | "tmp/restart.txt", 5 | "tmp/caching-dev.txt" 6 | ) 7 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 0) do 14 | 15 | end 16 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/lib/tasks/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/log/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-app", 3 | "private": true, 4 | "dependencies": { 5 | "@rails/activestorage": "^6.1.3", 6 | "@rails/ujs": "^6.1.3", 7 | "turbolinks": "^5.2.0" 8 | }, 9 | "devDependencies": { 10 | "@babel/core": "^7.13.15", 11 | "@babel/preset-env": "^7.13.15", 12 | "glob": "^7.1.6", 13 | "rollup": "^1.32.1", 14 | "rollup-plugin-babel": "^4.4.0", 15 | "rollup-plugin-commonjs": "^10.1.0", 16 | "rollup-plugin-fingerprint": "^1.3.0", 17 | "rollup-plugin-node-resolve": "^5.2.0", 18 | "rollup-plugin-terser": "^5.3.1" 19 | }, 20 | "scripts": { 21 | "build": "rollup -c", 22 | "watch": "rollup -c --watch" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /examples/demo_app-rollup/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/public/apple-touch-icon.png -------------------------------------------------------------------------------- /examples/demo_app-rollup/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/public/favicon.ico -------------------------------------------------------------------------------- /examples/demo_app-rollup/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/storage/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/test/controllers/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/test/fixtures/files/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/test/helpers/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/test/integration/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/integration/external_asset_pipeline_integration_test.rb: -------------------------------------------------------------------------------- 1 | ../../../../test/integration/external_asset_pipeline_integration_test.rb -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/test/mailers/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/test/models/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/test/system/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | # parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /examples/demo_app-rollup/tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/tmp/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/tmp/pids/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/tmp/pids/.keep -------------------------------------------------------------------------------- /examples/demo_app-rollup/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app-rollup/vendor/.keep -------------------------------------------------------------------------------- /examples/demo_app/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/demo_app/.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark the yarn lockfile as having been generated. 7 | yarn.lock linguist-generated 8 | 9 | # Mark any vendored files as having been vendored. 10 | vendor/* linguist-vendored 11 | -------------------------------------------------------------------------------- /examples/demo_app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-* 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore pidfiles, but keep the directory. 21 | /tmp/pids/* 22 | !/tmp/pids/ 23 | !/tmp/pids/.keep 24 | 25 | # Ignore uploaded files in development. 26 | /storage/* 27 | !/storage/.keep 28 | 29 | /public/assets 30 | .byebug_history 31 | 32 | # Ignore master key for decrypting credentials and more. 33 | /config/master.key 34 | 35 | /public/packs 36 | /public/packs-test 37 | /node_modules 38 | /yarn-error.log 39 | yarn-debug.log* 40 | .yarn-integrity 41 | -------------------------------------------------------------------------------- /examples/demo_app/.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.6.1 2 | -------------------------------------------------------------------------------- /examples/demo_app/README.md: -------------------------------------------------------------------------------- 1 | # ExternalAssetPipeline Demo with Webpack 2 | 3 | This example uses [`webpack`] with [`webpack-assets-manifest`] to build the 4 | assets and generate the manifest. Refer to the [`package.json`](./package.json) 5 | and [`webpack.config.js`](./webpack.config.js) to see the specifics. 6 | 7 | [`webpack`]: https://webpack.js.org 8 | [`webpack-assets-manifest`]: https://github.com/webdeveric/webpack-assets-manifest 9 | 10 | ## Working with assets 11 | 12 | ### Watch mode (incremental recompilation) 13 | 14 | `bin/yarn watch` 15 | 16 | ### Development build 17 | 18 | `bin/yarn build` 19 | 20 | ### Production build 21 | 22 | `NODE_ENV=production bin/yarn build` 23 | -------------------------------------------------------------------------------- /examples/demo_app/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /examples/demo_app/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | -------------------------------------------------------------------------------- /examples/demo_app/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/app/assets/images/.keep -------------------------------------------------------------------------------- /examples/demo_app/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's 6 | * vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS 10 | * files in this directory. Styles in this file should be added after the last require_* statement. 11 | * It is generally better to create a new file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /examples/demo_app/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app/app/controllers/home_controller.rb: -------------------------------------------------------------------------------- 1 | class HomeController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /examples/demo_app/app/javascript/packs/application.js: -------------------------------------------------------------------------------- 1 | import * as ActiveStorage from '@rails/activestorage'; 2 | import Rails from '@rails/ujs'; 3 | import Turbolinks from 'turbolinks'; 4 | 5 | Rails.start(); 6 | Turbolinks.start(); 7 | ActiveStorage.start(); 8 | -------------------------------------------------------------------------------- /examples/demo_app/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /examples/demo_app/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /examples/demo_app/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/app/models/concerns/.keep -------------------------------------------------------------------------------- /examples/demo_app/app/views/home/index.html.erb: -------------------------------------------------------------------------------- 1 |

Home#index

2 | -------------------------------------------------------------------------------- /examples/demo_app/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DemoApp 5 | 6 | <%= csrf_meta_tags %> 7 | <%= csp_meta_tag %> 8 | 9 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 10 | <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> 11 | 12 | 13 | 14 | <%= yield %> 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/demo_app/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/demo_app/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /examples/demo_app/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | APP_PATH = File.expand_path('../config/application', __dir__) 4 | require_relative "../config/boot" 5 | require "rails/commands" 6 | -------------------------------------------------------------------------------- /examples/demo_app/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | require_relative "../config/boot" 4 | require "rake" 5 | Rake.application.run 6 | -------------------------------------------------------------------------------- /examples/demo_app/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path('..', __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # Install JavaScript dependencies 21 | system! 'bin/yarn' 22 | 23 | # puts "\n== Copying sample files ==" 24 | # unless File.exist?('config/database.yml') 25 | # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' 26 | # end 27 | 28 | puts "\n== Preparing database ==" 29 | system! 'bin/rails db:prepare' 30 | 31 | puts "\n== Removing old logs and tempfiles ==" 32 | system! 'bin/rails log:clear tmp:clear' 33 | 34 | puts "\n== Restarting application server ==" 35 | system! 'bin/rails restart' 36 | end 37 | -------------------------------------------------------------------------------- /examples/demo_app/bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) 3 | gem "bundler" 4 | require "bundler" 5 | 6 | # Load Spring without loading other gems in the Gemfile, for speed. 7 | Bundler.locked_gems&.specs&.find { |spec| spec.name == "spring" }&.tap do |spring| 8 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 9 | gem "spring", spring.version 10 | require "spring/binstub" 11 | rescue Gem::LoadError 12 | # Ignore when Spring is not installed. 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /examples/demo_app/bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | yarn = ENV["PATH"].split(File::PATH_SEPARATOR). 5 | select { |dir| File.expand_path(dir) != __dir__ }. 6 | product(["yarn", "yarn.cmd", "yarn.ps1"]). 7 | map { |dir, file| File.expand_path(file, dir) }. 8 | find { |file| File.executable?(file) } 9 | 10 | if yarn 11 | exec yarn, *ARGV 12 | else 13 | $stderr.puts "Yarn executable was not detected in the system." 14 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 15 | exit 1 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /examples/demo_app/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /examples/demo_app/config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails/all" 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | require "external_asset_pipeline/railtie" 10 | 11 | module DemoApp 12 | class Application < Rails::Application 13 | # Initialize configuration defaults for originally generated Rails version. 14 | config.load_defaults 6.1 15 | 16 | config.external_asset_pipeline.fall_back_to_sprockets = true 17 | 18 | # Configuration for the application, engines, and railties goes here. 19 | # 20 | # These settings can be overridden in specific environments using the files 21 | # in config/environments, which are processed later. 22 | # 23 | # config.time_zone = "Central Time (US & Canada)" 24 | # config.eager_load_paths << Rails.root.join("extras") 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /examples/demo_app/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /examples/demo_app/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: demo_app_production 11 | -------------------------------------------------------------------------------- /examples/demo_app/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | vxtg4pPKbAkOSkchm3PAAlCd7NtuzSnWWAOObmraPqiKN1Ifxb33nkir3vUfR/Xswg3toKpGNUuiGu7mci0/Vx+xkB/oSrNmMUYz6te8ju/Ys8aUNdhfk6dG1fECaNwsMICvSGSXE6Yp9DjjztHAn0h9QuPL/EKQawtcym9lbz3WjfB14UIcuE3DIJWdTnipG4nSU+NMu55/trILNeFiU8hwrZi4pJPTMZfUODtjk8wJ3Sj6CydnIegMrt10xLMBSJi/yle468er45UWSA2XxoGgXZIuaKHd45lHksJZsnSuYuVzX0mvmk+9boazEvtc0Ut9LCJXjHkdDN8UB5D0OPQiZ4Ja9Ht6wg3b8ePJqnS9MbWHwUiAGYqybQ2AddnP0r7t7AtEPq/GqD5o7w2Vnj7ahDbib3pxC4lf--uEO2JbmjlSZgzy90--OQYCaMH0BT9A/dJLr3Yz6Q== -------------------------------------------------------------------------------- /examples/demo_app/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite. Versions 3.8.0 and up are supported. 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /examples/demo_app/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /examples/demo_app/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /examples/demo_app/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | # Add Yarn node_modules folder to the asset load path. 9 | Rails.application.config.assets.paths << Rails.root.join('node_modules') 10 | 11 | # Precompile additional assets. 12 | # application.js, application.css, and all non-JS/CSS in the app/assets 13 | # folder are already added. 14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 15 | -------------------------------------------------------------------------------- /examples/demo_app/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code 7 | # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". 8 | Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] 9 | -------------------------------------------------------------------------------- /examples/demo_app/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /examples/demo_app/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [ 5 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 6 | ] 7 | -------------------------------------------------------------------------------- /examples/demo_app/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /examples/demo_app/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /examples/demo_app/config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /examples/demo_app/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /examples/demo_app/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /examples/demo_app/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root to: 'home#index' 3 | end 4 | -------------------------------------------------------------------------------- /examples/demo_app/config/spring.rb: -------------------------------------------------------------------------------- 1 | Spring.watch( 2 | ".ruby-version", 3 | ".rbenv-vars", 4 | "tmp/restart.txt", 5 | "tmp/caching-dev.txt" 6 | ) 7 | -------------------------------------------------------------------------------- /examples/demo_app/config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket 23 | 24 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /examples/demo_app/db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 0) do 14 | 15 | end 16 | -------------------------------------------------------------------------------- /examples/demo_app/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /examples/demo_app/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/lib/tasks/.keep -------------------------------------------------------------------------------- /examples/demo_app/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/log/.keep -------------------------------------------------------------------------------- /examples/demo_app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-app", 3 | "private": true, 4 | "dependencies": { 5 | "@rails/activestorage": "^6.1.3", 6 | "@rails/ujs": "^6.1.3", 7 | "turbolinks": "^5.2.0" 8 | }, 9 | "devDependencies": { 10 | "@babel/core": "^7.13.15", 11 | "@babel/preset-env": "^7.13.15", 12 | "babel-loader": "^8.2.2", 13 | "glob": "^7.1.6", 14 | "webpack": "^4.46.0", 15 | "webpack-assets-manifest": "^4.0.5", 16 | "webpack-cli": "^3.3.12", 17 | "webpack-dev-server": "^3.11.2" 18 | }, 19 | "resolutions": { 20 | "sockjs-client": "1.5.2" 21 | }, 22 | "scripts": { 23 | "build": "webpack", 24 | "watch": "webpack --watch" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/demo_app/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /examples/demo_app/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/public/apple-touch-icon.png -------------------------------------------------------------------------------- /examples/demo_app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/public/favicon.ico -------------------------------------------------------------------------------- /examples/demo_app/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /examples/demo_app/storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/storage/.keep -------------------------------------------------------------------------------- /examples/demo_app/test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /examples/demo_app/test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /examples/demo_app/test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/test/controllers/.keep -------------------------------------------------------------------------------- /examples/demo_app/test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/test/fixtures/files/.keep -------------------------------------------------------------------------------- /examples/demo_app/test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/test/helpers/.keep -------------------------------------------------------------------------------- /examples/demo_app/test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/test/integration/.keep -------------------------------------------------------------------------------- /examples/demo_app/test/integration/external_asset_pipeline_integration_test.rb: -------------------------------------------------------------------------------- 1 | ../../../../test/integration/external_asset_pipeline_integration_test.rb -------------------------------------------------------------------------------- /examples/demo_app/test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/test/mailers/.keep -------------------------------------------------------------------------------- /examples/demo_app/test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/test/models/.keep -------------------------------------------------------------------------------- /examples/demo_app/test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/test/system/.keep -------------------------------------------------------------------------------- /examples/demo_app/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | # parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /examples/demo_app/tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/tmp/.keep -------------------------------------------------------------------------------- /examples/demo_app/tmp/pids/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/tmp/pids/.keep -------------------------------------------------------------------------------- /examples/demo_app/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails-front-end/external_asset_pipeline/af7651e4029b43844feba46ef3168f6efead173e/examples/demo_app/vendor/.keep -------------------------------------------------------------------------------- /lib/external_asset_pipeline.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'external_asset_pipeline/version' 4 | 5 | module ExternalAssetPipeline 6 | class Error < StandardError; end 7 | 8 | class AssetNotFound < Error; end 9 | 10 | class << self 11 | attr_accessor :manifest 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/external_asset_pipeline/dev_server.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'net/http' 4 | 5 | module ExternalAssetPipeline 6 | class DevServer 7 | def initialize(config) 8 | @config = config 9 | end 10 | 11 | def get(path) 12 | Net::HTTP.new(@config.host, @config.port).get(path) 13 | end 14 | 15 | def origin 16 | @config.public_origin || "http://#{@config.host}:#{@config.port}" 17 | end 18 | 19 | def running? 20 | Socket.tcp( 21 | @config.host, 22 | @config.port, 23 | connect_timeout: @config.connect_timeout 24 | ).close 25 | true 26 | rescue StandardError 27 | false 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/external_asset_pipeline/helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'external_asset_pipeline' 4 | 5 | module ExternalAssetPipeline 6 | module Helper 7 | # This helper method can be overridden to return a different Manifest 8 | # instance, e.g. to have distinct instances in different rails engines. 9 | def external_asset_pipeline_manifest 10 | ExternalAssetPipeline.manifest 11 | end 12 | 13 | # Overrides the built-in 14 | # `ActionView::Helpers::AssetUrlHelper#compute_asset_path` to use the 15 | # external asset pipeline, in the same manner that sprockets-rails does: 16 | # https://github.com/rails/sprockets-rails/blob/v3.2.1/lib/sprockets/rails/helper.rb#L74-L96 17 | def compute_asset_path(source, options = {}) 18 | manifest = external_asset_pipeline_manifest 19 | asset = manifest.find(source) 20 | 21 | options[:host] = asset[:host] if asset && asset[:host] 22 | 23 | return asset[:path] if asset 24 | return super if manifest.fall_back_to_sprockets? 25 | 26 | raise AssetNotFound, 27 | "The asset #{source.inspect} is not present in the asset manifest" 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/external_asset_pipeline/manifest.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'json' 4 | 5 | module ExternalAssetPipeline 6 | class Manifest 7 | def initialize(config) 8 | @config = config 9 | end 10 | 11 | def find(name) 12 | value = data[name.to_s] 13 | { path: "#{@config.manifest_value_prefix}#{value}" } if value 14 | end 15 | 16 | def fall_back_to_sprockets? 17 | @config.fall_back_to_sprockets? 18 | end 19 | 20 | private 21 | 22 | def data 23 | if @config.cache_manifest? 24 | @data ||= load 25 | else 26 | load 27 | end 28 | end 29 | 30 | def load 31 | JSON.parse(@config.manifest_path.read) 32 | rescue Errno::ENOENT 33 | warning = "No file exists at path #{@config.manifest_path}; "\ 34 | 'treating it as an empty manifest' 35 | @config.logger.warn warning 36 | {} 37 | end 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /lib/external_asset_pipeline/priority_manifest.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'json' 4 | 5 | module ExternalAssetPipeline 6 | class PriorityManifest 7 | def initialize(*manifests) 8 | @manifests = manifests 9 | end 10 | 11 | def find(name) 12 | @manifests.lazy.map { |manifest| manifest.find name }.find(&:itself) 13 | end 14 | 15 | def fall_back_to_sprockets? 16 | @manifests.any?(&:fall_back_to_sprockets?) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/external_asset_pipeline/server_manifest.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'json' 4 | 5 | require 'external_asset_pipeline/manifest' 6 | 7 | module ExternalAssetPipeline 8 | class ServerManifest < Manifest 9 | def initialize(config:, server:) 10 | @server = server 11 | super(config) 12 | end 13 | 14 | def find(name) 15 | value = super 16 | value&.merge(host: @server.origin) 17 | end 18 | 19 | private 20 | 21 | def load 22 | if @server.running? 23 | manifest_path = "#{@config.assets_prefix}/#{@config.manifest_filename}" 24 | response = @server.get(manifest_path) 25 | JSON.parse response.body 26 | else 27 | warning = 28 | "#{@server.class} is not running; returning empty ServerManifest" 29 | @config.logger.warn warning 30 | {} 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/external_asset_pipeline/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ExternalAssetPipeline 4 | module VERSION 5 | MAJOR = 0 6 | MINOR = 8 7 | PATCH = 0 8 | 9 | STRING = [MAJOR, MINOR, PATCH].join('.') 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /script/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # script/bootstrap: 4 | # Resolve all dependencies that the project requires. 5 | 6 | set -e 7 | 8 | cd "$(dirname "$0")/.." 9 | 10 | echo "==> Installing gem dependencies..." 11 | bundle check || bundle install 12 | -------------------------------------------------------------------------------- /script/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require 'bundler/setup' 5 | require 'external_asset_pipeline' 6 | 7 | # You can add fixtures and/or initialization code here to make experimenting 8 | # with your gem easier. You can also use a different console, if you like. 9 | 10 | # (If you use this, don't forget to add pry to your Gemfile!) 11 | # require "pry" 12 | # Pry.start 13 | 14 | require 'irb' 15 | IRB.start(__FILE__) 16 | -------------------------------------------------------------------------------- /script/lint: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # script/lint: 4 | # Run the linter for the project. 5 | 6 | set -e 7 | 8 | cd "$(dirname "$0")/.." 9 | 10 | echo "==> Running rubocop..." 11 | bundle exec rubocop 12 | -------------------------------------------------------------------------------- /script/test: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # script/test: 4 | # Run test suite for the project. 5 | 6 | set -e 7 | 8 | cd "$(dirname "$0")/.." 9 | 10 | echo "==> Running tests..." 11 | bundle exec rake test 12 | -------------------------------------------------------------------------------- /test/.rubocop.yml: -------------------------------------------------------------------------------- 1 | inherit_from: ../.rubocop.yml 2 | 3 | Metrics/AbcSize: 4 | Max: 45 5 | 6 | Metrics/MethodLength: 7 | Max: 25 8 | -------------------------------------------------------------------------------- /test/external_asset_pipeline/logger_double.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ExternalAssetPipeline 4 | class LoggerDouble 5 | attr_reader :messages 6 | 7 | def warn(message) 8 | @messages ||= [] 9 | @messages << message 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/external_asset_pipeline/server_double.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'external_asset_pipeline/dev_server' 4 | 5 | module ExternalAssetPipeline 6 | class ServerDouble < DevServer 7 | attr_accessor :running 8 | attr_reader :path 9 | 10 | def get(path) 11 | @path = path 12 | 13 | Struct.new(:body).new( 14 | JSON.generate( 15 | 'application.js' => 'application-from-server.js', 16 | 'application.css' => 'application-from-server.css' 17 | ) 18 | ) 19 | end 20 | 21 | def running? 22 | running 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /test/external_asset_pipeline_test.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'test_helper' 4 | 5 | class ExternalAssetPipelineTest < Minitest::Test 6 | def test_that_it_has_a_version_number 7 | refute_nil ::ExternalAssetPipeline::VERSION::MAJOR 8 | assert_kind_of Integer, ::ExternalAssetPipeline::VERSION::MAJOR 9 | refute_nil ::ExternalAssetPipeline::VERSION::MINOR 10 | assert_kind_of Integer, ::ExternalAssetPipeline::VERSION::MINOR 11 | refute_nil ::ExternalAssetPipeline::VERSION::PATCH 12 | assert_kind_of Integer, ::ExternalAssetPipeline::VERSION::PATCH 13 | 14 | version_string = [ 15 | ::ExternalAssetPipeline::VERSION::MAJOR, 16 | ::ExternalAssetPipeline::VERSION::MINOR, 17 | ::ExternalAssetPipeline::VERSION::PATCH 18 | ].join('.') 19 | assert_equal version_string, ::ExternalAssetPipeline::VERSION::STRING 20 | end 21 | 22 | def test_that_manifest_can_be_set 23 | assert_nil ExternalAssetPipeline.manifest 24 | 25 | ExternalAssetPipeline.manifest = 'foo' 26 | 27 | assert_equal 'foo', ExternalAssetPipeline.manifest 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /test/test_app/public/assets/.asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "application.css": "application-3rd-manifest.css", 3 | "application.js": "application-3rd-manifest.js", 4 | "foo.js": "foo-3rd-manifest.js", 5 | "unique.css": "unique-3rd-manifest.css" 6 | } 7 | -------------------------------------------------------------------------------- /test/test_app/public/assets/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "application.js": "application-2nd-manifest.js", 3 | "foo.js": "foo-2nd-manifest.js" 4 | } 5 | -------------------------------------------------------------------------------- /test/test_app/public/packs/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "application.css": "application-2ea8c3891d.css", 3 | "application.js": "application-7b3dc2436f7956c77987.js" 4 | } 5 | -------------------------------------------------------------------------------- /test/test_app/public/packs/manifest_with_prefixed_values.json: -------------------------------------------------------------------------------- 1 | { 2 | "application.css": "/packs/application-2ea8c3891d.css", 3 | "application.js": "/packs/application-7b3dc2436f7956c77987.js" 4 | } 5 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | $LOAD_PATH.unshift File.expand_path('../lib', __dir__) 4 | require 'external_asset_pipeline' 5 | 6 | require 'minitest/autorun' 7 | --------------------------------------------------------------------------------