Skip to content

Commit be29811

Browse files
committed
fix: restore CI after main rebase
1 parent c2361ab commit be29811

12 files changed

Lines changed: 24 additions & 56 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ Vite+ is the unified entry point for local web development. It combines [Vite](h
1919
- **`vp build`:** Build applications for production with Vite + Rolldown
2020
- **`vp run`:** Execute monorepo tasks with caching and dependency-aware scheduling
2121
- **`vp pack`:** Build libraries for npm publishing or standalone app binaries
22-
- **`vp release`:** Publish workspace releases
22+
- **`vp release`:** Version and publish workspace packages with native publish preflight during `--dry-run`, release checks before real publishes by default, retry-friendly exact version overrides via `--version`, optional changelog generation via `--changelog`, prerelease channels like `--preid alpha` / `beta` / `rc`, and `--projects` order respected between independent packages
2323
- **`vp create` / `vp migrate`:** Scaffold new projects and migrate existing ones
2424

2525
All of this is configured from your project root and works across Vite's framework ecosystem.
2626
Vite+ is fully open-source under the MIT license.
2727

28+
`vp release` detects likely checks from `build`, `pack`, `prepack`, `prepublishOnly`, `prepare`, and `vitePlus.release.checkScripts`. Real releases run those checks before publishing unless you pass `--no-run-checks`; dry-runs stay lightweight by default and can opt in with `--run-checks`. `--dry-run` also runs the native publisher in dry-run mode from a temporary release manifest state when the git worktree is clean. Use `--yes` for CI or other non-interactive runs, and `--version <x.y.z>` when retrying a partial publish at an exact version.
29+
30+
Real releases always create git tags after a successful publish. When every released package shares the same target version, `vp release` also creates a repository-level `v<version>` tag so GitHub Releases and repo-wide release notes can follow the same watermark. Preview-only flags such as `--skip-publish` and `--no-git-tag` are therefore limited to `--dry-run`.
31+
2832
## Getting Started
2933

3034
Install Vite+ globally as `vp`:
@@ -121,7 +125,7 @@ Use `vp migrate` to migrate to Vite+. It merges tool-specific config files such
121125

122126
- **build** - Build for production
123127
- **pack** - Build libraries
124-
- **release** - Publish workspace releases
128+
- **release** - Version and publish workspace packages, with optional changelog generation
125129
- **preview** - Preview production build
126130

127131
#### Manage Dependencies

crates/vite_global_cli/src/commands/mod.rs

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
use std::{collections::HashMap, io::BufReader};
2020

21-
use vite_install::package_manager::{PackageManager, PackageManagerType};
21+
use vite_install::package_manager::PackageManager;
2222
use vite_path::AbsolutePath;
2323
use vite_shared::{PrependOptions, prepend_to_path_env};
2424

@@ -97,37 +97,6 @@ pub async fn build_package_manager(cwd: &AbsolutePath) -> Result<PackageManager,
9797
}
9898
}
9999

100-
/// Build a PackageManager, falling back to a default npm instance when no
101-
/// package.json is found. Uses `build()` instead of `build_with_default()`
102-
/// to skip the interactive package manager selection prompt on the fallback path.
103-
///
104-
/// Requires `prepend_js_runtime_to_path_env` to be called first so npm is on PATH.
105-
pub async fn build_package_manager_or_npm_default(
106-
cwd: &AbsolutePath,
107-
) -> Result<PackageManager, Error> {
108-
match PackageManager::builder(cwd).build().await {
109-
Ok(pm) => Ok(pm),
110-
Err(vite_error::Error::WorkspaceError(vite_workspace::Error::PackageJsonNotFound(_)))
111-
| Err(vite_error::Error::UnrecognizedPackageManager) => {
112-
Ok(default_npm_package_manager(cwd))
113-
}
114-
Err(e) => Err(e.into()),
115-
}
116-
}
117-
118-
fn default_npm_package_manager(cwd: &AbsolutePath) -> PackageManager {
119-
PackageManager {
120-
client: PackageManagerType::Npm,
121-
package_name: "npm".into(),
122-
version: "latest".into(),
123-
hash: None,
124-
bin_name: "npm".into(),
125-
workspace_root: cwd.to_absolute_path_buf(),
126-
is_monorepo: false,
127-
install_dir: cwd.to_absolute_path_buf(),
128-
}
129-
}
130-
131100
pub mod release;
132101

133102
// Category B: JS Script Commands

crates/vite_global_cli/src/commands/release/first_publish.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,8 @@ impl<'a> ChecklistStep<'a> {
297297
let iter = lines.into_iter();
298298
let (lower, _) = iter.size_hint();
299299
let mut collected = Vec::with_capacity(lower);
300-
for line in iter {
301-
if let Some(line) = line {
302-
collected.push(line);
303-
}
300+
for line in iter.flatten() {
301+
collected.push(line);
304302
}
305303
Self { title, lines: collected }
306304
}
@@ -587,7 +585,7 @@ fn find_existing_release_workflow_path(cwd: &AbsolutePath) -> Option<String> {
587585
let mut path = String::with_capacity(file_name.len() + 18);
588586
path.push_str(".github/workflows/");
589587
path.push_str(&file_name);
590-
let should_replace = best_path.as_ref().map_or(true, |best| {
588+
let should_replace = best_path.as_ref().is_none_or(|best| {
591589
let best_lowercase = best.to_ascii_lowercase();
592590
let best_mentions_publish = best_lowercase.contains("publish");
593591
(mentions_publish && !best_mentions_publish)

crates/vite_global_cli/src/commands/release/manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ impl ReleaseManager {
388388
plan.repository_url
389389
.as_deref()
390390
.and_then(parse_github_repo_slug)
391-
.map_or(true, |slug| slug != expected_repository)
391+
.is_none_or(|slug| slug != expected_repository)
392392
})
393393
.map(|plan| plan.name.as_str())
394394
.collect();

crates/vite_global_cli/src/commands/release/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
//! - Conventional Commits 1.0.0: https://www.conventionalcommits.org/en/v1.0.0/#specification
77
//! - Conventional Commits FAQ: https://www.conventionalcommits.org/en/v1.0.0/#faq
88
9+
#![allow(clippy::wildcard_imports)]
10+
911
use std::{
1012
collections::{BTreeMap, HashMap, HashSet},
1113
fmt::{self, Write as _},

crates/vite_global_cli/src/commands/release/planning.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,7 @@ pub(super) fn find_latest_package_version(
343343
Ok(stdout
344344
.lines()
345345
.map(str::trim)
346-
.filter_map(|tag_name| RELEASE_TAG_FORMAT.parse_version(tag_name))
347-
.next())
346+
.find_map(|tag_name| RELEASE_TAG_FORMAT.parse_version(tag_name)))
348347
}
349348

350349
pub(super) fn find_latest_repository_release_tag(
@@ -362,7 +361,7 @@ pub(super) fn find_latest_repository_release_version(
362361
cwd: &AbsolutePath,
363362
) -> Result<Option<Version>, Error> {
364363
let stdout = capture_git(cwd, ["tag", "--list", "--sort=-creatordate", "v*"])?;
365-
Ok(stdout.lines().map(str::trim).filter_map(parse_repository_release_version).next())
364+
Ok(stdout.lines().map(str::trim).find_map(parse_repository_release_version))
366365
}
367366

368367
pub(super) fn find_latest_repository_stable_release_version(

crates/vite_global_cli/src/commands/release/reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ pub(super) fn confirm_release(
568568
let joined_channels = custom_prerelease_channels.join(", ");
569569
let mut prompt = String::from("Continue with non-standard prerelease channel");
570570
prompt.push_str(suffix);
571-
prompt.push_str(" ");
571+
prompt.push(' ');
572572
prompt.push_str(&joined_channels);
573573
prompt.push_str("? [y/N] ");
574574
if !prompt_for_confirmation(&prompt, false)? {

crates/vite_global_cli/src/commands/release/storage.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,11 @@ pub(super) async fn publish_packages(
366366

367367
/// Applies final release artifacts transactionally, rolling back already-written files on error.
368368
pub(super) fn apply_release_artifact_edits(edits: &[ReleaseArtifactEdit]) -> Result<(), Error> {
369-
let mut applied_count = 0usize;
370-
for edit in edits {
369+
for (applied_count, edit) in edits.iter().enumerate() {
371370
if let Err(error) = write_release_artifact_edit(edit) {
372371
let rollback_result = rollback_applied_release_artifact_edits(&edits[..applied_count]);
373372
return Err(release_artifact_error("write release artifacts", error, rollback_result));
374373
}
375-
applied_count += 1;
376374
}
377375

378376
Ok(())
@@ -567,8 +565,7 @@ pub(super) fn apply_manifest_edits(
567565
manifest_edits: &[ManifestEdit],
568566
restore_original: bool,
569567
) -> Result<(), Error> {
570-
let mut applied_edits = 0usize;
571-
for edit in manifest_edits {
568+
for (applied_edits, edit) in manifest_edits.iter().enumerate() {
572569
let contents =
573570
if restore_original { &edit.original_contents } else { &edit.updated_contents };
574571
if let Err(error) = fs::write(&edit.path, contents) {
@@ -589,7 +586,6 @@ pub(super) fn apply_manifest_edits(
589586
}
590587
return Err(Error::UserMessage(message.into()));
591588
}
592-
applied_edits += 1;
593589
}
594590

595591
Ok(())

crates/vite_install/src/commands/publish.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ impl PackageManager {
211211
let can_use_native_yarn = !self.version.starts_with("1.")
212212
&& options.target.is_none()
213213
&& !options.recursive
214-
&& options.filters.map_or(true, |filters| filters.is_empty())
214+
&& options.filters.is_none_or(|filters| filters.is_empty())
215215
&& options.publish_branch.is_none()
216216
&& !options.report_summary
217217
&& options
218218
.pass_through_args
219-
.map_or(true, |pass_through_args| pass_through_args.is_empty())
219+
.is_none_or(|pass_through_args| pass_through_args.is_empty())
220220
&& !options.force;
221221

222222
if can_use_native_yarn {

0 commit comments

Comments
 (0)