diff --git a/sample/Cargo.toml b/sample/Cargo.toml index 6ed12d9..27e3959 100644 --- a/sample/Cargo.toml +++ b/sample/Cargo.toml @@ -33,6 +33,15 @@ Inflector = "0.11.4" block-modes = "0.8.1" # crates: disable-check jpegxl-sys = "0.8.2" tracing = "=0.1.37" +smoldot.version = "0.17.0" + +[dependencies.depsonpath] +version = "7.0.0-alpha1" +path = "../lib" + +[workspace.dependencies] +my_package.path = "../lib" +my_package2 = { path = "../" } [dependencies.clap] version = "3.0.0-beta.2" diff --git a/src/core/Item.ts b/src/core/Item.ts index 2fd531f..0f62a7b 100644 --- a/src/core/Item.ts +++ b/src/core/Item.ts @@ -3,7 +3,7 @@ */ export default class Item { key: string = ""; - values: Array = []; + values: Array = []; value: string | undefined = ""; start: number = -1; end: number = -1; diff --git a/src/toml/parser.ts b/src/toml/parser.ts index 768c7bf..b18e996 100644 --- a/src/toml/parser.ts +++ b/src/toml/parser.ts @@ -65,11 +65,12 @@ export function findCrateAndVersion( function findVersion(item: Item): Item[] { let dependencies: Item[] = []; for (const field of item.values) { - if (field.key.endsWith(".workspace")) continue; + if (field.key.endsWith(".workspace") || field.key.endsWith(".path")) continue; if (field.values.length > 0) { const dependency = findVersionTable(field); if (dependency) dependencies.push(dependency); } else if (field.value != null) { + if (field.key.endsWith(".version")) field.key = field.key.replace(".version", ""); dependencies.push(field) } } @@ -80,7 +81,7 @@ function findVersionTable(table: Item): Item | null { let item = null let itemName = null; for (const field of table.values) { - if (field.key === "workspace") return null; + if (field.key === "workspace" || field.key === "path") return null; if (field.key === "version") { item = new Item(field); item.key = table.key; @@ -226,7 +227,7 @@ function isCratesDep(i: Item): boolean { for (let value of i.values) { if (value.key === "git" || value.key === "path") { return false; - } else if (value.key === "package") { + } else if (value.key === "package" && value.value !== undefined) { i.key = value.value; } }