@driftsys/markspec 0.5.0 → 0.6.1
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 +74 -20
- package/esm/ast/build.d.ts +11 -21
- package/esm/ast/build.d.ts.map +1 -1
- package/esm/ast/build.js +50 -139
- package/esm/ast/nodes.d.ts +11 -43
- package/esm/ast/nodes.d.ts.map +1 -1
- package/esm/ast/nodes.js +6 -1
- package/esm/ast/normalize.d.ts +8 -17
- package/esm/ast/normalize.d.ts.map +1 -1
- package/esm/ast/normalize.js +14 -72
- package/esm/compiler/constants.d.ts +16 -0
- package/esm/compiler/constants.d.ts.map +1 -0
- package/esm/compiler/constants.js +26 -0
- package/esm/compiler/discipline_classifier.d.ts +55 -0
- package/esm/compiler/discipline_classifier.d.ts.map +1 -0
- package/esm/compiler/discipline_classifier.js +191 -0
- package/esm/compiler/inverses.d.ts +7 -0
- package/esm/compiler/inverses.d.ts.map +1 -1
- package/esm/compiler/inverses.js +1 -18
- package/esm/compiler/mod.d.ts +30 -1
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +198 -65
- package/esm/compiler/schema.d.ts +15 -0
- package/esm/compiler/schema.d.ts.map +1 -1
- package/esm/compiler/schema.js +12 -0
- package/esm/config/markspec.d.ts +5 -0
- package/esm/config/markspec.d.ts.map +1 -1
- package/esm/config/markspec.js +17 -2
- package/esm/formatter/mod.d.ts +9 -3
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +97 -49
- package/esm/lexicons/loader.d.ts +35 -0
- package/esm/lexicons/loader.d.ts.map +1 -0
- package/esm/lexicons/loader.js +51 -0
- package/esm/lexicons/mod.d.ts +13 -0
- package/esm/lexicons/mod.d.ts.map +1 -0
- package/esm/lexicons/mod.js +12 -0
- package/esm/lint/glossary.d.ts +45 -0
- package/esm/lint/glossary.d.ts.map +1 -0
- package/esm/lint/glossary.js +85 -0
- package/esm/lint/mod.d.ts +4 -0
- package/esm/lint/mod.d.ts.map +1 -1
- package/esm/lint/mod.js +2 -0
- package/esm/lint/range_util.d.ts +25 -0
- package/esm/lint/range_util.d.ts.map +1 -0
- package/esm/lint/range_util.js +50 -0
- package/esm/lint/rules/ears.d.ts +39 -0
- package/esm/lint/rules/ears.d.ts.map +1 -0
- package/esm/lint/rules/ears.js +316 -0
- package/esm/lint/rules/incose_sentence.d.ts +46 -0
- package/esm/lint/rules/incose_sentence.d.ts.map +1 -0
- package/esm/lint/rules/incose_sentence.js +417 -0
- package/esm/lint/rules/modal_sentence.d.ts +46 -0
- package/esm/lint/rules/modal_sentence.d.ts.map +1 -0
- package/esm/lint/rules/modal_sentence.js +146 -0
- package/esm/lint/rules/passive.d.ts +64 -0
- package/esm/lint/rules/passive.d.ts.map +1 -0
- package/esm/lint/rules/passive.js +282 -0
- package/esm/lint/rules/suppression.d.ts +38 -3
- package/esm/lint/rules/suppression.d.ts.map +1 -1
- package/esm/lint/rules/suppression.js +58 -4
- package/esm/lint/rules/xref.d.ts +19 -0
- package/esm/lint/rules/xref.d.ts.map +1 -0
- package/esm/lint/rules/xref.js +248 -0
- package/esm/lint/runner.d.ts +31 -11
- package/esm/lint/runner.d.ts.map +1 -1
- package/esm/lint/runner.js +67 -26
- package/esm/lint/score.d.ts +64 -0
- package/esm/lint/score.d.ts.map +1 -0
- package/esm/lint/score.js +163 -0
- package/esm/lint/segmenter.d.ts +32 -0
- package/esm/lint/segmenter.d.ts.map +1 -0
- package/esm/lint/segmenter.js +79 -0
- package/esm/lint/types.d.ts +12 -0
- package/esm/lint/types.d.ts.map +1 -1
- package/esm/lock/canonical_edges.d.ts +31 -0
- package/esm/lock/canonical_edges.d.ts.map +1 -0
- package/esm/lock/canonical_edges.js +57 -0
- package/esm/lock/check.d.ts +24 -0
- package/esm/lock/check.d.ts.map +1 -0
- package/esm/lock/check.js +127 -0
- package/esm/lock/hash.d.ts +12 -0
- package/esm/lock/hash.d.ts.map +1 -0
- package/esm/lock/hash.js +32 -0
- package/esm/lock/mod.d.ts +19 -0
- package/esm/lock/mod.d.ts.map +1 -0
- package/esm/lock/mod.js +14 -0
- package/esm/lock/model.d.ts +81 -0
- package/esm/lock/model.d.ts.map +1 -0
- package/esm/lock/model.js +7 -0
- package/esm/lock/parser.d.ts +26 -0
- package/esm/lock/parser.d.ts.map +1 -0
- package/esm/lock/parser.js +195 -0
- package/esm/lock/resolve.d.ts +142 -0
- package/esm/lock/resolve.d.ts.map +1 -0
- package/esm/lock/resolve.js +389 -0
- package/esm/lock/serializer.d.ts +14 -0
- package/esm/lock/serializer.d.ts.map +1 -0
- package/esm/lock/serializer.js +104 -0
- package/esm/mod.d.ts +16 -9
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +12 -4
- package/esm/model/attributes.d.ts +6 -0
- package/esm/model/attributes.d.ts.map +1 -1
- package/esm/model/attributes.js +37 -0
- package/esm/model/discipline.d.ts +53 -0
- package/esm/model/discipline.d.ts.map +1 -0
- package/esm/model/discipline.js +50 -0
- package/esm/model/mod.d.ts +188 -30
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +42 -1
- package/esm/model/profile.d.ts +69 -0
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/parser/attributes.d.ts.map +1 -1
- package/esm/parser/attributes.js +1 -10
- package/esm/parser/body_tokens.d.ts +35 -0
- package/esm/parser/body_tokens.d.ts.map +1 -0
- package/esm/parser/body_tokens.js +232 -0
- package/esm/parser/glossary.d.ts +8 -0
- package/esm/parser/glossary.d.ts.map +1 -1
- package/esm/parser/glossary.js +6 -4
- package/esm/parser/grammars.d.ts +5 -3
- package/esm/parser/grammars.d.ts.map +1 -1
- package/esm/parser/grammars.js +18 -4
- package/esm/parser/language_spec.d.ts +55 -0
- package/esm/parser/language_spec.d.ts.map +1 -0
- package/esm/parser/language_spec.js +419 -0
- package/esm/parser/line_map.d.ts +60 -0
- package/esm/parser/line_map.d.ts.map +1 -0
- package/esm/parser/line_map.js +41 -0
- package/esm/parser/markdown.d.ts +9 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +97 -31
- package/esm/parser/mod.d.ts +4 -0
- package/esm/parser/mod.d.ts.map +1 -1
- package/esm/parser/mod.js +30 -8
- package/esm/parser/source.d.ts +39 -8
- package/esm/parser/source.d.ts.map +1 -1
- package/esm/parser/source.js +155 -65
- package/esm/parser/translate.d.ts +24 -0
- package/esm/parser/translate.d.ts.map +1 -0
- package/esm/parser/translate.js +99 -0
- package/esm/profile/chain.d.ts +8 -0
- package/esm/profile/chain.d.ts.map +1 -1
- package/esm/profile/chain.js +29 -1
- package/esm/profile/default_profile.d.ts +25 -0
- package/esm/profile/default_profile.d.ts.map +1 -0
- package/esm/profile/default_profile.js +43 -0
- package/esm/profile/discipline_mode.d.ts +64 -0
- package/esm/profile/discipline_mode.d.ts.map +1 -0
- package/esm/profile/discipline_mode.js +133 -0
- package/esm/profile/discipline_registry.d.ts +41 -0
- package/esm/profile/discipline_registry.d.ts.map +1 -0
- package/esm/profile/discipline_registry.js +67 -0
- package/esm/profile/load.d.ts +3 -1
- package/esm/profile/load.d.ts.map +1 -1
- package/esm/profile/load.js +24 -5
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +253 -20
- package/esm/profile/merge.d.ts.map +1 -1
- package/esm/profile/merge.js +112 -0
- package/esm/profile/mod.d.ts +2 -0
- package/esm/profile/mod.d.ts.map +1 -1
- package/esm/profile/mod.js +2 -0
- package/esm/sync/locked_attributes.d.ts +19 -0
- package/esm/sync/locked_attributes.d.ts.map +1 -0
- package/esm/sync/locked_attributes.js +27 -0
- package/esm/sync/log.d.ts +34 -0
- package/esm/sync/log.d.ts.map +1 -0
- package/esm/sync/log.js +48 -0
- package/esm/sync/mapping.d.ts +66 -0
- package/esm/sync/mapping.d.ts.map +1 -0
- package/esm/sync/mapping.js +165 -0
- package/esm/sync/mod.d.ts +16 -0
- package/esm/sync/mod.d.ts.map +1 -0
- package/esm/sync/mod.js +12 -0
- package/esm/sync/status.d.ts +23 -0
- package/esm/sync/status.d.ts.map +1 -0
- package/esm/sync/status.js +21 -0
- package/esm/typl/ast.d.ts +87 -0
- package/esm/typl/ast.d.ts.map +1 -0
- package/esm/typl/ast.js +21 -0
- package/esm/typl/bridge.d.ts +32 -0
- package/esm/typl/bridge.d.ts.map +1 -0
- package/esm/typl/bridge.js +27 -0
- package/esm/typl/bullet.d.ts +34 -0
- package/esm/typl/bullet.d.ts.map +1 -0
- package/esm/typl/bullet.js +44 -0
- package/esm/typl/diagnostics.d.ts +43 -0
- package/esm/typl/diagnostics.d.ts.map +1 -0
- package/esm/typl/diagnostics.js +61 -0
- package/esm/typl/fence.d.ts +31 -0
- package/esm/typl/fence.d.ts.map +1 -0
- package/esm/typl/fence.js +24 -0
- package/esm/typl/grammar.d.ts +20 -0
- package/esm/typl/grammar.d.ts.map +1 -0
- package/esm/typl/grammar.js +471 -0
- package/esm/typl/inline.d.ts +34 -0
- package/esm/typl/inline.d.ts.map +1 -0
- package/esm/typl/inline.js +48 -0
- package/esm/typl/lexer.d.ts +37 -0
- package/esm/typl/lexer.d.ts.map +1 -0
- package/esm/typl/lexer.js +234 -0
- package/esm/typl/mod.d.ts +23 -0
- package/esm/typl/mod.d.ts.map +1 -0
- package/esm/typl/mod.js +16 -0
- package/esm/typl/registry.d.ts +42 -0
- package/esm/typl/registry.d.ts.map +1 -0
- package/esm/typl/registry.js +26 -0
- package/esm/typl/validator.d.ts +29 -0
- package/esm/typl/validator.d.ts.map +1 -0
- package/esm/typl/validator.js +141 -0
- package/esm/util/line_endings.d.ts +33 -0
- package/esm/util/line_endings.d.ts.map +1 -0
- package/esm/util/line_endings.js +53 -0
- package/esm/util/modals.d.ts +29 -0
- package/esm/util/modals.d.ts.map +1 -0
- package/esm/util/modals.js +38 -0
- package/esm/validator/discipline.d.ts +35 -0
- package/esm/validator/discipline.d.ts.map +1 -0
- package/esm/validator/discipline.js +204 -0
- package/esm/validator/mod.d.ts +1 -1
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +23 -2
- package/esm/validator/modal_keywords.d.ts +15 -13
- package/esm/validator/modal_keywords.d.ts.map +1 -1
- package/esm/validator/modal_keywords.js +26 -109
- package/esm/validator/pattern.d.ts +15 -8
- package/esm/validator/pattern.d.ts.map +1 -1
- package/esm/validator/pattern.js +42 -19
- package/esm/validator/per_type_attrs.d.ts +2 -2
- package/esm/validator/per_type_attrs.d.ts.map +1 -1
- package/esm/validator/per_type_attrs.js +2 -2
- package/esm/validator/pipeline.d.ts +11 -0
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +37 -15
- package/esm/validator/type_resolution.d.ts +3 -3
- package/esm/validator/type_resolution.d.ts.map +1 -1
- package/esm/validator/type_resolution.js +31 -9
- package/package.json +2 -2
- package/script/ast/build.d.ts +11 -21
- package/script/ast/build.d.ts.map +1 -1
- package/script/ast/build.js +51 -140
- package/script/ast/nodes.d.ts +11 -43
- package/script/ast/nodes.d.ts.map +1 -1
- package/script/ast/nodes.js +6 -1
- package/script/ast/normalize.d.ts +8 -17
- package/script/ast/normalize.d.ts.map +1 -1
- package/script/ast/normalize.js +16 -74
- package/script/compiler/constants.d.ts +16 -0
- package/script/compiler/constants.d.ts.map +1 -0
- package/script/compiler/constants.js +29 -0
- package/script/compiler/discipline_classifier.d.ts +55 -0
- package/script/compiler/discipline_classifier.d.ts.map +1 -0
- package/script/compiler/discipline_classifier.js +196 -0
- package/script/compiler/inverses.d.ts +7 -0
- package/script/compiler/inverses.d.ts.map +1 -1
- package/script/compiler/inverses.js +2 -19
- package/script/compiler/mod.d.ts +30 -1
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +202 -69
- package/script/compiler/schema.d.ts +15 -0
- package/script/compiler/schema.d.ts.map +1 -1
- package/script/compiler/schema.js +12 -0
- package/script/config/markspec.d.ts +5 -0
- package/script/config/markspec.d.ts.map +1 -1
- package/script/config/markspec.js +17 -2
- package/script/formatter/mod.d.ts +9 -3
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +99 -51
- package/script/lexicons/loader.d.ts +35 -0
- package/script/lexicons/loader.d.ts.map +1 -0
- package/script/lexicons/loader.js +55 -0
- package/script/lexicons/mod.d.ts +13 -0
- package/script/lexicons/mod.d.ts.map +1 -0
- package/script/lexicons/mod.js +17 -0
- package/script/lint/glossary.d.ts +45 -0
- package/script/lint/glossary.d.ts.map +1 -0
- package/script/lint/glossary.js +88 -0
- package/script/lint/mod.d.ts +4 -0
- package/script/lint/mod.d.ts.map +1 -1
- package/script/lint/mod.js +6 -1
- package/script/lint/range_util.d.ts +25 -0
- package/script/lint/range_util.d.ts.map +1 -0
- package/script/lint/range_util.js +53 -0
- package/script/lint/rules/ears.d.ts +39 -0
- package/script/lint/rules/ears.d.ts.map +1 -0
- package/script/lint/rules/ears.js +320 -0
- package/script/lint/rules/incose_sentence.d.ts +46 -0
- package/script/lint/rules/incose_sentence.d.ts.map +1 -0
- package/script/lint/rules/incose_sentence.js +421 -0
- package/script/lint/rules/modal_sentence.d.ts +46 -0
- package/script/lint/rules/modal_sentence.d.ts.map +1 -0
- package/script/lint/rules/modal_sentence.js +150 -0
- package/script/lint/rules/passive.d.ts +64 -0
- package/script/lint/rules/passive.d.ts.map +1 -0
- package/script/lint/rules/passive.js +286 -0
- package/script/lint/rules/suppression.d.ts +38 -3
- package/script/lint/rules/suppression.d.ts.map +1 -1
- package/script/lint/rules/suppression.js +59 -3
- package/script/lint/rules/xref.d.ts +19 -0
- package/script/lint/rules/xref.d.ts.map +1 -0
- package/script/lint/rules/xref.js +251 -0
- package/script/lint/runner.d.ts +31 -11
- package/script/lint/runner.d.ts.map +1 -1
- package/script/lint/runner.js +67 -26
- package/script/lint/score.d.ts +64 -0
- package/script/lint/score.d.ts.map +1 -0
- package/script/lint/score.js +167 -0
- package/script/lint/segmenter.d.ts +32 -0
- package/script/lint/segmenter.d.ts.map +1 -0
- package/script/lint/segmenter.js +82 -0
- package/script/lint/types.d.ts +12 -0
- package/script/lint/types.d.ts.map +1 -1
- package/script/lock/canonical_edges.d.ts +31 -0
- package/script/lock/canonical_edges.d.ts.map +1 -0
- package/script/lock/canonical_edges.js +61 -0
- package/script/lock/check.d.ts +24 -0
- package/script/lock/check.d.ts.map +1 -0
- package/script/lock/check.js +130 -0
- package/script/lock/hash.d.ts +12 -0
- package/script/lock/hash.d.ts.map +1 -0
- package/script/lock/hash.js +36 -0
- package/script/lock/mod.d.ts +19 -0
- package/script/lock/mod.d.ts.map +1 -0
- package/script/lock/mod.js +31 -0
- package/script/lock/model.d.ts +81 -0
- package/script/lock/model.d.ts.map +1 -0
- package/script/lock/model.js +10 -0
- package/script/lock/parser.d.ts +26 -0
- package/script/lock/parser.d.ts.map +1 -0
- package/script/lock/parser.js +198 -0
- package/script/lock/resolve.d.ts +142 -0
- package/script/lock/resolve.d.ts.map +1 -0
- package/script/lock/resolve.js +397 -0
- package/script/lock/serializer.d.ts +14 -0
- package/script/lock/serializer.d.ts.map +1 -0
- package/script/lock/serializer.js +107 -0
- package/script/mod.d.ts +16 -9
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +111 -38
- package/script/model/attributes.d.ts +6 -0
- package/script/model/attributes.d.ts.map +1 -1
- package/script/model/attributes.js +38 -1
- package/script/model/discipline.d.ts +53 -0
- package/script/model/discipline.d.ts.map +1 -0
- package/script/model/discipline.js +53 -0
- package/script/model/mod.d.ts +188 -30
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +48 -1
- package/script/model/profile.d.ts +69 -0
- package/script/model/profile.d.ts.map +1 -1
- package/script/parser/attributes.d.ts.map +1 -1
- package/script/parser/attributes.js +1 -10
- package/script/parser/body_tokens.d.ts +35 -0
- package/script/parser/body_tokens.d.ts.map +1 -0
- package/script/parser/body_tokens.js +235 -0
- package/script/parser/glossary.d.ts +8 -0
- package/script/parser/glossary.d.ts.map +1 -1
- package/script/parser/glossary.js +7 -4
- package/script/parser/grammars.d.ts +5 -3
- package/script/parser/grammars.d.ts.map +1 -1
- package/script/parser/grammars.js +21 -8
- package/script/parser/language_spec.d.ts +55 -0
- package/script/parser/language_spec.d.ts.map +1 -0
- package/script/parser/language_spec.js +423 -0
- package/script/parser/line_map.d.ts +60 -0
- package/script/parser/line_map.d.ts.map +1 -0
- package/script/parser/line_map.js +44 -0
- package/script/parser/markdown.d.ts +9 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +95 -29
- package/script/parser/mod.d.ts +4 -0
- package/script/parser/mod.d.ts.map +1 -1
- package/script/parser/mod.js +32 -7
- package/script/parser/source.d.ts +39 -8
- package/script/parser/source.d.ts.map +1 -1
- package/script/parser/source.js +156 -69
- package/script/parser/translate.d.ts +24 -0
- package/script/parser/translate.d.ts.map +1 -0
- package/script/parser/translate.js +102 -0
- package/script/profile/chain.d.ts +8 -0
- package/script/profile/chain.d.ts.map +1 -1
- package/script/profile/chain.js +29 -1
- package/script/profile/default_profile.d.ts +25 -0
- package/script/profile/default_profile.d.ts.map +1 -0
- package/script/profile/default_profile.js +46 -0
- package/script/profile/discipline_mode.d.ts +64 -0
- package/script/profile/discipline_mode.d.ts.map +1 -0
- package/script/profile/discipline_mode.js +138 -0
- package/script/profile/discipline_registry.d.ts +41 -0
- package/script/profile/discipline_registry.d.ts.map +1 -0
- package/script/profile/discipline_registry.js +70 -0
- package/script/profile/load.d.ts +3 -1
- package/script/profile/load.d.ts.map +1 -1
- package/script/profile/load.js +24 -5
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +252 -19
- package/script/profile/merge.d.ts.map +1 -1
- package/script/profile/merge.js +112 -0
- package/script/profile/mod.d.ts +2 -0
- package/script/profile/mod.d.ts.map +1 -1
- package/script/profile/mod.js +6 -1
- package/script/sync/locked_attributes.d.ts +19 -0
- package/script/sync/locked_attributes.d.ts.map +1 -0
- package/script/sync/locked_attributes.js +30 -0
- package/script/sync/log.d.ts +34 -0
- package/script/sync/log.d.ts.map +1 -0
- package/script/sync/log.js +52 -0
- package/script/sync/mapping.d.ts +66 -0
- package/script/sync/mapping.d.ts.map +1 -0
- package/script/sync/mapping.js +169 -0
- package/script/sync/mod.d.ts +16 -0
- package/script/sync/mod.d.ts.map +1 -0
- package/script/sync/mod.js +21 -0
- package/script/sync/status.d.ts +23 -0
- package/script/sync/status.d.ts.map +1 -0
- package/script/sync/status.js +24 -0
- package/script/typl/ast.d.ts +87 -0
- package/script/typl/ast.d.ts.map +1 -0
- package/script/typl/ast.js +24 -0
- package/script/typl/bridge.d.ts +32 -0
- package/script/typl/bridge.d.ts.map +1 -0
- package/script/typl/bridge.js +30 -0
- package/script/typl/bullet.d.ts +34 -0
- package/script/typl/bullet.d.ts.map +1 -0
- package/script/typl/bullet.js +47 -0
- package/script/typl/diagnostics.d.ts +43 -0
- package/script/typl/diagnostics.d.ts.map +1 -0
- package/script/typl/diagnostics.js +65 -0
- package/script/typl/fence.d.ts +31 -0
- package/script/typl/fence.d.ts.map +1 -0
- package/script/typl/fence.js +27 -0
- package/script/typl/grammar.d.ts +20 -0
- package/script/typl/grammar.d.ts.map +1 -0
- package/script/typl/grammar.js +474 -0
- package/script/typl/inline.d.ts +34 -0
- package/script/typl/inline.d.ts.map +1 -0
- package/script/typl/inline.js +51 -0
- package/script/typl/lexer.d.ts +37 -0
- package/script/typl/lexer.d.ts.map +1 -0
- package/script/typl/lexer.js +237 -0
- package/script/typl/mod.d.ts +23 -0
- package/script/typl/mod.d.ts.map +1 -0
- package/script/typl/mod.js +29 -0
- package/script/typl/registry.d.ts +42 -0
- package/script/typl/registry.d.ts.map +1 -0
- package/script/typl/registry.js +29 -0
- package/script/typl/validator.d.ts +29 -0
- package/script/typl/validator.d.ts.map +1 -0
- package/script/typl/validator.js +144 -0
- package/script/util/line_endings.d.ts +33 -0
- package/script/util/line_endings.d.ts.map +1 -0
- package/script/util/line_endings.js +58 -0
- package/script/util/modals.d.ts +29 -0
- package/script/util/modals.d.ts.map +1 -0
- package/script/util/modals.js +42 -0
- package/script/validator/discipline.d.ts +35 -0
- package/script/validator/discipline.d.ts.map +1 -0
- package/script/validator/discipline.js +207 -0
- package/script/validator/mod.d.ts +1 -1
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +23 -1
- package/script/validator/modal_keywords.d.ts +15 -13
- package/script/validator/modal_keywords.d.ts.map +1 -1
- package/script/validator/modal_keywords.js +26 -109
- package/script/validator/pattern.d.ts +15 -8
- package/script/validator/pattern.d.ts.map +1 -1
- package/script/validator/pattern.js +42 -19
- package/script/validator/per_type_attrs.d.ts +2 -2
- package/script/validator/per_type_attrs.d.ts.map +1 -1
- package/script/validator/per_type_attrs.js +2 -2
- package/script/validator/pipeline.d.ts +11 -0
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +40 -17
- package/script/validator/type_resolution.d.ts +3 -3
- package/script/validator/type_resolution.d.ts.map +1 -1
- package/script/validator/type_resolution.js +31 -9
- package/esm/parser/entity_refs.d.ts +0 -53
- package/esm/parser/entity_refs.d.ts.map +0 -1
- package/esm/parser/entity_refs.js +0 -151
- package/script/parser/entity_refs.d.ts +0 -53
- package/script/parser/entity_refs.d.ts.map +0 -1
- package/script/parser/entity_refs.js +0 -155
package/esm/compiler/mod.js
CHANGED
|
@@ -4,10 +4,102 @@
|
|
|
4
4
|
* Compiler pipeline. Takes file paths, parses all entries, validates them,
|
|
5
5
|
* builds a bidirectional traceability graph, and returns the compiled model.
|
|
6
6
|
*/
|
|
7
|
+
import { makeDisplayId } from "../model/mod.js";
|
|
7
8
|
import { parseFile } from "../parser/mod.js";
|
|
8
|
-
import { classifyEntriesStage, validate } from "../validator/mod.js";
|
|
9
|
+
import { classifyEntriesStage, suppressDeclaredAttrR010, validate, } from "../validator/mod.js";
|
|
10
|
+
import { validateTypl } from "../typl/mod.js";
|
|
11
|
+
import { buildEffectiveDisciplineRegistry } from "../profile/discipline_registry.js";
|
|
12
|
+
import { ATTR_TO_LINK_KIND } from "./constants.js";
|
|
13
|
+
import { classifyDiscipline } from "./discipline_classifier.js";
|
|
9
14
|
import { generateInverses } from "./inverses.js";
|
|
10
15
|
import { checkLinkTargets } from "./link_target.js";
|
|
16
|
+
/**
|
|
17
|
+
* Shape the raw git observations from {@linkcode CompileOptions.gitFile}
|
|
18
|
+
* into an entry's `properties.git`. Enforces the PII gate (contributors
|
|
19
|
+
* dropped unless `withContributors`) and makes the contributor list
|
|
20
|
+
* deterministic (deduplicated + sorted). Returns undefined when there is
|
|
21
|
+
* no git data, so absent history leaves `properties.git` unset rather
|
|
22
|
+
* than emitting an empty object.
|
|
23
|
+
*/
|
|
24
|
+
function resolveGit(raw, withContributors) {
|
|
25
|
+
if (!raw)
|
|
26
|
+
return undefined;
|
|
27
|
+
const git = {};
|
|
28
|
+
if (raw.createdAt)
|
|
29
|
+
git.createdAt = raw.createdAt;
|
|
30
|
+
if (raw.modifiedAt)
|
|
31
|
+
git.modifiedAt = raw.modifiedAt;
|
|
32
|
+
if (raw.revision)
|
|
33
|
+
git.revision = raw.revision;
|
|
34
|
+
if (withContributors && raw.contributors && raw.contributors.length > 0) {
|
|
35
|
+
git.contributors = [...new Set(raw.contributors)].sort();
|
|
36
|
+
}
|
|
37
|
+
return Object.keys(git).length > 0 ? git : undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Project `Entry.source` onto `EntryProperties.source`. Always returns a
|
|
41
|
+
* non-empty object — every entry has a known source category. Markdown
|
|
42
|
+
* entries get `{ type: "markdown" }`; doc-comment entries get the full
|
|
43
|
+
* code-source fan-out (adapter, language, function, rule).
|
|
44
|
+
*/
|
|
45
|
+
function resolveSource(source) {
|
|
46
|
+
if (source.kind === "markdown") {
|
|
47
|
+
return { type: "markdown" };
|
|
48
|
+
}
|
|
49
|
+
if (source.kind === "doc-comment") {
|
|
50
|
+
return {
|
|
51
|
+
type: "code",
|
|
52
|
+
adapter: "tree-sitter",
|
|
53
|
+
language: source.language,
|
|
54
|
+
function: source.function,
|
|
55
|
+
rule: source.rule,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// Exhaustiveness check — adding a third EntrySource variant becomes a
|
|
59
|
+
// compile-time error here, forcing a deliberate decision about its
|
|
60
|
+
// properties.source projection rather than silently inheriting the
|
|
61
|
+
// tree-sitter branch's defaults.
|
|
62
|
+
const _exhaustive = source;
|
|
63
|
+
throw new Error(`unhandled EntrySource: ${JSON.stringify(_exhaustive)}`);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Semaphore for bounded concurrency — limits simultaneous file reads to
|
|
67
|
+
* avoid exhausting OS file-descriptor limits on large projects.
|
|
68
|
+
*
|
|
69
|
+
* Private to this module; not exported.
|
|
70
|
+
*/
|
|
71
|
+
class Semaphore {
|
|
72
|
+
constructor(maxConcurrent) {
|
|
73
|
+
Object.defineProperty(this, "maxConcurrent", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true,
|
|
76
|
+
writable: true,
|
|
77
|
+
value: maxConcurrent
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(this, "queue", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true,
|
|
82
|
+
writable: true,
|
|
83
|
+
value: []
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async acquire() {
|
|
87
|
+
if (this.maxConcurrent > 0) {
|
|
88
|
+
this.maxConcurrent--;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
await new Promise((resolve) => this.queue.push(resolve));
|
|
92
|
+
}
|
|
93
|
+
release() {
|
|
94
|
+
const next = this.queue.shift();
|
|
95
|
+
if (next) {
|
|
96
|
+
next();
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
this.maxConcurrent++;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
11
103
|
/**
|
|
12
104
|
* Compile MarkSpec files from the given paths into a resolved
|
|
13
105
|
* traceability graph.
|
|
@@ -21,45 +113,75 @@ export async function compile(paths, options) {
|
|
|
21
113
|
const allEntries = [];
|
|
22
114
|
const parseDiagnostics = [];
|
|
23
115
|
const documents = new Map();
|
|
24
|
-
// Phase 1: Read and parse all files.
|
|
25
|
-
|
|
26
|
-
|
|
116
|
+
// Phase 1: Read and parse all files with bounded concurrency (16 slots).
|
|
117
|
+
// Using Promise.all avoids sequential I/O latency on large projects while
|
|
118
|
+
// the semaphore prevents exhausting OS file-descriptor limits.
|
|
119
|
+
const sem = new Semaphore(16);
|
|
120
|
+
const fileResults = await Promise.all([...paths].map(async (filePath) => {
|
|
121
|
+
await sem.acquire();
|
|
27
122
|
try {
|
|
28
|
-
content
|
|
123
|
+
let content;
|
|
124
|
+
try {
|
|
125
|
+
content = await read(filePath);
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
return {
|
|
129
|
+
filePath,
|
|
130
|
+
entries: [],
|
|
131
|
+
diagnostics: [{
|
|
132
|
+
code: "MSL-E000",
|
|
133
|
+
severity: "error",
|
|
134
|
+
message: `failed to read file: ${filePath}`,
|
|
135
|
+
location: undefined,
|
|
136
|
+
}],
|
|
137
|
+
document: undefined,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
const result = await parseFile(content, { file: filePath });
|
|
141
|
+
const stat = options.statFile
|
|
142
|
+
? await options.statFile(filePath)
|
|
143
|
+
: undefined;
|
|
144
|
+
const mtimeStr = stat?.mtime ? stat.mtime.toISOString() : undefined;
|
|
145
|
+
const git = resolveGit(options.gitFile ? await options.gitFile(filePath) : undefined, options.withContributors ?? false);
|
|
146
|
+
const annotatedEntries = result.entries.map((entry) => ({
|
|
147
|
+
...entry,
|
|
148
|
+
properties: {
|
|
149
|
+
...entry.properties,
|
|
150
|
+
file: {
|
|
151
|
+
path: filePath,
|
|
152
|
+
line: entry.location.line,
|
|
153
|
+
column: entry.location.column,
|
|
154
|
+
mtime: mtimeStr,
|
|
155
|
+
},
|
|
156
|
+
...(git ? { git } : {}),
|
|
157
|
+
source: resolveSource(entry.source), // NEW — always set
|
|
158
|
+
},
|
|
159
|
+
}));
|
|
160
|
+
return {
|
|
161
|
+
filePath,
|
|
162
|
+
entries: annotatedEntries,
|
|
163
|
+
diagnostics: [...result.diagnostics],
|
|
164
|
+
document: result.document,
|
|
165
|
+
};
|
|
29
166
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
code: "MSL-E000",
|
|
33
|
-
severity: "error",
|
|
34
|
-
message: `failed to read file: ${filePath}`,
|
|
35
|
-
location: undefined,
|
|
36
|
-
});
|
|
37
|
-
continue;
|
|
167
|
+
finally {
|
|
168
|
+
sem.release();
|
|
38
169
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
...entry.properties,
|
|
48
|
-
file: {
|
|
49
|
-
path: filePath,
|
|
50
|
-
line: entry.location.line,
|
|
51
|
-
column: entry.location.column,
|
|
52
|
-
mtime: mtimeStr,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
}));
|
|
56
|
-
allEntries.push(...annotatedEntries);
|
|
57
|
-
parseDiagnostics.push(...result.diagnostics);
|
|
58
|
-
if (result.document)
|
|
59
|
-
documents.set(filePath, result.document);
|
|
170
|
+
}));
|
|
171
|
+
for (const res of fileResults) {
|
|
172
|
+
if (!res)
|
|
173
|
+
continue;
|
|
174
|
+
allEntries.push(...res.entries);
|
|
175
|
+
parseDiagnostics.push(...res.diagnostics);
|
|
176
|
+
if (res.document)
|
|
177
|
+
documents.set(res.filePath, res.document);
|
|
60
178
|
}
|
|
61
|
-
// Phase 2: Validate all entries.
|
|
179
|
+
// Phase 2: Validate all entries. When a profile is loaded, suppress the
|
|
180
|
+
// core-only MSL-R010 "unknown attribute" warnings for attributes the profile
|
|
181
|
+
// declares — mirrors runPipeline's Stage 1 so LSP/MCP diagnostics match the
|
|
182
|
+
// `validate` command instead of flooding the editor with false positives.
|
|
62
183
|
const validationResult = validate(allEntries);
|
|
184
|
+
const validationDiagnostics = suppressDeclaredAttrR010(validationResult.diagnostics, allEntries, options.profile ?? null);
|
|
63
185
|
// Phase 2.5: Classify entries when a profile is loaded.
|
|
64
186
|
let classifiedEntries = allEntries;
|
|
65
187
|
if (options.profile) {
|
|
@@ -88,18 +210,48 @@ export async function compile(paths, options) {
|
|
|
88
210
|
}
|
|
89
211
|
}
|
|
90
212
|
}
|
|
213
|
+
// Phase 4: Classify each entry's discipline per ADR-017 Invariant 1
|
|
214
|
+
// (channels 3 + 4 + default — override and freeze ship in Slice 3).
|
|
215
|
+
// The effective registry is built once per compile() from the active
|
|
216
|
+
// profile chain; null falls back to the core seed.
|
|
217
|
+
{
|
|
218
|
+
const registry = buildEffectiveDisciplineRegistry(options.profile ?? null);
|
|
219
|
+
const classified = [];
|
|
220
|
+
for (const entry of entries.values()) {
|
|
221
|
+
const discipline = classifyDiscipline(entry, entries, registry);
|
|
222
|
+
classified.push({ ...entry, derivedDiscipline: discipline });
|
|
223
|
+
}
|
|
224
|
+
entries.clear();
|
|
225
|
+
for (const entry of classified) {
|
|
226
|
+
entries.set(entry.displayId, entry);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
91
229
|
const authoredLinks = extractLinks([...entries.values()]);
|
|
92
230
|
const links = [...authoredLinks, ...generatedLinks];
|
|
93
231
|
// MSL-T013: check link targets for draft/retired state.
|
|
94
232
|
const linkTargetDiags = checkLinkTargets(entries, links);
|
|
95
233
|
const forward = buildAdjacency(links, (l) => l.from);
|
|
96
234
|
const reverse = buildAdjacency(links, (l) => l.to);
|
|
235
|
+
// Build the corpus typl registry. validateTypl is also called inside
|
|
236
|
+
// validate() (via validationDiagnostics) for the cross-entry TYPL
|
|
237
|
+
// diagnostics. Here we call it again only to capture the registry — the
|
|
238
|
+
// diagnostics are already included in validationDiagnostics, so we discard
|
|
239
|
+
// them to avoid duplicates in the output.
|
|
240
|
+
const { registry: typeRegistry } = validateTypl([...entries.values()]);
|
|
97
241
|
const diagnostics = [
|
|
98
242
|
...parseDiagnostics,
|
|
99
|
-
...
|
|
243
|
+
...validationDiagnostics,
|
|
100
244
|
...linkTargetDiags,
|
|
101
245
|
];
|
|
102
|
-
return {
|
|
246
|
+
return {
|
|
247
|
+
entries,
|
|
248
|
+
links,
|
|
249
|
+
forward,
|
|
250
|
+
reverse,
|
|
251
|
+
documents,
|
|
252
|
+
diagnostics,
|
|
253
|
+
typeRegistry,
|
|
254
|
+
};
|
|
103
255
|
}
|
|
104
256
|
/** Extract traceability links from entry attributes. */
|
|
105
257
|
function extractLinks(entries) {
|
|
@@ -127,41 +279,22 @@ function extractLinksFromAttribute(from, key, value, location) {
|
|
|
127
279
|
if (!kind)
|
|
128
280
|
return [];
|
|
129
281
|
if (LOCATOR_BEARING_ATTRS.has(key)) {
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
282
|
+
// Comma-separated targets, each "ID §section": split the list (these
|
|
283
|
+
// attributes are 0..N), then take the leading ID token of each value,
|
|
284
|
+
// dropping the optional free-text locator.
|
|
285
|
+
return value
|
|
286
|
+
.split(",")
|
|
287
|
+
.map((s) => s.trim().split(/\s/)[0])
|
|
288
|
+
.filter((s) => s.length > 0)
|
|
289
|
+
.map((to) => ({ from, to: makeDisplayId(to), kind, location }));
|
|
136
290
|
}
|
|
137
291
|
// Comma-separated targets for id-list attributes.
|
|
138
292
|
return value
|
|
139
293
|
.split(",")
|
|
140
294
|
.map((s) => s.trim())
|
|
141
295
|
.filter((s) => s.length > 0)
|
|
142
|
-
.map((to) => ({ from, to, kind, location }));
|
|
296
|
+
.map((to) => ({ from, to: makeDisplayId(to), kind, location }));
|
|
143
297
|
}
|
|
144
|
-
/**
|
|
145
|
-
* Attribute keys that produce traceability links per ADR-002.
|
|
146
|
-
*
|
|
147
|
-
* Spec attributes: Satisfies, Derived-from, References, Allocated-to.
|
|
148
|
-
* Test attributes: Verifies, Tests.
|
|
149
|
-
* Element attributes: Realizes, Depends-on, Part-of, Generated-from.
|
|
150
|
-
* Universal: Supersedes (same-family).
|
|
151
|
-
*/
|
|
152
|
-
const ATTR_TO_LINK_KIND = {
|
|
153
|
-
"Satisfies": "satisfies",
|
|
154
|
-
"Derived-from": "derived-from",
|
|
155
|
-
"References": "references",
|
|
156
|
-
"Allocated-to": "allocated-to",
|
|
157
|
-
"Realizes": "realizes",
|
|
158
|
-
"Verifies": "verifies",
|
|
159
|
-
"Tests": "tests",
|
|
160
|
-
"Depends-on": "depends-on",
|
|
161
|
-
"Part-of": "part-of",
|
|
162
|
-
"Generated-from": "generated-from",
|
|
163
|
-
"Supersedes": "supersedes",
|
|
164
|
-
};
|
|
165
298
|
/** Build an adjacency map from links using a key selector. */
|
|
166
299
|
function buildAdjacency(links, keyFn) {
|
|
167
300
|
const map = new Map();
|
package/esm/compiler/schema.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { CompileResult } from "./mod.js";
|
|
9
9
|
import type { Diagnostic, Entry, Link } from "../model/mod.js";
|
|
10
|
+
import type { RegistryBinding, RegistryTypedef } from "../typl/mod.js";
|
|
10
11
|
/**
|
|
11
12
|
* JSON-serializable form of {@linkcode Entry}.
|
|
12
13
|
*
|
|
@@ -17,6 +18,18 @@ import type { Diagnostic, Entry, Link } from "../model/mod.js";
|
|
|
17
18
|
export type SerializedEntry = Omit<Entry, "typedAttributes"> & {
|
|
18
19
|
readonly typedAttributes?: Record<string, readonly string[]>;
|
|
19
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Serialized form of the {@linkcode TypeRegistry}.
|
|
23
|
+
*
|
|
24
|
+
* `ReadonlyMap` fields are converted to plain objects so the result is
|
|
25
|
+
* JSON-serializable.
|
|
26
|
+
*/
|
|
27
|
+
export interface SerializedTypeRegistry {
|
|
28
|
+
/** Keyed by $Name (including leading `$`). */
|
|
29
|
+
readonly bindings: Record<string, readonly RegistryBinding[]>;
|
|
30
|
+
/** Keyed by typedef name (no `$`). */
|
|
31
|
+
readonly typedefs: Record<string, readonly RegistryTypedef[]>;
|
|
32
|
+
}
|
|
20
33
|
/**
|
|
21
34
|
* Serialized form of {@linkcode CompileResult}.
|
|
22
35
|
*
|
|
@@ -34,6 +47,8 @@ export interface SerializedCompileResult {
|
|
|
34
47
|
readonly reverse: Record<string, readonly Link[]>;
|
|
35
48
|
/** Diagnostics from parsing and validation. */
|
|
36
49
|
readonly diagnostics: readonly Diagnostic[];
|
|
50
|
+
/** Corpus-wide typl type registry. */
|
|
51
|
+
readonly typeRegistry: SerializedTypeRegistry;
|
|
37
52
|
}
|
|
38
53
|
/**
|
|
39
54
|
* Convert a {@linkcode CompileResult} to a plain JSON-serializable object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/compiler/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/compiler/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,iBAAiB,CAAC,GAAG;IAC7D,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;CAC9D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC,CAAC;IAC9D,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC,CAAC;CAC/D;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,mCAAmC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAClD,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;IAClD,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;IAClD,+CAA+C;IAC/C,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,sCAAsC;IACtC,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAC;CAC/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,aAAa,GACpB,uBAAuB,CAazB;AAgBD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,CAoB5D"}
|
package/esm/compiler/schema.js
CHANGED
|
@@ -25,6 +25,18 @@ export function serializeCompileResult(result) {
|
|
|
25
25
|
forward: Object.fromEntries(result.forward),
|
|
26
26
|
reverse: Object.fromEntries(result.reverse),
|
|
27
27
|
diagnostics: result.diagnostics,
|
|
28
|
+
typeRegistry: serializeTypeRegistry(result.typeRegistry),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Convert the {@linkcode TypeRegistry} Maps to plain objects for
|
|
33
|
+
* JSON serialization. `ReadonlyMap` serializes as `{}` in `JSON.stringify`,
|
|
34
|
+
* so explicit conversion is required.
|
|
35
|
+
*/
|
|
36
|
+
function serializeTypeRegistry(registry) {
|
|
37
|
+
return {
|
|
38
|
+
bindings: Object.fromEntries(registry.bindings),
|
|
39
|
+
typedefs: Object.fromEntries(registry.typedefs),
|
|
28
40
|
};
|
|
29
41
|
}
|
|
30
42
|
/**
|
package/esm/config/markspec.d.ts
CHANGED
|
@@ -22,6 +22,11 @@ export declare function readMarkspecYaml(projectRoot: string, readFile: ReadFile
|
|
|
22
22
|
/** The parsed content of a `.markspec.yaml`. */
|
|
23
23
|
export interface MarkspecYaml {
|
|
24
24
|
readonly profiles: readonly ProfileSpecifier[];
|
|
25
|
+
/**
|
|
26
|
+
* Opt out of the bundled default profile when explicitly `false`.
|
|
27
|
+
* `undefined` (key absent) means the default is active.
|
|
28
|
+
*/
|
|
29
|
+
readonly defaultProfile?: boolean;
|
|
25
30
|
}
|
|
26
31
|
/** Result of parsing a `.markspec.yaml` string. */
|
|
27
32
|
export interface ParseMarkspecYamlResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markspec.d.ts","sourceRoot":"","sources":["../../src/config/markspec.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACpE,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;AAMD,gDAAgD;AAChD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"markspec.d.ts","sourceRoot":"","sources":["../../src/config/markspec.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACpE,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;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;CACnC;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;AAID;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,uBAAuB,CA8FzB;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"}
|
package/esm/config/markspec.js
CHANGED
|
@@ -23,7 +23,7 @@ export async function readMarkspecYaml(projectRoot, readFile) {
|
|
|
23
23
|
const content = await readFile(path);
|
|
24
24
|
return content ?? null;
|
|
25
25
|
}
|
|
26
|
-
const ALLOWED_MARKSPEC_YAML_KEYS = new Set(["profiles"]);
|
|
26
|
+
const ALLOWED_MARKSPEC_YAML_KEYS = new Set(["profiles", "default-profile"]);
|
|
27
27
|
/**
|
|
28
28
|
* Parse and validate a `.markspec.yaml` string.
|
|
29
29
|
*
|
|
@@ -91,12 +91,27 @@ export function parseMarkspecYaml(rawYaml, sourcePath) {
|
|
|
91
91
|
profiles.push(spec);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
// default-profile: optional boolean opt-out for the bundled default.
|
|
95
|
+
let defaultProfile;
|
|
96
|
+
const rawDefaultProfile = root["default-profile"];
|
|
97
|
+
if (rawDefaultProfile !== undefined) {
|
|
98
|
+
if (typeof rawDefaultProfile !== "boolean") {
|
|
99
|
+
diagnostics.push({
|
|
100
|
+
code: "MARKSPEC-YAML-003",
|
|
101
|
+
severity: "error",
|
|
102
|
+
message: ".markspec.yaml: 'default-profile' must be a boolean",
|
|
103
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
104
|
+
});
|
|
105
|
+
return { config: null, diagnostics };
|
|
106
|
+
}
|
|
107
|
+
defaultProfile = rawDefaultProfile;
|
|
108
|
+
}
|
|
94
109
|
// If any specifier failed to parse, treat the whole file as invalid.
|
|
95
110
|
const hasErrors = diagnostics.some((d) => d.severity === "error");
|
|
96
111
|
if (hasErrors) {
|
|
97
112
|
return { config: null, diagnostics };
|
|
98
113
|
}
|
|
99
|
-
return { config: { profiles }, diagnostics };
|
|
114
|
+
return { config: { profiles, defaultProfile }, diagnostics };
|
|
100
115
|
}
|
|
101
116
|
/**
|
|
102
117
|
* Parse a single specifier string into a {@linkcode ProfileSpecifier}.
|
package/esm/formatter/mod.d.ts
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
import type { Attribute, Diagnostic } from "../model/mod.js";
|
|
9
9
|
/**
|
|
10
10
|
* Decide whether the EARS keyword at `offset` in `line` is at sentence
|
|
11
|
-
* start (return value true).
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* start (return value true). Delegates to the shared implementation in
|
|
12
|
+
* `core/util/modals.ts`; re-exported here for backward compatibility with
|
|
13
|
+
* existing callers and tests that import from `formatter/mod.ts`.
|
|
14
14
|
*/
|
|
15
15
|
export declare function isSentenceInitial(line: string, offset: number): boolean;
|
|
16
16
|
/**
|
|
@@ -43,6 +43,12 @@ export interface FormatOptions {
|
|
|
43
43
|
readonly file?: string;
|
|
44
44
|
/** ULID generator override (for testing). */
|
|
45
45
|
readonly generateUlid?: () => string;
|
|
46
|
+
/**
|
|
47
|
+
* Override the "today" date used by the Discipline-frozen: stamper.
|
|
48
|
+
* Returned value must be a `YYYY-MM-DD` string in UTC. Default: today.
|
|
49
|
+
* Injectable for deterministic tests.
|
|
50
|
+
*/
|
|
51
|
+
readonly today?: () => string;
|
|
46
52
|
}
|
|
47
53
|
/** Result of a format operation. */
|
|
48
54
|
export interface FormatResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/formatter/mod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EAGX,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/formatter/mod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EAGX,MAAM,iBAAiB,CAAC;AA0BzB;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAc/D;AA0OD,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;CAC/B;AAED,oCAAoC;AACpC,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AA2BD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,aAAa,GACtB,YAAY,CAqLd;AA4DD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAmB/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,SAAS,EAAE,GACtB,SAAS,EAAE,CA2Bb;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,SAAS,EAAE,EACvB,MAAM,EAAE,MAAM,GACb,MAAM,CAKR;AA2BD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA2B5C"}
|