-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fixtures for all kinds of Rails app setups
- Loading branch information
Showing
67 changed files
with
12,656 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
types/**/* linguist-vendored | ||
test/fixtures/**/* linguist-vendored |
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,17 @@ | ||
{ | ||
"name": "app", | ||
"private": true, | ||
"dependencies": { | ||
"@hotwired/stimulus": "^3.2.2", | ||
"@stimulus-library/controllers": "^1.0.6", | ||
"@vytant/stimulus-decorators": "^1.1.0", | ||
"stimulus-checkbox": "^2.0.0", | ||
"stimulus-clipboard": "^4.0.1", | ||
"stimulus-datepicker": "^1.0.6", | ||
"stimulus-dropdown": "^2.1.0", | ||
"stimulus-hotkeys": "^2.3.0", | ||
"stimulus-inline-input-validations": "^1.2.0", | ||
"stimulus-use": "^0.52.2", | ||
"tailwindcss-stimulus-components": "^4.0.4" | ||
} | ||
} |
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,2 @@ | ||
# See https://bun.sh/docs/install/lockfile | ||
*.lockb diff=lockb |
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,2 @@ | ||
web: env RUBY_DEBUG_OPEN=true bin/rails server | ||
js: bun run build --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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Entry point for the build script in your package.json | ||
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 } |
7 changes: 7 additions & 0 deletions
7
test/fixtures/bun/app/javascript/controllers/hello_controller.js
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,7 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
connect() { | ||
|
||
} | ||
} |
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,8 @@ | ||
// This file is auto-generated by ./bin/rails stimulus:manifest:update | ||
// Run that command whenever you add a new controller or create them with | ||
// ./bin/rails generate stimulus controllerName | ||
|
||
import { application } from "./application" | ||
|
||
import HelloController from "./hello_controller" | ||
application.register("hello", HelloController) |
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,37 @@ | ||
import path from "path"; | ||
import fs from "fs"; | ||
|
||
const config = { | ||
sourcemap: "external", | ||
entrypoints: ["app/javascript/application.js"], | ||
outdir: path.join(process.cwd(), "app/assets/builds"), | ||
}; | ||
|
||
const build = async (config) => { | ||
const result = await Bun.build(config); | ||
|
||
if (!result.success) { | ||
if (process.argv.includes("--watch")) { | ||
console.error("Build failed"); | ||
for (const message of result.logs) { | ||
console.error(message); | ||
} | ||
return; | ||
} else { | ||
throw new AggregateError(result.logs, "Build failed"); | ||
} | ||
} | ||
}; | ||
|
||
(async () => { | ||
await build(config); | ||
|
||
if (process.argv.includes("--watch")) { | ||
fs.watch(path.join(process.cwd(), "app/javascript"), { recursive: true }, (eventType, filename) => { | ||
console.log(`File changed: ${filename}. Rebuilding...`); | ||
build(config); | ||
}); | ||
} else { | ||
process.exit(0); | ||
} | ||
})(); |
Binary file not shown.
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,10 @@ | ||
{ | ||
"name": "bun", | ||
"private": true, | ||
"dependencies": { | ||
"@hotwired/stimulus": "^3.2.2" | ||
}, | ||
"scripts": { | ||
"build": "bun bun.config.js" | ||
} | ||
} |
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,8 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
"@hotwired/stimulus@^3.2.2": | ||
version "3.2.2" | ||
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" | ||
integrity sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A== |
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,2 @@ | ||
// Entry point for the build script in your package.json | ||
import "./controllers" |
9 changes: 9 additions & 0 deletions
9
test/fixtures/esbuild-rails/app/javascript/controllers/application.js
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 } |
7 changes: 7 additions & 0 deletions
7
test/fixtures/esbuild-rails/app/javascript/controllers/hello_controller.js
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,7 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
connect() { | ||
|
||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
test/fixtures/esbuild-rails/app/javascript/controllers/index.js
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 "./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,9 @@ | ||
{ | ||
"name": "esbuild-rails", | ||
"private": true, | ||
"dependencies": { | ||
"@hotwired/stimulus": "^3.2.2", | ||
"esbuild": "^0.20.0", | ||
"esbuild-rails": "^1.0.7" | ||
} | ||
} |
Oops, something went wrong.