Skip to content
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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,10 @@ bin/
build/
dist/
site/
mock_heavy_project/
mock_project/
mock_project_fast/
run_bench.sh
run_heavy_bench.sh
mock_many_imports/
run_many_imports.sh
9 changes: 7 additions & 2 deletions cli/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ impl ProjectBuildGraph {

// 2. Resolve imports recursively
let mut visited = HashSet::new();
let mut manifest_cache: HashMap<PathBuf, String> = HashMap::new();
while let Some((fid, path, pkg_name)) = to_resolve.pop() {
if visited.contains(&fid) {
continue;
Expand Down Expand Up @@ -256,14 +257,18 @@ impl ProjectBuildGraph {
}
if !try_file.exists() {
let manifest_toml = pkg_path.join("tech.toml");
if manifest_toml.exists() {
if let Some(cached_entry) = manifest_cache.get(&manifest_toml) {
try_file = pkg_path.join(cached_entry);
} else if manifest_toml.exists() {
if let Ok(toml_content) = std::fs::read_to_string(&manifest_toml) {
if let Ok(manifest) =
toml::from_str::<techscript_package_manager::Manifest>(
&toml_content,
)
{
try_file = pkg_path.join(manifest.package.entry);
let entry = manifest.package.entry;
try_file = pkg_path.join(&entry);
manifest_cache.insert(manifest_toml, entry);
}
}
}
Expand Down
Loading