Skip to content

Commit

Permalink
new: Rename project to moon. (#9)
Browse files Browse the repository at this point in the history
* Rename monolith to moon.

* Rename folders.
  • Loading branch information
milesj authored Dec 29, 2021
1 parent ae5ff1a commit e311903
Show file tree
Hide file tree
Showing 59 changed files with 181 additions and 183 deletions.
File renamed without changes.
File renamed without changes.
36 changes: 18 additions & 18 deletions Cargo.lock

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

11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Monolith
# Moon

Monolith is a Rust program for managing JavaScript based monorepo's.
> Currently a work in progress!
> Inspired heavily from Bazel.
Moon is a *m*onorepo *o*rganization, *o*rchestration, and *n*otification tool for JavaScript based
projects, written in Rust. Many of the concepts within Moon are heavily inspired from Bazel.

- [Documentation](./docs/README.md)

<!--
#### Tokens
- File groups
Expand All @@ -21,3 +25,4 @@ Monolith is a Rust program for managing JavaScript based monorepo's.
- Other
- `@cache` - Returns an absolute file path to a location within the cache folder.
- `@pid` - Returns the running project's ID as a fully-qualified ID from the workspace root.
-->
10 changes: 5 additions & 5 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "monolith_cli"
name = "moon_cli"
version = "0.1.0"
edition = "2021"

[dependencies]
monolith_logger = { path = "../logger" }
monolith_project = { path = "../project" }
monolith_toolchain = { path = "../toolchain" }
monolith_workspace = { path = "../workspace" }
moon_logger = { path = "../logger" }
moon_project = { path = "../project" }
moon_toolchain = { path = "../toolchain" }
moon_workspace = { path = "../workspace" }
clap = { version = "3.0.0-beta.1", features = ["derive"] }
dot-writer = "0.1"
itertools = "0.10"
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub enum Commands {
#[derive(Debug, Parser)]
#[clap(
bin_name = "mono",
name = "Monolith",
name = "Moon",
about = "Take your monorepo to the moon!",
version
)]
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/commands/bin.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::helpers::safe_exit;
use clap::ArgEnum;
use monolith_toolchain::Tool;
use monolith_workspace::Workspace;
use moon_toolchain::Tool;
use moon_workspace::Workspace;

