Skip to content

Commit ecfcfb3

Browse files
committed
only fix
1 parent f287cbb commit ecfcfb3

File tree

18 files changed

+161
-60
lines changed

18 files changed

+161
-60
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ path = "module/move/wcensor"
478478
## willbe
479479

480480
[workspace.dependencies.willbe]
481-
version = "~0.20.0"
481+
version = "~0.21.0"
482482
path = "module/move/willbe"
483483

484484

module/move/willbe/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# module/move/willbe/Cargo.toml
22
[package]
33
name = "willbe"
4-
version = "0.20.0"
4+
version = "0.21.0"
55
edition = "2021"
66
authors = [
77
"Kostiantyn Wandalen <[email protected]>",

module/move/willbe/src/action/cicd_renew.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ mod private
144144
let content = handlebars.render( "module_push", &data )?;
145145
file_write( &workflow_file_name, &content )?;
146146

147-
println!( "file_write : {}", &workflow_file_name.display() );
147+
println!( "file_write : {:?}", &workflow_file_name );
148148
}
149149

150150
dbg!( &workflow_root );

module/move/willbe/src/action/crate_doc.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ mod private
104104
///
105105
/// # Errors
106106
/// Returns an error if the command arguments are invalid, the workspace cannot be loaded
107-
#[ allow( clippy::too_many_lines, clippy::result_large_err ) ]
107+
#[allow(clippy::too_many_lines)]
108108
pub fn doc
109109
(
110110
workspace : &Workspace,
@@ -123,17 +123,17 @@ mod private
123123
// --- Get crate name early for --package argument and file naming ---
124124
let manifest_path_for_name = crate_dir.as_ref().join( "Cargo.toml" );
125125
let manifest_content_for_name = fs::read_to_string( &manifest_path_for_name )
126-
.map_err( CrateDocError::Io )
127-
.context( format!( "Failed to read Cargo.toml at {}", manifest_path_for_name.display() ) )
128-
.err_with_report( &report )?;
126+
.map_err( CrateDocError::Io )
127+
.context( format!( "Failed to read Cargo.toml at {}", manifest_path_for_name.display() ) )
128+
.err_with_report( &report )?;
129129
let manifest_toml_for_name = manifest_content_for_name.parse::< Document >()
130-
.map_err( CrateDocError::Toml )
131-
.context( format!( "Failed to parse Cargo.toml at {}", manifest_path_for_name.display() ) )
132-
.err_with_report( &report )?;
130+
.map_err( CrateDocError::Toml )
131+
.context( format!( "Failed to parse Cargo.toml at {}", manifest_path_for_name.display() ) )
132+
.err_with_report( &report )?;
133133
let crate_name = manifest_toml_for_name[ "package" ][ "name" ]
134-
.as_str()
135-
.ok_or_else( || CrateDocError::MissingPackageName( manifest_path_for_name.clone() ) )
136-
.err_with_report( &report )?;
134+
.as_str()
135+
.ok_or_else( || CrateDocError::MissingPackageName( manifest_path_for_name.clone() ) )
136+
.err_with_report( &report )?;
137137
// --- End get crate name early ---
138138

139139
// Define the arguments for `cargo doc`

module/move/willbe/src/action/list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ mod private
324324
}
325325

326326
#[ allow( clippy::trivially_copy_pass_by_ref, clippy::needless_lifetimes ) ]
327-
fn process_package_dependency
327+
fn process_package_dependency< 'a >
328328
(
329329
workspace : &Workspace,
330-
package : &WorkspacePackageRef< '_ >,
330+
package : &WorkspacePackageRef< 'a >,
331331
args : &ListOptions,
332332
dep_rep : &mut tool::ListNodeReport,
333333
visited : &mut collection::HashSet< DependencyId >

module/move/willbe/src/action/publish.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ mod private
110110
///
111111
/// # Arguments
112112
/// * `patterns` - A vector of patterns specifying the folders to search for packages.
113+
/// * `exclude_dev_dependencies` - A boolean value indicating whether to exclude dev dependencies from manifest before publish.
113114
/// * `dry` - A boolean value indicating whether to perform a dry run.
114115
/// * `temp` - A boolean value indicating whether to use a temporary directory.
115116
///
@@ -120,6 +121,8 @@ mod private
120121
(
121122
patterns : Vec< String >,
122123
channel : channel::Channel,
124+
exclude_dev_dependencies : bool,
125+
commit_changes : bool,
123126
dry : bool,
124127
temp : bool
125128
)
@@ -216,6 +219,7 @@ mod private
216219
&tmp,
217220
&packages_to_publish,
218221
dir.clone(),
222+
exclude_dev_dependencies
219223
)?;
220224
let subgraph = subgraph
221225
.map( | _, n | n, | _, e | e );
@@ -235,6 +239,8 @@ mod private
235239
.channel( channel )
236240
.workspace_dir( CrateDir::try_from( workspace_root_dir ).unwrap() )
237241
.option_base_temp_dir( dir.clone() )
242+
.exclude_dev_dependencies( exclude_dev_dependencies )
243+
.commit_changes( commit_changes )
238244
.dry( dry )
239245
.roots( roots )
240246
.packages( queue )

