Skip to content

Commit

Permalink
Add Packwerk gem, and start adding config for it
Browse files Browse the repository at this point in the history
  • Loading branch information
denny committed Mar 25, 2021
1 parent 6a47573 commit b56bdba
Show file tree
Hide file tree
Showing 6 changed files with 211 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ source 'https://rubygems.org' do
# Charts
gem 'chartkick', '~> 3.4.2'

# Check plugin boundaries
gem 'packwerk'

group :development, :test do
# RSpec for Rails
gem 'rspec-rails'
Expand Down
20 changes: 20 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ GEM
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
bcrypt (3.1.16)
better_html (1.0.16)
actionview (>= 4.0)
activesupport (>= 4.0)
ast (~> 2.0)
erubi (~> 1.4)
html_tokenizer (~> 0.0.6)
parser (>= 2.4)
smart_properties
blazer (2.4.2)
activerecord (>= 5)
chartkick (>= 3.2)
Expand Down Expand Up @@ -339,6 +347,7 @@ GEM
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.1.8)
connection_pool (2.2.3)
constant_resolver (0.1.5)
coverband (5.1.0)
redis
crack (0.4.5)
Expand Down Expand Up @@ -397,6 +406,7 @@ GEM
concurrent-ruby (~> 1.0)
hashdiff (1.0.1)
highline (2.0.3)
html_tokenizer (0.0.7)
httparty (0.18.1)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
Expand Down Expand Up @@ -461,6 +471,13 @@ GEM
overcommit (0.57.0)
childprocess (>= 0.6.3, < 5)
iniparse (~> 1.4)
packwerk (1.1.2)
activesupport (>= 5.2)
ast
better_html
constant_resolver
parser
sorbet-runtime
pagy (4.1.0)
parallel (1.20.1)
parallel_tests (3.5.2)
Expand Down Expand Up @@ -658,6 +675,8 @@ GEM
unf (~> 0.1.4)
sitemap_generator (6.1.2)
builder (~> 3.0)
smart_properties (1.15.0)
sorbet-runtime (0.5.6352)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand Down Expand Up @@ -729,6 +748,7 @@ DEPENDENCIES
letter_opener_web (~> 1.0)!
listen (~> 3.3)!
overcommit!
packwerk!
parallel_tests!
pg (~> 1.2.3)!
puma (~> 5.2)!
Expand Down
23 changes: 23 additions & 0 deletions bin/packwerk
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# This file was auto-generated by Packwerk through `packwerk init`

# Needs to be run in test environment in order to have test helper paths available in the autoload paths
ENV["RAILS_ENV"] = "test"

# Command line arguments needs to be duplicated because spring modifies it
packwerk_argv = ARGV.dup

begin
load(File.expand_path("spring", __dir__))
rescue LoadError => e
raise unless e.message.include?("spring")
end

require File.expand_path("../config/environment", __dir__)

require "packwerk"

cli = Packwerk::Cli.new
cli.run(packwerk_argv)
40 changes: 40 additions & 0 deletions config/inflections.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ShinyCMS ~ https://shinycms.org
#
# Copyright 2009-2021 Denny de la Haye ~ https://denny.me
#
# ShinyCMS is free software; you can redistribute it and/or modify it under the terms of the GPL (version 2 or later)

# Packwerk inflections config

# List your inflections in this file instead of `inflections.rb`
# See steps to set up custom inflections:
# https://github.com/Shopify/packwerk/blob/main/USAGE.md#Inflections

acronym:
# Acronyms used in the ShinyCMS code
- CMS
- IP
- HTML
- MJML
- SEO
- ShinyCMS
- URL

# Common acronyms, that might be used in CMS content
# (to prevent them being misformatted by methods such as .titlecase)
- AI
- API
- BBC
- CEO
- CPU
- CRM
- CTO
- EU
- PR
- REST
- RESTful
- UK
- USA
- USB
- VIP
- WWW
29 changes: 29 additions & 0 deletions package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ShinyCMS ~ https://shinycms.org
#
# Copyright 2009-2021 Denny de la Haye ~ https://denny.me
#
# ShinyCMS is free software; you can redistribute it and/or modify it under the terms of the GPL (version 2 or later)

# Packwerk config for the root package of the application

# Validate the configuration using `bin/packwerk validate`
# Check your code using `packwerk check`

