Skip to content

Commit

Permalink
Merge latest 0.5.0 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
spohlenz committed Aug 16, 2024
2 parents 783f7b5 + e55a046 commit a989ee9
Show file tree
Hide file tree
Showing 23 changed files with 696 additions and 1,787 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish gem

on: workflow_dispatch

jobs:
push:
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write

# If you configured a GitHub environment on RubyGems, you must use it here.
environment: release

steps:
# Set up
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ruby

# Release
- uses: rubygems/release-gem@v1
16 changes: 13 additions & 3 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,27 @@ jobs:
strategy:
fail-fast: false
matrix:
gemfile: [ rails-5.2, rails-6.0, rails-6.1 ]
ruby: [ '2.7' ]
include:
- gemfile: rails-6.0
ruby: '2.6'
- gemfile: rails-6.1
ruby: '2.6'
- gemfile: rails-6.1
ruby: '3.0'
- gemfile: rails-7.0
ruby: '2.7'
- gemfile: rails-7.0
ruby: '3.0'
- gemfile: rails-7.0-propshaft
ruby: '3.0'
- gemfile: rails-7.1
ruby: '3.2'
ruby: '3.3'
- gemfile: rails-7.1-propshaft
ruby: '3.3'
- gemfile: rails-7.2
ruby: '3.3'
- gemfile: rails-7.2-propshaft
ruby: '3.3'
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
Expand Down
10 changes: 7 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in trestle-auth.gemspec
gemspec
group :development, :test do
gem "sprockets-rails"
# gem "propshaft"
end

group :test do
gem "rspec-rails"
Expand All @@ -13,10 +15,12 @@ group :test do
end

gem "rails", "~> 7.1.0"
gem "sprockets-rails"

gem "devise"
gem "cancancan"
gem "pundit"

gem "trestle", github: "TrestleAdmin/trestle"

# Specify your gem's dependencies in trestle-auth.gemspec
gemspec
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Trestle Authentication & Authorization (trestle-auth)

