@driftsys/markspec 0.10.3 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/esm/ast/normalize.d.ts +4 -5
- package/esm/ast/normalize.d.ts.map +1 -1
- package/esm/ast/normalize.js +6 -37
- package/esm/collect/mod.d.ts +29 -9
- package/esm/collect/mod.d.ts.map +1 -1
- package/esm/collect/mod.js +36 -10
- package/esm/compiler/deserialize.d.ts +49 -0
- package/esm/compiler/deserialize.d.ts.map +1 -0
- package/esm/compiler/deserialize.js +139 -0
- package/esm/compiler/manifest.d.ts +3 -0
- package/esm/compiler/manifest.d.ts.map +1 -1
- package/esm/compiler/manifest.js +9 -3
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +18 -13
- package/esm/config/markspec.d.ts +40 -1
- package/esm/config/markspec.d.ts.map +1 -1
- package/esm/config/markspec.js +127 -2
- package/esm/config/mod.d.ts.map +1 -1
- package/esm/config/mod.js +143 -147
- package/esm/decl/duplicates.d.ts +29 -0
- package/esm/decl/duplicates.d.ts.map +1 -0
- package/esm/decl/duplicates.js +28 -0
- package/esm/decl/mod.d.ts +4 -2
- package/esm/decl/mod.d.ts.map +1 -1
- package/esm/decl/mod.js +2 -1
- package/esm/decl/surfaces.d.ts +29 -7
- package/esm/decl/surfaces.d.ts.map +1 -1
- package/esm/decl/surfaces.js +31 -18
- package/esm/discovery/mod.d.ts +24 -8
- package/esm/discovery/mod.d.ts.map +1 -1
- package/esm/discovery/mod.js +57 -21
- package/esm/discovery/projects.d.ts +109 -0
- package/esm/discovery/projects.d.ts.map +1 -0
- package/esm/discovery/projects.js +232 -0
- package/esm/formatter/entry_body.d.ts +86 -0
- package/esm/formatter/entry_body.d.ts.map +1 -0
- package/esm/formatter/entry_body.js +287 -0
- package/esm/formatter/mod.d.ts +13 -9
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +126 -50
- package/esm/gates/mod.d.ts +13 -2
- package/esm/gates/mod.d.ts.map +1 -1
- package/esm/gates/mod.js +41 -13
- package/esm/lint/runner.d.ts.map +1 -1
- package/esm/lint/runner.js +7 -5
- package/esm/lock/acquire_compile.d.ts +31 -0
- package/esm/lock/acquire_compile.d.ts.map +1 -0
- package/esm/lock/acquire_compile.js +83 -0
- package/esm/lock/cache_check.d.ts +28 -0
- package/esm/lock/cache_check.d.ts.map +1 -0
- package/esm/lock/cache_check.js +51 -0
- package/esm/lock/check.d.ts +14 -3
- package/esm/lock/check.d.ts.map +1 -1
- package/esm/lock/check.js +43 -4
- package/esm/lock/edge_drift.d.ts +2 -0
- package/esm/lock/edge_drift.d.ts.map +1 -1
- package/esm/lock/edge_drift.js +4 -0
- package/esm/lock/git_intent.d.ts +46 -0
- package/esm/lock/git_intent.d.ts.map +1 -0
- package/esm/lock/git_intent.js +111 -0
- package/esm/lock/mod.d.ts +11 -4
- package/esm/lock/mod.d.ts.map +1 -1
- package/esm/lock/mod.js +8 -2
- package/esm/lock/model.d.ts +24 -1
- package/esm/lock/model.d.ts.map +1 -1
- package/esm/lock/parser.d.ts.map +1 -1
- package/esm/lock/parser.js +32 -0
- package/esm/lock/pin_assurance.d.ts +20 -0
- package/esm/lock/pin_assurance.d.ts.map +1 -0
- package/esm/lock/pin_assurance.js +34 -0
- package/esm/lock/resolve.d.ts +8 -17
- package/esm/lock/resolve.d.ts.map +1 -1
- package/esm/lock/resolve.js +7 -67
- package/esm/lock/serializer.d.ts.map +1 -1
- package/esm/lock/serializer.js +23 -0
- package/esm/lock/upstream_common.d.ts +29 -0
- package/esm/lock/upstream_common.d.ts.map +1 -0
- package/esm/lock/upstream_common.js +38 -0
- package/esm/lock/upstream_deps.d.ts +63 -0
- package/esm/lock/upstream_deps.d.ts.map +1 -0
- package/esm/lock/upstream_deps.js +172 -0
- package/esm/lock/upstream_refs.d.ts +69 -0
- package/esm/lock/upstream_refs.d.ts.map +1 -0
- package/esm/lock/upstream_refs.js +238 -0
- package/esm/mod.d.ts +23 -11
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +20 -8
- package/esm/model/mod.d.ts +114 -28
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +76 -13
- package/esm/model/profile.d.ts +13 -0
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/parser/code_regions.d.ts +29 -0
- package/esm/parser/code_regions.d.ts.map +1 -0
- package/esm/parser/code_regions.js +38 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +110 -91
- package/esm/parser/mod.d.ts.map +1 -1
- package/esm/parser/mod.js +7 -1
- package/esm/parser/translate.d.ts.map +1 -1
- package/esm/parser/translate.js +5 -0
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +20 -3
- package/esm/profile/merge.js +7 -0
- package/esm/refs/mod.d.ts.map +1 -1
- package/esm/refs/mod.js +8 -19
- package/esm/reporter/mod.d.ts +11 -0
- package/esm/reporter/mod.d.ts.map +1 -1
- package/esm/reporter/mod.js +20 -9
- package/esm/typl/assemble.d.ts +53 -0
- package/esm/typl/assemble.d.ts.map +1 -0
- package/esm/typl/assemble.js +238 -0
- package/esm/typl/ast.d.ts +7 -1
- package/esm/typl/ast.d.ts.map +1 -1
- package/esm/typl/ast.js +3 -0
- package/esm/typl/bullet.d.ts +9 -7
- package/esm/typl/bullet.d.ts.map +1 -1
- package/esm/typl/bullet.js +6 -4
- package/esm/typl/citations.d.ts +27 -0
- package/esm/typl/citations.d.ts.map +1 -0
- package/esm/typl/citations.js +16 -0
- package/esm/typl/diagnostics.d.ts +2 -2
- package/esm/typl/diagnostics.d.ts.map +1 -1
- package/esm/typl/diagnostics.js +18 -0
- package/esm/typl/grammar.d.ts.map +1 -1
- package/esm/typl/grammar.js +6 -0
- package/esm/typl/lexer.d.ts.map +1 -1
- package/esm/typl/lexer.js +25 -4
- package/esm/typl/mod.d.ts +8 -2
- package/esm/typl/mod.d.ts.map +1 -1
- package/esm/typl/mod.js +5 -1
- package/esm/typl/recognize.js +2 -2
- package/esm/typl/registry.d.ts +1 -1
- package/esm/typl/resolve.d.ts +31 -0
- package/esm/typl/resolve.d.ts.map +1 -0
- package/esm/typl/resolve.js +27 -0
- package/esm/typl/table.d.ts +52 -0
- package/esm/typl/table.d.ts.map +1 -0
- package/esm/typl/table.js +69 -0
- package/esm/typl/validator.d.ts +24 -5
- package/esm/typl/validator.d.ts.map +1 -1
- package/esm/typl/validator.js +55 -75
- package/esm/upstream/mod.d.ts +45 -0
- package/esm/upstream/mod.d.ts.map +1 -0
- package/esm/upstream/mod.js +98 -0
- package/esm/upstream/project.d.ts +33 -0
- package/esm/upstream/project.d.ts.map +1 -0
- package/esm/upstream/project.js +38 -0
- package/esm/upstream/refs.d.ts +23 -0
- package/esm/upstream/refs.d.ts.map +1 -0
- package/esm/upstream/refs.js +71 -0
- package/esm/util/fence.d.ts +20 -29
- package/esm/util/fence.d.ts.map +1 -1
- package/esm/util/fence.js +42 -50
- package/esm/util/modals.d.ts +6 -0
- package/esm/util/modals.d.ts.map +1 -1
- package/esm/util/modals.js +37 -0
- package/esm/util/paths.d.ts +14 -0
- package/esm/util/paths.d.ts.map +1 -0
- package/esm/util/paths.js +22 -0
- package/esm/uxil/assemble.d.ts +38 -0
- package/esm/uxil/assemble.d.ts.map +1 -0
- package/esm/uxil/assemble.js +268 -0
- package/esm/uxil/ast.d.ts +63 -0
- package/esm/uxil/ast.d.ts.map +1 -0
- package/esm/uxil/ast.js +9 -0
- package/esm/uxil/citations.d.ts +27 -0
- package/esm/uxil/citations.d.ts.map +1 -0
- package/esm/uxil/citations.js +25 -0
- package/esm/uxil/diagnostics.d.ts +39 -0
- package/esm/uxil/diagnostics.d.ts.map +1 -0
- package/esm/uxil/diagnostics.js +135 -0
- package/esm/uxil/grammar.d.ts +72 -0
- package/esm/uxil/grammar.d.ts.map +1 -0
- package/esm/uxil/grammar.js +505 -0
- package/esm/uxil/lexer.d.ts +23 -0
- package/esm/uxil/lexer.d.ts.map +1 -0
- package/esm/uxil/lexer.js +58 -0
- package/esm/uxil/mod.d.ts +32 -0
- package/esm/uxil/mod.d.ts.map +1 -0
- package/esm/uxil/mod.js +11 -0
- package/esm/uxil/projection.d.ts +40 -0
- package/esm/uxil/projection.d.ts.map +1 -0
- package/esm/uxil/projection.js +41 -0
- package/esm/uxil/recognize.d.ts +16 -0
- package/esm/uxil/recognize.d.ts.map +1 -0
- package/esm/uxil/recognize.js +28 -0
- package/esm/uxil/registry.d.ts +37 -0
- package/esm/uxil/registry.d.ts.map +1 -0
- package/esm/uxil/registry.js +29 -0
- package/esm/uxil/surfaces.d.ts +36 -0
- package/esm/uxil/surfaces.d.ts.map +1 -0
- package/esm/uxil/surfaces.js +34 -0
- package/esm/uxil/validator.d.ts +36 -0
- package/esm/uxil/validator.d.ts.map +1 -0
- package/esm/uxil/validator.js +139 -0
- package/esm/uxil/vocab.d.ts +33 -0
- package/esm/uxil/vocab.d.ts.map +1 -0
- package/esm/uxil/vocab.js +36 -0
- package/esm/validator/body_blocks.d.ts +2 -1
- package/esm/validator/body_blocks.d.ts.map +1 -1
- package/esm/validator/body_blocks.js +80 -2
- package/esm/validator/caption_convention.d.ts +2 -1
- package/esm/validator/caption_convention.d.ts.map +1 -1
- package/esm/validator/caption_convention.js +2 -1
- package/esm/validator/corpus.d.ts +6 -0
- package/esm/validator/corpus.d.ts.map +1 -1
- package/esm/validator/corpus.js +55 -20
- package/esm/validator/discipline.d.ts +6 -4
- package/esm/validator/discipline.d.ts.map +1 -1
- package/esm/validator/discipline.js +6 -4
- package/esm/validator/mod.d.ts +1 -1
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +29 -16
- package/esm/validator/pipeline.d.ts +11 -1
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +76 -23
- package/esm/validator/trace_types.d.ts +9 -2
- package/esm/validator/trace_types.d.ts.map +1 -1
- package/esm/validator/trace_types.js +21 -5
- package/esm/validator/traceability.d.ts +15 -3
- package/esm/validator/traceability.d.ts.map +1 -1
- package/esm/validator/traceability.js +39 -4
- package/esm/validator/types.d.ts.map +1 -1
- package/esm/validator/types.js +11 -1
- package/esm/validator/uxil_family.d.ts +43 -0
- package/esm/validator/uxil_family.d.ts.map +1 -0
- package/esm/validator/uxil_family.js +52 -0
- package/package.json +1 -1
- package/script/ast/normalize.d.ts +4 -5
- package/script/ast/normalize.d.ts.map +1 -1
- package/script/ast/normalize.js +5 -36
- package/script/collect/mod.d.ts +29 -9
- package/script/collect/mod.d.ts.map +1 -1
- package/script/collect/mod.js +38 -10
- package/script/compiler/deserialize.d.ts +49 -0
- package/script/compiler/deserialize.d.ts.map +1 -0
- package/script/compiler/deserialize.js +144 -0
- package/script/compiler/manifest.d.ts +3 -0
- package/script/compiler/manifest.d.ts.map +1 -1
- package/script/compiler/manifest.js +10 -3
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +16 -11
- package/script/config/markspec.d.ts +40 -1
- package/script/config/markspec.d.ts.map +1 -1
- package/script/config/markspec.js +129 -3
- package/script/config/mod.d.ts.map +1 -1
- package/script/config/mod.js +143 -147
- package/script/decl/duplicates.d.ts +29 -0
- package/script/decl/duplicates.d.ts.map +1 -0
- package/script/decl/duplicates.js +31 -0
- package/script/decl/mod.d.ts +4 -2
- package/script/decl/mod.d.ts.map +1 -1
- package/script/decl/mod.js +4 -2
- package/script/decl/surfaces.d.ts +29 -7
- package/script/decl/surfaces.d.ts.map +1 -1
- package/script/decl/surfaces.js +32 -19
- package/script/discovery/mod.d.ts +24 -8
- package/script/discovery/mod.d.ts.map +1 -1
- package/script/discovery/mod.js +56 -20
- package/script/discovery/projects.d.ts +109 -0
- package/script/discovery/projects.d.ts.map +1 -0
- package/script/discovery/projects.js +240 -0
- package/script/formatter/entry_body.d.ts +86 -0
- package/script/formatter/entry_body.d.ts.map +1 -0
- package/script/formatter/entry_body.js +292 -0
- package/script/formatter/mod.d.ts +13 -9
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +124 -48
- package/script/gates/mod.d.ts +13 -2
- package/script/gates/mod.d.ts.map +1 -1
- package/script/gates/mod.js +50 -22
- package/script/lint/runner.d.ts.map +1 -1
- package/script/lint/runner.js +6 -4
- package/script/lock/acquire_compile.d.ts +31 -0
- package/script/lock/acquire_compile.d.ts.map +1 -0
- package/script/lock/acquire_compile.js +86 -0
- package/script/lock/cache_check.d.ts +28 -0
- package/script/lock/cache_check.d.ts.map +1 -0
- package/script/lock/cache_check.js +54 -0
- package/script/lock/check.d.ts +14 -3
- package/script/lock/check.d.ts.map +1 -1
- package/script/lock/check.js +43 -4
- package/script/lock/edge_drift.d.ts +2 -0
- package/script/lock/edge_drift.d.ts.map +1 -1
- package/script/lock/edge_drift.js +5 -0
- package/script/lock/git_intent.d.ts +46 -0
- package/script/lock/git_intent.d.ts.map +1 -0
- package/script/lock/git_intent.js +115 -0
- package/script/lock/mod.d.ts +11 -4
- package/script/lock/mod.d.ts.map +1 -1
- package/script/lock/mod.js +17 -2
- package/script/lock/model.d.ts +24 -1
- package/script/lock/model.d.ts.map +1 -1
- package/script/lock/parser.d.ts.map +1 -1
- package/script/lock/parser.js +32 -0
- package/script/lock/pin_assurance.d.ts +20 -0
- package/script/lock/pin_assurance.d.ts.map +1 -0
- package/script/lock/pin_assurance.js +37 -0
- package/script/lock/resolve.d.ts +8 -17
- package/script/lock/resolve.d.ts.map +1 -1
- package/script/lock/resolve.js +7 -68
- package/script/lock/serializer.d.ts.map +1 -1
- package/script/lock/serializer.js +23 -0
- package/script/lock/upstream_common.d.ts +29 -0
- package/script/lock/upstream_common.d.ts.map +1 -0
- package/script/lock/upstream_common.js +42 -0
- package/script/lock/upstream_deps.d.ts +63 -0
- package/script/lock/upstream_deps.d.ts.map +1 -0
- package/script/lock/upstream_deps.js +175 -0
- package/script/lock/upstream_refs.d.ts +69 -0
- package/script/lock/upstream_refs.d.ts.map +1 -0
- package/script/lock/upstream_refs.js +244 -0
- package/script/mod.d.ts +23 -11
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +55 -7
- package/script/model/mod.d.ts +114 -28
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +81 -14
- package/script/model/profile.d.ts +13 -0
- package/script/model/profile.d.ts.map +1 -1
- package/script/parser/code_regions.d.ts +29 -0
- package/script/parser/code_regions.d.ts.map +1 -0
- package/script/parser/code_regions.js +41 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +108 -89
- package/script/parser/mod.d.ts.map +1 -1
- package/script/parser/mod.js +7 -1
- package/script/parser/translate.d.ts.map +1 -1
- package/script/parser/translate.js +5 -0
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +20 -3
- package/script/profile/merge.js +7 -0
- package/script/refs/mod.d.ts.map +1 -1
- package/script/refs/mod.js +7 -18
- package/script/reporter/mod.d.ts +11 -0
- package/script/reporter/mod.d.ts.map +1 -1
- package/script/reporter/mod.js +19 -8
- package/script/typl/assemble.d.ts +53 -0
- package/script/typl/assemble.d.ts.map +1 -0
- package/script/typl/assemble.js +241 -0
- package/script/typl/ast.d.ts +7 -1
- package/script/typl/ast.d.ts.map +1 -1
- package/script/typl/ast.js +3 -0
- package/script/typl/bullet.d.ts +9 -7
- package/script/typl/bullet.d.ts.map +1 -1
- package/script/typl/bullet.js +6 -4
- package/script/typl/citations.d.ts +27 -0
- package/script/typl/citations.d.ts.map +1 -0
- package/script/typl/citations.js +20 -0
- package/script/typl/diagnostics.d.ts +2 -2
- package/script/typl/diagnostics.d.ts.map +1 -1
- package/script/typl/diagnostics.js +18 -0
- package/script/typl/grammar.d.ts.map +1 -1
- package/script/typl/grammar.js +6 -0
- package/script/typl/lexer.d.ts.map +1 -1
- package/script/typl/lexer.js +25 -4
- package/script/typl/mod.d.ts +8 -2
- package/script/typl/mod.d.ts.map +1 -1
- package/script/typl/mod.js +14 -2
- package/script/typl/recognize.js +2 -2
- package/script/typl/registry.d.ts +1 -1
- package/script/typl/resolve.d.ts +31 -0
- package/script/typl/resolve.d.ts.map +1 -0
- package/script/typl/resolve.js +33 -0
- package/script/typl/table.d.ts +52 -0
- package/script/typl/table.d.ts.map +1 -0
- package/script/typl/table.js +75 -0
- package/script/typl/validator.d.ts +24 -5
- package/script/typl/validator.d.ts.map +1 -1
- package/script/typl/validator.js +55 -75
- package/script/upstream/mod.d.ts +45 -0
- package/script/upstream/mod.d.ts.map +1 -0
- package/script/upstream/mod.js +101 -0
- package/script/upstream/project.d.ts +33 -0
- package/script/upstream/project.d.ts.map +1 -0
- package/script/upstream/project.js +41 -0
- package/script/upstream/refs.d.ts +23 -0
- package/script/upstream/refs.d.ts.map +1 -0
- package/script/upstream/refs.js +74 -0
- package/script/util/fence.d.ts +20 -29
- package/script/util/fence.d.ts.map +1 -1
- package/script/util/fence.js +47 -54
- package/script/util/modals.d.ts +6 -0
- package/script/util/modals.d.ts.map +1 -1
- package/script/util/modals.js +38 -0
- package/script/util/paths.d.ts +14 -0
- package/script/util/paths.d.ts.map +1 -0
- package/script/util/paths.js +25 -0
- package/script/uxil/assemble.d.ts +38 -0
- package/script/uxil/assemble.d.ts.map +1 -0
- package/script/uxil/assemble.js +272 -0
- package/script/uxil/ast.d.ts +63 -0
- package/script/uxil/ast.d.ts.map +1 -0
- package/script/uxil/ast.js +10 -0
- package/script/uxil/citations.d.ts +27 -0
- package/script/uxil/citations.d.ts.map +1 -0
- package/script/uxil/citations.js +29 -0
- package/script/uxil/diagnostics.d.ts +39 -0
- package/script/uxil/diagnostics.d.ts.map +1 -0
- package/script/uxil/diagnostics.js +140 -0
- package/script/uxil/grammar.d.ts +72 -0
- package/script/uxil/grammar.d.ts.map +1 -0
- package/script/uxil/grammar.js +511 -0
- package/script/uxil/lexer.d.ts +23 -0
- package/script/uxil/lexer.d.ts.map +1 -0
- package/script/uxil/lexer.js +61 -0
- package/script/uxil/mod.d.ts +32 -0
- package/script/uxil/mod.d.ts.map +1 -0
- package/script/uxil/mod.js +37 -0
- package/script/uxil/projection.d.ts +40 -0
- package/script/uxil/projection.d.ts.map +1 -0
- package/script/uxil/projection.js +44 -0
- package/script/uxil/recognize.d.ts +16 -0
- package/script/uxil/recognize.d.ts.map +1 -0
- package/script/uxil/recognize.js +31 -0
- package/script/uxil/registry.d.ts +37 -0
- package/script/uxil/registry.d.ts.map +1 -0
- package/script/uxil/registry.js +32 -0
- package/script/uxil/surfaces.d.ts +36 -0
- package/script/uxil/surfaces.d.ts.map +1 -0
- package/script/uxil/surfaces.js +39 -0
- package/script/uxil/validator.d.ts +36 -0
- package/script/uxil/validator.d.ts.map +1 -0
- package/script/uxil/validator.js +142 -0
- package/script/uxil/vocab.d.ts +33 -0
- package/script/uxil/vocab.d.ts.map +1 -0
- package/script/uxil/vocab.js +41 -0
- package/script/validator/body_blocks.d.ts +2 -1
- package/script/validator/body_blocks.d.ts.map +1 -1
- package/script/validator/body_blocks.js +80 -2
- package/script/validator/caption_convention.d.ts +2 -1
- package/script/validator/caption_convention.d.ts.map +1 -1
- package/script/validator/caption_convention.js +2 -1
- package/script/validator/corpus.d.ts +6 -0
- package/script/validator/corpus.d.ts.map +1 -1
- package/script/validator/corpus.js +55 -19
- package/script/validator/discipline.d.ts +6 -4
- package/script/validator/discipline.d.ts.map +1 -1
- package/script/validator/discipline.js +6 -4
- package/script/validator/mod.d.ts +1 -1
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +29 -15
- package/script/validator/pipeline.d.ts +11 -1
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +75 -22
- package/script/validator/trace_types.d.ts +9 -2
- package/script/validator/trace_types.d.ts.map +1 -1
- package/script/validator/trace_types.js +20 -4
- package/script/validator/traceability.d.ts +15 -3
- package/script/validator/traceability.d.ts.map +1 -1
- package/script/validator/traceability.js +38 -3
- package/script/validator/types.d.ts.map +1 -1
- package/script/validator/types.js +10 -0
- package/script/validator/uxil_family.d.ts +43 -0
- package/script/validator/uxil_family.d.ts.map +1 -0
- package/script/validator/uxil_family.js +56 -0
package/esm/config/markspec.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Emits diagnostics (MARKSPEC-YAML-*) on parse or schema errors. See
|
|
8
8
|
* [spec §7.6](../../../../docs/superpowers/specs/2026-04-21-adr-008-profile-system-v1-design.md).
|
|
9
9
|
*/
|
|
10
|
-
import type { Diagnostic, ProfileSpecifier } from "../model/mod.js";
|
|
10
|
+
import type { CaptionConventions, Diagnostic, ProfileSpecifier } from "../model/mod.js";
|
|
11
11
|
import type { ReadFile } from "./mod.js";
|
|
12
12
|
/** The consumer-binding config filename, placed next to `project.yaml`. */
|
|
13
13
|
export declare const MARKSPEC_YAML_FILENAME = ".markspec.yaml";
|
|
@@ -44,6 +44,20 @@ export interface MarkspecYaml {
|
|
|
44
44
|
* `undefined` (key absent) means the default is active.
|
|
45
45
|
*/
|
|
46
46
|
readonly defaultProfile?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Gitignore-syntax patterns excluded from project file discovery,
|
|
49
|
+
* anchored at the project root (e.g. `["skills/", "*.gen.md"]`).
|
|
50
|
+
* Applied after built-in build-output skips and all `.gitignore` rules at
|
|
51
|
+
* every directory level by `core/discovery`. Negations can re-include
|
|
52
|
+
* non-hidden directories, provided their parents are not ignored. Hidden
|
|
53
|
+
* directories are always skipped. Defaults to `[]` when the key is absent.
|
|
54
|
+
*/
|
|
55
|
+
readonly exclude: readonly string[];
|
|
56
|
+
/**
|
|
57
|
+
* Per-keyword caption-position conventions (spec §4.7 MSL-C072).
|
|
58
|
+
* Defaults to `{}` when the key is absent.
|
|
59
|
+
*/
|
|
60
|
+
readonly captionConventions: CaptionConventions;
|
|
47
61
|
}
|
|
48
62
|
/** Result of parsing a `.markspec.yaml` string. */
|
|
49
63
|
export interface ParseMarkspecYamlResult {
|
|
@@ -71,4 +85,29 @@ export type WriteFile = (path: string, content: string) => Promise<void>;
|
|
|
71
85
|
* Uses raw string manipulation to preserve user comments and formatting.
|
|
72
86
|
*/
|
|
73
87
|
export declare function addProfileSpecifier(specifier: string, readFileFn: ReadFile, writeFileFn: WriteFile, projectRoot: string): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* The markspec-tool configuration read from `.markspec.yaml`: file-
|
|
90
|
+
* discovery exclusions and caption-position conventions. Distinct from
|
|
91
|
+
* {@linkcode MarkspecYaml}'s `profiles` / `defaultProfile` fields, which
|
|
92
|
+
* drive profile-chain resolution rather than tool behavior.
|
|
93
|
+
*/
|
|
94
|
+
export interface ToolConfig {
|
|
95
|
+
readonly exclude: readonly string[];
|
|
96
|
+
readonly captionConventions: CaptionConventions;
|
|
97
|
+
}
|
|
98
|
+
/** Defaults used when `.markspec.yaml` is absent or carries neither key. */
|
|
99
|
+
export declare const DEFAULT_TOOL_CONFIG: ToolConfig;
|
|
100
|
+
/**
|
|
101
|
+
* Load the markspec tool config (`exclude`, `caption-conventions`) from
|
|
102
|
+
* `.markspec.yaml` at `projectRoot`.
|
|
103
|
+
*
|
|
104
|
+
* An absent file, or one that parses to a `null` config (a schema or YAML
|
|
105
|
+
* error — see {@linkcode parseMarkspecYaml}), yields
|
|
106
|
+
* {@linkcode DEFAULT_TOOL_CONFIG}; callers inspect the returned
|
|
107
|
+
* diagnostics to decide whether that default is acceptable or fatal.
|
|
108
|
+
*/
|
|
109
|
+
export declare function loadToolConfig(projectRoot: string, readFile: ReadFile): Promise<{
|
|
110
|
+
config: ToolConfig;
|
|
111
|
+
diagnostics: readonly Diagnostic[];
|
|
112
|
+
}>;
|
|
74
113
|
//# sourceMappingURL=markspec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markspec.d.ts","sourceRoot":"","sources":["../../src/config/markspec.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"markspec.d.ts","sourceRoot":"","sources":["../../src/config/markspec.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,kBAAkB,EAElB,UAAU,EACV,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AAEvD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIxB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAU7B;AAMD,gDAAgD;AAChD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;CACjD;AAED,mDAAmD;AACnD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED,eAAO,MAAM,0BAA0B,aAMrC,CAAC;AAYH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,uBAAuB,CA8LzB;AAgFD,sDAAsD;AACtD,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzE;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,QAAQ,EACpB,WAAW,EAAE,SAAS,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAiDf;AAMD;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;CACjD;AAED,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,EAAE,UAGjC,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,CAAC,CAkBrE"}
|
package/esm/config/markspec.js
CHANGED
|
@@ -56,6 +56,17 @@ export const ALLOWED_MARKSPEC_YAML_KEYS = new Set([
|
|
|
56
56
|
"$schema",
|
|
57
57
|
"profiles",
|
|
58
58
|
"default-profile",
|
|
59
|
+
"exclude",
|
|
60
|
+
"caption-conventions",
|
|
61
|
+
]);
|
|
62
|
+
/** Valid `caption-conventions` keywords (spec §4.7 MSL-C072). */
|
|
63
|
+
const VALID_CAPTION_KEYWORDS = new Set([
|
|
64
|
+
"Figure",
|
|
65
|
+
"Table",
|
|
66
|
+
"Listing",
|
|
67
|
+
"Feature",
|
|
68
|
+
"Equation",
|
|
69
|
+
"List",
|
|
59
70
|
]);
|
|
60
71
|
/**
|
|
61
72
|
* Parse and validate a `.markspec.yaml` string.
|
|
@@ -69,7 +80,10 @@ export function parseMarkspecYaml(rawYaml, sourcePath) {
|
|
|
69
80
|
// Empty file is equivalent to `profiles: []`
|
|
70
81
|
const trimmed = rawYaml.trim();
|
|
71
82
|
if (trimmed.length === 0) {
|
|
72
|
-
return {
|
|
83
|
+
return {
|
|
84
|
+
config: { profiles: [], exclude: [], captionConventions: {} },
|
|
85
|
+
diagnostics,
|
|
86
|
+
};
|
|
73
87
|
}
|
|
74
88
|
let parsed;
|
|
75
89
|
try {
|
|
@@ -139,12 +153,91 @@ export function parseMarkspecYaml(rawYaml, sourcePath) {
|
|
|
139
153
|
}
|
|
140
154
|
defaultProfile = rawDefaultProfile;
|
|
141
155
|
}
|
|
156
|
+
// exclude: optional string[] of gitignore-syntax patterns.
|
|
157
|
+
let exclude = [];
|
|
158
|
+
const rawExclude = root.exclude;
|
|
159
|
+
if (rawExclude !== undefined && rawExclude !== null) {
|
|
160
|
+
if (!Array.isArray(rawExclude)) {
|
|
161
|
+
diagnostics.push({
|
|
162
|
+
code: "MARKSPEC-YAML-003",
|
|
163
|
+
severity: "error",
|
|
164
|
+
message: `.markspec.yaml: 'exclude' expected array, got ${typeof rawExclude}`,
|
|
165
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
const bad = rawExclude.findIndex((v) => typeof v !== "string" || v === "");
|
|
170
|
+
if (bad !== -1) {
|
|
171
|
+
diagnostics.push({
|
|
172
|
+
code: "MARKSPEC-YAML-003",
|
|
173
|
+
severity: "error",
|
|
174
|
+
message: `.markspec.yaml: 'exclude[${bad}]': each exclude pattern must be a non-empty string`,
|
|
175
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
exclude = rawExclude;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// caption-conventions: optional mapping of keyword → "above" | "below".
|
|
184
|
+
let captionConventions = {};
|
|
185
|
+
const rawCaptionConventions = root["caption-conventions"];
|
|
186
|
+
if (rawCaptionConventions !== undefined && rawCaptionConventions !== null) {
|
|
187
|
+
if (typeof rawCaptionConventions !== "object" ||
|
|
188
|
+
Array.isArray(rawCaptionConventions)) {
|
|
189
|
+
diagnostics.push({
|
|
190
|
+
code: "MARKSPEC-YAML-003",
|
|
191
|
+
severity: "error",
|
|
192
|
+
message: `.markspec.yaml: 'caption-conventions' expected a mapping of caption-keyword: above|below, got ${Array.isArray(rawCaptionConventions)
|
|
193
|
+
? "array"
|
|
194
|
+
: typeof rawCaptionConventions}`,
|
|
195
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
const rawMap = rawCaptionConventions;
|
|
200
|
+
const parsedConventions = {};
|
|
201
|
+
let badKey;
|
|
202
|
+
const captionErrsBefore = diagnostics.length;
|
|
203
|
+
for (const [kw, pos] of Object.entries(rawMap)) {
|
|
204
|
+
if (!VALID_CAPTION_KEYWORDS.has(kw)) {
|
|
205
|
+
badKey = kw;
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
if (pos !== "above" && pos !== "below") {
|
|
209
|
+
diagnostics.push({
|
|
210
|
+
code: "MARKSPEC-YAML-003",
|
|
211
|
+
severity: "error",
|
|
212
|
+
message: `.markspec.yaml: 'caption-conventions.${kw}' expected "above" or "below", got ${JSON.stringify(pos)}`,
|
|
213
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
214
|
+
});
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
parsedConventions[kw] = pos;
|
|
218
|
+
}
|
|
219
|
+
if (badKey !== undefined) {
|
|
220
|
+
diagnostics.push({
|
|
221
|
+
code: "MARKSPEC-YAML-003",
|
|
222
|
+
severity: "error",
|
|
223
|
+
message: `.markspec.yaml: 'caption-conventions.${badKey}': unknown caption keyword '${badKey}'; valid keywords: ${[...VALID_CAPTION_KEYWORDS].join(", ")}`,
|
|
224
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
if (diagnostics.length === captionErrsBefore) {
|
|
228
|
+
captionConventions = parsedConventions;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
142
232
|
// If any specifier failed to parse, treat the whole file as invalid.
|
|
143
233
|
const hasErrors = diagnostics.some((d) => d.severity === "error");
|
|
144
234
|
if (hasErrors) {
|
|
145
235
|
return { config: null, diagnostics };
|
|
146
236
|
}
|
|
147
|
-
return {
|
|
237
|
+
return {
|
|
238
|
+
config: { profiles, defaultProfile, exclude, captionConventions },
|
|
239
|
+
diagnostics,
|
|
240
|
+
};
|
|
148
241
|
}
|
|
149
242
|
/**
|
|
150
243
|
* Parse a single specifier string into a {@linkcode ProfileSpecifier}.
|
|
@@ -262,3 +355,35 @@ export async function addProfileSpecifier(specifier, readFileFn, writeFileFn, pr
|
|
|
262
355
|
}
|
|
263
356
|
await writeFileFn(filePath, lines.join("\n"));
|
|
264
357
|
}
|
|
358
|
+
/** Defaults used when `.markspec.yaml` is absent or carries neither key. */
|
|
359
|
+
export const DEFAULT_TOOL_CONFIG = {
|
|
360
|
+
exclude: [],
|
|
361
|
+
captionConventions: {},
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* Load the markspec tool config (`exclude`, `caption-conventions`) from
|
|
365
|
+
* `.markspec.yaml` at `projectRoot`.
|
|
366
|
+
*
|
|
367
|
+
* An absent file, or one that parses to a `null` config (a schema or YAML
|
|
368
|
+
* error — see {@linkcode parseMarkspecYaml}), yields
|
|
369
|
+
* {@linkcode DEFAULT_TOOL_CONFIG}; callers inspect the returned
|
|
370
|
+
* diagnostics to decide whether that default is acceptable or fatal.
|
|
371
|
+
*/
|
|
372
|
+
export async function loadToolConfig(projectRoot, readFile) {
|
|
373
|
+
const rawYaml = await readMarkspecYaml(projectRoot, readFile);
|
|
374
|
+
if (rawYaml === null) {
|
|
375
|
+
return { config: DEFAULT_TOOL_CONFIG, diagnostics: [] };
|
|
376
|
+
}
|
|
377
|
+
const sourcePath = join(projectRoot, MARKSPEC_YAML_FILENAME);
|
|
378
|
+
const { config, diagnostics } = parseMarkspecYaml(rawYaml, sourcePath);
|
|
379
|
+
if (config === null) {
|
|
380
|
+
return { config: DEFAULT_TOOL_CONFIG, diagnostics };
|
|
381
|
+
}
|
|
382
|
+
return {
|
|
383
|
+
config: {
|
|
384
|
+
exclude: config.exclude,
|
|
385
|
+
captionConventions: config.captionConventions,
|
|
386
|
+
},
|
|
387
|
+
diagnostics,
|
|
388
|
+
};
|
|
389
|
+
}
|
package/esm/config/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/config/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/config/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAIL,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAEzB,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,yFAAyF;AACzF,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAMrE;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAU7B;AA8DD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,aAAa,CAkHf;AAoGD;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAiBxD;AAMD;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAUvC"}
|
package/esm/config/mod.js
CHANGED
|
@@ -46,6 +46,42 @@ function findLineNumber(rawYaml, fieldName) {
|
|
|
46
46
|
return undefined;
|
|
47
47
|
return rawYaml.slice(0, match.index).split("\n").length;
|
|
48
48
|
}
|
|
49
|
+
/** `name:` must be lowercase, start with a letter, and contain only
|
|
50
|
+
* letters, digits, `.`, and `-` (org project schema). */
|
|
51
|
+
const NAME_PATTERN = /^[a-z][a-z0-9.-]*$/;
|
|
52
|
+
/**
|
|
53
|
+
* Org keys `project.yaml` accepts but never parses or acts on — free-form
|
|
54
|
+
* classification/metadata fields owned by the org schema, not MarkSpec.
|
|
55
|
+
*/
|
|
56
|
+
const ORG_INERT_KEYS = new Set([
|
|
57
|
+
"$schema",
|
|
58
|
+
"category",
|
|
59
|
+
"description",
|
|
60
|
+
"license",
|
|
61
|
+
"keywords",
|
|
62
|
+
"labels",
|
|
63
|
+
"authors",
|
|
64
|
+
"homepage",
|
|
65
|
+
"bugs",
|
|
66
|
+
"repository",
|
|
67
|
+
"upstream",
|
|
68
|
+
"process",
|
|
69
|
+
"classification",
|
|
70
|
+
"metadata",
|
|
71
|
+
]);
|
|
72
|
+
/** Keys `parseProjectConfig` actually parses into `ProjectConfig`. */
|
|
73
|
+
const PARSED_KEYS = new Set(["name", "version", "dependencies", "references"]);
|
|
74
|
+
/**
|
|
75
|
+
* Keys retired or relocated by the Task 8 closed-schema flip. Present only
|
|
76
|
+
* to produce an actionable migration message; the key itself is never
|
|
77
|
+
* accepted.
|
|
78
|
+
*/
|
|
79
|
+
const MIGRATED_KEY_HINTS = {
|
|
80
|
+
"exclude": "has moved to .markspec.yaml (markspec tool config)",
|
|
81
|
+
"caption-conventions": "has moved to .markspec.yaml (markspec tool config)",
|
|
82
|
+
"parents": "is retired — declare a 'references:' projectRef instead",
|
|
83
|
+
"parent-fallback": "is retired — declare a 'references:' projectRef instead",
|
|
84
|
+
};
|
|
49
85
|
/**
|
|
50
86
|
* Parse a YAML string and validate it as a MarkSpec project configuration.
|
|
51
87
|
*
|
|
@@ -82,7 +118,7 @@ export function parseProjectConfig(yaml, filePath) {
|
|
|
82
118
|
}
|
|
83
119
|
const obj = raw;
|
|
84
120
|
const errors = [];
|
|
85
|
-
// name: required string
|
|
121
|
+
// name: required string, matching the org name pattern
|
|
86
122
|
if (obj.name === undefined || obj.name === null || obj.name === "") {
|
|
87
123
|
errors.push({
|
|
88
124
|
field: "name",
|
|
@@ -97,10 +133,16 @@ export function parseProjectConfig(yaml, filePath) {
|
|
|
97
133
|
line: findLineNumber(yaml, "name"),
|
|
98
134
|
});
|
|
99
135
|
}
|
|
100
|
-
|
|
101
|
-
|
|
136
|
+
else if (!NAME_PATTERN.test(obj.name)) {
|
|
137
|
+
errors.push({
|
|
138
|
+
field: "name",
|
|
139
|
+
message: "must match ^[a-z][a-z0-9.-]*$ (lowercase letters, digits, '.', '-'; starts with a letter)",
|
|
140
|
+
line: findLineNumber(yaml, "name"),
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
// version: required string (org project schema)
|
|
102
144
|
let version = DEFAULT_PROJECT_CONFIG.version;
|
|
103
|
-
if (obj.version !== undefined && obj.version !== null) {
|
|
145
|
+
if (obj.version !== undefined && obj.version !== null && obj.version !== "") {
|
|
104
146
|
if (typeof obj.version === "number") {
|
|
105
147
|
console.error(`warning: ${filePath}: version is a number (${obj.version}), ` +
|
|
106
148
|
`coerced to "${String(obj.version)}". ` +
|
|
@@ -108,159 +150,125 @@ export function parseProjectConfig(yaml, filePath) {
|
|
|
108
150
|
}
|
|
109
151
|
version = String(obj.version);
|
|
110
152
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
message: `expected array, got ${typeof obj.labels}`,
|
|
118
|
-
line: findLineNumber(yaml, "labels"),
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
const bad = obj.labels.findIndex((v) => typeof v !== "string" || v === "");
|
|
123
|
-
if (bad !== -1) {
|
|
124
|
-
errors.push({
|
|
125
|
-
field: `labels[${bad}]`,
|
|
126
|
-
message: "each label must be a non-empty string",
|
|
127
|
-
line: findLineNumber(yaml, "labels"),
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
labels = obj.labels;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
153
|
+
else {
|
|
154
|
+
errors.push({
|
|
155
|
+
field: "version",
|
|
156
|
+
message: "version is required (org project schema)",
|
|
157
|
+
line: undefined,
|
|
158
|
+
});
|
|
134
159
|
}
|
|
135
|
-
//
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
160
|
+
// dependencies / references: optional projectRef[] (org project-manifest)
|
|
161
|
+
const dependencies = parseProjectRefList(obj["dependencies"], "dependencies", yaml, errors);
|
|
162
|
+
const references = parseProjectRefList(obj["references"], "references", yaml, errors);
|
|
163
|
+
// Closed-schema key classifier: every key must be one this parser reads
|
|
164
|
+
// (PARSED_KEYS), an org-owned free-form field MarkSpec ignores
|
|
165
|
+
// (ORG_INERT_KEYS), or a migrated/retired key with an actionable hint
|
|
166
|
+
// (MIGRATED_KEY_HINTS). Anything else is unknown to the closed schema.
|
|
167
|
+
for (const key of Object.keys(obj)) {
|
|
168
|
+
if (PARSED_KEYS.has(key) || ORG_INERT_KEYS.has(key))
|
|
169
|
+
continue;
|
|
170
|
+
const hint = MIGRATED_KEY_HINTS[key];
|
|
171
|
+
errors.push({
|
|
172
|
+
field: key,
|
|
173
|
+
message: hint !== undefined
|
|
174
|
+
? `'${key}' ${hint}`
|
|
175
|
+
: `unknown key '${key}' (project.yaml follows the closed org schema ` +
|
|
176
|
+
`https://driftsys.github.io/schemas/project/v1.json)`,
|
|
177
|
+
line: findLineNumber(yaml, key),
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
if (errors.length > 0) {
|
|
181
|
+
throw new ConfigError(filePath, errors);
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
name: obj.name,
|
|
185
|
+
version,
|
|
186
|
+
dependencies,
|
|
187
|
+
references,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
// projectRef parsing (org project-manifest contract: dependencies/references)
|
|
192
|
+
// ---------------------------------------------------------------------------
|
|
193
|
+
/** Safe upstream id: single path segment, no separators or traversal. */
|
|
194
|
+
const PROJECT_REF_NAME_RE = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
195
|
+
const PROJECT_REF_KEYS = new Set(["url", "version", "name"]);
|
|
196
|
+
/**
|
|
197
|
+
* Parse a `dependencies:` or `references:` list of projectRef objects
|
|
198
|
+
* (`{ url (required), version?, name? }`). Pushes field errors onto
|
|
199
|
+
* `errors` and returns whatever refs parsed cleanly; the caller throws
|
|
200
|
+
* once all fields have been checked, so a single invalid entry doesn't
|
|
201
|
+
* mask other unrelated errors.
|
|
202
|
+
*/
|
|
203
|
+
function parseProjectRefList(value, field, yaml, errors) {
|
|
204
|
+
if (value === undefined || value === null)
|
|
205
|
+
return [];
|
|
206
|
+
if (!Array.isArray(value)) {
|
|
207
|
+
errors.push({
|
|
208
|
+
field,
|
|
209
|
+
message: "must be a list of projectRef objects ({ url, version?, name? })",
|
|
210
|
+
line: findLineNumber(yaml, field),
|
|
211
|
+
});
|
|
212
|
+
return [];
|
|
213
|
+
}
|
|
214
|
+
const out = [];
|
|
215
|
+
value.forEach((item, i) => {
|
|
216
|
+
if (typeof item !== "object" || item === null || Array.isArray(item)) {
|
|
139
217
|
errors.push({
|
|
140
|
-
field:
|
|
141
|
-
message:
|
|
142
|
-
line: findLineNumber(yaml,
|
|
218
|
+
field: `${field}[${i}]`,
|
|
219
|
+
message: "must be a mapping with a required 'url' key",
|
|
220
|
+
line: findLineNumber(yaml, field),
|
|
143
221
|
});
|
|
222
|
+
return;
|
|
144
223
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (
|
|
224
|
+
const record = item;
|
|
225
|
+
for (const key of Object.keys(record)) {
|
|
226
|
+
if (!PROJECT_REF_KEYS.has(key)) {
|
|
148
227
|
errors.push({
|
|
149
|
-
field:
|
|
150
|
-
message:
|
|
151
|
-
line: findLineNumber(yaml,
|
|
228
|
+
field: `${field}[${i}]`,
|
|
229
|
+
message: `unknown projectRef key '${key}' (allowed: url, version, name)`,
|
|
230
|
+
line: findLineNumber(yaml, key),
|
|
152
231
|
});
|
|
153
232
|
}
|
|
154
|
-
else {
|
|
155
|
-
parents = obj.parents;
|
|
156
|
-
}
|
|
157
233
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
let parentFallback = DEFAULT_PROJECT_CONFIG.parentFallback;
|
|
161
|
-
const fallbackKey = "parent-fallback";
|
|
162
|
-
if (obj[fallbackKey] !== undefined && obj[fallbackKey] !== null) {
|
|
163
|
-
const val = obj[fallbackKey];
|
|
164
|
-
if (typeof val !== "string" || !isValidUrl(val)) {
|
|
234
|
+
const url = record.url;
|
|
235
|
+
if (typeof url !== "string" || url.length === 0) {
|
|
165
236
|
errors.push({
|
|
166
|
-
field:
|
|
167
|
-
message: "
|
|
168
|
-
line: findLineNumber(yaml,
|
|
237
|
+
field: `${field}[${i}].url`,
|
|
238
|
+
message: "projectRef requires a non-empty 'url' string",
|
|
239
|
+
line: findLineNumber(yaml, field),
|
|
169
240
|
});
|
|
241
|
+
return;
|
|
170
242
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
// caption-conventions: optional mapping of keyword → "above" | "below"
|
|
176
|
-
let captionConventions = DEFAULT_PROJECT_CONFIG.captionConventions;
|
|
177
|
-
const captionConventionsKey = "caption-conventions";
|
|
178
|
-
if (obj[captionConventionsKey] !== undefined &&
|
|
179
|
-
obj[captionConventionsKey] !== null) {
|
|
180
|
-
const raw = obj[captionConventionsKey];
|
|
181
|
-
if (typeof raw !== "object" || Array.isArray(raw)) {
|
|
182
|
-
errors.push({
|
|
183
|
-
field: captionConventionsKey,
|
|
184
|
-
message: `expected a mapping of caption-keyword: above|below, got ${Array.isArray(raw) ? "array" : typeof raw}`,
|
|
185
|
-
line: findLineNumber(yaml, captionConventionsKey),
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
const rawMap = raw;
|
|
190
|
-
const VALID_KEYWORDS = new Set([
|
|
191
|
-
"Figure",
|
|
192
|
-
"Table",
|
|
193
|
-
"Listing",
|
|
194
|
-
"Feature",
|
|
195
|
-
"Equation",
|
|
196
|
-
"List",
|
|
197
|
-
]);
|
|
198
|
-
const parsed = {};
|
|
199
|
-
let badKey;
|
|
200
|
-
const captionErrsBefore = errors.length;
|
|
201
|
-
for (const [kw, pos] of Object.entries(rawMap)) {
|
|
202
|
-
if (!VALID_KEYWORDS.has(kw)) {
|
|
203
|
-
badKey = kw;
|
|
204
|
-
break;
|
|
205
|
-
}
|
|
206
|
-
if (pos !== "above" && pos !== "below") {
|
|
207
|
-
errors.push({
|
|
208
|
-
field: `${captionConventionsKey}.${kw}`,
|
|
209
|
-
message: `expected "above" or "below", got ${JSON.stringify(pos)}`,
|
|
210
|
-
line: findLineNumber(yaml, captionConventionsKey),
|
|
211
|
-
});
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
|
-
parsed[kw] = pos;
|
|
215
|
-
}
|
|
216
|
-
if (badKey !== undefined) {
|
|
243
|
+
const ref = { url };
|
|
244
|
+
if (record.version !== undefined) {
|
|
245
|
+
if (typeof record.version !== "string" || record.version.length === 0) {
|
|
217
246
|
errors.push({
|
|
218
|
-
field: `${
|
|
219
|
-
message:
|
|
220
|
-
line: findLineNumber(yaml,
|
|
247
|
+
field: `${field}[${i}].version`,
|
|
248
|
+
message: "must be a non-empty string when present",
|
|
249
|
+
line: findLineNumber(yaml, field),
|
|
221
250
|
});
|
|
222
251
|
}
|
|
223
|
-
|
|
224
|
-
|
|
252
|
+
else {
|
|
253
|
+
ref.version = record.version;
|
|
225
254
|
}
|
|
226
255
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
if (obj.exclude !== undefined && obj.exclude !== null) {
|
|
231
|
-
if (!Array.isArray(obj.exclude)) {
|
|
232
|
-
errors.push({
|
|
233
|
-
field: "exclude",
|
|
234
|
-
message: `expected array, got ${typeof obj.exclude}`,
|
|
235
|
-
line: findLineNumber(yaml, "exclude"),
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
const bad = obj.exclude.findIndex((v) => typeof v !== "string" || v === "");
|
|
240
|
-
if (bad !== -1) {
|
|
256
|
+
if (record.name !== undefined) {
|
|
257
|
+
if (typeof record.name !== "string" ||
|
|
258
|
+
!PROJECT_REF_NAME_RE.test(record.name)) {
|
|
241
259
|
errors.push({
|
|
242
|
-
field:
|
|
243
|
-
message: "
|
|
244
|
-
line: findLineNumber(yaml,
|
|
260
|
+
field: `${field}[${i}].name`,
|
|
261
|
+
message: "must match [A-Za-z0-9][A-Za-z0-9._-]* (used as a cache directory name)",
|
|
262
|
+
line: findLineNumber(yaml, field),
|
|
245
263
|
});
|
|
246
264
|
}
|
|
247
265
|
else {
|
|
248
|
-
|
|
266
|
+
ref.name = record.name;
|
|
249
267
|
}
|
|
250
268
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
return {
|
|
256
|
-
name: obj.name,
|
|
257
|
-
version,
|
|
258
|
-
labels,
|
|
259
|
-
parents,
|
|
260
|
-
parentFallback,
|
|
261
|
-
captionConventions,
|
|
262
|
-
exclude,
|
|
263
|
-
};
|
|
269
|
+
out.push(ref);
|
|
270
|
+
});
|
|
271
|
+
return out;
|
|
264
272
|
}
|
|
265
273
|
// ---------------------------------------------------------------------------
|
|
266
274
|
// Domain derivation
|
|
@@ -308,15 +316,3 @@ export async function loadConfig(startDir, readFile) {
|
|
|
308
316
|
const config = parseProjectConfig(content, configPath);
|
|
309
317
|
return { config, projectRoot: root, configPath };
|
|
310
318
|
}
|
|
311
|
-
// ---------------------------------------------------------------------------
|
|
312
|
-
// Helpers
|
|
313
|
-
// ---------------------------------------------------------------------------
|
|
314
|
-
function isValidUrl(value) {
|
|
315
|
-
try {
|
|
316
|
-
new URL(value);
|
|
317
|
-
return true;
|
|
318
|
-
}
|
|
319
|
-
catch {
|
|
320
|
-
return false;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/decl/duplicates
|
|
3
|
+
*
|
|
4
|
+
* DSL-agnostic "declared exactly once" scan over a corpus-wide registry
|
|
5
|
+
* (uxil epic #717 §A, #754). Both typl's dotted-name bindings (TYPL-009)
|
|
6
|
+
* and uxil's own registry (#726) need the identical shape: a
|
|
7
|
+
* `Map<name, T[]>` where any name with more than one declaration is a
|
|
8
|
+
* violation. The engine only counts and groups — the DSL host supplies
|
|
9
|
+
* the registry, narrows which names to check via `predicate`, and maps
|
|
10
|
+
* each {@linkcode DuplicateDeclaration} to its own diagnostic code.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* One corpus-wide multiple-declaration violation: `name` was declared
|
|
14
|
+
* more than once. `first` is the earliest declaration (registry
|
|
15
|
+
* insertion order); `duplicates` are the rest, in the same order.
|
|
16
|
+
*/
|
|
17
|
+
export interface DuplicateDeclaration<T> {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly first: T;
|
|
20
|
+
readonly duplicates: readonly T[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Scan `registry` for names declared more than once. Returns one entry
|
|
24
|
+
* per offending name, in `registry`'s iteration order. `predicate`
|
|
25
|
+
* narrows which names are checked at all (e.g. typl's "only dotted,
|
|
26
|
+
* published names" rule); defaults to checking every name.
|
|
27
|
+
*/
|
|
28
|
+
export declare function findDuplicateDeclarations<T>(registry: ReadonlyMap<string, readonly T[]>, predicate?: (name: string) => boolean): readonly DuplicateDeclaration<T>[];
|
|
29
|
+
//# sourceMappingURL=duplicates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicates.d.ts","sourceRoot":"","sources":["../../src/decl/duplicates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,EAC3C,SAAS,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAoB,GAChD,SAAS,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAQpC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/decl/duplicates
|
|
3
|
+
*
|
|
4
|
+
* DSL-agnostic "declared exactly once" scan over a corpus-wide registry
|
|
5
|
+
* (uxil epic #717 §A, #754). Both typl's dotted-name bindings (TYPL-009)
|
|
6
|
+
* and uxil's own registry (#726) need the identical shape: a
|
|
7
|
+
* `Map<name, T[]>` where any name with more than one declaration is a
|
|
8
|
+
* violation. The engine only counts and groups — the DSL host supplies
|
|
9
|
+
* the registry, narrows which names to check via `predicate`, and maps
|
|
10
|
+
* each {@linkcode DuplicateDeclaration} to its own diagnostic code.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Scan `registry` for names declared more than once. Returns one entry
|
|
14
|
+
* per offending name, in `registry`'s iteration order. `predicate`
|
|
15
|
+
* narrows which names are checked at all (e.g. typl's "only dotted,
|
|
16
|
+
* published names" rule); defaults to checking every name.
|
|
17
|
+
*/
|
|
18
|
+
export function findDuplicateDeclarations(registry, predicate = () => true) {
|
|
19
|
+
const out = [];
|
|
20
|
+
for (const [name, decls] of registry) {
|
|
21
|
+
if (decls.length < 2)
|
|
22
|
+
continue;
|
|
23
|
+
if (!predicate(name))
|
|
24
|
+
continue;
|
|
25
|
+
out.push({ name, first: decls[0], duplicates: decls.slice(1) });
|
|
26
|
+
}
|
|
27
|
+
return out;
|
|
28
|
+
}
|
package/esm/decl/mod.d.ts
CHANGED
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
* against the base an enclosing declaration establishes. typl consumes
|
|
10
10
|
* these today; uxil (§B) rides on the same substrate.
|
|
11
11
|
*/
|
|
12
|
-
export type { BlockDeclaration, FenceRecognizer, InlineDeclaration, TextRecognizer, } from "./surfaces.js";
|
|
13
|
-
export {
|
|
12
|
+
export type { BlockDeclaration, FenceRecognizer, InlineDeclaration, NestedBlockDeclaration, TextRecognizer, } from "./surfaces.js";
|
|
13
|
+
export { extractFenceDeclarations, extractInlineDeclarations, extractNestedBulletDeclarations, stripCodeSpanDelimiters, } from "./surfaces.js";
|
|
14
14
|
export type { RowRecognizer, TableRowDeclaration } from "./table.js";
|
|
15
15
|
export { extractTableDeclarations } from "./table.js";
|
|
16
16
|
export type { BaseScope, RefOps, RefResolution, RootCheck } from "./resolve.js";
|
|
17
17
|
export { checkSingleRoot, resolveRef } from "./resolve.js";
|
|
18
|
+
export type { DuplicateDeclaration } from "./duplicates.js";
|
|
19
|
+
export { findDuplicateDeclarations } from "./duplicates.js";
|
|
18
20
|
//# sourceMappingURL=mod.d.ts.map
|
package/esm/decl/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/decl/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/decl/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtD,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE3D,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC"}
|