docs(flows): DoD obligatorio con user-facing surface + abrir issues 0100-0103 (taxonomia, frontmatter migration, dev_console, work dashboard)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -82,6 +82,7 @@ type rawApp struct {
|
||||
Tags []string `yaml:"tags"`
|
||||
UsesFunctions []string `yaml:"uses_functions"`
|
||||
UsesTypes []string `yaml:"uses_types"`
|
||||
UsesModules []string `yaml:"uses_modules"`
|
||||
Framework string `yaml:"framework"`
|
||||
EntryPoint string `yaml:"entry_point"`
|
||||
DirPath string `yaml:"dir_path"`
|
||||
@@ -97,12 +98,25 @@ type rawAnalysis struct {
|
||||
Tags []string `yaml:"tags"`
|
||||
UsesFunctions []string `yaml:"uses_functions"`
|
||||
UsesTypes []string `yaml:"uses_types"`
|
||||
UsesModules []string `yaml:"uses_modules"`
|
||||
Framework string `yaml:"framework"`
|
||||
EntryPoint string `yaml:"entry_point"`
|
||||
DirPath string `yaml:"dir_path"`
|
||||
RepoURL string `yaml:"repo_url"`
|
||||
}
|
||||
|
||||
// rawModule mirrors the YAML frontmatter of a module.md file.
|
||||
type rawModule struct {
|
||||
Name string `yaml:"name"`
|
||||
Version string `yaml:"version"`
|
||||
Lang string `yaml:"lang"`
|
||||
Description string `yaml:"description"`
|
||||
Members []string `yaml:"members"`
|
||||
Tags []string `yaml:"tags"`
|
||||
DirPath string `yaml:"dir_path"`
|
||||
RepoURL string `yaml:"repo_url"`
|
||||
}
|
||||
|
||||
// rawProject mirrors the YAML frontmatter of a project .md file.
|
||||
type rawProject struct {
|
||||
Name string `yaml:"name"`
|
||||
@@ -320,6 +334,7 @@ func ParseAppMD(path string, root string) (*App, error) {
|
||||
Tags: raw.Tags,
|
||||
UsesFunctions: raw.UsesFunctions,
|
||||
UsesTypes: raw.UsesTypes,
|
||||
UsesModules: raw.UsesModules,
|
||||
Framework: raw.Framework,
|
||||
EntryPoint: raw.EntryPoint,
|
||||
Documentation: sections.documentation,
|
||||
@@ -366,6 +381,7 @@ func ParseAnalysisMD(path string, root string) (*Analysis, error) {
|
||||
Tags: raw.Tags,
|
||||
UsesFunctions: raw.UsesFunctions,
|
||||
UsesTypes: raw.UsesTypes,
|
||||
UsesModules: raw.UsesModules,
|
||||
Framework: raw.Framework,
|
||||
EntryPoint: raw.EntryPoint,
|
||||
Documentation: sections.documentation,
|
||||
@@ -377,6 +393,55 @@ func ParseAnalysisMD(path string, root string) (*Analysis, error) {
|
||||
return an, nil
|
||||
}
|
||||
|
||||
// ParseModuleMD parses a module .md file into a Module.
|
||||
func ParseModuleMD(path string, root string) (*Module, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("reading %s: %w", path, err)
|
||||
}
|
||||
|
||||
fm, body, err := extractFrontmatter(data)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("parsing %s: %w", path, err)
|
||||
}
|
||||
|
||||
var raw rawModule
|
||||
if err := yaml.Unmarshal(fm, &raw); err != nil {
|
||||
return nil, fmt.Errorf("parsing YAML in %s: %w", path, err)
|
||||
}
|
||||
|
||||
if raw.Name == "" {
|
||||
return nil, fmt.Errorf("%s: name is required", path)
|
||||
}
|
||||
if raw.Lang == "" {
|
||||
return nil, fmt.Errorf("%s: lang is required", path)
|
||||
}
|
||||
if raw.Description == "" {
|
||||
return nil, fmt.Errorf("%s: description is required", path)
|
||||
}
|
||||
if raw.Version == "" {
|
||||
raw.Version = "0.0.0"
|
||||
}
|
||||
|
||||
sections := extractSections(body)
|
||||
|
||||
m := &Module{
|
||||
ID: GenerateModuleID(raw.Name, raw.Lang),
|
||||
Name: raw.Name,
|
||||
Version: raw.Version,
|
||||
Lang: raw.Lang,
|
||||
Description: raw.Description,
|
||||
Members: raw.Members,
|
||||
Tags: raw.Tags,
|
||||
DirPath: raw.DirPath,
|
||||
RepoURL: raw.RepoURL,
|
||||
Documentation: sections.documentation,
|
||||
Notes: sections.notes,
|
||||
}
|
||||
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// ParseProjectMD parses a project .md file into a Project.
|
||||
func ParseProjectMD(path string, root string) (*Project, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
|
||||
Reference in New Issue
Block a user