generated from rootstrap/rails_api_base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa40930
commit deed66a
Showing
29 changed files
with
966 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
web: ./bin/rails server -p 3000 -b 0.0.0.0 | ||
js: yarn build --watch | ||
css: yarn build:css --watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
//= link_tree ../images | ||
//= link_directory ../stylesheets .css | ||
//= link_tree ../builds |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div data-controller="example--component"> | ||
<span class="after:content-['CSS_works!']" data-example--component-target="hello">HTML works!</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
module Example | ||
class Component < ViewComponent::Base | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
|
||
export default class extends Controller { | ||
static targets = ['hello']; | ||
|
||
connect() { | ||
const cssValue = window.getComputedStyle(this.helloTarget, ':after').getPropertyValue('content'); | ||
this.helloTarget.classList = ''; | ||
this.helloTarget.innerText += ` ${cssValue} JS works!`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { application } from "../javascript/controllers/application" | ||
import controllers from "./**/*_controller.js" | ||
|
||
controllers.forEach((controller) => { | ||
application.register(controller.name, controller.module.default) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Entry point for the build script in your package.json | ||
import "@hotwired/turbo-rails" | ||
import "./controllers" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Application } from "@hotwired/stimulus" | ||
|
||
const application = Application.start() | ||
|
||
// Configure Stimulus development experience | ||
application.debug = false | ||
window.Stimulus = application | ||
|
||
export { application } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { application } from "./application" | ||
|
||
// Import app/components/index.js | ||
import "../../components" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
#!/usr/bin/env sh | ||
|
||
if ! gem list foreman -i --silent; then | ||
if gem list --no-installed --exact --silent foreman; then | ||
echo "Installing foreman..." | ||
gem install foreman | ||
fi | ||
|
||
# Default to port 3000 if not specified | ||
export PORT="${PORT:-3000}" | ||
|
||
exec foreman start -f Procfile.dev "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
openapi: 3.0.3 | ||
info: | ||
title: rails_api_base | ||
title: hotwire_workshop | ||
version: 1.0.0 | ||
servers: [] | ||
paths: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
{ | ||
"name": "rails_api_base", | ||
"name": "hotwire_workshop", | ||
"private": "true", | ||
"engines" : { | ||
"node" : "20.10.0", | ||
"yarn" : "1.22" | ||
"engines": { | ||
"node": "20.10.0", | ||
"yarn": "1.22" | ||
}, | ||
"dependencies": { | ||
"@activeadmin/activeadmin": "3.2.2", | ||
"@fortawesome/fontawesome-free": "6.5.2", | ||
"@hotwired/stimulus": "^3.2.2", | ||
"@hotwired/turbo-rails": "^8.0.0-beta.2", | ||
"arctic_admin": "4.3.1", | ||
"autoprefixer": "^10.4.19", | ||
"esbuild": "0.23.0", | ||
"esbuild-rails": "^1.0.7", | ||
"jquery": "3.7.1", | ||
"jquery-ui": "1.13.3", | ||
"jquery-ujs": "1.2.3" | ||
"jquery-ujs": "1.2.3", | ||
"postcss": "^8.4.39", | ||
"tailwindcss": "^3.4.6" | ||
}, | ||
"scripts": { | ||
"build": "node esbuild.config.mjs" | ||
"build": "node esbuild.config.mjs", | ||
"build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe Example::Component, type: :component do | ||
it 'renders component', :js do | ||
with_rendered_component_path(render_inline(described_class.new), layout: 'application') do |path| | ||
visit(path) | ||
|
||
expect(page).to have_text 'HTML works!' | ||
expect(page).to have_text 'CSS works!' | ||
expect(page).to have_text 'JS works!' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
module Example | ||
class ComponentPreview < Lookbook::Preview | ||
def standard | ||
render Example::Component.new | ||
end | ||
end | ||
end |
Oops, something went wrong.