Skip to content

Commit

Permalink
Merge pull request #3248 from projectblacklight/importmap-generator
Browse files Browse the repository at this point in the history
Add an importmap generator
  • Loading branch information
corylown authored and taylor-steve committed Oct 30, 2024
2 parents ace0ea4 + be61bb1 commit fbea85a
Show file tree
Hide file tree
Showing 19 changed files with 242 additions and 7,208 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
ruby: ["3.2", "3.3"]
bootstrap_version: ["~> 4.0"]
blacklight_version: ["~> 8.0"]
additional_engine_cart_rails_options: ["-a propshaft -j esbuild"]
additional_engine_cart_rails_options: ["-a propshaft -j importmap"]
additional_name: [""]
include:
- rails_version: "~> 7.2"
Expand All @@ -28,6 +28,18 @@ jobs:
blacklight_version: "~> 8.0"
bootstrap_version: "~> 4.0"
additional_name: Rails 7.1
- rails_version: "~> 7.1.4"
ruby: "3.2"
blacklight_version: "~> 8.0"
bootstrap_version: "~> 4.0"
additional_engine_cart_rails_options: "-a propshaft -j esbuild"
additional_name: "JS bundling (esbuild) Bootstrap 4"
- rails_version: "~> 7.2"
ruby: "3.3"
blacklight_version: "~> 8.0"
bootstrap_version: "~> 5.0"
additional_engine_cart_rails_options: "-a propshaft -j esbuild"
additional_name: "JS bundling (esbuild) Bootstrap 5"
env:
RAILS_VERSION: ${{ matrix.rails_version }}
BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ Read more about what Spotlight is, our motivations for creating it, and how to i

## Installation

To bootstrap a new Rails application:
To bootstrap a new Rails application using [importmap-rails](https://github.com/rails/importmap-rails):

```
$ SKIP_TRANSLATION=1 rails new app-name -m https://raw.githubusercontent.com/projectblacklight/spotlight/main/template.rb -a propshaft -j importmap
```

or using [jsbundling-rails](https://github.com/rails/jsbundling-rails) with [esbuild](https://esbuild.github.io/):

```
$ SKIP_TRANSLATION=1 rails new app-name -m https://raw.githubusercontent.com/projectblacklight/spotlight/main/template.rb -a propshaft -j esbuild
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ require 'spotlight/version'
# Build with our opinionated defaults if none are provided.
rails_options = ENV.fetch('ENGINE_CART_RAILS_OPTIONS', '')
rails_options = "#{rails_options} -a propshaft" unless rails_options.match?(/-a\s|--asset-pipeline/)
rails_options = "#{rails_options} -j esbuild" unless rails_options.match?(/-j\s|--javascript/)
rails_options = "#{rails_options} -j importmap" unless rails_options.match?(/-j\s|--javascript/)
ENV['ENGINE_CART_RAILS_OPTIONS'] = rails_options

task ci: ['engine_cart:generate'] do
Expand Down
Loading

0 comments on commit fbea85a

Please sign in to comment.