Bump to sprockets 4.0.0 (#6172) [deploy]

* Bump to sprocket 4.0.0

* Add manifest.js

* Link internal/layout.css

* Make it more similar to Rails 5.2 default
This commit is contained in:
rhymes 2020-02-25 00:16:09 +01:00 committed by GitHub
parent f54153d334
commit c3e7179f5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 27 deletions

16
.eslintrc.js Normal file
View file

@ -0,0 +1,16 @@
module.exports = {
env: {
browser: true,
es6: true,
},
extends: 'eslint:recommended',
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
rules: {},
};

View file

@ -88,7 +88,7 @@ gem "sass-rails", "~> 6.0" # Sass adapter for the Rails asset pipeline
gem "sidekiq", "~> 6.0.4" # Sidekiq is used to process background jobs with the help of Redis
gem "sitemap_generator", "~> 6.1" # SitemapGenerator is a framework-agnostic XML Sitemap generator
gem "slack-notifier", "~> 2.3" # A slim ruby wrapper for posting to slack webhooks
gem "sprockets", "~> 3.7" # Sprockets is a Rack-based asset packaging system
gem "sprockets", "~> 4.0" # Sprockets is a Rack-based asset packaging system
gem "staccato", "~> 0.5" # Ruby Google Analytics Measurement
gem "storext", "~> 3.1" # Add type-casting and other features on top of ActiveRecord::Store.store_accessor
gem "stripe", "~> 5.15" # Ruby library for the Stripe API

View file

@ -740,7 +740,7 @@ GEM
spring (2.1.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.7.2)
sprockets (4.0.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
@ -963,7 +963,7 @@ DEPENDENCIES
slack-notifier (~> 2.3)
spring (~> 2.1)
spring-commands-rspec (~> 1.0)
sprockets (~> 3.7)
sprockets (~> 4.0)
staccato (~> 0.5)
stackprof (~> 0.2)
storext (~> 3.1)

View file

@ -0,0 +1,6 @@
// https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= link internal/layout.css
//= link s3_direct_upload.js

View file

@ -10,27 +10,6 @@ Rails.application.config.assets.version = "1.1"
Rails.application.config.assets.paths << Rails.root.join("node_modules")
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Rails.application.config.assets.precompile += %w[favicon.ico]
# Add client/assets/ folders to asset pipeline's search path.
# If you do not want to move existing images and fonts from your Rails app
# you could also consider creating symlinks there that point to the original
# rails directories. In that case, you would not add these paths here.
# Rails.application.config.assets.paths << Rails.root.join("client/assets/stylesheets")
# Rails.application.config.assets.paths << Rails.root.join("client/assets/images")
# Rails.application.config.assets.paths << Rails.root.join("client/assets/fonts")
# Rails.application.config.assets.precompile += %w( generated/server-bundle.js )
Rails.application.config.assets.precompile += %w[minimal.css]
Rails.application.config.assets.precompile += %w[s3_direct_upload.css]
Rails.application.config.assets.precompile += %w[base.js]
Rails.application.config.assets.precompile += %w[hello-dev.js]
Rails.application.config.assets.precompile += %w[s3_direct_upload.js]
Rails.application.config.assets.precompile += %w[classified_listings.css]
Rails.application.config.assets.precompile += %w[lib/xss.js]
Rails.application.config.assets.precompile += %w[lib/pulltorefresh.js]
Rails.application.config.assets.precompile += %w[internal.js]
Rails.application.config.assets.precompile += %w[internal/layout]
Rails.application.config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/
Rails.application.config.assets.precompile += %w[honeybadger-js/dist/honeybadger.js]
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )

View file

@ -21,6 +21,10 @@
}
},
"lint-staged": {
"app/assets/config/manifest.js": [
"prettier --write",
"eslint --fix -c app/assets/javascripts/.eslintrc.js"
],
"*.{js,jsx}": [
"prettier --write",
"eslint --fix"