проектные команды и ссылки на источник

- заведён internal/source: уровни ссылаются друг на друга путём на диске
  или git-репозиторием, ревизия закрепляется хвостом #ref; клон делается
  заново и удаляется, кэша нет
- добавлены init, add, pull, list, check в проекте — манифест
  .conventions.toml, сборка копий по разу на компонент, маркер локальной
  части, READING.md рядом
- проверки формы развязаны с набором: принимают lang.Vocabulary, а язык
  копии узнаётся по строке о версии — манифеста рядом с ней нет
This commit is contained in:
av
2026-07-27 20:42:18 +03:00
parent 4615de6e86
commit 23d88c4048
27 changed files with 3009 additions and 57 deletions
+17 -8
View File
@@ -1,13 +1,22 @@
package suite
import "git.vakhrushev.me/av/convy/internal/doc"
import (
"slices"
// Component is what a copy is assembled for: one language, one stack, one kind
// of application. Both axes may stay empty — a flat suite has no axes at all,
// and a component of it selects the base layer and nothing else.
"git.vakhrushev.me/av/convy/internal/doc"
)
// Component is what a copy is assembled for: one language, one set of tools,
// one kind of application. Both axes may stay empty — a flat suite has no axes
// at all, and a component of it selects the base layer and nothing else.
//
// Each axis is a list because a component may take two stack layers at once:
// sqlite and postgres in the schema topic hold together, being different tables
// of one service. Two languages never hold together, and that the axis allows
// the list anyway is a matter of one shape for both rather than a licence.
type Component struct {
Lang string
Stack string
Lang []string
Stack []string
}
// Assemble picks the layers of a topic a component takes, in the order they go
@@ -34,10 +43,10 @@ func (s *Suite) Assemble(topic string, c Component) (taken, left []*doc.Document
// fits reports whether a component takes a layer.
func fits(d *doc.Document, c Component) bool {
if d.Front.Lang != "" && d.Front.Lang != c.Lang {
if d.Front.Lang != "" && !slices.Contains(c.Lang, d.Front.Lang) {
return false
}
if d.Front.Stack != "" && d.Front.Stack != c.Stack {
if d.Front.Stack != "" && !slices.Contains(c.Stack, d.Front.Stack) {
return false
}
return true