@cratis/screenplay-language 4.124.0 → 4.125.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 +50 -0
- package/dist/bundles/TypeReferenceSymbol.js +2 -0
- package/dist/bundles/TypeReferenceSymbol.js.map +1 -0
- package/dist/bundles/_virtual/_virtual/_rolldown/runtime.js +1 -0
- package/dist/bundles/bmp-word-characters.js +2 -0
- package/dist/bundles/bmp-word-characters.js.map +1 -0
- package/dist/bundles/case-authoring.js +3 -0
- package/dist/bundles/case-authoring.js.map +1 -0
- package/dist/bundles/code-actions.js +2 -0
- package/dist/bundles/code-actions.js.map +1 -0
- package/dist/bundles/compiler/Authoring/QuickFixes.js +5 -0
- package/dist/bundles/compiler/Authoring/QuickFixes.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/DeclaredDependencies.js +2 -0
- package/dist/bundles/compiler/Dependencies/DeclaredDependencies.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/DeclaredDependencyTargets.js +2 -0
- package/dist/bundles/compiler/Dependencies/DeclaredDependencyTargets.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/DependencyGraph.js +2 -0
- package/dist/bundles/compiler/Dependencies/DependencyGraph.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/DependencyKind.js +2 -0
- package/dist/bundles/compiler/Dependencies/DependencyKind.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/InvalidDependencyQuery.js +2 -0
- package/dist/bundles/compiler/Dependencies/InvalidDependencyQuery.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/SliceReferences.js +2 -0
- package/dist/bundles/compiler/Dependencies/SliceReferences.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/StronglyConnectedGroups.js +2 -0
- package/dist/bundles/compiler/Dependencies/StronglyConnectedGroups.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/index.js +1 -0
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +2 -0
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -0
- package/dist/bundles/compiler/Diagnostics/ProductionDestinationDiagnostics.js +2 -0
- package/dist/bundles/compiler/Diagnostics/ProductionDestinationDiagnostics.js.map +1 -0
- package/dist/bundles/compiler/Diagnostics/SourceLocation.js +2 -0
- package/dist/bundles/compiler/Diagnostics/SourceLocation.js.map +1 -0
- package/dist/bundles/compiler/Files/AuthoredOrder.js +2 -0
- package/dist/bundles/compiler/Files/AuthoredOrder.js.map +1 -0
- package/dist/bundles/compiler/Files/OrderingRoot.js +1 -0
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +2 -0
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayFolderMerge.js +2 -0
- package/dist/bundles/compiler/Files/PlayFolderMerge.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayImports.js +1 -0
- package/dist/bundles/compiler/Files/PlayPlacement.js +2 -0
- package/dist/bundles/compiler/Files/PlayPlacement.js.map +1 -0
- package/dist/bundles/compiler/Files/TimelineOrder.js +2 -0
- package/dist/bundles/compiler/Files/TimelineOrder.js.map +1 -0
- package/dist/bundles/compiler/Parsing/AuthorizeParser.js +2 -0
- package/dist/bundles/compiler/Parsing/AuthorizeParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CaptureParser.js +2 -0
- package/dist/bundles/compiler/Parsing/CaptureParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CodeBlockParser.js +3 -0
- package/dist/bundles/compiler/Parsing/CodeBlockParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CommandDestinationTypes.js +2 -0
- package/dist/bundles/compiler/Parsing/CommandDestinationTypes.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CommandParser.js +2 -0
- package/dist/bundles/compiler/Parsing/CommandParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CommandReadSources.js +2 -0
- package/dist/bundles/compiler/Parsing/CommandReadSources.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CommandResponseParser.js +2 -0
- package/dist/bundles/compiler/Parsing/CommandResponseParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CommandStreamCandidates.js +2 -0
- package/dist/bundles/compiler/Parsing/CommandStreamCandidates.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CompositeStreamIdValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/CompositeStreamIdValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/CompositionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/CompositionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ConditionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ConditionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ConstraintParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ConstraintParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ConstraintPropertyValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/ConstraintPropertyValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js +2 -0
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DependencySourceParser.js +2 -0
- package/dist/bundles/compiler/Parsing/DependencySourceParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DependsOnParser.js +2 -0
- package/dist/bundles/compiler/Parsing/DependsOnParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DescriptionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/DescriptionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/DocumentationParser.js +2 -0
- package/dist/bundles/compiler/Parsing/DocumentationParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/EventMetadataParser.js +2 -0
- package/dist/bundles/compiler/Parsing/EventMetadataParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/EventSourceParser.js +2 -0
- package/dist/bundles/compiler/Parsing/EventSourceParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/EventSourceValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/EventSourceValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/EventSubjectValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/EventSubjectValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ExpressionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ExpressionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/FeatureBody.js +2 -0
- package/dist/bundles/compiler/Parsing/FeatureBody.js.map +1 -0
- package/dist/bundles/compiler/Parsing/FileImportParser.js +2 -0
- package/dist/bundles/compiler/Parsing/FileImportParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/FileReferences.js +2 -0
- package/dist/bundles/compiler/Parsing/FileReferences.js.map +1 -0
- package/dist/bundles/compiler/Parsing/GuardedActionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/GuardedActionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/GuardedActionShadowing.js +2 -0
- package/dist/bundles/compiler/Parsing/GuardedActionShadowing.js.map +1 -0
- package/dist/bundles/compiler/Parsing/GuardedActionValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/GuardedActionValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/IdentityParser.js +2 -0
- package/dist/bundles/compiler/Parsing/IdentityParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/IdentityValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/IdentityValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ImplementationParser.js +3 -0
- package/dist/bundles/compiler/Parsing/ImplementationParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ImportDiscovery.js +1 -0
- package/dist/bundles/compiler/Parsing/InlineEventValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/InlineEventValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/InputUses.js +2 -0
- package/dist/bundles/compiler/Parsing/InputUses.js.map +1 -0
- package/dist/bundles/compiler/Parsing/InteractionAlternatives.js +2 -0
- package/dist/bundles/compiler/Parsing/InteractionAlternatives.js.map +1 -0
- package/dist/bundles/compiler/Parsing/LineReader.js +2 -0
- package/dist/bundles/compiler/Parsing/LineReader.js.map +1 -0
- package/dist/bundles/compiler/Parsing/LineText.js +2 -0
- package/dist/bundles/compiler/Parsing/LineText.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ModuleBody.js +2 -0
- package/dist/bundles/compiler/Parsing/ModuleBody.js.map +1 -0
- package/dist/bundles/compiler/Parsing/OperationParser.js +2 -0
- package/dist/bundles/compiler/Parsing/OperationParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/OperationValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/OperationValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ParserContext.js +2 -0
- package/dist/bundles/compiler/Parsing/ParserContext.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PersonaCallerValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/PersonaCallerValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PolicyParser.js +2 -0
- package/dist/bundles/compiler/Parsing/PolicyParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ProducesParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ProducesParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ProjectionExpressionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ProjectionExpressionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ProjectionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ProjectionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ProjectionTargetValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/ProjectionTargetValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PropertyLineParser.js +2 -0
- package/dist/bundles/compiler/Parsing/PropertyLineParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PublicEventMetadataValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/PublicEventMetadataValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PublicEventUsageCollector.js +2 -0
- package/dist/bundles/compiler/Parsing/PublicEventUsageCollector.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PublicEventUsageValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/PublicEventUsageValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PurposeParser.js +2 -0
- package/dist/bundles/compiler/Parsing/PurposeParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/PurposeValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/PurposeValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/QueryParser.js +2 -0
- package/dist/bundles/compiler/Parsing/QueryParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ReactionParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ReactionParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ReactionRefusalValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/ReactionRefusalValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/RedeliveryValues.js +2 -0
- package/dist/bundles/compiler/Parsing/RedeliveryValues.js.map +1 -0
- package/dist/bundles/compiler/Parsing/RefusalDeclarations.js +2 -0
- package/dist/bundles/compiler/Parsing/RefusalDeclarations.js.map +1 -0
- package/dist/bundles/compiler/Parsing/RefusalValueWalker.js +2 -0
- package/dist/bundles/compiler/Parsing/RefusalValueWalker.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ResponseDateValues.js +2 -0
- package/dist/bundles/compiler/Parsing/ResponseDateValues.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ResponseValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/ResponseValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ScreenParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ScreenParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js +2 -0
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SeedParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SeedParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SliceParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SliceParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SourceLine.js +2 -0
- package/dist/bundles/compiler/Parsing/SourceLine.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SourceLineSplitter.js +3 -0
- package/dist/bundles/compiler/Parsing/SourceLineSplitter.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SourceOptionsParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SourceOptionsParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationCaseValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationCaseValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationRedeliveryValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationRedeliveryValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationRouteComparison.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationRouteComparison.js.map +1 -0
- package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js +2 -0
- package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js.map +1 -0
- package/dist/bundles/compiler/Parsing/StructuredValueParser.js +3 -0
- package/dist/bundles/compiler/Parsing/StructuredValueParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/TriggerDataParser.js +2 -0
- package/dist/bundles/compiler/Parsing/TriggerDataParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/UiBindingParser.js +2 -0
- package/dist/bundles/compiler/Parsing/UiBindingParser.js.map +1 -0
- package/dist/bundles/compiler/ScreenplayCompiler.js +2 -0
- package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -0
- package/dist/bundles/compiler/Syntax/AuthoringProductionResolver.js +2 -0
- package/dist/bundles/compiler/Syntax/AuthoringProductionResolver.js.map +1 -0
- package/dist/bundles/compiler/Syntax/CaptureEventsSource.js +2 -0
- package/dist/bundles/compiler/Syntax/CaptureEventsSource.js.map +1 -0
- package/dist/bundles/compiler/Syntax/DependencySources.js +2 -0
- package/dist/bundles/compiler/Syntax/DependencySources.js.map +1 -0
- package/dist/bundles/compiler/Syntax/EventDeclarations.js +2 -0
- package/dist/bundles/compiler/Syntax/EventDeclarations.js.map +1 -0
- package/dist/bundles/compiler/Syntax/EventSourceCatalog.js +2 -0
- package/dist/bundles/compiler/Syntax/EventSourceCatalog.js.map +1 -0
- package/dist/bundles/compiler/Syntax/EventSourceReadConfidence.js +2 -0
- package/dist/bundles/compiler/Syntax/EventSourceReadConfidence.js.map +1 -0
- package/dist/bundles/compiler/Syntax/ExactMathFacts.js +2 -0
- package/dist/bundles/compiler/Syntax/ExactMathFacts.js.map +1 -0
- package/dist/bundles/compiler/Syntax/ExactNumber.js +2 -0
- package/dist/bundles/compiler/Syntax/ExactNumber.js.map +1 -0
- package/dist/bundles/compiler/Syntax/InvalidSyntaxJson.js +2 -0
- package/dist/bundles/compiler/Syntax/InvalidSyntaxJson.js.map +1 -0
- package/dist/bundles/compiler/Syntax/LegacyWireProjection.js +2 -0
- package/dist/bundles/compiler/Syntax/LegacyWireProjection.js.map +1 -0
- package/dist/bundles/compiler/Syntax/Operations.js +2 -0
- package/dist/bundles/compiler/Syntax/Operations.js.map +1 -0
- package/dist/bundles/compiler/Syntax/PersonaCallers.js +2 -0
- package/dist/bundles/compiler/Syntax/PersonaCallers.js.map +1 -0
- package/dist/bundles/compiler/Syntax/ProductionDestinations.js +2 -0
- package/dist/bundles/compiler/Syntax/ProductionDestinations.js.map +1 -0
- package/dist/bundles/compiler/Syntax/PublicEventInvariants.js +2 -0
- package/dist/bundles/compiler/Syntax/PublicEventInvariants.js.map +1 -0
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js +2 -0
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SourceOptions.js +2 -0
- package/dist/bundles/compiler/Syntax/SourceOptions.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SpecificationCaseOrigin.js +2 -0
- package/dist/bundles/compiler/Syntax/SpecificationCaseOrigin.js.map +1 -0
- package/dist/bundles/compiler/Syntax/StreamIdFormatter.js +2 -0
- package/dist/bundles/compiler/Syntax/StreamIdFormatter.js.map +1 -0
- package/dist/bundles/compiler/Syntax/StrictSyntaxJson.js +1 -0
- package/dist/bundles/compiler/Syntax/Structure.js +2 -0
- package/dist/bundles/compiler/Syntax/Structure.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js +2 -0
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SyntaxInvariants.js +2 -0
- package/dist/bundles/compiler/Syntax/SyntaxInvariants.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SyntaxJson.js +2 -0
- package/dist/bundles/compiler/Syntax/SyntaxJson.js.map +1 -0
- package/dist/bundles/compiler/Syntax/SyntaxMemberContracts.js +2 -0
- package/dist/bundles/compiler/Syntax/SyntaxMemberContracts.js.map +1 -0
- package/dist/bundles/compiler/Syntax/index.js +1 -0
- package/dist/bundles/compiler/Text/ImplementationHintText.js +2 -0
- package/dist/bundles/compiler/Text/ImplementationHintText.js.map +1 -0
- package/dist/bundles/compiler/Text/ReservedWords.js +2 -0
- package/dist/bundles/compiler/Text/ReservedWords.js.map +1 -0
- package/dist/bundles/compiler/Text/SourceStreamNames.js +2 -0
- package/dist/bundles/compiler/Text/SourceStreamNames.js.map +1 -0
- package/dist/bundles/compiler/Text/StringLiteral.js +3 -0
- package/dist/bundles/compiler/Text/StringLiteral.js.map +1 -0
- package/dist/bundles/compiler/Text/ordinalIgnoreCaseKey.js +2 -0
- package/dist/bundles/compiler/Text/ordinalIgnoreCaseKey.js.map +1 -0
- package/dist/bundles/compiler/Text/patterns.js +2 -0
- package/dist/bundles/compiler/Text/patterns.js.map +1 -0
- package/dist/bundles/compiler/index.js +1 -0
- package/dist/bundles/completion-items.js +21 -0
- package/dist/bundles/completion-items.js.map +1 -0
- package/dist/bundles/completion-planner.js +5 -0
- package/dist/bundles/completion-planner.js.map +1 -0
- package/dist/bundles/completions.js +2 -0
- package/dist/bundles/completions.js.map +1 -0
- package/dist/bundles/dependency-completions.js +3 -0
- package/dist/bundles/dependency-completions.js.map +1 -0
- package/dist/bundles/dependency-target-analysis.js +2 -0
- package/dist/bundles/dependency-target-analysis.js.map +1 -0
- package/dist/bundles/diagnostic-codes.js +2 -0
- package/dist/bundles/diagnostic-codes.js.map +1 -0
- package/dist/bundles/diagnostics.js +2 -0
- package/dist/bundles/diagnostics.js.map +1 -0
- package/dist/bundles/document-context.js +2 -0
- package/dist/bundles/document-context.js.map +1 -0
- package/dist/bundles/documentation-item.js +2 -0
- package/dist/bundles/documentation-item.js.map +1 -0
- package/dist/bundles/event-analysis-source.js +2 -0
- package/dist/bundles/event-analysis-source.js.map +1 -0
- package/dist/bundles/event-context-catalog.js +2 -0
- package/dist/bundles/event-context-catalog.js.map +1 -0
- package/dist/bundles/event-context.js +4 -0
- package/dist/bundles/event-context.js.map +1 -0
- package/dist/bundles/event-source-authoring.js +13 -0
- package/dist/bundles/event-source-authoring.js.map +1 -0
- package/dist/bundles/example-analysis.js +3 -0
- package/dist/bundles/example-analysis.js.map +1 -0
- package/dist/bundles/example-authoring.js +3 -0
- package/dist/bundles/example-authoring.js.map +1 -0
- package/dist/bundles/example-declaration-items.js +2 -0
- package/dist/bundles/example-declaration-items.js.map +1 -0
- package/dist/bundles/example-values.js +2 -0
- package/dist/bundles/example-values.js.map +1 -0
- package/dist/bundles/file-imports.js +2 -0
- package/dist/bundles/file-imports.js.map +1 -0
- package/dist/bundles/file-references.js +2 -0
- package/dist/bundles/file-references.js.map +1 -0
- package/dist/bundles/hover-content.js +6 -0
- package/dist/bundles/hover-content.js.map +1 -0
- package/dist/bundles/hover.js +2 -0
- package/dist/bundles/hover.js.map +1 -0
- package/dist/bundles/index.js +2 -104
- package/dist/bundles/index.js.map +1 -7
- package/dist/bundles/inlay-hints.js +2 -0
- package/dist/bundles/inlay-hints.js.map +1 -0
- package/dist/bundles/inline-completions.js +2 -0
- package/dist/bundles/inline-completions.js.map +1 -0
- package/dist/bundles/inline-event-validation.js +2 -0
- package/dist/bundles/inline-event-validation.js.map +1 -0
- package/dist/bundles/keyword-docs.js +2 -0
- package/dist/bundles/keyword-docs.js.map +1 -0
- package/dist/bundles/language.js +2 -0
- package/dist/bundles/language.js.map +1 -0
- package/dist/bundles/named-rule-context.js +2 -0
- package/dist/bundles/named-rule-context.js.map +1 -0
- package/dist/bundles/operation-authoring.js +7 -0
- package/dist/bundles/operation-authoring.js.map +1 -0
- package/dist/bundles/persona-analysis.js +2 -0
- package/dist/bundles/persona-analysis.js.map +1 -0
- package/dist/bundles/production-destinations.js +2 -0
- package/dist/bundles/production-destinations.js.map +1 -0
- package/dist/bundles/purpose-items.js +2 -0
- package/dist/bundles/purpose-items.js.map +1 -0
- package/dist/bundles/reaction-authoring.js +5 -0
- package/dist/bundles/reaction-authoring.js.map +1 -0
- package/dist/bundles/refusal-context.js +2 -0
- package/dist/bundles/refusal-context.js.map +1 -0
- package/dist/bundles/response-analysis.js +7 -0
- package/dist/bundles/response-analysis.js.map +1 -0
- package/dist/bundles/response-completions.js +2 -0
- package/dist/bundles/response-completions.js.map +1 -0
- package/dist/bundles/response-tokens.js +3 -0
- package/dist/bundles/response-tokens.js.map +1 -0
- package/dist/bundles/scope-items.js +18 -0
- package/dist/bundles/scope-items.js.map +1 -0
- package/dist/bundles/structure-completions.js +7 -0
- package/dist/bundles/structure-completions.js.map +1 -0
- package/dist/bundles/sub-language-registry.js +2 -0
- package/dist/bundles/sub-language-registry.js.map +1 -0
- package/dist/bundles/sub-languages/capture/CompletionProvider.js +2 -0
- package/dist/bundles/sub-languages/capture/CompletionProvider.js.map +1 -0
- package/dist/bundles/sub-languages/capture/HoverProvider.js +60 -0
- package/dist/bundles/sub-languages/capture/HoverProvider.js.map +1 -0
- package/dist/bundles/sub-languages/capture/Validator.js +2 -0
- package/dist/bundles/sub-languages/capture/Validator.js.map +1 -0
- package/dist/bundles/sub-languages/capture/index.js +2 -40
- package/dist/bundles/sub-languages/capture/index.js.map +1 -7
- package/dist/bundles/sub-languages/capture/language.js +2 -0
- package/dist/bundles/sub-languages/capture/language.js.map +1 -0
- package/dist/bundles/sub-languages/cdl.js +2 -0
- package/dist/bundles/sub-languages/cdl.js.map +1 -0
- package/dist/bundles/sub-languages/pdl.js +2 -0
- package/dist/bundles/sub-languages/pdl.js.map +1 -0
- package/dist/bundles/sub-languages/projection/CodeActionProvider.js +2 -0
- package/dist/bundles/sub-languages/projection/CodeActionProvider.js.map +1 -0
- package/dist/bundles/sub-languages/projection/CompletionProvider.js +2 -0
- package/dist/bundles/sub-languages/projection/CompletionProvider.js.map +1 -0
- package/dist/bundles/sub-languages/projection/HoverProvider.js +43 -0
- package/dist/bundles/sub-languages/projection/HoverProvider.js.map +1 -0
- package/dist/bundles/sub-languages/projection/Validator.js +5 -0
- package/dist/bundles/sub-languages/projection/Validator.js.map +1 -0
- package/dist/bundles/sub-languages/projection/index.js +3 -75
- package/dist/bundles/sub-languages/projection/index.js.map +1 -7
- package/dist/bundles/sub-languages/projection/language.js +2 -0
- package/dist/bundles/sub-languages/projection/language.js.map +1 -0
- package/dist/bundles/symbols.js +3 -0
- package/dist/bundles/symbols.js.map +1 -0
- package/dist/bundles/themes/screenplay-dark.js +2 -0
- package/dist/bundles/themes/screenplay-dark.js.map +1 -0
- package/dist/bundles/themes/screenplay-light.js +2 -0
- package/dist/bundles/themes/screenplay-light.js.map +1 -0
- package/dist/bundles/tokens.js +2 -0
- package/dist/bundles/tokens.js.map +1 -0
- package/dist/bundles/validation.js +3 -0
- package/dist/bundles/validation.js.map +1 -0
- package/package.json +4 -3
- package/dist/bundles/chunk-7GSRLVHB.js +0 -42
- package/dist/bundles/chunk-7GSRLVHB.js.map +0 -7
- package/dist/bundles/chunk-AYDF3IFZ.js +0 -2
- package/dist/bundles/chunk-AYDF3IFZ.js.map +0 -7
package/README.md
CHANGED
|
@@ -65,3 +65,53 @@ Registration works before or after `register(monaco)`; the tokenizer recomposes
|
|
|
65
65
|
```shell
|
|
66
66
|
yarn build
|
|
67
67
|
```
|
|
68
|
+
|
|
69
|
+
The published runtime is an ES module graph under `dist/bundles/`, not a shared
|
|
70
|
+
prebuilt chunk. The root, capture, and projection entry paths are unchanged.
|
|
71
|
+
Private compiler modules ship as relative files under `dist/bundles/compiler/`;
|
|
72
|
+
consumers do not need to install `@cratis/screenplay-compiler`. Consumers can
|
|
73
|
+
now tree-shake and split these modules using their own bundler configuration.
|
|
74
|
+
Callable names, minification, and source maps are preserved.
|
|
75
|
+
|
|
76
|
+
`check-package.mjs` checks the packed tarball, resolves every public entry with
|
|
77
|
+
only declared peers installed, and prints the ten largest modules, total runtime
|
|
78
|
+
bytes, and the minified size of a consumer importing `register`, `languageId`, and
|
|
79
|
+
`screenplayDarkThemeName`. Runtime sizes exclude declarations and source maps.
|
|
80
|
+
|
|
81
|
+
### Runtime size budget
|
|
82
|
+
|
|
83
|
+
- Every published JavaScript file must be **≤ 500,000 bytes**. This is the consumer
|
|
84
|
+
chunk budget and is never raised; split the module graph rather than growing a
|
|
85
|
+
prebuilt chunk.
|
|
86
|
+
- The total runtime must be **≤ 1,000,000 bytes**. This ceiling approves language
|
|
87
|
+
growth within that limit while guarding against vendored dependencies. Growth
|
|
88
|
+
beyond it requires explicit approval after reviewing the module breakdown,
|
|
89
|
+
not an automatic ceiling increase each release. Monaco remains external.
|
|
90
|
+
- A consumer's final chunks still depend on its bundler's splitting configuration;
|
|
91
|
+
a module graph does not guarantee that a single bundled consumer stays under
|
|
92
|
+
500,000 bytes.
|
|
93
|
+
|
|
94
|
+
The module-graph build initially emits **199 JavaScript files totaling 752,551
|
|
95
|
+
bytes**. Its ten largest modules are:
|
|
96
|
+
|
|
97
|
+
| Module (relative to `dist/bundles/`) | Bytes |
|
|
98
|
+
| --- | ---: |
|
|
99
|
+
| `completion-items.js` | 41,933 |
|
|
100
|
+
| `compiler/Syntax/SyntaxCollections.js` | 29,257 |
|
|
101
|
+
| `keyword-docs.js` | 23,414 |
|
|
102
|
+
| `compiler/Syntax/ScreenplaySyntaxWalker.js` | 20,450 |
|
|
103
|
+
| `compiler/Parsing/SpecificationParser.js` | 19,931 |
|
|
104
|
+
| `compiler/Diagnostics/DiagnosticCodes.js` | 14,235 |
|
|
105
|
+
| `sub-languages/projection/CompletionProvider.js` | 13,391 |
|
|
106
|
+
| `event-source-authoring.js` | 12,877 |
|
|
107
|
+
| `validation.js` | 12,806 |
|
|
108
|
+
| `compiler/Parsing/ScreenParser.js` | 12,351 |
|
|
109
|
+
|
|
110
|
+
The packed consumer smoke import bundles to **601,682 bytes** as a single
|
|
111
|
+
minified module with Monaco external. The breakdown contains no printer or
|
|
112
|
+
MCP-only provenance modules. Syntax serialization initialization is still pulled
|
|
113
|
+
in by compiler barrel exports; removing it requires a separate, behavior-checked
|
|
114
|
+
compiler import cleanup rather than dropping parser validators from the editor.
|
|
115
|
+
|
|
116
|
+
`yarn test:pack` also runs size-check specifications with a planted oversized
|
|
117
|
+
module. The guard must reject it and name its published path.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";function typeReferenceSymbol(e){let t=/^([\w.]+)(\[\])?(\?|\s+optional)?$/.exec(e);return{name:t?.[1]??e,isCollection:t?.[2]!==void 0,isOptional:t?.[3]!==void 0}}function typeReferenceText(e){return`${e.name}${e.isCollection?`[]`:``}${e.isOptional?` optional`:``}`}export{typeReferenceSymbol,typeReferenceText};
|
|
2
|
+
//# sourceMappingURL=TypeReferenceSymbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeReferenceSymbol.js","names":["match","text","type"],"sources":["../../TypeReferenceSymbol.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nexport interface TypeReferenceSymbol {\n readonly name: string;\n readonly isCollection: boolean;\n readonly isOptional: boolean;\n}\n\nexport function typeReferenceSymbol(text: string): TypeReferenceSymbol {\n const match = /^([\\w.]+)(\\[\\])?(\\?|\\s+optional)?$/.exec(text);\n return { name: match?.[1] ?? text, isCollection: match?.[2] !== undefined, isOptional: match?.[3] !== undefined };\n}\n\nexport function typeReferenceText(type: TypeReferenceSymbol): string {\n return `${type.name}${type.isCollection ? '[]' : ''}${type.isOptional ? ' optional' : ''}`;\n}\n"],"mappings":"iDASA,SAAgB,oBAAoB,EAAmC,CACnE,IAAMA,EAAQ,qCAAqC,KAAKC,CAAI,EAC5D,MAAO,CAAE,KAAMD,IAAQ,IAAMC,EAAM,aAAcD,IAAQ,KAAO,IAAA,GAAW,WAAYA,IAAQ,KAAO,IAAA,EAAU,CACpH,CAEA,SAAgB,kBAAkB,EAAmC,CACjE,MAAO,GAAGE,EAAK,OAAOA,EAAK,aAAe,KAAO,KAAKA,EAAK,WAAa,YAAc,IAC1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,__name=(t,n)=>e(t,`name`,{value:n,configurable:!0});export{__name};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";const e=/[\p{L}\p{Mn}\p{Nd}\p{Pc}]/u,escape=e=>`\\u${e.toString(16).padStart(4,`0`)}`;function ranges(){let t=``;for(let n=0;n<=65535;n++){if(!e.test(String.fromCharCode(n)))continue;let r=n;for(;n<65535&&e.test(String.fromCharCode(n+1));)n++;t+=escape(r)+(n>r?`-${escape(n)}`:``)}return t}const t=ranges();export{t as bmpWordCharacters};
|
|
2
|
+
//# sourceMappingURL=bmp-word-characters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bmp-word-characters.js","names":["word","value","result","start","bmpWordCharacters"],"sources":["../../bmp-word-characters.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// .NET regex \\w accepts these categories per UTF-16 code unit, not supplementary code points.\n// Monarch discards a rule's /u flag. Expand just this class into BMP ranges rather than enabling\n// Unicode mode for the entire grammar (which would change legacy regexes and embedded languages).\nconst word = /[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}]/u;\nconst escape = (value: number) => `\\\\u${value.toString(16).padStart(4, '0')}`;\nfunction ranges(): string {\n let result = '';\n for (let value = 0; value <= 0xffff; value++) {\n if (!word.test(String.fromCharCode(value))) continue;\n const start = value;\n while (value < 0xffff && word.test(String.fromCharCode(value + 1))) value++;\n result += escape(start) + (value > start ? `-${escape(value)}` : '');\n }\n return result;\n}\nexport const bmpWordCharacters = ranges();\n"],"mappings":"iDAMA,MAAMA,EAAO,6BACP,OAAU,GAAkB,MAAMC,EAAM,SAAS,EAAE,CAAC,CAAC,SAAS,EAAG,GAAG,IAC1E,SAAS,QAAiB,CACtB,IAAIC,EAAS,GACb,IAAK,IAAID,EAAQ,EAAGA,GAAS,MAAQ,IAAS,CAC1C,GAAI,CAACD,EAAK,KAAK,OAAO,aAAaC,CAAK,CAAC,EAAG,SAC5C,IAAME,EAAQF,EACd,KAAOA,EAAQ,OAAUD,EAAK,KAAK,OAAO,aAAaC,EAAQ,CAAC,CAAC,GAAG,IACpE,GAAU,OAAOE,CAAK,GAAKF,EAAQE,EAAQ,IAAI,OAAOF,CAAK,IAAM,GACrE,CACA,OAAOC,CACX,CACA,MAAaE,EAAoB,OAAO"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{enclosingHeaders as e,fenceMap as t,indentOf as n}from"./document-context.js";import{responseAnalysis as r}from"./response-analysis.js";function enclosing(i,a){let o=e(i,t(i),a,n(i[a]));if(o.some(e=>e.startsWith(`specification `))&&!o.some(e=>/^(?:case|given caller|when redelivered)\b/.test(e)))return[...r(i).specifications].filter(([e])=>e<=a).sort(([e],[t])=>t-e)[0]?.[1]}function caseCompletions(e,t,n){if(!/(?:=\s*|for\s+|then\s+error\s+)case\.[\w]*$/.test(n)||/when\s+redelivered|given\s+caller/.test(n)||/^\s*case\b/.test(n))return null;let r=enclosing(e,t);return(r?.cases?.length??0)===0?null:r.parameters?.map(e=>({label:`case.${e.name}`,insertText:`case.${e.name}`,documentation:`Case value of ${e.type.name}${e.type.isCollection?`[]`:``}${e.type.isOptional?` optional`:``}.`}))??[]}function caseHover(e,t,n,r){let i=[...e[t].matchAll(/\bcase\.([a-z_]\w*)\b/g)].find(e=>e.index<r&&e.index+e[0].length>=n);if(i===void 0)return null;let a=enclosing(e,t),o=a?.parameters?.find(e=>e.name===i[1]);if(o===void 0)return null;let s=a.cases?.map(e=>{let t=e.values.find(e=>e.property===o.name)?.source,n=typeof t==`object`&&t&&`value`in t?t.value:t;return`- ${e.name}: \`${JSON.stringify(n)}\``}).join(`
|
|
2
|
+
`);return`**case.${o.name}** — ${o.type.name}\n\nCase origin in **${a.name}**; substitutes after example overrides.\n\n${s??``}`}export{caseCompletions,caseHover};
|
|
3
|
+
//# sourceMappingURL=case-authoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case-authoring.js","names":["headers","enclosingHeaders","lines","fenceMap","line","indentOf","header","responseAnalysis","start","left","right","before","table","parameter","reference","match","end","values","source","row","value"],"sources":["../../case-authoring.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { responseAnalysis } from './response-analysis';\nimport { enclosingHeaders, fenceMap, indentOf } from './document-context';\n\nfunction enclosing(lines: string[], line: number) {\n const headers = enclosingHeaders(lines, fenceMap(lines), line, indentOf(lines[line]));\n if (!headers.some(header => header.startsWith('specification ')) || headers.some(header => /^(?:case|given caller|when redelivered)\\b/.test(header))) return undefined;\n return [...responseAnalysis(lines).specifications].filter(([start]) => start <= line).sort(([left], [right]) => right - left)[0]?.[1];\n}\n\nexport function caseCompletions(lines: string[], line: number, before: string) {\n if (!/(?:=\\s*|for\\s+|then\\s+error\\s+)case\\.[\\w]*$/.test(before) || /when\\s+redelivered|given\\s+caller/.test(before) || /^\\s*case\\b/.test(before)) return null;\n const table = enclosing(lines, line);\n if ((table?.cases?.length ?? 0) === 0) return null;\n return table!.parameters?.map(parameter => ({ label: `case.${parameter.name}`, insertText: `case.${parameter.name}`, documentation: `Case value of ${parameter.type.name}${parameter.type.isCollection ? '[]' : ''}${parameter.type.isOptional ? ' optional' : ''}.` })) ?? [];\n}\n\nexport function caseHover(lines: string[], line: number, start: number, end: number): string | null {\n const text = lines[line];\n const reference = [...text.matchAll(/\\bcase\\.([a-z_]\\w*)\\b/g)].find(match => match.index! < end && match.index! + match[0].length >= start);\n if (reference === undefined) return null;\n const table = enclosing(lines, line);\n const parameter = table?.parameters?.find(parameter => parameter.name === reference[1]);\n if (parameter === undefined) return null;\n const values = table!.cases?.map(row => {\n const source = row.values.find(value => value.property === parameter.name)?.source;\n const value = source !== null && typeof source === 'object' && 'value' in source ? source.value : source;\n return `- ${row.name}: \\`${JSON.stringify(value)}\\``;\n }).join('\\n');\n return `**case.${parameter.name}** — ${parameter.type.name}\\n\\nCase origin in **${table!.name}**; substitutes after example overrides.\\n\\n${values ?? ''}`;\n}\n"],"mappings":"gMAMA,SAAS,UAAU,EAAiB,EAAc,CAC9C,IAAMA,EAAUC,EAAiBC,EAAOC,EAASD,CAAK,EAAGE,EAAMC,EAASH,EAAME,EAAK,CAAC,EACpF,GAAKJ,EAAQ,KAAK,GAAUM,EAAO,WAAW,gBAAgB,CAAC,GAAK,GAAQ,KAAK,GAAU,4CAA4C,KAAKA,CAAM,CAAC,EACnJ,MAAO,CAAC,GAAGC,EAAiBL,CAAK,CAAC,CAAC,cAAc,CAAC,CAAC,QAAQ,CAACM,KAAWA,GAASJ,CAAI,CAAC,CAAC,MAAM,CAACK,GAAO,CAACC,KAAWA,EAAQD,CAAI,CAAC,CAAC,EAAE,GAAG,EACvI,CAEA,SAAgB,gBAAgB,EAAiB,EAAc,EAAgB,CAC3E,GAAI,CAAC,8CAA8C,KAAKE,CAAM,GAAK,oCAAoC,KAAKA,CAAM,GAAK,aAAa,KAAKA,CAAM,EAAG,OAAO,KACzJ,IAAMC,EAAQ,UAAUV,EAAOE,CAAI,EAEnC,OADKQ,GAAO,OAAO,QAAU,KAAO,EAAU,KACvCA,EAAO,YAAY,IAAI,IAAc,CAAE,MAAO,QAAQC,EAAU,OAAQ,WAAY,QAAQA,EAAU,OAAQ,cAAe,iBAAiBA,EAAU,KAAK,OAAOA,EAAU,KAAK,aAAe,KAAO,KAAKA,EAAU,KAAK,WAAa,YAAc,GAAG,EAAG,EAAE,GAAK,CAAC,CACjR,CAEA,SAAgB,UAAU,EAAiB,EAAc,EAAe,EAA4B,CAEhG,IAAMC,EAAY,CAAC,GADNZ,EAAME,EACO,CAAC,SAAS,wBAAwB,CAAC,CAAC,CAAC,KAAK,GAASW,EAAM,MAASC,GAAOD,EAAM,MAASA,EAAM,EAAE,CAAC,QAAUP,CAAK,EAC1I,GAAIM,IAAc,IAAA,GAAW,OAAO,KACpC,IAAMF,EAAQ,UAAUV,EAAOE,CAAI,EAC7BS,EAAYD,GAAO,YAAY,KAAK,GAAaC,EAAU,OAASC,EAAU,EAAE,EACtF,GAAID,IAAc,IAAA,GAAW,OAAO,KACpC,IAAMI,EAASL,EAAO,OAAO,IAAI,GAAO,CACpC,IAAMM,EAASC,EAAI,OAAO,KAAK,GAASC,EAAM,WAAaP,EAAU,IAAI,CAAC,EAAE,OACtEO,EAA2B,OAAOF,GAAW,UAArCA,GAAiD,UAAWA,EAASA,EAAO,MAAQA,EAClG,MAAO,KAAKC,EAAI,KAAK,MAAM,KAAK,UAAUC,CAAK,EAAE,GACrD,CAAC,CAAC,CAAC,KAAK;CAAI,EACZ,MAAO,UAAUP,EAAU,KAAK,OAAOA,EAAU,KAAK,KAAK,uBAAuBD,EAAO,KAAK,8CAA8CK,GAAU,IAC1J"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"./compiler/Diagnostics/DiagnosticCodes.js";import{isQuickFixDiagnostic as t,prepareQuickFixes as n}from"./compiler/Authoring/QuickFixes.js";import"./compiler/index.js";const r=`source.screenplay.migrateOptional`,i=`source.screenplay.migrateCompliance`,migrationKind=t=>t===e.LegacyComplianceMarker?i:r,containsKind=(e,t)=>e===``||e===t||t.startsWith(`${e}.`);function intersects(e,t){return(e.startLineNumber<t.endLineNumber||e.startLineNumber===t.endLineNumber&&e.startColumn<=t.endColumn)&&(t.startLineNumber<e.endLineNumber||t.startLineNumber===e.endLineNumber&&t.startColumn<=e.endColumn)}function createCodeActionProvider(a){let o=/* @__PURE__ */ new WeakMap;return{provideCodeActions(s,c,l,u){let d=l.only!==void 0&&[r,i].some(e=>containsKind(l.only,e)),f=l.only!==void 0&&d&&!containsKind(l.only,`quickfix`);if(u.isCancellationRequested||l.only!==void 0&&!d&&!containsKind(l.only,`quickfix`))return{actions:[],dispose(){}};let p=l.markers.filter(e=>{let n=typeof e.code==`object`?e.code.value:e.code;return t(n)&&intersects(e,c)});if(!d&&p.length===0)return{actions:[],dispose(){}};let m=s.getVersionId(),h=JSON.stringify(a)??``,g=o.get(s);(g?.version!==m||g.placement!==h)&&(g={version:m,placement:h,fixes:n(s.getValue(),{placement:a})},o.set(s,g));let _=[...f?[]:g.fixes(p.map(e=>({line:e.startLineNumber,diagnosticCode:String(typeof e.code==`object`?e.code.value:e.code)}))).filter(e=>e.scope===`occurrence`),...l.only===void 0||d?[e.LegacyOptionalSuffix,e.LegacyComplianceMarker].flatMap(e=>g.fixes(void 0,e)):[]].filter(e=>l.only===void 0||containsKind(l.only,e.scope===`document`?migrationKind(e.diagnosticCode):`quickfix`));return u.isCancellationRequested||s.getVersionId()!==m?{actions:[],dispose(){}}:{actions:_.map(e=>({title:e.title,kind:e.scope===`document`?migrationKind(e.diagnosticCode):`quickfix`,isPreferred:e.scope===`occurrence`,edit:{edits:e.edits.map(e=>{let t=s.getPositionAt(e.start),n=s.getPositionAt(e.start+e.length);return{resource:s.uri,versionId:m,textEdit:{range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:n.lineNumber,endColumn:n.column},text:e.text}}})}})),dispose(){}}}}}export{createCodeActionProvider};
|
|
2
|
+
//# sourceMappingURL=code-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-actions.js","names":["migrateOptional","migrateCompliance","code","DiagnosticCodes","requested","kind","left","right","cache","migrationRequested","context","migrationOnly","token","diagnostics","marker","isQuickFixDiagnostic","range","version","model","placementKey","placement","analysis","prepareQuickFixes","fixes","diagnostic","fix","start","edit","end"],"sources":["../../code-actions.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { editor, IRange, languages } from 'monaco-editor';\nimport { DiagnosticCodes, isQuickFixDiagnostic, prepareQuickFixes } from '@cratis/screenplay-compiler';\n\nconst migrateOptional = 'source.screenplay.migrateOptional';\nconst migrateCompliance = 'source.screenplay.migrateCompliance';\nconst migrationKind = (code: string) => code === DiagnosticCodes.LegacyComplianceMarker ? migrateCompliance : migrateOptional;\nconst containsKind = (requested: string, kind: string) => requested === '' || requested === kind || kind.startsWith(`${requested}.`);\n\nfunction intersects(left: IRange, right: IRange): boolean {\n return (left.startLineNumber < right.endLineNumber || (left.startLineNumber === right.endLineNumber && left.startColumn <= right.endColumn)) &&\n (right.startLineNumber < left.endLineNumber || (right.startLineNumber === left.endLineNumber && right.startColumn <= left.endColumn));\n}\n\n// The compiler owns recipes and verification. The adapter only translates verified offsets and pins\n// edits to the analyzed buffer version, so future fixes need no editor-specific parsing or .NET bridge.\nexport function createCodeActionProvider(placement?: readonly string[]): languages.CodeActionProvider {\n const cache = new WeakMap<editor.ITextModel, { version: number; placement: string; fixes: ReturnType<typeof prepareQuickFixes> }>();\n return {\n provideCodeActions(model, range, context, token) {\n const migrationRequested = context.only !== undefined && [migrateOptional, migrateCompliance].some(kind => containsKind(context.only!, kind));\n const migrationOnly = context.only !== undefined && migrationRequested && !containsKind(context.only, 'quickfix');\n if (token.isCancellationRequested || (context.only !== undefined && !migrationRequested && !containsKind(context.only, 'quickfix'))) return { actions: [], dispose() {} };\n const diagnostics = context.markers.filter(marker => {\n const code = typeof marker.code === 'object' ? marker.code.value : marker.code;\n return isQuickFixDiagnostic(code) && intersects(marker, range);\n });\n if (!migrationRequested && diagnostics.length === 0) return { actions: [], dispose() {} };\n const version = model.getVersionId();\n const placementKey = JSON.stringify(placement) ?? '';\n let analysis = cache.get(model);\n if (analysis?.version !== version || analysis.placement !== placementKey) {\n analysis = { version, placement: placementKey, fixes: prepareQuickFixes(model.getValue(), { placement }) };\n cache.set(model, analysis);\n }\n const occurrences = migrationOnly ? [] : analysis.fixes(diagnostics.map(diagnostic => ({\n line: diagnostic.startLineNumber,\n diagnosticCode: String(typeof diagnostic.code === 'object' ? diagnostic.code.value : diagnostic.code),\n }))).filter(fix => fix.scope === 'occurrence');\n const requested = [...occurrences, ...(context.only === undefined || migrationRequested ? [DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.LegacyComplianceMarker].flatMap(code => analysis.fixes(undefined, code)) : [])];\n const fixes = requested.filter(fix => context.only === undefined || containsKind(context.only, fix.scope === 'document' ? migrationKind(fix.diagnosticCode) : 'quickfix'));\n if (token.isCancellationRequested || model.getVersionId() !== version) return { actions: [], dispose() {} };\n return {\n actions: fixes.map(fix => ({\n title: fix.title,\n kind: fix.scope === 'document' ? migrationKind(fix.diagnosticCode) : 'quickfix',\n isPreferred: fix.scope === 'occurrence',\n edit: { edits: fix.edits.map(edit => {\n const start = model.getPositionAt(edit.start);\n const end = model.getPositionAt(edit.start + edit.length);\n return { resource: model.uri, versionId: version, textEdit: {\n range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column },\n text: edit.text,\n } };\n }) },\n })),\n dispose() {},\n };\n },\n };\n}\n"],"mappings":"0PAMA,MAAMA,EAAkB,oCAClBC,EAAoB,sCACpB,cAAiB,GAAiBC,IAASC,EAAgB,uBAAyBF,EAAoBD,EACxG,cAAgB,EAAmB,IAAiBI,IAAc,IAAMA,IAAcC,GAAQA,EAAK,WAAW,GAAGD,EAAU,EAAE,EAEnI,SAAS,WAAW,EAAc,EAAwB,CACtD,OAAQE,EAAK,gBAAkBC,EAAM,eAAkBD,EAAK,kBAAoBC,EAAM,eAAiBD,EAAK,aAAeC,EAAM,aAC5HA,EAAM,gBAAkBD,EAAK,eAAkBC,EAAM,kBAAoBD,EAAK,eAAiBC,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AI,CACxG,EAAE,CAAC,CAAC,CAAC,OAAO,GAAOC,EAAI,QAAU,YAAY,EACV,GAAIf,EAAQ,OAAS,IAAA,IAAaD,EAAqB,CAACN,EAAgB,qBAAsBA,EAAgB,sBAAsB,CAAC,CAAC,QAAQ,GAAQkB,EAAS,MAAM,IAAA,GAAWnB,CAAI,CAAC,EAAI,CAAC,CACvM,CAAC,CAAC,OAAO,GAAOQ,EAAQ,OAAS,IAAA,IAAa,aAAaA,EAAQ,KAAMe,EAAI,QAAU,WAAa,cAAcA,EAAI,cAAc,EAAI,UAAU,CAAC,EAEzK,OADIb,EAAM,yBAA2BM,EAAM,aAAa,IAAMD,EAAgB,CAAE,QAAS,CAAC,EAAG,SAAU,CAAC,CAAE,EACnG,CACH,QAASM,EAAM,IAAI,IAAQ,CACvB,MAAOE,EAAI,MACX,KAAMA,EAAI,QAAU,WAAa,cAAcA,EAAI,cAAc,EAAI,WACrE,YAAaA,EAAI,QAAU,aAC3B,KAAM,CAAE,MAAOA,EAAI,MAAM,IAAI,GAAQ,CACjC,IAAMC,EAAQR,EAAM,cAAcS,EAAK,KAAK,EACtCC,EAAMV,EAAM,cAAcS,EAAK,MAAQA,EAAK,MAAM,EACxD,MAAO,CAAE,SAAUT,EAAM,IAAK,UAAWD,EAAS,SAAU,CACxD,MAAO,CAAE,gBAAiBS,EAAM,WAAY,YAAaA,EAAM,OAAQ,cAAeE,EAAI,WAAY,UAAWA,EAAI,MAAO,EAC5H,KAAMD,EAAK,IACf,CAAE,CACN,CAAC,CAAE,CACP,EAAE,EACF,SAAU,CAAC,CACf,CACJ,CACJ,CACJ"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{pattern as t}from"../Text/patterns.js";import{commentStart as n,splitLines as r}from"../Parsing/SourceLineSplitter.js";import{ScreenplaySyntaxWalker as i}from"../Syntax/ScreenplaySyntaxWalker.js";import{parseForAuthoring as a}from"../ScreenplayCompiler.js";function isQuickFixDiagnostic(t){return t===e.LegacyOptionalSuffix||t===e.LegacyComplianceMarker||t===e.RedundantEventId||t===e.PublicTranslationRequiresDirection}function legacyOptionalTypeLength(t,n){return n.code===e.LegacyOptionalSuffix?/^[\p{L}\p{Mn}\p{Nd}\p{Pc}.]+(?:\[\])?\?/u.exec(t.slice(n.location.column-1))?.[0].length??0:0}function prepareQuickFixes(t,o={}){let s=a(t,void 0,o.placement),c=new Set(Array.from({length:14},(e,t)=>`PLAY0${607+t}`)),acceptable=e=>e.success||e.diagnostics.every(e=>e.severity!==`error`||c.has(e.code)),errorCodes=e=>new Set(e.diagnostics.filter(e=>e.severity===`error`).map(e=>e.code));if(!acceptable(s))return()=>[];let l=r(t),u=/* @__PURE__ */ new Map,d=/* @__PURE__ */ new Map;new class extends i{visitEvent(e){u.set(e.location.line,e)}visitSlice(e){d.set(e.location.line,e),super.visitSlice(e)}}().visitApplication(s.value);let f=/* @__PURE__ */ new Map,p=/* @__PURE__ */ new Map,m=/* @__PURE__ */ new Map,h;for(let e of l)h=u.get(e.number)??h,h!==void 0&&m.set(e.number,h);for(let r of s.diagnostics){f.set(r.code,(f.get(r.code)??0)+1);let i=l[r.location.line-1],c=legacyOptionalTypeLength(i.raw,r);if(c>0)p.set(i.number,{line:i.number,fix:{diagnosticCode:r.code,title:`Use 'optional' instead of '?'`,scope:`occurrence`,edits:[{start:i.startOffset+r.location.column+c-2,length:1,text:` optional`}]}});else if(r.code===e.LegacyComplianceMarker){let e=complianceMarkerEdit(i.raw,i.startOffset);e!==void 0&&p.set(i.number,{line:i.number,fix:{diagnosticCode:r.code,title:`Use bare pii and secret compliance markers`,scope:`occurrence`,edits:[e]}})}else if(r.code===e.PublicTranslationRequiresDirection){let n=d.get(i.number),c=/^\s*/.exec(i.raw)[0],l=t.includes(`\r
|
|
2
|
+
`)?`\r
|
|
3
|
+
`:`
|
|
4
|
+
`,u=[`Inbound`,`Outbound`].map(e=>({direction:e,text:`${l}${c} direction ${e===`Inbound`?`inbound`:`outbound`}`})).filter(n=>{let r=applyQuickFixEdits(t,[{start:i.startOffset+i.raw.length,length:0,text:n.text}]),c=a(r,void 0,o.placement),l=errorCodes(s);return acceptable(c)&&![...errorCodes(c)].some(t=>t===e.PublicTranslationRequiresDirection||!l.has(t))});if(u.length===1){let[{direction:e,text:t}]=u;p.set(i.number,{line:i.number,fix:{diagnosticCode:r.code,title:`Declare 'direction ${e===`Inbound`?`inbound`:`outbound`}'`,scope:`occurrence`,edits:[{start:i.startOffset+i.raw.length,length:0,text:t}]},change:{node:n,replacement:{...n,direction:e}}})}}else if(r.code===e.RedundantEventId&&n(i.raw)<0){let e=m.get(i.number);if(e?.id!==e?.name||e===void 0)continue;p.set(i.number,{line:i.number,fix:{diagnosticCode:r.code,title:`Remove the redundant event id`,scope:`occurrence`,edits:[{start:i.startOffset,length:(l[i.number]?.startOffset??t.length)-i.startOffset,text:``}]},change:{node:e,replacement:{...e,id:null}}})}}let g=[e.LegacyOptionalSuffix,e.LegacyComplianceMarker],_=verificationShape(s),v=/* @__PURE__ */ new Map,y,b=/* @__PURE__ */ new Set,x=/* @__PURE__ */ new Map,verify=(e,n)=>{let r=applyQuickFixEdits(t,e.edits);if(r===void 0)return;let i=a(r,void 0,o.placement);if(acceptable(i)&&verificationShape(i)===(n===void 0?_:verificationShape(s,[n])))return i.diagnostics.filter(t=>t.code===e.diagnosticCode).length===(f.get(e.diagnosticCode)??0)-e.edits.length?e:void 0};return(n,r)=>{let i=typeof n==`number`||n===void 0?void 0:n,c=g.filter(e=>i===void 0?r===void 0||r===e:i.some(t=>t.diagnosticCode===e));for(let t of c.filter(e=>!b.has(e))){let n=[...p.values()].filter(e=>e.fix.diagnosticCode===t);if(n.length>0){let r=verify({diagnosticCode:t,title:t===e.LegacyOptionalSuffix?`Use 'optional' throughout this document`:`Use bare pii and secret throughout this document`,scope:`document`,edits:n.flatMap(e=>e.fix.edits)});r!==void 0&&x.set(t,r)}b.add(t)}let u=c.flatMap(e=>x.has(e)?[x.get(e)]:[]);if(i!==void 0){if(y===void 0){y=/* @__PURE__ */ new Map;let e=l.flatMap(e=>p.has(e.number)?[p.get(e.number)]:[]),n=e.flatMap(e=>e.fix.edits),r=applyQuickFixEdits(t,n);if(n.length>0&&r!==void 0){let t=a(r,void 0,o.placement),n=e.flatMap(e=>e.change===void 0?[]:[e.change]);if(acceptable(t)&&verificationShape(t)===verificationShape(s,n)){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map;for(let e of t.diagnostics)n.set(e.code,(n.get(e.code)??0)+1);for(let t of e)r.set(t.fix.diagnosticCode,(r.get(t.fix.diagnosticCode)??0)+t.fix.edits.length);if([...r].every(([e,t])=>(n.get(e)??0)===(f.get(e)??0)-t))for(let t of e)y.set(t.line,t.fix)}}}let e=/* @__PURE__ */ new Map;for(let t of i){let n=y.get(t.line);n?.diagnosticCode===t.diagnosticCode&&e.set(t.line,n)}return[...e.values(),...u]}let d=typeof n==`number`?n:void 0,m=d===void 0?void 0:p.get(d),h;return m!==void 0&&d!==void 0&&(r===void 0||m.fix.diagnosticCode===r)&&(v.has(d)||(v.size===32&&v.delete(v.keys().next().value),v.set(d,verify(m.fix,m.change))),h=v.get(d)),[...h===void 0?[]:[h],...u]}}function complianceMarkerEdit(e,n){let r=t(`^(\\s*concept\\s+\\w+\\s*:\\s*\\w+)((?:[^\\S\\r\\n]+@?\\w+)*)`).exec(e);if(r!==null){let e=r[2],t=e.replace(/@pii\b|@?sensitive\b/g,e=>e===`@pii`?`pii`:`secret`);return t===e?void 0:{start:n+r[1].length,length:e.length,text:t}}let i=t(`^(\\s*)(@pii|@?sensitive)\\b`).exec(e);return i===null?void 0:{start:n+i[1].length,length:i[2].length,text:i[2]===`@pii`?`pii`:`secret`}}function verificationShape(e,t=[]){let n=new Map(t.map(e=>[e.node,e.replacement]));return JSON.stringify([e.value,e.triggerData],(e,t)=>[`location`,`usesLocation`,`targetLocation`].includes(e)?void 0:n.get(t)??t)}function applyQuickFixEdits(e,t){let n=[],r=0;for(let i of t){if(i.start<r||i.start<0||i.length<0||i.start+i.length>e.length)return;n.push(e.slice(r,i.start),i.text),r=i.start+i.length}return n.push(e.slice(r)),n.join(``)}export{applyQuickFixEdits,isQuickFixDiagnostic,legacyOptionalTypeLength,prepareQuickFixes};
|
|
5
|
+
//# sourceMappingURL=QuickFixes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuickFixes.js","names":["code","DiagnosticCodes","diagnostic","line","original","parseForAuthoring","source","options","publicEventCodes","index","parsed","lines","splitLines","eventsByLine","slicesByLine","ScreenplaySyntaxWalker","event","slice","counts","byLine","events","length","edit","indent","ending","candidates","direction","edited","candidate","originalCodes","commentStart","declaration","spellingCodes","syntax","verified","rangeVerdicts","documentChecked","documentFixes","fix","change","requests","selectedCodes","diagnosticCode","request","documents","edits","candidateSource","changes","remaining","removed","count","selected","occurrenceLine","occurrenceFix","header","pattern","raw","suffix","text","marker","startOffset","directive","replacements","key","value","parts","end"],"sources":["../../../../../../Compiler/Authoring/QuickFixes.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Diagnostic } from '../Diagnostics/Diagnostic';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { PlayPlacement } from '../Files/PlayPlacement';\nimport { commentStart, splitLines } from '../Parsing/SourceLineSplitter';\nimport { parseForAuthoring } from '../ScreenplayCompiler';\nimport { EventSyntax } from '../Syntax/Declarations';\nimport { SliceSyntax } from '../Syntax/Structure';\nimport { TranslationDirection } from '../Syntax/TranslationDirection';\nimport { ScreenplaySyntaxWalker } from '../Syntax/ScreenplaySyntaxWalker';\nimport { pattern } from '../Text/patterns';\nimport { QuickFixCandidate } from './QuickFixCandidate';\n\nexport interface QuickFixEdit {\n readonly start: number;\n readonly length: number;\n readonly text: string;\n}\n\nexport interface QuickFix {\n readonly diagnosticCode: string;\n readonly title: string;\n readonly scope: 'occurrence' | 'document';\n readonly edits: readonly QuickFixEdit[];\n}\n\nexport interface QuickFixOptions {\n readonly line?: number;\n readonly placement?: PlayPlacement;\n readonly diagnosticCode?: string;\n}\n\nexport function isQuickFixDiagnostic(code: unknown): code is string {\n return code === DiagnosticCodes.LegacyOptionalSuffix || code === DiagnosticCodes.LegacyComplianceMarker || code === DiagnosticCodes.RedundantEventId || code === DiagnosticCodes.PublicTranslationRequiresDirection;\n}\n\n// Diagnostics point at the complete type, not at the suffix. Never derive edits from message text.\nexport function legacyOptionalTypeLength(line: string, diagnostic: Diagnostic): number {\n if (diagnostic.code !== DiagnosticCodes.LegacyOptionalSuffix) return 0;\n return /^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?\\?/u.exec(line.slice(diagnostic.location.column - 1))?.[0].length ?? 0;\n}\n\nexport function findQuickFixes(source: string, options: QuickFixOptions = {}): QuickFix[] {\n return prepareQuickFixes(source, options)(options.line, options.diagnosticCode);\n}\n\n// One immutable buffer version owns the analysis and document verdict. Cursor moves reuse them;\n// single-occurrence verdicts have a bounded cache. Range requests verify the independent recipes\n// together once per version, rather than reparsing N times for N intersecting markers.\nexport function prepareQuickFixes(source: string, options: Pick<QuickFixOptions, 'placement'> = {}): (line?: number | readonly { line: number; diagnosticCode: string }[], diagnosticCode?: string) => QuickFix[] {\n const original = parseForAuthoring(source, undefined, options.placement);\n // PLAY0614 and the public-event boundary errors that follow from a missing direction are errors the repair itself removes,\n // so a document whose only errors are public-event boundary errors stays repairable.\n const publicEventCodes: ReadonlySet<string> = new Set(Array.from({ length: 14 }, (_, index) => `PLAY0${607 + index}`));\n const acceptable = (parsed: ReturnType<typeof parseForAuthoring>): boolean => parsed.success || parsed.diagnostics.every(diagnostic => diagnostic.severity !== 'error' || publicEventCodes.has(diagnostic.code));\n const errorCodes = (parsed: ReturnType<typeof parseForAuthoring>): Set<string> => new Set(parsed.diagnostics.filter(diagnostic => diagnostic.severity === 'error').map(diagnostic => diagnostic.code));\n if (!acceptable(original)) return () => [];\n const lines = splitLines(source);\n const eventsByLine = new Map<number, EventSyntax>();\n const slicesByLine = new Map<number, SliceSyntax>();\n // Index inline and standalone declarations once, without scanning the tree per diagnostic.\n const walker = new class extends ScreenplaySyntaxWalker {\n override visitEvent(event: EventSyntax): void { eventsByLine.set(event.location.line, event); }\n override visitSlice(slice: SliceSyntax): void { slicesByLine.set(slice.location.line, slice); super.visitSlice(slice); }\n }();\n walker.visitApplication(original.value);\n const counts = new Map<string, number>();\n const byLine = new Map<number, QuickFixCandidate>();\n const events = new Map<number, EventSyntax>();\n let event: EventSyntax | undefined;\n for (const line of lines) {\n event = eventsByLine.get(line.number) ?? event;\n if (event !== undefined) events.set(line.number, event);\n }\n for (const diagnostic of original.diagnostics) {\n counts.set(diagnostic.code, (counts.get(diagnostic.code) ?? 0) + 1);\n const line = lines[diagnostic.location.line - 1];\n const length = legacyOptionalTypeLength(line.raw, diagnostic);\n if (length > 0) {\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: \"Use 'optional' instead of '?'\", scope: 'occurrence', edits: [{ start: line.startOffset + diagnostic.location.column + length - 2, length: 1, text: ' optional' }] } });\n } else if (diagnostic.code === DiagnosticCodes.LegacyComplianceMarker) {\n const edit = complianceMarkerEdit(line.raw, line.startOffset);\n if (edit !== undefined) byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Use bare pii and secret compliance markers', scope: 'occurrence', edits: [edit] } });\n } else if (diagnostic.code === DiagnosticCodes.PublicTranslationRequiresDirection) {\n // PLAY0614 is only reported on the declaration line of a Translate slice that has no direction.\n const slice = slicesByLine.get(line.number)!;\n // Offer a direction only when exactly one is consistent with the slice: the other would add errors.\n const indent = /^\\s*/.exec(line.raw)![0];\n const ending = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const candidates = [TranslationDirection.Inbound, TranslationDirection.Outbound].map(direction => ({ direction, text: `${ending}${indent} direction ${direction === TranslationDirection.Inbound ? 'inbound' : 'outbound'}` }))\n .filter(candidate => {\n // The insertion point is the end of an existing line, so the edit is always in bounds.\n const edited = applyQuickFixEdits(source, [{ start: line.startOffset + line.raw.length, length: 0, text: candidate.text }])!;\n const parsed = parseForAuthoring(edited, undefined, options.placement);\n const originalCodes = errorCodes(original);\n // Valid when the missing-direction error is gone and the direction introduces no kind of error the document lacked.\n return acceptable(parsed) && ![...errorCodes(parsed)].some(code => code === DiagnosticCodes.PublicTranslationRequiresDirection || !originalCodes.has(code));\n });\n if (candidates.length === 1) {\n const [{ direction, text }] = candidates;\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: `Declare 'direction ${direction === TranslationDirection.Inbound ? 'inbound' : 'outbound'}'`, scope: 'occurrence', edits: [{ start: line.startOffset + line.raw.length, length: 0, text }] },\n change: { node: slice, replacement: { ...slice, direction } as SliceSyntax } });\n }\n } else if (diagnostic.code === DiagnosticCodes.RedundantEventId && commentStart(line.raw) < 0) {\n const declaration = events.get(line.number);\n if (declaration?.id !== declaration?.name || declaration === undefined) continue;\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Remove the redundant event id', scope: 'occurrence', edits: [{ start: line.startOffset, length: (lines[line.number]?.startOffset ?? source.length) - line.startOffset, text: '' }] },\n change: { node: declaration, replacement: { ...declaration, id: null } as EventSyntax } });\n }\n }\n const spellingCodes = [DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.LegacyComplianceMarker];\n const syntax = verificationShape(original);\n const verified = new Map<number, QuickFix | undefined>();\n let rangeVerdicts: Map<number, QuickFix> | undefined;\n const documentChecked = new Set<string>();\n const documentFixes = new Map<string, QuickFix>();\n const verify = (fix: QuickFix, change?: QuickFixCandidate['change']): QuickFix | undefined => {\n const candidate = applyQuickFixEdits(source, fix.edits);\n if (candidate === undefined) return undefined;\n const parsed = parseForAuthoring(candidate, undefined, options.placement);\n if (!acceptable(parsed) || verificationShape(parsed) !== (change === undefined ? syntax : verificationShape(original, [change]))) return undefined;\n return parsed.diagnostics.filter(diagnostic => diagnostic.code === fix.diagnosticCode).length === (counts.get(fix.diagnosticCode) ?? 0) - fix.edits.length ? fix : undefined;\n };\n return (line, diagnosticCode) => {\n const requests = typeof line === 'number' || line === undefined ? undefined : line;\n const selectedCodes = spellingCodes.filter(code => requests === undefined ? diagnosticCode === undefined || diagnosticCode === code : requests.some(request => request.diagnosticCode === code));\n for (const code of selectedCodes.filter(code => !documentChecked.has(code))) {\n const candidates = [...byLine.values()].filter(candidate => candidate.fix.diagnosticCode === code);\n if (candidates.length > 0) {\n const fix = verify({ diagnosticCode: code, title: code === DiagnosticCodes.LegacyOptionalSuffix ? \"Use 'optional' throughout this document\" : 'Use bare pii and secret throughout this document', scope: 'document', edits: candidates.flatMap(candidate => candidate.fix.edits) });\n if (fix !== undefined) documentFixes.set(code, fix);\n }\n documentChecked.add(code);\n }\n const documents = selectedCodes.flatMap(code => documentFixes.has(code) ? [documentFixes.get(code)!] : []);\n if (requests !== undefined) {\n if (rangeVerdicts === undefined) {\n rangeVerdicts = new Map();\n // Source order gives ordered, non-overlapping edits without sorting. Recipes replace\n // distinct nodes/lines; the batch must preserve every other modeled member and remove\n // exactly the expected diagnostics before any of its occurrence edits can be offered.\n const candidates = lines.flatMap(line => byLine.has(line.number) ? [byLine.get(line.number)!] : []);\n const edits = candidates.flatMap(candidate => candidate.fix.edits);\n const candidateSource = applyQuickFixEdits(source, edits);\n if (edits.length > 0 && candidateSource !== undefined) {\n const parsed = parseForAuthoring(candidateSource, undefined, options.placement);\n const changes = candidates.flatMap(candidate => candidate.change === undefined ? [] : [candidate.change]);\n if (acceptable(parsed) && verificationShape(parsed) === verificationShape(original, changes)) {\n const remaining = new Map<string, number>();\n const removed = new Map<string, number>();\n for (const diagnostic of parsed.diagnostics) remaining.set(diagnostic.code, (remaining.get(diagnostic.code) ?? 0) + 1);\n for (const candidate of candidates) removed.set(candidate.fix.diagnosticCode, (removed.get(candidate.fix.diagnosticCode) ?? 0) + candidate.fix.edits.length);\n if ([...removed].every(([code, count]) => (remaining.get(code) ?? 0) === (counts.get(code) ?? 0) - count)) {\n for (const candidate of candidates) rangeVerdicts.set(candidate.line, candidate.fix);\n }\n }\n }\n }\n const selected = new Map<number, QuickFix>();\n for (const request of requests) {\n const fix = rangeVerdicts.get(request.line);\n if (fix?.diagnosticCode === request.diagnosticCode) selected.set(request.line, fix);\n }\n return [...selected.values(), ...documents];\n }\n const occurrenceLine = typeof line === 'number' ? line : undefined;\n const selected = occurrenceLine === undefined ? undefined : byLine.get(occurrenceLine);\n let occurrenceFix: QuickFix | undefined;\n if (selected !== undefined && occurrenceLine !== undefined && (diagnosticCode === undefined || selected.fix.diagnosticCode === diagnosticCode)) {\n if (!verified.has(occurrenceLine)) {\n if (verified.size === 32) verified.delete(verified.keys().next().value!);\n verified.set(occurrenceLine, verify(selected.fix, selected.change));\n }\n occurrenceFix = verified.get(occurrenceLine);\n }\n return [...(occurrenceFix === undefined ? [] : [occurrenceFix]), ...documents];\n };\n}\n\nfunction complianceMarkerEdit(raw: string, startOffset: number): QuickFixEdit | undefined {\n // Restrict rewriting to the suffix or leading directive marker, never comments or quoted reasons.\n const header = pattern('^(\\\\s*concept\\\\s+\\\\w+\\\\s*:\\\\s*\\\\w+)((?:[^\\\\S\\\\r\\\\n]+@?\\\\w+)*)').exec(raw);\n if (header !== null) {\n const suffix = header[2];\n const text = suffix.replace(/@pii\\b|@?sensitive\\b/g, marker => marker === '@pii' ? 'pii' : 'secret');\n return text === suffix ? undefined : { start: startOffset + header[1].length, length: suffix.length, text };\n }\n const directive = pattern('^(\\\\s*)(@pii|@?sensitive)\\\\b').exec(raw);\n return directive === null ? undefined : { start: startOffset + directive[1].length, length: directive[2].length, text: directive[2] === '@pii' ? 'pii' : 'secret' };\n}\n\nfunction verificationShape(parsed: ReturnType<typeof parseForAuthoring>, changes: readonly NonNullable<QuickFixCandidate['change']>[] = []): string {\n // Compare every modeled member (including trigger data), ignoring only source locations. A recipe\n // may replace only its original node; no other id or destination is normalized away.\n const replacements = new Map(changes.map(change => [change.node, change.replacement]));\n return JSON.stringify([parsed.value, parsed.triggerData], (key, value: unknown) => ['location', 'usesLocation', 'targetLocation'].includes(key) ? undefined : replacements.get(value as NonNullable<QuickFixCandidate['change']>['node']) ?? value);\n}\n\n// One forward pass; applying N edits by repeatedly slicing the document would be quadratic.\nexport function applyQuickFixEdits(source: string, edits: readonly QuickFixEdit[]): string | undefined {\n const parts: string[] = [];\n let end = 0;\n for (const edit of edits) {\n if (edit.start < end || edit.start < 0 || edit.length < 0 || edit.start + edit.length > source.length) return undefined;\n parts.push(source.slice(end, edit.start), edit.text);\n end = edit.start + edit.length;\n }\n parts.push(source.slice(end));\n return parts.join('');\n}\n"],"mappings":"iYAkCA,SAAgB,qBAAqB,EAA+B,CAChE,OAAOA,IAASC,EAAgB,sBAAwBD,IAASC,EAAgB,wBAA0BD,IAASC,EAAgB,kBAAoBD,IAASC,EAAgB,kCACrL,CAGA,SAAgB,yBAAyB,EAAc,EAAgC,CAEnF,OADIC,EAAW,OAASD,EAAgB,qBACjC,2CAA2C,KAAKE,EAAK,MAAMD,EAAW,SAAS,OAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAU,EAD7C,CAEzE,CASA,SAAgB,kBAAkB,EAAgB,EAA8C,CAAC,EAAiH,CAC9M,IAAME,EAAWC,EAAkBC,EAAQ,IAAA,GAAWC,EAAQ,SAAS,EAGjEC,EAAwC,IAAI,IAAI,MAAM,KAAK,CAAE,OAAQ,EAAG,GAAI,EAAG,IAAU,QAAQ,IAAMC,GAAO,CAAC,EAC/G,WAAc,GAA0DC,EAAO,SAAWA,EAAO,YAAY,MAAM,GAAcR,EAAW,WAAa,SAAWM,EAAiB,IAAIN,EAAW,IAAI,CAAC,EACzM,WAAc,GAA8D,IAAI,IAAIQ,EAAO,YAAY,OAAO,GAAcR,EAAW,WAAa,OAAO,CAA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AmB,EAAgB,EAAoD,CACnG,IAAMC,EAAkB,CAAC,EACrBC,EAAM,EACV,IAAK,IAAM5C,KAAQuB,EAAO,CACtB,GAAIvB,EAAK,MAAQ4C,GAAO5C,EAAK,MAAQ,GAAKA,EAAK,OAAS,GAAKA,EAAK,MAAQA,EAAK,OAAShB,EAAO,OAAQ,OACvG2D,EAAM,KAAK3D,EAAO,MAAM4D,EAAK5C,EAAK,KAAK,EAAGA,EAAK,IAAI,EACnD,EAAMA,EAAK,MAAQA,EAAK,MAC5B,CAEA,OADA2C,EAAM,KAAK3D,EAAO,MAAM4D,CAAG,CAAC,EACrBD,EAAM,KAAK,EAAE,CACxB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{DeclaredDependencyTargets as t}from"./DeclaredDependencyTargets.js";import{DependencyGraph as n}from"./DependencyGraph.js";const r=[`usesFactsFrom`,`reactsTo`,`decidesFrom`,`asks`,`shows`],contains=(e,t)=>t===e||t.startsWith(e+`.`),ordinal=(e,t)=>e<t?-1:+(e>t),orderedEvidence=(e,t)=>ordinal(e.location.path??``,t.location.path??``)||e.location.line-t.location.line||e.location.column-t.location.column||ordinal(e.kind,t.kind)||ordinal(e.consumer.address,t.consumer.address)||ordinal(e.producer.address,t.producer.address)||ordinal(e.role,t.role)||ordinal(e.name,t.name);var DeclaredDependencies=class{static for(i){let a=/* @__PURE__ */ new Map,inventory=(e,t)=>{let n=e.join(`.`);a.has(n)||a.set(n,{location:t.location,dependencies:[]}),a.get(n).dependencies.push(...t.dependsOn??[]),t.features.forEach(t=>inventory([...e,t.name],t))};if(i.modules.forEach(e=>inventory([e.name],e)),![...a.values()].some(e=>e.dependencies.length))return{containers:[],diagnostics:[]};let o=n.for(i,/* @__PURE__ */ new Map),s=o.nodes.filter(e=>e.kind===`module`||e.kind===`feature`),c=t.containersOf(i),resolve=(e,n)=>{let r=t.resolve(e,n,c).resolved;return r&&[...r.scope,r.name].join(`.`)},l=[],u=[],finding=(e,t,n,r)=>u.push({code:e,severity:t,message:n,location:r});for(let t of s.filter(e=>a.get(e.address).dependencies.length)){let n=a.get(t.address),i=n.dependencies.map(e=>{let n=resolve(e.target,t.scope);return{syntax:e,resolved:n,status:n!==void 0&&!contains(t.address,n)&&!contains(n,t.address)?`unused`:`invalid`}}),s=[],c=/* @__PURE__ */ new Map;for(let e of o.edges.flatMap(e=>e.evidence).filter(e=>r.includes(e.kind)&&contains(t.address,e.consumer.address)).sort(orderedEvidence)){let n=[e.producer,...e.alternatives].filter(e=>!contains(t.address,e.address)&&!contains(e.scope.slice(0,-1).join(`.`),t.address));if(!n.length)continue;let r=i.filter(e=>e.status!==`invalid`&&n.some(t=>contains(e.resolved,t.address)));for(let t of r)t.status=e.ambiguous&&t.status!==`used`?`provisional`:`used`;let a=e.ambiguous?`provisional`:r.length?`declared`:`undeclared`;if(s.push({evidence:e,status:a,coveringDeclarations:r.map(e=>e.syntax)}),a===`undeclared`){let t=e.producer.scope[0];c.has(t)||c.set(t,[]),c.get(t).push(e)}}for(let r of c.values()){let i=r[0].producer.scope.slice(0,-1),a=i.findIndex((e,t)=>r.some(n=>t>=n.producer.scope.length-1||n.producer.scope[t]!==e));a>=0&&(i=i.slice(0,a));let o=i.join(`.`),s=contains(t.address,o)||contains(o,t.address)?[...new Set(r.map(e=>e.producer.scope.slice(0,-1).map((t,n)=>e.producer.scope.slice(0,n+1).join(`.`)).find(e=>!contains(t.address,e)&&!contains(e,t.address))))]:[o],c=r.map(e=>`${e.kind} ${e.role} '${e.name}' at ${e.location.path??``}:${e.location.line}:${e.location.column}`).join(`; `);finding(e.UndeclaredDependency,`warning`,`Container '${t.address}' depends on '${s.join(`', '`)}' without declaring ${s.length===1?`it`:`them`} - evidence: ${c}`,n.location)}for(let n of i)n.status===`unused`&&finding(e.UnusedDependencyDeclaration,`information`,`Dependency '${n.syntax.target}' on '${t.address}' is not used by any counted explicit reference`,n.syntax.location),n.status!==`invalid`&&a.get(n.resolved).dependencies.some(e=>resolve(e.target,n.resolved.split(`.`))===t.address)&&finding(e.MutualDependencyDeclarations,`information`,`Containers '${t.address}' and '${n.resolved}' declare each other`,n.syntax.location);l.push({container:t,location:n.location,declarations:i,edges:s})}return{containers:l,diagnostics:u}}static validate(e,t){for(let n of this.for(e).diagnostics)t[n.severity===`warning`?`warning`:`information`](n.code,n.message,n.location)}};export{DeclaredDependencies};
|
|
2
|
+
//# sourceMappingURL=DeclaredDependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeclaredDependencies.js","names":["countedKinds","address","container","left","right","owners","scope","syntax","child","application","module","owner","graph","DependencyGraph","nodes","node","targets","DeclaredDependencyTargets","resolved","target","containers","diagnostics","declarations","edges","buckets","evidence","edge","item","candidates","producer","covering","declaration","candidate","status","prefix","mismatch","index","segment","suggestedTargets","details","DiagnosticCodes","dependency","diagnostic","context"],"sources":["../../../../../../Compiler/Dependencies/DeclaredDependencies.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Diagnostic } from '../Diagnostics/Diagnostic';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { ParserContext } from '../Parsing/ParserContext';\nimport { ApplicationSyntax, DependsOnSyntax, FeatureSyntax } from '../Syntax/Structure';\nimport { DeclaredDependencyTargets } from './DeclaredDependencyTargets';\nimport { DependencyGraph } from './DependencyGraph';\nimport { DependencyEvidence, DependencyNode } from './index';\n\nexport interface DependencyDeclaration {\n readonly syntax: DependsOnSyntax;\n readonly resolved?: string;\n readonly status: 'used' | 'provisional' | 'unused' | 'invalid';\n}\nexport interface DeclaredDependencyEdge {\n readonly evidence: DependencyEvidence;\n readonly status: 'declared' | 'provisional' | 'undeclared';\n readonly coveringDeclarations: readonly DependsOnSyntax[];\n}\nexport interface CheckedDependencyContainer {\n readonly container: DependencyNode;\n readonly location: SourceLocation;\n readonly declarations: readonly DependencyDeclaration[];\n readonly edges: readonly DeclaredDependencyEdge[];\n}\nexport interface DeclaredDependencyReport {\n readonly containers: readonly CheckedDependencyContainer[];\n readonly diagnostics: readonly Diagnostic[];\n}\nconst countedKinds = ['usesFactsFrom', 'reactsTo', 'decidesFrom', 'asks', 'shows'];\nconst contains = (container: string, address: string): boolean => address === container || address.startsWith(container + '.');\nconst ordinal = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0;\nconst orderedEvidence = (left: DependencyEvidence, right: DependencyEvidence): number => ordinal(left.location.path ?? '', right.location.path ?? '') || left.location.line - right.location.line || left.location.column - right.location.column || ordinal(left.kind, right.kind) || ordinal(left.consumer.address, right.consumer.address) || ordinal(left.producer.address, right.producer.address) || ordinal(left.role, right.role) || ordinal(left.name, right.name);\n\n/** Independent opt-in inventories; checks explicit reference coupling, never executable identity. */\nexport class DeclaredDependencies {\n static for(application: ApplicationSyntax): DeclaredDependencyReport {\n const owners = new Map<string, { location: SourceLocation; dependencies: DependsOnSyntax[] }>();\n const inventory = (scope: string[], syntax: { location: SourceLocation; dependsOn?: readonly DependsOnSyntax[]; features: readonly FeatureSyntax[] }) => {\n const address = scope.join('.');\n if (!owners.has(address)) owners.set(address, { location: syntax.location, dependencies: [] });\n owners.get(address)!.dependencies.push(...syntax.dependsOn ?? []);\n syntax.features.forEach(child => inventory([...scope, child.name], child));\n };\n application.modules.forEach(module => inventory([module.name], module));\n if (![...owners.values()].some(owner => owner.dependencies.length)) return { containers: [], diagnostics: [] };\n // Both twins use syntax order, not authored import ranks.\n const graph = DependencyGraph.for(application, new Map());\n const nodes = graph.nodes.filter(node => node.kind === 'module' || node.kind === 'feature');\n const targets = DeclaredDependencyTargets.containersOf(application);\n const resolve = (target: string, scope: readonly string[]) => {\n const resolved = DeclaredDependencyTargets.resolve(target, scope, targets).resolved;\n return resolved && [...resolved.scope, resolved.name].join('.');\n };\n const containers: CheckedDependencyContainer[] = [];\n const diagnostics: Diagnostic[] = [];\n const finding = (code: string, severity: Diagnostic['severity'], message: string, location: SourceLocation) => diagnostics.push({ code, severity, message, location });\n for (const container of nodes.filter(node => owners.get(node.address)!.dependencies.length)) {\n const owner = owners.get(container.address)!;\n const declarations = owner.dependencies.map(syntax => {\n const resolved = resolve(syntax.target, container.scope);\n const valid = resolved !== undefined && !contains(container.address, resolved) && !contains(resolved, container.address);\n return { syntax, resolved, status: valid ? 'unused' : 'invalid' } as { syntax: DependsOnSyntax; resolved?: string; status: DependencyDeclaration['status'] };\n });\n const edges: DeclaredDependencyEdge[] = [];\n const buckets = new Map<string, DependencyEvidence[]>();\n for (const evidence of graph.edges.flatMap(edge => edge.evidence).filter(item => countedKinds.includes(item.kind) && contains(container.address, item.consumer.address)).sort(orderedEvidence)) {\n const candidates = [evidence.producer, ...evidence.alternatives].filter(producer => !contains(container.address, producer.address) && !contains(producer.scope.slice(0, -1).join('.'), container.address));\n if (!candidates.length) continue;\n const covering = declarations.filter(declaration => declaration.status !== 'invalid' && candidates.some(candidate => contains(declaration.resolved!, candidate.address)));\n for (const declaration of covering) declaration.status = evidence.ambiguous && declaration.status !== 'used' ? 'provisional' : 'used';\n const status = evidence.ambiguous ? 'provisional' : covering.length ? 'declared' : 'undeclared';\n edges.push({ evidence, status, coveringDeclarations: covering.map(declaration => declaration.syntax) });\n if (status === 'undeclared') {\n const module = evidence.producer.scope[0];\n if (!buckets.has(module)) buckets.set(module, []);\n buckets.get(module)!.push(evidence);\n }\n }\n for (const evidence of buckets.values()) {\n let prefix = evidence[0].producer.scope.slice(0, -1);\n const mismatch = prefix.findIndex((segment, index) => evidence.some(item => index >= item.producer.scope.length - 1 || item.producer.scope[index] !== segment));\n if (mismatch >= 0) prefix = prefix.slice(0, mismatch);\n const target = prefix.join('.');\n const suggestedTargets = contains(container.address, target) || contains(target, container.address)\n ? [...new Set(evidence.map(item => item.producer.scope.slice(0, -1).map((_, index) => item.producer.scope.slice(0, index + 1).join('.'))\n .find(candidate => !contains(container.address, candidate) && !contains(candidate, container.address))!))]\n : [target];\n const details = evidence.map(item => `${item.kind} ${item.role} '${item.name}' at ${item.location.path ?? ''}:${item.location.line}:${item.location.column}`).join('; ');\n finding(DiagnosticCodes.UndeclaredDependency, 'warning', `Container '${container.address}' depends on '${suggestedTargets.join(\"', '\")}' without declaring ${suggestedTargets.length === 1 ? 'it' : 'them'} - evidence: ${details}`, owner.location);\n }\n for (const declaration of declarations) {\n if (declaration.status === 'unused') finding(DiagnosticCodes.UnusedDependencyDeclaration, 'information', `Dependency '${declaration.syntax.target}' on '${container.address}' is not used by any counted explicit reference`, declaration.syntax.location);\n if (declaration.status !== 'invalid' && owners.get(declaration.resolved!)!.dependencies.some(dependency => resolve(dependency.target, declaration.resolved!.split('.')) === container.address)) {\n finding(DiagnosticCodes.MutualDependencyDeclarations, 'information', `Containers '${container.address}' and '${declaration.resolved}' declare each other`, declaration.syntax.location);\n }\n }\n containers.push({ container, location: owner.location, declarations, edges });\n }\n return { containers, diagnostics };\n }\n\n static validate(application: ApplicationSyntax, context: ParserContext): void {\n for (const diagnostic of this.for(application).diagnostics) context[diagnostic.severity === 'warning' ? 'warning' : 'information'](diagnostic.code, diagnostic.message, diagnostic.location);\n }\n}\n"],"mappings":"2PAgCA,MAAMA,EAAe,CAAC,gBAAiB,WAAY,cAAe,OAAQ,OAAO,EAC3E,UAAY,EAAmB,IAA6BC,IAAYC,GAAaD,EAAQ,WAAWC,EAAY,GAAG,EACvH,SAAW,EAAc,IAA0BC,EAAOC,EAAQ,GAAK,IAAOA,GAC9E,iBAAmB,EAA0B,IAAsC,QAAQD,EAAK,SAAS,MAAQ,GAAIC,EAAM,SAAS,MAAQ,EAAE,GAAKD,EAAK,SAAS,KAAOC,EAAM,SAAS,MAAQD,EAAK,SAAS,OAASC,EAAM,SAAS,QAAU,QAAQD,EAAK,KAAMC,EAAM,IAAI,GAAK,QAAQD,EAAK,SAAS,QAAS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,qBAAsB,UAAW,cAActC,EAAU,QAAQ,gBAAgBoC,EAAiB,KAAK,MAAM,EAAE,sBAAsBA,EAAiB,SAAW,EAAI,KAAO,OAAO,eAAeC,IAAW5B,EAAM,QAAQ,CACvP,CACA,IAAK,IAAMoB,KAAeT,EAClBS,EAAY,SAAW,UAAU,QAAQS,EAAgB,4BAA6B,cAAe,eAAeT,EAAY,OAAO,OAAO,QAAQ7B,EAAU,QAAQ,iDAAkD6B,EAAY,OAAO,QAAQ,EACrPA,EAAY,SAAW,WAAa1B,EAAO,IAAI0B,EAAY,QAAS,CAAC,CAAE,aAAa,KAAK,GAAc,QAAQU,EAAW,OAAQV,EAAY,SAAU,MAAM,GAAG,CAAC,IAAM7B,EAAU,OAAO,GACzL,QAAQsC,EAAgB,6BAA8B,cAAe,eAAetC,EAAU,QAAQ,SAAS6B,EAAY,SAAS,sBAAuBA,EAAY,OAAO,QAAQ,EAG9LX,EAAW,KAAK,CAAE,YAAW,SAAUT,EAAM,SAAU,eAAc,OAAM,CAAC,CAChF,CACA,MAAO,CAAE,aAAY,aAAY,CACrC,CAEA,OAAO,SAAS,EAAgC,EAA8B,CAC1E,IAAK,IAAM+B,KAAc,KAAK,IAAIjC,CAAW,CAAC,CAAC,YAAakC,EAAQD,EAAW,WAAa,UAAY,UAAY,cAAc,CAACA,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,CAC/L,CACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";const same=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),addressOf=e=>[...e.scope,e.name].join(`.`);var DeclaredDependencyTargets=class{static containersOf(e){let t=[],inventory=(e,n)=>{t.push({name:e.name,scope:n}),e.features.forEach(t=>inventory(t,[...n,e.name]))};for(let n of e.modules)t.push({name:n.name,scope:[]}),n.features.forEach(e=>inventory(e,[n.name]));return[...new Map(t.map(e=>[addressOf(e),e])).values()]}static candidates(e,t){let n=e.join(`.`);return t.flatMap(r=>{let i=addressOf(r);if(i===n||i.startsWith(n+`.`)||n.startsWith(i+`.`))return[];let a=[...r.scope,r.name];for(let n=1;n<=a.length;n++){let i=a.slice(-n).join(`.`);if(this.resolve(i,e,t).resolved===r)return[{container:r,reference:i,tier:n===1?e.length-1-r.scope.length:`qualified`}]}return[]}).sort((t,n)=>(t.tier===`qualified`?e.length:t.tier)-(n.tier===`qualified`?e.length:n.tier))}static resolve(e,t,n){let r=e.split(`.`);if(r.length>1){let e=n.filter(e=>same([...e.scope,e.name].slice(-r.length),r));return e.length===1?{resolved:e[0],ambiguous:[]}:{ambiguous:e}}for(let r=t.length-1;r>=0;r--){let i=n.filter(n=>n.name===e&&same(n.scope,t.slice(0,r)));if(i.length>0)return i.length===1?{resolved:i[0],ambiguous:[]}:{ambiguous:i}}return{ambiguous:[]}}};function validateDependencyDeclarations(t,n){let hasDependencies=e=>(e.dependsOn?.length??0)>0||e.features.some(hasDependencies);if(!t.modules.some(hasDependencies))return t;let r=DeclaredDependencyTargets.containersOf(t),i=/* @__PURE__ */ new Map,keep=(t,a)=>{let o=[],s=a.join(`.`);i.has(s)||i.set(s,/* @__PURE__ */ new Set);let c=i.get(s);for(let i of t){let t=DeclaredDependencyTargets.resolve(i.target,a,r),l=t.resolved===void 0?void 0:addressOf(t.resolved),u=l===void 0?`text:${i.target}`:`resolved:${l}`;c.has(u)?n.warning(e.RepeatedDependencyDeclaration,`Dependency '${i.target}' is already declared on this container - this repeated declaration is ignored`,i.location):(c.add(u),o.push(i),t.ambiguous.length>0?n.warning(e.AmbiguousReference,`Ambiguous dependency target '${i.target}' - candidates: ${t.ambiguous.map(addressOf).join(`, `)}`,i.location):(l===void 0||l===s||l.startsWith(s+`.`)||s.startsWith(l+`.`))&&n.warning(e.InvalidDependencyTarget,`Invalid dependency target '${i.target}' on '${s}' - the target must resolve to another module or feature, not self, an ancestor, or a descendant`,i.location))}return o},normalize=(e,t)=>{let n=[...t,e.name];return{...e,dependsOn:keep(e.dependsOn??[],n),features:e.features.map(e=>normalize(e,n))}};return{...t,modules:t.modules.map(e=>({...e,dependsOn:keep(e.dependsOn??[],[e.name]),features:e.features.map(t=>normalize(t,[e.name]))}))}}export{DeclaredDependencyTargets,validateDependencyDeclarations};
|
|
2
|
+
//# sourceMappingURL=DeclaredDependencyTargets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeclaredDependencyTargets.js","names":["left","right","segment","index","container","containers","feature","parent","child","module","application","owner","from","address","parts","length","reference","segments","matches","depth","seenByOwner","kept","seen","dependency","dependencies","resolution","target","key","context","DiagnosticCodes"],"sources":["../../../../../../Compiler/Dependencies/DeclaredDependencyTargets.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { ParserContext } from '../Parsing/ParserContext';\nimport { ApplicationSyntax, DependsOnSyntax, FeatureSyntax } from '../Syntax/Structure';\n\nexport interface DependencyContainer {\n readonly name: string;\n readonly scope: readonly string[];\n}\n\nconst same = (left: readonly string[], right: readonly string[]) => left.length === right.length && left.every((segment, index) => segment === right[index]);\nconst addressOf = (container: DependencyContainer) => [...container.scope, container.name].join('.');\n\n// Children sets only: siblings, ancestors' siblings, then root modules. Dotted references match suffixes.\nexport class DeclaredDependencyTargets {\n static containersOf(application: ApplicationSyntax): DependencyContainer[] {\n const containers: DependencyContainer[] = [];\n const inventory = (feature: FeatureSyntax, parent: readonly string[]): void => {\n containers.push({ name: feature.name, scope: parent });\n feature.features.forEach(child => inventory(child, [...parent, feature.name]));\n };\n for (const module of application.modules) {\n containers.push({ name: module.name, scope: [] });\n module.features.forEach(feature => inventory(feature, [module.name]));\n }\n return [...new Map(containers.map(container => [addressOf(container), container])).values()];\n }\n\n static candidates(from: readonly string[], containers: readonly DependencyContainer[]): { container: DependencyContainer; reference: string; tier: number | 'qualified' }[] {\n const owner = from.join('.');\n return containers.flatMap(container => {\n const address = addressOf(container);\n if (address === owner || address.startsWith(owner + '.') || owner.startsWith(address + '.')) return [];\n const parts = [...container.scope, container.name];\n for (let length = 1; length <= parts.length; length++) {\n const reference = parts.slice(-length).join('.');\n if (this.resolve(reference, from, containers).resolved !== container) continue;\n const tier: number | 'qualified' = length === 1 ? from.length - 1 - container.scope.length : 'qualified';\n return [{ container, reference, tier }];\n }\n return [];\n }).sort((left, right) => (left.tier === 'qualified' ? from.length : left.tier) - (right.tier === 'qualified' ? from.length : right.tier));\n }\n\n static resolve(reference: string, from: readonly string[], containers: readonly DependencyContainer[]): { resolved?: DependencyContainer; ambiguous: readonly DependencyContainer[] } {\n const segments = reference.split('.');\n if (segments.length > 1) {\n const matches = containers.filter(container => same([...container.scope, container.name].slice(-segments.length), segments));\n return matches.length === 1 ? { resolved: matches[0], ambiguous: [] } : { ambiguous: matches };\n }\n for (let depth = from.length - 1; depth >= 0; depth--) {\n const matches = containers.filter(container => container.name === reference && same(container.scope, from.slice(0, depth)));\n if (matches.length > 0) return matches.length === 1 ? { resolved: matches[0], ambiguous: [] } : { ambiguous: matches };\n }\n return { ambiguous: [] };\n }\n}\n\nexport function validateDependencyDeclarations(application: ApplicationSyntax, context: ParserContext): ApplicationSyntax {\n const hasDependencies = (container: { dependsOn?: readonly DependsOnSyntax[]; features: readonly FeatureSyntax[] }): boolean =>\n (container.dependsOn?.length ?? 0) > 0 || container.features.some(hasDependencies);\n if (!application.modules.some(hasDependencies)) return application;\n const containers = DeclaredDependencyTargets.containersOf(application);\n\n const seenByOwner = new Map<string, Set<string>>();\n const keep = (dependencies: readonly DependsOnSyntax[], from: readonly string[]): DependsOnSyntax[] => {\n const kept: DependsOnSyntax[] = [];\n const owner = from.join('.');\n if (!seenByOwner.has(owner)) seenByOwner.set(owner, new Set());\n const seen = seenByOwner.get(owner)!;\n for (const dependency of dependencies) {\n const resolution = DeclaredDependencyTargets.resolve(dependency.target, from, containers);\n const target = resolution.resolved === undefined ? undefined : addressOf(resolution.resolved);\n const key = target === undefined ? `text:${dependency.target}` : `resolved:${target}`;\n if (seen.has(key)) {\n context.warning(DiagnosticCodes.RepeatedDependencyDeclaration, `Dependency '${dependency.target}' is already declared on this container - this repeated declaration is ignored`, dependency.location);\n continue;\n }\n seen.add(key);\n kept.push(dependency);\n if (resolution.ambiguous.length > 0) {\n context.warning(DiagnosticCodes.AmbiguousReference, `Ambiguous dependency target '${dependency.target}' - candidates: ${resolution.ambiguous.map(addressOf).join(', ')}`, dependency.location);\n } else if (target === undefined || target === owner || target.startsWith(owner + '.') || owner.startsWith(target + '.')) {\n context.warning(DiagnosticCodes.InvalidDependencyTarget, `Invalid dependency target '${dependency.target}' on '${owner}' - the target must resolve to another module or feature, not self, an ancestor, or a descendant`, dependency.location);\n }\n }\n return kept;\n };\n const normalize = (feature: FeatureSyntax, parent: readonly string[]): FeatureSyntax => {\n const address = [...parent, feature.name];\n return { ...feature, dependsOn: keep(feature.dependsOn ?? [], address), features: feature.features.map(child => normalize(child, address)) };\n };\n return { ...application, modules: application.modules.map(module => ({ ...module, dependsOn: keep(module.dependsOn ?? [], [module.name]), features: module.features.map(feature => normalize(feature, [module.name])) })) };\n}\n"],"mappings":"yHAYA,MAAM,MAAQ,EAAyB,IAA6BA,EAAK,SAAWC,EAAM,QAAUD,EAAK,OAAO,EAAS,IAAUE,IAAYD,EAAME,EAAM,EACrJ,UAAa,GAAmC,CAAC,GAAGC,EAAU,MAAOA,EAAU,IAAI,CAAC,CAAC,KAAK,GAAG,EAGnG,IAAa,0BAAb,KAAuC,CACnC,OAAO,aAAa,EAAuD,CACvE,IAAMC,EAAoC,CAAC,EACrC,WAAa,EAAwB,IAAoC,CAC3EA,EAAW,KAAK,CAAE,KAAMC,EAAQ,KAAM,MAAOC,CAAO,CAAC,EACrDD,EAAQ,SAAS,QAAQ,GAAS,UAAUE,EAAO,CAAC,GAAGD,EAAQD,EAA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H,EAAW,SAAW,YAAYG,IACzEJ,EAAK,IAAIK,CAAG,EACZC,EAAQ,QAAQC,EAAgB,8BAA+B,eAAeN,EAAW,OAAO,gFAAiFA,EAAW,QAAQ,GAGxMD,EAAK,IAAIK,CAAG,EACZN,EAAK,KAAKE,CAAU,EAChBE,EAAW,UAAU,OAAS,EAC9BG,EAAQ,QAAQC,EAAgB,mBAAoB,gCAAgCN,EAAW,OAAO,kBAAkBE,EAAW,UAAU,IAAI,SAAS,CAAC,CAAC,KAAK,IAAI,IAAKF,EAAW,QAAQ,GACtLG,IAAW,IAAA,IAAaA,IAAWf,GAASe,EAAO,WAAWf,EAAQ,GAAG,GAAKA,EAAM,WAAWe,EAAS,GAAG,IAClHE,EAAQ,QAAQC,EAAgB,wBAAyB,8BAA8BN,EAAW,OAAO,QAAQZ,EAAM,kGAAmGY,EAAW,QAAQ,EAErP,CACA,OAAOF,CACX,EACM,WAAa,EAAwB,IAA6C,CACpF,IAAMR,EAAU,CAAC,GAAGN,EAAQD,EAAQ,IAAI,EACxC,MAAO,CAAE,GAAGA,EAAS,UAAW,KAAKA,EAAQ,WAAa,CAAC,EAAGO,CAAO,EAAG,SAAUP,EAAQ,SAAS,IAAI,GAAS,UAAUE,EAAOK,CAAO,CAAC,CAAE,CAC/I,EACA,MAAO,CAAE,GAAGH,EAAa,QAASA,EAAY,QAAQ,IAAI,IAAW,CAAE,GAAGD,EAAQ,UAAW,KAAKA,EAAO,WAAa,CAAC,EAAG,CAACA,EAAO,IAAI,CAAC,EAAG,SAAUA,EAAO,SAAS,IAAI,GAAW,UAAUH,EAAS,CAACG,EAAO,IAAI,CAAC,CAAC,CAAE,EAAE,CAAE,CAC9N"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{eventDeclarations as e}from"../Syntax/EventDeclarations.js";import{dependencySourcesOf as t}from"../Syntax/DependencySources.js";import{expandSpecificationExamples as n}from"../Parsing/SpecificationCommandExamples.js";import{authoredOrderKey as r,authoredOrderOf as i}from"../Files/AuthoredOrder.js";import{dependencyKinds as a}from"./DependencyKind.js";import{InvalidDependencyQuery as o}from"./InvalidDependencyQuery.js";import{sliceReferences as s}from"./SliceReferences.js";import{stronglyConnectedGroups as c}from"./StronglyConnectedGroups.js";const l=[`usesFactsFrom`,`reactsTo`,`decidesFrom`],ordinal=(e,t)=>e<t?-1:+(e>t),declarationKey=(e,t)=>JSON.stringify([e,t.toLowerCase()]),nodeOf=(e,t,n,r)=>({kind:e,address:t,scope:n,rank:r,key:`${e}:${t}`}),compareNodes=(e,t)=>e.rank-t.rank||ordinal(e.key,t.key),distinctNodes=e=>[...new Map([...e].map(e=>[e.key,e])).values()].sort(compareNodes),compareEvidence=(e,t)=>e.consumer.rank-t.consumer.rank||e.location.line-t.location.line||e.location.column-t.location.column||a.indexOf(e.kind)-a.indexOf(t.kind)||e.producer.rank-t.producer.rank||ordinal(e.location.path??``,t.location.path??``)||ordinal(e.role,t.role)||ordinal(e.name,t.name);function variants(e){return e.flatMap(e=>e.kind===`ProjectionVariantSyntax`?[e,...variants(e.blocks)]:e.kind===`ChildrenSyntax`||e.kind===`NestedSyntax`?variants(e.blocks):[])}var u=class DependencyGraph{orderSource;edges;unresolved;excludedReferences;unusedImports;modelNodes=[];slices=[];children=/* @__PURE__ */ new Map;byKey=/* @__PURE__ */ new Map;parents=/* @__PURE__ */ new Map;root=nodeOf(`application`,``,[],-1);static for(e,t=i(e)){return new DependencyGraph(e,t)}get nodes(){return this.modelNodes}constructor(i,o){i=n(i),this.orderSource=o.size>0?`authored`:`syntax`,this.children.set(this.root.key,[]);let ordered=(e,t)=>e.map((e,n)=>({syntax:e,index:n,rank:o.get(r([...t.scope,e.name]))??2**53-1})).sort((e,t)=>e.rank-t.rank||e.index-t.index).map(e=>e.syntax),feature=(e,t)=>{let n=this.add(`feature`,e.name,t);for(let t of ordered(e.slices,n))this.slices.push({node:this.add(`slice`,t.name,n),syntax:t});for(let t of ordered(e.features,n))feature(t,n)};for(let e of ordered(i.modules,this.root)){let t=this.add(`module`,e.name,this.root);for(let n of ordered(e.features,t))feature(n,t)}let c=/* @__PURE__ */ new Map,l=/* @__PURE__ */ new Map,declare=(e,t,n,r)=>{let i=declarationKey(t,n);e.has(i)||e.set(i,[]);let a=e.get(i);a.includes(r)||a.push(r);let o=declarationKey(t,[...r.scope,n].join(`.`));e.has(o)||e.set(o,[]);let s=e.get(o);s.includes(r)||s.push(r)};for(let{node:n,syntax:r}of this.slices){for(let t of e(r))declare(c,`Event`,t.name,n);for(let e of r.commands)declare(c,`Command`,e.name,n);for(let e of r.reactions)declare(c,`Reaction`,e.name,n);for(let e of r.queries)declare(c,`Query`,e.name,n);for(let e of r.screens)declare(c,`Screen`,e.name,n);for(let e of r.readModels)declare(c,`ReadModel`,e.name,n);for(let e of r.projections){let t=variants(e.blocks);t.length===0&&declare(l,`ReadModel`,e.readModel??e.name,n);for(let e of t)declare(l,`ReadModel`,e.name,n)}for(let e of t(r).reducers??[])declare(l,`ReadModel`,e.readModel,n)}let u=new Set((i.declaredTriggers??[]).map(e=>e.name.toLowerCase())),d=new Set([...i.concepts,...i.types].map(e=>e.name.toLowerCase())),f=new Set((i.policies??[]).map(e=>e.name.toLowerCase())),p=i.imports.filter(e=>e.qualifiedName.includes(`.`)).slice().sort((e,t)=>ordinal(e.location.path??``,t.location.path??``)||e.location.line-t.location.line||e.location.column-t.location.column||ordinal(e.qualifiedName,t.qualifiedName)),m=/* @__PURE__ */ new Map,h=[],g=[],_=/* @__PURE__ */ new Set,v=0;for(let{node:e,syntax:t}of this.slices){let n=s(t);v+=n.shared.filter(e=>(e.kind===`type`?d:f).has(e.name.toLowerCase())).length;for(let t of n.references){let n=declarationKey(t.targetKind,t.name),r=(t.targetKind===`ReadModel`&&l.has(n)?l:c).get(n);if(r!==void 0&&r.length>0){let n=r[0];n!==e&&h.push({consumer:e,producer:n,kind:t.kind,role:t.role,name:t.name,ambiguous:r.length>1,alternatives:r.slice(1),location:t.location,testOnly:t.kind===`verifiedWith`});continue}let i=t.targetKind===`Event`?p.filter(e=>e.qualifiedName.slice(e.qualifiedName.lastIndexOf(`.`)+1).toLowerCase()===t.name.toLowerCase()):[];if(i.length>0){let n=[];for(let e of i){_.add(e.qualifiedName);let t=e.qualifiedName.slice(0,e.qualifiedName.lastIndexOf(`.`)),r=`context:${t}`;if(!m.has(r)){let e=nodeOf(`context`,r,[t],this.modelNodes.length);this.modelNodes.push(e),m.set(r,e)}let i=m.get(r);n.includes(i)||n.push(i)}h.push({consumer:e,producer:n[0],kind:`outsideTheModel`,role:t.role,name:t.name,ambiguous:n.length>1,alternatives:n.slice(1),location:t.location,testOnly:t.kind===`verifiedWith`})}else t.role===`trigger`&&u.has(t.name.toLowerCase())?v++:g.push({consumer:e,kind:t.kind,role:t.role,name:t.name,location:t.location})}}let y=/* @__PURE__ */ new Map;for(let e of h.sort(compareEvidence)){let t=JSON.stringify([e.consumer.key,e.producer.key,e.kind]);y.has(t)||y.set(t,[]),y.get(t).push(e)}this.edges=[...y.values()].map(e=>({consumer:e[0].consumer,producer:e[0].producer,kind:e[0].kind,evidence:e})),this.unresolved=g.sort((e,t)=>e.consumer.rank-t.consumer.rank||e.location.line-t.location.line||e.location.column-t.location.column||a.indexOf(e.kind)-a.indexOf(t.kind)||ordinal(e.location.path??``,t.location.path??``)||ordinal(e.name,t.name)),this.excludedReferences=v,this.unusedImports=[...new Set(p.filter(e=>!_.has(e.qualifiedName)).map(e=>e.qualifiedName))]}implied(e,t,n,r=!1,i=3){if(![`slice`,`feature`,`module`].includes(e))throw new o(`Unsupported source level '${e}'.`);if(![`slice`,`feature`,`module`,`context`].includes(t))throw new o(`Unsupported target level '${t}'.`);if(i<0)throw new o(`Evidence limit must not be negative.`);let s=/* @__PURE__ */ new Map;for(let i of this.evidence(n,r))for(let n of this.at(i.consumer,e))for(let e of this.at(i.producer,t).filter(e=>this.disjoint(n,e))){let t=JSON.stringify([n.key,e.key]);s.has(t)||s.set(t,{source:n,target:e,evidence:[]}),s.get(t).evidence.push(i)}return[...s.values()].sort((e,t)=>e.source.rank-t.source.rank||e.target.rank-t.target.rank||ordinal(e.source.key,t.source.key)||ordinal(e.target.key,t.target.key)).map(e=>{let t=e.evidence.sort(compareEvidence),n={};for(let e of a){let r=t.filter(t=>t.kind===e).length;r>0&&(n[e]=r)}return{source:e.source,target:e.target,sliceEdges:new Set(t.map(e=>JSON.stringify([e.consumer.key,e.producer.key]))).size,references:t.length,byKind:n,consumers:distinctNodes(t.map(e=>e.consumer)),producers:distinctNodes(t.map(e=>e.producer)),evidence:t.slice(0,i),evidenceCount:t.length,evidenceTruncated:t.length>i}})}cycles(e,t){if(![`slice`,`feature`,`module`].includes(e))throw new o(`Unsupported cycle level '${e}'.`);let n=this.implied(e,e,selectedOrderingKinds(t)),r=distinctNodes(n.flatMap(e=>[e.source,e.target]));return groupsOf(adjacency(r,n),r,null)}siblingGroups(e){let t=this.siblingEdges(e);return this.containers().flatMap(e=>{let n=this.children.get(e.key);return groupsOf(adjacency(n,t.filter(t=>t.container===e)),n,e)})}suggestedOrder(e){let t=this.siblingEdges(e),n=[];for(let e of this.containers()){let r=this.children.get(e.key),i=t.filter(t=>t.container===e),a=new Map(r.map(e=>[e.key,e])),o=c(adjacency(r,i)).map(e=>e.map(e=>a.get(e)).sort(compareNodes)).sort((e,t)=>e[0].rank-t[0].rank),s=new Map(o.flatMap((e,t)=>e.map(e=>[e.key,t]))),l=new Map(r.map(e=>[e.key,/* @__PURE__ */ new Set]));for(let e of i)s.get(e.source.key)!==s.get(e.target.key)&&l.get(e.source.key).add(e.target.key);for(let e of o)for(let t=1;t<e.length;t++)l.get(e[t].key).add(e[t-1].key);let u=new Set(r.map(e=>e.key)),d=[];for(;u.size>0;){let e=[...u].filter(e=>l.get(e).size===0).sort((e,t)=>compareNodes(a.get(e),a.get(t)))[0];d.push(a.get(e)),u.delete(e);for(let t of u)l.get(t).delete(e)}n.push({container:e,children:d,changed:r.some((e,t)=>e!==d[t])})}let r=new Map(n.map(e=>[e.container.key,e.children])),i=[],walk=e=>{if(e.kind===`slice`)i.push(e);else for(let t of[...r.get(e.key)].sort((e,t)=>Number(e.kind!==`slice`)-Number(t.kind!==`slice`)))walk(t)};return walk(this.root),{containers:n,slices:i}}traverse(e,t,n,r=!1){if(t!==`incoming`&&t!==`outgoing`)throw new o(`Unsupported dependency direction '${t}'.`);let i=this.evidence(n,r).map(e=>t===`incoming`?{source:e.producer,target:e.consumer}:{source:e.consumer,target:e.producer}),a=/* @__PURE__ */ new Set([e]),s=[e],c=[];for(let e=0;e<s.length;e++)for(let t of i.filter(t=>t.source.address===s[e]).sort((e,t)=>e.target.rank-t.target.rank))a.has(t.target.address)||(a.add(t.target.address),c.push(t.target),s.push(t.target.address));return distinctNodes(c)}add(e,t,n){let r=[...n.scope,t],i=r.join(`.`),a=`${e}:${i}`,o=this.byKey.get(a);if(o!==void 0)return o;let s=nodeOf(e,i,r,this.modelNodes.length);return this.modelNodes.push(s),this.byKey.set(a,s),this.parents.set(a,n),this.children.get(n.key).push(s),e!==`slice`&&this.children.set(a,[]),s}ancestors(e){let t=[];for(let n=this.parents.get(e.key);n!==void 0;n=this.parents.get(n.key))t.push(n);return t}disjoint(e,t){return e.key!==t.key&&!this.ancestors(e).includes(t)&&!this.ancestors(t).includes(e)}at(e,t){return[e,...this.ancestors(e)].filter(e=>e.kind===t)}containers(){return[this.root,...this.modelNodes.filter(e=>e.kind===`module`||e.kind===`feature`)]}evidence(e,t){let n=selectedKinds(e);return this.edges.flatMap(e=>e.evidence).filter(e=>n.has(e.kind)&&(t||!e.testOnly))}path(e){return[...this.ancestors(e).reverse(),e].filter(e=>e!==this.root)}siblingEdges(e){let t=[];for(let n of this.evidence(selectedOrderingKinds(e),!1)){let e=this.path(n.consumer),r=this.path(n.producer),i=0;for(;i<e.length&&i<r.length&&e[i].key===r[i].key;)i++;i!==e.length&&i!==r.length&&t.push({container:i===0?this.root:e[i-1],source:e[i],target:r[i]})}return t}};function selectedKinds(e){let t=new Set(e??a);if([...t].some(e=>!a.includes(e)))throw new o(`Unsupported dependency kind.`);return t}function selectedOrderingKinds(e){return[...selectedKinds(e??l)].filter(e=>l.includes(e))}function adjacency(e,t){let n=new Map(e.map(e=>[e.key,/* @__PURE__ */ new Set]));for(let e of t)n.get(e.source.key).add(e.target.key);return n}function groupsOf(e,t,n){let r=new Map(t.map(e=>[e.key,e]));return c(e).filter(e=>e.length>1).map(e=>({container:n,members:distinctNodes(e.map(e=>r.get(e)))})).sort((e,t)=>e.members[0].rank-t.members[0].rank)}export{u as DependencyGraph};
|
|
2
|
+
//# sourceMappingURL=DependencyGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyGraph.js","names":["orderingKinds","left","right","kind","name","address","nodes","node","dependencyKinds","blocks","block","DependencyGraph","authoredOrderOf","application","ranks","expandSpecificationExamples","items","authoredOrderKey","parent","syntax","item","slice","child","module","declarations","builders","key","inventory","owners","qualified","scopedOwners","event","eventDeclarations","command","reaction","query","screen","readModel","projection","found","variant","reducer","dependencySourcesOf","foundations","trigger","sharedTypes","type","sharedPolicies","policy","imports","imported","contexts","evidence","unresolved","usedImports","excluded","collected","sliceReferences","reference","candidates","producer","matches","contract","contextName","context","edgeGroups","group","from","InvalidDependencyQuery","to","evidenceLimit","groups","kinds","includeTestOnly","source","target","byKind","count","level","edges","edge","children","container","suggestions","local","byKey","stronglyConnectedGroups","membership","index","dependencies","remaining","ordered","ready","orders","slices","direction","links","visited","queue","link","scope","existing","ancestors","selected","consumer","common","graph"],"sources":["../../../../../../Compiler/Dependencies/DependencyGraph.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { authoredOrderKey, authoredOrderOf } from '../Files/AuthoredOrder';\nimport { expandSpecificationExamples } from '../Parsing/SpecificationCommandExamples';\nimport { dependencySourcesOf } from '../Syntax/DependencySources';\nimport { eventDeclarations } from '../Syntax/EventDeclarations';\nimport { ProjectionBlockSyntax, ProjectionVariantSyntax } from '../Syntax/Projections';\nimport { ApplicationSyntax, FeatureSyntax, SliceSyntax } from '../Syntax/Structure';\nimport type { DependencyKind, DependencyNode, DependencyLevel, DependencyEvidence, DependencyEdge, UnresolvedDependency, ImpliedDependency, DependencyGroup, DependencyOrder, DependencyContainerOrder } from './index';\nimport { dependencyKinds } from './DependencyKind';\nimport { InvalidDependencyQuery } from './InvalidDependencyQuery';\nimport { SiblingEdge } from './SiblingEdge';\nimport { sliceReferences } from './SliceReferences';\nimport { stronglyConnectedGroups } from './StronglyConnectedGroups';\n\nconst orderingKinds: readonly string[] = ['usesFactsFrom', 'reactsTo', 'decidesFrom'];\nconst ordinal = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0;\nconst declarationKey = (kind: string, name: string): string => JSON.stringify([kind, name.toLowerCase()]);\nconst nodeOf = (kind: DependencyLevel, address: string, scope: readonly string[], rank: number): DependencyNode => ({ kind, address, scope, rank, key: `${kind}:${address}` });\nconst compareNodes = (left: DependencyNode, right: DependencyNode): number => left.rank - right.rank || ordinal(left.key, right.key);\nconst distinctNodes = (nodes: Iterable<DependencyNode>): DependencyNode[] => [...new Map([...nodes].map(node => [node.key, node])).values()].sort(compareNodes);\nconst compareEvidence = (left: DependencyEvidence, right: DependencyEvidence): number => left.consumer.rank - right.consumer.rank || left.location.line - right.location.line || left.location.column - right.location.column || dependencyKinds.indexOf(left.kind) - dependencyKinds.indexOf(right.kind) || left.producer.rank - right.producer.rank || ordinal(left.location.path ?? '', right.location.path ?? '') || ordinal(left.role, right.role) || ordinal(left.name, right.name);\n\nfunction variants(blocks: readonly ProjectionBlockSyntax[]): ProjectionVariantSyntax[] {\n return blocks.flatMap(block => block.kind === 'ProjectionVariantSyntax' ? [block, ...variants(block.blocks)] : block.kind === 'ChildrenSyntax' || block.kind === 'NestedSyntax' ? variants(block.blocks) : []);\n}\n\n/** Presentation dependencies inferred from explicit syntax, independently of executable binding and identity. */\nexport class DependencyGraph {\n readonly orderSource: 'authored' | 'syntax';\n readonly edges: readonly DependencyEdge[];\n readonly unresolved: readonly UnresolvedDependency[];\n readonly excludedReferences: number;\n readonly unusedImports: readonly string[];\n private readonly modelNodes: DependencyNode[] = [];\n private readonly slices: { node: DependencyNode; syntax: SliceSyntax }[] = [];\n private readonly children = new Map<string, DependencyNode[]>();\n private readonly byKey = new Map<string, DependencyNode>();\n private readonly parents = new Map<string, DependencyNode>();\n private readonly root = nodeOf('application', '', [], -1);\n\n static for(application: ApplicationSyntax, ranks: ReadonlyMap<string, number> = authoredOrderOf(application)): DependencyGraph {\n return new DependencyGraph(application, ranks);\n }\n\n get nodes(): readonly DependencyNode[] { return this.modelNodes; }\n\n private constructor(application: ApplicationSyntax, ranks: ReadonlyMap<string, number>) {\n application = expandSpecificationExamples(application);\n this.orderSource = ranks.size > 0 ? 'authored' : 'syntax';\n this.children.set(this.root.key, []);\n const ordered = <T extends { name: string }>(items: readonly T[], parent: DependencyNode): T[] => items\n .map((syntax, index) => ({ syntax, index, rank: ranks.get(authoredOrderKey([...parent.scope, syntax.name])) ?? Number.MAX_SAFE_INTEGER }))\n .sort((left, right) => left.rank - right.rank || left.index - right.index).map(item => item.syntax);\n const feature = (syntax: FeatureSyntax, parent: DependencyNode) => {\n const node = this.add('feature', syntax.name, parent);\n for (const slice of ordered(syntax.slices, node)) this.slices.push({ node: this.add('slice', slice.name, node), syntax: slice });\n for (const child of ordered(syntax.features, node)) feature(child, node);\n };\n for (const module of ordered(application.modules, this.root)) {\n const node = this.add('module', module.name, this.root);\n for (const child of ordered(module.features, node)) feature(child, node);\n }\n const declarations = new Map<string, DependencyNode[]>();\n const builders = new Map<string, DependencyNode[]>();\n const declare = (inventory: Map<string, DependencyNode[]>, kind: string, name: string, node: DependencyNode) => {\n const key = declarationKey(kind, name);\n if (!inventory.has(key)) inventory.set(key, []);\n const owners = inventory.get(key)!;\n if (!owners.includes(node)) owners.push(node);\n const qualified = declarationKey(kind, [...node.scope, name].join('.'));\n if (!inventory.has(qualified)) inventory.set(qualified, []);\n const scopedOwners = inventory.get(qualified)!;\n if (!scopedOwners.includes(node)) scopedOwners.push(node);\n };\n for (const { node, syntax } of this.slices) {\n for (const event of eventDeclarations(syntax)) declare(declarations, 'Event', event.name, node);\n for (const command of syntax.commands) declare(declarations, 'Command', command.name, node);\n for (const reaction of syntax.reactions) declare(declarations, 'Reaction', reaction.name, node);\n for (const query of syntax.queries) declare(declarations, 'Query', query.name, node);\n for (const screen of syntax.screens) declare(declarations, 'Screen', screen.name, node);\n for (const readModel of syntax.readModels) declare(declarations, 'ReadModel', readModel.name, node);\n for (const projection of syntax.projections) {\n const found = variants(projection.blocks);\n if (found.length === 0) declare(builders, 'ReadModel', projection.readModel ?? projection.name, node);\n for (const variant of found) declare(builders, 'ReadModel', variant.name, node);\n }\n for (const reducer of dependencySourcesOf(syntax).reducers ?? []) declare(builders, 'ReadModel', reducer.readModel, node);\n }\n const foundations = new Set((application.declaredTriggers ?? []).map(trigger => trigger.name.toLowerCase()));\n const sharedTypes = new Set([...application.concepts, ...application.types].map(type => type.name.toLowerCase()));\n const sharedPolicies = new Set((application.policies ?? []).map(policy => policy.name.toLowerCase()));\n const imports = application.imports.filter(imported => imported.qualifiedName.includes('.')).slice().sort((left, right) => ordinal(left.location.path ?? '', right.location.path ?? '') || left.location.line - right.location.line || left.location.column - right.location.column || ordinal(left.qualifiedName, right.qualifiedName));\n const contexts = new Map<string, DependencyNode>();\n const evidence: DependencyEvidence[] = [];\n const unresolved: UnresolvedDependency[] = [];\n const usedImports = new Set<string>();\n let excluded = 0;\n for (const { node, syntax } of this.slices) {\n const collected = sliceReferences(syntax);\n excluded += collected.shared.filter(reference => (reference.kind === 'type' ? sharedTypes : sharedPolicies).has(reference.name.toLowerCase())).length;\n for (const reference of collected.references) {\n const key = declarationKey(reference.targetKind, reference.name);\n const inventory = reference.targetKind === 'ReadModel' && builders.has(key) ? builders : declarations;\n const candidates = inventory.get(key);\n if (candidates !== undefined && candidates.length > 0) {\n const producer = candidates[0];\n if (producer !== node) evidence.push({ consumer: node, producer, kind: reference.kind, role: reference.role, name: reference.name, ambiguous: candidates.length > 1, alternatives: candidates.slice(1), location: reference.location, testOnly: reference.kind === 'verifiedWith' });\n continue;\n }\n const imported = reference.targetKind === 'Event' ? imports.filter(imported => imported.qualifiedName.slice(imported.qualifiedName.lastIndexOf('.') + 1).toLowerCase() === reference.name.toLowerCase()) : [];\n if (imported.length > 0) {\n const matches: DependencyNode[] = [];\n for (const contract of imported) {\n usedImports.add(contract.qualifiedName);\n const contextName = contract.qualifiedName.slice(0, contract.qualifiedName.lastIndexOf('.'));\n const address = `context:${contextName}`;\n if (!contexts.has(address)) {\n const context = nodeOf('context', address, [contextName], this.modelNodes.length);\n this.modelNodes.push(context);\n contexts.set(address, context);\n }\n const context = contexts.get(address)!;\n if (!matches.includes(context)) matches.push(context);\n }\n evidence.push({ consumer: node, producer: matches[0], kind: 'outsideTheModel', role: reference.role, name: reference.name, ambiguous: matches.length > 1, alternatives: matches.slice(1), location: reference.location, testOnly: reference.kind === 'verifiedWith' });\n continue;\n }\n if (reference.role === 'trigger' && foundations.has(reference.name.toLowerCase())) {\n excluded++;\n continue;\n }\n unresolved.push({ consumer: node, kind: reference.kind, role: reference.role, name: reference.name, location: reference.location });\n }\n }\n const edgeGroups = new Map<string, DependencyEvidence[]>();\n for (const item of evidence.sort(compareEvidence)) {\n const key = JSON.stringify([item.consumer.key, item.producer.key, item.kind]);\n if (!edgeGroups.has(key)) edgeGroups.set(key, []);\n edgeGroups.get(key)!.push(item);\n }\n this.edges = [...edgeGroups.values()].map(group => ({ consumer: group[0].consumer, producer: group[0].producer, kind: group[0].kind, evidence: group }));\n this.unresolved = unresolved.sort((left, right) => left.consumer.rank - right.consumer.rank || left.location.line - right.location.line || left.location.column - right.location.column || dependencyKinds.indexOf(left.kind) - dependencyKinds.indexOf(right.kind) || ordinal(left.location.path ?? '', right.location.path ?? '') || ordinal(left.name, right.name));\n this.excludedReferences = excluded;\n this.unusedImports = [...new Set(imports.filter(imported => !usedImports.has(imported.qualifiedName)).map(imported => imported.qualifiedName))];\n }\n\n /** Aggregate any level pair, excluding equal and overlapping containers. Counts include capped evidence. */\n implied(from: string, to: string, kinds?: Iterable<string>, includeTestOnly = false, evidenceLimit = 3): ImpliedDependency[] {\n if (!['slice', 'feature', 'module'].includes(from)) throw new InvalidDependencyQuery(`Unsupported source level '${from}'.`);\n if (!['slice', 'feature', 'module', 'context'].includes(to)) throw new InvalidDependencyQuery(`Unsupported target level '${to}'.`);\n if (evidenceLimit < 0) throw new InvalidDependencyQuery('Evidence limit must not be negative.');\n const groups = new Map<string, { source: DependencyNode; target: DependencyNode; evidence: DependencyEvidence[] }>();\n for (const item of this.evidence(kinds, includeTestOnly)) {\n for (const source of this.at(item.consumer, from)) {\n for (const target of this.at(item.producer, to).filter(target => this.disjoint(source, target))) {\n const key = JSON.stringify([source.key, target.key]);\n if (!groups.has(key)) groups.set(key, { source, target, evidence: [] });\n groups.get(key)!.evidence.push(item);\n }\n }\n }\n return [...groups.values()].sort((left, right) => left.source.rank - right.source.rank || left.target.rank - right.target.rank || ordinal(left.source.key, right.source.key) || ordinal(left.target.key, right.target.key)).map(group => {\n const evidence = group.evidence.sort(compareEvidence);\n const byKind: Partial<Record<DependencyKind, number>> = {};\n for (const kind of dependencyKinds) {\n const count = evidence.filter(item => item.kind === kind).length;\n if (count > 0) byKind[kind] = count;\n }\n return { source: group.source, target: group.target, sliceEdges: new Set(evidence.map(item => JSON.stringify([item.consumer.key, item.producer.key]))).size, references: evidence.length, byKind, consumers: distinctNodes(evidence.map(item => item.consumer)), producers: distinctNodes(evidence.map(item => item.producer)), evidence: evidence.slice(0, evidenceLimit), evidenceCount: evidence.length, evidenceTruncated: evidence.length > evidenceLimit };\n });\n }\n\n /** Mutual dependencies at a single level; only story-ordering kinds can constrain cycles. */\n cycles(level: string, kinds?: Iterable<string>): DependencyGroup[] {\n if (!['slice', 'feature', 'module'].includes(level)) throw new InvalidDependencyQuery(`Unsupported cycle level '${level}'.`);\n const edges = this.implied(level, level, selectedOrderingKinds(kinds));\n const nodes = distinctNodes(edges.flatMap(edge => [edge.source, edge.target]));\n return groupsOf(adjacency(nodes, edges), nodes, null);\n }\n\n siblingGroups(kinds?: Iterable<string>): DependencyGroup[] {\n const edges = this.siblingEdges(kinds);\n return this.containers().flatMap(container => {\n const children = this.children.get(container.key)!;\n return groupsOf(adjacency(children, edges.filter(edge => edge.container === container)), children, container);\n });\n }\n\n /** Producers first via Kahn, preserving authored rank ties and cycle members' relative order. Never applied. */\n suggestedOrder(kinds?: Iterable<string>): DependencyOrder {\n const edges = this.siblingEdges(kinds);\n const suggestions: DependencyContainerOrder[] = [];\n for (const container of this.containers()) {\n const children = this.children.get(container.key)!;\n const local = edges.filter(edge => edge.container === container);\n const byKey = new Map(children.map(node => [node.key, node]));\n const groups = stronglyConnectedGroups(adjacency(children, local)).map(group => group.map(key => byKey.get(key)!).sort(compareNodes)).sort((left, right) => left[0].rank - right[0].rank);\n const membership = new Map(groups.flatMap((group, index) => group.map(node => [node.key, index] as const)));\n const dependencies = new Map(children.map(node => [node.key, new Set<string>()]));\n for (const edge of local) if (membership.get(edge.source.key) !== membership.get(edge.target.key)) dependencies.get(edge.source.key)!.add(edge.target.key);\n // Remove cycle-internal edges, not unrelated children. A cycle need not become contiguous.\n for (const group of groups) for (let index = 1; index < group.length; index++) dependencies.get(group[index].key)!.add(group[index - 1].key);\n const remaining = new Set(children.map(node => node.key));\n const ordered: DependencyNode[] = [];\n while (remaining.size > 0) {\n const ready = [...remaining].filter(key => dependencies.get(key)!.size === 0).sort((left, right) => compareNodes(byKey.get(left)!, byKey.get(right)!))[0];\n ordered.push(byKey.get(ready)!);\n remaining.delete(ready);\n for (const key of remaining) dependencies.get(key)!.delete(ready);\n }\n suggestions.push({ container, children: ordered, changed: children.some((node, index) => node !== ordered[index]) });\n }\n const orders = new Map(suggestions.map(item => [item.container.key, item.children]));\n const slices: DependencyNode[] = [];\n const walk = (node: DependencyNode) => {\n if (node.kind === 'slice') slices.push(node);\n else for (const child of [...orders.get(node.key)!].sort((left, right) => Number(left.kind !== 'slice') - Number(right.kind !== 'slice'))) walk(child);\n };\n walk(this.root);\n return { containers: suggestions, slices };\n }\n\n traverse(address: string, direction: string, kinds?: Iterable<string>, includeTestOnly = false): DependencyNode[] {\n if (direction !== 'incoming' && direction !== 'outgoing') throw new InvalidDependencyQuery(`Unsupported dependency direction '${direction}'.`);\n const links = this.evidence(kinds, includeTestOnly).map(item => direction === 'incoming' ? { source: item.producer, target: item.consumer } : { source: item.consumer, target: item.producer });\n const visited = new Set([address]);\n const queue = [address];\n const nodes: DependencyNode[] = [];\n for (let index = 0; index < queue.length; index++) {\n for (const link of links.filter(link => link.source.address === queue[index]).sort((left, right) => left.target.rank - right.target.rank)) {\n if (visited.has(link.target.address)) continue;\n visited.add(link.target.address);\n nodes.push(link.target);\n queue.push(link.target.address);\n }\n }\n return distinctNodes(nodes);\n }\n\n private add(kind: DependencyLevel, name: string, parent: DependencyNode): DependencyNode {\n const scope = [...parent.scope, name];\n const address = scope.join('.');\n const key = `${kind}:${address}`;\n const existing = this.byKey.get(key);\n if (existing !== undefined) return existing;\n const node = nodeOf(kind, address, scope, this.modelNodes.length);\n this.modelNodes.push(node);\n this.byKey.set(key, node);\n this.parents.set(key, parent);\n this.children.get(parent.key)!.push(node);\n if (kind !== 'slice') this.children.set(key, []);\n return node;\n }\n private ancestors(node: DependencyNode): DependencyNode[] {\n const ancestors: DependencyNode[] = [];\n for (let parent = this.parents.get(node.key); parent !== undefined; parent = this.parents.get(parent.key)) ancestors.push(parent);\n return ancestors;\n }\n private disjoint(left: DependencyNode, right: DependencyNode): boolean {\n return left.key !== right.key && !this.ancestors(left).includes(right) && !this.ancestors(right).includes(left);\n }\n private at(node: DependencyNode, level: string): DependencyNode[] { return [node, ...this.ancestors(node)].filter(node => node.kind === level); }\n private containers(): DependencyNode[] { return [this.root, ...this.modelNodes.filter(node => node.kind === 'module' || node.kind === 'feature')]; }\n private evidence(kinds: Iterable<string> | undefined, includeTestOnly: boolean): DependencyEvidence[] {\n const selected = selectedKinds(kinds);\n return this.edges.flatMap(edge => edge.evidence).filter(item => selected.has(item.kind) && (includeTestOnly || !item.testOnly));\n }\n private path(node: DependencyNode): DependencyNode[] { return [...this.ancestors(node).reverse(), node].filter(node => node !== this.root); }\n private siblingEdges(kinds?: Iterable<string>): SiblingEdge[] {\n const edges: SiblingEdge[] = [];\n for (const item of this.evidence(selectedOrderingKinds(kinds), false)) {\n const consumer = this.path(item.consumer);\n const producer = this.path(item.producer);\n let common = 0;\n while (common < consumer.length && common < producer.length && consumer[common].key === producer[common].key) common++;\n if (common === consumer.length || common === producer.length) continue;\n edges.push({ container: common === 0 ? this.root : consumer[common - 1], source: consumer[common], target: producer[common] });\n }\n return edges;\n }\n}\n\nfunction selectedKinds(kinds?: Iterable<string>): Set<string> {\n const selected = new Set(kinds ?? dependencyKinds);\n if ([...selected].some(kind => !(dependencyKinds as readonly string[]).includes(kind))) throw new InvalidDependencyQuery('Unsupported dependency kind.');\n return selected;\n}\nfunction selectedOrderingKinds(kinds?: Iterable<string>): string[] { return [...selectedKinds(kinds ?? orderingKinds)].filter(kind => orderingKinds.includes(kind)); }\nfunction adjacency(nodes: readonly DependencyNode[], edges: readonly { source: DependencyNode; target: DependencyNode }[]): Map<string, Set<string>> {\n const graph = new Map(nodes.map(node => [node.key, new Set<string>()]));\n for (const edge of edges) graph.get(edge.source.key)!.add(edge.target.key);\n return graph;\n}\nfunction groupsOf(graph: ReadonlyMap<string, ReadonlySet<string>>, nodes: readonly DependencyNode[], container: DependencyNode | null): DependencyGroup[] {\n const byKey = new Map(nodes.map(node => [node.key, node]));\n return stronglyConnectedGroups(graph).filter(group => group.length > 1).map(group => ({ container, members: distinctNodes(group.map(key => byKey.get(key)!)) })).sort((left, right) => left.members[0].rank - right.members[0].rank);\n}\n"],"mappings":"imBAgBA,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,IAAI,GAAOmB,EAAM,IAAI3D,CAAG,CAAE,CAAC,CAAE,EAAE,CAAC,CAAC,MAAM,EAAM,IAAUzB,EAAK,QAAQ,EAAE,CAAC,KAAOC,EAAM,QAAQ,EAAE,CAAC,IAAI,CACvO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyKind.js","names":["dependencyKinds"],"sources":["../../../../../../Compiler/Dependencies/DependencyKind.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// String values follow the C# graph's reference-role contract, like the compiler's syntax kind unions.\nexport const dependencyKinds = ['usesFactsFrom', 'reactsTo', 'decidesFrom', 'asks', 'shows', 'verifiedWith', 'outsideTheModel'] as const;\nexport type DependencyKind = typeof dependencyKinds[number];\n"],"mappings":"AAIA,MAAaA,EAAkB,CAAC,gBAAiB,WAAY,cAAe,OAAQ,QAAS,eAAgB,iBAAiB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvalidDependencyQuery.js","names":[],"sources":["../../../../../../Compiler/Dependencies/InvalidDependencyQuery.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nexport class InvalidDependencyQuery extends Error {}\n"],"mappings":"qDAGA,IAAa,uBAAb,cAA4C,KAAM,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{dependencySourcesOf as e}from"../Syntax/DependencySources.js";import{ScreenplaySyntaxWalker as t}from"../Syntax/ScreenplaySyntaxWalker.js";const n={from:`usesFactsFrom`,join:`usesFactsFrom`,remove:`usesFactsFrom`,removeViaJoin:`usesFactsFrom`,clear:`usesFactsFrom`,entersOn:`usesFactsFrom`,reduces:`usesFactsFrom`,uniqueEvent:`usesFactsFrom`,uniqueProperty:`usesFactsFrom`,concurrency:`usesFactsFrom`,trigger:`reactsTo`,reads:`decidesFrom`,invokes:`asks`,action:`asks`,actionAlternative:`asks`,actionOtherwise:`asks`,formCommand:`asks`,dataQuery:`shows`,populate:`shows`,navigate:`shows`,whenRedeliveredEvent:`verifiedWith`,redeliveryReaction:`verifiedWith`,refusalConstraint:null,refusalProduces:null,specificationEvent:`verifiedWith`,givenEvent:`verifiedWith`,whenAppendedEvent:`verifiedWith`,thenEvent:`verifiedWith`,whenCommand:`verifiedWith`,declares:null,uses:null,commandEventSource:null,commandStream:null,specificationEventSource:null,specificationStream:null,thenOperation:null,givenOperationFailure:null,thenCompensated:null,produces:null,authorizes:null,queryResult:null,dataReadModel:null,type:null,exampleType:null,contributes:null,template:null,specificationReadModel:null,thenAbsentReadModel:null,thenReadModel:null,givenReadModel:null,thenQuery:null,compositeKeyType:null,builds:null,buildsVariant:null,appends:null,seed:null};function sliceReferences(e){let t=new SliceReferenceCollector;return t.visitSlice(e),{references:t.references.sort((e,t)=>e.location.line-t.location.line||e.location.column-t.location.column),shared:t.shared}}function buildingReadModelReferences(t,n){let r=new SliceReferenceCollector(n);return t.projections.forEach(e=>r.visitProjection(e)),e(t).reducers?.filter(e=>e.readModel.toLowerCase()===n.toLowerCase()).forEach(e=>r.visitReducer(e)),r.references}function variants(e){return e.flatMap(e=>e.kind===`ProjectionVariantSyntax`?[e,...variants(e.blocks)]:e.kind===`ChildrenSyntax`||e.kind===`NestedSyntax`?variants(e.blocks):[])}var SliceReferenceCollector=class extends t{readModel;references=[];shared=[];specification;projection=!1;constructor(e){super(),this.readModel=e}matches(e){return e.toLowerCase()===this.readModel?.toLowerCase()}visitSlice(t){super.visitSlice(t),e(t).reducers?.forEach(e=>this.visitReducer(e))}visitCommand(t){let n=e(t);n.reads?.forEach(e=>this.visitReads(e)),n.concurrency!=null&&this.visitConcurrency(n.concurrency),super.visitCommand(t)}visitReactionTrigger(t){let n=e(t);n.data?.forEach(e=>this.visitTriggerData(e)),n.reads?.forEach(e=>this.visitReads(e)),super.visitReactionTrigger(t)}visitProjection(e){if(this.readModel!==void 0){let t=variants(e.blocks);if(t.length===0?!this.matches(e.readModel??e.name):!t.some(e=>this.matches(e.name)))return}this.projection=!0,super.visitProjection(e),this.projection=!1}visitSpecification(e){this.specification=e,super.visitSpecification(e),this.specification=void 0}visitNode(e){let add=(t,r,i)=>{this.references.push({name:t,targetKind:r,role:i,kind:n[i],location:e.location,timeline:this.projection||[`trigger`,`reads`,`reduces`].includes(i)})};switch(e.kind){case`TypeRefSyntax`:{let t=e.name;[`Uuid`,`String`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`].includes(t)||this.shared.push({kind:`type`,name:t});break}case`PolicyReferenceSyntax`:this.shared.push({kind:`policy`,name:e.name});break;case`EventSpecSyntax`:add(e.event,`Event`,`from`);break;case`JoinEventSyntax`:add(e.event,`Event`,`join`);break;case`RemoveWithSyntax`:add(e.event,`Event`,`remove`);break;case`RemoveViaJoinSyntax`:add(e.event,`Event`,`removeViaJoin`);break;case`ClearWithSyntax`:add(e.event,`Event`,`clear`);break;case`ProjectionEntersOnSyntax`:add(e.event,`Event`,`entersOn`);break;case`ReducerRuleSyntax`:add(e.event,`Event`,`reduces`);break;case`UniqueEventConstraintSyntax`:add(e.event,`Event`,`uniqueEvent`);break;case`UniquePropertyConstraintSyntax`:add(e.event,`Event`,`uniqueProperty`);break;case`NamedTriggerSourceSyntax`:add(e.name,`Event`,`trigger`);break;case`ReadsSyntax`:add(e.readModel,`ReadModel`,`reads`);break;case`InvokesSyntax`:add(e.command,`Command`,`invokes`);break;case`ScreenActionSyntax`:add(e.command,`Command`,`action`);break;case`ScreenActionAlternativeSyntax`:add(e.command,`Command`,`actionAlternative`);break;case`ScreenActionOtherwiseSyntax`:{let t=e.command;t!==null&&add(t,`Command`,`actionOtherwise`);break}case`FormSyntax`:add(e.for,`Command`,`formCommand`);break;case`ScreenDataSyntax`:add(e.query,`Query`,`dataQuery`);break;case`FormPopulateViaQuerySyntax`:add(e.query,`Query`,`populate`);break;case`ScreenNavigateSyntax`:add(e.screen,`Screen`,`navigate`);break;case`SpecificationEventSyntax`:add(e.eventType,`Event`,this.specification?.given.includes(e)===!0?`givenEvent`:this.specification?.whenAppended===e?`whenAppendedEvent`:`thenEvent`);break;case`SpecificationCommandSyntax`:add(e.commandType,`Command`,`whenCommand`);break;case`SpecificationRedeliverySyntax`:{let t=e;add(t.eventType,`Event`,`whenRedeliveredEvent`),add(t.reaction,`Reaction`,`redeliveryReaction`);break}case`ConcurrencySyntax`:e.eventTypes.forEach(e=>add(e,`Event`,`concurrency`))}}};export{SliceReferenceCollector,buildingReadModelReferences,n as referenceClassifications,sliceReferences};
|
|
2
|
+
//# sourceMappingURL=SliceReferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceReferences.js","names":["referenceClassifications","collector","slice","left","right","readModel","projection","dependencySourcesOf","reducer","blocks","block","ScreenplaySyntaxWalker","name","syntax","node","sources","found","variant","role","command","redelivery"],"sources":["../../../../../../Compiler/Dependencies/SliceReferences.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PolicyReferenceSyntax } from '../Syntax/Authorization';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { ConstraintSyntax } from '../Syntax/Constraints';\nimport { TypeRefSyntax } from '../Syntax/Declarations';\nimport { dependencySourcesOf, ConcurrencySyntax, FormPopulateViaQuerySyntax, FormSyntax, ReadsSyntax, ReducerRuleSyntax } from '../Syntax/DependencySources';\nimport { EventSpecSyntax, JoinEventSyntax, ProjectionSyntax, ProjectionBlockSyntax, ProjectionVariantSyntax, ProjectionEntersOnSyntax, RemoveWithSyntax, RemoveViaJoinSyntax, ClearWithSyntax } from '../Syntax/Projections';\nimport { InvokesSyntax, NamedTriggerSourceSyntax, ReactionTriggerSyntax } from '../Syntax/Reactions';\nimport { ScreenActionAlternativeSyntax, ScreenActionOtherwiseSyntax, ScreenActionSyntax, ScreenDataSyntax, ScreenNavigateSyntax } from '../Syntax/Screens';\nimport { ScreenplaySyntaxWalker } from '../Syntax/ScreenplaySyntaxWalker';\nimport { SpecificationSyntax, SpecificationEventSyntax, SpecificationCommandSyntax, SpecificationRedeliverySyntax } from '../Syntax/Specifications';\nimport { SliceSyntax } from '../Syntax/Structure';\nimport { SyntaxNode } from '../Syntax/SyntaxNode';\nimport type { DependencyKind, SliceReference, SharedReference, CollectedSliceReferences } from './index';\n\nexport const referenceClassifications: Readonly<Record<string, DependencyKind | null>> = {\n from: 'usesFactsFrom', join: 'usesFactsFrom', remove: 'usesFactsFrom', removeViaJoin: 'usesFactsFrom',\n clear: 'usesFactsFrom', entersOn: 'usesFactsFrom', reduces: 'usesFactsFrom', uniqueEvent: 'usesFactsFrom',\n uniqueProperty: 'usesFactsFrom', concurrency: 'usesFactsFrom', trigger: 'reactsTo', reads: 'decidesFrom',\n invokes: 'asks', action: 'asks', actionAlternative: 'asks', actionOtherwise: 'asks', formCommand: 'asks', dataQuery: 'shows', populate: 'shows', navigate: 'shows',\n whenRedeliveredEvent: 'verifiedWith', redeliveryReaction: 'verifiedWith', refusalConstraint: null, refusalProduces: null,\n specificationEvent: 'verifiedWith', givenEvent: 'verifiedWith', whenAppendedEvent: 'verifiedWith', thenEvent: 'verifiedWith', whenCommand: 'verifiedWith',\n declares: null, uses: null, commandEventSource: null, commandStream: null, specificationEventSource: null, specificationStream: null, thenOperation: null,\n givenOperationFailure: null, thenCompensated: null, produces: null, authorizes: null, queryResult: null,\n dataReadModel: null, type: null, exampleType: null, contributes: null, template: null, specificationReadModel: null,\n thenAbsentReadModel: null, thenReadModel: null, givenReadModel: null, thenQuery: null,\n compositeKeyType: null, builds: null, buildsVariant: null, appends: null, seed: null,\n};\n// No resolution or expression/code interpretation: this is the same role inventory as C# SliceReferences.\nexport function sliceReferences(slice: SliceSyntax): CollectedSliceReferences {\n const collector = new SliceReferenceCollector();\n collector.visitSlice(slice);\n return { references: collector.references.sort((left, right) => left.location.line - right.location.line || left.location.column - right.location.column), shared: collector.shared };\n}\n\nexport function buildingReadModelReferences(slice: SliceSyntax, readModel: string): readonly SliceReference[] {\n const collector = new SliceReferenceCollector(readModel);\n slice.projections.forEach(projection => collector.visitProjection(projection));\n dependencySourcesOf(slice).reducers?.filter(reducer => reducer.readModel.toLowerCase() === readModel.toLowerCase()).forEach(reducer => collector.visitReducer(reducer));\n return collector.references;\n}\n\nfunction variants(blocks: readonly ProjectionBlockSyntax[]): ProjectionVariantSyntax[] {\n return blocks.flatMap(block => block.kind === 'ProjectionVariantSyntax' ? [block, ...variants(block.blocks)] : block.kind === 'ChildrenSyntax' || block.kind === 'NestedSyntax' ? variants(block.blocks) : []);\n}\n\nexport class SliceReferenceCollector extends ScreenplaySyntaxWalker {\n readonly references: SliceReference[] = [];\n readonly shared: SharedReference[] = [];\n private specification?: SpecificationSyntax;\n private projection = false;\n\n constructor(private readonly readModel?: string) { super(); }\n\n private matches(name: string): boolean { return name.toLowerCase() === this.readModel?.toLowerCase(); }\n\n override visitSlice(syntax: SliceSyntax): void {\n super.visitSlice(syntax);\n const sources = dependencySourcesOf(syntax);\n sources.reducers?.forEach(node => this.visitReducer(node));\n }\n override visitCommand(syntax: CommandSyntax): void {\n const sources = dependencySourcesOf(syntax);\n sources.reads?.forEach(node => this.visitReads(node));\n if (sources.concurrency != null) this.visitConcurrency(sources.concurrency);\n super.visitCommand(syntax);\n }\n override visitReactionTrigger(syntax: ReactionTriggerSyntax): void {\n const sources = dependencySourcesOf(syntax);\n sources.data?.forEach(node => this.visitTriggerData(node));\n sources.reads?.forEach(node => this.visitReads(node));\n super.visitReactionTrigger(syntax);\n }\n override visitProjection(syntax: ProjectionSyntax): void {\n if (this.readModel !== undefined) {\n const found = variants(syntax.blocks);\n if (found.length === 0 ? !this.matches(syntax.readModel ?? syntax.name) : !found.some(variant => this.matches(variant.name))) return;\n }\n this.projection = true;\n super.visitProjection(syntax);\n this.projection = false;\n }\n override visitSpecification(syntax: SpecificationSyntax): void {\n this.specification = syntax;\n super.visitSpecification(syntax);\n this.specification = undefined;\n }\n override visitNode(node: SyntaxNode): void {\n const add = (name: string, targetKind: SliceReference['targetKind'], role: string) => {\n this.references.push({ name, targetKind, role, kind: referenceClassifications[role]!, location: node.location, timeline: this.projection || ['trigger', 'reads', 'reduces'].includes(role) });\n };\n switch (node.kind) {\n case 'TypeRefSyntax': {\n const name = (node as TypeRefSyntax).name;\n if (!['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'].includes(name)) this.shared.push({ kind: 'type', name });\n break;\n }\n case 'PolicyReferenceSyntax': this.shared.push({ kind: 'policy', name: (node as PolicyReferenceSyntax).name }); break;\n case 'EventSpecSyntax': add((node as EventSpecSyntax).event, 'Event', 'from'); break;\n case 'JoinEventSyntax': add((node as JoinEventSyntax).event, 'Event', 'join'); break;\n case 'RemoveWithSyntax': add((node as RemoveWithSyntax).event, 'Event', 'remove'); break;\n case 'RemoveViaJoinSyntax': add((node as RemoveViaJoinSyntax).event, 'Event', 'removeViaJoin'); break;\n case 'ClearWithSyntax': add((node as ClearWithSyntax).event, 'Event', 'clear'); break;\n case 'ProjectionEntersOnSyntax': add((node as ProjectionEntersOnSyntax).event, 'Event', 'entersOn'); break;\n case 'ReducerRuleSyntax': add((node as ReducerRuleSyntax).event, 'Event', 'reduces'); break;\n case 'UniqueEventConstraintSyntax': add((node as Extract<ConstraintSyntax, { kind: 'UniqueEventConstraintSyntax' }>).event, 'Event', 'uniqueEvent'); break;\n case 'UniquePropertyConstraintSyntax': add((node as Extract<ConstraintSyntax, { kind: 'UniquePropertyConstraintSyntax' }>).event, 'Event', 'uniqueProperty'); break;\n case 'NamedTriggerSourceSyntax': add((node as NamedTriggerSourceSyntax).name, 'Event', 'trigger'); break;\n case 'ReadsSyntax': add((node as ReadsSyntax).readModel, 'ReadModel', 'reads'); break;\n case 'InvokesSyntax': add((node as InvokesSyntax).command, 'Command', 'invokes'); break;\n case 'ScreenActionSyntax': add((node as ScreenActionSyntax).command, 'Command', 'action'); break;\n case 'ScreenActionAlternativeSyntax': add((node as ScreenActionAlternativeSyntax).command, 'Command', 'actionAlternative'); break;\n case 'ScreenActionOtherwiseSyntax': {\n const command = (node as ScreenActionOtherwiseSyntax).command;\n if (command !== null) add(command, 'Command', 'actionOtherwise');\n break;\n }\n case 'FormSyntax': add((node as FormSyntax).for, 'Command', 'formCommand'); break;\n case 'ScreenDataSyntax': add((node as ScreenDataSyntax).query, 'Query', 'dataQuery'); break;\n case 'FormPopulateViaQuerySyntax': add((node as FormPopulateViaQuerySyntax).query, 'Query', 'populate'); break;\n case 'ScreenNavigateSyntax': add((node as ScreenNavigateSyntax).screen, 'Screen', 'navigate'); break;\n case 'SpecificationEventSyntax': add((node as SpecificationEventSyntax).eventType, 'Event', this.specification?.given.includes(node as SpecificationEventSyntax) === true ? 'givenEvent' : this.specification?.whenAppended === node ? 'whenAppendedEvent' : 'thenEvent'); break;\n case 'SpecificationCommandSyntax': add((node as SpecificationCommandSyntax).commandType, 'Command', 'whenCommand'); break;\n case 'SpecificationRedeliverySyntax': {\n const redelivery = node as SpecificationRedeliverySyntax;\n add(redelivery.eventType, 'Event', 'whenRedeliveredEvent');\n add(redelivery.reaction, 'Reaction', 'redeliveryReaction');\n break;\n }\n case 'ConcurrencySyntax': (node as ConcurrencySyntax).eventTypes.forEach(name => add(name, 'Event', 'concurrency')); break;\n }\n }\n}\n"],"mappings":"uMAiBA,MAAaA,EAA4E,CACrF,KAAM,gBAAiB,KAAM,gBAAiB,OAAQ,gBAAiB,cAAe,gBACtF,MAAO,gBAAiB,SAAU,gBAAiB,QAAS,gBAAiB,YAAa,gBAC1F,eAAgB,gBAAiB,YAAa,gBAAiB,QAAS,WAAY,MAAO,cAC3F,QAAS,OAAQ,OAAQ,OAAQ,kBAAmB,OAAQ,gBAAiB,OAAQ,YAAa,OAAQ,UAAW,QAAS,SAAU,QAAS,SAAU,QAC3J,qBAAsB,eAAgB,mBAAoB,eAAgB,kBAAmB,KA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BAAsB,IAAKA,EAA4B,QAAS,UAAW,QAAQ,EAAG,MAC3F,IAAK,gCAAiC,IAAKA,EAAuC,QAAS,UAAW,mBAAmB,EAAG,MAC5H,IAAK,8BAA+B,CAChC,IAAMK,EAAWL,EAAqC,QAClDK,IAAY,MAAM,IAAIA,EAAS,UAAW,iBAAiB,EAC/D,KACJ,CACA,IAAK,aAAc,IAAKL,EAAoB,IAAK,UAAW,aAAa,EAAG,MAC5E,IAAK,mBAAoB,IAAKA,EAA0B,MAAO,QAAS,WAAW,EAAG,MACtF,IAAK,6BAA8B,IAAKA,EAAoC,MAAO,QAAS,UAAU,EAAG,MACzG,IAAK,uBAAwB,IAAKA,EAA8B,OAAQ,SAAU,UAAU,EAAG,MAC/F,IAAK,2BAA4B,IAAKA,EAAkC,UAAW,QAAS,KAAK,eAAe,MAAM,SAASA,CAAgC,IAAM,GAAO,aAAe,KAAK,eAAe,eAAiBA,EAAO,oBAAsB,WAAW,EAAG,MAC3Q,IAAK,6BAA8B,IAAKA,EAAoC,YAAa,UAAW,aAAa,EAAG,MACpH,IAAK,gCAAiC,CAClC,IAAMM,EAAaN,EACnB,IAAIM,EAAW,UAAW,QAAS,sBAAsB,EACzD,IAAIA,EAAW,SAAU,WAAY,oBAAoB,EACzD,KACJ,CACA,IAAK,oBAAqBN,EAA4B,WAAW,QAAQ,GAAQ,IAAIF,EAAM,QAAS,aAAa,CAAC,CACtH,CACJ,CACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";function stronglyConnectedGroups(e){let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Map,r=[],i=/* @__PURE__ */ new Set,a=[],visit=o=>{t.set(o,t.size),n.set(o,t.get(o)),r.push(o),i.add(o);for(let r of[...e.get(o)].sort())t.has(r)?i.has(r)&&n.set(o,Math.min(n.get(o),t.get(r))):(visit(r),n.set(o,Math.min(n.get(o),n.get(r))));if(n.get(o)!==t.get(o))return;let s=[],c;do c=r.pop(),i.delete(c),s.push(c);while(c!==o);a.push(s.sort())};for(let n of[...e.keys()].sort())t.has(n)||visit(n);return a}export{stronglyConnectedGroups};
|
|
2
|
+
//# sourceMappingURL=StronglyConnectedGroups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StronglyConnectedGroups.js","names":["indices","low","stack","active","groups","node","next","graph","group","member"],"sources":["../../../../../../Compiler/Dependencies/StronglyConnectedGroups.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// Deterministic Tarjan decomposition, shared by dependency queries and timeline diagnostics.\nexport function stronglyConnectedGroups(graph: ReadonlyMap<string, ReadonlySet<string>>): string[][] {\n const indices = new Map<string, number>();\n const low = new Map<string, number>();\n const stack: string[] = [];\n const active = new Set<string>();\n const groups: string[][] = [];\n const visit = (node: string) => {\n indices.set(node, indices.size);\n low.set(node, indices.get(node)!);\n stack.push(node);\n active.add(node);\n for (const next of [...graph.get(node)!].sort()) {\n if (!indices.has(next)) {\n visit(next);\n low.set(node, Math.min(low.get(node)!, low.get(next)!));\n } else if (active.has(next)) low.set(node, Math.min(low.get(node)!, indices.get(next)!));\n }\n if (low.get(node) !== indices.get(node)) return;\n const group: string[] = [];\n let member: string;\n do {\n member = stack.pop()!;\n active.delete(member);\n group.push(member);\n } while (member !== node);\n groups.push(group.sort());\n };\n for (const node of [...graph.keys()].sort()) if (!indices.has(node)) visit(node);\n return groups;\n}\n"],"mappings":"qDAIA,SAAgB,wBAAwB,EAA6D,CACjG,IAAMA,kBAAU,IAAI,IACdC,kBAAM,IAAI,IACVC,EAAkB,CAAC,EACnBC,kBAAS,IAAI,IACbC,EAAqB,CAAC,EACtB,MAAS,GAAiB,CAC5BJ,EAAQ,IAAIK,EAAML,EAAQ,IAAI,EAC9BC,EAAI,IAAII,EAAML,EAAQ,IAAIK,CAAI,CAAE,EAChCH,EAAM,KAAKG,CAAI,EACfF,EAAO,IAAIE,CAAI,EACf,IAAK,IAAMC,IAAQ,CAAC,GAAGC,EAAM,IAAIF,CAAI,CAAE,CAAC,CAAC,KAAK,EACrCL,EAAQ,IAAIM,CAAI,EAGVH,EAAO,IAAIG,CAAI,GAAGL,EAAI,IAAII,EAAM,KAAK,IAAIJ,EAAI,IAAII,CAAI,EAAIL,EAAQ,IAAIM,CAAI,CAAE,CAAC,GAFnF,MAAMA,CAAI,EACVL,EAAI,IAAII,EAAM,KAAK,IAAIJ,EAAI,IAAII,CAAI,EAAIJ,EAAI,IAAIK,CAAI,CAAE,CAAC,GAG9D,GAAIL,EAAI,IAAII,CAAI,IAAML,EAAQ,IAAIK,CAAI,EAAG,OACzC,IAAMG,EAAkB,CAAC,EACrBC,EACJ,EACI,GAASP,EAAM,IAAI,EACnBC,EAAO,OAAOM,CAAM,EACpBD,EAAM,KAAKC,CAAM,QACZA,IAAWJ,GACpBD,EAAO,KAAKI,EAAM,KAAK,CAAC,CAC5B,EACA,IAAK,IAAMH,IAAQ,CAAC,GAAGE,EAAM,KAAK,CAAC,CAAC,CAAC,KAAK,EAAQP,EAAQ,IAAIK,CAAI,GAAG,MAAMA,CAAI,EAC/E,OAAOD,CACX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DeclaredDependencyTargets as e}from"./DeclaredDependencyTargets.js";import{dependencyKinds as t}from"./DependencyKind.js";import{InvalidDependencyQuery as n}from"./InvalidDependencyQuery.js";import{SliceReferenceCollector as r,buildingReadModelReferences as i,referenceClassifications as a,sliceReferences as o}from"./SliceReferences.js";import{stronglyConnectedGroups as s}from"./StronglyConnectedGroups.js";import{DependencyGraph as c}from"./DependencyGraph.js";export{e as DeclaredDependencyTargets,c as DependencyGraph,n as InvalidDependencyQuery,r as SliceReferenceCollector,i as buildingReadModelReferences,t as dependencyKinds,a as referenceClassifications,o as sliceReferences,s as stronglyConnectedGroups};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e={InvalidIdentityDeclaration:`PLAY0633`,DuplicateIdentity:`PLAY0634`,InvalidIdentityDetail:`PLAY0635`,UnknownIdentitySource:`PLAY0636`,IdentityDetailWithoutSource:`PLAY0637`,IdentitySourceWithBody:`PLAY0638`,DuplicateIdentityDetail:`PLAY0639`,BuiltInIdentityDetail:`PLAY0640`,UnknownIdentityQuery:`PLAY0641`,InvalidIdentityQuery:`PLAY0642`,IdentityQueryWithoutKey:`PLAY0643`,InvalidIdentityQueryKey:`PLAY0644`,IdentityQueryAuthorizationDependency:`PLAY0645`,IdentityQueryTypeMismatch:`PLAY0646`,InvalidReactionIdentity:`PLAY0647`,GatedInvocationWithoutIdentity:`PLAY0648`,UnusedReactionIdentity:`PLAY0649`,UnusedReactionRole:`PLAY0650`,UnsatisfiedReactionIdentity:`PLAY0651`,ReactionPrivilegeEscalation:`PLAY0652`,CommandProducesPublicEvent:`PLAY0607`,PublicEventRequiresOutboundTranslation:`PLAY0608`,OutboundPublicEventCount:`PLAY0609`,ForeignPublicEventConsumer:`PLAY0610`,OutboundTranslationInput:`PLAY0611`,InboundTranslationOutput:`PLAY0612`,ForeignPublicEventProduced:`PLAY0613`,PublicTranslationRequiresDirection:`PLAY0614`,TranslationConstructDirection:`PLAY0615`,InboundTranslationInput:`PLAY0616`,OutboundTranslationOutput:`PLAY0617`,EventTargetOutsideOutboundTranslation:`PLAY0618`,EventsSourceOutsideInboundTranslation:`PLAY0619`,InvalidCaptureEventsSource:`PLAY0620`,InvalidExposureDeclaration:`PLAY0621`,UnknownExposureOwner:`PLAY0622`,ReExposureCycle:`PLAY0623`,ReExposureBroken:`PLAY0624`,InvalidInstanceContribution:`PLAY0625`,UnknownContributionInstance:`PLAY0626`,ContributionNotExposed:`PLAY0627`,ContributionTypeMismatch:`PLAY0628`,UnknownTemplateContentSlot:`PLAY0629`,UnknownNavigationOutlet:`PLAY0630`,TemplateScopeMismatch:`PLAY0631`,IncompatibleComponentPackage:`PLAY0632`,LegacyComplianceMarker:`PLAY0565`,UnknownComplianceMarker:`PLAY0566`,InvalidSecretScope:`PLAY0567`,DuplicateSecretScope:`PLAY0568`,SecretScopeIgnoredForPii:`PLAY0569`,InvalidPersonalDataQualifier:`PLAY0570`,DuplicateSpecialCategory:`PLAY0571`,InvalidPurposeDeclaration:`PLAY0596`,InvalidPurposeVocabulary:`PLAY0597`,DuplicatePurposeField:`PLAY0598`,DuplicatePurposeDeclaration:`PLAY0599`,UnknownPurpose:`PLAY0600`,PurposeInterestMismatch:`PLAY0601`,PersonalDataWithoutPurpose:`PLAY0602`,SpecialDataWithoutCondition:`PLAY0603`,CriminalDataWithoutAuthorization:`PLAY0604`,PurposeWithoutBasis:`PLAY0605`,UnusedPurpose:`PLAY0606`,ConflictingScreenDataBinding:`PLAY0530`,ScreenDataQueryMismatch:`PLAY0531`,ActionWithoutInputSurface:`PLAY0532`,CommandWithoutInputSurface:`PLAY0533`,ReadModelFieldWithoutOrigin:`PLAY0534`,QueryParameterNotHeldByView:`PLAY0535`,UnconsumedEvent:`PLAY0536`,UnreachableScreen:`PLAY0537`,UnknownActionSubjectField:`PLAY0345`,UnresolvedActionSubject:`PLAY0346`,UnreachableActionAlternative:`PLAY0347`,UnknownActionArgumentProperty:`PLAY0348`,UnreachableRefusalBranch:`PLAY0540`,InvalidRefusalValue:`PLAY0541`,UnknownRefusalConstraint:`PLAY0542`,UnknownRedeliveryReaction:`PLAY0544`,IndeterminateNegatedClaimTarget:`PLAY0546`,InvalidRefusalBranch:`PLAY0538`,InvalidRefusalBranchBody:`PLAY0539`,UnmatchedRedeliveredOccurrence:`PLAY0543`,InvalidNoEventsExpectation:`PLAY0545`,InvalidProducesDeclaration:`PLAY0042`,ProducesWhenWithoutEvent:`PLAY0043`,InvalidPropertyMapping:`PLAY0044`,DuplicateProducesTarget:`PLAY0193`,EventSourceIdInPayload:`PLAY0469`,ExplicitProducesTargetsRequired:`PLAY0470`,RedundantEventId:`PLAY0471`,InvalidEventId:`PLAY0472`,InlineEventCollision:`PLAY0473`,InlineEventOutsideCommand:`PLAY0474`,InlineEventGeneration:`PLAY0475`,ReservedProductionMetadata:`PLAY0476`,InvalidEventDocumentation:`PLAY0477`,OmittedProductionDestination:`PLAY0478`,UnknownConstraintProperty:`PLAY0391`,UnknownTopLevelConstruct:`PLAY0001`,InvalidDomainDeclaration:`PLAY0002`,DuplicateDomain:`PLAY0003`,DomainNotFirst:`PLAY0004`,InvalidImportDeclaration:`PLAY0005`,TabIndentation:`PLAY0006`,InvalidConceptDeclaration:`PLAY0007`,UnknownPrimitiveType:`PLAY0008`,InvalidEnumerationValue:`PLAY0009`,UnknownConceptDirective:`PLAY0010`,ValidateReadAsEnumerationBlock:`PLAY0011`,AttributeReasonWithoutAttribute:`PLAY0012`,DuplicateAttributeReason:`PLAY0013`,InvalidTypeDeclaration:`PLAY0014`,TypeWithoutProperties:`PLAY0015`,InvalidPropertyDeclaration:`PLAY0016`,IdentifierOutsideCommand:`PLAY0017`,InvalidEventDeclaration:`PLAY0018`,IdentifierOnEventProperty:`PLAY0019`,TagPropertyReadAsTag:`PLAY0020`,InvalidModuleDeclaration:`PLAY0021`,UnknownModuleDirective:`PLAY0022`,InvalidFeatureDeclaration:`PLAY0023`,UnknownFeatureDirective:`PLAY0024`,InvalidSliceDeclaration:`PLAY0027`,UnknownSliceType:`PLAY0028`,UnknownSliceDirective:`PLAY0029`,InvalidPersonaDeclaration:`PLAY0030`,InvalidPersonaPolicyReference:`PLAY0031`,UnknownPersonaDirective:`PLAY0032`,InvalidCommandDeclaration:`PLAY0033`,UnknownCommandDirective:`PLAY0034`,DuplicateCommandIdentifier:`PLAY0036`,InvalidQueryDeclaration:`PLAY0047`,UnknownQueryDirective:`PLAY0048`,InvalidQueryParameter:`PLAY0049`,InvalidProjectionDeclaration:`PLAY0056`,EmptyProjection:`PLAY0057`,UnknownProjectionDirective:`PLAY0058`,FromWithoutEvent:`PLAY0061`,InvalidEventReference:`PLAY0062`,InvalidJoinDeclaration:`PLAY0063`,JoinWithoutEvent:`PLAY0064`,InvalidChildrenDeclaration:`PLAY0065`,InvalidNestedDeclaration:`PLAY0066`,NestedBlockWithoutFrom:`PLAY0067`,InvalidRemoveDeclaration:`PLAY0068`,UnknownRemoveDirective:`PLAY0069`,InvalidClearDeclaration:`PLAY0070`,ClearWithOutsideNestedBlock:`PLAY0071`,InvalidSpecificationDeclaration:`PLAY0094`,UnknownSpecificationDirective:`PLAY0095`,InvalidSpecificationWhen:`PLAY0096`,DuplicateSpecificationWhen:`PLAY0097`,InvalidThenError:`PLAY0098`,InvalidReadModelStep:`PLAY0099`,InvalidEventStep:`PLAY0100`,InvalidSpecificationValue:`PLAY0101`,InvalidScreenDeclaration:`PLAY0102`,UnknownScreenDirective:`PLAY0103`,InvalidDataDirective:`PLAY0104`,InvalidActionDirective:`PLAY0105`,UnknownActionDirective:`PLAY0106`,InvalidNavigation:`PLAY0107`,InvalidScreenLayoutSlot:`PLAY0108`,InvalidTitleDirective:`PLAY0109`,UnknownTableDirective:`PLAY0110`,UnknownSummaryDirective:`PLAY0111`,AuthorizeWithoutPolicy:`PLAY0122`,InvalidPolicyReference:`PLAY0123`,InvalidConstraintDeclaration:`PLAY0132`,ConstraintWithoutRule:`PLAY0133`,InvalidConstraintBody:`PLAY0134`,DuplicateConstraintBody:`PLAY0135`,InvalidReactionDeclaration:`PLAY0136`,InvalidReactionTrigger:`PLAY0137`,ReactionWithoutTrigger:`PLAY0138`,InvalidValidateDeclaration:`PLAY0140`,InvalidValidationRule:`PLAY0141`,InvalidRuleName:`PLAY0143`,UnknownRuleImplementationDirective:`PLAY0144`,InvalidDescription:`PLAY0145`,EmptyDescription:`PLAY0146`,DuplicateDescription:`PLAY0147`,TagWithoutValue:`PLAY0148`,InvalidTagValue:`PLAY0149`,UnknownContextPath:`PLAY0153`,UnknownContextCausedByProperty:`PLAY0154`,UnknownContextIdentityProperty:`PLAY0155`,ExpectedCodeFence:`PLAY0163`,UnclosedCodeBlock:`PLAY0164`,DuplicateDeclaration:`PLAY0168`,RepeatedSingularDeclarationAcrossFiles:`PLAY0172`,RepeatedDeclarationAcrossFiles:`PLAY0173`,ConflictingDescriptionAcrossFiles:`PLAY0174`,UnexpectedTokenInAuthorize:`PLAY0184`,UnclosedAuthorizeGroup:`PLAY0185`,InvalidReadModelDeclaration:`PLAY0186`,InvalidInvokesDeclaration:`PLAY0194`,InvalidScopeDeclaration:`PLAY0199`,DuplicateScope:`PLAY0200`,InvalidIntervalTrigger:`PLAY0249`,InvalidScheduleTrigger:`PLAY0250`,DuplicateReactionTrigger:`PLAY0253`,InvalidSpecificationEventSource:`PLAY0275`,DuplicateSpecificationEventSource:`PLAY0276`,InvalidProjectionVariantDeclaration:`PLAY0277`,InvalidEntersOnDeclaration:`PLAY0279`,NestedProjectionVariantNotAllowed:`PLAY0280`,InvalidStructuredValue:`PLAY0291`,DuplicateStructuredValueMember:`PLAY0294`,ConflictingSpecificationActions:`PLAY0358`,InvalidSpecificationEventOrder:`PLAY0359`,InvalidValidationSeverity:`PLAY0368`,VariantRequiresEnteringEvent:`PLAY0382`,DuplicateProjectionVariant:`PLAY0384`,DuplicateVariantEnteringEvent:`PLAY0385`,InvalidSpecificationDenied:`PLAY0388`,DuplicateAuthorizationAcrossFiles:`PLAY0394`,FileConstraintOnlySupportsUniqueness:`PLAY0396`,LegacyInlineCodeFence:`PLAY0397`,InvalidEventGeneration:`PLAY0446`,InvalidFileImport:`PLAY0454`,FileImportMatchesNothing:`PLAY0455`,ImportedFileNotFound:`PLAY0456`,ConflictingImportPlacement:`PLAY0457`,ImportCycle:`PLAY0458`,ModuleInPlacedFile:`PLAY0459`,UnexpectedInPlacedFile:`PLAY0460`,InvalidSpecificationClock:`PLAY0461`,InvalidSpecificationTrigger:`PLAY0462`,InvalidSpecificationCapture:`PLAY0463`,InvalidSpecificationQueryAction:`PLAY0464`,InvalidSpecificationQuery:`PLAY0265`,UnknownSpecificationQueryDirective:`PLAY0266`,DuplicateSpecificationQueryArguments:`PLAY0267`,InvalidAbsentReadModelStep:`PLAY0453`,LegacyOptionalSuffix:`PLAY0479`,InvalidOptionalModifierOrder:`PLAY0480`,OptionalReadsNotSupported:`PLAY0481`,InvalidSpecificationCaller:`PLAY0386`,DuplicateSpecificationCallerOrDenied:`PLAY0387`,GeneratedPropertyOutsideCommand:`PLAY0482`,InvalidGeneratedType:`PLAY0483`,InvalidGeneratedModifierOrder:`PLAY0484`,DuplicateEventSubject:`PLAY0590`,InvalidSubjectType:`PLAY0591`,ProtectedSubjectType:`PLAY0592`,InvalidSubjectOwner:`PLAY0593`,ReadModelSubjectNotSupported:`PLAY0594`,InvalidSubjectModifierOrder:`PLAY0595`,GeneratedPropertySuppliedAsInput:`PLAY0485`,InvalidCommandResponse:`PLAY0486`,InvalidResponseSource:`PLAY0487`,DuplicateResponseField:`PLAY0488`,InvalidResponseShape:`PLAY0489`,InvalidGeneratedFixture:`PLAY0490`,InvalidReturnExpectation:`PLAY0491`,InvalidImplementationBlock:`PLAY0492`,InvalidImplementationHint:`PLAY0493`,ConflictingImplementationSources:`PLAY0494`,UnknownType:`PLAY0165`,InvalidSystemDeclaration:`PLAY0495`,InvalidOperationDeclaration:`PLAY0496`,InvalidProductionReference:`PLAY0497`,ProductionDeclarationCollision:`PLAY0498`,OperationOutsideCommand:`PLAY0499`,InvalidSystemReference:`PLAY0500`,InvalidOperationMapping:`PLAY0501`,InvalidOperationSpecification:`PLAY0502`,InvalidCaptureDeclaration:`PLAY0078`,UnknownCaptureDirective:`PLAY0079`,InvalidMapEntry:`PLAY0080`,InvalidTranslation:`PLAY0081`,InvalidSplitDeclaration:`PLAY0082`,InvalidSplitTarget:`PLAY0083`,InvalidAppendDeclaration:`PLAY0084`,UnknownAppendDirective:`PLAY0085`,WhenWithoutTrigger:`PLAY0086`,InvalidWhenClause:`PLAY0087`,InvalidWhenTransitionClause:`PLAY0088`,MixedWhenCombinators:`PLAY0089`,WhenCombinatorWithoutProperty:`PLAY0090`,UnknownCaptureBlockDirective:`PLAY0091`,InvalidCompositeKeyPart:`PLAY0072`,TemplateInCompositeKey:`PLAY0073`,EmptyCompositeKey:`PLAY0074`,InvalidProjectionMapping:`PLAY0075`,ExpectedLiteralValue:`PLAY0150`,InvalidExpression:`PLAY0152`,UnterminatedInterpolation:`PLAY0157`,UnterminatedTemplateExpression:`PLAY0156`,ProjectionDocumentWithoutProjection:`PLAY0055`,CaptureDocumentWithoutCapture:`PLAY0077`,SpecificationDocumentWithoutSpecification:`PLAY0093`,InvalidSeedDeclaration:`PLAY0128`,InvalidSeedGroup:`PLAY0129`,InvalidSeedEvent:`PLAY0130`,InvalidSeedPropertyAssignment:`PLAY0131`,InvalidPolicyDeclaration:`PLAY0112`,UnknownPolicyDirective:`PLAY0113`,PolicyWithoutRequirement:`PLAY0114`,ExpectedRoleName:`PLAY0118`,ExpectedClaimName:`PLAY0119`,ExpectedClaimMatches:`PLAY0120`,ExpectedClaimMatchTarget:`PLAY0121`,MixedPolicyImplementation:`PLAY0440`,RepeatedPolicyRequirement:`PLAY0441`,UnexpectedTokenInPolicyCondition:`PLAY0115`,ExpectedPolicyCondition:`PLAY0116`,UnclosedPolicyConditionGroup:`PLAY0117`,UnexpectedTokenInCondition:`PLAY0158`,ExpectedCondition:`PLAY0159`,ExpectedComparisonOperator:`PLAY0161`,ExpectedComparisonValue:`PLAY0162`,InvalidActionAlternative:`PLAY0341`,GuardedActionWithoutAlternatives:`PLAY0342`,MisplacedActionOtherwise:`PLAY0343`,UnsupportedActionConditionOperand:`PLAY0344`,InvalidInteractionArgument:`PLAY0319`,UnclosedConditionGroup:`PLAY0160`,InvalidNumericDirective:`PLAY0508`,DuplicateNumericDirective:`PLAY0509`,LateNumericDirective:`PLAY0510`,InexactNumericLiteral:`PLAY0511`,MixedNumericModes:`PLAY0512`,IncompatibleNumericSource:`PLAY0513`,EventFromLaterSlice:`PLAY0516`,TimelineCycleGroup:`PLAY0517`,InvalidSpecificationExample:`PLAY0518`,DuplicateSpecificationAssignment:`PLAY0519`,UnresolvedSpecificationExampleType:`PLAY0520`,SpecificationExampleNameCollision:`PLAY0521`,SpecificationExampleKindMismatch:`PLAY0522`,InvalidSpecificationExampleValue:`PLAY0523`,MissingSpecificationProperty:`PLAY0524`,UnadmittedSpecificationExampleValue:`PLAY0525`,InvalidSpecificationExampleBody:`PLAY0526`,AmbiguousReference:`PLAY0198`,InvalidSpecificationStream:`PLAY0547`,SpecificationStreamOnCommand:`PLAY0548`,InvalidSpecificationStreamRoute:`PLAY0549`,InvalidSpecificationStreamEventSource:`PLAY0550`,SpecificationStreamContradictsCommand:`PLAY0551`,InvalidDependencyTarget:`PLAY0554`,RepeatedDependencyDeclaration:`PLAY0555`,UndeclaredDependency:`PLAY0552`,UnusedDependencyDeclaration:`PLAY0553`,MutualDependencyDeclarations:`PLAY0556`,AuthorizationRefusalWithoutIdentity:`PLAY0557`,InvalidDocumentation:`PLAY0558`,ConflictingDocumentationAcrossFiles:`PLAY0559`,InvalidSpecificationCallerPersona:`PLAY0572`,UnsynthesizablePersonaCaller:`PLAY0573`,PersonaWithoutGate:`PLAY0574`,GateWithoutPersona:`PLAY0575`,AmbiguousPersonaCaller:`PLAY0576`,InvalidSpecificationParameter:`PLAY0577`,InvalidSpecificationCase:`PLAY0578`,DuplicateSpecificationParameter:`PLAY0579`,DuplicateSpecificationCase:`PLAY0580`,IncompleteSpecificationTable:`PLAY0581`,InvalidSpecificationCaseAssignment:`PLAY0582`,InvalidSpecificationCaseValue:`PLAY0583`,InvalidSpecificationCaseReference:`PLAY0584`,OptionalSpecificationParameterTarget:`PLAY0585`,SpecificationCaseNameCollision:`PLAY0586`,IncompatibleSpecificationParameterType:`PLAY0587`,UnusedSpecificationParameter:`PLAY0588`,SingularSpecificationTableExpansion:`PLAY0589`,UnsupportedInteractionAlternatives:`PLAY0560`,MixedInteractionAlternatives:`PLAY0561`,InteractionAlternativeWithoutActions:`PLAY0562`,InlineInteractionAlternative:`PLAY0563`,LegacyInteractionWhere:`PLAY0564`,InvalidEventSourceDeclaration:`PLAY0503`,InvalidCommandStream:`PLAY0504`,AmbiguousCommandStream:`PLAY0505`,UnsupportedStreamIdType:`PLAY0506`,RedundantSourceStreamId:`PLAY0507`,UnknownEvent:`PLAY0166`,UnknownReadModelProperty:`PLAY0514`,PiiNotSupportedOnIdentifier:`PLAY0515`,HandlerWithoutImplementation:`PLAY0045`,UnknownHandlerDirective:`PLAY0046`,CommandWithProducesAndHandler:`PLAY0035`,AbsoluteFileReference:`PLAY0264`,InvalidTriggerData:`PLAY0246`};export{e as DiagnosticCodes};
|
|
2
|
+
//# sourceMappingURL=DiagnosticCodes.js.map
|