forked from e621ng/e621ng
Update webpacker and fix a bunch of broken things with it
This commit is contained in:
parent
1861441100
commit
1fdc3926df
18
.babelrc
18
.babelrc
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
["env", {
|
|
||||||
"modules": false,
|
|
||||||
"targets": {
|
|
||||||
"browsers": "> 1%",
|
|
||||||
"uglify": true
|
|
||||||
},
|
|
||||||
"useBuiltIns": true
|
|
||||||
}]
|
|
||||||
],
|
|
||||||
|
|
||||||
"plugins": [
|
|
||||||
"syntax-dynamic-import",
|
|
||||||
"transform-object-rest-spread",
|
|
||||||
["transform-class-properties", { "spec": true }]
|
|
||||||
]
|
|
||||||
}
|
|
8
.gitignore
vendored
8
.gitignore
vendored
@ -26,10 +26,12 @@ script/scratch.*
|
|||||||
test/fixtures/vcr_cassettes
|
test/fixtures/vcr_cassettes
|
||||||
.gitconfig
|
.gitconfig
|
||||||
test/reports
|
test/reports
|
||||||
|
|
||||||
|
.idea
|
||||||
|
.vagrant
|
||||||
|
|
||||||
|
/public/packs
|
||||||
/public/packs-test
|
/public/packs-test
|
||||||
/node_modules
|
/node_modules
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
.yarn-integrity
|
.yarn-integrity
|
||||||
public/packs
|
|
||||||
.idea
|
|
||||||
.vagrant
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
plugins:
|
|
||||||
postcss-import: {}
|
|
||||||
postcss-cssnext: {}
|
|
14
Gemfile.lock
14
Gemfile.lock
@ -111,7 +111,7 @@ GEM
|
|||||||
chronic (0.10.2)
|
chronic (0.10.2)
|
||||||
cityhash (0.9.0)
|
cityhash (0.9.0)
|
||||||
coderay (1.1.2)
|
coderay (1.1.2)
|
||||||
concurrent-ruby (1.1.3)
|
concurrent-ruby (1.1.5)
|
||||||
connection_pool (2.2.2)
|
connection_pool (2.2.2)
|
||||||
crack (0.4.3)
|
crack (0.4.3)
|
||||||
safe_yaml (~> 1.0.0)
|
safe_yaml (~> 1.0.0)
|
||||||
@ -146,7 +146,7 @@ GEM
|
|||||||
faraday
|
faraday
|
||||||
multi_json
|
multi_json
|
||||||
equalizer (0.0.11)
|
equalizer (0.0.11)
|
||||||
erubi (1.7.1)
|
erubi (1.8.0)
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
factory_bot (4.8.2)
|
factory_bot (4.8.2)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
@ -195,7 +195,7 @@ GEM
|
|||||||
multi_xml (>= 0.5.2)
|
multi_xml (>= 0.5.2)
|
||||||
httpclient (2.8.3)
|
httpclient (2.8.3)
|
||||||
hurley (0.2)
|
hurley (0.2)
|
||||||
i18n (1.2.0)
|
i18n (1.6.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
jmespath (1.4.0)
|
jmespath (1.4.0)
|
||||||
jquery-rails (4.3.3)
|
jquery-rails (4.3.3)
|
||||||
@ -291,10 +291,10 @@ GEM
|
|||||||
ptools (1.3.5-universal-mingw32)
|
ptools (1.3.5-universal-mingw32)
|
||||||
win32-file (>= 0.7.0)
|
win32-file (>= 0.7.0)
|
||||||
public_suffix (3.0.2)
|
public_suffix (3.0.2)
|
||||||
rack (2.0.6)
|
rack (2.0.7)
|
||||||
rack-protection (2.0.3)
|
rack-protection (2.0.3)
|
||||||
rack
|
rack
|
||||||
rack-proxy (0.6.4)
|
rack-proxy (0.6.5)
|
||||||
rack
|
rack
|
||||||
rack-test (1.1.0)
|
rack-test (1.1.0)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
@ -324,7 +324,7 @@ GEM
|
|||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.19.0, < 2.0)
|
thor (>= 0.19.0, < 2.0)
|
||||||
raindrops (0.19.0)
|
raindrops (0.19.0)
|
||||||
rake (12.3.2)
|
rake (12.3.3)
|
||||||
rakismet (1.5.4)
|
rakismet (1.5.4)
|
||||||
rb-fsevent (0.10.3)
|
rb-fsevent (0.10.3)
|
||||||
rb-inotify (0.9.10)
|
rb-inotify (0.9.10)
|
||||||
@ -450,7 +450,7 @@ GEM
|
|||||||
addressable (>= 2.3.6)
|
addressable (>= 2.3.6)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
hashdiff
|
hashdiff
|
||||||
webpacker (4.0.0.pre.pre.2)
|
webpacker (4.0.7)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
rack-proxy (>= 0.6.1)
|
rack-proxy (>= 0.6.1)
|
||||||
railties (>= 4.2)
|
railties (>= 4.2)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<input type="text" size="50" v-model="realValue" @keyup.enter="add"/>
|
<input type="text" size="50" v-model="realValue" @keyup.enter="add"/>
|
||||||
<button @click="remove" v-if="index !== 0">-</button>
|
<button @click="remove" v-if="index !== 0">-</button>
|
||||||
<button @click="add" v-if="last && index < 4">+</button>
|
<button @click="add" v-if="last && index < 9">+</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
<%= raw Danbooru.config.custom_html_header_content %>
|
<%= raw Danbooru.config.custom_html_header_content %>
|
||||||
<script src="/vendor/jquery-3.4.1.min.js" integrity="sha384-v/CvOfYoICV4azK6zXTy9qXP6UwbdbFVuxd2Lorpes7n5YVsaU1bQqIalcktKchl" crossorigin="anonymous"></script>
|
<script src="/vendor/jquery-3.4.1.min.js" integrity="sha384-v/CvOfYoICV4azK6zXTy9qXP6UwbdbFVuxd2Lorpes7n5YVsaU1bQqIalcktKchl" crossorigin="anonymous"></script>
|
||||||
<link rel="stylesheet" href="/vendor/fontawesome/css/all.min.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
<link rel="stylesheet" href="/vendor/fontawesome/css/all.min.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
||||||
<%= javascript_pack_tag "application" %>
|
|
||||||
<%= stylesheet_pack_tag "application" %>
|
<%= stylesheet_pack_tag "application" %>
|
||||||
|
<%= javascript_pack_tag "application" %>
|
||||||
<%= yield :html_header %>
|
<%= yield :html_header %>
|
||||||
</head>
|
</head>
|
||||||
<body lang="en">
|
<body lang="en">
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
||||||
<script src="/vendor/jquery-3.4.1.min.js" integrity="sha384-v/CvOfYoICV4azK6zXTy9qXP6UwbdbFVuxd2Lorpes7n5YVsaU1bQqIalcktKchl" crossorigin="anonymous"></script>
|
<script src="/vendor/jquery-3.4.1.min.js" integrity="sha384-v/CvOfYoICV4azK6zXTy9qXP6UwbdbFVuxd2Lorpes7n5YVsaU1bQqIalcktKchl" crossorigin="anonymous"></script>
|
||||||
<link rel="stylesheet" href="/vendor/fontawesome/css/all.min.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
<link rel="stylesheet" href="/vendor/fontawesome/css/all.min.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
||||||
<%= javascript_pack_tag "application" %>
|
|
||||||
<%= stylesheet_pack_tag "application" %>
|
<%= stylesheet_pack_tag "application" %>
|
||||||
|
<%= javascript_pack_tag "application" %>
|
||||||
<% if CurrentUser.user.custom_style.present? %>
|
<% if CurrentUser.user.custom_style.present? %>
|
||||||
<%= stylesheet_link_tag custom_style_users_path, :media => "screen" %>
|
<%= stylesheet_link_tag custom_style_users_path, :media => "screen" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
72
babel.config.js
Normal file
72
babel.config.js
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
module.exports = function(api) {
|
||||||
|
var validEnv = ['development', 'test', 'production']
|
||||||
|
var currentEnv = api.env()
|
||||||
|
var isDevelopmentEnv = api.env('development')
|
||||||
|
var isProductionEnv = api.env('production')
|
||||||
|
var isTestEnv = api.env('test')
|
||||||
|
|
||||||
|
if (!validEnv.includes(currentEnv)) {
|
||||||
|
throw new Error(
|
||||||
|
'Please specify a valid `NODE_ENV` or ' +
|
||||||
|
'`BABEL_ENV` environment variables. Valid values are "development", ' +
|
||||||
|
'"test", and "production". Instead, received: ' +
|
||||||
|
JSON.stringify(currentEnv) +
|
||||||
|
'.'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
presets: [
|
||||||
|
isTestEnv && [
|
||||||
|
require('@babel/preset-env').default,
|
||||||
|
{
|
||||||
|
targets: {
|
||||||
|
node: 'current'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
(isProductionEnv || isDevelopmentEnv) && [
|
||||||
|
require('@babel/preset-env').default,
|
||||||
|
{
|
||||||
|
forceAllTransforms: true,
|
||||||
|
useBuiltIns: 'entry',
|
||||||
|
corejs: 3,
|
||||||
|
modules: false,
|
||||||
|
exclude: ['transform-typeof-symbol']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
].filter(Boolean),
|
||||||
|
plugins: [
|
||||||
|
require('babel-plugin-macros'),
|
||||||
|
require('@babel/plugin-syntax-dynamic-import').default,
|
||||||
|
isTestEnv && require('babel-plugin-dynamic-import-node'),
|
||||||
|
require('@babel/plugin-transform-destructuring').default,
|
||||||
|
[
|
||||||
|
require('@babel/plugin-proposal-class-properties').default,
|
||||||
|
{
|
||||||
|
loose: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
require('@babel/plugin-proposal-object-rest-spread').default,
|
||||||
|
{
|
||||||
|
useBuiltIns: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
require('@babel/plugin-transform-runtime').default,
|
||||||
|
{
|
||||||
|
helpers: false,
|
||||||
|
regenerator: true,
|
||||||
|
corejs: false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
require('@babel/plugin-transform-regenerator').default,
|
||||||
|
{
|
||||||
|
async: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
].filter(Boolean)
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
||||||
ENV["NODE_ENV"] ||= ENV["NODE_ENV"] || "development"
|
ENV["NODE_ENV"] ||= "development"
|
||||||
|
|
||||||
require "pathname"
|
require "pathname"
|
||||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
||||||
@ -12,4 +12,8 @@ require "bundler/setup"
|
|||||||
|
|
||||||
require "webpacker"
|
require "webpacker"
|
||||||
require "webpacker/webpack_runner"
|
require "webpacker/webpack_runner"
|
||||||
Webpacker::WebpackRunner.run(ARGV)
|
|
||||||
|
APP_ROOT = File.expand_path("..", __dir__)
|
||||||
|
Dir.chdir(APP_ROOT) do
|
||||||
|
Webpacker::WebpackRunner.run(ARGV)
|
||||||
|
end
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
||||||
ENV["NODE_ENV"] ||= ENV["NODE_ENV"] || "development"
|
ENV["NODE_ENV"] ||= "development"
|
||||||
|
|
||||||
require "pathname"
|
require "pathname"
|
||||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
||||||
@ -12,4 +12,8 @@ require "bundler/setup"
|
|||||||
|
|
||||||
require "webpacker"
|
require "webpacker"
|
||||||
require "webpacker/dev_server_runner"
|
require "webpacker/dev_server_runner"
|
||||||
Webpacker::DevServerRunner.run(ARGV)
|
|
||||||
|
APP_ROOT = File.expand_path("..", __dir__)
|
||||||
|
Dir.chdir(APP_ROOT) do
|
||||||
|
Webpacker::DevServerRunner.run(ARGV)
|
||||||
|
end
|
||||||
|
@ -3,8 +3,11 @@
|
|||||||
default: &default
|
default: &default
|
||||||
source_path: app/javascript
|
source_path: app/javascript
|
||||||
source_entry_path: packs
|
source_entry_path: packs
|
||||||
|
public_root_path: public
|
||||||
public_output_path: packs
|
public_output_path: packs
|
||||||
cache_path: tmp/cache/webpacker
|
cache_path: tmp/cache/webpacker
|
||||||
|
check_yarn_integrity: false
|
||||||
|
webpack_compile_output: false
|
||||||
|
|
||||||
# Additional paths webpack should lookup modules
|
# Additional paths webpack should lookup modules
|
||||||
# ['app/assets', 'engine/foo/app/assets']
|
# ['app/assets', 'engine/foo/app/assets']
|
||||||
@ -13,8 +16,26 @@ default: &default
|
|||||||
# Reload manifest.json on all requests so we reload latest compiled packs
|
# Reload manifest.json on all requests so we reload latest compiled packs
|
||||||
cache_manifest: false
|
cache_manifest: false
|
||||||
|
|
||||||
|
# Extract and emit a css file
|
||||||
|
extract_css: true
|
||||||
|
|
||||||
|
static_assets_extensions:
|
||||||
|
- .jpg
|
||||||
|
- .jpeg
|
||||||
|
- .png
|
||||||
|
- .gif
|
||||||
|
- .tiff
|
||||||
|
- .ico
|
||||||
|
- .svg
|
||||||
|
- .eot
|
||||||
|
- .otf
|
||||||
|
- .ttf
|
||||||
|
- .woff
|
||||||
|
- .woff2
|
||||||
|
|
||||||
extensions:
|
extensions:
|
||||||
- .erb
|
- .erb
|
||||||
|
- .mjs
|
||||||
- .js
|
- .js
|
||||||
- .sass
|
- .sass
|
||||||
- .scss
|
- .scss
|
||||||
@ -32,6 +53,9 @@ development:
|
|||||||
<<: *default
|
<<: *default
|
||||||
compile: true
|
compile: true
|
||||||
|
|
||||||
|
# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
|
||||||
|
check_yarn_integrity: false
|
||||||
|
|
||||||
# Reference: https://webpack.js.org/configuration/dev-server/
|
# Reference: https://webpack.js.org/configuration/dev-server/
|
||||||
dev_server:
|
dev_server:
|
||||||
https: false
|
https: false
|
||||||
@ -49,7 +73,7 @@ development:
|
|||||||
headers:
|
headers:
|
||||||
'Access-Control-Allow-Origin': '*'
|
'Access-Control-Allow-Origin': '*'
|
||||||
watch_options:
|
watch_options:
|
||||||
ignored: /node_modules/
|
ignored: '**/node_modules/**'
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@ -65,5 +89,8 @@ production:
|
|||||||
# Production depends on precompilation of packs prior to booting for performance.
|
# Production depends on precompilation of packs prior to booting for performance.
|
||||||
compile: false
|
compile: false
|
||||||
|
|
||||||
|
# Extract and emit a css file
|
||||||
|
extract_css: true
|
||||||
|
|
||||||
# Cache manifest.json for performance
|
# Cache manifest.json for performance
|
||||||
cache_manifest: true
|
cache_manifest: true
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rails/webpacker": "^3.5.3",
|
"@rails/webpacker": "^4.0.7",
|
||||||
"debug-loader": "^0.0.1",
|
"debug-loader": "^0.0.1",
|
||||||
"expose-loader": "^0.7.5",
|
"expose-loader": "^0.7.5",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
@ -19,7 +19,7 @@
|
|||||||
"eslint": "^5.3.0",
|
"eslint": "^5.3.0",
|
||||||
"eslint-loader": "^2.1.0",
|
"eslint-loader": "^2.1.0",
|
||||||
"eslint-plugin-ignore-erb": "^0.1.1",
|
"eslint-plugin-ignore-erb": "^0.1.1",
|
||||||
"webpack-dev-server": "^3.1.11"
|
"webpack-dev-server": "^3.7.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "yarn run eslint --plugin eslint-plugin-ignore-erb --ext .js,.js.erb app/javascript/src/javascripts"
|
"lint": "yarn run eslint --plugin eslint-plugin-ignore-erb --ext .js,.js.erb app/javascript/src/javascripts"
|
||||||
|
12
postcss.config.js
Normal file
12
postcss.config.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: [
|
||||||
|
require('postcss-import'),
|
||||||
|
require('postcss-flexbugs-fixes'),
|
||||||
|
require('postcss-preset-env')({
|
||||||
|
autoprefixer: {
|
||||||
|
flexbox: 'no-2009'
|
||||||
|
},
|
||||||
|
stage: 3
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user