Skip to content

Commit

Permalink
Merge pull request #389 from clayzenx/packages
Browse files Browse the repository at this point in the history
documentation && unresolved package error message
  • Loading branch information
rpiontik authored Oct 7, 2023
2 parents 4272248 + be672ea commit 0f387a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
10 changes: 5 additions & 5 deletions public/documentation/docs/manual/entities/bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@

```
$package:
id: <идентификатор_пакета>
version: <версия_пакета>
dependencies:
<зависимость_1>: "<версия_1>"
<зависимость_2>: "<версия_2>"
<идентификатор_пакета>:
version: <версия_пакета>
dependencies:
<зависимость_1>: "<версия_1>"
<зависимость_2>: "<версия_2>"
```
Здесь <идентификатор_пакета> - уникальный идентификатор пакета, <версия_пакета> - версия пакета, <зависимость> - зависимость пакета, <версия> - версия зависимости.

Expand Down
10 changes: 8 additions & 2 deletions src/global/manifest/parser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ const parser = {
case 'components':
case 'rules':
case 'datasets':
case '$package':
await this.parseEntity(node, `/${section}`, uri);
break;
case 'imports':
Expand Down Expand Up @@ -349,8 +350,13 @@ const parser = {
const awaited = Object.entries(this?.awaitedPackages);
if(awaited.length) {
awaited.forEach(([uri, pkg]) => {
const $pkg = Object.keys(pkg.$package)[0];
this.registerError(new PackageError(uri, `У пакета ${$pkg} не разрешены зависимости`), uri)
const [id, $pkg] = Object.entries(pkg.$package)[0];
const unresolved = Object.entries($pkg.dependencies).filter(([id, _]) =>
!this.packages[id]
)
.map(([id, ver]) => `${id} (${ver})`)
.join(', ');
this.registerError(new PackageError(uri, `У пакета ${id} не разрешены зависимости ${unresolved}`), uri)
})
}
},
Expand Down

0 comments on commit 0f387a8

Please sign in to comment.