[![RubyGem](https://img.shields.io/gem/v/trestle-auth.svg?style=flat&colorB=4065a9)](https://rubygems.org/gems/trestle-auth)
[![RubyGem](https://img.shields.io/gem/v/trestle-auth?include_prereleases&color=%234d6bb2)](https://rubygems.org/gems/trestle-auth)
[![Build Status](https://img.shields.io/github/actions/workflow/status/TrestleAdmin/trestle-auth/rspec.yml?style=flat)](https://github.com/TrestleAdmin/trestle-auth/actions)
[![Coveralls](https://img.shields.io/coveralls/TrestleAdmin/trestle-auth.svg?style=flat)](https://coveralls.io/github/TrestleAdmin/trestle-auth)

Expand Down
1 change: 0 additions & 1 deletion app/assets/bundle/trestle/auth/bundle.css

This file was deleted.

1 change: 1 addition & 0 deletions app/assets/bundle/trestle/auth/login.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/assets/bundle/trestle/auth/userbox.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions app/assets/sprockets/trestle/auth/manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//= link trestle/auth/login.css
//= link trestle/auth/userbox.css
//= link trestle/auth/custom.css
2 changes: 0 additions & 2 deletions app/assets/stylesheets/trestle/auth.css

This file was deleted.

5 changes: 3 additions & 2 deletions app/views/layouts/trestle/auth.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
<%= stylesheet_link_tag "trestle/admin", 'data-turbo-track': 'reload' %>
<%= stylesheet_link_tag "trestle/icons/font-awesome", 'data-turbo-track': 'reload' if defined?(Sprockets) %>

<%= stylesheet_link_tag "trestle/custom", 'data-turbo-track': 'reload' %>
<%= stylesheet_link_tag "trestle/auth/login", 'data-turbo-track': 'reload' %>

<%= stylesheet_link_tag "trestle/auth", 'data-turbo-track': 'reload' %>
<%= stylesheet_link_tag "trestle/custom", 'data-turbo-track': 'reload' %>
<%= stylesheet_link_tag "trestle/auth/custom", 'data-turbo-track': 'reload' %>

<%= render "trestle/theme" %>

Expand Down
12 changes: 6 additions & 6 deletions frontend/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

.form-control {
color: $auth-form-control-color;
font-size: 1.1rem;
font-size: 1rem;

padding: 1rem 0.75rem;
padding: 0.875rem 0.625rem;

&:focus {
outline-color: transparent;
Expand All @@ -32,22 +32,22 @@

.input-group-text {
color: $auth-form-control-icon-color;
padding: 0.375rem 0.25rem 0.375rem 1rem;
padding: 0.25rem 0.25rem 0.25rem 0.875rem;
}

.btn-primary {
box-shadow: rgba(black, 0.1) 0 0 2px;

padding-top: 0.75rem;
padding-bottom: 0.75rem;
padding-top: 0.625rem;
padding-bottom: 0.625rem;
}

.alert-danger {
background-color: rgba($alert-danger-bg, 0.75);
}

.remember-me {
font-size: 0.95rem;
font-size: 0.8125rem;
line-height: 1.5;

padding-left: 0;
Expand Down
6 changes: 3 additions & 3 deletions frontend/userbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.userbox {
order: 99;
padding: 2px 0;
padding: 0.125rem 0;

display: flex;
align-items: center;
Expand All @@ -11,7 +11,7 @@
color: $body-color;

display: block;
padding: 2px 0;
padding: 0.125rem 0;

font-weight: normal;
line-height: 40px;
Expand All @@ -23,7 +23,7 @@

.avatar {
vertical-align: top;
margin-left: 6px;
margin-left: 0.375rem;
}

.dropdown-toggle {
Expand Down
17 changes: 17 additions & 0 deletions gemfiles/rails-7.0-propshaft.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
source 'https://rubygems.org'

group :test do
gem "rspec-rails"

gem "coveralls_reborn", require: false
gem "capybara"
end

gem "rails", "~> 7.0.0"
gem "propshaft"
gem "sqlite3", "~> 1.4"
gem "devise"

gem "trestle", github: "TrestleAdmin/trestle"

gemspec path: "../"
17 changes: 17 additions & 0 deletions gemfiles/rails-7.1-propshaft.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
source 'https://rubygems.org'

group :test do
gem "rspec-rails"

gem "coveralls_reborn", require: false
gem "capybara"
end

gem "rails", "~> 7.1.0"
gem "propshaft"
gem "sqlite3", "~> 1.4"
gem "devise"

gem "trestle", github: "TrestleAdmin/trestle"

gemspec path: "../"
17 changes: 17 additions & 0 deletions gemfiles/rails-7.2-propshaft.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
source 'https://rubygems.org'

group :test do
gem "rspec-rails"

gem "coveralls_reborn", require: false
gem "capybara"
end

gem "rails", "~> 7.2.0.rc1"
gem "propshaft"
gem "sqlite3", "~> 1.4"
gem "devise"

gem "trestle", github: "TrestleAdmin/trestle"

gemspec path: "../"
4 changes: 2 additions & 2 deletions gemfiles/rails-5.2.gemfile → gemfiles/rails-7.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ group :test do
gem "capybara"
end

gem "rails", "~> 5.2.0"
gem "rails", "~> 7.2.0.rc1"
gem "sprockets-rails"
gem "sqlite3", "~> 1.3.13"
gem "sqlite3", "~> 1.4"
gem "devise"
gem "cancancan"
gem "pundit"
Expand Down
9 changes: 8 additions & 1 deletion lib/trestle/auth/engine.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
module Trestle
module Auth
class Engine < ::Rails::Engine
config.assets.precompile << "trestle/auth.css" << "trestle/auth/userbox.css"
initializer "trestle.sprockets" do |app|
# Sprockets manifest
config.assets.precompile << "trestle/auth/manifest.js"
end if defined?(Sprockets)

initializer "trestle.propshaft" do |app|
app.config.assets.excluded_paths << root.join("app/assets/sprockets")
end if defined?(Propshaft)

config.before_initialize do
Trestle::Engine.paths["app/helpers"].concat(paths["app/helpers"].existent)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trestle-auth",
"version": "0.5.0.pre",
"version": "0.5.0-authorization",
"description": "Authentication plugin for the Trestle admin framework",
"repository": "https://github.com/TrestleAdmin/trestle-auth.git",
"author": "Sam Pohlenz <[email protected]>",
Expand All @@ -19,8 +19,8 @@
"css-loader": "^5.2.6",
"css-minimizer-webpack-plugin": "^3.0.2",
"mini-css-extract-plugin": "^2.0.0",
"node-sass": "^7.0.0",
"postcss-loader": "^6.1.1",
"sass": "^1.77.6",
"sass-loader": "^12.1.0",
"webpack": "^5.42.0",
"webpack-cli": "^4.7.2",
Expand Down
1 change: 0 additions & 1 deletion spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
require "active_record/railtie"
require "action_controller/railtie"
require "action_view/railtie"
require "sprockets/railtie"
require "action_mailer/railtie"
# require "active_job/railtie"
# require "active_storage/engine"
Expand Down
4 changes: 2 additions & 2 deletions trestle-auth.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Gem::Specification.new do |spec|

spec.require_paths = ["lib"]

spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/TrestleAdmin/trestle-auth"

spec.add_dependency "trestle", "~> 0.10.0.pre"
spec.add_dependency "trestle", "~> 0.10.0"
spec.add_dependency "bcrypt", "~> 3.1.7"

spec.add_development_dependency "rspec-rails"
Expand Down
11 changes: 9 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');
module.exports = {
mode: 'production',
entry: {
bundle: path.resolve(__dirname, 'frontend/index.scss'),
login: path.resolve(__dirname, 'frontend/index.scss'),
userbox: path.resolve(__dirname, 'frontend/userbox.scss')
},
output: {
Expand Down Expand Up @@ -35,7 +35,14 @@ module.exports = {
}
}
},
{ loader: 'sass-loader' }
{
loader: 'sass-loader',
options: {
sassOptions: {
quietDeps: true
}
}
}
]
}
]
Expand Down
Loading

0 comments on commit a989ee9

Please sign in to comment.