#[derive(ArgEnum, Clone, Debug)]
pub enum BinTools {
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/project.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::helpers::{print_list, safe_exit};
use itertools::Itertools;
use monolith_workspace::Workspace;
use moon_workspace::Workspace;

enum ProjectExitCodes {
UnknownProject = 1,
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/commands/project_graph.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use dot_writer::{ArrowType, Attributes, Color, DotWriter, Scope, Shape, Style};
use monolith_project::{ProjectError, ROOT_NODE_ID};
use monolith_workspace::Workspace;
use moon_project::{ProjectError, ROOT_NODE_ID};
use moon_workspace::Workspace;

fn create_edge(dot_graph: &mut Scope, from: &str, to: &str) {
let mut attr = dot_graph.edge(from, to).attributes();
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/setup.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use monolith_workspace::Workspace;
use moon_workspace::Workspace;

pub async fn setup(workspace: Workspace) -> Result<(), clap::Error> {
workspace.toolchain.setup().await.unwrap(); // TODO error
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/teardown.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use monolith_workspace::Workspace;
use moon_workspace::Workspace;

pub async fn teardown(workspace: Workspace) -> Result<(), clap::Error> {
workspace.toolchain.teardown().await.unwrap(); // TODO error
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use commands::project_graph::project_graph;
use commands::setup::setup;
use commands::teardown::teardown;
use log::LevelFilter;
use monolith_logger::Logger;
use monolith_workspace::Workspace;
use moon_logger::Logger;
use moon_workspace::Workspace;

// This is annoying, but clap requires applying the `ArgEnum`
// trait onto the enum, which we can't apply to the log package.
Expand Down
2 changes: 1 addition & 1 deletion crates/config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "monolith_config"
name = "moon_config"
version = "0.1.0"
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion crates/config/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub const CONFIG_DIRNAME: &str = ".monolith";
pub const CONFIG_DIRNAME: &str = ".moon";

pub const CONFIG_WORKSPACE_FILENAME: &str = "workspace.yml";

Expand Down
2 changes: 1 addition & 1 deletion crates/config/src/global_project.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// .monolith/project.yml
// .moon/project.yml

use crate::constants;
use crate::errors::{create_validation_error, map_figment_error_to_validation_errors};
Expand Down
2 changes: 1 addition & 1 deletion crates/config/src/workspace.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// .monolith/workspace.yml
// .moon/workspace.yml

use crate::constants;
use crate::errors::map_figment_error_to_validation_errors;
Expand Down
4 changes: 2 additions & 2 deletions crates/config/templates/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ project:
dependsOn: []

# OPTIONAL: File groups are a mechanism for grouping similar types of files within
# a project using file glob patterns. View `.monolith/project.yml` for more info.
# a project using file glob patterns. View `.moon/project.yml` for more info.
fileGroups: {}

# OPTIONAL: A task is an action that is ran within the context of a project, and
# wraps around an npm or shell command. View `.monolith/project.yml` for more info.
# wraps around an npm or shell command. View `.moon/project.yml` for more info.
tasks: {}
2 changes: 1 addition & 1 deletion crates/config/templates/workspace.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Configures Node.js within the toolchain. Monolith manages its own version of Node.js
# Configures Node.js within the toolchain. Moon manages its own version of Node.js
# instead of relying on a version found on the host machine. This ensures deterministic
# and reproducible builds across any machine.
node:
Expand Down
2 changes: 1 addition & 1 deletion crates/logger/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "monolith_logger"
name = "moon_logger"
version = "0.1.0"
edition = "2021"

Expand Down
6 changes: 3 additions & 3 deletions crates/project/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "monolith_project"
name = "moon_project"
version = "0.1.0"
edition = "2021"

[dependencies]
monolith_config = { path = "../config" }
monolith_logger = { path = "../logger" }
moon_config = { path = "../config" }
moon_logger = { path = "../logger" }
dep-graph = "0.2"
itertools = "0.10"
serde = { version = "1.0", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions crates/project/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use monolith_config::{constants, ValidationErrors};
use moon_config::{constants, ValidationErrors};
use thiserror::Error;

#[derive(Error, Debug)]
Expand All @@ -24,6 +24,6 @@ pub enum ProjectError {
#[error("Task `{0}` has not been configured for project `{1}`.")]
UnconfiguredTask(String, String),

#[error("Unknown monolith project error.")]
#[error("Unknown moon project error.")]
Unknown,
}
4 changes: 2 additions & 2 deletions crates/project/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ pub use constants::ROOT_NODE_ID;
pub use errors::ProjectError;

// Projects
pub use monolith_config::{FileGroups, ProjectID, ProjectType};
pub use moon_config::{FileGroups, ProjectID, ProjectType};
pub use project::{Project, ProjectsMap};
pub use project_graph::ProjectGraph;

// Tasks
pub use monolith_config::{TargetID, TaskType};
pub use moon_config::{TargetID, TaskType};
pub use target::Target;
pub use task::{Task, TaskOptions};
pub use task_graph::TaskGraph;
6 changes: 3 additions & 3 deletions crates/project/src/project.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::errors::ProjectError;
use crate::task::Task;
use monolith_config::constants::CONFIG_PROJECT_FILENAME;
use monolith_config::{
use moon_config::constants::CONFIG_PROJECT_FILENAME;
use moon_config::{
FileGroups, FilePath, GlobalProjectConfig, PackageJson, PackageJsonValue, ProjectConfig,
ProjectID,
};
use monolith_logger::{color, debug, trace};
use moon_logger::{color, debug, trace};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::path::{Path, PathBuf};
Expand Down
8 changes: 4 additions & 4 deletions crates/project/src/project_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ use crate::errors::ProjectError;
use crate::project::Project;
use dep_graph::{DepGraph, Node};
use itertools::Itertools;
use monolith_config::{GlobalProjectConfig, ProjectID};
use monolith_logger::{color, debug, trace};
use moon_config::{GlobalProjectConfig, ProjectID};
use moon_logger::{color, debug, trace};
use std::cell::{RefCell, RefMut};
use std::collections::HashMap;
use std::path::{Path, PathBuf};

pub struct ProjectGraph {
/// The global project configuration that all projects inherit from.
/// Is loaded from `.monolith/project.yml`.
/// Is loaded from `.moon/project.yml`.
global_config: GlobalProjectConfig,

/// A lightweight dependency graph, where each node is a project ID,
Expand All @@ -22,7 +22,7 @@ pub struct ProjectGraph {
projects: RefCell<HashMap<ProjectID, Project>>,

/// The mapping of projects by ID to a relative file system location.
/// Is the `projects` setting in `.monolith/workspace.yml`.
/// Is the `projects` setting in `.moon/workspace.yml`.
projects_config: HashMap<ProjectID, String>,

/// The workspace root, in which projects are relatively loaded from.
Expand Down
2 changes: 1 addition & 1 deletion crates/project/src/target.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use monolith_config::{ProjectID, TargetID, TaskID};
use moon_config::{ProjectID, TargetID, TaskID};

pub struct Target {}

Expand Down
4 changes: 2 additions & 2 deletions crates/project/src/task.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use monolith_config::{
use moon_config::{
FilePathOrGlob, TargetID, TaskConfig, TaskMergeStrategy, TaskOptionsConfig, TaskType,
};
use monolith_logger::{color, debug};
use moon_logger::{color, debug};
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
Expand Down
2 changes: 1 addition & 1 deletion crates/project/src/task_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::project_graph::ProjectGraph;
use crate::target::Target;
use crate::task::Task;
use dep_graph::{DepGraph, Node};
use monolith_config::TargetID;
use moon_config::TargetID;
use std::collections::HashMap;

#[derive(Default)]
Expand Down
6 changes: 3 additions & 3 deletions crates/project/tests/project_test.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use monolith_config::project::ProjectMetadataConfig;
use monolith_config::{
use moon_config::project::ProjectMetadataConfig;
use moon_config::{
FileGroups, GlobalProjectConfig, PackageJson, ProjectConfig, ProjectType, TaskConfig,
TaskMergeStrategy, TaskOptionsConfig, TaskType,
};
use monolith_project::{Project, Task};
use moon_project::{Project, Task};
use std::collections::HashMap;
use std::env;
use std::path::PathBuf;
Expand Down
6 changes: 3 additions & 3 deletions crates/toolchain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "monolith_toolchain"
name = "moon_toolchain"
version = "0.1.0"
edition = "2021"

[dependencies]
monolith_config = { path = "../config" }
monolith_logger = { path = "../logger" }
moon_config = { path = "../config" }
moon_logger = { path = "../logger" }
async-trait = "0.1"
dirs = "4.0"
flate2 = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/toolchain/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use thiserror::Error;

#[derive(Error, Debug)]
pub enum ToolchainError {
#[error("Unknown monolith toolchain error.")]
#[error("Unknown moon toolchain error.")]
Unknown,

// TODO
Expand Down
Loading

0 comments on commit e311903

Please sign in to comment.