# Turn on dependency checks for this package?
enforce_dependencies: true

# Turn on privacy checks for this package?
enforce_privacy: false
# Enforcing privacy is often not useful for the root package, because it would
# require defining a public interface for something that should only be a thin
# wrapper in the first place. We recommend enabling this for any new packages
# you create to aid with encapsulation.

# The public path for this package
public_path: public/

# A list of this package's dependencies
# Note: packages in this list require their own `package.yml` file
# dependencies:
# - plugins/ShinyAccess
# ...
96 changes: 96 additions & 0 deletions packwerk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# ShinyCMS ~ https://shinycms.org
#
# Copyright 2009-2021 Denny de la Haye ~ https://denny.me
#
# ShinyCMS is free software; you can redistribute it and/or modify it under the terms of the GPL (version 2 or later)

# Packwerk config

# https://github.com/Shopify/packwerk/blob/main/USAGE.md#setting-up-the-configuration-file

# List of patterns for folder paths to include
# include:
# - "**/*.{rb,rake,erb}"

# List of patterns for folder paths to exclude
# exclude:
# - "{bin,node_modules,script,tmp,vendor}/**/*"

# Patterns to find package configuration files
# package_paths: "**/"

# List of application load paths
# These load paths were auto generated by Packwerk.
load_paths:
- plugins/ShinyCMS/app/controllers
- plugins/ShinyCMS/app/controllers/concerns
- plugins/ShinyCMS/app/helpers
- plugins/ShinyCMS/app/lib
- plugins/ShinyCMS/app/mailer_previews
- plugins/ShinyCMS/app/mailers
- plugins/ShinyCMS/app/models
- plugins/ShinyCMS/app/models/concerns
- plugins/ShinyCMS/app/policies
- plugins/ShinyAccess/app/controllers
- plugins/ShinyAccess/app/helpers
- plugins/ShinyAccess/app/jobs
- plugins/ShinyAccess/app/mailers
- plugins/ShinyAccess/app/models
- plugins/ShinyAccess/app/policies
- plugins/ShinyBlog/app/controllers
- plugins/ShinyBlog/app/helpers
- plugins/ShinyBlog/app/jobs
- plugins/ShinyBlog/app/models
- plugins/ShinyBlog/app/policies
- plugins/ShinyForms/app/controllers
- plugins/ShinyForms/app/helpers
- plugins/ShinyForms/app/jobs
- plugins/ShinyForms/app/mailers
- plugins/ShinyForms/app/models
- plugins/ShinyForms/app/policies
- plugins/ShinyInserts/app/controllers
- plugins/ShinyInserts/app/helpers
- plugins/ShinyInserts/app/models
- plugins/ShinyInserts/app/policies
- plugins/ShinyLists/app/controllers
- plugins/ShinyLists/app/helpers
- plugins/ShinyLists/app/models
- plugins/ShinyLists/app/policies
- plugins/ShinyNews/app/controllers
- plugins/ShinyNews/app/helpers
- plugins/ShinyNews/app/jobs
- plugins/ShinyNews/app/models
- plugins/ShinyNews/app/policies
- plugins/ShinyNewsletters/app/controllers
- plugins/ShinyNewsletters/app/jobs
- plugins/ShinyNewsletters/app/mailers
- plugins/ShinyNewsletters/app/models
- plugins/ShinyNewsletters/app/policies
- plugins/ShinyPages/app/controllers
- plugins/ShinyPages/app/helpers
- plugins/ShinyPages/app/models
- plugins/ShinyPages/app/policies
- plugins/ShinyPages/app/validators
- plugins/ShinyProfiles/app/controllers
- plugins/ShinyProfiles/app/helpers
- plugins/ShinyProfiles/app/models
- plugins/ShinyProfiles/app/policies
- plugins/ShinySEO/app/controllers
- plugins/ShinySEO/app/helpers
- plugins/ShinySEO/app/models
- plugins/ShinySearch/app/controllers
- plugins/ShinySearch/app/helpers
- plugins/ShinySearch/app/jobs
- plugins/ShinySearch/app/models
- plugins/ShinySearch/app/models/concerns
- app/controllers
- app/models
- app/policies
- app/validators

# List of custom associations, if any
# custom_associations:
# - "cache_belongs_to"

# Location of inflections file
# inflections_file: "config/inflections.yml"

0 comments on commit b56bdba

Please sign in to comment.