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

Release 5.7.0 #449

Merged
merged 42 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9a14efb
[#383] Upgrade Rails version
andyduong1920 Jul 3, 2023
46a091c
[#383] Upgrade Ruby version
andyduong1920 Jul 3, 2023
3e26faa
[#383] Use figjam
andyduong1920 Jul 3, 2023
d6a2ba3
[#383] Update the excon and other package to fix the Docker::Containe…
andyduong1920 Jul 3, 2023
3b2c3d6
[#383] Fix rubocop
andyduong1920 Jul 3, 2023
1a3bbf5
Merge pull request #418 from nimblehq/feature/upgrade-rails-version
malparty Jul 3, 2023
c7e95b6
[#383] Pin the deb.nodesource.com instead of deb.debian.org for the n…
andyduong1920 Jul 3, 2023
ce00e6e
[#383] YAML load with aliases: true
andyduong1920 Jul 3, 2023
6592c3b
[#383] Upgrade Nodejs to 16.20.1
andyduong1920 Jul 3, 2023
5f77033
[#383] Upgrade Node and Ruby dependencies
andyduong1920 Jul 3, 2023
442021a
[#383] Correct the version
andyduong1920 Jul 3, 2023
9574f80
[#383] Revert to the working version
andyduong1920 Jul 3, 2023
6b2e6d7
[#383] Fix rubocop
andyduong1920 Jul 3, 2023
d7ea475
[#383] Add eslint and revert bootstrap
andyduong1920 Jul 3, 2023
a085a9f
[#416] Remove sassc
andyduong1920 Jul 3, 2023
b3635db
[#383] Add bootstrap 5.3.0
andyduong1920 Jul 3, 2023
c1b6086
[#383] Revert the i18n-js to 3.8.0
andyduong1920 Jul 4, 2023
f7ca10c
Merge pull request #419 from nimblehq/feature/upgrade-ruby-version
malparty Jul 5, 2023
74a4dd7
Merge pull request #420 from nimblehq/feature/upgrade-node-versions
malparty Jul 5, 2023
8d47972
Merge pull request #423 from nimblehq/chore/remove-sassc
malparty Jul 5, 2023
2217126
[#433] Add the `.keep` file
andyduong1920 Jul 6, 2023
b92f051
[#430] Update the .stylelintignore - Add public/*
andyduong1920 Jul 6, 2023
46573c2
Merge pull request #434 from nimblehq/feature/433-add-keep-file-into-…
malparty Jul 6, 2023
8069b8f
Correct the build:css task
andyduong1920 Jul 4, 2023
63dd5fe
Fix the typo
andyduong1920 Jul 4, 2023
0f39c39
Add the option to build multiple JS files with engines
andyduong1920 Jul 4, 2023
9d3ced5
Add the Alias
andyduong1920 Jul 4, 2023
8c6b585
Remove the duplicate gitignore
andyduong1920 Jul 4, 2023
d58fe53
Correct the out filename
andyduong1920 Jul 4, 2023
bec259c
Remove the alias config
andyduong1920 Jul 6, 2023
6500b69
Merge pull request #427 from nimblehq/chore/some-minor-update
malparty Jul 7, 2023
73ae92a
Merge pull request #435 from nimblehq/feature/430-update-stylelintignore
malparty Jul 7, 2023
e57226f
[#393] Update the Bootstrap vendor fiel
andyduong1920 Jul 7, 2023
d89b317
[#393] Correct the Bootstrap package
andyduong1920 Jul 7, 2023
522b216
update .eslintrc
htoo-eain-lwin Jul 11, 2023
704ae5e
Merge pull request #439 from nimblehq/feature/393-update-bootstrap-file
malparty Jul 11, 2023
23c1455
Merge pull request #442 from htoo-eain-lwin/bug/gh441-update-eslintrc
malparty Jul 12, 2023
7f0c393
Remove the ./bin/dev.sh script in favor of the makefile (#443)
mosharaf13 Jul 13, 2023
c21e356
[#414] Enable source map in css build (#444)
mosharaf13 Jul 13, 2023
7f0418c
[#436] Fix invalid workflow bug for publish wiki workflow (#437)
mosharaf13 Jul 17, 2023
613e39b
[#223] Ignore Danger run on WIP pull request (#432)
mosharaf13 Jul 17, 2023
6c8da12
Add svgeez addon (#445)
mosharaf13 Jul 26, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/test_generated_app.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: 3.0.1
RUBY_VERSION: 3.2.2
NODE_VERSION: 16
RAILS_VERSION: 7.0.1
RAILS_VERSION: 7.0.6

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
4 changes: 2 additions & 2 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: 3.0.1
RUBY_VERSION: 3.2.2
NODE_VERSION: 16
RAILS_VERSION: 7.0.1
RAILS_VERSION: 7.0.6

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test the codebase of the template
on: push

env:
RUBY_VERSION: 3.0.1
RUBY_VERSION: 3.2.2

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
66 changes: 36 additions & 30 deletions .template/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,70 @@ GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
diff-lcs (1.4.4)
diff-lcs (1.5.0)
docker-api (2.2.0)
excon (>= 0.47.0)
multi_json
excon (0.90.0)
excon (0.100.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
multi_json (1.15.0)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-ssh (6.1.0)
net-scp (4.0.0)
net-ssh (>= 2.6.5, < 8.0.0)
net-ssh (7.1.0)
net-telnet (0.1.1)
parallel (1.21.0)
parser (3.1.0.0)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
racc (1.7.1)
rainbow (3.1.1)
regexp_parser (2.2.0)
regexp_parser (2.8.1)
rexml (3.2.5)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (~> 3.12.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.9.1)
rspec-mocks (3.12.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.3)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rspec-wait (0.0.9)
rspec (>= 3, < 4)
rubocop (1.25.0)
rubocop (1.54.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.15.1, < 2.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 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)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
serverspec (2.42.2)
multi_json
rspec (~> 3.0)
rspec-its
specinfra (~> 2.72)
sfl (2.3)
specinfra (2.82.18)
specinfra (2.86.0)
net-scp
net-ssh (>= 2.7)
net-telnet (= 0.1.1)
sfl
unicode-display_width (2.1.0)
unicode-display_width (2.4.2)

PLATFORMS
ruby
Expand Down
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'
73 changes: 37 additions & 36 deletions .template/addons/bootstrap/stylesheets/vendor/_bootstrap.scss
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
// By default every component is imported
// But DO NOT import the whole framework but instead
// pick what the project requires
// and comment out the rest.

// Configuration
// 1. Include functions first (so you can manipulate colors, SVGs, calc, etc)
@import 'bootstrap/scss/functions';

// 2. Include remainder of required Bootstrap stylesheets (including any separate color mode stylesheets)
@import 'bootstrap/scss/variables';
@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);
@import 'bootstrap/scss/variables-dark';

// 3. Include remainder of required parts
@import 'bootstrap/scss/maps';
@import 'bootstrap/scss/mixins';
@import 'bootstrap/scss/root';
@import 'bootstrap/scss/utilities';

// Layout & components
@import 'bootstrap/scss/root';
@import 'bootstrap/scss/reboot';
@import 'bootstrap/scss/type';
@import 'bootstrap/scss/images';
@import 'bootstrap/scss/containers';
@import 'bootstrap/scss/grid';
@import 'bootstrap/scss/tables';
@import 'bootstrap/scss/forms';
// 4. Optionally include any other parts as needed
// By default every component is imported
// But DO NOT import the whole framework but instead
// pick what the project requires
// and comment out the rest.
@import 'bootstrap/scss/accordion';
@import 'bootstrap/scss/alert';
@import 'bootstrap/scss/badge';
@import 'bootstrap/scss/breadcrumb';
@import 'bootstrap/scss/button-group';
@import 'bootstrap/scss/buttons';
@import 'bootstrap/scss/transitions';
@import 'bootstrap/scss/card';
@import 'bootstrap/scss/carousel';
@import 'bootstrap/scss/close';
@import 'bootstrap/scss/containers';
@import 'bootstrap/scss/dropdown';
@import 'bootstrap/scss/button-group';
@import 'bootstrap/scss/forms';
@import 'bootstrap/scss/grid';
@import 'bootstrap/scss/helpers';
@import 'bootstrap/scss/images';
@import 'bootstrap/scss/list-group';
@import 'bootstrap/scss/modal';
@import 'bootstrap/scss/nav';
@import 'bootstrap/scss/navbar';
@import 'bootstrap/scss/card';
@import 'bootstrap/scss/accordion';
@import 'bootstrap/scss/breadcrumb';
@import 'bootstrap/scss/offcanvas';
@import 'bootstrap/scss/pagination';
@import 'bootstrap/scss/badge';
@import 'bootstrap/scss/alert';
@import 'bootstrap/scss/placeholders';
@import 'bootstrap/scss/popover';
@import 'bootstrap/scss/progress';
@import 'bootstrap/scss/list-group';
@import 'bootstrap/scss/close';
@import 'bootstrap/scss/reboot';
@import 'bootstrap/scss/root';
@import 'bootstrap/scss/spinners';
@import 'bootstrap/scss/tables';
@import 'bootstrap/scss/toasts';
@import 'bootstrap/scss/modal';
@import 'bootstrap/scss/tooltip';
@import 'bootstrap/scss/popover';
@import 'bootstrap/scss/carousel';
@import 'bootstrap/scss/spinners';
@import 'bootstrap/scss/offcanvas';

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

// Utilities
// 5. Optionally include utilities API last to generate classes based on the Sass map in `_utilities.scss`
@import 'bootstrap/scss/utilities/api';
3 changes: 2 additions & 1 deletion .template/addons/docker/Dockerfile.tt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ RUN apt-get update -qq && \
ADD https://dl.yarnpkg.com/debian/pubkey.gpg /tmp/yarn-pubkey.gpg
RUN apt-key add /tmp/yarn-pubkey.gpg && rm /tmp/yarn-pubkey.gpg && \
echo "deb http://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \
curl -sL https://deb.nodesource.com/setup_"$NODE_SOURCE_VERSION".x | bash - && \
echo 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 600' > /etc/apt/preferences.d/nodesource && \
curl -fsSL https://deb.nodesource.com/setup_"$NODE_SOURCE_VERSION".x | bash - && \
apt-get update -qq && \
apt-get install -y --no-install-recommends nodejs yarn && \
apt-get clean && \
Expand Down
31 changes: 22 additions & 9 deletions .template/addons/github/.github/workflows/publish_wiki.yml.tt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,30 @@ name: Publish Wiki

on:
push:
paths:
- .github/wiki/**
branches:
- develop
paths:
- .github/wiki/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
publish:
name: Publish Wiki
uses: nimblehq/github-actions-workflows/.github/workflows/[email protected]
with:
USER_NAME: github-wiki-workflow
USER_EMAIL: ${{ secrets.GH_EMAIL }}
secrets:
USER_TOKEN: ${{ secrets.GH_TOKEN }}
name: Publish Github Wiki
runs-on: ubuntu-latest
timeout-minutes: 1

steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Publish Github Wiki
uses: nimblehq/[email protected]
with:
user_name: github-wiki-workflow
user_email: [email protected]
user_access_token: ${{ secrets.USER_ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion .template/addons/github/.github/workflows/test.yml.tt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
needs: unit_tests
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && !contains(join(github.event.pull_request.labels.*.name, ','), 'wip') && !contains(github.event.pull_request.title, '[wip]') && !github.event.pull_request.draft
steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .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 All @@ -16,7 +16,7 @@
# replace en with root as `en` is not a tag
locale_tags[locale_tags.index('en')] = 'root'

phrase_pull_tags = YAML.load_file(Rails.root.join('.phrase.yml'))
phrase_pull_tags = YAML.load_file(Rails.root.join('.phrase.yml'), aliases: true)
.dig('phrase', 'pull', 'targets')
.map { |target| target.dig('params', 'tags') }
.sort
Expand Down
35 changes: 35 additions & 0 deletions .template/addons/svgeez/.github/wiki/Managing-SVG-Icons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From time to time, we need to add new SVG icons to the app. This document describes the steps to do that.

## Gems
The following 2 gems are used to handle SVG:
- [svgeez](https://github.com/jgarber623/svgeez): for generating an SVG sprite from a folder of SVG icons. Requires Node.js and SVGO 1.3.2.
- [inline_svg](https://github.com/jamesmartin/inline_svg): to use inline SVG for styling SVG with CSS

## Node dependencies
- [svgo](https://www.npmjs.com/package/svgo): Optimizes SVG sprite file size
```sh
npm -g install [email protected]
```

## Add a new icon:
- Export the SVG icon from Figma
- Add the icon to `app/assets/images/icons` directory.
- Run the following command to generate the new `app/assets/images/icon-sprite.svg` file which contains all of the icons in the `icons` directory
```sh
bin/svg-sprite
```

## Use the new icon
- Add the `icon-sprite.svg` file to the layout of the page
```erb
<body>
<%= inline_svg_tag 'icon-sprite.svg' %>
</body>
```
- Use the `svg_tag` provided by the `SvgHelper` (app/helpers/svg_helper.rb) and provided `icon_id` matched with icon file name with prefix `icon-`:
```erb
<%= svg_tag icon_id: 'icon-[icon-file-name]', html: {} %>

<!-- example: -->
<%= svg_tag icon_id: 'icon-contacts', html: { class: 'icon' } %>
```
14 changes: 14 additions & 0 deletions .template/addons/svgeez/.github/wiki/template.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

if Dir.exist?('.github/wiki')
use_source_path __dir__

copy_file 'Managing-SVG-Icons.md', '.github/wiki/Managing-SVG-Icons.md'

# SVG Sprite
insert_into_file '.github/wiki/_Sidebar.md', after: /## Operations.*\n/ do
<<~RUBY
- [[Managing SVG icons]]
RUBY
end
end
15 changes: 15 additions & 0 deletions .template/addons/svgeez/Gemfile.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

# SVG Sprite
insert_into_file 'Gemfile', after: /gem 'danger'.*\n/ do
<<~RUBY
gem 'svgeez' # Gem for generating an SVG sprite from a folder of SVG icons.
RUBY
end

# SVG Sprite
insert_into_file 'Gemfile', after: /gem 'bcrypt'.*\n/ do
<<~RUBY
gem 'inline_svg' # Use Inline SVG for styling SVG with CSS
RUBY
end
12 changes: 12 additions & 0 deletions .template/addons/svgeez/bin/svg-sprite
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Generates an SVG sprite from a folder of SVG icons.
#
# Uses `svgeez` gem.
# https://github.com/jgarber623/svgeez
#
# Usage
# -s --source: Path to the folder of source SVGs (defaults to ./_svgeez).
# -d --destination: Path to the destination file or folder (defaults to ./svgeez.svg)
# --with-svgo: Optimize SVG sprite file with SVGO

# Generate the sprite file which includes the `icon-` prefix
bin/bundle exec svgeez build --prefix icon --source app/assets/images/icons/ --destination app/assets/images/icon-sprite.svg --with-svgo
5 changes: 5 additions & 0 deletions .template/addons/svgeez/bin/template.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

use_source_path __dir__

copy_file 'svg-sprite', 'bin/svg-sprite', mode: :preserve
Loading