Skip to content

Commit 209e375

Browse files
committed
Initial setup
1 parent 7057dfb commit 209e375

File tree

16 files changed

+108
-1
lines changed

16 files changed

+108
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@
4040

4141
# Ignore locally-installed gems.
4242
/vendor/bundle/
43+
44+
/app/assets/builds/*
45+
!/app/assets/builds/.keep

Gemfile.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,12 @@ GEM
168168
net-smtp (0.4.0)
169169
net-protocol
170170
nio4r (2.7.0)
171+
nokogiri (1.16.0-aarch64-linux)
172+
racc (~> 1.4)
171173
nokogiri (1.16.0-arm64-darwin)
172174
racc (~> 1.4)
175+
nokogiri (1.16.0-x86_64-linux)
176+
racc (~> 1.4)
173177
parallel (1.24.0)
174178
parser (3.2.2.4)
175179
ast (~> 2.4.1)
@@ -294,8 +298,12 @@ GEM
294298
stimulus-rails (1.3.0)
295299
railties (>= 6.0.0)
296300
stringio (3.1.0)
301+
tailwindcss-rails (2.1.0-aarch64-linux)
302+
railties (>= 6.0.0)
297303
tailwindcss-rails (2.1.0-arm64-darwin)
298304
railties (>= 6.0.0)
305+
tailwindcss-rails (2.1.0-x86_64-linux)
306+
railties (>= 6.0.0)
299307
thor (1.3.0)
300308
timeout (0.4.1)
301309
turbo-rails (1.5.0)
@@ -320,7 +328,9 @@ GEM
320328
zeitwerk (2.6.12)
321329

322330
PLATFORMS
331+
aarch64-linux
323332
arm64-darwin-23
333+
x86_64-linux
324334

325335
DEPENDENCIES
326336
bootsnap

Procfile.dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
web: env RUBY_DEBUG_OPEN=true bin/rails server -p 3000
2+
css: bin/rails tailwindcss:watch

app/assets/builds/.keep

Whitespace-only changes.

app/assets/config/manifest.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
//= link_tree ../images
22
//= link_directory ../stylesheets .css
3+
//= link_tree ../../javascript .js
4+
//= link_tree ../../../vendor/javascript .js
5+
//= link_tree ../builds
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
/*
6+
7+
@layer components {
8+
.btn-primary {
9+
@apply py-2 px-4 bg-blue-200;
10+
}
11+
}
12+
13+
*/

app/javascript/application.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2+
import "@hotwired/turbo-rails"
3+
import "controllers"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Application } from "@hotwired/stimulus"
2+
3+
const application = Application.start()
4+
5+
// Configure Stimulus development experience
6+
application.debug = false
7+
window.Stimulus = application
8+
9+
export { application }
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Controller } from "@hotwired/stimulus"
2+
3+
export default class extends Controller {
4+
connect() {
5+
this.element.textContent = "Hello World!"
6+
}
7+
}

app/javascript/controllers/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Import and register all your controllers from the importmap under controllers/*
2+
3+
import { application } from "controllers/application"
4+
5+
// Eager load all controllers defined in the import map under controllers/**/*_controller
6+
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
7+
eagerLoadControllersFrom("controllers", application)
8+
9+
// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
10+
// import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
11+
// lazyLoadControllersFrom("controllers", application)

app/views/layouts/application.html.erb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
<meta name="viewport" content="width=device-width,initial-scale=1">
66
<%= csrf_meta_tags %>
77
<%= csp_meta_tag %>
8+
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
89

910
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
11+
<%= javascript_importmap_tags %>
1012
</head>
1113

1214
<body>
13-
<%= yield %>
15+
<main class="container mx-auto mt-28 px-5 flex">
16+
<%= yield %>
17+
</main>
1418
</body>
1519
</html>

bin/dev

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env sh
2+
3+
if ! gem list foreman -i --silent; then
4+
echo "Installing foreman..."
5+
gem install foreman
6+
fi
7+
8+
exec foreman start -f Procfile.dev "$@"

bin/importmap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
3+
require_relative "../config/application"
4+
require "importmap/commands"

config/importmap.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Pin npm packages by running ./bin/importmap
2+
3+
pin "application", preload: true
4+
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
5+
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
6+
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
7+
pin_all_from "app/javascript/controllers", under: "controllers"

config/tailwind.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const defaultTheme = require('tailwindcss/defaultTheme')
2+
3+
module.exports = {
4+
content: [
5+
'./public/*.html',
6+
'./app/helpers/**/*.rb',
7+
'./app/javascript/**/*.js',
8+
'./app/views/**/*.{erb,haml,html,slim}'
9+
],
10+
theme: {
11+
extend: {
12+
fontFamily: {
13+
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
14+
},
15+
},
16+
},
17+
plugins: [
18+
require('@tailwindcss/forms'),
19+
require('@tailwindcss/aspect-ratio'),
20+
require('@tailwindcss/typography'),
21+
require('@tailwindcss/container-queries'),
22+
]
23+
}

vendor/javascript/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)