Skip to content

Commit b81ef88

Browse files
♻️ Add a 'dirty' parameter when building apps to not check the package interface.
1 parent 58fcd31 commit b81ef88

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/lustre_dev_tools/cli/build.gleam

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ JavaScript module for you to host or distribute.
5858
detect_tailwind,
5959
))
6060

61-
do_app(minify, detect_tailwind)
61+
do_app(minify, detect_tailwind, False)
6262
}
6363

6464
case cli.run(script, flags) {
@@ -67,14 +67,19 @@ JavaScript module for you to host or distribute.
6767
}
6868
}
6969

70-
pub fn do_app(minify: Bool, detect_tailwind: Bool) -> Cli(Nil) {
70+
pub fn do_app(minify: Bool, detect_tailwind: Bool, dirty: Bool) -> Cli(Nil) {
7171
use <- cli.log("Building your project")
7272
use project_name <- do(cli.get_name())
7373

7474
use <- cli.success("Project compiled successfully")
7575
use <- cli.log("Checking if I can bundle your application")
76-
use module <- try(get_module_interface(project_name))
77-
use _ <- try(check_main_function(project_name, module))
76+
use _ <- cli.do({
77+
use <- bool.guard(dirty == False, cli.return(Nil))
78+
use module <- try(get_module_interface(project_name))
79+
use _ <- try(check_main_function(project_name, module))
80+
81+
cli.return(Nil)
82+
})
7883

7984
use <- cli.log("Creating the bundle entry file")
8085
let root = project.root()

src/lustre_dev_tools/cli/start.gleam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Watchexec is a popular tool you can use to restart the server when files change.
4646
))
4747

4848
use _ <- do(check_otp_version())
49-
use _ <- do(build.do_app(False, detect_tailwind))
49+
use _ <- do(build.do_app(False, detect_tailwind, False))
5050
use _ <- do(prepare_html())
5151
use _ <- do(server.start(port))
5252

src/lustre_dev_tools/server/live_reload.gleam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ fn loop_watcher(
219219
glint.get_flag(_, flag.detect_tailwind()),
220220
),
221221
)
222-
use _ <- cli.do(build.do_app(False, detect_tailwind))
222+
use _ <- cli.do(build.do_app(False, detect_tailwind, True))
223223
use _ <- cli.do(cli.unmute())
224224

225225
cli.return(Nil)

0 commit comments

Comments
 (0)