File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 25
25
- Clean up ` config.ml ` . https://github.com/rescript-lang/rescript/pull/7636
26
26
- Rewatch: simplify getting bsc path. https://github.com/rescript-lang/rescript/pull/7634
27
27
- Rewatch: only get ` "type": "dev" ` source files for local packages. https://github.com/rescript-lang/rescript/pull/7646
28
+ - Rewatch: add support for ` rescript -w ` for compatibility. https://github.com/rescript-lang/rescript/pull/7649
28
29
29
30
#### :rocket : New Feature
30
31
Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ pub struct BuildArgs {
107
107
108
108
#[ command( flatten) ]
109
109
pub snapshot_output : SnapshotOutputArg ,
110
+
111
+ /// Watch mode (deprecated, use `rescript watch` instead)
112
+ #[ arg( short, default_value_t = false , num_args = 0 ..=1 ) ]
113
+ pub watch : bool ,
110
114
}
111
115
112
116
#[ derive( Args , Clone , Debug ) ]
@@ -130,6 +134,19 @@ pub struct WatchArgs {
130
134
pub snapshot_output : SnapshotOutputArg ,
131
135
}
132
136
137
+ impl From < BuildArgs > for WatchArgs {
138
+ fn from ( build_args : BuildArgs ) -> Self {
139
+ Self {
140
+ folder : build_args. folder ,
141
+ filter : build_args. filter ,
142
+ after_build : build_args. after_build ,
143
+ create_sourcedirs : build_args. create_sourcedirs ,
144
+ dev : build_args. dev ,
145
+ snapshot_output : build_args. snapshot_output ,
146
+ }
147
+ }
148
+ }
149
+
133
150
#[ derive( Subcommand , Clone , Debug ) ]
134
151
pub enum Command {
135
152
/// Build the project
Original file line number Diff line number Diff line change @@ -17,13 +17,20 @@ fn main() -> Result<()> {
17
17
. target ( env_logger:: fmt:: Target :: Stdout )
18
18
. init ( ) ;
19
19
20
- let command = args. command . unwrap_or ( cli:: Command :: Build ( args. build_args ) ) ;
20
+ let mut command = args. command . unwrap_or ( cli:: Command :: Build ( args. build_args ) ) ;
21
+
22
+ if let cli:: Command :: Build ( build_args) = & command {
23
+ if build_args. watch {
24
+ log:: warn!( "`rescript build -w` is deprecated. Please use `rescript watch` instead." ) ;
25
+ command = cli:: Command :: Watch ( build_args. clone ( ) . into ( ) ) ;
26
+ }
27
+ }
21
28
22
29
// The 'normal run' mode will show the 'pretty' formatted progress. But if we turn off the log
23
30
// level, we should never show that.
24
31
let show_progress = log_level_filter == LevelFilter :: Info ;
25
32
26
- match command. clone ( ) {
33
+ match command {
27
34
cli:: Command :: CompilerArgs { path, dev } => {
28
35
println ! ( "{}" , build:: get_compiler_args( Path :: new( & path) , * dev) ?) ;
29
36
std:: process:: exit ( 0 ) ;
You can’t perform that action at this time.
0 commit comments