add content to deps

This commit is contained in:
2026-03-24 13:40:34 +00:00
parent d2bf437f53
commit f28d7515b8
45 changed files with 832 additions and 44 deletions
@@ -16,6 +16,7 @@ include = ["../../VERSION.txt"]
[dependencies]
prometeu-deps = { path = "../prometeu-deps" }
prometeu-core = { path = "../prometeu-core" }
prometeu-languages-registry = { path = "../languages/prometeu-languages-registry" }
clap = { version = "4.5.54", features = ["derive"] }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149"
@@ -2,7 +2,7 @@ use crate::pipeline::run_phases;
use crate::{BuildMode, PipelineConfig, PipelineInput, PipelineOutput};
use anyhow::{Context, Result};
use clap::{Parser, Subcommand};
use prometeu_deps::{load_sources, resolve_project, DepsConfig};
use prometeu_deps::{load_sources, resolve_workspace, DepsConfig};
use std::path::{Path, PathBuf};
/// Command line interface for the Prometeu Compiler.
@@ -128,7 +128,7 @@ fn run_pipeline(cfg: PipelineConfig, project_dir: &Path, explain_deps: bool) ->
registry_dirs: vec![],
};
let resolved = resolve_project(&deps_cfg, project_dir)
let resolved = resolve_workspace(&deps_cfg, project_dir)
.with_context(|| format!("deps: failed to resolve project at {:?}", project_dir))?;
// resolved deve te dar pelo menos:
@@ -30,15 +30,11 @@ impl ProjectCtx {
}
}
/// Pipeline context (in-memory state).
/// Arena-friendly: uses Vec + IDs as the main storage.
#[derive(Debug)]
pub struct PipelineCtx {
pub source_db: FileDB,
pub interner: NameInterner,
pub diagnostics: Vec<Diagnostic>,
/// Projects in stack order (deps first).
pub projects: Vec<ProjectCtx>,
}
@@ -60,8 +56,8 @@ impl PipelineCtx {
pub fn init_projects_from_stack(&mut self, stack: &BuildStack) {
self.projects.clear();
self.projects.reserve(stack.projects.len());
for p in &stack.projects {
self.projects.push(ProjectCtx::new(p.project_id));
for project_id in &stack.projects {
self.projects.push(ProjectCtx::new(project_id.clone()));
}
}
@@ -3,8 +3,8 @@ pub mod config;
pub mod ctx;
pub mod pipeline;
pub mod phases;
pub use config::*;
pub use config::*;
pub use ctx::*;
pub use pipeline::*;
pub use cli::run;
@@ -13,14 +13,15 @@ pub fn run(_cfg: &PipelineConfig, input: &PipelineInput, ctx: &mut PipelineCtx)
let is_empty = ctx.projects[i].files.is_empty();
if is_empty {
let proj = &input.stack.projects[i];
let project_id = &input.stack.projects[i];
let project_name = input.graph.project(project_id).unwrap().name.clone();
ctx.push_diagnostic(Diagnostic {
severity: Severity::Warning,
code: "PIPELINE_NO_SOURCES".into(),
message: format!(
"Project '{}' has no source files loaded.",
proj.name
project_name
),
span: Span::none(),
related: vec![],
@@ -1,5 +1,5 @@
pub mod boot;
pub mod load_source;
pub mod frontend;
pub mod backend;
pub mod language;
pub mod lowering;
pub mod emit;
@@ -37,10 +37,10 @@ pub(crate) fn run_phases(cfg: PipelineConfig, input: PipelineInput) -> PipelineO
phases::load_source::run(&cfg, &input, &mut ctx);
// Frontend phase (stub / optional).
phases::frontend::run(&cfg, &input, &mut ctx);
phases::language::run(&cfg, &input, &mut ctx);
// Backend phase (stub).
phases::backend::run(&cfg, &input, &mut ctx);
phases::lowering::run(&cfg, &input, &mut ctx);
// Emit phase (stub).
let artifacts = phases::emit::run(&cfg, &input, &mut ctx);