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

Compile assets with dart-sass and esbuild #2116

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
11 changes: 10 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,25 @@ commands:
- restore_cache:
name: Restore bundle cache
key: administrate-{{ checksum "Gemfile.lock" }}
- restore_cache:
name: Restore npm cache
key: administrate-{{ checksum "package-lock.json" }}

# Bundle install dependencies
# Install dependencies
- run: bundle install --path vendor/bundle
- run: npm install

# Cache Dependencies
- save_cache:
name: Store bundle cache
key: administrate-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- save_cache:
name: Store npm cache
key: administrate-{{ checksum "package-lock.json" }}
paths:
- node_modules

# Wait for DB
- run: dockerize -wait tcp://localhost:5432 -timeout 1m
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ pkg
gemfiles/.bundle/
.yardoc
/doc
/node_modules
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.2
2.7.5
6 changes: 4 additions & 2 deletions .scss-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
scss_files: "app/assets/stylesheets/administrate/**/*.scss"
scss_files: "lib/assets/stylesheets/**/*.scss"

exclude: "app/assets/stylesheets/administrate/reset/**"
exclude:
- "lib/assets/stylesheets/reset/**"
- "app/assets/builds/**/*"

severity: warning

Expand Down
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ To maintain compatibility with multiple dependency versions, we use
[Rails Engine]: https://guides.rubyonrails.org/engines.html
[Appraisal]: https://github.com/thoughtbot/appraisal

## Compiling assets

To compile assets, run:

```
$ npm run build
$ npm run build:css
```

Remember to compile assets before committing.

### Opening a PR

1. Fork the repo,
Expand Down
19 changes: 4 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ PATH
actionpack (>= 5.0)
actionview (>= 5.0)
activerecord (>= 5.0)
datetime_picker_rails (~> 0.0.7)
jquery-rails (>= 4.0)
kaminari (>= 1.0)
momentjs-rails (~> 2.8)
sassc-rails (~> 2.1)
selectize-rails (~> 0.6)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -114,8 +109,6 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
datetime_picker_rails (0.0.7)
momentjs-rails (>= 2.8.1)
diff-lcs (1.4.4)
dotenv (2.7.6)
dotenv-rails (2.7.6)
Expand All @@ -135,7 +128,7 @@ GEM
multipart-post (>= 1.2, < 3)
ruby2_keywords
faraday-net_http (1.0.1)
ffi (1.15.4)
ffi (1.15.5)
formulaic (0.4.1)
activesupport
capybara
Expand All @@ -157,10 +150,6 @@ GEM
rails-i18n
rainbow (>= 2.2.2, < 4.0)
terminal-table (>= 1.5.1)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand Down Expand Up @@ -190,8 +179,6 @@ GEM
mini_mime (1.1.2)
mini_portile2 (2.6.1)
minitest (5.15.0)
momentjs-rails (2.20.1)
railties (>= 3.1)
multipart-post (2.1.1)
nio4r (2.5.8)
nokogiri (1.12.5)
Expand Down Expand Up @@ -267,6 +254,8 @@ GEM
rspec-support (3.10.2)
ruby2_keywords (0.0.4)
rubyzip (2.3.2)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
Expand All @@ -275,7 +264,6 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
selectize-rails (0.12.6)
selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
Expand Down Expand Up @@ -346,6 +334,7 @@ DEPENDENCIES
rack-timeout
redcarpet
rspec-rails
sass-rails (>= 6)
selenium-webdriver
sentry-raven
shoulda-matchers
Expand Down
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ Bundler::GemHelper.install_tasks

Rails.application.load_tasks
task(:default).clear
task default: [:spec]
task default: %i[compile_assets spec]

task :compile_assets do
sh("npm run build")
sh("npm run build:css")
end

if defined? RSpec
task(:spec).clear
Expand Down
7 changes: 1 addition & 6 deletions administrate.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@ Gem::Specification.new do |s|
s.add_dependency "actionpack", ">= 5.0"
s.add_dependency "actionview", ">= 5.0"
s.add_dependency "activerecord", ">= 5.0"

s.add_dependency "datetime_picker_rails", "~> 0.0.7"
s.add_dependency "jquery-rails", ">= 4.0"
s.add_dependency "kaminari", ">= 1.0"
s.add_dependency "momentjs-rails", "~> 2.8"
s.add_dependency "sassc-rails", "~> 2.1"
s.add_dependency "selectize-rails", "~> 0.6"

s.add_development_dependency "rspec-rails"
s.add_development_dependency "sass-rails", ">= 6"

s.description = <<-DESCRIPTION
Administrate is heavily inspired by projects like Rails Admin and ActiveAdmin,
Expand Down
Loading