module/move/willbe/src/action/publish_diff.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ mod private
2222
pub struct PublishDiffOptions
2323
{
2424
path : PathBuf,
25+
exclude_dev_dependencies : bool,
2526
keep_archive : Option< PathBuf >,
2627
}
2728

@@ -168,7 +169,7 @@ mod private
168169
std::fs::write( local_path, content )?;
169170
}
170171
}
171-
diffs.insert( path, crate_diff( &l, &r ).exclude( diff::PUBLISH_IGNORE_LIST ) );
172+
diffs.insert( path, crate_diff( &l, &r, o.exclude_dev_dependencies ).exclude( diff::PUBLISH_IGNORE_LIST ) );
172173
let report = tasks[ current_idx ].info.normal_dependencies.clone();
173174
let printer : Vec< TreePrinter > = report
174175
.iter()

module/move/willbe/src/command/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ mod private
2727
.kind( Type::String )
2828
.optional( true )
2929
.end()
30+
.property( "exclude_dev_dependencies" )
31+
.hint( "Setting this option to true will temporarily remove development dependencies before executing the command, then restore them afterward. Default is `true`." )
32+
.kind( Type::Bool )
33+
.optional( true )
34+
.end()
35+
.property( "commit_changes" )
36+
.hint( "Indicates whether changes should be committed. Default is `false`." )
37+
.kind( Type::Bool )
38+
.optional( true )
39+
.end()
3040
.property( "dry" )
3141
.hint( "Enables 'dry run'. Does not publish, only simulates. Default is `true`." )
3242
.kind( Type::Bool )
@@ -49,6 +59,11 @@ mod private
4959
.kind( Type::Path )
5060
.optional( true )
5161
.end()
62+
.property( "exclude_dev_dependencies" )
63+
.hint( "Setting this option to true will temporarily remove development dependencies before executing the command, then restore them afterward. Default is `true`." )
64+
.kind( Type::Bool )
65+
.optional( true )
66+
.end()
5267
.property( "keep_archive" )
5368
.hint( "Save remote package version to the specified path" )
5469
.kind( Type::Path )

module/move/willbe/src/command/publish.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ mod private
1717
{
1818
#[ former( default = Channel::Stable ) ]
1919
channel : Channel,
20+
#[ former( default = false ) ]
21+
exclude_dev_dependencies : bool,
22+
#[ former( default = false ) ]
23+
commit_changes : bool,
2024
#[ former( default = true ) ]
2125
dry : bool,
2226
#[ former( default = true ) ]
@@ -52,10 +56,12 @@ mod private
5256
let PublishProperties
5357
{
5458
channel,
59+
exclude_dev_dependencies,
60+
commit_changes,
5561
dry,
5662
temp
5763
} = o.props.try_into()?;
58-
let plan = action::publish_plan( patterns, channel, dry, temp )
64+
let plan = action::publish_plan( patterns, channel, exclude_dev_dependencies, commit_changes, dry, temp )
5965
.context( "Failed to plan the publication process" )?;
6066

6167
let mut formatted_plan = String::new();
@@ -110,6 +116,10 @@ mod private
110116
else
111117
{ this };
112118

119+
this = if let Some( v ) = value
120+
.get_owned( "exclude_dev_dependencies" ) { this.exclude_dev_dependencies::< bool >( v ) } else { this };
121+
this = if let Some( v ) = value
122+
.get_owned( "commit_changes" ) { this.commit_changes::< bool >( v ) } else { this };
113123
this = if let Some( v ) = value
114124
.get_owned( "dry" ) { this.dry::< bool >( v ) } else { this };
115125
this = if let Some( v ) = value

module/move/willbe/src/command/publish_diff.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ mod private
1414
#[ derive( former::Former ) ]
1515
struct PublishDiffProperties
1616
{
17+
#[ former( default = false ) ]
18+
exclude_dev_dependencies : bool,
1719
keep_archive : Option< PathBuf >,
1820
}
1921

@@ -36,10 +38,11 @@ mod private
3638
pub fn publish_diff( o : VerifiedCommand ) -> error::untyped::Result< () > // qqq : use typed error
3739
{
3840
let path : PathBuf = o.args.get_owned( 0 ).unwrap_or( std::env::current_dir()? );
39-
let PublishDiffProperties { keep_archive } = o.props.try_into()?;
41+
let PublishDiffProperties { keep_archive, exclude_dev_dependencies } = o.props.try_into()?;
4042

4143
let mut o = action::PublishDiffOptions::former()
42-
.path( path );
44+
.path( path )
45+
.exclude_dev_dependencies( exclude_dev_dependencies );
4346
if let Some( k ) = keep_archive.clone() { o = o.keep_archive( k ); }
4447
let o = o.form();
4548

@@ -61,6 +64,12 @@ mod private
6164
{
6265
let mut this = Self::former();
6366

67+
this = if let Some( v ) = value
68+
.get_owned( "exclude_dev_dependencies" )
69+
{ this.exclude_dev_dependencies::< bool >( v ) }
70+
else
71+
{ this };
72+
6473
this = if let Some( v ) = value
6574
.get_owned( "keep_archive" )
6675
{ this.keep_archive::< PathBuf >( v ) }

0 commit comments

Comments
 (0)