Skip to content

Commit

Permalink
Merge pull request #327 from nimblehq/release/5.0.0
Browse files Browse the repository at this point in the history
Release/5.0.0
  • Loading branch information
rosle authored Mar 21, 2022
2 parents 9d7edc3 + 7810d17 commit b55db69
Show file tree
Hide file tree
Showing 169 changed files with 1,367 additions and 1,146 deletions.
2 changes: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_GEMFILE: ".template/Gemfile"
8 changes: 4 additions & 4 deletions .github/workflows/test_production_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ env:
APP_NAME: rails_templates
DOCKER_IMAGE: ${{ github.repository }}
DOCKER_REGISTRY_HOST: ${{ secrets.DOCKER_REGISTRY_HOST }}
RUBY_VERSION: 2.7.2
NODE_VERSION: 14
RAILS_VERSION: 6.1.1
RUBY_VERSION: 3.0.1
NODE_VERSION: 16
RAILS_VERSION: 7.0.1

jobs:
build_production:
Expand All @@ -29,7 +29,7 @@ jobs:
uses: nimblehq/[email protected]

- name: Setup Ruby
uses: ruby/setup-ruby@v1.61.1
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/test_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test Template

on: push

env:
RUBY_VERSION: 3.0.1

jobs:
test:
name: Test template
runs-on: ubuntu-latest

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout Repository
uses: actions/[email protected]

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true

- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-template-${{ env.RUBY_VERSION }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-template-${{ env.RUBY_VERSION }}-
- name: Install gems
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run RuboCop
run: bundle exec rubocop --config .template/.rubocop.yml --parallel
12 changes: 6 additions & 6 deletions .github/workflows/test_variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ env:
DOCKER_REGISTRY_HOST: ${{ secrets.DOCKER_REGISTRY_HOST }}
DOCKER_REGISTRY_USERNAME: ${{ github.repository_owner }}
DOCKER_REGISTRY_TOKEN: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
RUBY_VERSION: 2.7.2
NODE_VERSION: 14
RAILS_VERSION: 6.1.1
RUBY_VERSION: 3.0.1
NODE_VERSION: 16
RAILS_VERSION: 7.0.1

jobs:
test:
Expand All @@ -32,7 +32,7 @@ jobs:
uses: nimblehq/[email protected]

- name: Setup Ruby
uses: ruby/setup-ruby@v1.61.1
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
run: |
export BRANCH_TAG=${{ env.BRANCH_TAG }}-${{ matrix.variant }}
cd $APP_NAME
docker-compose pull test || true
docker compose pull test || true
- name: Build docker image
run: |
Expand All @@ -98,7 +98,7 @@ jobs:
run: |
export BRANCH_TAG=${{ env.BRANCH_TAG }}-${{ matrix.variant }}
cd $APP_NAME
docker-compose push test
docker compose push test
- name: Test template
run: |
Expand Down
20 changes: 9 additions & 11 deletions .gitignore.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
append_to_file '.gitignore' do
<<~EOT
# frozen_string_literal: true

# Ignore i18n.js generated files
# If deploy to heroku with git, please remove this as it prevents the files to be committed
/app/javascript/translations/translations.js
append_to_file '.gitignore' do
<<~IGNORE
# Ignore folder information and IDE-specific files
.DS_Store
.idea/*
# Ignore folder information and IDE-specific files
.DS_Store
.idea/*
# Ignore the test coverage results from SimpleCov
/coverage
EOT
# Ignore the test coverage results from SimpleCov
/coverage
IGNORE
end
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require:
require:
- rubocop-rails
- rubocop-rspec
- rubocop-performance
Expand All @@ -15,7 +15,7 @@ AllCops:
- 'node_modules/**/*'
- 'config/**/*'
- 'tmp/**/*'
TargetRubyVersion: 2.7
TargetRubyVersion: 3
NewCops: enable

Style/Documentation:
Expand Down
46 changes: 46 additions & 0 deletions .template/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
AllCops:
NewCops: enable
TargetRubyVersion: 3
Exclude:
- 'vendor/**/*'

Lint/NonDeterministicRequireOrder:
Exclude:
- '../spec/rails_helper.rb'

Metrics/MethodLength:
Exclude:
- '../template.rb'
- '**/template.rb'
- 'hooks/**/*'

Metrics/AbcSize:
Enabled: false

Metrics/BlockLength:
Enabled: false

Metrics/CyclomaticComplexity:
Exclude:
- '../template.rb'
- '**/template.rb'

Metrics/PerceivedComplexity:
Exclude:
- '../template.rb'
- '**/template.rb'

Naming/FileName:
Exclude:
- '**/.tool-versions.rb'
- '**/Dangerfile.rb'
- '**/Gemfile.rb'
- '**/Procfile.dev.rb'

Style/Documentation:
Enabled: false

Style/TrivialAccessors:
Exclude:
- '../template.rb'
- '**/template.rb'
5 changes: 4 additions & 1 deletion .template/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gem 'docker-api' # A lightweight Ruby client for the Docker Remote API
gem 'rspec' # BDD for Ruby
gem 'rspec-wait' # Wait for conditions in RSpec
gem 'rubocop', require: false # A Ruby static code analyzer and formatter, based on the community Ruby style guide.
gem 'serverspec' # RSpec tests for your servers
gem 'docker-api' # A lightweight Ruby client for the Docker Remote API
27 changes: 24 additions & 3 deletions .template/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
diff-lcs (1.4.4)
docker-api (1.34.2)
docker-api (2.2.0)
excon (>= 0.47.0)
multi_json
excon (0.75.0)
excon (0.90.0)
multi_json (1.15.0)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-ssh (6.1.0)
net-telnet (0.1.1)
parallel (1.21.0)
parser (3.1.0.0)
ast (~> 2.4.1)
rainbow (3.1.1)
regexp_parser (2.2.0)
rexml (3.2.5)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
Expand All @@ -29,6 +36,18 @@ GEM
rspec-support (3.9.3)
rspec-wait (0.0.9)
rspec (>= 3, < 4)
rubocop (1.25.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.15.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.1)
parser (>= 3.0.1.1)
ruby-progressbar (1.11.0)
serverspec (2.41.5)
multi_json
rspec (~> 3.0)
Expand All @@ -40,6 +59,7 @@ GEM
net-ssh (>= 2.7)
net-telnet (= 0.1.1)
sfl
unicode-display_width (2.1.0)

PLATFORMS
ruby
Expand All @@ -48,7 +68,8 @@ DEPENDENCIES
docker-api
rspec
rspec-wait
rubocop
serverspec

BUNDLED WITH
2.1.4
2.3.3
4 changes: 2 additions & 2 deletions .template/addons/bootstrap/application.js.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

insert_into_file 'app/javascript/packs/application.js', before: %r{import 'translations/translations'.+\n} do
insert_into_file 'app/javascript/application.js', before: %r{import './translations/translations'.+\n} do
<<~JAVASCRIPT
import 'vendor/bootstrap';
import './vendor/';
JAVASCRIPT
end
4 changes: 2 additions & 2 deletions .template/addons/bootstrap/application.scss.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

insert_into_file 'app/assets/stylesheets/application.scss', after: /\/\/ Dependencies\n/ do
insert_into_file 'app/assets/stylesheets/application.scss', after: %r{// Dependencies\n} do
<<~SCSS
@import 'vendor/bootstrap/bootstrap';
@import './vendor';
SCSS
end
13 changes: 0 additions & 13 deletions .template/addons/bootstrap/javascript/bootstrap/index.js

This file was deleted.

27 changes: 27 additions & 0 deletions .template/addons/bootstrap/javascript/vendor/bootstrap/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import Alert from 'bootstrap/js/dist/alert';
import Button from 'bootstrap/js/dist/button';
import Carousel from 'bootstrap/js/dist/carousel';
import Collapse from 'bootstrap/js/dist/collapse';
import Dropdown from 'bootstrap/js/dist/dropdown';
import Modal from 'bootstrap/js/dist/modal';
import Offcanvas from 'bootstrap/js/dist/offcanvas';
import Popover from 'bootstrap/js/dist/popover';
import ScrollSpy from 'bootstrap/js/dist/scrollspy';
import Tab from 'bootstrap/js/dist/tab';
import Toast from 'bootstrap/js/dist/toast';
import Tooltip from 'bootstrap/js/dist/tooltip';

export default {
Alert,
Button,
Carousel,
Collapse,
Dropdown,
Modal,
Offcanvas,
Popover,
ScrollSpy,
Tab,
Toast,
Tooltip
};
1 change: 1 addition & 0 deletions .template/addons/bootstrap/javascript/vendor/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './bootstrap';
8 changes: 2 additions & 6 deletions .template/addons/bootstrap/package.json.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# frozen_string_literal: true

insert_into_file 'package.json', after: /"i18n-js":.+\n/ do
<<~JSON
"bootstrap": "4.5.2",
"bootstrap.native": "3.0.13",
JSON
end
run 'yarn add [email protected]'
run 'yarn add @popperjs/[email protected]'
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@
// pick what the project requires
// and comment out the rest.

// Configuration
@import 'bootstrap/scss/functions';
@import 'bootstrap/scss/variables';
@import 'bootstrap/scss/mixins';
@import 'bootstrap/scss/utilities';

// Layout & components
@import 'bootstrap/scss/root';
@import 'bootstrap/scss/reboot';
@import 'bootstrap/scss/type';
@import 'bootstrap/scss/utilities';
@import 'bootstrap/scss/images';
@import 'bootstrap/scss/containers';
@import 'bootstrap/scss/grid';
@import 'bootstrap/scss/tables';
@import 'bootstrap/scss/forms';
@import 'bootstrap/scss/buttons';
@import 'bootstrap/scss/tables';
@import 'bootstrap/scss/code';
@import 'bootstrap/scss/transitions';
@import 'bootstrap/scss/dropdown';
@import 'bootstrap/scss/button-group';
@import 'bootstrap/scss/input-group';
@import 'bootstrap/scss/custom-forms';
@import 'bootstrap/scss/nav';
@import 'bootstrap/scss/navbar';
@import 'bootstrap/scss/card';
@import 'bootstrap/scss/accordion';
@import 'bootstrap/scss/breadcrumb';
@import 'bootstrap/scss/pagination';
@import 'bootstrap/scss/badge';
@import 'bootstrap/scss/jumbotron';
@import 'bootstrap/scss/alert';
@import 'bootstrap/scss/progress';
@import 'bootstrap/scss/media';
@import 'bootstrap/scss/list-group';
@import 'bootstrap/scss/close';
@import 'bootstrap/scss/toasts';
Expand All @@ -39,4 +39,10 @@
@import 'bootstrap/scss/popover';
@import 'bootstrap/scss/carousel';
@import 'bootstrap/scss/spinners';
@import 'bootstrap/scss/print';
@import 'bootstrap/scss/offcanvas';

// Helpers
@import 'bootstrap/scss/helpers';

// Utilities
@import 'bootstrap/scss/utilities/api';
1 change: 1 addition & 0 deletions .template/addons/bootstrap/stylesheets/vendor/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import './bootstrap';
Loading

0 comments on commit b55db69

Please sign in to comment.