Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to webpacker 5.n #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM ruby:2.7.2-buster

RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get remove cmdtest && apt-get install -y nodejs postgresql-client yarn
Expand Down
24 changes: 14 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ PATH
remote: .
specs:
camden_style_guide (0.3.0)
rails (~> 6.0.2, >= 6.0.2.2)
webpacker (~> 4)
rails (~> 6.0.2, >= 6.0.3.4)
webpacker (~> 5)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -69,7 +69,7 @@ GEM
erubi (1.10.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.8.5)
i18n (1.8.7)
concurrent-ruby (~> 1.0)
loofah (2.8.0)
crass (~> 1.0.2)
Expand All @@ -81,11 +81,13 @@ GEM
method_source (1.0.0)
mimemagic (0.3.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.14.2)
mini_portile2 (2.5.0)
minitest (5.14.3)
nio4r (2.5.4)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
nokogiri (1.11.1)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
racc (1.5.2)
rack (2.2.3)
rack-proxy (0.6.5)
rack
Expand Down Expand Up @@ -118,6 +120,7 @@ GEM
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rake (13.0.3)
semantic_range (2.3.1)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand All @@ -129,10 +132,11 @@ GEM
thread_safe (0.3.6)
tzinfo (1.2.9)
thread_safe (~> 0.1)
webpacker (4.3.0)
activesupport (>= 4.2)
webpacker (5.2.1)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down
4 changes: 2 additions & 2 deletions camden_style_guide.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ Gem::Specification.new do |spec|

spec.files = Dir["{app,config,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]

spec.add_dependency "rails", "~> 6.0.2", ">= 6.0.2.2"
spec.add_dependency "webpacker", "~> 4"
spec.add_dependency "rails", "~> 6.0.2", ">= 6.0.3.4"
spec.add_dependency "webpacker", "~> 5"
end
2 changes: 1 addition & 1 deletion lib/camden/style_guide/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Camden
module StyleGuide
VERSION = '0.3.0'
VERSION = '0.4.0'
end
end
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "camden-style-guide",
"private": true,
"dependencies": {
"@rails/webpacker": "4.2.2",
"@rails/webpacker": "6.0.0-pre.1",
"datatables.net": "^1.10.20",
"datatables.net-dt": "^1.10.20",
"flatpickr": "^4.6.3",
Expand All @@ -15,6 +15,6 @@
},
"version": "0.1.0",
"devDependencies": {
"webpack-dev-server": "^3.11.0"
"webpack-dev-server": "^3.11.1"
}
}
1 change: 1 addition & 0 deletions test/dummy/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaults
70 changes: 70 additions & 0 deletions test/dummy/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
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 && [
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
],
(isProductionEnv || isDevelopmentEnv) && [
'@babel/preset-env',
{
forceAllTransforms: true,
useBuiltIns: 'entry',
corejs: 3,
modules: false,
exclude: ['transform-typeof-symbol']
}
]
].filter(Boolean),
plugins: [
'babel-plugin-macros',
'@babel/plugin-syntax-dynamic-import',
isTestEnv && 'babel-plugin-dynamic-import-node',
'@babel/plugin-transform-destructuring',
[
'@babel/plugin-proposal-class-properties',
{
loose: true
}
],
[
'@babel/plugin-proposal-object-rest-spread',
{
useBuiltIns: true
}
],
[
'@babel/plugin-transform-runtime',
{
helpers: false
}
],
[
'@babel/plugin-transform-regenerator',
{
async: false
}
]
].filter(Boolean)
}
}
8 changes: 2 additions & 6 deletions test/dummy/config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ default: &default
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: true

# Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']
resolved_paths: []
additional_paths: []

# Reload manifest.json on all requests so we reload latest compiled packs
cache_manifest: false

# Extract and emit a css file
extract_css: true
extract_css: false

static_assets_extensions:
- .jpg
Expand Down Expand Up @@ -52,9 +51,6 @@ development:
<<: *default
compile: true

# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
check_yarn_integrity: true

# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
Expand Down
12 changes: 12 additions & 0 deletions test/dummy/postcss.config.js
Original file line number Diff line number Diff line change
@@ -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