-
-
Notifications
You must be signed in to change notification settings - Fork 171
Allow string entrypoints, add debug flag, and improve support for Docker #2031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jwoertink
merged 9 commits into
luckyframework:main
from
wout:allow-string-entrypoints-and-add-debug-flag
Apr 4, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9fb7d4e
Accept arrays and strings for js/css entrypoints in bun config
wout 1f04efc
Allow string entrpypoints in Bun config on the Crystal side
wout 1f5ba2f
Add basic test suite for the Bun config on the Crystal side
wout ad9dd58
Add `--debug` flag to enabel WebSocket client connection output
wout e91e85a
Fix eternal reconnect loop in `bun_reload_connect_tag`
wout 424c831
Add `listenHost` option to bun config for docker development setups
wout c92fc2c
Add `watchDirs` option to Bun config to limit watched files
wout 764d35f
Add tests for `watchDirs` config
wout b14f867
Check existence of watch dirs and warn if missing
wout File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,42 @@ | ||
| require "../spec_helper" | ||
|
|
||
| describe LuckyBun::Config do | ||
| it "uses defaults without a config file" do | ||
| config = LuckyBun::Config.from_json("{}") | ||
|
|
||
| config.dev_server.host.should eq("127.0.0.1") | ||
| config.dev_server.port.should eq(3002) | ||
| config.dev_server.secure?.should be_false | ||
| config.dev_server.ws_url.should eq("ws://127.0.0.1:3002") | ||
| config.entry_points.css.should eq(%w[src/css/app.css]) | ||
| config.entry_points.js.should eq(%w[src/js/app.js]) | ||
| config.manifest_path.should eq("public/bun-manifest.json") | ||
| config.out_dir.should eq("public/assets") | ||
| config.public_path.should eq("/assets") | ||
| config.static_dirs.should eq(%w[src/images src/fonts]) | ||
| end | ||
|
|
||
| it "accepts string entry points" do | ||
| config = LuckyBun::Config.from_json( | ||
| %({"entryPoints": {"js": "src/js/app.ts", "css": "src/css/app.css"}}) | ||
| ) | ||
|
|
||
| config.entry_points.js.should eq(%w[src/js/app.ts]) | ||
| config.entry_points.css.should eq(%w[src/css/app.css]) | ||
| end | ||
|
|
||
| it "accepts array entry points" do | ||
| config = LuckyBun::Config.from_json( | ||
| %({"entryPoints": {"js": ["src/js/app.js", "src/js/admin.js"]}}) | ||
| ) | ||
|
|
||
| config.entry_points.js.should eq(%w[src/js/app.js src/js/admin.js]) | ||
| end | ||
|
|
||
| it "supports secure websocket url" do | ||
| config = LuckyBun::Config.from_json(%({"devServer": {"secure": true}})) | ||
|
|
||
| config.dev_server.ws_protocol.should eq("wss") | ||
| config.dev_server.ws_url.should eq("wss://127.0.0.1:3002") | ||
| end | ||
| end |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clever. I was originally thinking it should have been an exception, but I think this actually fits better with the whole "action of least surprise" or whatever that saying is. I originally reached for a string without thinking 😅 so this works great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I figured you wouldn't be the first. I would probably walk into that as well at some point😊