Skip to content

Commit

Permalink
Reorganizate code using packwerk
Browse files Browse the repository at this point in the history
  • Loading branch information
nickel committed Mar 25, 2024
1 parent 3b60b96 commit 2ac61ac
Show file tree
Hide file tree
Showing 20 changed files with 14 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class HomeController < ActionController::Base
class HomeController < ApplicationController
def index
end
end
1 change: 1 addition & 0 deletions app/packages/landing/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enforce_dependencies: true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions app/packages/rails/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enforce_dependencies: true
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Application < Rails::Application
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w(assets tasks))

config.paths.add "app/packages", glob: "{*,*/concerns}", eager_load: true
config.paths.add "app/packages", glob: "*/{*,*/concerns}", eager_load: true

# Configuration for the application, engines, and railties goes here.
#
Expand Down
2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ default: &default

development:
<<: *default
database: pictoplan_development
url: <%= ENV["DATABASE_URL"] %>

test:
url: <%= ENV["DATABASE_URL"] %>
Expand Down
5 changes: 0 additions & 5 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# frozen_string_literal: true

Rails.application.routes.draw do
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
# Can be used by load balancers and uptime monitors to verify that the app is live.
get "up" => "rails/health#show", as: :rails_health_check

# Defines the root path route ("/")
root "home#index"
end
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://postgres:postgres@postgres/pictoplan_test
DATABASE_URL: postgres://postgres:postgres@postgres/pictoplan_development
depends_on:
postgres:
condition: service_healthy
10 changes: 0 additions & 10 deletions package.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
# This file represents the root package of the application
# Please validate the configuration using `packwerk validate` (for Rails applications) or running the auto generated
# test case (for non-Rails projects). You can then use `packwerk check` to check your code.

# Change to `true` to turn on dependency checks for this package
enforce_dependencies: true

# A list of this package's dependencies
# Note that packages in this list require their own `package.yml` file
# dependencies:
# - "packages/billing"
31 changes: 8 additions & 23 deletions packwerk.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
# See: Setting up the configuration file
# https://github.com/Shopify/packwerk/blob/main/USAGE.md#configuring-packwerk

# 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 custom associations, if any
# custom_associations:
# - "cache_belongs_to"

# Whether or not you want the cache enabled (disabled by default)
# cache: true

# Where you want the cache to be stored (default below)
# cache_directory: 'tmp/cache/packwerk'
exclude:
- 'spec/support/**/*'
- '**/lib/tasks/**/*.rake'
- '{bin,node_modules,script,tmp,vendor,VENDORED_GEMS}/**/*'

package_paths:
- ./packages/*
- .
Empty file removed tmp/pids/.keep
Empty file.

0 comments on commit 2ac61ac

Please sign in to comment.