Skip to content

Commit

Permalink
Initial decidim (#6)
Browse files Browse the repository at this point in the history
* initial commit

* add figaro

* add passsenger

* Linting and specs (#3)

* Added .github/workflow file for CI

* Lint ERB files with erblint

* Lint SCSS files with stylelint

* Add i18n spec

* Lint JS files with eslint

* Lint MarkDown files with mdl

* Default local to :ca

* Rubocop automatic fixes

* db:migrate to create db/schema.rb

* Revert "Default local to :ca"

This reverts commit 00532b0.

* Run Rubocop

* Rubocop corrections

* Restored db/migrate files to before rubocop fixes

* Remove config/deploy symlink and fix .gitignore

* Initial cleanup (#4)

* Add GH CI result to README.md

* Ignore .rspec-failures

* i18n spec file

* homepage and other spec files

* Remove test directory

* Fix README rubocop suggestion

* i18n_spec to english

* default locale to :ca, edit en.yml

* Platoniq and EU logos in footer

* More spec files to go with the new footer

* Edited expected checksum in overrides_spec.rb

* remove eu logo

* public.sw.js* in .gitignor

* Remove cached ublic/sw.js* files

* correct platoniq footer spec

* Remove lingering EU footer files

* default locale to :en to be overwritten with env variable

* Add decidim awesome (#5)

* Add GH CI result to README.md

* Ignore .rspec-failures

* i18n spec file

* homepage and other spec files

* Remove test directory

* Fix README rubocop suggestion

* i18n_spec to english

* default locale to :ca, edit en.yml

* Platoniq and EU logos in footer

* More spec files to go with the new footer

* Edited expected checksum in overrides_spec.rb

* Add decidim awesome

* db:migrate for rspec failing

* add decidim awesome to gemfile and run webpack install for decidim awesome

* decidim_awesome spec file

* update decidim dev packages to correct version

* remove eu-logo.png

* default locale to :en

* remove eu.en.yml

* Remove cached public/sw.js* files

* remove eu_footer_spec.rb

* Add decidim awesome factories

---------

Co-authored-by: Fran Bolívar <[email protected]>

* Update README.md

* Move .erb-lint.yml

---------

Co-authored-by: David Igón <[email protected]>
Co-authored-by: Harrison Hassig <[email protected]>
  • Loading branch information
3 people authored Jul 1, 2024
1 parent c9f8ff9 commit 07ac2c4
Show file tree
Hide file tree
Showing 824 changed files with 190,295 additions and 55 deletions.
30 changes: 30 additions & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

linters:
ExtraNewline:
enabled: true

FinalNewline:
enabled: true

SpaceAroundErbTag:
enabled: true

AllowedScriptType:
enabled: true
allowed_types:
- text/javascript
- text/template

Rubocop:
enabled: true

rubocop_config:
AllCops:
DisabledByDefault: true

Style/StringLiterals:
EnforcedStyle: double_quotes

Layout/SpaceInsideHashLiteralBraces:
Enabled: true
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
**/*{.,-}min.js
decidim-*/vendor/**/*.js
**/node_modules/**
bundle.js
karma.conf.js
webpack.config.js
webpack.config.babel.js
entry.test.js
entry.js
*_manifest.js
coverage
vendor/bundle
**/vendor/**/*.js
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@decidim"
}
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark the yarn lockfile as having been generated.
yarn.lock linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
47 changes: 47 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Lint

on:
push:
branches:
- main
pull_request:

env:
RUBY_VERSION: 3.1.1
NODE_VERSION: 18.17.1

jobs:
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 1

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

- uses: actions/setup-node@master
with:
node-version: ${{ env.NODE_VERSION }}

- run: npm ci
name: Install JS deps

- run: bundle exec rubocop -P
name: Lint Ruby files

- run: bundle exec mdl *.md
name: Lint Markdown files

- run: bundle exec erblint app/views/**/*.erb
name: Lint ERB files

- run: npm run stylelint
name: Lint SCSS files

- run: npm run lint
name: Lint JS files
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Test

on:
push:
branches:
- main
pull_request:

env:
RUBY_VERSION: 3.1.1
NODE_VERSION: 18.17.1

jobs:
test:
name: Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
- uses: actions/setup-node@master
with:
node-version: ${{ env.NODE_VERSION }}
- uses: nanasess/setup-chromedriver@v2
- name: Setup & create Database
run: bundle exec rake db:test:prepare
env:
RAILS_ENV: test
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
- name: Precompile assets
run: |
npm install
bundle exec rake assets:precompile
env:
RAILS_ENV: test
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
- name: Run RSpec
run: SIMPLECOV=1 bundle exec rspec
env:
RAILS_ENV: test
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
92 changes: 42 additions & 50 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,69 +1,61 @@
*.rbc
capybara-*.html
.rspec
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
/db/*.sqlite3-[0-9]*
/public/system
/coverage/
/spec/tmp
*.orig
rerun.txt
pickle-email-*.html
/db/*.sqlite3-*

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# TODO Comment out this rule if you are OK with secrets being uploaded to the repo
config/initializers/secret_token.rb
config/master.key
# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Only include if you have production secrets in this file, which is no longer a Rails default
# config/secrets.yml

# dotenv, dotenv-rails
# TODO Comment out these rules if environment variables can be committed
.env
.env*.local
# Ignore uploaded files in development.
/storage/*
!/storage/.keep

## Environment normalization:
/.bundle
/vendor/bundle
/public/assets
.byebug_history

# these should all be checked in to normalize the environment:
# Gemfile.lock, .ruby-version, .ruby-gemset
# Ignore master key for decrypting credentials and more.
/config/master.key

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
# Ignore env configuration files
.env
.envrc
.rbenv-vars

# if using bower-rails ignore default bower_components path bower.json files
/vendor/assets/bower_components
*.bowerrc
bower.json
# Ignore the files and folders generated through Webpack
/public/decidim-packs
/public/packs-test
/public/sw.js
/public/sw.js.map

# Ignore pow environment settings
.powenv
# Ignore node modules
/node_modules

# Ignore Byebug command history file.
.byebug_history

# Ignore node_modules
node_modules/
# Ignore Tailwind configuration
tailwind.config.js

# Ignore precompiled javascript packs
/public/packs
/public/packs-test
/public/assets
# Ignore rspec failures
.rspec-failures

# Ignore yarn files
/yarn-error.log
yarn-debug.log*
.yarn-integrity
# Ignore public/sw.js*
public/sw.js*

# Ignore uploaded files in development
/storage/*
!/storage/.keep
/public/uploads
Capfile
/config/deploy
/config/deploy.rb
17 changes: 17 additions & 0 deletions .mdl_style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

all

exclude_rule "first-line-h1"

exclude_rule "line-length"

exclude_rule "no-bare-urls"

exclude_rule "no-inline-html"

exclude_rule "ol-prefix"

exclude_rule "ul-indent"

rule "no-trailing-punctuation", punctuation: ".,;:!"
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style ".mdl_style.rb"
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.17.1
26 changes: 26 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
inherit_from: .rubocop_todo.yml

inherit_gem:
decidim-dev: rubocop-decidim.yml

inherit_mode:
merge:
- Exclude

AllCops:
Include:
- "**/*.rb"
- "**/*.rake"
- "**/*.ru"
- "**/Gemfile"
- "**/Rakefile"
Exclude:
- "spec/decidim_dummy_app/**/*"
- "**/spec/decidim_dummy_app/**/*"
- "bin/**/*"
- "node_modules/**/*"
- "**/node_modules/**/*"
- "db/schema.rb"
- "db/migrate/*"
- "vendor/**/*"
- "**/vendor/**/*"
Empty file added .rubocop_todo.yml
Empty file.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.1
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM decidim/decidim:0.28.1
54 changes: 54 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# frozen_string_literal: true

source "https://rubygems.org"

ruby RUBY_VERSION

gem "decidim", "0.28.1"
# gem "decidim-conferences", "0.28.1"
# gem "decidim-design", "0.28.1"
# gem "decidim-elections", "0.28.1"
# gem "decidim-initiatives", "0.28.1"
# gem "decidim-templates", "0.28.1"

gem "decidim-decidim_awesome", git: "https://github.com/decidim-ice/decidim-module-decidim_awesome", branch: "develop"

gem "bootsnap", "~> 1.3"

gem "puma", ">= 6.3.1"

gem "wicked_pdf", "~> 2.1"

group :development, :test do
gem "byebug", "~> 11.0", platform: :mri

gem "brakeman", "~> 5.4"
gem "decidim-dev", "0.28.1"
gem "mdl"
gem "net-imap", "~> 0.2.3"
gem "net-pop", "~> 0.1.1"
gem "net-smtp", "~> 0.3.1"
end

group :development do
gem "letter_opener_web", "~> 2.0"
gem "listen", "~> 3.1"
gem "spring", "~> 2.0"
gem "spring-watcher-listen", "~> 2.0"
gem "web-console", "~> 4.2"

gem "capistrano", "~> 3.18"
gem "capistrano-bundler"
gem "capistrano-passenger"
gem "capistrano-rails", "~> 1.6"
gem "capistrano-rails-console"
gem "capistrano-rbenv"
gem "capistrano-sidekiq"
end

group :production do
gem "aws-sdk-s3", require: false
gem "figaro", "~> 1.2"
gem "passenger"
gem "sidekiq"
end
Loading

0 comments on commit 07ac2c4

Please sign in to comment.