Skip to content

Commit

Permalink
Merge pull request #420 from nimblehq/feature/upgrade-node-versions
Browse files Browse the repository at this point in the history
[#383] Upgrade Node and Ruby dependency versions
  • Loading branch information
malparty authored Jul 5, 2023
2 parents f7ca10c + c1b6086 commit 74a4dd7
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .template/addons/bootstrap/package.json.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true

run 'yarn add bootstrap@5.2.3'
run 'yarn add @popperjs/[email protected].2'
run 'yarn add bootstrap@5.3.0'
run 'yarn add @popperjs/[email protected].8'
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Configuration
@import 'bootstrap/scss/functions';
@import 'bootstrap/scss/variables';
@import 'bootstrap/scss/variables-dark';
@import 'bootstrap/scss/maps';
// @import 'sass_maps'; // Optional Sass map overrides here (See: https://getbootstrap.com/docs/5.2/migration/#new-_mapsscss)
// e.g., $theme-colors: map-merge($theme-colors, $custom-theme-colors);
Expand Down
2 changes: 1 addition & 1 deletion .template/addons/phrase/spec/codebase/codebase_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# rubocop:disable RSpec/ExampleLength
it 'does not offend Phrase Pull configuration' do
locale_tags = Dir[File.expand_path(Rails.root.join('config', 'locales', '*.yml'))]
locale_tags = Dir[Rails.root.join('config', 'locales', '*.yml').expand_path]
.map { |path| path.split('/').last }
# ['campaign.en.yml', 'article.en.yml', 'campaign.th.yml', 'en.yml']
.map { |path| path.split('.').first }
Expand Down
35 changes: 19 additions & 16 deletions .template/variants/web/package.json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@
run 'yarn add esbuild'
run 'yarn add postcss postcss-cli autoprefixer'

run 'yarn add --dev @nimblehq/eslint[email protected]'
run 'yarn add --dev eslint'
run 'yarn add --dev stylelint'
run 'yarn add --dev @nimblehq/stylelint-config-nimble'
run 'yarn add --dev @nimblehq/[email protected]'
run 'yarn add --dev @nimblehq/[email protected]'

# Setup scripts
run 'npm set-script eslint "eslint . --color"'
run 'npm set-script eslint:fix "eslint . --color --fix"'
run 'npm set-script stylelint "stylelint **/*.scss --color"'
run 'npm set-script stylelint:fix "stylelint **/*.scss --color --fix"'
run 'npm set-script codebase "yarn eslint && yarn stylelint"'
run 'npm set-script codebase:fix "yarn eslint:fix && yarn stylelint:fix"'
run 'npm pkg set scripts.eslint="eslint . --color"'
run 'npm pkg set scripts.eslint:fix="eslint . --color --fix"'
run 'npm pkg set scripts.stylelint="stylelint **/*.scss --color"'
run 'npm pkg set scripts.stylelint:fix="stylelint **/*.scss --color --fix"'
run 'npm pkg set scripts.codebase="yarn eslint && yarn stylelint"'
run 'npm pkg set scripts.codebase:fix="yarn eslint:fix && yarn stylelint:fix"'

source_stylesheet = 'app/assets/stylesheets/application.scss'
bundled_stylesheet = 'app/assets/builds/application.css'
Expand All @@ -49,17 +51,18 @@
'--style=compressed'
]

run %(npm set-script build "node app/javascript/build.js")
run %(npm pkg set scripts.build="node app/javascript/build.js")
run %(
npm set-script build:css-production \
"sass #{source_stylesheet} #{bundled_stylesheet} #{production_bundled_stylesheet_options.join(' ')}"
npm pkg set scripts.build:css-production="sass\
#{source_stylesheet} #{bundled_stylesheet} #{production_bundled_stylesheet_options.join(' ')}"
)
run %(
npm set-script build:css \
"sass #{source_stylesheet} #{bundled_stylesheet} #{bundled_stylesheet_base_options.join(' ')}"
npm pkg set scripts.build:css="sass\
#{source_stylesheet} #{bundled_stylesheet} #{bundled_stylesheet_base_options.join(' ')}"
)
run %(npm set-script postcss "postcss public/assets/*.css --dir public/assets --config ./")
run %(npm pkg set scripts.postcss="postcss\
public/assets/*.css --dir public/assets --config ./")
run %(
npm set-script build:postcss \
"postcss app/assets/builds/*.css --dir app/assets/builds --config ./",
npm pkg set scripts.build:postcss="postcss\
app/assets/builds/*.css --dir app/assets/builds --config ./",
)
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 16.13.2
nodejs 16.20.1
ruby 3.2.2
6 changes: 3 additions & 3 deletions Gemfile.tt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] # Windows doe
gem 'pundit' # Minimal authorization through OO design and pure Ruby classes

# Translations
# gem 'rails-i18n', '~> 6.0.0' # Translations for Rails
# gem 'rails-i18n', '~> 7.0' # Translations for Rails

group :development do
gem 'foreman' # Manage Procfile-based applications
Expand All @@ -31,7 +31,7 @@ group :development do
gem 'roadie-rails' # Mailers
gem 'spring' # Spring speeds up development by keeping your application running in the background.
gem 'spring-commands-rspec' # This gem implements the rspec command for Spring.
gem 'spring-watcher-listen', '2.0.1' # Makes Spring watch the filesystem for changes using Listen
gem 'spring-watcher-listen', '2.1.0' # Makes Spring watch the filesystem for changes using Listen
end

group :development, :test do
Expand All @@ -53,7 +53,7 @@ group :development, :test do
# Code Analysis
gem 'bullet' # help to kill N+1 queries and unused eager loading
gem 'brakeman', require: false # A static analysis security vulnerability scanner for Ruby on Rails applications
gem 'parser', '3.0.1.1' # Use correct parser version to avoid parser warnings
gem 'parser', '3.2.2.3' # Use correct parser version to avoid parser warnings
gem 'rubocop', require: false # A Ruby static code analyzer and formatter, based on the community Ruby style guide.
gem 'rubocop-rails', require: false # A RuboCop extension focused on enforcing Rails best practices and coding conventions.
gem 'rubocop-rspec', require: false # Code style checking for RSpec files
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ with building complex applications over the years.

- Install ruby and set your local ruby version to `3.2.2`
- Install rails `7.0.6`
- Install node `16.13.2` (For creating web application)
- Install node `16.20.1` (For creating web application)

> 📝 If running on Apple M1, to build docker image, please make sure to set platform to AMD64 by `export DOCKER_DEFAULT_PLATFORM=linux/amd64`
Expand Down
2 changes: 1 addition & 1 deletion spec/codebase/codebase_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
end

it 'does not offend engine prefix name' do
engine_paths = Dir[File.expand_path(Rails.root.join('engines', '*'))]
engine_paths = Dir[Rails.root.join('engines', '*').expand_path]
.select { |f| File.directory? f }
.map { |path| path.split('/').last }
invalid_engine_paths = engine_paths.reject { |path| path.start_with?('APP_NAME_HERE_') }
Expand Down
2 changes: 1 addition & 1 deletion template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}.freeze

if WEB_VARIANT
NODE_VERSION = '16.13.2'
NODE_VERSION = '16.20.1'
NODE_SOURCE_VERSION = '16' # Used in Dockerfile https://github.com/nodesource/distributions
end

Expand Down

0 comments on commit 74a4dd7

Please sign in to comment.