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

internal: Update colors/utils usage. #1057

Merged
merged 3 commits into from
Sep 19, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
const response = await github.request(context.payload.issue.pull_request.url);
return response.data.head.sha;
- name: Checkout PR branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: false
ref: ${{ steps.sha.outputs.result }}
Expand All @@ -42,7 +42,7 @@ jobs:

# Run on base branch to get a baseline
- name: Checkout base branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
clean: false
ref: ${{ github.event.pull_request.base.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
os: [ubuntu-latest, windows-latest]
node-version: [16, 18, 20]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: Version check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
Expand All @@ -24,7 +24,7 @@ jobs:
name: CLI binary check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: bash ./scripts/checks/cliBinary.sh
shell: bash
installer:
Expand All @@ -35,7 +35,7 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Unix
- run: bash ./website/static/install/moon.sh
if: ${{ runner.os != 'Windows' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
env:
NPM_CHANNEL: latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: yarn
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
name: Stable - ${{ matrix.target }}
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
if: ${{ !matrix.docker-target }}
with:
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
name: Test - ${{ matrix.target }}
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: yarn
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
env:
NPM_CHANNEL: latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: yarn
Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
env:
NPM_CHANNEL: latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: yarn
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
components: rustfmt
Expand All @@ -38,7 +38,7 @@ jobs:
os: [ubuntu-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
bins: cargo-make
Expand All @@ -53,7 +53,7 @@ jobs:
os: [buildjet-4vcpu-ubuntu-2204, self-hosted-laptop-macos-m1, self-hosted-laptop-windows-i7]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
bins: cargo-make, cargo-nextest, cargo-llvm-cov
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
needs:
- test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
name: Download coverage reports
with:
Expand Down
33 changes: 29 additions & 4 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 @@ -63,7 +63,7 @@ starbase_archive = { version = "0.2.2", default-features = false, features = [
starbase_events = { version = "0.2.1" }
starbase_sandbox = "0.1.10"
starbase_styles = { version = "0.1.15", features = ["relative-path"] }
starbase_utils = { version = "0.3.1", default-features = false, features = [
starbase_utils = { version = "0.3.2", default-features = false, features = [
"editor-config",
"glob",
"json",
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fn gather_runnable_targets(
} else {
debug!(
"Not running target {} because it either has no `outputs` or `runInCI` is false",
color::label(&task.target.id),
color::label(&task.target),
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/cli/src/commands/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub async fn hash(args: ArgsRef<QueryHashArgs>, workspace: ResourceRef<Workspace
let result = query_hash(workspace, &args.hash).await?;

if !args.json {
println!("Hash: {}\n", color::id(result.0));
println!("Hash: {}\n", color::hash(result.0));
}

println!("{}", result.1);
Expand Down Expand Up @@ -68,8 +68,8 @@ pub async fn hash_diff(args: ArgsRef<QueryHashDiffArgs>, workspace: ResourceMut<

term.line(serde_json::to_string_pretty(&result).into_diagnostic()?)?;
} else {
term.line(format!("Left: {}", color::id(&result.left_hash)))?;
term.line(format!("Right: {}\n", color::id(&result.right_hash)))?;
term.line(format!("Left: {}", color::hash(&result.left_hash)))?;
term.line(format!("Right: {}\n", color::hash(&result.right_hash)))?;

for diff in diff::lines(&result.left, &result.right) {
match diff {
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/syncs/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub async fn sync(args: ArgsRef<SyncHooksArgs>, workspace: ResourceRef<Workspace
if workspace.config.vcs.hooks.is_empty() {
println!(
"No hooks available to sync. Configure them with the {} setting.",
color::id("vcs.hooks")
color::property("vcs.hooks")
);
println!(
"Learn more: {}",
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn detect_running_version() {
let version = env!("CARGO_PKG_VERSION");

if let Ok(exe_with) = env::var("MOON_EXECUTED_WITH") {
debug!("Running moon v{} (with {})", version, color::file(exe_with),);
debug!("Running moon v{} (with {})", version, color::file(exe_with));
} else {
debug!("Running moon v{}", version);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub async fn check_for_new_version(workspace: ResourceRef<Workspace>) {
println!(
"{} There's a new version of moon available, {} (currently on {})!",
prefix,
color::success(latest.current_version),
color::hash(latest.current_version),
current_version,
);

Expand Down
4 changes: 2 additions & 2 deletions crates/core/action-pipeline/src/actions/sync_workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub async fn sync_workspace(
debug!(
target: LOG_TARGET,
"Syncing code owners ({} enabled)",
color::id("codeowners.syncOnRun"),
color::property("codeowners.syncOnRun"),
);

sync_codeowners(&workspace, &project_graph, false).await?;
Expand All @@ -43,7 +43,7 @@ pub async fn sync_workspace(
target: LOG_TARGET,
"Syncing {} hooks ({} enabled)",
workspace.config.vcs.manager,
color::id("vcs.syncHooks"),
color::property("vcs.syncHooks"),
);

sync_vcs_hooks(&workspace, false).await?;
Expand Down
4 changes: 2 additions & 2 deletions crates/core/dep-graph/src/dep_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl<'ws> DepGraphBuilder<'ws> {
trace!(
target: LOG_TARGET,
"Adding dependents to run for target {}",
color::label(&target.id),
color::label(target),
);

if let TargetScope::Project(project_id) = &target.scope {
Expand Down Expand Up @@ -313,7 +313,7 @@ impl<'ws> DepGraphBuilder<'ws> {
trace!(
target: LOG_TARGET,
"Target {} not affected based on touched files, skipping",
color::label(&target.id),
color::label(target),
);

return Ok(None);
Expand Down
2 changes: 1 addition & 1 deletion crates/rust/platform/src/rust_platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl Platform for RustPlatform {
target: LOG_TARGET,
"Syncing {} configuration file with version {}",
color::file(RUSTUP.version_file),
color::symbol(&version),
color::hash(&version),
);

cfg.toolchain.channel = Some(version);
Expand Down
2 changes: 1 addition & 1 deletion nextgen/project-expander/src/tasks_expander.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl<'graph, 'query> TasksExpander<'graph, 'query> {
target = task.target.as_str(),
env_file = ?env_path,
"Setting {} is enabled but file doesn't exist, skipping as this may be intentional",
color::symbol("options.envFile"),
color::property("options.envFile"),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion website/blog/2023-02-27_v0.25.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
name: 'CI'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: moonrepo/setup-moon-action@v1
Expand Down
2 changes: 1 addition & 1 deletion website/blog/2023-05-23_proto-v0.9.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
name: 'CI'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/checkout@v4'
- uses: 'moonrepo/setup-proto@v0'
- run: 'proto use'
```
Expand Down
2 changes: 1 addition & 1 deletion website/docs/guides/ci.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
name: 'CI'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- uses: 'actions/setup-node@v3'
Expand Down
2 changes: 1 addition & 1 deletion website/docs/guides/open-source.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
node-version: [14, 16, 18]
steps:
# Checkout repository
- uses: 'actions/checkout@v3'
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
# Install Node.js so we can install dependencies
Expand Down
2 changes: 1 addition & 1 deletion website/docs/proto/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
name: 'CI'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/checkout@v4'
- uses: 'moonrepo/setup-proto@v1'
- run: 'proto use'
```