Skip to content
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

refactor(cli): add --no-bundle flag, skip bundling on invalid formats #8990

Merged
merged 5 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/cli-build-no-bundle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'tauri-cli': 'patch:enhance'
'@tauri-apps/cli': 'patch:enhance'
---

Add `--no-bundle` flag for `tauri build` command to skip bundling. Previously `none` was used to skip bundling, it will now be treated as invalid format and a warning will be emitted instead.
5 changes: 5 additions & 0 deletions .changes/utils-bundle-target-all.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-utils': 'patch:bug'
---

Fix `BundleTarget::to_vec` returning an empty vec for `BundleTarget::All` variant.
5 changes: 5 additions & 0 deletions .changes/utils-bundle-type-all.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-utils': 'patch:bug'
---

Add `BundleType::all` method to return all possible `BundleType` variants.
18 changes: 17 additions & 1 deletion core/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ pub enum BundleType {
Updater,
}

impl BundleType {
/// All bundle types.
fn all() -> &'static [Self] {
&[
BundleType::Deb,
BundleType::Rpm,
BundleType::AppImage,
BundleType::Msi,
BundleType::Nsis,
BundleType::App,
BundleType::Dmg,
BundleType::Updater,
]
}
}

impl Display for BundleType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
Expand Down Expand Up @@ -274,7 +290,7 @@ impl BundleTarget {
#[allow(dead_code)]
pub fn to_vec(&self) -> Vec<BundleType> {
match self {
Self::All => vec![],
Self::All => BundleType::all().to_vec(),
Self::List(list) => list.clone(),
Self::One(i) => vec![i.clone()],
}
Expand Down
16 changes: 8 additions & 8 deletions examples/api/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading