diff --git a/.github/workflows/publish-crates.yml b/.github/workflows/publish-crates.yml index 00efbecbe..6db4f0094 100644 --- a/.github/workflows/publish-crates.yml +++ b/.github/workflows/publish-crates.yml @@ -31,9 +31,9 @@ jobs: - run: cargo publish -p axoproject --token ${CRATES_TOKEN} env: CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} - - run: cargo publish -p cargo-dist-schema --token ${CRATES_TOKEN} + - run: cargo publish -p dist-schema --token ${CRATES_TOKEN} env: CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} - - run: cargo publish -p cargo-dist --token ${CRATES_TOKEN} + - run: cargo publish -p dist --token ${CRATES_TOKEN} env: CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index 57a44c390..3a233d167 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -378,71 +378,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cargo-dist" -version = "0.28.0" -dependencies = [ - "axoasset", - "axocli", - "axoprocess", - "axoproject", - "axotag", - "axoupdater", - "backtrace", - "base64", - "blake2", - "camino", - "cargo-dist-schema", - "cargo-wix", - "cargo_metadata", - "clap", - "clap-cargo", - "color-backtrace", - "comfy-table", - "console", - "current_platform", - "dialoguer", - "flate2", - "gazenot", - "goblin", - "include_dir", - "insta", - "itertools 0.13.0", - "lazy_static", - "mach_object", - "miette 7.4.0", - "minijinja", - "newline-converter", - "schemars", - "semver", - "serde", - "serde_json", - "sha2", - "sha3", - "similar", - "spdx", - "tar", - "temp-dir", - "thiserror 2.0.9", - "tokio", - "tracing", - "uuid", -] - -[[package]] -name = "cargo-dist-schema" -version = "0.28.0" -dependencies = [ - "camino", - "gazenot", - "insta", - "schemars", - "semver", - "serde", - "serde_json", - "target-lexicon", -] - [[package]] name = "cargo-platform" version = "0.1.8" @@ -840,6 +775,71 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "dist" +version = "0.28.0" +dependencies = [ + "axoasset", + "axocli", + "axoprocess", + "axoproject", + "axotag", + "axoupdater", + "backtrace", + "base64", + "blake2", + "camino", + "cargo-wix", + "cargo_metadata", + "clap", + "clap-cargo", + "color-backtrace", + "comfy-table", + "console", + "current_platform", + "dialoguer", + "dist-schema", + "flate2", + "gazenot", + "goblin", + "include_dir", + "insta", + "itertools 0.13.0", + "lazy_static", + "mach_object", + "miette 7.4.0", + "minijinja", + "newline-converter", + "schemars", + "semver", + "serde", + "serde_json", + "sha2", + "sha3", + "similar", + "spdx", + "tar", + "temp-dir", + "thiserror 2.0.9", + "tokio", + "tracing", + "uuid", +] + +[[package]] +name = "dist-schema" +version = "0.28.0" +dependencies = [ + "camino", + "gazenot", + "insta", + "schemars", + "semver", + "serde", + "serde_json", + "target-lexicon", +] + [[package]] name = "dyn-clone" version = "1.0.17" diff --git a/Cargo.toml b/Cargo.toml index 8fcf3a461..a0074cd29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ rust-version = "1.74" [workspace.dependencies] # intra-workspace deps (you need to bump these versions when you cut releases too! -cargo-dist-schema = { version = "=0.28.0", path = "cargo-dist-schema" } +dist-schema = { version = "=0.28.0", path = "cargo-dist-schema" } axoproject = { version = "=0.28.0", path = "axoproject", default-features = false, features = ["cargo-projects", "generic-projects", "npm-projects"] } # first-party deps diff --git a/cargo-dist-schema/Cargo.toml b/cargo-dist-schema/Cargo.toml index 37bea8b2d..f13cc2a87 100644 --- a/cargo-dist-schema/Cargo.toml +++ b/cargo-dist-schema/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "cargo-dist-schema" +name = "dist-schema" description = "Schema information for cargo-dist's dist-manifest.json" version.workspace = true edition.workspace = true diff --git a/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap b/cargo-dist-schema/src/snapshots/dist_schema__emit.snap similarity index 100% rename from cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap rename to cargo-dist-schema/src/snapshots/dist_schema__emit.snap diff --git a/cargo-dist/Cargo.toml b/cargo-dist/Cargo.toml index b7b72f98e..e671e1362 100644 --- a/cargo-dist/Cargo.toml +++ b/cargo-dist/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "cargo-dist" +name = "dist" description = "Shippable application packaging for Rust" version.workspace = true edition.workspace = true @@ -35,7 +35,7 @@ axocli.workspace = true axoupdater.workspace = true # Features used by the cli and library -cargo-dist-schema.workspace = true +dist-schema.workspace = true axoproject.workspace = true axotag.workspace = true diff --git a/cargo-dist/src/announce.rs b/cargo-dist/src/announce.rs index b08c6fc53..dbe56d9f6 100644 --- a/cargo-dist/src/announce.rs +++ b/cargo-dist/src/announce.rs @@ -90,7 +90,7 @@ use std::fmt::Display; use axoproject::PackageIdx; use axotag::{parse_tag, Package, PartialAnnouncementTag, ReleaseType}; -use cargo_dist_schema::{DistManifest, GithubHosting, TripleName, TripleNameRef}; +use dist_schema::{DistManifest, GithubHosting, TripleName, TripleNameRef}; use itertools::Itertools; use semver::Version; use tracing::info; @@ -884,9 +884,9 @@ pub fn announcement_github(manifest: &mut DistManifest) { for (_name, artifact) in manifest.artifacts_for_release(release) { match artifact.kind { - cargo_dist_schema::ArtifactKind::ExecutableZip => bundles.push(artifact), - cargo_dist_schema::ArtifactKind::Symbols => symbols.push(artifact), - cargo_dist_schema::ArtifactKind::Installer => { + dist_schema::ArtifactKind::ExecutableZip => bundles.push(artifact), + dist_schema::ArtifactKind::Symbols => symbols.push(artifact), + dist_schema::ArtifactKind::Installer => { if let (Some(desc), Some(hint)) = (&artifact.description, &artifact.install_hint) { @@ -895,10 +895,10 @@ pub fn announcement_github(manifest: &mut DistManifest) { local_installers.push(artifact); } } - cargo_dist_schema::ArtifactKind::Checksum => { + dist_schema::ArtifactKind::Checksum => { // Do Nothing (will be included with the artifact it checksums) } - cargo_dist_schema::ArtifactKind::Unknown => { + dist_schema::ArtifactKind::Unknown => { // Do nothing } _ => { @@ -1022,7 +1022,7 @@ fn sortable_triple(triple: &TripleNameRef) -> Vec { #[cfg(test)] mod tests { - use cargo_dist_schema::TripleNameRef; + use dist_schema::TripleNameRef; use super::sortable_triple; #[test] diff --git a/cargo-dist/src/backend/ci/github.rs b/cargo-dist/src/backend/ci/github.rs index 26e24167e..3d19c1dea 100644 --- a/cargo-dist/src/backend/ci/github.rs +++ b/cargo-dist/src/backend/ci/github.rs @@ -7,7 +7,7 @@ use std::collections::BTreeMap; use axoasset::{LocalAsset, SourceFile}; use axoprocess::Cmd; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ +use dist_schema::{ target_lexicon::{self, Architecture, OperatingSystem, Triple}, AptPackageName, ChocolateyPackageName, ContainerImageRef, GhaRunStep, GithubGlobalJobConfig, GithubLocalJobConfig, GithubMatrix, GithubRunnerConfig, GithubRunnerRef, GithubRunners, @@ -66,9 +66,9 @@ pub struct GithubCiInfo { /// Trigger releases on pushes to this branch instead of ci pub release_branch: Option, /// Matrix for upload-local-artifacts - pub artifacts_matrix: cargo_dist_schema::GithubMatrix, + pub artifacts_matrix: dist_schema::GithubMatrix, /// What kind of job to run on pull request - pub pr_run_mode: cargo_dist_schema::PrRunMode, + pub pr_run_mode: dist_schema::PrRunMode, /// global task pub global_task: GithubGlobalJobConfig, /// homebrew tap @@ -222,7 +222,7 @@ impl GithubCiInfo { let mut dependencies = SystemDependencies::default(); let caching_could_be_profitable = - release_branch.is_some() || pr_run_mode == cargo_dist_schema::PrRunMode::Upload; + release_branch.is_some() || pr_run_mode == dist_schema::PrRunMode::Upload; let cache_builds = cache_builds.unwrap_or(caching_could_be_profitable); let need_cargo_auditable = dist.config.builds.cargo.cargo_auditable; @@ -679,10 +679,10 @@ fn cargo_xwin() -> GithubRunnerConfig { GithubRunnerConfig { runner: GithubRunnerRef::from_str("ubuntu-20.04").to_owned(), host: targets::TARGET_X64_LINUX_GNU.to_owned(), - container: Some(cargo_dist_schema::ContainerConfig { + container: Some(dist_schema::ContainerConfig { image: ContainerImageRef::from_str("messense/cargo-xwin").to_owned(), host: targets::TARGET_X64_LINUX_MUSL.to_owned(), - package_manager: Some(cargo_dist_schema::PackageManager::Apt), + package_manager: Some(dist_schema::PackageManager::Apt), }), } } @@ -743,7 +743,7 @@ fn system_deps_install_script( // apt-using runners. if rc.container.is_none() || rc.container.as_ref().and_then(|c| c.package_manager) - == Some(cargo_dist_schema::PackageManager::Apt) + == Some(dist_schema::PackageManager::Apt) { for (name, pkg) in &packages.apt { if !pkg.0.stage_wanted(&DependencyKind::Build) { diff --git a/cargo-dist/src/backend/ci/mod.rs b/cargo-dist/src/backend/ci/mod.rs index be0cef280..bd1d06d76 100644 --- a/cargo-dist/src/backend/ci/mod.rs +++ b/cargo-dist/src/backend/ci/mod.rs @@ -1,6 +1,6 @@ //! Support for generating CI scripts for running dist -use cargo_dist_schema::{ +use dist_schema::{ target_lexicon::{OperatingSystem, Triple}, DashScript, GhaRunStep, PowershellScript, }; @@ -101,7 +101,7 @@ impl DistInstallSettings<'_> { } let version = self.version; - let format = cargo_dist_schema::format_of_version(version); + let format = dist_schema::format_of_version(version); let installer_name = if format.unsupported() { // FIXME: we should probably do this check way higher up and produce a proper err... panic!("requested dist v{version}, which is not supported by the this copy of dist ({SELF_DIST_VERSION})"); diff --git a/cargo-dist/src/backend/installer/homebrew.rs b/cargo-dist/src/backend/installer/homebrew.rs index 9e7172d36..288edf47c 100644 --- a/cargo-dist/src/backend/installer/homebrew.rs +++ b/cargo-dist/src/backend/installer/homebrew.rs @@ -1,7 +1,7 @@ //! Code for generating formula.rb use axoasset::LocalAsset; -use cargo_dist_schema::{ChecksumValue, DistManifest, HomebrewPackageName}; +use dist_schema::{ChecksumValue, DistManifest, HomebrewPackageName}; use serde::Serialize; use spdx::{ expression::{ExprNode, Operator}, diff --git a/cargo-dist/src/backend/installer/mod.rs b/cargo-dist/src/backend/installer/mod.rs index e3a9299c7..090c42a8d 100644 --- a/cargo-dist/src/backend/installer/mod.rs +++ b/cargo-dist/src/backend/installer/mod.rs @@ -5,7 +5,7 @@ use std::collections::BTreeMap; use camino::Utf8PathBuf; -use cargo_dist_schema::{ArtifactId, EnvironmentVariables, Hosting, TripleName}; +use dist_schema::{ArtifactId, EnvironmentVariables, Hosting, TripleName}; use homebrew::HomebrewFragments; use macpkg::PkgInstallerInfo; use serde::Serialize; diff --git a/cargo-dist/src/backend/installer/msi.rs b/cargo-dist/src/backend/installer/msi.rs index 706e6969e..c26df2f2b 100644 --- a/cargo-dist/src/backend/installer/msi.rs +++ b/cargo-dist/src/backend/installer/msi.rs @@ -2,7 +2,7 @@ use axoasset::{toml_edit, LocalAsset}; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::TripleName; +use dist_schema::TripleName; use tracing::info; use wix::print::{wxs::WxsRenders, RenderOutput}; diff --git a/cargo-dist/src/backend/installer/npm.rs b/cargo-dist/src/backend/installer/npm.rs index 2f019acf3..0520309b4 100644 --- a/cargo-dist/src/backend/installer/npm.rs +++ b/cargo-dist/src/backend/installer/npm.rs @@ -2,7 +2,7 @@ use axoasset::{LocalAsset, SourceFile}; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ArtifactId, GlibcVersion, TripleName}; +use dist_schema::{ArtifactId, GlibcVersion, TripleName}; use serde::Serialize; use super::InstallerInfo; diff --git a/cargo-dist/src/backend/installer/shell.rs b/cargo-dist/src/backend/installer/shell.rs index d005d1ce4..d24a28e9d 100644 --- a/cargo-dist/src/backend/installer/shell.rs +++ b/cargo-dist/src/backend/installer/shell.rs @@ -1,7 +1,7 @@ //! Code for generating installer.sh use axoasset::LocalAsset; -use cargo_dist_schema::DistManifest; +use dist_schema::DistManifest; use crate::{backend::templates::TEMPLATE_INSTALLER_SH, errors::DistResult, DistGraph}; diff --git a/cargo-dist/src/build/cargo.rs b/cargo-dist/src/build/cargo.rs index c3d0be405..06f1dfde8 100644 --- a/cargo-dist/src/build/cargo.rs +++ b/cargo-dist/src/build/cargo.rs @@ -4,8 +4,8 @@ use std::env; use axoprocess::Cmd; use axoproject::WorkspaceIdx; -use cargo_dist_schema::target_lexicon::{Architecture, Environment, Triple}; -use cargo_dist_schema::{DistManifest, TripleName}; +use dist_schema::target_lexicon::{Architecture, Environment, Triple}; +use dist_schema::{DistManifest, TripleName}; use miette::{Context, IntoDiagnostic}; use tracing::warn; @@ -272,7 +272,7 @@ pub fn build_cargo_target( } let auditable = dist_graph.config.builds.cargo.cargo_auditable; - let host = cargo_dist_schema::target_lexicon::HOST; + let host = dist_schema::target_lexicon::HOST; let mut command = make_build_cargo_target_command(&host, &cargo.cmd, &rustflags, step, auditable)?; diff --git a/cargo-dist/src/build/fake.rs b/cargo-dist/src/build/fake.rs index bb9c5e96b..ccf778856 100644 --- a/cargo-dist/src/build/fake.rs +++ b/cargo-dist/src/build/fake.rs @@ -5,7 +5,7 @@ use axoasset::LocalAsset; use camino::Utf8PathBuf; -use cargo_dist_schema::DistManifest; +use dist_schema::DistManifest; use crate::{BinaryIdx, CargoBuildStep, DistGraph, DistResult, GenericBuildStep}; diff --git a/cargo-dist/src/build/generic.rs b/cargo-dist/src/build/generic.rs index 169bccd72..c69bd66b7 100644 --- a/cargo-dist/src/build/generic.rs +++ b/cargo-dist/src/build/generic.rs @@ -5,7 +5,7 @@ use std::{env, process::ExitStatus}; use axoprocess::Cmd; use axoproject::WorkspaceIdx; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{DistManifest, TripleName, TripleNameRef}; +use dist_schema::{DistManifest, TripleName, TripleNameRef}; use crate::{ build::{package_id_string, BuildExpectations}, diff --git a/cargo-dist/src/build/mod.rs b/cargo-dist/src/build/mod.rs index 388e49e56..71c36baed 100644 --- a/cargo-dist/src/build/mod.rs +++ b/cargo-dist/src/build/mod.rs @@ -2,7 +2,7 @@ use axoproject::PackageId; use camino::Utf8PathBuf; -use cargo_dist_schema::{AssetInfo, DistManifest, TripleNameRef}; +use dist_schema::{AssetInfo, DistManifest, TripleNameRef}; use tracing::info; use crate::{ @@ -207,8 +207,8 @@ impl BuildExpectations { // If we're faking it, don't run the linkage stuff let linkage = if self.fake { // FIXME: fake this more interestingly! - let mut linkage = cargo_dist_schema::Linkage::default(); - linkage.other.insert(cargo_dist_schema::Library { + let mut linkage = dist_schema::Linkage::default(); + linkage.other.insert(dist_schema::Library { path: "fakelib".to_owned(), source: None, package_manager: None, diff --git a/cargo-dist/src/cli.rs b/cargo-dist/src/cli.rs index a9f8540fe..d2e4d3cba 100644 --- a/cargo-dist/src/cli.rs +++ b/cargo-dist/src/cli.rs @@ -1,12 +1,12 @@ //! All the clap stuff for parsing/documenting the cli use camino::Utf8PathBuf; -use cargo_dist::announce::{TagMode, TagSettings}; -use cargo_dist_schema::TripleName; use clap::{ builder::{PossibleValuesParser, TypedValueParser}, Args, Parser, Subcommand, ValueEnum, }; +use dist::announce::{TagMode, TagSettings}; +use dist_schema::TripleName; use tracing::level_filters::LevelFilter; #[derive(Parser, Clone, Debug)] @@ -233,13 +233,13 @@ pub enum ArtifactMode { impl ArtifactMode { /// Convert the application version of this enum to the library version - pub fn to_lib(self) -> cargo_dist::config::ArtifactMode { + pub fn to_lib(self) -> dist::config::ArtifactMode { match self { - ArtifactMode::Local => cargo_dist::config::ArtifactMode::Local, - ArtifactMode::Global => cargo_dist::config::ArtifactMode::Global, - ArtifactMode::Host => cargo_dist::config::ArtifactMode::Host, - ArtifactMode::All => cargo_dist::config::ArtifactMode::All, - ArtifactMode::Lies => cargo_dist::config::ArtifactMode::Lies, + ArtifactMode::Local => dist::config::ArtifactMode::Local, + ArtifactMode::Global => dist::config::ArtifactMode::Global, + ArtifactMode::Host => dist::config::ArtifactMode::Host, + ArtifactMode::All => dist::config::ArtifactMode::All, + ArtifactMode::Lies => dist::config::ArtifactMode::Lies, } } } @@ -291,10 +291,10 @@ pub enum GenerateMode { impl GenerateMode { /// Convert the application version of this enum to the library version - pub fn to_lib(self) -> cargo_dist::config::GenerateMode { + pub fn to_lib(self) -> dist::config::GenerateMode { match self { - GenerateMode::Ci => cargo_dist::config::GenerateMode::Ci, - GenerateMode::Msi => cargo_dist::config::GenerateMode::Msi, + GenerateMode::Ci => dist::config::GenerateMode::Ci, + GenerateMode::Msi => dist::config::GenerateMode::Msi, } } } @@ -391,9 +391,9 @@ pub enum CiStyle { impl CiStyle { /// Convert the application version of this enum to the library version - pub fn to_lib(self) -> cargo_dist::config::CiStyle { + pub fn to_lib(self) -> dist::config::CiStyle { match self { - CiStyle::Github => cargo_dist::config::CiStyle::Github, + CiStyle::Github => dist::config::CiStyle::Github, } } } @@ -415,13 +415,13 @@ pub enum InstallerStyle { impl InstallerStyle { /// Convert the application version of this enum to the library version - pub fn to_lib(self) -> cargo_dist::config::InstallerStyle { + pub fn to_lib(self) -> dist::config::InstallerStyle { match self { - InstallerStyle::Shell => cargo_dist::config::InstallerStyle::Shell, - InstallerStyle::Powershell => cargo_dist::config::InstallerStyle::Powershell, - InstallerStyle::Npm => cargo_dist::config::InstallerStyle::Npm, - InstallerStyle::Homebrew => cargo_dist::config::InstallerStyle::Homebrew, - InstallerStyle::Msi => cargo_dist::config::InstallerStyle::Msi, + InstallerStyle::Shell => dist::config::InstallerStyle::Shell, + InstallerStyle::Powershell => dist::config::InstallerStyle::Powershell, + InstallerStyle::Npm => dist::config::InstallerStyle::Npm, + InstallerStyle::Homebrew => dist::config::InstallerStyle::Homebrew, + InstallerStyle::Msi => dist::config::InstallerStyle::Msi, } } } @@ -465,13 +465,13 @@ pub struct HostArgs { impl HostStyle { /// Convert the application version of this enum to the library version - pub fn to_lib(self) -> cargo_dist::config::HostStyle { + pub fn to_lib(self) -> dist::config::HostStyle { match self { - HostStyle::Check => cargo_dist::config::HostStyle::Check, - HostStyle::Create => cargo_dist::config::HostStyle::Create, - HostStyle::Upload => cargo_dist::config::HostStyle::Upload, - HostStyle::Release => cargo_dist::config::HostStyle::Release, - HostStyle::Announce => cargo_dist::config::HostStyle::Announce, + HostStyle::Check => dist::config::HostStyle::Check, + HostStyle::Create => dist::config::HostStyle::Create, + HostStyle::Upload => dist::config::HostStyle::Upload, + HostStyle::Release => dist::config::HostStyle::Release, + HostStyle::Announce => dist::config::HostStyle::Announce, } } } @@ -493,10 +493,10 @@ pub enum HostStyle { impl HostingStyle { /// Convert the application version of this enum to the library version - pub fn to_lib(self) -> cargo_dist::config::HostingStyle { + pub fn to_lib(self) -> dist::config::HostingStyle { match self { - HostingStyle::Github => cargo_dist::config::HostingStyle::Github, - HostingStyle::Axodotdev => cargo_dist::config::HostingStyle::Axodotdev, + HostingStyle::Github => dist::config::HostingStyle::Github, + HostingStyle::Axodotdev => dist::config::HostingStyle::Axodotdev, } } } diff --git a/cargo-dist/src/config/mod.rs b/cargo-dist/src/config/mod.rs index 4d27e03db..2123aefef 100644 --- a/cargo-dist/src/config/mod.rs +++ b/cargo-dist/src/config/mod.rs @@ -5,7 +5,7 @@ use std::collections::BTreeMap; use axoasset::{toml_edit, SourceFile}; use axoproject::local_repo::LocalRepo; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ +use dist_schema::{ AptPackageName, ChecksumExtensionRef, ChocolateyPackageName, HomebrewPackageName, PackageVersion, TripleName, TripleNameRef, }; @@ -175,13 +175,13 @@ impl std::str::FromStr for LibraryStyle { #[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "kebab-case")] pub enum InstallerStyle { - /// Generate a shell script that fetches from [`cargo_dist_schema::Release::artifact_download_url`][] + /// Generate a shell script that fetches from [`dist_schema::Release::artifact_download_url`][] Shell, - /// Generate a powershell script that fetches from [`cargo_dist_schema::Release::artifact_download_url`][] + /// Generate a powershell script that fetches from [`dist_schema::Release::artifact_download_url`][] Powershell, - /// Generate an npm project that fetches from [`cargo_dist_schema::Release::artifact_download_url`][] + /// Generate an npm project that fetches from [`dist_schema::Release::artifact_download_url`][] Npm, - /// Generate a Homebrew formula that fetches from [`cargo_dist_schema::Release::artifact_download_url`][] + /// Generate a Homebrew formula that fetches from [`dist_schema::Release::artifact_download_url`][] Homebrew, /// Generate an msi installer that embeds the binary Msi, diff --git a/cargo-dist/src/config/v0.rs b/cargo-dist/src/config/v0.rs index 176f031fb..4a508cacc 100644 --- a/cargo-dist/src/config/v0.rs +++ b/cargo-dist/src/config/v0.rs @@ -1,7 +1,7 @@ //! v0 config use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ +use dist_schema::{ declare_strongly_typed_string, GithubRunner, GithubRunnerConfigInput, StringLikeOr, }; use semver::Version; @@ -78,7 +78,7 @@ pub struct DistMetadata { /// only plan out the release without running builds and "skip" will disable /// pull request runs entirely. #[serde(skip_serializing_if = "Option::is_none")] - pub pr_run_mode: Option, + pub pr_run_mode: Option, /// Generate targets whose dist should avoid checking for up-to-dateness. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/cargo-dist/src/config/v1/ci/github.rs b/cargo-dist/src/config/v1/ci/github.rs index 0ed00db8e..2fe6a6fbf 100644 --- a/cargo-dist/src/config/v1/ci/github.rs +++ b/cargo-dist/src/config/v1/ci/github.rs @@ -1,6 +1,6 @@ //! github ci config -use cargo_dist_schema::{ +use dist_schema::{ ContainerConfig, GithubRunner, GithubRunnerConfig, GithubRunnerConfigInput, StringLikeOr, TripleName, }; diff --git a/cargo-dist/src/config/v1/ci/mod.rs b/cargo-dist/src/config/v1/ci/mod.rs index 3c1712b4b..6ae9d8836 100644 --- a/cargo-dist/src/config/v1/ci/mod.rs +++ b/cargo-dist/src/config/v1/ci/mod.rs @@ -130,7 +130,7 @@ pub struct CommonCiLayer { /// only plan out the release without running builds and "skip" will disable /// pull request runs entirely. #[serde(skip_serializing_if = "Option::is_none")] - pub pr_run_mode: Option, + pub pr_run_mode: Option, /// a prefix to add to the release.yml and tag pattern so that /// dist can co-exist with other release workflows in complex workspaces @@ -203,7 +203,7 @@ pub struct CommonCiConfig { pub release_branch: Option, /// Which actions to run on pull requests. - pub pr_run_mode: cargo_dist_schema::PrRunMode, + pub pr_run_mode: dist_schema::PrRunMode, /// a prefix to add to the release.yml and tag pattern so that /// dist can co-exist with other release workflows in complex workspaces @@ -237,7 +237,7 @@ impl CommonCiConfig { build_local_artifacts: true, dispatch_releases: false, release_branch: None, - pr_run_mode: cargo_dist_schema::PrRunMode::default(), + pr_run_mode: dist_schema::PrRunMode::default(), tag_namespace: None, plan_jobs: vec![], build_local_jobs: vec![], diff --git a/cargo-dist/src/errors.rs b/cargo-dist/src/errors.rs index 8ffb54b12..923b6aef0 100644 --- a/cargo-dist/src/errors.rs +++ b/cargo-dist/src/errors.rs @@ -9,9 +9,9 @@ use axoproject::errors::AxoprojectError; use backtrace::Backtrace; use camino::Utf8PathBuf; -use cargo_dist_schema::{target_lexicon::Triple, ArtifactId, TripleName}; use color_backtrace::BacktracePrinter; use console::style; +use dist_schema::{target_lexicon::Triple, ArtifactId, TripleName}; use miette::{Diagnostic, SourceOffset, SourceSpan}; use thiserror::Error; @@ -72,7 +72,7 @@ pub enum DistError { /// random triple parse error #[error(transparent)] - TripleError(#[from] cargo_dist_schema::target_lexicon::ParseError), + TripleError(#[from] dist_schema::target_lexicon::ParseError), /// A problem with a jinja template, which is always a dist bug #[error("Failed to render template")] diff --git a/cargo-dist/src/host.rs b/cargo-dist/src/host.rs index d4c4c3f1c..47ac57ffe 100644 --- a/cargo-dist/src/host.rs +++ b/cargo-dist/src/host.rs @@ -14,7 +14,7 @@ use crate::{ DistError, DistGraph, DistGraphBuilder, HostingInfo, }; use axoproject::WorkspaceGraph; -use cargo_dist_schema::{ArtifactIdRef, DistManifest, Hosting}; +use dist_schema::{ArtifactIdRef, DistManifest, Hosting}; use gazenot::{AnnouncementKey, Gazenot}; /// Do hosting @@ -190,7 +190,7 @@ impl<'a> DistGraphBuilder<'a> { self.manifest .ensure_release(name.clone(), version.clone()) .hosting - .github = Some(cargo_dist_schema::GithubHosting { + .github = Some(dist_schema::GithubHosting { artifact_base_url: hosting.domain.clone(), artifact_download_path: format!("{repo_path}/releases/download/{tag}"), owner: hosting.owner.clone(), diff --git a/cargo-dist/src/init.rs b/cargo-dist/src/init.rs index 298a5a1f7..a8d549e96 100644 --- a/cargo-dist/src/init.rs +++ b/cargo-dist/src/init.rs @@ -1,7 +1,7 @@ use axoasset::{toml_edit, LocalAsset}; use axoproject::{WorkspaceGraph, WorkspaceInfo, WorkspaceKind}; use camino::Utf8PathBuf; -use cargo_dist_schema::TripleNameRef; +use dist_schema::TripleNameRef; use semver::Version; use serde::Deserialize; diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index b82f5ee1e..9764128dc 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -27,11 +27,11 @@ use build::{ fake::{build_fake_cargo_target, build_fake_generic_target}, }; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ArtifactId, ChecksumValue, ChecksumValueRef, DistManifest, TripleName}; use config::{ ArtifactMode, ChecksumStyle, CompressionImpl, Config, DirtyMode, GenerateMode, ZipStyle, }; use console::Term; +use dist_schema::{ArtifactId, ChecksumValue, ChecksumValueRef, DistManifest, TripleName}; use semver::Version; use temp_dir::TempDir; use tracing::info; diff --git a/cargo-dist/src/linkage.rs b/cargo-dist/src/linkage.rs index 23d8214b5..6da162a25 100644 --- a/cargo-dist/src/linkage.rs +++ b/cargo-dist/src/linkage.rs @@ -8,11 +8,11 @@ use std::{ use axoasset::SourceFile; use axoprocess::Cmd; use camino::Utf8PathBuf; -use cargo_dist_schema::{ +use comfy_table::{presets::UTF8_FULL, Table}; +use dist_schema::{ AssetInfo, BuildEnvironment, DistManifest, GlibcVersion, Library, Linkage, PackageManager, TripleNameRef, }; -use comfy_table::{presets::UTF8_FULL, Table}; use goblin::Object; use mach_object::{LoadCommand, OFile}; use tracing::warn; diff --git a/cargo-dist/src/main.rs b/cargo-dist/src/main.rs index c7c088b9f..1aca900bf 100644 --- a/cargo-dist/src/main.rs +++ b/cargo-dist/src/main.rs @@ -9,14 +9,14 @@ use axoprocess::Cmd; use axoupdater::AxoUpdater; use camino::Utf8PathBuf; // Import everything from the lib version of ourselves -use cargo_dist::{linkage::LinkageDisplay, *}; -use cargo_dist_schema::{AssetKind, DistManifest}; use clap::Parser; use cli::{ Cli, Commands, GenerateMode, HelpMarkdownArgs, HostArgs, ManifestArgs, OutputFormat, PlanArgs, PrintUploadFilesFromManifestArgs, }; use console::Term; +use dist::{linkage::LinkageDisplay, *}; +use dist_schema::{AssetKind, DistManifest}; use miette::{miette, IntoDiagnostic}; use net::ClientSettings; @@ -116,7 +116,7 @@ fn print_human(out: &mut Term, manifest: &DistManifest) -> Result<(), std::io::E )?; for artifact_id in &release.artifacts { let artifact = &manifest.artifacts[artifact_id]; - if let cargo_dist_schema::ArtifactKind::Checksum = &artifact.kind { + if let dist_schema::ArtifactKind::Checksum = &artifact.kind { // Don't print shasums at top-level continue; } @@ -186,7 +186,7 @@ fn print_human(out: &mut Term, manifest: &DistManifest) -> Result<(), std::io::E fn print_human_artifact_path( out: &mut Term, - artifact: &cargo_dist_schema::Artifact, + artifact: &dist_schema::Artifact, ) -> Result<(), std::io::Error> { // Print out the name or path of the artifact (path is more useful by noisier) if let Some(path) = &artifact.path { @@ -217,7 +217,7 @@ fn print_human_linkage(out: &mut Term, report: &DistManifest) -> Result<(), std: } fn cmd_build(cli: &Cli, args: &BuildArgs) -> Result<(), miette::Report> { - let config = cargo_dist::config::Config { + let config = dist::config::Config { tag_settings: cli.tag_settings(true), create_hosting: false, artifact_mode: args.artifacts.to_lib(), @@ -242,7 +242,7 @@ fn cmd_print_upload_files_from_manifest( args: &PrintUploadFilesFromManifestArgs, ) -> Result<(), miette::Report> { let manifest_str = axoasset::LocalAsset::load_string(&args.manifest)?; - let manifest = serde_json::from_str::(&manifest_str) + let manifest = serde_json::from_str::(&manifest_str) .into_diagnostic() .map_err(|err| miette!("Failed to parse manifest as JSON: {}", err))?; @@ -254,7 +254,7 @@ fn cmd_print_upload_files_from_manifest( } fn cmd_host(cli: &Cli, args: &HostArgs) -> Result<(), miette::Report> { - let args = cargo_dist::config::HostArgs { + let args = dist::config::HostArgs { steps: args.steps.iter().map(|m| m.to_lib()).collect(), }; // host can be invoked on multiple machines, so use arg keys to disambiguate @@ -264,7 +264,7 @@ fn cmd_host(cli: &Cli, args: &HostArgs) -> Result<(), miette::Report> { .map(|s| s.to_string()) .collect::>() .join(","); - let config = cargo_dist::config::Config { + let config = dist::config::Config { tag_settings: cli.tag_settings(true), create_hosting: false, artifact_mode: config::ArtifactMode::All, @@ -276,7 +276,7 @@ fn cmd_host(cli: &Cli, args: &HostArgs) -> Result<(), miette::Report> { root_cmd: format!("host:{arg_key}"), }; - let report = cargo_dist::host::do_host(&config, args)?; + let report = dist::host::do_host(&config, args)?; print(cli, &report, false, Some("host")) } @@ -382,7 +382,7 @@ fn generate_manifest( args: &ManifestArgs, needs_coherence: bool, ) -> Result { - let config = cargo_dist::config::Config { + let config = dist::config::Config { tag_settings: cli.tag_settings(needs_coherence), create_hosting: false, artifact_mode: args.build_args.artifacts.to_lib(), @@ -404,7 +404,7 @@ fn generate_manifest( .as_ref() .and_then(|ci| ci.github.as_ref()) .and_then(|gh| gh.pr_run_mode) - == Some(cargo_dist_schema::PrRunMode::Upload)) + == Some(dist_schema::PrRunMode::Upload)) { let message = concat!( " note: Forcing needs_coherence=true, because pr-run-mode=\"upload\" is set.\n", @@ -425,10 +425,10 @@ fn cmd_migrate(_cli: &Cli, _args: &MigrateArgs) -> Result<(), miette::Report> { } fn cmd_init(cli: &Cli, args: &InitArgs) -> Result<(), miette::Report> { - let config = cargo_dist::config::Config { + let config = dist::config::Config { tag_settings: cli.tag_settings(false), create_hosting: false, - artifact_mode: cargo_dist::config::ArtifactMode::All, + artifact_mode: dist::config::ArtifactMode::All, no_local_paths: cli.no_local_paths, allow_all_dirty: cli.allow_dirty, targets: cli.target.clone(), @@ -436,7 +436,7 @@ fn cmd_init(cli: &Cli, args: &InitArgs) -> Result<(), miette::Report> { installers: cli.installer.iter().map(|ins| ins.to_lib()).collect(), root_cmd: "init".to_owned(), }; - let args = cargo_dist::InitArgs { + let args = dist::InitArgs { yes: args.yes, no_generate: args.skip_generate, with_json_config: args.with_json_config.clone(), @@ -447,10 +447,10 @@ fn cmd_init(cli: &Cli, args: &InitArgs) -> Result<(), miette::Report> { } fn cmd_generate(cli: &Cli, args: &GenerateArgs) -> Result<(), miette::Report> { - let config = cargo_dist::config::Config { + let config = dist::config::Config { tag_settings: cli.tag_settings(false), create_hosting: false, - artifact_mode: cargo_dist::config::ArtifactMode::All, + artifact_mode: dist::config::ArtifactMode::All, no_local_paths: cli.no_local_paths, allow_all_dirty: cli.allow_dirty, targets: cli.target.clone(), @@ -458,7 +458,7 @@ fn cmd_generate(cli: &Cli, args: &GenerateArgs) -> Result<(), miette::Report> { installers: cli.installer.iter().map(|ins| ins.to_lib()).collect(), root_cmd: "generate".to_owned(), }; - let args = cargo_dist::GenerateArgs { + let args = dist::GenerateArgs { check: args.check, modes: args.mode.iter().map(|m| m.to_lib()).collect(), }; @@ -467,10 +467,10 @@ fn cmd_generate(cli: &Cli, args: &GenerateArgs) -> Result<(), miette::Report> { } fn cmd_linkage(cli: &Cli, args: &LinkageArgs) -> Result<(), miette::Report> { - let config = cargo_dist::config::Config { + let config = dist::config::Config { tag_settings: cli.tag_settings(false), create_hosting: false, - artifact_mode: cargo_dist::config::ArtifactMode::All, + artifact_mode: dist::config::ArtifactMode::All, no_local_paths: cli.no_local_paths, allow_all_dirty: cli.allow_dirty, targets: cli.target.clone(), @@ -478,7 +478,7 @@ fn cmd_linkage(cli: &Cli, args: &LinkageArgs) -> Result<(), miette::Report> { installers: cli.installer.iter().map(|ins| ins.to_lib()).collect(), root_cmd: "linkage".to_owned(), }; - let mut options = cargo_dist::linkage::LinkageArgs { + let mut options = dist::linkage::LinkageArgs { print_output: args.print_output, print_json: args.print_json, from_json: args.from_json.clone(), @@ -486,7 +486,7 @@ fn cmd_linkage(cli: &Cli, args: &LinkageArgs) -> Result<(), miette::Report> { if !args.print_output && !args.print_json { options.print_output = true; } - cargo_dist::linkage::do_linkage(&config, &options)?; + dist::linkage::do_linkage(&config, &options)?; Ok(()) } @@ -661,7 +661,7 @@ fn cmd_manifest_schema( _config: &Cli, args: &cli::ManifestSchemaArgs, ) -> Result<(), miette::ErrReport> { - let schema = cargo_dist_schema::DistManifest::json_schema(); + let schema = dist_schema::DistManifest::json_schema(); let json_schema = serde_json::to_string_pretty(&schema).expect("failed to stringify schema!?"); if let Some(destination) = args.output.to_owned() { @@ -720,7 +720,7 @@ async fn cmd_update(_config: &Cli, args: &cli::UpdateArgs) -> Result<(), miette: // out immediately to avoid the user getting confused and thinking the update didn't work! if !args.skip_init { config::get_project() - .map_err(|cause| cargo_dist::errors::DistError::UpdateNotInWorkspace { cause })?; + .map_err(|cause| dist::errors::DistError::UpdateNotInWorkspace { cause })?; } if this_cargo_dist_provided_by_brew() { diff --git a/cargo-dist/src/manifest.rs b/cargo-dist/src/manifest.rs index 2e0d99fbf..3fd09b804 100644 --- a/cargo-dist/src/manifest.rs +++ b/cargo-dist/src/manifest.rs @@ -37,7 +37,7 @@ use std::collections::btree_map::Entry; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ +use dist_schema::{ Artifact, ArtifactId, Asset, AssetKind, DistManifest, DynamicLibraryAsset, ExecutableAsset, Hosting, StaticLibraryAsset, }; @@ -336,12 +336,12 @@ fn add_manifest_artifact( ArtifactKind::ExecutableZip(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::ExecutableZip; + kind = dist_schema::ArtifactKind::ExecutableZip; } ArtifactKind::Symbols(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::Symbols; + kind = dist_schema::ArtifactKind::Symbols; } ArtifactKind::Installer( InstallerImpl::Powershell(info) @@ -354,58 +354,58 @@ fn add_manifest_artifact( ) => { install_hint = Some(info.hint.clone()); description = Some(info.desc.clone()); - kind = cargo_dist_schema::ArtifactKind::Installer; + kind = dist_schema::ArtifactKind::Installer; } ArtifactKind::Installer(InstallerImpl::Msi(..)) => { install_hint = None; description = Some("install via msi".to_owned()); - kind = cargo_dist_schema::ArtifactKind::Installer; + kind = dist_schema::ArtifactKind::Installer; } ArtifactKind::Installer(InstallerImpl::Pkg(..)) => { install_hint = None; description = Some("install via pkg".to_owned()); - kind = cargo_dist_schema::ArtifactKind::Installer; + kind = dist_schema::ArtifactKind::Installer; } ArtifactKind::Checksum(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::Checksum; + kind = dist_schema::ArtifactKind::Checksum; } ArtifactKind::UnifiedChecksum(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::UnifiedChecksum; + kind = dist_schema::ArtifactKind::UnifiedChecksum; } ArtifactKind::SourceTarball(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::SourceTarball; + kind = dist_schema::ArtifactKind::SourceTarball; } ArtifactKind::ExtraArtifact(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::ExtraArtifact; + kind = dist_schema::ArtifactKind::ExtraArtifact; } ArtifactKind::Updater(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::Updater; + kind = dist_schema::ArtifactKind::Updater; } ArtifactKind::SBOM(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::SBOM; + kind = dist_schema::ArtifactKind::SBOM; } ArtifactKind::OmniborArtifactId(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::OmniborArtifactId; + kind = dist_schema::ArtifactKind::OmniborArtifactId; } }; let checksum = artifact.checksum.map(|idx| dist.artifact(idx).id.clone()); - let out_artifact = cargo_dist_schema::Artifact { + let out_artifact = dist_schema::Artifact { name: Some(artifact.id.clone()), path: if cfg.no_local_paths { None diff --git a/cargo-dist/src/platform.rs b/cargo-dist/src/platform.rs index a95e53e69..d6ff39614 100644 --- a/cargo-dist/src/platform.rs +++ b/cargo-dist/src/platform.rs @@ -232,7 +232,7 @@ pub mod targets; use std::collections::HashMap; -use cargo_dist_schema::{ +use dist_schema::{ ArtifactId, AssetId, BuildEnvironment, ChecksumExtension, ChecksumValue, DistManifest, GlibcVersion, Linkage, SystemInfo, TripleName, TripleNameRef, }; diff --git a/cargo-dist/src/platform/github_runners.rs b/cargo-dist/src/platform/github_runners.rs index 061c9bfd3..6db867856 100644 --- a/cargo-dist/src/platform/github_runners.rs +++ b/cargo-dist/src/platform/github_runners.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use crate::platform::targets as t; -use cargo_dist_schema::{target_lexicon::Triple, GithubRunnerRef, TripleNameRef}; +use dist_schema::{target_lexicon::Triple, GithubRunnerRef, TripleNameRef}; use tracing::warn; lazy_static::lazy_static! { diff --git a/cargo-dist/src/platform/targets.rs b/cargo-dist/src/platform/targets.rs index 1b9008a55..b03d42cd7 100644 --- a/cargo-dist/src/platform/targets.rs +++ b/cargo-dist/src/platform/targets.rs @@ -2,7 +2,7 @@ // Various target triples -use cargo_dist_schema::TripleNameRef; +use dist_schema::TripleNameRef; macro_rules! define_target_triples { ($($(#[$meta:meta])* const $name:ident = $triple:expr;)*) => { diff --git a/cargo-dist/src/sign/macos.rs b/cargo-dist/src/sign/macos.rs index ee267d3b9..bcbf83265 100644 --- a/cargo-dist/src/sign/macos.rs +++ b/cargo-dist/src/sign/macos.rs @@ -22,7 +22,7 @@ use axoasset::LocalAsset; use axoprocess::Cmd; use base64::Engine; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::TripleNameRef; +use dist_schema::TripleNameRef; use temp_dir::TempDir; use tracing::warn; diff --git a/cargo-dist/src/sign/mod.rs b/cargo-dist/src/sign/mod.rs index 19bfc5d2a..52c5b6147 100644 --- a/cargo-dist/src/sign/mod.rs +++ b/cargo-dist/src/sign/mod.rs @@ -5,7 +5,7 @@ use std::os::unix::fs::PermissionsExt; use axoasset::AxoClient; use camino::Utf8Path; -use cargo_dist_schema::TripleNameRef; +use dist_schema::TripleNameRef; use crate::{config::ProductionMode, DistResult}; diff --git a/cargo-dist/src/sign/ssldotcom.rs b/cargo-dist/src/sign/ssldotcom.rs index 73a878fd4..83845702f 100644 --- a/cargo-dist/src/sign/ssldotcom.rs +++ b/cargo-dist/src/sign/ssldotcom.rs @@ -4,7 +4,7 @@ use axoasset::LocalAsset; use axoprocess::Cmd; use camino::Utf8Path; use camino::Utf8PathBuf; -use cargo_dist_schema::TripleNameRef; +use dist_schema::TripleNameRef; use tracing::info; use tracing::warn; diff --git a/cargo-dist/src/tasks.rs b/cargo-dist/src/tasks.rs index 187df1c6b..fe3f19897 100644 --- a/cargo-dist/src/tasks.rs +++ b/cargo-dist/src/tasks.rs @@ -58,8 +58,8 @@ use axoasset::AxoClient; use axoprocess::Cmd; use axoproject::{PackageId, PackageIdx, WorkspaceGraph}; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::target_lexicon::{OperatingSystem, Triple}; -use cargo_dist_schema::{ +use dist_schema::target_lexicon::{OperatingSystem, Triple}; +use dist_schema::{ ArtifactId, BuildEnvironment, DistManifest, HomebrewPackageName, SystemId, SystemInfo, TripleName, TripleNameRef, }; @@ -2980,14 +2980,14 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { .github_release .as_ref() .and_then(|r| r.external_repo_commit.clone()); - cargo_dist_schema::GithubCiInfo { + dist_schema::GithubCiInfo { artifacts_matrix: Some(info.artifacts_matrix.clone()), pr_run_mode: Some(info.pr_run_mode), external_repo_commit, } }); - self.manifest.ci = Some(cargo_dist_schema::CiInfo { github }); + self.manifest.ci = Some(dist_schema::CiInfo { github }); } Ok(()) diff --git a/cargo-dist/tests/cli-tests.rs b/cargo-dist/tests/cli-tests.rs index a2c7a3f19..8f23230d3 100644 --- a/cargo-dist/tests/cli-tests.rs +++ b/cargo-dist/tests/cli-tests.rs @@ -40,7 +40,7 @@ fn test_version() { assert_eq!(stderr, ""); let (name, ver) = stdout.split_once(' ').unwrap(); - assert_eq!(name, "cargo-dist"); + assert_eq!(name, "dist"); let mut ver_parts = ver.trim().split('.'); ver_parts.next().unwrap().parse::().unwrap(); ver_parts.next().unwrap().parse::().unwrap(); @@ -123,7 +123,7 @@ fn test_lib_manifest() { .arg("--output-format=json") .arg("--verbose=error") .arg("--tag") - .arg(&format!("cargo-dist-schema-v{}", version)) + .arg(&format!("dist-schema-v{}", version)) .stdout(Stdio::piped()) .stderr(Stdio::piped()) .output() @@ -149,7 +149,7 @@ fn test_lib_manifest_slash() { .arg("--output-format=json") .arg("--verbose=error") .arg("--tag") - .arg(&format!("cargo-dist-schema/v{}", version)) + .arg(&format!("dist-schema/v{}", version)) .stdout(Stdio::piped()) .stderr(Stdio::piped()) .output() diff --git a/cargo-dist/tests/gallery/dist.rs b/cargo-dist/tests/gallery/dist.rs index c026d51aa..3d976414b 100644 --- a/cargo-dist/tests/gallery/dist.rs +++ b/cargo-dist/tests/gallery/dist.rs @@ -512,7 +512,7 @@ impl PlanResult { self.snapshot() } - pub fn parse(&self) -> Result { + pub fn parse(&self) -> Result { let src = SourceFile::new("dist-manifest.json", self.raw_json.clone()); let val = src.deserialize_json()?; Ok(val) diff --git a/cargo-dist/tests/snapshots/error_manifest.snap b/cargo-dist/tests/snapshots/error_manifest.snap index dda3fe561..e44e4ed93 100644 --- a/cargo-dist/tests/snapshots/error_manifest.snap +++ b/cargo-dist/tests/snapshots/error_manifest.snap @@ -3,7 +3,7 @@ source: cargo-dist/tests/cli-tests.rs expression: format_outputs(&output) --- stdout: -{"diagnostic": {"message": "This workspace doesn't have anything for dist to Release!","severity": "error","causes": [],"help": "You may need to pass the current version as --tag, or need to give all your packages the same version\n\nHere are some options:\n\n--tag=v1.0.0-FAKEVERSION will Announce: cargo-dist\n\nyou can also request any single package with --tag=cargo-dist-v1.0.0-FAKEVERSION\n","labels": [],"related": []}} +{"diagnostic": {"message": "This workspace doesn't have anything for dist to Release!","severity": "error","causes": [],"help": "You may need to pass the current version as --tag, or need to give all your packages the same version\n\nHere are some options:\n\n--tag=v1.0.0-FAKEVERSION will Announce: dist\n\nyou can also request any single package with --tag=dist-v1.0.0-FAKEVERSION\n","labels": [],"related": []}} stderr: @@ -12,6 +12,6 @@ stderr: Here are some options: - --tag=v1.0.0-FAKEVERSION will Announce: cargo-dist + --tag=v1.0.0-FAKEVERSION will Announce: dist - you can also request any single package with --tag=cargo-dist-v1.0.0-FAKEVERSION + you can also request any single package with --tag=dist-v1.0.0-FAKEVERSION diff --git a/cargo-dist/tests/snapshots/lib_manifest.snap b/cargo-dist/tests/snapshots/lib_manifest.snap index eb6e357ad..6fb5dae91 100644 --- a/cargo-dist/tests/snapshots/lib_manifest.snap +++ b/cargo-dist/tests/snapshots/lib_manifest.snap @@ -1,6 +1,7 @@ --- source: cargo-dist/tests/cli-tests.rs expression: format_outputs(&output) +snapshot_kind: text --- stdout: { @@ -13,29 +14,29 @@ stdout: "announcement_github_body": "CENSORED" "releases": [ { - "app_name": "cargo-dist-schema", + "app_name": "dist-schema", "app_version": "1.0.0-FAKEVERSION", "env": { - "install_dir_env_var": "CARGO_DIST_SCHEMA_INSTALL_DIR", - "unmanaged_dir_env_var": "CARGO_DIST_SCHEMA_UNMANAGED_INSTALL", - "disable_update_env_var": "CARGO_DIST_SCHEMA_DISABLE_UPDATE", - "no_modify_path_env_var": "CARGO_DIST_SCHEMA_NO_MODIFY_PATH", - "github_base_url_env_var": "CARGO_DIST_SCHEMA_INSTALLER_GITHUB_BASE_URL", - "ghe_base_url_env_var": "CARGO_DIST_SCHEMA_INSTALLER_GHE_BASE_URL" + "install_dir_env_var": "DIST_SCHEMA_INSTALL_DIR", + "unmanaged_dir_env_var": "DIST_SCHEMA_UNMANAGED_INSTALL", + "disable_update_env_var": "DIST_SCHEMA_DISABLE_UPDATE", + "no_modify_path_env_var": "DIST_SCHEMA_NO_MODIFY_PATH", + "github_base_url_env_var": "DIST_SCHEMA_INSTALLER_GITHUB_BASE_URL", + "ghe_base_url_env_var": "DIST_SCHEMA_INSTALLER_GHE_BASE_URL" }, - "display_name": "cargo-dist-schema", + "display_name": "dist-schema", "display": true, "hosting": { "github": { "artifact_base_url": "https://github.com", - "artifact_download_path": "/axodotdev/cargo-dist/releases/download/cargo-dist-schema-v1.0.0-FAKEVERSION", + "artifact_download_path": "/axodotdev/cargo-dist/releases/download/dist-schema-v1.0.0-FAKEVERSION", "owner": "axodotdev", "repo": "cargo-dist" }, "axodotdev": { - "package": "cargo-dist-schema", + "package": "dist-schema", "public_id": "fake-id-do-not-upload", - "set_download_url": "https://fake.axo.dev/faker/cargo-dist-schema/fake-id-do-not-upload", + "set_download_url": "https://fake.axo.dev/faker/dist-schema/fake-id-do-not-upload", "upload_url": null, "release_url": null, "announce_url": null diff --git a/cargo-dist/tests/snapshots/lib_manifest_slash.snap b/cargo-dist/tests/snapshots/lib_manifest_slash.snap index d64c09330..406d92c7c 100644 --- a/cargo-dist/tests/snapshots/lib_manifest_slash.snap +++ b/cargo-dist/tests/snapshots/lib_manifest_slash.snap @@ -1,6 +1,7 @@ --- source: cargo-dist/tests/cli-tests.rs expression: format_outputs(&output) +snapshot_kind: text --- stdout: { @@ -13,29 +14,29 @@ stdout: "announcement_github_body": "CENSORED" "releases": [ { - "app_name": "cargo-dist-schema", + "app_name": "dist-schema", "app_version": "1.0.0-FAKEVERSION", "env": { - "install_dir_env_var": "CARGO_DIST_SCHEMA_INSTALL_DIR", - "unmanaged_dir_env_var": "CARGO_DIST_SCHEMA_UNMANAGED_INSTALL", - "disable_update_env_var": "CARGO_DIST_SCHEMA_DISABLE_UPDATE", - "no_modify_path_env_var": "CARGO_DIST_SCHEMA_NO_MODIFY_PATH", - "github_base_url_env_var": "CARGO_DIST_SCHEMA_INSTALLER_GITHUB_BASE_URL", - "ghe_base_url_env_var": "CARGO_DIST_SCHEMA_INSTALLER_GHE_BASE_URL" + "install_dir_env_var": "DIST_SCHEMA_INSTALL_DIR", + "unmanaged_dir_env_var": "DIST_SCHEMA_UNMANAGED_INSTALL", + "disable_update_env_var": "DIST_SCHEMA_DISABLE_UPDATE", + "no_modify_path_env_var": "DIST_SCHEMA_NO_MODIFY_PATH", + "github_base_url_env_var": "DIST_SCHEMA_INSTALLER_GITHUB_BASE_URL", + "ghe_base_url_env_var": "DIST_SCHEMA_INSTALLER_GHE_BASE_URL" }, - "display_name": "cargo-dist-schema", + "display_name": "dist-schema", "display": true, "hosting": { "github": { "artifact_base_url": "https://github.com", - "artifact_download_path": "/axodotdev/cargo-dist/releases/download/cargo-dist-schema/v1.0.0-FAKEVERSION", + "artifact_download_path": "/axodotdev/cargo-dist/releases/download/dist-schema/v1.0.0-FAKEVERSION", "owner": "axodotdev", "repo": "cargo-dist" }, "axodotdev": { - "package": "cargo-dist-schema", + "package": "dist-schema", "public_id": "fake-id-do-not-upload", - "set_download_url": "https://fake.axo.dev/faker/cargo-dist-schema/fake-id-do-not-upload", + "set_download_url": "https://fake.axo.dev/faker/dist-schema/fake-id-do-not-upload", "upload_url": null, "release_url": null, "announce_url": null diff --git a/cargo-dist/tests/snapshots/manifest.snap b/cargo-dist/tests/snapshots/manifest.snap index 6563da5d8..77585bc85 100644 --- a/cargo-dist/tests/snapshots/manifest.snap +++ b/cargo-dist/tests/snapshots/manifest.snap @@ -13,41 +13,41 @@ stdout: "announcement_github_body": "CENSORED" "releases": [ { - "app_name": "cargo-dist", + "app_name": "dist", "app_version": "1.0.0-FAKEVERSION", "env": { - "install_dir_env_var": "CARGO_DIST_INSTALL_DIR", - "unmanaged_dir_env_var": "CARGO_DIST_UNMANAGED_INSTALL", - "disable_update_env_var": "CARGO_DIST_DISABLE_UPDATE", - "no_modify_path_env_var": "CARGO_DIST_NO_MODIFY_PATH", - "github_base_url_env_var": "CARGO_DIST_INSTALLER_GITHUB_BASE_URL", - "ghe_base_url_env_var": "CARGO_DIST_INSTALLER_GHE_BASE_URL" + "install_dir_env_var": "DIST_INSTALL_DIR", + "unmanaged_dir_env_var": "DIST_UNMANAGED_INSTALL", + "disable_update_env_var": "DIST_DISABLE_UPDATE", + "no_modify_path_env_var": "DIST_NO_MODIFY_PATH", + "github_base_url_env_var": "DIST_INSTALLER_GITHUB_BASE_URL", + "ghe_base_url_env_var": "DIST_INSTALLER_GHE_BASE_URL" }, - "display_name": "cargo-dist", + "display_name": "dist", "display": true, "artifacts": [ "source.tar.gz", "source.tar.gz.sha256", "dist-manifest-schema.json", - "cargo-dist-installer.sh", - "cargo-dist-installer.ps1", - "cargo-dist.rb", - "cargo-dist-npm-package.tar.gz", + "dist-installer.sh", + "dist-installer.ps1", + "dist.rb", + "dist-npm-package.tar.gz", "sha256.sum", - "cargo-dist-aarch64-apple-darwin.tar.xz", - "cargo-dist-aarch64-apple-darwin.tar.xz.sha256", - "cargo-dist-aarch64-unknown-linux-gnu.tar.xz", - "cargo-dist-aarch64-unknown-linux-gnu.tar.xz.sha256", - "cargo-dist-aarch64-unknown-linux-musl.tar.xz", - "cargo-dist-aarch64-unknown-linux-musl.tar.xz.sha256", - "cargo-dist-x86_64-apple-darwin.tar.xz", - "cargo-dist-x86_64-apple-darwin.tar.xz.sha256", - "cargo-dist-x86_64-pc-windows-msvc.zip", - "cargo-dist-x86_64-pc-windows-msvc.zip.sha256", - "cargo-dist-x86_64-unknown-linux-gnu.tar.xz", - "cargo-dist-x86_64-unknown-linux-gnu.tar.xz.sha256", - "cargo-dist-x86_64-unknown-linux-musl.tar.xz", - "cargo-dist-x86_64-unknown-linux-musl.tar.xz.sha256" + "dist-aarch64-apple-darwin.tar.xz", + "dist-aarch64-apple-darwin.tar.xz.sha256", + "dist-aarch64-unknown-linux-gnu.tar.xz", + "dist-aarch64-unknown-linux-gnu.tar.xz.sha256", + "dist-aarch64-unknown-linux-musl.tar.xz", + "dist-aarch64-unknown-linux-musl.tar.xz.sha256", + "dist-x86_64-apple-darwin.tar.xz", + "dist-x86_64-apple-darwin.tar.xz.sha256", + "dist-x86_64-pc-windows-msvc.zip", + "dist-x86_64-pc-windows-msvc.zip.sha256", + "dist-x86_64-unknown-linux-gnu.tar.xz", + "dist-x86_64-unknown-linux-gnu.tar.xz.sha256", + "dist-x86_64-unknown-linux-musl.tar.xz", + "dist-x86_64-unknown-linux-musl.tar.xz.sha256" ], "hosting": { "github": { @@ -57,9 +57,9 @@ stdout: "repo": "cargo-dist" }, "axodotdev": { - "package": "cargo-dist", + "package": "dist", "public_id": "fake-id-do-not-upload", - "set_download_url": "https://fake.axo.dev/faker/cargo-dist/fake-id-do-not-upload", + "set_download_url": "https://fake.axo.dev/faker/dist/fake-id-do-not-upload", "upload_url": null, "release_url": null, "announce_url": null @@ -68,8 +68,8 @@ stdout: } ], "artifacts": { - "cargo-dist-aarch64-apple-darwin.tar.xz": { - "name": "cargo-dist-aarch64-apple-darwin.tar.xz", + "dist-aarch64-apple-darwin.tar.xz": { + "name": "dist-aarch64-apple-darwin.tar.xz", "kind": "executable-zip", "target_triples": [ "aarch64-apple-darwin" @@ -96,23 +96,23 @@ stdout: "kind": "readme" }, { - "id": "cargo-dist-aarch64-apple-darwin-exe-dist", + "id": "dist-aarch64-apple-darwin-exe-dist", "name": "dist", "path": "dist", "kind": "executable" } ], - "checksum": "cargo-dist-aarch64-apple-darwin.tar.xz.sha256" + "checksum": "dist-aarch64-apple-darwin.tar.xz.sha256" }, - "cargo-dist-aarch64-apple-darwin.tar.xz.sha256": { - "name": "cargo-dist-aarch64-apple-darwin.tar.xz.sha256", + "dist-aarch64-apple-darwin.tar.xz.sha256": { + "name": "dist-aarch64-apple-darwin.tar.xz.sha256", "kind": "checksum", "target_triples": [ "aarch64-apple-darwin" ] }, - "cargo-dist-aarch64-unknown-linux-gnu.tar.xz": { - "name": "cargo-dist-aarch64-unknown-linux-gnu.tar.xz", + "dist-aarch64-unknown-linux-gnu.tar.xz": { + "name": "dist-aarch64-unknown-linux-gnu.tar.xz", "kind": "executable-zip", "target_triples": [ "aarch64-unknown-linux-gnu" @@ -139,23 +139,23 @@ stdout: "kind": "readme" }, { - "id": "cargo-dist-aarch64-unknown-linux-gnu-exe-dist", + "id": "dist-aarch64-unknown-linux-gnu-exe-dist", "name": "dist", "path": "dist", "kind": "executable" } ], - "checksum": "cargo-dist-aarch64-unknown-linux-gnu.tar.xz.sha256" + "checksum": "dist-aarch64-unknown-linux-gnu.tar.xz.sha256" }, - "cargo-dist-aarch64-unknown-linux-gnu.tar.xz.sha256": { - "name": "cargo-dist-aarch64-unknown-linux-gnu.tar.xz.sha256", + "dist-aarch64-unknown-linux-gnu.tar.xz.sha256": { + "name": "dist-aarch64-unknown-linux-gnu.tar.xz.sha256", "kind": "checksum", "target_triples": [ "aarch64-unknown-linux-gnu" ] }, - "cargo-dist-aarch64-unknown-linux-musl.tar.xz": { - "name": "cargo-dist-aarch64-unknown-linux-musl.tar.xz", + "dist-aarch64-unknown-linux-musl.tar.xz": { + "name": "dist-aarch64-unknown-linux-musl.tar.xz", "kind": "executable-zip", "target_triples": [ "aarch64-unknown-linux-musl" @@ -182,34 +182,34 @@ stdout: "kind": "readme" }, { - "id": "cargo-dist-aarch64-unknown-linux-musl-exe-dist", + "id": "dist-aarch64-unknown-linux-musl-exe-dist", "name": "dist", "path": "dist", "kind": "executable" } ], - "checksum": "cargo-dist-aarch64-unknown-linux-musl.tar.xz.sha256" + "checksum": "dist-aarch64-unknown-linux-musl.tar.xz.sha256" }, - "cargo-dist-aarch64-unknown-linux-musl.tar.xz.sha256": { - "name": "cargo-dist-aarch64-unknown-linux-musl.tar.xz.sha256", + "dist-aarch64-unknown-linux-musl.tar.xz.sha256": { + "name": "dist-aarch64-unknown-linux-musl.tar.xz.sha256", "kind": "checksum", "target_triples": [ "aarch64-unknown-linux-musl" ] }, - "cargo-dist-installer.ps1": { - "name": "cargo-dist-installer.ps1", + "dist-installer.ps1": { + "name": "dist-installer.ps1", "kind": "installer", "target_triples": [ "aarch64-pc-windows-msvc", "x86_64-pc-windows-gnu", "x86_64-pc-windows-msvc" ], - "install_hint": "powershell -ExecutionPolicy Bypass -c \"irm https://fake.axo.dev/faker/cargo-dist/fake-id-do-not-upload/cargo-dist-installer.ps1 | iex\"", + "install_hint": "powershell -ExecutionPolicy Bypass -c \"irm https://fake.axo.dev/faker/dist/fake-id-do-not-upload/dist-installer.ps1 | iex\"", "description": "Install prebuilt binaries via powershell script" }, - "cargo-dist-installer.sh": { - "name": "cargo-dist-installer.sh", + "dist-installer.sh": { + "name": "dist-installer.sh", "kind": "installer", "target_triples": [ "aarch64-apple-darwin", @@ -222,11 +222,15 @@ stdout: "x86_64-unknown-linux-musl-dynamic", "x86_64-unknown-linux-musl-static" ], - "install_hint": "curl --proto '=https' --tlsv1.2 -LsSf https://fake.axo.dev/faker/cargo-dist/fake-id-do-not-upload/cargo-dist-installer.sh | sh", + "install_hint": "curl --proto '=https' --tlsv1.2 -LsSf https://fake.axo.dev/faker/dist/fake-id-do-not-upload/dist-installer.sh | sh", "description": "Install prebuilt binaries via shell script" }, - "cargo-dist-npm-package.tar.gz": { - "name": "cargo-dist-npm-package.tar.gz", + "dist-manifest-schema.json": { + "name": "dist-manifest-schema.json", + "kind": "extra-artifact" + }, + "dist-npm-package.tar.gz": { + "name": "dist-npm-package.tar.gz", "kind": "installer", "target_triples": [ "aarch64-apple-darwin", @@ -301,8 +305,8 @@ stdout: "install_hint": "npm install @axodotdev/dist@1.0.0-FAKEVERSION", "description": "Install prebuilt binaries into your npm project" }, - "cargo-dist-x86_64-apple-darwin.tar.xz": { - "name": "cargo-dist-x86_64-apple-darwin.tar.xz", + "dist-x86_64-apple-darwin.tar.xz": { + "name": "dist-x86_64-apple-darwin.tar.xz", "kind": "executable-zip", "target_triples": [ "x86_64-apple-darwin" @@ -329,23 +333,23 @@ stdout: "kind": "readme" }, { - "id": "cargo-dist-x86_64-apple-darwin-exe-dist", + "id": "dist-x86_64-apple-darwin-exe-dist", "name": "dist", "path": "dist", "kind": "executable" } ], - "checksum": "cargo-dist-x86_64-apple-darwin.tar.xz.sha256" + "checksum": "dist-x86_64-apple-darwin.tar.xz.sha256" }, - "cargo-dist-x86_64-apple-darwin.tar.xz.sha256": { - "name": "cargo-dist-x86_64-apple-darwin.tar.xz.sha256", + "dist-x86_64-apple-darwin.tar.xz.sha256": { + "name": "dist-x86_64-apple-darwin.tar.xz.sha256", "kind": "checksum", "target_triples": [ "x86_64-apple-darwin" ] }, - "cargo-dist-x86_64-pc-windows-msvc.zip": { - "name": "cargo-dist-x86_64-pc-windows-msvc.zip", + "dist-x86_64-pc-windows-msvc.zip": { + "name": "dist-x86_64-pc-windows-msvc.zip", "kind": "executable-zip", "target_triples": [ "x86_64-pc-windows-msvc" @@ -372,23 +376,23 @@ stdout: "kind": "readme" }, { - "id": "cargo-dist-x86_64-pc-windows-msvc-exe-dist", + "id": "dist-x86_64-pc-windows-msvc-exe-dist", "name": "dist", "path": "dist.exe", "kind": "executable" } ], - "checksum": "cargo-dist-x86_64-pc-windows-msvc.zip.sha256" + "checksum": "dist-x86_64-pc-windows-msvc.zip.sha256" }, - "cargo-dist-x86_64-pc-windows-msvc.zip.sha256": { - "name": "cargo-dist-x86_64-pc-windows-msvc.zip.sha256", + "dist-x86_64-pc-windows-msvc.zip.sha256": { + "name": "dist-x86_64-pc-windows-msvc.zip.sha256", "kind": "checksum", "target_triples": [ "x86_64-pc-windows-msvc" ] }, - "cargo-dist-x86_64-unknown-linux-gnu.tar.xz": { - "name": "cargo-dist-x86_64-unknown-linux-gnu.tar.xz", + "dist-x86_64-unknown-linux-gnu.tar.xz": { + "name": "dist-x86_64-unknown-linux-gnu.tar.xz", "kind": "executable-zip", "target_triples": [ "x86_64-unknown-linux-gnu" @@ -415,23 +419,23 @@ stdout: "kind": "readme" }, { - "id": "cargo-dist-x86_64-unknown-linux-gnu-exe-dist", + "id": "dist-x86_64-unknown-linux-gnu-exe-dist", "name": "dist", "path": "dist", "kind": "executable" } ], - "checksum": "cargo-dist-x86_64-unknown-linux-gnu.tar.xz.sha256" + "checksum": "dist-x86_64-unknown-linux-gnu.tar.xz.sha256" }, - "cargo-dist-x86_64-unknown-linux-gnu.tar.xz.sha256": { - "name": "cargo-dist-x86_64-unknown-linux-gnu.tar.xz.sha256", + "dist-x86_64-unknown-linux-gnu.tar.xz.sha256": { + "name": "dist-x86_64-unknown-linux-gnu.tar.xz.sha256", "kind": "checksum", "target_triples": [ "x86_64-unknown-linux-gnu" ] }, - "cargo-dist-x86_64-unknown-linux-musl.tar.xz": { - "name": "cargo-dist-x86_64-unknown-linux-musl.tar.xz", + "dist-x86_64-unknown-linux-musl.tar.xz": { + "name": "dist-x86_64-unknown-linux-musl.tar.xz", "kind": "executable-zip", "target_triples": [ "x86_64-unknown-linux-musl" @@ -458,23 +462,23 @@ stdout: "kind": "readme" }, { - "id": "cargo-dist-x86_64-unknown-linux-musl-exe-dist", + "id": "dist-x86_64-unknown-linux-musl-exe-dist", "name": "dist", "path": "dist", "kind": "executable" } ], - "checksum": "cargo-dist-x86_64-unknown-linux-musl.tar.xz.sha256" + "checksum": "dist-x86_64-unknown-linux-musl.tar.xz.sha256" }, - "cargo-dist-x86_64-unknown-linux-musl.tar.xz.sha256": { - "name": "cargo-dist-x86_64-unknown-linux-musl.tar.xz.sha256", + "dist-x86_64-unknown-linux-musl.tar.xz.sha256": { + "name": "dist-x86_64-unknown-linux-musl.tar.xz.sha256", "kind": "checksum", "target_triples": [ "x86_64-unknown-linux-musl" ] }, - "cargo-dist.rb": { - "name": "cargo-dist.rb", + "dist.rb": { + "name": "dist.rb", "kind": "installer", "target_triples": [ "aarch64-apple-darwin", @@ -487,13 +491,9 @@ stdout: "x86_64-unknown-linux-musl-dynamic", "x86_64-unknown-linux-musl-static" ], - "install_hint": "brew install axodotdev/tap/cargo-dist", + "install_hint": "brew install axodotdev/tap/dist", "description": "Install prebuilt binaries via Homebrew" }, - "dist-manifest-schema.json": { - "name": "dist-manifest-schema.json", - "kind": "extra-artifact" - }, "sha256.sum": { "name": "sha256.sum", "kind": "unified-checksum"