Skip to content

Commit

Permalink
feat: rename cargo-dist-schema => dist-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Dec 18, 2024
1 parent 3b71f38 commit b90ec3a
Show file tree
Hide file tree
Showing 37 changed files with 98 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ 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 dist --token ${CRATES_TOKEN}
Expand Down
30 changes: 15 additions & 15 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.26.1", path = "cargo-dist-schema" }
dist-schema = { version = "=0.26.1", path = "cargo-dist-schema" }
axoproject = { version = "=0.26.1", path = "axoproject", default-features = false, features = ["cargo-projects", "generic-projects", "npm-projects"] }

# first-party deps
Expand Down
2 changes: 1 addition & 1 deletion cargo-dist-schema/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions cargo-dist/src/announce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand All @@ -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
}
_ => {
Expand Down Expand Up @@ -1022,7 +1022,7 @@ fn sortable_triple(triple: &TripleNameRef) -> Vec<String> {

#[cfg(test)]
mod tests {
use cargo_dist_schema::TripleNameRef;
use dist_schema::TripleNameRef;

use super::sortable_triple;
#[test]
Expand Down
12 changes: 6 additions & 6 deletions cargo-dist/src/backend/ci/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -66,9 +66,9 @@ pub struct GithubCiInfo {
/// Trigger releases on pushes to this branch instead of ci
pub release_branch: Option<String>,
/// 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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -679,7 +679,7 @@ 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: None,
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions cargo-dist/src/backend/ci/mod.rs
Original file line number Diff line number Diff line change
@@ -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,
};
Expand Down Expand Up @@ -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})");
Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/src/backend/installer/homebrew.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/src/backend/installer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/src/backend/installer/msi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/src/backend/installer/npm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/src/backend/installer/shell.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
6 changes: 3 additions & 3 deletions cargo-dist/src/build/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)?;

Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/src/build/fake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/src/build/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
6 changes: 3 additions & 3 deletions cargo-dist/src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! All the clap stuff for parsing/documenting the cli
use camino::Utf8PathBuf;
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)]
Expand Down
10 changes: 5 additions & 5 deletions cargo-dist/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions cargo-dist/src/config/v0.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<cargo_dist_schema::PrRunMode>,
pub pr_run_mode: Option<dist_schema::PrRunMode>,

/// Generate targets whose dist should avoid checking for up-to-dateness.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/src/config/v1/ci/github.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! github ci config
use cargo_dist_schema::{
use dist_schema::{
ContainerConfig, GithubRunner, GithubRunnerConfig, GithubRunnerConfigInput, StringLikeOr,
TripleName,
};
Expand Down
6 changes: 3 additions & 3 deletions cargo-dist/src/config/v1/ci/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<cargo_dist_schema::PrRunMode>,
pub pr_run_mode: Option<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
Expand Down Expand Up @@ -203,7 +203,7 @@ pub struct CommonCiConfig {
pub release_branch: Option<String>,

/// 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
Expand Down Expand Up @@ -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![],
Expand Down
Loading

0 comments on commit b90ec3a

Please sign in to comment.