Skip to content

Commit fbea85a

Browse files
corylowntaylor-steve
authored andcommitted
Merge pull request #3248 from projectblacklight/importmap-generator
Add an importmap generator
2 parents ace0ea4 + be61bb1 commit fbea85a

File tree

19 files changed

+242
-7208
lines changed

19 files changed

+242
-7208
lines changed

.github/workflows/ruby.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
ruby: ["3.2", "3.3"]
1616
bootstrap_version: ["~> 4.0"]
1717
blacklight_version: ["~> 8.0"]
18-
additional_engine_cart_rails_options: ["-a propshaft -j esbuild"]
18+
additional_engine_cart_rails_options: ["-a propshaft -j importmap"]
1919
additional_name: [""]
2020
include:
2121
- rails_version: "~> 7.2"
@@ -28,6 +28,18 @@ jobs:
2828
blacklight_version: "~> 8.0"
2929
bootstrap_version: "~> 4.0"
3030
additional_name: Rails 7.1
31+
- rails_version: "~> 7.1.4"
32+
ruby: "3.2"
33+
blacklight_version: "~> 8.0"
34+
bootstrap_version: "~> 4.0"
35+
additional_engine_cart_rails_options: "-a propshaft -j esbuild"
36+
additional_name: "JS bundling (esbuild) Bootstrap 4"
37+
- rails_version: "~> 7.2"
38+
ruby: "3.3"
39+
blacklight_version: "~> 8.0"
40+
bootstrap_version: "~> 5.0"
41+
additional_engine_cart_rails_options: "-a propshaft -j esbuild"
42+
additional_name: "JS bundling (esbuild) Bootstrap 5"
3143
env:
3244
RAILS_VERSION: ${{ matrix.rails_version }}
3345
BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ Read more about what Spotlight is, our motivations for creating it, and how to i
1616

1717
## Installation
1818

19-
To bootstrap a new Rails application:
19+
To bootstrap a new Rails application using [importmap-rails](https://github.com/rails/importmap-rails):
20+
21+
```
22+
$ SKIP_TRANSLATION=1 rails new app-name -m https://raw.githubusercontent.com/projectblacklight/spotlight/main/template.rb -a propshaft -j importmap
23+
```
24+
25+
or using [jsbundling-rails](https://github.com/rails/jsbundling-rails) with [esbuild](https://esbuild.github.io/):
2026

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

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ require 'spotlight/version'
3333
# Build with our opinionated defaults if none are provided.
3434
rails_options = ENV.fetch('ENGINE_CART_RAILS_OPTIONS', '')
3535
rails_options = "#{rails_options} -a propshaft" unless rails_options.match?(/-a\s|--asset-pipeline/)
36-
rails_options = "#{rails_options} -j esbuild" unless rails_options.match?(/-j\s|--javascript/)
36+
rails_options = "#{rails_options} -j importmap" unless rails_options.match?(/-j\s|--javascript/)
3737
ENV['ENGINE_CART_RAILS_OPTIONS'] = rails_options
3838

3939
task ci: ['engine_cart:generate'] do

0 commit comments

Comments
 (0)