File tree 8 files changed +366
-356
lines changed
8 files changed +366
-356
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,15 @@ jobs:
13
13
runs-on : ${{ matrix.os }}
14
14
15
15
steps :
16
+ - uses : actions/checkout@v2
17
+ - name : Use Node.js ${{ matrix.node }}
18
+ uses : actions/setup-node@v1
19
+ with :
20
+ node-version : ${{ matrix.node }}
21
+
16
22
- name : Install yarn maybe
17
- run : which yarn || sudo npm install -g yarn
23
+ run : which yarn || npm install -g yarn
18
24
19
- - uses : actions/checkout@v2
20
25
- name : Get yarn cache directory path
21
26
id : yarn-cache-dir-path
22
27
run : echo "::set-output name=dir::$(yarn cache dir)"
29
34
restore-keys : |
30
35
${{ runner.os }}-${{ matrix.node }}-yarn-
31
36
32
- - name : Use Node.js ${{ matrix.node }}
33
- uses : actions/setup-node@v1
34
- with :
35
- node-version : ${{ matrix.node }}
36
-
37
37
- name : Install dependencies
38
38
run : yarn --frozen-lockfile
39
39
Original file line number Diff line number Diff line change 9
9
strategy :
10
10
matrix :
11
11
os : [ubuntu-latest]
12
- node : [14.x ]
12
+ node : [14]
13
13
14
14
runs-on : ${{ matrix.os }}
15
15
16
16
steps :
17
+ - name : Use Node.js ${{ matrix.node }}
18
+ uses : actions/setup-node@v1
19
+ with :
20
+ node-version : ${{ matrix.node }}
21
+
17
22
- name : Install yarn maybe
18
- run : which yarn || sudo npm install -g yarn
23
+ run : which yarn || npm install -g yarn
19
24
20
25
- uses : actions/checkout@v2
21
26
- name : Get yarn cache directory path
30
35
restore-keys : |
31
36
${{ runner.os }}-yarn-
32
37
33
- - name : Use Node.js ${{ matrix.node }}
34
- uses : actions/setup-node@v1
35
- with :
36
- node-version : ${{ matrix.node }}
37
-
38
38
- name : Install dependencies
39
39
run : yarn --frozen-lockfile
40
40
Original file line number Diff line number Diff line change 14
14
fail-fast : false
15
15
matrix :
16
16
os : [ubuntu-latest]
17
+ node : [14]
17
18
ruby : [
18
19
2.4,
19
20
2.5,
55
56
restore-keys : |
56
57
bundle-use-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-gems-
57
58
59
+ - name : Use Node.js ${{ matrix.node }}
60
+ uses : actions/setup-node@v1
61
+ with :
62
+ node-version : ${{ matrix.node }}
63
+
58
64
- name : Install yarn maybe
59
- run : which yarn || sudo npm install -g yarn
65
+ run : which yarn || npm install -g yarn
60
66
61
67
- uses : ruby/setup-ruby@v1
62
68
with :
Original file line number Diff line number Diff line change 1
1
require : rubocop-performance
2
2
AllCops :
3
- TargetRubyVersion : 2.4
3
+ TargetRubyVersion : 2.7
4
4
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
5
5
# to ignore them, so only the ones explicitly set in this file are enabled.
6
6
DisabledByDefault : true
Original file line number Diff line number Diff line change 5
5
namespace :yarn do
6
6
desc "Install all JavaScript dependencies as specified via Yarn"
7
7
task :install do
8
- # Install only production deps when for not usual envs.
9
- valid_node_envs = %w[ test development production ]
10
- node_env = ENV . fetch ( "NODE_ENV" ) do
11
- valid_node_envs . include? ( Rails . env ) ? Rails . env : "production"
12
- end
13
-
14
- yarn_flags =
15
- if `#{ RbConfig . ruby } "#{ Rails . root } /bin/yarn" --version` . start_with? ( "1" )
16
- "--no-progress --frozen-lockfile"
17
- else
18
- "--immutable"
8
+ begin
9
+ # Install only production deps when for not usual envs.
10
+ valid_node_envs = %w[ test development production ]
11
+ node_env = ENV . fetch ( "NODE_ENV" ) do
12
+ valid_node_envs . include? ( Rails . env ) ? Rails . env : "production"
19
13
end
20
14
21
- system (
22
- { "NODE_ENV" => node_env } ,
23
- "#{ RbConfig . ruby } \" #{ Rails . root } /bin/yarn\" install #{ yarn_flags } " ,
24
- exception : true
25
- )
26
- rescue Errno ::ENOENT
27
- $stderr. puts "bin/yarn was not found."
28
- $stderr. puts "Please run `bundle exec rails app:update:bin` to create it."
29
- exit 1
15
+ yarn_flags =
16
+ if `#{ RbConfig . ruby } "#{ Rails . root } /bin/yarn" --version` . start_with? ( "1" )
17
+ "--no-progress --frozen-lockfile"
18
+ else
19
+ "--immutable"
20
+ end
21
+
22
+ system (
23
+ { "NODE_ENV" => node_env } ,
24
+ "#{ RbConfig . ruby } \" #{ Rails . root } /bin/yarn\" install #{ yarn_flags } " ,
25
+ exception : true
26
+ )
27
+ rescue Errno ::ENOENT
28
+ $stderr. puts "bin/yarn was not found."
29
+ $stderr. puts "Please run `bundle exec rails app:update:bin` to create it."
30
+ exit 1
31
+ end
30
32
end
31
33
end
32
34
Original file line number Diff line number Diff line change 37
37
"eslint-plugin-import" : " ^2.24.1" ,
38
38
"eslint-plugin-jsx-a11y" : " ^6.4.1" ,
39
39
"eslint-plugin-react" : " ^7.24.0" ,
40
- "jest" : " ^27.0.6 "
40
+ "jest" : " ^27.1.0 "
41
41
},
42
42
"jest" : {
43
43
"testRegex" : " (/__tests__/.*|(\\ .|/))\\ .jsx?$" ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ describe('Development environment', () => {
14
14
test ( 'should use development config and environment including devServer if WEBPACK_SERVE' , ( ) => {
15
15
process . env . RAILS_ENV = 'development'
16
16
process . env . NODE_ENV = 'development'
17
- process . env . WEBPACK_DEV_SERVER = 'true'
17
+ process . env . WEBPACK_SERVE = 'true'
18
18
const { webpackConfig } = require ( '../index' )
19
19
20
20
expect ( webpackConfig . output . path ) . toEqual ( resolve ( 'public' , 'packs' ) )
@@ -31,7 +31,7 @@ describe('Development environment', () => {
31
31
test ( 'should use development config and environment if WEBPACK_SERVE' , ( ) => {
32
32
process . env . RAILS_ENV = 'development'
33
33
process . env . NODE_ENV = 'development'
34
- process . env . WEBPACK_DEV_SERVER = undefined
34
+ process . env . WEBPACK_SERVE = undefined
35
35
const { webpackConfig } = require ( '../index' )
36
36
37
37
expect ( webpackConfig . output . path ) . toEqual ( resolve ( 'public' , 'packs' ) )
You can’t perform that action at this time.
0 commit comments