Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
move to src from commands
Browse files Browse the repository at this point in the history
  • Loading branch information
noise64 committed Nov 14, 2024
1 parent 96db313 commit 951fa54
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion wasm-rpc-stubgen/src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::commands::log::{log_action, log_warn_action, LogColorize};
use crate::fs::PathExtra;
use crate::log::{log_action, log_warn_action, LogColorize};
use crate::stub::StubDefinition;
use crate::wit_resolve::ResolvedWitDir;
use crate::{fs, naming};
Expand Down
2 changes: 1 addition & 1 deletion wasm-rpc-stubgen/src/commands/composition.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::commands::log::{log_warn_action, LogColorize};
use crate::fs;
use crate::fs::PathExtra;
use crate::log::{log_warn_action, LogColorize};
use anyhow::Context;
use std::collections::{BTreeMap, BTreeSet};
use std::path::{Path, PathBuf};
Expand Down
6 changes: 3 additions & 3 deletions wasm-rpc-stubgen/src/commands/declarative.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::cargo::regenerate_cargo_package_component;
use crate::commands::log::{
use crate::fs;
use crate::fs::PathExtra;
use crate::log::{
log_action, log_skipping_up_to_date, log_validated_action_result, log_warn_action, LogColorize,
LogIndent,
};
use crate::fs;
use crate::fs::PathExtra;
use crate::model::oam;
use crate::model::wasm_rpc::{
include_glob_patter_from_yaml_file, init_oam_app, Application, ComponentName,
Expand Down
2 changes: 1 addition & 1 deletion wasm-rpc-stubgen/src/commands/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// limitations under the License.

use crate::cargo::generate_cargo_toml;
use crate::commands::log::{log_action, LogColorize, LogIndent};
use crate::compilation::compile;
use crate::fs;
use crate::log::{log_action, LogColorize, LogIndent};
use crate::naming;
use crate::rust::generate_stub_source;
use crate::stub::StubDefinition;
Expand Down
3 changes: 0 additions & 3 deletions wasm-rpc-stubgen/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,3 @@ pub mod composition;

/// Declarative subcommands
pub mod declarative;

/// Logging
pub mod log;
1 change: 1 addition & 0 deletions wasm-rpc-stubgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub mod cargo;
pub mod commands;
pub mod compilation;
pub mod fs;
pub mod log;
pub mod make;
pub mod model;
pub mod naming;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::validation::ValidatedResult;
use colored::{ColoredString, Colorize};
use std::path::{Path, PathBuf};
use std::sync::{LazyLock, RwLock};
// TODO: move package under lib

static LOG_STATE: LazyLock<RwLock<LogState>> = LazyLock::new(RwLock::default);

Expand Down
2 changes: 1 addition & 1 deletion wasm-rpc-stubgen/src/make.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::commands::log::{log_action, log_warn_action, LogColorize};
use crate::log::{log_action, log_warn_action, LogColorize};
use crate::{cargo, fs, GenerateArgs, WasmRpcOverride};
use heck::ToSnakeCase;
use std::path::Path;
Expand Down
2 changes: 1 addition & 1 deletion wasm-rpc-stubgen/src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::commands::log::{log_action, LogColorize};
use crate::fs;
use crate::fs::PathExtra;
use crate::log::{log_action, LogColorize};
use crate::stub::{FunctionResultStub, FunctionStub, InterfaceStub, StubDefinition};
use anyhow::anyhow;
use heck::{ToShoutySnakeCase, ToSnakeCase, ToUpperCamelCase};
Expand Down
2 changes: 1 addition & 1 deletion wasm-rpc-stubgen/src/wit_generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::commands::log::{log_action, log_action_plan, log_warn_action, LogColorize, LogIndent};
use crate::fs::{OverwriteSafeAction, OverwriteSafeActions, PathExtra};
use crate::log::{log_action, log_action_plan, log_warn_action, LogColorize, LogIndent};
use crate::naming::wit::package_dep_dir_name_from_encoder;
use crate::stub::{
FunctionParamStub, FunctionResultStub, FunctionStub, InterfaceStub, InterfaceStubTypeDef,
Expand Down
2 changes: 1 addition & 1 deletion wasm-rpc-stubgen/src/wit_resolve.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::commands::log::{log_action, LogColorize, LogIndent};
use crate::log::{log_action, LogColorize, LogIndent};
use crate::model::wasm_rpc::{Application, ComponentName};
use crate::naming;
use crate::validation::{ValidatedResult, ValidationBuilder};
Expand Down

0 comments on commit 951fa54

Please sign in to comment.