@cratis/screenplay-language 4.218.1 → 4.219.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/dist/bundles/code-actions.js +1 -1
- package/dist/bundles/code-actions.js.map +1 -1
- package/dist/bundles/compiler/Authoring/QuickFixes.js +1 -1
- package/dist/bundles/compiler/Authoring/QuickFixes.js.map +1 -1
- package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js +7 -0
- package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js.map +1 -0
- package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js +5 -0
- package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js.map +1 -0
- package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js +2 -0
- package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js.map +1 -0
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
- package/dist/bundles/compiler/Files/AuthoredOrder.js +1 -1
- package/dist/bundles/compiler/Files/AuthoredOrder.js.map +1 -1
- package/dist/bundles/compiler/Files/OrderingRoot.js +2 -1
- package/dist/bundles/compiler/Files/OrderingRoot.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +1 -1
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayDocumentSource.js +2 -0
- package/dist/bundles/compiler/Files/PlayDocumentSource.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayGlob.js +2 -0
- package/dist/bundles/compiler/Files/PlayGlob.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayImports.js +2 -1
- package/dist/bundles/compiler/Files/PlayImports.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayPlacement.js +1 -1
- package/dist/bundles/compiler/Files/PlayPlacement.js.map +1 -1
- package/dist/bundles/compiler/Files/TimelineOrder.js +1 -1
- package/dist/bundles/compiler/Files/TimelineOrder.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ImportDiscovery.js +2 -1
- package/dist/bundles/compiler/Parsing/ImportDiscovery.js.map +1 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguity.js +2 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguity.js.map +1 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityCharacters.js +2 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityCharacters.js.map +1 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityGraph.js +2 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityGraph.js.map +1 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityParser.js +2 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/MatchOperandValidation.js +1 -1
- package/dist/bundles/compiler/Parsing/MatchOperandValidation.js.map +1 -1
- package/dist/bundles/compiler/Parsing/hasExponentialMatchAmbiguity.js +2 -0
- package/dist/bundles/compiler/Parsing/hasExponentialMatchAmbiguity.js.map +1 -0
- package/dist/bundles/compiler/Parsing/trimMatchAmbiguityGraph.js +2 -0
- package/dist/bundles/compiler/Parsing/trimMatchAmbiguityGraph.js.map +1 -0
- package/dist/bundles/compiler/ScreenplayCompiler.js +1 -1
- package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -1
- package/dist/bundles/compiler/index.js +1 -1
- package/dist/bundles/diagnostic-codes.js +1 -1
- package/dist/bundles/diagnostic-codes.js.map +1 -1
- package/dist/bundles/validation.js +1 -1
- package/dist/bundles/validation.js.map +1 -1
- package/dist/code-actions.d.ts +2 -2
- package/dist/code-actions.d.ts.map +1 -1
- package/dist/diagnostic-codes.d.ts +1 -0
- package/dist/diagnostic-codes.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagnosticCodes.js","names":["DiagnosticCodes"],"sources":["../../../../../../Compiler/Diagnostics/DiagnosticCodes.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// Shared diagnostic names, including the explicitly C#-only checks below. Catalogue membership does\n// not imply TypeScript validation support; see Documentation/screenplay/editor-diagnostics.md.\nexport const DiagnosticCodes = {\n DuplicateBehaviorAttachment: 'PLAY0340',\n UnknownMatchPattern: 'PLAY0366',\n InvalidMatchPattern: 'PLAY0367',\n PatternOutsidePortableMatchDialect: 'PLAY0699',\n DeprecatedStudioTextRulePattern: 'PLAY0787',\n InvalidIdentityDeclaration: 'PLAY0633',\n DuplicateIdentity: 'PLAY0634',\n InvalidIdentityDetail: 'PLAY0635',\n UnknownIdentitySource: 'PLAY0636',\n IdentityDetailWithoutSource: 'PLAY0637',\n IdentitySourceWithBody: 'PLAY0638',\n DuplicateIdentityDetail: 'PLAY0639',\n BuiltInIdentityDetail: 'PLAY0640',\n UnknownIdentityQuery: 'PLAY0641',\n InvalidIdentityQuery: 'PLAY0642',\n IdentityQueryWithoutKey: 'PLAY0643',\n InvalidIdentityQueryKey: 'PLAY0644',\n IdentityQueryAuthorizationDependency: 'PLAY0645',\n IdentityQueryTypeMismatch: 'PLAY0646',\n InvalidReactionIdentity: 'PLAY0647',\n GatedInvocationWithoutIdentity: 'PLAY0648',\n UnusedReactionIdentity: 'PLAY0649',\n UnusedReactionRole: 'PLAY0650',\n UnsatisfiedReactionIdentity: 'PLAY0651',\n ReactionPrivilegeEscalation: 'PLAY0652',\n // C#-only whole-model public event boundaries; membership is not TypeScript validation support.\n CommandProducesPublicEvent: 'PLAY0607',\n PublicEventRequiresOutboundTranslation: 'PLAY0608',\n OutboundPublicEventCount: 'PLAY0609',\n ForeignPublicEventConsumer: 'PLAY0610',\n OutboundTranslationInput: 'PLAY0611',\n InboundTranslationOutput: 'PLAY0612',\n ForeignPublicEventProduced: 'PLAY0613',\n PublicTranslationRequiresDirection: 'PLAY0614',\n TranslationConstructDirection: 'PLAY0615',\n InboundTranslationInput: 'PLAY0616',\n OutboundTranslationOutput: 'PLAY0617',\n EventTargetOutsideOutboundTranslation: 'PLAY0618',\n EventsSourceOutsideInboundTranslation: 'PLAY0619',\n InvalidCaptureEventsSource: 'PLAY0620',\n CaptureEventsFromSeveralOrigins: 'PLAY0687',\n DirectionlessTranslationReactsToOwnCapture: 'PLAY0694',\n PendingIntentWithOtherHandler: 'PLAY0698',\n CommandHandlerRequiresAttachment: 'PLAY0800', // C# only\n DescribedCommandNotImplemented: 'PLAY0695', // C# only\n DescribedCommandWithoutProductions: 'PLAY0696', // C# only\n DescribedCommandCardinalityNotAdmitted: 'PLAY0697', // C# only\n CaptureEventsKeyNotRequired: 'PLAY0700',\n CaptureEventsRecordFixture: 'PLAY0701',\n RefutedGeneratedConceptRule: 'PLAY0688',\n UnprovenGeneratedConceptRule: 'PLAY0689',\n // Syntax shared with C#; the reference checks (owners, instances, cycles, outlets, scopes, packages) are C#-only.\n InvalidExposureDeclaration: 'PLAY0621',\n UnknownExposureOwner: 'PLAY0622',\n ReExposureCycle: 'PLAY0623',\n ReExposureBroken: 'PLAY0624',\n InvalidInstanceContribution: 'PLAY0625',\n UnknownContributionInstance: 'PLAY0626',\n ContributionNotExposed: 'PLAY0627',\n ContributionTypeMismatch: 'PLAY0628',\n UnknownTemplateContentSlot: 'PLAY0629',\n UnknownNavigationOutlet: 'PLAY0630',\n TemplateScopeMismatch: 'PLAY0631',\n IncompatibleComponentPackage: 'PLAY0632',\n UnknownNavigationDestination: 'PLAY0654',\n UnknownScreenContributionPoint: 'PLAY0655',\n TemplateNestingCycle: 'PLAY0656',\n TemplateCategoryMissing: 'PLAY0720', // C# only: template declarations are not modeled by this compiler.\n InvalidTemplateVersionRange: 'PLAY0721',\n LegacyProfileLayout: 'PLAY0791', // The other ui profile root template rules (PLAY0790, PLAY0792-PLAY0799) are C# only: this compiler does not model a ui profile.\n UnknownTemplateBlueprint: 'PLAY0722', // C# only: ui profile packages are not modeled by this compiler.\n DuplicateComplianceMarker: 'PLAY0653',\n LegacyComplianceMarker: 'PLAY0565',\n UnknownComplianceMarker: 'PLAY0566',\n InvalidSecretScope: 'PLAY0567',\n DuplicateSecretScope: 'PLAY0568',\n SecretScopeIgnoredForPii: 'PLAY0569',\n InvalidPersonalDataQualifier: 'PLAY0570',\n DuplicateSpecialCategory: 'PLAY0571',\n InvalidPurposeDeclaration: 'PLAY0596',\n InvalidPurposeVocabulary: 'PLAY0597',\n DuplicatePurposeField: 'PLAY0598',\n DuplicatePurposeDeclaration: 'PLAY0599',\n UnknownPurpose: 'PLAY0600',\n PurposeInterestMismatch: 'PLAY0601',\n PersonalDataWithoutPurpose: 'PLAY0602',\n SpecialDataWithoutCondition: 'PLAY0603',\n CriminalDataWithoutAuthorization: 'PLAY0604',\n PurposeWithoutBasis: 'PLAY0605',\n UnusedPurpose: 'PLAY0606',\n // C#-only: opt-in completeness, scoped action/refusal reference validation, and semantic binding.\n ConflictingScreenDataBinding: 'PLAY0530',\n ScreenDataQueryMismatch: 'PLAY0531',\n ActionWithoutInputSurface: 'PLAY0532',\n CommandWithoutInputSurface: 'PLAY0533',\n ReadModelFieldWithoutOrigin: 'PLAY0534',\n QueryParameterNotHeldByView: 'PLAY0535',\n UnconsumedEvent: 'PLAY0536',\n UnreachableScreen: 'PLAY0537',\n UnknownActionSubjectField: 'PLAY0345',\n UnresolvedActionSubject: 'PLAY0346',\n UnreachableActionAlternative: 'PLAY0347',\n UnknownActionArgumentProperty: 'PLAY0348',\n UnreachableRefusalBranch: 'PLAY0540',\n InvalidRefusalValue: 'PLAY0541',\n UnknownRefusalConstraint: 'PLAY0542',\n UnknownRedeliveryReaction: 'PLAY0544',\n IndeterminateNegatedClaimTarget: 'PLAY0546',\n InvalidRefusalBranch: 'PLAY0538',\n InvalidRefusalBranchBody: 'PLAY0539',\n UnmatchedRedeliveredOccurrence: 'PLAY0543',\n InvalidNoEventsExpectation: 'PLAY0545',\n InvalidProducesDeclaration: 'PLAY0042',\n ProducesWhenWithoutEvent: 'PLAY0043',\n InvalidPropertyMapping: 'PLAY0044',\n DuplicateProducesTarget: 'PLAY0193',\n EventSourceIdInPayload: 'PLAY0469',\n ExplicitProducesTargetsRequired: 'PLAY0470',\n RedundantEventId: 'PLAY0471',\n InvalidEventId: 'PLAY0472',\n InlineEventCollision: 'PLAY0473',\n InlineEventOutsideCommand: 'PLAY0474',\n InlineEventGeneration: 'PLAY0475',\n ReservedProductionMetadata: 'PLAY0476',\n InvalidEventDocumentation: 'PLAY0477',\n OmittedProductionDestination: 'PLAY0478',\n UnknownConstraintProperty: 'PLAY0391',\n UnknownTopLevelConstruct: 'PLAY0001',\n InvalidDomainDeclaration: 'PLAY0002',\n DuplicateDomain: 'PLAY0003',\n DomainNotFirst: 'PLAY0004',\n InvalidImportDeclaration: 'PLAY0005',\n TabIndentation: 'PLAY0006',\n InvalidConceptDeclaration: 'PLAY0007',\n UnknownPrimitiveType: 'PLAY0008',\n InvalidEnumerationValue: 'PLAY0009',\n UnknownConceptDirective: 'PLAY0010',\n ValidateReadAsEnumerationBlock: 'PLAY0011',\n AttributeReasonWithoutAttribute: 'PLAY0012',\n DuplicateAttributeReason: 'PLAY0013',\n InvalidTypeDeclaration: 'PLAY0014',\n TypeWithoutProperties: 'PLAY0015',\n InvalidPropertyDeclaration: 'PLAY0016',\n IdentifierOutsideCommand: 'PLAY0017',\n InvalidEventDeclaration: 'PLAY0018',\n IdentifierOnEventProperty: 'PLAY0019',\n TagPropertyReadAsTag: 'PLAY0020',\n InvalidModuleDeclaration: 'PLAY0021',\n UnknownModuleDirective: 'PLAY0022',\n InvalidFeatureDeclaration: 'PLAY0023',\n UnknownFeatureDirective: 'PLAY0024',\n InvalidSliceDeclaration: 'PLAY0027',\n UnknownSliceType: 'PLAY0028',\n UnknownSliceDirective: 'PLAY0029',\n InvalidPersonaDeclaration: 'PLAY0030',\n InvalidPersonaPolicyReference: 'PLAY0031',\n UnknownPersonaDirective: 'PLAY0032',\n InvalidCommandDeclaration: 'PLAY0033',\n UnknownCommandDirective: 'PLAY0034',\n DuplicateCommandIdentifier: 'PLAY0036',\n InvalidQueryDeclaration: 'PLAY0047',\n UnknownQueryDirective: 'PLAY0048',\n InvalidQueryParameter: 'PLAY0049',\n InvalidProjectionDeclaration: 'PLAY0056',\n EmptyProjection: 'PLAY0057',\n UnknownProjectionDirective: 'PLAY0058',\n FromWithoutEvent: 'PLAY0061',\n InvalidEventReference: 'PLAY0062',\n InvalidJoinDeclaration: 'PLAY0063',\n JoinWithoutEvent: 'PLAY0064',\n InvalidChildrenDeclaration: 'PLAY0065',\n InvalidNestedDeclaration: 'PLAY0066',\n NestedBlockWithoutFrom: 'PLAY0067',\n InvalidRemoveDeclaration: 'PLAY0068',\n UnknownRemoveDirective: 'PLAY0069',\n InvalidClearDeclaration: 'PLAY0070',\n ClearWithOutsideNestedBlock: 'PLAY0071',\n InvalidSpecificationDeclaration: 'PLAY0094',\n UnknownSpecificationDirective: 'PLAY0095',\n InvalidSpecificationWhen: 'PLAY0096',\n DuplicateSpecificationWhen: 'PLAY0097',\n InvalidThenError: 'PLAY0098',\n InvalidReadModelStep: 'PLAY0099',\n InvalidEventStep: 'PLAY0100',\n InvalidSpecificationValue: 'PLAY0101',\n InvalidScreenDeclaration: 'PLAY0102',\n UnknownScreenDirective: 'PLAY0103',\n InvalidDataDirective: 'PLAY0104',\n InvalidActionDirective: 'PLAY0105',\n UnknownActionDirective: 'PLAY0106',\n InvalidNavigation: 'PLAY0107',\n InvalidScreenLayoutSlot: 'PLAY0108',\n UnknownLayoutDirective: 'PLAY0026',\n InvalidTitleDirective: 'PLAY0109',\n UnknownTableDirective: 'PLAY0110',\n UnknownSummaryDirective: 'PLAY0111',\n AuthorizeWithoutPolicy: 'PLAY0122',\n InvalidPolicyReference: 'PLAY0123',\n InvalidConstraintDeclaration: 'PLAY0132',\n ConstraintWithoutRule: 'PLAY0133',\n InvalidConstraintBody: 'PLAY0134',\n DuplicateConstraintBody: 'PLAY0135',\n InvalidReactionDeclaration: 'PLAY0136',\n InvalidReactionTrigger: 'PLAY0137',\n ReactionWithoutTrigger: 'PLAY0138',\n InvalidValidateDeclaration: 'PLAY0140',\n InvalidValidationRule: 'PLAY0141',\n InvalidRuleName: 'PLAY0143',\n UnknownRuleImplementationDirective: 'PLAY0144',\n InvalidDescription: 'PLAY0145',\n EmptyDescription: 'PLAY0146',\n DuplicateDescription: 'PLAY0147',\n TagWithoutValue: 'PLAY0148',\n InvalidTagValue: 'PLAY0149',\n UnknownContextPath: 'PLAY0153',\n UnknownContextCausedByProperty: 'PLAY0154',\n UnknownContextIdentityProperty: 'PLAY0155',\n ExpectedCodeFence: 'PLAY0163',\n UnclosedCodeBlock: 'PLAY0164',\n DuplicateDeclaration: 'PLAY0168',\n RepeatedSingularDeclarationAcrossFiles: 'PLAY0172',\n RepeatedDeclarationAcrossFiles: 'PLAY0173',\n ConflictingDescriptionAcrossFiles: 'PLAY0174',\n UnexpectedTokenInAuthorize: 'PLAY0184',\n UnclosedAuthorizeGroup: 'PLAY0185',\n InvalidReadModelDeclaration: 'PLAY0186',\n InvalidInvokesDeclaration: 'PLAY0194',\n InvalidScopeDeclaration: 'PLAY0199',\n DuplicateScope: 'PLAY0200',\n InvalidIntervalTrigger: 'PLAY0249',\n InvalidScheduleTrigger: 'PLAY0250',\n DuplicateReactionTrigger: 'PLAY0253',\n InvalidSpecificationEventSource: 'PLAY0275',\n DuplicateSpecificationEventSource: 'PLAY0276',\n InvalidProjectionVariantDeclaration: 'PLAY0277',\n InvalidEntersOnDeclaration: 'PLAY0279',\n NestedProjectionVariantNotAllowed: 'PLAY0280',\n InvalidStructuredValue: 'PLAY0291',\n DuplicateStructuredValueMember: 'PLAY0294',\n ConflictingSpecificationActions: 'PLAY0358',\n InvalidSpecificationEventOrder: 'PLAY0359',\n InvalidValidationSeverity: 'PLAY0368',\n VariantRequiresEnteringEvent: 'PLAY0382',\n /** An event is used more than once in one projection level's event or join set. */\n DuplicateEventInProjectionScope: 'PLAY0801',\n /** An event source has the reserved stored name Default, or an event stream has the reserved stored name All, including through an id pin. */\n ReservedStoredName: 'PLAY0802',\n DuplicateProjectionVariant: 'PLAY0384',\n DuplicateVariantEnteringEvent: 'PLAY0385',\n InvalidSpecificationDenied: 'PLAY0388',\n DuplicateAuthorizationAcrossFiles: 'PLAY0394',\n FileConstraintOnlySupportsUniqueness: 'PLAY0396',\n LegacyInlineCodeFence: 'PLAY0397',\n InvalidEventGeneration: 'PLAY0446',\n InvalidFileImport: 'PLAY0454',\n FileImportMatchesNothing: 'PLAY0455',\n ImportedFileNotFound: 'PLAY0456',\n ConflictingImportPlacement: 'PLAY0457',\n ImportCycle: 'PLAY0458',\n ModuleInPlacedFile: 'PLAY0459',\n UnexpectedInPlacedFile: 'PLAY0460',\n InvalidSpecificationClock: 'PLAY0461',\n InvalidSpecificationTrigger: 'PLAY0462',\n InvalidSpecificationCapture: 'PLAY0463',\n InvalidSpecificationQueryAction: 'PLAY0464',\n MismatchedSpecificationQueryResult: 'PLAY0465',\n UnknownSpecificationQueryArgument: 'PLAY0468',\n InvalidSpecificationQuery: 'PLAY0265',\n UnknownSpecificationQueryDirective: 'PLAY0266',\n DuplicateSpecificationQueryArguments: 'PLAY0267',\n InvalidAbsentReadModelStep: 'PLAY0453',\n LegacyOptionalSuffix: 'PLAY0479',\n InvalidOptionalModifierOrder: 'PLAY0480',\n OptionalReadsNotSupported: 'PLAY0481',\n InvalidSpecificationCaller: 'PLAY0386',\n DuplicateSpecificationCallerOrDenied: 'PLAY0387',\n GeneratedPropertyOutsideCommand: 'PLAY0482',\n InvalidGeneratedType: 'PLAY0483',\n InvalidGeneratedModifierOrder: 'PLAY0484',\n DuplicateEventSubject: 'PLAY0590',\n InvalidSubjectType: 'PLAY0591',\n ProtectedSubjectType: 'PLAY0592',\n InvalidSubjectOwner: 'PLAY0593',\n ReadModelSubjectNotSupported: 'PLAY0594',\n InvalidSubjectModifierOrder: 'PLAY0595',\n GeneratedPropertySuppliedAsInput: 'PLAY0485',\n InvalidCommandResponse: 'PLAY0486',\n InvalidResponseSource: 'PLAY0487',\n DuplicateResponseField: 'PLAY0488',\n InvalidResponseShape: 'PLAY0489',\n InvalidGeneratedFixture: 'PLAY0490',\n InvalidReturnExpectation: 'PLAY0491',\n InvalidImplementationBlock: 'PLAY0492',\n InvalidImplementationHint: 'PLAY0493',\n ConflictingImplementationSources: 'PLAY0494',\n UnknownType: 'PLAY0165',\n InvalidSystemDeclaration: 'PLAY0495',\n InvalidOperationDeclaration: 'PLAY0496',\n InvalidProductionReference: 'PLAY0497',\n ProductionDeclarationCollision: 'PLAY0498',\n OperationOutsideCommand: 'PLAY0499',\n InvalidSystemReference: 'PLAY0500',\n InvalidOperationMapping: 'PLAY0501',\n InvalidOperationSpecification: 'PLAY0502',\n InvalidCaptureDeclaration: 'PLAY0078',\n UnknownCaptureDirective: 'PLAY0079',\n InvalidMapEntry: 'PLAY0080',\n InvalidTranslation: 'PLAY0081',\n InvalidSplitDeclaration: 'PLAY0082',\n InvalidSplitTarget: 'PLAY0083',\n InvalidAppendDeclaration: 'PLAY0084',\n UnknownAppendDirective: 'PLAY0085',\n WhenWithoutTrigger: 'PLAY0086',\n InvalidWhenClause: 'PLAY0087',\n InvalidWhenTransitionClause: 'PLAY0088',\n MixedWhenCombinators: 'PLAY0089',\n WhenCombinatorWithoutProperty: 'PLAY0090',\n UnknownCaptureBlockDirective: 'PLAY0091',\n InvalidCompositeKeyPart: 'PLAY0072',\n TemplateInCompositeKey: 'PLAY0073',\n EmptyCompositeKey: 'PLAY0074',\n InvalidProjectionMapping: 'PLAY0075',\n ExpectedLiteralValue: 'PLAY0150',\n InvalidExpression: 'PLAY0152',\n UnterminatedInterpolation: 'PLAY0157',\n UnterminatedTemplateExpression: 'PLAY0156',\n ProjectionDocumentWithoutProjection: 'PLAY0055',\n CaptureDocumentWithoutCapture: 'PLAY0077',\n SpecificationDocumentWithoutSpecification: 'PLAY0093',\n InvalidSeedDeclaration: 'PLAY0128',\n InvalidSeedGroup: 'PLAY0129',\n InvalidSeedEvent: 'PLAY0130',\n InvalidSeedPropertyAssignment: 'PLAY0131',\n InvalidPolicyDeclaration: 'PLAY0112',\n UnknownPolicyDirective: 'PLAY0113',\n PolicyWithoutRequirement: 'PLAY0114',\n ExpectedRoleName: 'PLAY0118',\n ExpectedClaimName: 'PLAY0119',\n ExpectedClaimMatches: 'PLAY0120',\n ExpectedClaimMatchTarget: 'PLAY0121',\n MixedPolicyImplementation: 'PLAY0440',\n RepeatedPolicyRequirement: 'PLAY0441',\n UnexpectedTokenInPolicyCondition: 'PLAY0115',\n ExpectedPolicyCondition: 'PLAY0116',\n UnclosedPolicyConditionGroup: 'PLAY0117',\n UnexpectedTokenInCondition: 'PLAY0158',\n ExpectedCondition: 'PLAY0159',\n ExpectedComparisonOperator: 'PLAY0161',\n ExpectedComparisonValue: 'PLAY0162',\n InvalidActionAlternative: 'PLAY0341',\n GuardedActionWithoutAlternatives: 'PLAY0342',\n MisplacedActionOtherwise: 'PLAY0343',\n UnsupportedActionConditionOperand: 'PLAY0344',\n InvalidInteractionArgument: 'PLAY0319',\n UnclosedConditionGroup: 'PLAY0160',\n InvalidNumericDirective: 'PLAY0508',\n DuplicateNumericDirective: 'PLAY0509',\n LateNumericDirective: 'PLAY0510',\n InexactNumericLiteral: 'PLAY0511',\n MixedNumericModes: 'PLAY0512',\n IncompatibleNumericSource: 'PLAY0513',\n EventFromLaterSlice: 'PLAY0516',\n TimelineCycleGroup: 'PLAY0517',\n InvalidSpecificationExample: 'PLAY0518',\n DuplicateSpecificationAssignment: 'PLAY0519',\n UnresolvedSpecificationExampleType: 'PLAY0520',\n SpecificationExampleNameCollision: 'PLAY0521',\n SpecificationExampleKindMismatch: 'PLAY0522',\n InvalidSpecificationExampleValue: 'PLAY0523',\n MissingSpecificationProperty: 'PLAY0524',\n UnadmittedSpecificationExampleValue: 'PLAY0525',\n InvalidSpecificationExampleBody: 'PLAY0526',\n AmbiguousReference: 'PLAY0198',\n InvalidSpecificationStream: 'PLAY0547',\n SpecificationStreamOnCommand: 'PLAY0548',\n InvalidSpecificationStreamRoute: 'PLAY0549',\n InvalidSpecificationStreamEventSource: 'PLAY0550',\n SpecificationStreamContradictsCommand: 'PLAY0551',\n InvalidDependencyTarget: 'PLAY0554',\n RepeatedDependencyDeclaration: 'PLAY0555',\n UndeclaredDependency: 'PLAY0552',\n UnusedDependencyDeclaration: 'PLAY0553',\n MutualDependencyDeclarations: 'PLAY0556',\n AuthorizationRefusalWithoutIdentity: 'PLAY0557',\n InvalidDocumentation: 'PLAY0558',\n ConflictingDocumentationAcrossFiles: 'PLAY0559',\n InvalidSpecificationCallerPersona: 'PLAY0572',\n UnsynthesizablePersonaCaller: 'PLAY0573',\n PersonaWithoutGate: 'PLAY0574',\n GateWithoutPersona: 'PLAY0575',\n AmbiguousPersonaCaller: 'PLAY0576',\n InvalidSpecificationParameter: 'PLAY0577',\n InvalidSpecificationCase: 'PLAY0578',\n DuplicateSpecificationParameter: 'PLAY0579',\n DuplicateSpecificationCase: 'PLAY0580',\n IncompleteSpecificationTable: 'PLAY0581',\n InvalidSpecificationCaseAssignment: 'PLAY0582',\n InvalidSpecificationCaseValue: 'PLAY0583',\n InvalidSpecificationCaseReference: 'PLAY0584',\n OptionalSpecificationParameterTarget: 'PLAY0585',\n SpecificationCaseNameCollision: 'PLAY0586',\n IncompatibleSpecificationParameterType: 'PLAY0587',\n UnusedSpecificationParameter: 'PLAY0588',\n SingularSpecificationTableExpansion: 'PLAY0589',\n UnsupportedInteractionAlternatives: 'PLAY0560',\n MixedInteractionAlternatives: 'PLAY0561',\n InteractionAlternativeWithoutActions: 'PLAY0562',\n InlineInteractionAlternative: 'PLAY0563',\n LegacyInteractionWhere: 'PLAY0564',\n InvalidEventSourceDeclaration: 'PLAY0503',\n InvalidCommandStream: 'PLAY0504',\n AmbiguousCommandStream: 'PLAY0505',\n UnsupportedStreamIdType: 'PLAY0506',\n RedundantSourceStreamId: 'PLAY0507',\n UnknownEvent: 'PLAY0166',\n UnknownReadModelProperty: 'PLAY0514',\n PiiNotSupportedOnIdentifier: 'PLAY0515',\n HandlerWithoutImplementation: 'PLAY0045',\n UnknownHandlerDirective: 'PLAY0046',\n CommandWithProducesAndHandler: 'PLAY0035',\n AbsoluteFileReference: 'PLAY0264',\n InvalidTriggerData: 'PLAY0246',\n InvalidReadModelKey: 'PLAY0660',\n IncompleteReadModelKey: 'PLAY0661', // C# only: scoped read-model key resolution.\n InvalidReadModelKeyLookup: 'PLAY0662', // Shape checks shared; scoped lookup checks are C# only.\n ProductionRouteOutsideCommand: 'PLAY0663',\n RedundantProductionRoute: 'PLAY0664',\n InvalidObserverFilter: 'PLAY0665',\n ObserverFilterExcludesEveryProducer: 'PLAY0666', // C# only: statically known producer routes.\n ReducerIdentityMismatch: 'PLAY0690',\n InvalidReactionBatchesDeclaration: 'PLAY0693',\n InvalidCommandReadsDeclaration: 'PLAY0780',\n GenerationSupportBudgetExceeded: 'PLAY0691',\n EmptyGenerationSupport: 'PLAY0692', // C# only: conservative nominal producer identity comparison.\n MixedEnumerationNumbering: 'PLAY0667',\n DuplicateEnumerationNumber: 'PLAY0668',\n EnumerationNumberOutsideInt32: 'PLAY0669',\n MalformedEnumerationNumber: 'PLAY0670',\n UnpinnedStoredEnumeration: 'PLAY0671',\n ReadsWithChildren: 'PLAY0451',\n UnknownGenerationStrategy: 'PLAY0672',\n InvalidGenerationArgument: 'PLAY0673',\n InvalidGenerationModifier: 'PLAY0674',\n DuplicateGenerationModifier: 'PLAY0675',\n DuplicateGeneration: 'PLAY0676',\n InvalidGenerationPrimitive: 'PLAY0677',\n InvalidGenerationPrefix: 'PLAY0678',\n InvalidGenerationAlphabet: 'PLAY0679',\n InvalidTypeIdPrefix: 'PLAY0680',\n GenerationSizeOutsideRange: 'PLAY0681',\n ReservedSequenceGeneration: 'PLAY0682',\n LowGenerationEntropy: 'PLAY0683',\n LowGeneratedIdentifierEntropy: 'PLAY0684',\n ResponseNameUsedOnFailure: 'PLAY0685',\n // Retired by ESM v16; preserved for compatibility with earlier native compiler diagnostics.\n EventIdPinNotCarriedToRenderers: 'PLAY0686',\n InvalidToolbarButton: 'PLAY0760',\n} as const;\n"],"mappings":"AAKA,MAAaA,EAAkB,CAC3B,4BAA6B,WAC7B,oBAAqB,WACrB,oBAAqB,WACrB,mCAAoC,WACpC,gCAAiC,WACjC,2BAA4B,WAC5B,kBAAmB,WACnB,sBAAuB,WACvB,sBAAuB,WACvB,4BAA6B,WAC7B,uBAAwB,WACxB,wBAAyB,WACzB,sBAAuB,WACvB,qBAAsB,WACtB,qBAAsB,WACtB,wBAAyB,WACzB,wBAAyB,WACzB,qCAAsC,WACtC,0BAA2B,WAC3B,wBAAyB,WACzB,+BAAgC,WAChC,uBAAwB,WACxB,mBAAoB,WACpB,4BAA6B,WAC7B,4BAA6B,WAE7B,2BAA4B,WAC5B,uCAAwC,WACxC,yBAA0B,WAC1B,2BAA4B,WAC5B,yBAA0B,WAC1B,yBAA0B,WAC1B,2BAA4B,WAC5B,mCAAoC,WACpC,8BAA+B,WAC/B,wBAAyB,WACzB,0BAA2B,WAC3B,sCAAuC,WACvC,sCAAuC,WACvC,2BAA4B,WAC5B,gCAAiC,WACjC,2CAA4C,WAC5C,8BAA+B,WAC/B,iCAAkC,WAClC,+BAAgC,WAChC,mCAAoC,WACpC,uCAAwC,WACxC,4BAA6B,WAC7B,2BAA4B,WAC5B,4BAA6B,WAC7B,6BAA8B,WAE9B,2BAA4B,WAC5B,qBAAsB,WACtB,gBAAiB,WACjB,iBAAkB,WAClB,4BAA6B,WAC7B,4BAA6B,WAC7B,uBAAwB,WACxB,yBAA0B,WAC1B,2BAA4B,WAC5B,wBAAyB,WACzB,sBAAuB,WACvB,6BAA8B,WAC9B,6BAA8B,WAC9B,+BAAgC,WAChC,qBAAsB,WACtB,wBAAyB,WACzB,4BAA6B,WAC7B,oBAAqB,WACrB,yBAA0B,WAC1B,0BAA2B,WAC3B,uBAAwB,W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AC9B,uBAAwB,WACxB,8BAA+B,WAC/B,qBAAsB,WACtB,uBAAwB,WACxB,wBAAyB,WACzB,wBAAyB,WACzB,aAAc,WACd,yBAA0B,WAC1B,4BAA6B,WAC7B,6BAA8B,WAC9B,wBAAyB,WACzB,8BAA+B,WAC/B,sBAAuB,WACvB,mBAAoB,WACpB,oBAAqB,WACrB,uBAAwB,WACxB,0BAA2B,WAC3B,8BAA+B,WAC/B,yBAA0B,WAC1B,sBAAuB,WACvB,oCAAqC,WACrC,wBAAyB,WACzB,kCAAmC,WACnC,+BAAgC,WAChC,gCAAiC,WACjC,uBAAwB,WACxB,0BAA2B,WAC3B,2BAA4B,WAC5B,8BAA+B,WAC/B,2BAA4B,WAC5B,0BAA2B,WAC3B,kBAAmB,WACnB,0BAA2B,WAC3B,0BAA2B,WAC3B,0BAA2B,WAC3B,4BAA6B,WAC7B,oBAAqB,WACrB,2BAA4B,WAC5B,wBAAyB,WACzB,0BAA2B,WAC3B,oBAAqB,WACrB,2BAA4B,WAC5B,2BAA4B,WAC5B,qBAAsB,WACtB,8BAA+B,WAC/B,0BAA2B,WAE3B,gCAAiC,WACjC,qBAAsB,UAC1B"}
|
|
1
|
+
{"version":3,"file":"DiagnosticCodes.js","names":["DiagnosticCodes"],"sources":["../../../../../../Compiler/Diagnostics/DiagnosticCodes.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// Shared diagnostic names, including the explicitly C#-only checks below. Catalogue membership does\n// not imply TypeScript validation support; see Documentation/screenplay/editor-diagnostics.md.\nexport const DiagnosticCodes = {\n DuplicateBehaviorAttachment: 'PLAY0340',\n UnknownMatchPattern: 'PLAY0366',\n InvalidMatchPattern: 'PLAY0367',\n PatternOutsidePortableMatchDialect: 'PLAY0699',\n AmbiguousMatchPattern: 'PLAY0803',\n DeprecatedStudioTextRulePattern: 'PLAY0787',\n InvalidIdentityDeclaration: 'PLAY0633',\n DuplicateIdentity: 'PLAY0634',\n InvalidIdentityDetail: 'PLAY0635',\n UnknownIdentitySource: 'PLAY0636',\n IdentityDetailWithoutSource: 'PLAY0637',\n IdentitySourceWithBody: 'PLAY0638',\n DuplicateIdentityDetail: 'PLAY0639',\n BuiltInIdentityDetail: 'PLAY0640',\n UnknownIdentityQuery: 'PLAY0641',\n InvalidIdentityQuery: 'PLAY0642',\n IdentityQueryWithoutKey: 'PLAY0643',\n InvalidIdentityQueryKey: 'PLAY0644',\n IdentityQueryAuthorizationDependency: 'PLAY0645',\n IdentityQueryTypeMismatch: 'PLAY0646',\n InvalidReactionIdentity: 'PLAY0647',\n GatedInvocationWithoutIdentity: 'PLAY0648',\n UnusedReactionIdentity: 'PLAY0649',\n UnusedReactionRole: 'PLAY0650',\n UnsatisfiedReactionIdentity: 'PLAY0651',\n ReactionPrivilegeEscalation: 'PLAY0652',\n // C#-only whole-model public event boundaries; membership is not TypeScript validation support.\n CommandProducesPublicEvent: 'PLAY0607',\n PublicEventRequiresOutboundTranslation: 'PLAY0608',\n OutboundPublicEventCount: 'PLAY0609',\n ForeignPublicEventConsumer: 'PLAY0610',\n OutboundTranslationInput: 'PLAY0611',\n InboundTranslationOutput: 'PLAY0612',\n ForeignPublicEventProduced: 'PLAY0613',\n PublicTranslationRequiresDirection: 'PLAY0614',\n TranslationConstructDirection: 'PLAY0615',\n InboundTranslationInput: 'PLAY0616',\n OutboundTranslationOutput: 'PLAY0617',\n EventTargetOutsideOutboundTranslation: 'PLAY0618',\n EventsSourceOutsideInboundTranslation: 'PLAY0619',\n InvalidCaptureEventsSource: 'PLAY0620',\n CaptureEventsFromSeveralOrigins: 'PLAY0687',\n DirectionlessTranslationReactsToOwnCapture: 'PLAY0694',\n PendingIntentWithOtherHandler: 'PLAY0698',\n CommandHandlerRequiresAttachment: 'PLAY0800', // C# only\n DescribedCommandNotImplemented: 'PLAY0695', // C# only\n DescribedCommandWithoutProductions: 'PLAY0696', // C# only\n DescribedCommandCardinalityNotAdmitted: 'PLAY0697', // C# only\n CaptureEventsKeyNotRequired: 'PLAY0700',\n CaptureEventsRecordFixture: 'PLAY0701',\n RefutedGeneratedConceptRule: 'PLAY0688',\n UnprovenGeneratedConceptRule: 'PLAY0689',\n // Syntax shared with C#; the reference checks (owners, instances, cycles, outlets, scopes, packages) are C#-only.\n InvalidExposureDeclaration: 'PLAY0621',\n UnknownExposureOwner: 'PLAY0622',\n ReExposureCycle: 'PLAY0623',\n ReExposureBroken: 'PLAY0624',\n InvalidInstanceContribution: 'PLAY0625',\n UnknownContributionInstance: 'PLAY0626',\n ContributionNotExposed: 'PLAY0627',\n ContributionTypeMismatch: 'PLAY0628',\n UnknownTemplateContentSlot: 'PLAY0629',\n UnknownNavigationOutlet: 'PLAY0630',\n TemplateScopeMismatch: 'PLAY0631',\n IncompatibleComponentPackage: 'PLAY0632',\n UnknownNavigationDestination: 'PLAY0654',\n UnknownScreenContributionPoint: 'PLAY0655',\n TemplateNestingCycle: 'PLAY0656',\n TemplateCategoryMissing: 'PLAY0720', // C# only: template declarations are not modeled by this compiler.\n InvalidTemplateVersionRange: 'PLAY0721',\n LegacyProfileLayout: 'PLAY0791', // The other ui profile root template rules (PLAY0790, PLAY0792-PLAY0799) are C# only: this compiler does not model a ui profile.\n UnknownTemplateBlueprint: 'PLAY0722', // C# only: ui profile packages are not modeled by this compiler.\n DuplicateComplianceMarker: 'PLAY0653',\n LegacyComplianceMarker: 'PLAY0565',\n UnknownComplianceMarker: 'PLAY0566',\n InvalidSecretScope: 'PLAY0567',\n DuplicateSecretScope: 'PLAY0568',\n SecretScopeIgnoredForPii: 'PLAY0569',\n InvalidPersonalDataQualifier: 'PLAY0570',\n DuplicateSpecialCategory: 'PLAY0571',\n InvalidPurposeDeclaration: 'PLAY0596',\n InvalidPurposeVocabulary: 'PLAY0597',\n DuplicatePurposeField: 'PLAY0598',\n DuplicatePurposeDeclaration: 'PLAY0599',\n UnknownPurpose: 'PLAY0600',\n PurposeInterestMismatch: 'PLAY0601',\n PersonalDataWithoutPurpose: 'PLAY0602',\n SpecialDataWithoutCondition: 'PLAY0603',\n CriminalDataWithoutAuthorization: 'PLAY0604',\n PurposeWithoutBasis: 'PLAY0605',\n UnusedPurpose: 'PLAY0606',\n // C#-only: opt-in completeness, scoped action/refusal reference validation, and semantic binding.\n ConflictingScreenDataBinding: 'PLAY0530',\n ScreenDataQueryMismatch: 'PLAY0531',\n ActionWithoutInputSurface: 'PLAY0532',\n CommandWithoutInputSurface: 'PLAY0533',\n ReadModelFieldWithoutOrigin: 'PLAY0534',\n QueryParameterNotHeldByView: 'PLAY0535',\n UnconsumedEvent: 'PLAY0536',\n UnreachableScreen: 'PLAY0537',\n UnknownActionSubjectField: 'PLAY0345',\n UnresolvedActionSubject: 'PLAY0346',\n UnreachableActionAlternative: 'PLAY0347',\n UnknownActionArgumentProperty: 'PLAY0348',\n UnreachableRefusalBranch: 'PLAY0540',\n InvalidRefusalValue: 'PLAY0541',\n UnknownRefusalConstraint: 'PLAY0542',\n UnknownRedeliveryReaction: 'PLAY0544',\n IndeterminateNegatedClaimTarget: 'PLAY0546',\n InvalidRefusalBranch: 'PLAY0538',\n InvalidRefusalBranchBody: 'PLAY0539',\n UnmatchedRedeliveredOccurrence: 'PLAY0543',\n InvalidNoEventsExpectation: 'PLAY0545',\n InvalidProducesDeclaration: 'PLAY0042',\n ProducesWhenWithoutEvent: 'PLAY0043',\n InvalidPropertyMapping: 'PLAY0044',\n DuplicateProducesTarget: 'PLAY0193',\n EventSourceIdInPayload: 'PLAY0469',\n ExplicitProducesTargetsRequired: 'PLAY0470',\n RedundantEventId: 'PLAY0471',\n InvalidEventId: 'PLAY0472',\n InlineEventCollision: 'PLAY0473',\n InlineEventOutsideCommand: 'PLAY0474',\n InlineEventGeneration: 'PLAY0475',\n ReservedProductionMetadata: 'PLAY0476',\n InvalidEventDocumentation: 'PLAY0477',\n OmittedProductionDestination: 'PLAY0478',\n UnknownConstraintProperty: 'PLAY0391',\n UnknownTopLevelConstruct: 'PLAY0001',\n InvalidDomainDeclaration: 'PLAY0002',\n DuplicateDomain: 'PLAY0003',\n DomainNotFirst: 'PLAY0004',\n InvalidImportDeclaration: 'PLAY0005',\n TabIndentation: 'PLAY0006',\n InvalidConceptDeclaration: 'PLAY0007',\n UnknownPrimitiveType: 'PLAY0008',\n InvalidEnumerationValue: 'PLAY0009',\n UnknownConceptDirective: 'PLAY0010',\n ValidateReadAsEnumerationBlock: 'PLAY0011',\n AttributeReasonWithoutAttribute: 'PLAY0012',\n DuplicateAttributeReason: 'PLAY0013',\n InvalidTypeDeclaration: 'PLAY0014',\n TypeWithoutProperties: 'PLAY0015',\n InvalidPropertyDeclaration: 'PLAY0016',\n IdentifierOutsideCommand: 'PLAY0017',\n InvalidEventDeclaration: 'PLAY0018',\n IdentifierOnEventProperty: 'PLAY0019',\n TagPropertyReadAsTag: 'PLAY0020',\n InvalidModuleDeclaration: 'PLAY0021',\n UnknownModuleDirective: 'PLAY0022',\n InvalidFeatureDeclaration: 'PLAY0023',\n UnknownFeatureDirective: 'PLAY0024',\n InvalidSliceDeclaration: 'PLAY0027',\n UnknownSliceType: 'PLAY0028',\n UnknownSliceDirective: 'PLAY0029',\n InvalidPersonaDeclaration: 'PLAY0030',\n InvalidPersonaPolicyReference: 'PLAY0031',\n UnknownPersonaDirective: 'PLAY0032',\n InvalidCommandDeclaration: 'PLAY0033',\n UnknownCommandDirective: 'PLAY0034',\n DuplicateCommandIdentifier: 'PLAY0036',\n InvalidQueryDeclaration: 'PLAY0047',\n UnknownQueryDirective: 'PLAY0048',\n InvalidQueryParameter: 'PLAY0049',\n InvalidProjectionDeclaration: 'PLAY0056',\n EmptyProjection: 'PLAY0057',\n UnknownProjectionDirective: 'PLAY0058',\n FromWithoutEvent: 'PLAY0061',\n InvalidEventReference: 'PLAY0062',\n InvalidJoinDeclaration: 'PLAY0063',\n JoinWithoutEvent: 'PLAY0064',\n InvalidChildrenDeclaration: 'PLAY0065',\n InvalidNestedDeclaration: 'PLAY0066',\n NestedBlockWithoutFrom: 'PLAY0067',\n InvalidRemoveDeclaration: 'PLAY0068',\n UnknownRemoveDirective: 'PLAY0069',\n InvalidClearDeclaration: 'PLAY0070',\n ClearWithOutsideNestedBlock: 'PLAY0071',\n InvalidSpecificationDeclaration: 'PLAY0094',\n UnknownSpecificationDirective: 'PLAY0095',\n InvalidSpecificationWhen: 'PLAY0096',\n DuplicateSpecificationWhen: 'PLAY0097',\n InvalidThenError: 'PLAY0098',\n InvalidReadModelStep: 'PLAY0099',\n InvalidEventStep: 'PLAY0100',\n InvalidSpecificationValue: 'PLAY0101',\n InvalidScreenDeclaration: 'PLAY0102',\n UnknownScreenDirective: 'PLAY0103',\n InvalidDataDirective: 'PLAY0104',\n InvalidActionDirective: 'PLAY0105',\n UnknownActionDirective: 'PLAY0106',\n InvalidNavigation: 'PLAY0107',\n InvalidScreenLayoutSlot: 'PLAY0108',\n UnknownLayoutDirective: 'PLAY0026',\n InvalidTitleDirective: 'PLAY0109',\n UnknownTableDirective: 'PLAY0110',\n UnknownSummaryDirective: 'PLAY0111',\n AuthorizeWithoutPolicy: 'PLAY0122',\n InvalidPolicyReference: 'PLAY0123',\n InvalidConstraintDeclaration: 'PLAY0132',\n ConstraintWithoutRule: 'PLAY0133',\n InvalidConstraintBody: 'PLAY0134',\n DuplicateConstraintBody: 'PLAY0135',\n InvalidReactionDeclaration: 'PLAY0136',\n InvalidReactionTrigger: 'PLAY0137',\n ReactionWithoutTrigger: 'PLAY0138',\n InvalidValidateDeclaration: 'PLAY0140',\n InvalidValidationRule: 'PLAY0141',\n InvalidRuleName: 'PLAY0143',\n UnknownRuleImplementationDirective: 'PLAY0144',\n InvalidDescription: 'PLAY0145',\n EmptyDescription: 'PLAY0146',\n DuplicateDescription: 'PLAY0147',\n TagWithoutValue: 'PLAY0148',\n InvalidTagValue: 'PLAY0149',\n UnknownContextPath: 'PLAY0153',\n UnknownContextCausedByProperty: 'PLAY0154',\n UnknownContextIdentityProperty: 'PLAY0155',\n ExpectedCodeFence: 'PLAY0163',\n UnclosedCodeBlock: 'PLAY0164',\n DuplicateDeclaration: 'PLAY0168',\n RepeatedSingularDeclarationAcrossFiles: 'PLAY0172',\n RepeatedDeclarationAcrossFiles: 'PLAY0173',\n ConflictingDescriptionAcrossFiles: 'PLAY0174',\n UnexpectedTokenInAuthorize: 'PLAY0184',\n UnclosedAuthorizeGroup: 'PLAY0185',\n InvalidReadModelDeclaration: 'PLAY0186',\n InvalidInvokesDeclaration: 'PLAY0194',\n InvalidScopeDeclaration: 'PLAY0199',\n DuplicateScope: 'PLAY0200',\n InvalidIntervalTrigger: 'PLAY0249',\n InvalidScheduleTrigger: 'PLAY0250',\n DuplicateReactionTrigger: 'PLAY0253',\n InvalidSpecificationEventSource: 'PLAY0275',\n DuplicateSpecificationEventSource: 'PLAY0276',\n InvalidProjectionVariantDeclaration: 'PLAY0277',\n InvalidEntersOnDeclaration: 'PLAY0279',\n NestedProjectionVariantNotAllowed: 'PLAY0280',\n InvalidStructuredValue: 'PLAY0291',\n DuplicateStructuredValueMember: 'PLAY0294',\n ConflictingSpecificationActions: 'PLAY0358',\n InvalidSpecificationEventOrder: 'PLAY0359',\n InvalidValidationSeverity: 'PLAY0368',\n VariantRequiresEnteringEvent: 'PLAY0382',\n /** An event is used more than once in one projection level's event or join set. */\n DuplicateEventInProjectionScope: 'PLAY0801',\n /** An event source has the reserved stored name Default, or an event stream has the reserved stored name All, including through an id pin. */\n ReservedStoredName: 'PLAY0802',\n DuplicateProjectionVariant: 'PLAY0384',\n DuplicateVariantEnteringEvent: 'PLAY0385',\n InvalidSpecificationDenied: 'PLAY0388',\n DuplicateAuthorizationAcrossFiles: 'PLAY0394',\n FileConstraintOnlySupportsUniqueness: 'PLAY0396',\n LegacyInlineCodeFence: 'PLAY0397',\n InvalidEventGeneration: 'PLAY0446',\n InvalidFileImport: 'PLAY0454',\n FileImportMatchesNothing: 'PLAY0455',\n ImportedFileNotFound: 'PLAY0456',\n ConflictingImportPlacement: 'PLAY0457',\n ImportCycle: 'PLAY0458',\n ModuleInPlacedFile: 'PLAY0459',\n UnexpectedInPlacedFile: 'PLAY0460',\n InvalidSpecificationClock: 'PLAY0461',\n InvalidSpecificationTrigger: 'PLAY0462',\n InvalidSpecificationCapture: 'PLAY0463',\n InvalidSpecificationQueryAction: 'PLAY0464',\n MismatchedSpecificationQueryResult: 'PLAY0465',\n UnknownSpecificationQueryArgument: 'PLAY0468',\n InvalidSpecificationQuery: 'PLAY0265',\n UnknownSpecificationQueryDirective: 'PLAY0266',\n DuplicateSpecificationQueryArguments: 'PLAY0267',\n InvalidAbsentReadModelStep: 'PLAY0453',\n LegacyOptionalSuffix: 'PLAY0479',\n InvalidOptionalModifierOrder: 'PLAY0480',\n OptionalReadsNotSupported: 'PLAY0481',\n InvalidSpecificationCaller: 'PLAY0386',\n DuplicateSpecificationCallerOrDenied: 'PLAY0387',\n GeneratedPropertyOutsideCommand: 'PLAY0482',\n InvalidGeneratedType: 'PLAY0483',\n InvalidGeneratedModifierOrder: 'PLAY0484',\n DuplicateEventSubject: 'PLAY0590',\n InvalidSubjectType: 'PLAY0591',\n ProtectedSubjectType: 'PLAY0592',\n InvalidSubjectOwner: 'PLAY0593',\n ReadModelSubjectNotSupported: 'PLAY0594',\n InvalidSubjectModifierOrder: 'PLAY0595',\n GeneratedPropertySuppliedAsInput: 'PLAY0485',\n InvalidCommandResponse: 'PLAY0486',\n InvalidResponseSource: 'PLAY0487',\n DuplicateResponseField: 'PLAY0488',\n InvalidResponseShape: 'PLAY0489',\n InvalidGeneratedFixture: 'PLAY0490',\n InvalidReturnExpectation: 'PLAY0491',\n InvalidImplementationBlock: 'PLAY0492',\n InvalidImplementationHint: 'PLAY0493',\n ConflictingImplementationSources: 'PLAY0494',\n UnknownType: 'PLAY0165',\n InvalidSystemDeclaration: 'PLAY0495',\n InvalidOperationDeclaration: 'PLAY0496',\n InvalidProductionReference: 'PLAY0497',\n ProductionDeclarationCollision: 'PLAY0498',\n OperationOutsideCommand: 'PLAY0499',\n InvalidSystemReference: 'PLAY0500',\n InvalidOperationMapping: 'PLAY0501',\n InvalidOperationSpecification: 'PLAY0502',\n InvalidCaptureDeclaration: 'PLAY0078',\n UnknownCaptureDirective: 'PLAY0079',\n InvalidMapEntry: 'PLAY0080',\n InvalidTranslation: 'PLAY0081',\n InvalidSplitDeclaration: 'PLAY0082',\n InvalidSplitTarget: 'PLAY0083',\n InvalidAppendDeclaration: 'PLAY0084',\n UnknownAppendDirective: 'PLAY0085',\n WhenWithoutTrigger: 'PLAY0086',\n InvalidWhenClause: 'PLAY0087',\n InvalidWhenTransitionClause: 'PLAY0088',\n MixedWhenCombinators: 'PLAY0089',\n WhenCombinatorWithoutProperty: 'PLAY0090',\n UnknownCaptureBlockDirective: 'PLAY0091',\n InvalidCompositeKeyPart: 'PLAY0072',\n TemplateInCompositeKey: 'PLAY0073',\n EmptyCompositeKey: 'PLAY0074',\n InvalidProjectionMapping: 'PLAY0075',\n ExpectedLiteralValue: 'PLAY0150',\n InvalidExpression: 'PLAY0152',\n UnterminatedInterpolation: 'PLAY0157',\n UnterminatedTemplateExpression: 'PLAY0156',\n ProjectionDocumentWithoutProjection: 'PLAY0055',\n CaptureDocumentWithoutCapture: 'PLAY0077',\n SpecificationDocumentWithoutSpecification: 'PLAY0093',\n InvalidSeedDeclaration: 'PLAY0128',\n InvalidSeedGroup: 'PLAY0129',\n InvalidSeedEvent: 'PLAY0130',\n InvalidSeedPropertyAssignment: 'PLAY0131',\n InvalidPolicyDeclaration: 'PLAY0112',\n UnknownPolicyDirective: 'PLAY0113',\n PolicyWithoutRequirement: 'PLAY0114',\n ExpectedRoleName: 'PLAY0118',\n ExpectedClaimName: 'PLAY0119',\n ExpectedClaimMatches: 'PLAY0120',\n ExpectedClaimMatchTarget: 'PLAY0121',\n MixedPolicyImplementation: 'PLAY0440',\n RepeatedPolicyRequirement: 'PLAY0441',\n UnexpectedTokenInPolicyCondition: 'PLAY0115',\n ExpectedPolicyCondition: 'PLAY0116',\n UnclosedPolicyConditionGroup: 'PLAY0117',\n UnexpectedTokenInCondition: 'PLAY0158',\n ExpectedCondition: 'PLAY0159',\n ExpectedComparisonOperator: 'PLAY0161',\n ExpectedComparisonValue: 'PLAY0162',\n InvalidActionAlternative: 'PLAY0341',\n GuardedActionWithoutAlternatives: 'PLAY0342',\n MisplacedActionOtherwise: 'PLAY0343',\n UnsupportedActionConditionOperand: 'PLAY0344',\n InvalidInteractionArgument: 'PLAY0319',\n UnclosedConditionGroup: 'PLAY0160',\n InvalidNumericDirective: 'PLAY0508',\n DuplicateNumericDirective: 'PLAY0509',\n LateNumericDirective: 'PLAY0510',\n InexactNumericLiteral: 'PLAY0511',\n MixedNumericModes: 'PLAY0512',\n IncompatibleNumericSource: 'PLAY0513',\n EventFromLaterSlice: 'PLAY0516',\n TimelineCycleGroup: 'PLAY0517',\n InvalidSpecificationExample: 'PLAY0518',\n DuplicateSpecificationAssignment: 'PLAY0519',\n UnresolvedSpecificationExampleType: 'PLAY0520',\n SpecificationExampleNameCollision: 'PLAY0521',\n SpecificationExampleKindMismatch: 'PLAY0522',\n InvalidSpecificationExampleValue: 'PLAY0523',\n MissingSpecificationProperty: 'PLAY0524',\n UnadmittedSpecificationExampleValue: 'PLAY0525',\n InvalidSpecificationExampleBody: 'PLAY0526',\n AmbiguousReference: 'PLAY0198',\n InvalidSpecificationStream: 'PLAY0547',\n SpecificationStreamOnCommand: 'PLAY0548',\n InvalidSpecificationStreamRoute: 'PLAY0549',\n InvalidSpecificationStreamEventSource: 'PLAY0550',\n SpecificationStreamContradictsCommand: 'PLAY0551',\n InvalidDependencyTarget: 'PLAY0554',\n RepeatedDependencyDeclaration: 'PLAY0555',\n UndeclaredDependency: 'PLAY0552',\n UnusedDependencyDeclaration: 'PLAY0553',\n MutualDependencyDeclarations: 'PLAY0556',\n AuthorizationRefusalWithoutIdentity: 'PLAY0557',\n InvalidDocumentation: 'PLAY0558',\n ConflictingDocumentationAcrossFiles: 'PLAY0559',\n InvalidSpecificationCallerPersona: 'PLAY0572',\n UnsynthesizablePersonaCaller: 'PLAY0573',\n PersonaWithoutGate: 'PLAY0574',\n GateWithoutPersona: 'PLAY0575',\n AmbiguousPersonaCaller: 'PLAY0576',\n InvalidSpecificationParameter: 'PLAY0577',\n InvalidSpecificationCase: 'PLAY0578',\n DuplicateSpecificationParameter: 'PLAY0579',\n DuplicateSpecificationCase: 'PLAY0580',\n IncompleteSpecificationTable: 'PLAY0581',\n InvalidSpecificationCaseAssignment: 'PLAY0582',\n InvalidSpecificationCaseValue: 'PLAY0583',\n InvalidSpecificationCaseReference: 'PLAY0584',\n OptionalSpecificationParameterTarget: 'PLAY0585',\n SpecificationCaseNameCollision: 'PLAY0586',\n IncompatibleSpecificationParameterType: 'PLAY0587',\n UnusedSpecificationParameter: 'PLAY0588',\n SingularSpecificationTableExpansion: 'PLAY0589',\n UnsupportedInteractionAlternatives: 'PLAY0560',\n MixedInteractionAlternatives: 'PLAY0561',\n InteractionAlternativeWithoutActions: 'PLAY0562',\n InlineInteractionAlternative: 'PLAY0563',\n LegacyInteractionWhere: 'PLAY0564',\n InvalidEventSourceDeclaration: 'PLAY0503',\n InvalidCommandStream: 'PLAY0504',\n AmbiguousCommandStream: 'PLAY0505',\n UnsupportedStreamIdType: 'PLAY0506',\n RedundantSourceStreamId: 'PLAY0507',\n UnknownEvent: 'PLAY0166',\n UnknownReadModelProperty: 'PLAY0514',\n PiiNotSupportedOnIdentifier: 'PLAY0515',\n HandlerWithoutImplementation: 'PLAY0045',\n UnknownHandlerDirective: 'PLAY0046',\n CommandWithProducesAndHandler: 'PLAY0035',\n AbsoluteFileReference: 'PLAY0264',\n InvalidTriggerData: 'PLAY0246',\n InvalidReadModelKey: 'PLAY0660',\n IncompleteReadModelKey: 'PLAY0661', // C# only: scoped read-model key resolution.\n InvalidReadModelKeyLookup: 'PLAY0662', // Shape checks shared; scoped lookup checks are C# only.\n ProductionRouteOutsideCommand: 'PLAY0663',\n RedundantProductionRoute: 'PLAY0664',\n InvalidObserverFilter: 'PLAY0665',\n ObserverFilterExcludesEveryProducer: 'PLAY0666', // C# only: statically known producer routes.\n ReducerIdentityMismatch: 'PLAY0690',\n InvalidReactionBatchesDeclaration: 'PLAY0693',\n InvalidCommandReadsDeclaration: 'PLAY0780',\n GenerationSupportBudgetExceeded: 'PLAY0691',\n EmptyGenerationSupport: 'PLAY0692', // C# only: conservative nominal producer identity comparison.\n MixedEnumerationNumbering: 'PLAY0667',\n DuplicateEnumerationNumber: 'PLAY0668',\n EnumerationNumberOutsideInt32: 'PLAY0669',\n MalformedEnumerationNumber: 'PLAY0670',\n UnpinnedStoredEnumeration: 'PLAY0671',\n ReadsWithChildren: 'PLAY0451',\n UnknownGenerationStrategy: 'PLAY0672',\n InvalidGenerationArgument: 'PLAY0673',\n InvalidGenerationModifier: 'PLAY0674',\n DuplicateGenerationModifier: 'PLAY0675',\n DuplicateGeneration: 'PLAY0676',\n InvalidGenerationPrimitive: 'PLAY0677',\n InvalidGenerationPrefix: 'PLAY0678',\n InvalidGenerationAlphabet: 'PLAY0679',\n InvalidTypeIdPrefix: 'PLAY0680',\n GenerationSizeOutsideRange: 'PLAY0681',\n ReservedSequenceGeneration: 'PLAY0682',\n LowGenerationEntropy: 'PLAY0683',\n LowGeneratedIdentifierEntropy: 'PLAY0684',\n ResponseNameUsedOnFailure: 'PLAY0685',\n // Retired by ESM v16; preserved for compatibility with earlier native compiler diagnostics.\n EventIdPinNotCarriedToRenderers: 'PLAY0686',\n InvalidToolbarButton: 'PLAY0760',\n} as const;\n"],"mappings":"AAKA,MAAaA,EAAkB,CAC3B,4BAA6B,WAC7B,oBAAqB,WACrB,oBAAqB,WACrB,mCAAoC,WACpC,sBAAuB,WACvB,gCAAiC,WACjC,2BAA4B,WAC5B,kBAAmB,WACnB,sBAAuB,WACvB,sBAAuB,WACvB,4BAA6B,WAC7B,uBAAwB,WACxB,wBAAyB,WACzB,sBAAuB,WACvB,qBAAsB,WACtB,qBAAsB,WACtB,wB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AC3B,2BAA4B,WAC5B,8BAA+B,WAC/B,2BAA4B,WAC5B,0BAA2B,WAC3B,kBAAmB,WACnB,0BAA2B,WAC3B,0BAA2B,WAC3B,0BAA2B,WAC3B,4BAA6B,WAC7B,oBAAqB,WACrB,2BAA4B,WAC5B,wBAAyB,WACzB,0BAA2B,WAC3B,oBAAqB,WACrB,2BAA4B,WAC5B,2BAA4B,WAC5B,qBAAsB,WACtB,8BAA+B,WAC/B,0BAA2B,WAE3B,gCAAiC,WACjC,qBAAsB,UAC1B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import"../Parsing/ImportDiscovery.js";import"../ScreenplayCompiler.js";const e=/* @__PURE__ */ new WeakMap,authoredOrderKey=e=>JSON.stringify(e);function authoredOrderOf(t){return e.get(t)
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{samePlacement as e}from"./PlayPlacement.js";import{placementFrom as t}from"../Parsing/ImportDiscovery.js";import{matchesPlayPattern as n,normalizePlayPath as r,resolvePlayPattern as i}from"./PlayGlob.js";import{discoverImports as a,parseForAuthoring as o}from"../ScreenplayCompiler.js";const s=/* @__PURE__ */ new WeakMap,authoredOriginsOf=e=>s.get(e)??/* @__PURE__ */ new Map,sameAuthoredStep=(e,t)=>e.path===t.path&&e.node.kind===t.node.kind&&e.node.location.line===t.node.location.line&&e.node.location.column===t.node.location.column&&e.targetPath===t.targetPath,c=/* @__PURE__ */ new WeakMap,authoredOrderKey=e=>JSON.stringify(e);function authoredOrderOf(e){return c.get(e)??/* @__PURE__ */ new Map}function declarations(e){let t=[],feature=(e,n,r)=>{let i=[...n,e.name],a=e.isPlacement?r:[...r,e];t.push({scope:i,...e.location,implicit:e.isPlacement,isContainer:!0,chain:a}),e.features.forEach(e=>feature(e,i,a)),e.slices.forEach(e=>t.push({scope:[...i,e.name],...e.location,implicit:!1,isContainer:!1,chain:[...a,e]}))};return e.modules.forEach(e=>{let n=e.isPlacement?[]:[e];t.push({scope:[e.name],...e.location,implicit:e.isPlacement,isContainer:!0,chain:n}),e.features.forEach(t=>feature(t,[e.name],n))}),t}function containerOwners(e,t){let n=/* @__PURE__ */ new Map;for(let[r,i]of e){let e=r.split(`/`),a=e[e.length-1].slice(0,-5);for(let o of i.filter(e=>e.isContainer&&!e.implicit)){let i=o.scope.indexOf(a);if(!t.has(r)&&i===-1)continue;let s=t.has(r)?0:i+1,c=authoredOrderKey(o.scope),l=n.get(c);(l===void 0||s<l.priority||s===l.priority&&e.length<l.depth)&&n.set(c,{path:r,priority:s,depth:e.length})}}return new Map([...n].map(([e,t])=>[e,t.path]))}function recordAuthoredOrder(l,u,d,f,p,m){let h=new Map(d.map(e=>[e.path,e])),g=new Map(d.filter(e=>e.isPlacementResolved!==!1).map(e=>[e.path,declarations(p?.get(e.path)??o(e.source,e.path,e.placement,!1,void 0,f).value)])),_=containerOwners(g,new Set(u.map(r))),v=new Set([...g.values()].flat().filter(e=>!e.implicit).map(e=>authoredOrderKey(e.scope))),y=/* @__PURE__ */ new Map,b=/* @__PURE__ */ new Map,x=/* @__PURE__ */ new Set,visit=(r,o)=>{let s=h.get(r);s===void 0||s.isPlacementResolved===!1||x.has(r)||(x.add(r),[...(g.get(r)??[]).filter(e=>{let t=authoredOrderKey(e.scope);return(!e.implicit||!v.has(t))&&(!e.isContainer||!_.has(t)||_.get(t)===r)}).map(e=>({line:e.line,column:e.column,run:()=>{let t=authoredOrderKey(e.scope);y.has(t)||(y.set(t,y.size),b.set(t,[...o,...e.chain.map(e=>({path:r,node:e}))]))}})),...(m?.get(r)??a(s.source,r,f)).map(a=>({...a.fileImport.location,run:()=>{let c=t(a,s.placement);if(c===void 0)return;let l=i(r,a.fileImport.pattern),u=(g.get(r)??[]).filter(e=>e.isContainer&&!e.implicit&&e.scope.length<=c.length&&e.scope.every((e,t)=>c[t]===e)).sort((e,t)=>e.scope.length-t.scope.length).map(e=>e.chain.at(-1));[...h.keys()].filter(e=>e!==r&&n(l,e)).sort().forEach((t,n)=>{e(h.get(t).placement,c)&&visit(t,[...o,...[...new Set(u)].map(e=>({path:r,node:e})),{path:r,node:a.fileImport,targetPath:t,matchIndex:n}])})}}))].sort((e,t)=>e.line-t.line||e.column-t.column).forEach(e=>e.run()))};u.map(r).forEach(e=>{h.get(e)?.placement.length===0&&visit(e,[])}),c.set(l,y),s.set(l,b)}export{authoredOrderKey,authoredOrderOf,authoredOriginsOf,recordAuthoredOrder,sameAuthoredStep};
|
|
2
2
|
//# sourceMappingURL=AuthoredOrder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthoredOrder.js","names":["orders","scope","application"],"sources":["../../../../../../Compiler/Files/AuthoredOrder.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 { DiscoveredImport, placementFrom } from '../Parsing/ImportDiscovery';\nimport { discoverImports, parseForAuthoring } from '../ScreenplayCompiler';\nimport { ApplicationSyntax, FeatureSyntax } from '../Syntax/Structure';\nimport { PlacedPlayDocument } from './PlayDocumentSource';\nimport { matchesPlayPattern, normalizePlayPath, resolvePlayPattern } from './PlayGlob';\nimport { samePlacement } from './PlayPlacement';\nimport { AuthoredDeclaration } from './AuthoredDeclaration';\n\n// Presentation metadata never enters syntax JSON, semantic bytes or identity. Merging and diagnostics\n// still use the original document order; only a consumer explicitly requesting authored order sees it.\nconst orders = new WeakMap<ApplicationSyntax, ReadonlyMap<string, number>>();\nexport const authoredOrderKey = (scope: readonly string[]): string => JSON.stringify(scope);\n\nexport function authoredOrderOf(application: ApplicationSyntax): ReadonlyMap<string, number> {\n return orders.get(application) ?? new Map();\n}\n\n// A board may narrow an application without changing the order of its remaining declarations.\nexport function copyAuthoredOrder(original: ApplicationSyntax, narrowed: ApplicationSyntax): ApplicationSyntax {\n const order = orders.get(original);\n if (order !== undefined) orders.set(narrowed, order);\n return narrowed;\n}\n\nfunction declarations(application: ApplicationSyntax): AuthoredDeclaration[] {\n const found: AuthoredDeclaration[] = [];\n const feature = (syntax: FeatureSyntax, outer: readonly string[]) => {\n const scope = [...outer, syntax.name];\n found.push({ scope, ...syntax.location, implicit: syntax.isPlacement, isContainer: true });\n syntax.features.forEach(child => feature(child, scope));\n syntax.slices.forEach(slice => found.push({ scope: [...scope, slice.name], ...slice.location, implicit: false, isContainer: false }));\n };\n application.modules.forEach(module => {\n found.push({ scope: [module.name], ...module.location, implicit: module.isPlacement, isContainer: true });\n module.features.forEach(child => feature(child, [module.name]));\n });\n return found;\n}\n\n// A root's explicit declarations, or those in an enclosing container's own named file, define container\n// order before globbed slice files that merely restate the same containers. Prefer the outer named\n// composite, then the shallower path; absent one, the text walk keeps the first explicit occurrence.\nfunction containerOwners(own: ReadonlyMap<string, readonly AuthoredDeclaration[]>, roots: ReadonlySet<string>): ReadonlyMap<string, string> {\n const owners = new Map<string, { path: string; priority: number; depth: number }>();\n for (const [path, declarations] of own) {\n const segments = path.split('/');\n const name = segments[segments.length - 1].slice(0, -5);\n for (const declaration of declarations.filter(declaration => declaration.isContainer && !declaration.implicit)) {\n const ancestor = declaration.scope.indexOf(name);\n if (!roots.has(path) && ancestor === -1) continue;\n const priority = roots.has(path) ? 0 : ancestor + 1;\n const key = authoredOrderKey(declaration.scope);\n const current = owners.get(key);\n if (current === undefined || priority < current.priority || (priority === current.priority && segments.length < current.depth)) {\n owners.set(key, { path, priority, depth: segments.length });\n }\n }\n }\n return new Map([...owners].map(([key, owner]) => [key, owner.path]));\n}\n\n// Walk text, not the merged tree: placement stubs must not claim the position of a declaration that is\n// written elsewhere. Expand an import only if it contributes the file's settled (deepest) placement.\nexport function recordAuthoredOrder(application: ApplicationSyntax, roots: readonly string[], documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>, parsed?: ReadonlyMap<string, ApplicationSyntax>, imports?: ReadonlyMap<string, readonly DiscoveredImport[]>): void {\n const files = new Map(documents.map(document => [document.path, document]));\n const own = new Map(documents.filter(document => document.isPlacementResolved !== false).map(document => [document.path, declarations(parsed?.get(document.path) ?? parseForAuthoring(document.source, document.path, document.placement, false, undefined, languages).value)]));\n const owners = containerOwners(own, new Set(roots.map(normalizePlayPath)));\n const explicit = new Set([...own.values()].flat().filter(declaration => !declaration.implicit).map(declaration => authoredOrderKey(declaration.scope)));\n const order = new Map<string, number>();\n const visited = new Set<string>();\n const visit = (path: string) => {\n const document = files.get(path);\n if (document === undefined || document.isPlacementResolved === false || visited.has(path)) return;\n visited.add(path);\n const entries = [\n ...(own.get(path) ?? []).filter(declaration => {\n const key = authoredOrderKey(declaration.scope);\n return (!declaration.implicit || !explicit.has(key)) && (!declaration.isContainer || !owners.has(key) || owners.get(key) === path);\n })\n .map(declaration => ({ line: declaration.line, column: declaration.column, run: () => {\n const key = authoredOrderKey(declaration.scope);\n if (!order.has(key)) order.set(key, order.size);\n } })),\n ...(imports?.get(path) ?? discoverImports(document.source, path, languages)).map(imported => ({\n ...imported.fileImport.location,\n run: () => {\n const placement = placementFrom(imported, document.placement);\n if (placement === undefined) return;\n const pattern = resolvePlayPattern(path, imported.fileImport.pattern);\n [...files.keys()].filter(target => target !== path && matchesPlayPattern(pattern, target)).sort().forEach(target => {\n if (samePlacement(files.get(target)!.placement, placement)) visit(target);\n });\n },\n })),\n ];\n entries.sort((left, right) => left.line - right.line || left.column - right.column).forEach(entry => entry.run());\n };\n roots.map(normalizePlayPath).forEach(path => {\n const document = files.get(path);\n // A broad root glob can discover a file before the import that actually places it.\n if (document?.placement.length === 0) visit(path);\n });\n orders.set(application, order);\n}\n"],"mappings":"4HAaA,MAAMA,kBAAS,IAAI,QACN,iBAAoB,GAAqC,KAAK,UAAUC,CAAK,EAE1F,SAAgB,gBAAgB,EAA6D,CACzF,OAAOD,EAAO,IAAIE,CAAW,mBAAK,IAAI,GAC1C"}
|
|
1
|
+
{"version":3,"file":"AuthoredOrder.js","names":["origins","application","left","right","orders","scope","found","outer","syntax","chain","ancestors","child","slice","module","owners","path","declarations","own","segments","name","declaration","ancestor","roots","priority","key","current","owner","files","documents","document","parsed","parseForAuthoring","languages","normalizePlayPath","explicit","order","trace","visited","imports","discoverImports","imported","placement","placementFrom","pattern","resolvePlayPattern","index","target","matchesPlayPattern","samePlacement","entry"],"sources":["../../../../../../Compiler/Files/AuthoredOrder.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 { DiscoveredImport, placementFrom } from '../Parsing/ImportDiscovery';\nimport { discoverImports, parseForAuthoring } from '../ScreenplayCompiler';\nimport { ApplicationSyntax, FeatureSyntax } from '../Syntax/Structure';\nimport { PlacedPlayDocument } from './PlayDocumentSource';\nimport { matchesPlayPattern, normalizePlayPath, resolvePlayPattern } from './PlayGlob';\nimport { samePlacement } from './PlayPlacement';\nimport { AuthoredDeclaration } from './AuthoredDeclaration';\nimport { SyntaxNode } from '../Syntax/SyntaxNode';\n\n/** A physical declaration or one particular file reached by an import. Presentation only. */\nexport interface AuthoredOrderStep {\n readonly path: string;\n readonly node: SyntaxNode;\n readonly targetPath?: string;\n readonly matchIndex?: number;\n}\n\nconst origins = new WeakMap<ApplicationSyntax, ReadonlyMap<string, readonly AuthoredOrderStep[]>>();\nexport const authoredOriginsOf = (application: ApplicationSyntax): ReadonlyMap<string, readonly AuthoredOrderStep[]> => origins.get(application) ?? new Map();\nexport const sameAuthoredStep = (left: AuthoredOrderStep, right: AuthoredOrderStep): boolean => left.path === right.path && left.node.kind === right.node.kind &&\n left.node.location.line === right.node.location.line && left.node.location.column === right.node.location.column && left.targetPath === right.targetPath;\n\n// Presentation metadata never enters syntax JSON, semantic bytes or identity. Merging and diagnostics\n// still use the original document order; only a consumer explicitly requesting authored order sees it.\nconst orders = new WeakMap<ApplicationSyntax, ReadonlyMap<string, number>>();\nexport const authoredOrderKey = (scope: readonly string[]): string => JSON.stringify(scope);\n\nexport function authoredOrderOf(application: ApplicationSyntax): ReadonlyMap<string, number> {\n return orders.get(application) ?? new Map();\n}\n\n// A board may narrow an application without changing the order of its remaining declarations.\nexport function copyAuthoredOrder(original: ApplicationSyntax, narrowed: ApplicationSyntax): ApplicationSyntax {\n const order = orders.get(original);\n if (order !== undefined) orders.set(narrowed, order);\n return narrowed;\n}\n\nfunction declarations(application: ApplicationSyntax): (AuthoredDeclaration & { chain: readonly SyntaxNode[] })[] {\n const found: (AuthoredDeclaration & { chain: readonly SyntaxNode[] })[] = [];\n const feature = (syntax: FeatureSyntax, outer: readonly string[], ancestors: readonly SyntaxNode[]) => {\n const scope = [...outer, syntax.name];\n const chain = syntax.isPlacement ? ancestors : [...ancestors, syntax];\n found.push({ scope, ...syntax.location, implicit: syntax.isPlacement, isContainer: true, chain });\n syntax.features.forEach(child => feature(child, scope, chain));\n syntax.slices.forEach(slice => found.push({ scope: [...scope, slice.name], ...slice.location, implicit: false, isContainer: false, chain: [...chain, slice] }));\n };\n application.modules.forEach(module => {\n const chain = module.isPlacement ? [] : [module];\n found.push({ scope: [module.name], ...module.location, implicit: module.isPlacement, isContainer: true, chain });\n module.features.forEach(child => feature(child, [module.name], chain));\n });\n return found;\n}\n\n// A root's explicit declarations, or those in an enclosing container's own named file, define container\n// order before globbed slice files that merely restate the same containers. Prefer the outer named\n// composite, then the shallower path; absent one, the text walk keeps the first explicit occurrence.\nfunction containerOwners(own: ReadonlyMap<string, readonly AuthoredDeclaration[]>, roots: ReadonlySet<string>): ReadonlyMap<string, string> {\n const owners = new Map<string, { path: string; priority: number; depth: number }>();\n for (const [path, declarations] of own) {\n const segments = path.split('/');\n const name = segments[segments.length - 1].slice(0, -5);\n for (const declaration of declarations.filter(declaration => declaration.isContainer && !declaration.implicit)) {\n const ancestor = declaration.scope.indexOf(name);\n if (!roots.has(path) && ancestor === -1) continue;\n const priority = roots.has(path) ? 0 : ancestor + 1;\n const key = authoredOrderKey(declaration.scope);\n const current = owners.get(key);\n if (current === undefined || priority < current.priority || (priority === current.priority && segments.length < current.depth)) {\n owners.set(key, { path, priority, depth: segments.length });\n }\n }\n }\n return new Map([...owners].map(([key, owner]) => [key, owner.path]));\n}\n\n// Walk text, not the merged tree: placement stubs must not claim the position of a declaration that is\n// written elsewhere. Expand an import only if it contributes the file's settled (deepest) placement.\nexport function recordAuthoredOrder(application: ApplicationSyntax, roots: readonly string[], documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>, parsed?: ReadonlyMap<string, ApplicationSyntax>, imports?: ReadonlyMap<string, readonly DiscoveredImport[]>): void {\n const files = new Map(documents.map(document => [document.path, document]));\n const own = new Map(documents.filter(document => document.isPlacementResolved !== false).map(document => [document.path, declarations(parsed?.get(document.path) ?? parseForAuthoring(document.source, document.path, document.placement, false, undefined, languages).value)]));\n const owners = containerOwners(own, new Set(roots.map(normalizePlayPath)));\n const explicit = new Set([...own.values()].flat().filter(declaration => !declaration.implicit).map(declaration => authoredOrderKey(declaration.scope)));\n const order = new Map<string, number>();\n const trace = new Map<string, readonly AuthoredOrderStep[]>();\n const visited = new Set<string>();\n const visit = (path: string, outer: readonly AuthoredOrderStep[]) => {\n const document = files.get(path);\n if (document === undefined || document.isPlacementResolved === false || visited.has(path)) return;\n visited.add(path);\n const entries = [\n ...(own.get(path) ?? []).filter(declaration => {\n const key = authoredOrderKey(declaration.scope);\n return (!declaration.implicit || !explicit.has(key)) && (!declaration.isContainer || !owners.has(key) || owners.get(key) === path);\n })\n .map(declaration => ({ line: declaration.line, column: declaration.column, run: () => {\n const key = authoredOrderKey(declaration.scope);\n if (!order.has(key)) {\n order.set(key, order.size);\n trace.set(key, [...outer, ...declaration.chain.map(node => ({ path, node }))]);\n }\n } })),\n ...(imports?.get(path) ?? discoverImports(document.source, path, languages)).map(imported => ({\n ...imported.fileImport.location,\n run: () => {\n const placement = placementFrom(imported, document.placement);\n if (placement === undefined) return;\n const pattern = resolvePlayPattern(path, imported.fileImport.pattern);\n const ancestors = (own.get(path) ?? []).filter(declaration => declaration.isContainer && !declaration.implicit &&\n declaration.scope.length <= placement.length && declaration.scope.every((name, index) => placement[index] === name))\n .sort((left, right) => left.scope.length - right.scope.length).map(declaration => declaration.chain.at(-1)!);\n [...files.keys()].filter(target => target !== path && matchesPlayPattern(pattern, target)).sort().forEach((target, matchIndex) => {\n if (samePlacement(files.get(target)!.placement, placement)) visit(target, [...outer, ...[...new Set(ancestors)].map(node => ({ path, node })), { path, node: imported.fileImport, targetPath: target, matchIndex }]);\n });\n },\n })),\n ];\n entries.sort((left, right) => left.line - right.line || left.column - right.column).forEach(entry => entry.run());\n };\n roots.map(normalizePlayPath).forEach(path => {\n const document = files.get(path);\n // A broad root glob can discover a file before the import that actually places it.\n if (document?.placement.length === 0) visit(path, []);\n });\n orders.set(application, order);\n origins.set(application, trace);\n}\n"],"mappings":"0VAoBA,MAAMA,kBAAU,IAAI,QACP,kBAAqB,GAAsFA,EAAQ,IAAIC,CAAW,mBAAK,IAAI,IAC3I,kBAAoB,EAAyB,IAAsCC,EAAK,OAASC,EAAM,MAAQD,EAAK,KAAK,OAASC,EAAM,KAAK,MACtJD,EAAK,KAAK,SAAS,OAASC,EAAM,KAAK,SAAS,MAAQD,EAAK,KAAK,SAAS,SAAWC,EAAM,KAAK,SAAS,QAAUD,EAAK,aAAeC,EAAM,WAI5IC,kBAAS,IAAI,QACN,iBAAoB,GAAqC,KAAK,UAAUC,CAAK,EAE1F,SAAgB,gBAAgB,EAA6D,CACzF,OAAOD,EAAO,IAAIH,CAAW,mBAAK,IAAI,GAC1C,CASA,SAAS,aAAa,EAA4F,CAC9G,IAAMK,EAAoE,CAAC,EACrE,SAAW,EAAuB,EAA0B,IAAqC,CACnG,IAAMD,EAAQ,CAAC,GAAGE,EAAOC,EAAO,IAAI,EAC9BC,EAAQD,EAAO,YAAcE,EAAY,CAAC,GAAGA,EAAWF,CAAM,EACpEF,EAAM,KAAK,CAAE,QAAO,GAAGE,EAAO,SAAU,SAAUA,EAAO,YAAa,YAAa,GAAM,OAAM,CAAC,EAChGA,EAAO,SAAS,QAAQ,GAAS,QAAQG,EAAON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GvC,EAAO,GAAG,CAAC,GAAG,IAAI,IAAIG,CAAS,CAAC,CAAC,CAAC,IAAI,IAAS,CAAE,OAAM,MAAK,EAAE,EAAG,CAAE,OAAM,KAAM8B,EAAS,WAAY,WAAYM,EAAQ,YAAW,CAAC,CAAC,CACvN,CAAC,CACL,CACJ,EAAE,CAEA,CAAC,CAAC,MAAM,EAAM,IAAU5C,EAAK,KAAOC,EAAM,MAAQD,EAAK,OAASC,EAAM,MAAM,CAAC,CAAC,QAAQ,GAAS8C,EAAM,IAAI,CAAC,EACpH,EACA3B,EAAM,IAAIW,CAAiB,CAAC,CAAC,QAAQ,GAAQ,CACxBN,EAAM,IAAIZ,CAEhB,CAAC,EAAE,UAAU,SAAW,GAAG,MAAMA,EAAM,CAAC,CAAC,CACxD,CAAC,EACDX,EAAO,IAAIH,EAAakC,CAAK,EAC7BnC,EAAQ,IAAIC,EAAamC,CAAK,CAClC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import"../ScreenplayCompiler.js";
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{matchesPlayPattern as e,normalizePlayPath as t,resolvePlayPattern as n}from"./PlayGlob.js";import{discoverImports as r}from"../ScreenplayCompiler.js";function selectOrderingRoot(i,a,o,s){let c=[...new Set(i.map(t))];if(c.length===1)return c[0];if(s??=new Map(a.map(e=>[e.path,r(e.source,e.path,o)])),(s.get(`application.play`)?.length??0)>0)return`application.play`;let l=/* @__PURE__ */ new Set;for(let[t,r]of s)for(let i of r){let r=n(t,i.fileImport.pattern);a.filter(n=>n.path!==t&&e(r,n.path)).forEach(e=>l.add(e.path))}let u=[...s].filter(([e,t])=>t.length>0&&!l.has(e)).map(([e])=>e);return u.length===1?u[0]:void 0}export{selectOrderingRoot};
|
|
2
|
+
//# sourceMappingURL=OrderingRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrderingRoot.js","names":["normalized","roots","normalizePlayPath","documents","document","discoverImports","languages","imports","imported","path","entries","entry","pattern","resolvePlayPattern","matchesPlayPattern","candidates"],"sources":["../../../../../../Compiler/Files/OrderingRoot.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 { DiscoveredImport } from '../Parsing/ImportDiscovery';\nimport { discoverImports } from '../ScreenplayCompiler';\nimport { PlacedPlayDocument } from './PlayDocumentSource';\nimport { matchesPlayPattern, normalizePlayPath, resolvePlayPattern } from './PlayGlob';\n\n// Choosing presentation order never changes the roots used for resolving or merging documents.\nexport function selectOrderingRoot(roots: readonly string[], documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>, imports?: ReadonlyMap<string, readonly DiscoveredImport[]>): string | undefined {\n const normalized = [...new Set(roots.map(normalizePlayPath))];\n if (normalized.length === 1) return normalized[0];\n imports ??= new Map(documents.map(document => [document.path, discoverImports(document.source, document.path, languages)]));\n if ((imports.get('application.play')?.length ?? 0) > 0) return 'application.play';\n const imported = new Set<string>();\n for (const [path, entries] of imports) {\n for (const entry of entries) {\n const pattern = resolvePlayPattern(path, entry.fileImport.pattern);\n documents.filter(document => document.path !== path && matchesPlayPattern(pattern, document.path)).forEach(document => imported.add(document.path));\n }\n }\n const candidates = [...imports].filter(([path, entries]) => entries.length > 0 && !imported.has(path)).map(([path]) => path);\n return candidates.length === 1 ? candidates[0] : undefined;\n}\n"],"mappings":"kNASA,SAAgB,mBAAmB,EAA0B,EAA0C,EAAiC,EAAgF,CACpN,IAAMA,EAAa,CAAC,GAAG,IAAI,IAAIC,EAAM,IAAIC,CAAiB,CAAC,CAAC,EAC5D,GAAIF,EAAW,SAAW,EAAG,OAAOA,EAAW,GAE/C,GADA,IAAY,IAAI,IAAIG,EAAU,IAAI,GAAY,CAACC,EAAS,KAAMC,EAAgBD,EAAS,OAAQA,EAAS,KAAME,CAAS,CAAC,CAAC,CAAC,GACrHC,EAAQ,IAAI,kBAAkB,CAAC,EAAE,QAAU,GAAK,EAAG,MAAO,mBAC/D,IAAMC,kBAAW,IAAI,IACrB,IAAK,GAAM,CAACC,EAAMC,KAAYH,EAC1B,IAAK,IAAMI,KAASD,EAAS,CACzB,IAAME,EAAUC,EAAmBJ,EAAME,EAAM,WAAW,OAAO,EACjER,EAAU,OAAO,GAAYC,EAAS,OAASK,GAAQK,EAAmBF,EAASR,EAAS,IAAI,CAAC,CAAC,CAAC,QAAQ,GAAYI,EAAS,IAAIJ,EAAS,IAAI,CAAC,CACtJ,CAEJ,IAAMW,EAAa,CAAC,GAAGR,CAAO,CAAC,CAAC,QAAQ,CAACE,EAAMC,KAAaA,EAAQ,OAAS,GAAK,CAACF,EAAS,IAAIC,CAAI,CAAC,CAAC,CAAC,KAAK,CAACA,KAAUA,CAAI,EAC3H,OAAOM,EAAW,SAAW,EAAIA,EAAW,GAAK,IAAA,EACrD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{splitLines as e}from"../Parsing/SourceLineSplitter.js";import{effectiveStructuralInteractions as t}from"../Parsing/StructuralInteractionSites.js";import{expandSpecificationExamples as n,validateSpecificationExampleTypes as r}from"../Parsing/SpecificationCommandExamples.js";import{validateResponses as i}from"../Parsing/ResponseValidator.js";import{validateSpecificationCases as a}from"../Parsing/SpecificationCaseValidator.js";import{productionDestinationDiagnostics as o}from"../Diagnostics/ProductionDestinationDiagnostics.js";import{validateConstraintProperties as s}from"../Parsing/ConstraintPropertyValidator.js";import{validateDependencyDeclarations as c}from"../Dependencies/DeclaredDependencyTargets.js";import{LineReader as l}from"../Parsing/LineReader.js";import{ParserContext as u}from"../Parsing/ParserContext.js";import"./AuthoredOrder.js";import{DeclaredDependencies as
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{splitLines as e}from"../Parsing/SourceLineSplitter.js";import{effectiveStructuralInteractions as t}from"../Parsing/StructuralInteractionSites.js";import{expandSpecificationExamples as n,validateSpecificationExampleTypes as r}from"../Parsing/SpecificationCommandExamples.js";import{validateResponses as i}from"../Parsing/ResponseValidator.js";import{validateSpecificationCases as a}from"../Parsing/SpecificationCaseValidator.js";import{productionDestinationDiagnostics as o}from"../Diagnostics/ProductionDestinationDiagnostics.js";import{validateConstraintProperties as s}from"../Parsing/ConstraintPropertyValidator.js";import{validateDependencyDeclarations as c}from"../Dependencies/DeclaredDependencyTargets.js";import{LineReader as l}from"../Parsing/LineReader.js";import{ParserContext as u}from"../Parsing/ParserContext.js";import{normalizePlayPath as d}from"./PlayGlob.js";import{recordAuthoredOrder as f}from"./AuthoredOrder.js";import{DeclaredDependencies as p}from"../Dependencies/DeclaredDependencies.js";import{validatePublicEventUsage as m}from"../Parsing/PublicEventUsageValidator.js";import{validateInlineEvents as h}from"../Parsing/InlineEventValidator.js";import{validateOperations as g}from"../Parsing/OperationValidator.js";import{CommandStreamCandidates as _}from"../Parsing/CommandStreamCandidates.js";import{validateEventSources as v}from"../Parsing/EventSourceValidator.js";import{validateProjectionTargets as y}from"../Parsing/ProjectionTargetValidator.js";import{validateIdentifierCompliance as b}from"../Parsing/IdentifierComplianceValidator.js";import{validateEventSubjects as x}from"../Parsing/EventSubjectValidator.js";import{validateReadModelKeys as S}from"../Parsing/ReadModelKeyValidator.js";import{validateReactionRefusals as C}from"../Parsing/ReactionRefusalValidator.js";import{validateSpecificationRedelivery as w}from"../Parsing/SpecificationRedeliveryValidator.js";import{validateGuardedActions as T}from"../Parsing/GuardedActionValidator.js";import{validatePersonaCallers as E}from"../Parsing/PersonaCallerValidator.js";import{validatePurposes as D}from"../Parsing/PurposeValidator.js";import{timelineOrderDiagnostics as O}from"./TimelineOrder.js";import{discoverImports as k,parseForAuthoring as A}from"../ScreenplayCompiler.js";import{EventSourceReadConfidence as j}from"../Syntax/EventSourceReadConfidence.js";import{mergeDocuments as M}from"./PlayFolderMerge.js";import{inMemoryDocumentSource as N}from"./PlayDocumentSource.js";import{resolveImports as P}from"./PlayImports.js";import{selectOrderingRoot as F}from"./OrderingRoot.js";function assembleApplication(e,t,n,r){let i=[...e],{documents:a,diagnostics:o}=P(i,t,n),{result:s,syntax:c}=parsePlacedDocumentsWithSyntax(a,n),l=new Map(a.map(e=>[e.path,k(e.source,e.path,n)])),u=r===null?void 0:F(r===void 0?i:[r],a,n,l);u!==void 0&&f(s.value,[u],a,n,c,l);let d=u===void 0?[]:O(s.value),p=[...o,...s.diagnostics,...d];return{...s,documents:a,diagnostics:p,success:!p.some(e=>e.severity===`error`)}}function parsePlacedDocuments(e,t,n=!1){return parsePlacedDocumentsWithSyntax(e,t,n).result}function parsePlacedDocumentsWithSyntax(d,f,O=!1){let k=_.capturePlaced(d.filter(e=>e.isPlacementResolved!==!1).map(t=>({lines:e(t.source,!1,t.path),placement:t.placement})),f),N=d.map(e=>A(e.source,e.path,e.isPlacementResolved===!1?[]:e.placement,!1,k,f)),P=N.flatMap((e,t)=>(e.value.eventSources??[]).map(e=>({source:e,placementResolved:d[t].isPlacementResolved!==!1}))),F=d.every(e=>e.isPlacementResolved!==!1)&&N.every(e=>!j.hasUnknownExtent(e.diagnostics)),I=N.map((e,t)=>d[t].isPlacementResolved===!1?{...e,value:{...e.value,eventSources:[]}}:e),L=M(I),R=new u(new l([]),void 0,f);L.value.sourceOptions!==void 0&&(R.sourceOptions=L.value.sourceOptions),R.guardedInteractions.push(...I.flatMap(e=>e.guardedInteractions)),R.interactionBehaviors.push(...I.flatMap(e=>e.interactionBehaviors)),R.interactionUses.push(...t(L.value).filter(e=>`behavior`in e),...I.flatMap(e=>e.interactionUses).filter(e=>e.ancestors.some(e=>e.keyword===`screen`))),R.continuationValues.push(...I.flatMap(e=>e.continuationValues)),a(L.value,R),r(L.value,R,O);let z=n(L.value);v(L.value,R),g(L.value,R),m(L.value,R),h(L.value,R),s(L.value,R),i(z,R,I.flatMap(e=>e.inputUses)),y(L.value,R),b(z,R),x(L.value,R),S(L.value,R),C(L.value,R),w(L.value,R),T(L.value,R),E(L.value,R),D(L.value,R);let B=c(L.value,R);p.validate(B,R);for(let e of o(B))R.information(e.code,e.message,e.location);let V=L.diagnostics,H=new Set(V.map(diagnosticKey)),U=[...V,...R.diagnostics.filter(e=>!H.has(diagnosticKey(e)))];return{result:{...L,value:B,diagnostics:U,success:!U.some(e=>e.severity===`error`),physicalEventSources:P,sourceInventoryComplete:F,continuationValues:R.continuationValues},syntax:new Map(I.map((e,t)=>[d[t].path,e.value]))}}function diagnosticKey(e){return JSON.stringify([e.code,e.location.path,e.location.line,e.location.column])}function compileApplication(e,t,n,r){let i=new Map([...e].map(([e,t])=>[d(e),t]));return assembleApplication(t??[...i.keys()].sort(),N(i),n,r)}export{assembleApplication,compileApplication,parsePlacedDocuments};
|
|
2
2
|
//# sourceMappingURL=PlayApplicationAssembly.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayApplicationAssembly.js","names":["documents","languages","deferImportedExampleTypes","candidates","CommandStreamCandidates","document","splitLines","physical","parseForAuthoring","physicalEventSources","result","index","sourceInventoryComplete","EventSourceReadConfidence","parsed","merged","mergeDocuments","context","ParserContext","LineReader","effectiveStructuralInteractions","site","ancestor","validateSpecificationCases","validateSpecificationExampleTypes","effective","expandSpecificationExamples","validateEventSources","validateOperations","validatePublicEventUsage","validateInlineEvents","validateConstraintProperties","validateResponses","validateProjectionTargets","validateIdentifierCompliance","validateEventSubjects","validateReadModelKeys","validateReactionRefusals","validateSpecificationRedelivery","validateGuardedActions","validatePersonaCallers","validatePurposes","value","validateDependencyDeclarations","DeclaredDependencies","diagnostic","productionDestinationDiagnostics","existing","reported","all"],"sources":["../../../../../../Compiler/Files/PlayApplicationAssembly.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 { validateSpecificationCases } from '../Parsing/SpecificationCaseValidator';\nimport { expandSpecificationExamples, validateSpecificationExampleTypes } from '../Parsing/SpecificationCommandExamples';\nimport { productionDestinationDiagnostics } from '../Diagnostics/ProductionDestinationDiagnostics';\nimport { validateConstraintProperties } from '../Parsing/ConstraintPropertyValidator';\nimport { validateDependencyDeclarations } from '../Dependencies/DeclaredDependencyTargets';\nimport { DeclaredDependencies } from '../Dependencies/DeclaredDependencies';\nimport { validateInlineEvents } from '../Parsing/InlineEventValidator';\nimport { LineReader } from '../Parsing/LineReader';\nimport { CommandStreamCandidates } from '../Parsing/CommandStreamCandidates';\nimport { validateEventSources } from '../Parsing/EventSourceValidator';\nimport { validateProjectionTargets } from '../Parsing/ProjectionTargetValidator';\nimport { validateIdentifierCompliance } from '../Parsing/IdentifierComplianceValidator';\nimport { validateEventSubjects } from '../Parsing/EventSubjectValidator';\nimport { validateReadModelKeys } from '../Parsing/ReadModelKeyValidator';\nimport { validateReactionRefusals } from '../Parsing/ReactionRefusalValidator';\nimport { validateSpecificationRedelivery } from '../Parsing/SpecificationRedeliveryValidator';\nimport { effectiveStructuralInteractions } from '../Parsing/StructuralInteractionSites';\nimport { validateGuardedActions } from '../Parsing/GuardedActionValidator';\nimport { validatePersonaCallers } from '../Parsing/PersonaCallerValidator';\nimport { validatePurposes } from '../Parsing/PurposeValidator';\nimport { splitLines } from '../Parsing/SourceLineSplitter';\nimport { ParserContext } from '../Parsing/ParserContext';\nimport { validateResponses } from '../Parsing/ResponseValidator';\nimport { validatePublicEventUsage } from '../Parsing/PublicEventUsageValidator';\nimport { validateOperations } from '../Parsing/OperationValidator';\nimport { CompilationResult, discoverImports, parseForAuthoring } from '../ScreenplayCompiler';\nimport { ApplicationSyntax } from '../Syntax/Structure';\nimport { EventSourceSyntax } from '../Syntax/EventSources';\nimport { EventSourceReadConfidence } from '../Syntax/EventSourceReadConfidence';\nimport { mergeDocuments } from './PlayFolderMerge';\nimport { inMemoryDocumentSource, PlacedPlayDocument, PlayDocumentSource } from './PlayDocumentSource';\nimport { normalizePlayPath } from './PlayGlob';\nimport { resolveImports } from './PlayImports';\nimport { recordAuthoredOrder } from './AuthoredOrder';\nimport { selectOrderingRoot } from './OrderingRoot';\nimport { timelineOrderDiagnostics } from './TimelineOrder';\n\n// One .play document of a folder: its path relative to the folder, and its text.\nexport interface PlayFileSource {\n readonly path: string;\n readonly source: string;\n}\n\n// One application compiled from documents: the documents that make it up, each with where its top level\n// belongs, and the merged syntax with every diagnostic - resolving, parsing and merging.\nexport interface ApplicationCompilation extends CompilationResult<ApplicationSyntax> {\n readonly documents: readonly PlacedPlayDocument[];\n}\n\n// Assembles one application from documents - following their imports from the roots, parsing each where it is\n// placed, and merging the lot. The port of the C# PlayApplicationAssembly.Compile.\nexport function assembleApplication(roots: Iterable<string>, source: PlayDocumentSource, languages?: ReadonlySet<string>, presentationRoot?: string | null): ApplicationCompilation {\n const rootPaths = [...roots];\n const { documents, diagnostics } = resolveImports(rootPaths, source, languages);\n const { result: merged, syntax } = parsePlacedDocumentsWithSyntax(documents, languages);\n // Resolution owns its import inventory; share one discovery between the presentation passes.\n const imports = new Map(documents.map(document => [document.path, discoverImports(document.source, document.path, languages)]));\n const orderingRoot = presentationRoot === null ? undefined : selectOrderingRoot(presentationRoot === undefined ? rootPaths : [presentationRoot], documents, languages, imports);\n if (orderingRoot !== undefined) recordAuthoredOrder(merged.value, [orderingRoot], documents, languages, syntax, imports);\n const timeline = orderingRoot === undefined ? [] : timelineOrderDiagnostics(merged.value);\n const all = [...diagnostics, ...merged.diagnostics, ...timeline];\n return { ...merged, documents, diagnostics: all, success: !all.some(diagnostic => diagnostic.severity === 'error') };\n}\n\n// Parses documents whose source identities and placements are already known (for example unsaved\n// editor buffers), then validates contracts against the merged declaration inventory. Editor callers may\n// defer example types whose imports are not in that inventory; resolved types are still checked.\nexport function parsePlacedDocuments(documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>, deferImportedExampleTypes = false): CompilationResult<ApplicationSyntax> & {\n readonly physicalEventSources: readonly { source: EventSourceSyntax; placementResolved: boolean }[];\n readonly sourceInventoryComplete: boolean;\n readonly continuationValues: ReturnType<typeof parseForAuthoring>['continuationValues'];\n} {\n return parsePlacedDocumentsWithSyntax(documents, languages, deferImportedExampleTypes).result;\n}\n\nfunction parsePlacedDocumentsWithSyntax(documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>, deferImportedExampleTypes = false) {\n const candidates = CommandStreamCandidates.capturePlaced(documents.filter(document => document.isPlacementResolved !== false).map(document => ({ lines: splitLines(document.source, false, document.path), placement: document.placement })), languages);\n const physical = documents.map(document => parseForAuthoring(document.source, document.path, document.isPlacementResolved === false ? [] : document.placement, false, candidates, languages));\n const physicalEventSources = physical.flatMap((result, index) => (result.value.eventSources ?? []).map(source => ({ source, placementResolved: documents[index].isPlacementResolved !== false })));\n const sourceInventoryComplete = documents.every(document => document.isPlacementResolved !== false) && physical.every(result => !EventSourceReadConfidence.hasUnknownExtent(result.diagnostics));\n const parsed = physical.map((result, index) => documents[index].isPlacementResolved === false ? { ...result, value: { ...result.value, eventSources: [] } } : result);\n const merged = mergeDocuments(parsed);\n const context = new ParserContext(new LineReader([]), undefined, languages);\n if (merged.value.sourceOptions !== undefined) context.sourceOptions = merged.value.sourceOptions;\n context.guardedInteractions.push(...parsed.flatMap(document => document.guardedInteractions));\n context.interactionBehaviors.push(...parsed.flatMap(document => document.interactionBehaviors));\n context.interactionUses.push(...effectiveStructuralInteractions(merged.value).filter(site => 'behavior' in site),\n ...parsed.flatMap(document => document.interactionUses).filter(site => site.ancestors.some(ancestor => ancestor.keyword === 'screen')));\n context.continuationValues.push(...parsed.flatMap(document => document.continuationValues));\n validateSpecificationCases(merged.value, context);\n validateSpecificationExampleTypes(merged.value, context, deferImportedExampleTypes);\n const effective = expandSpecificationExamples(merged.value);\n validateEventSources(merged.value, context);\n validateOperations(merged.value, context);\n validatePublicEventUsage(merged.value, context);\n validateInlineEvents(merged.value, context);\n validateConstraintProperties(merged.value, context);\n validateResponses(effective, context, parsed.flatMap(document => document.inputUses));\n validateProjectionTargets(merged.value, context);\n validateIdentifierCompliance(effective, context);\n validateEventSubjects(merged.value, context);\n validateReadModelKeys(merged.value, context);\n validateReactionRefusals(merged.value, context);\n validateSpecificationRedelivery(merged.value, context);\n validateGuardedActions(merged.value, context);\n validatePersonaCallers(merged.value, context);\n validatePurposes(merged.value, context);\n const value = validateDependencyDeclarations(merged.value, context);\n DeclaredDependencies.validate(value, context);\n for (const diagnostic of productionDestinationDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n const existing = merged.diagnostics;\n const reported = new Set(existing.map(diagnosticKey));\n const all = [...existing, ...context.diagnostics.filter(diagnostic => !reported.has(diagnosticKey(diagnostic)))];\n return {\n result: { ...merged, value, diagnostics: all, success: !all.some(diagnostic => diagnostic.severity === 'error'), physicalEventSources, sourceInventoryComplete, continuationValues: context.continuationValues },\n syntax: new Map(parsed.map((result, index) => [documents[index].path, result.value])),\n };\n}\n\nfunction diagnosticKey(diagnostic: Diagnostic): string {\n return JSON.stringify([diagnostic.code, diagnostic.location.path, diagnostic.location.line, diagnostic.location.column]);\n}\n\n// Compiles documents held in memory, keyed by portable path, as one application. Without roots every\n// document is a root, in ordinal order of its path - a folder compiled as one application, where a file an\n// import places in a module or feature is placed there. With roots, only those documents and what they import\n// make up the application - a single file compiled with its imports followed. The default sort compares\n// UTF-16 code units, which is the C# ordinal order.\nexport function compileApplication(documents: ReadonlyMap<string, string>, roots?: readonly string[], languages?: ReadonlySet<string>, presentationRoot?: string | null): ApplicationCompilation {\n const normalized = new Map([...documents].map(([path, source]) => [normalizePlayPath(path), source]));\n return assembleApplication(roots ?? [...normalized.keys()].sort(), inMemoryDocumentSource(normalized), languages, presentationRoot);\n}\n\n// Compiles the documents of a folder as one application - the counterpart of the C# CompileFolder. Every\n// document is a root, read in ordinal order of its relative path as the C# compiler reads them, so a merge\n// keeps the same first declaration in either language; one an import places in a module or feature is\n// placed there.\nexport function parseFolder(files: readonly PlayFileSource[], languages?: ReadonlySet<string>): ApplicationCompilation {\n return compileApplication(new Map(files.map(file => [file.path, file.source])), undefined, languages);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AAY4B,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,EAC9I,IAAME,EAAWhC,EAAO,YAClBiC,EAAW,IAAI,IAAID,EAAS,IAAI,aAAa,CAAC,EAC9CE,EAAM,CAAC,GAAGF,EAAU,GAAG9B,EAAQ,YAAY,OAAO,GAAc,CAAC+B,EAAS,IAAI,cAAcH,CAAU,CAAC,CAAC,CAAC,EAC/G,MAAO,CACH,OAAQ,CAAE,GAAG9B,EAAQ,QAAO,YAAakC,EAAK,QAAS,CAACA,EAAI,KAAK,GAAcJ,EAAW,WAAa,OAAO,EAAG,uBAAsB,0BAAyB,mBAAoB5B,EAAQ,kBAAmB,EAC/M,OAAQ,IAAI,IAAIH,EAAO,KAAK,EAAQ,IAAU,CAACd,EAAUW,EAAM,CAAC,KAAMD,EAAO,KAAK,CAAC,CAAC,CACxF,CACJ,CAEA,SAAS,cAAc,EAAgC,CACnD,OAAO,KAAK,UAAU,CAACmC,EAAW,KAAMA,EAAW,SAAS,KAAMA,EAAW,SAAS,KAAMA,EAAW,SAAS,MAAM,CAAC,CAC3H"}
|
|
1
|
+
{"version":3,"file":"PlayApplicationAssembly.js","names":["rootPaths","roots","resolveImports","source","languages","merged","documents","imports","document","discoverImports","orderingRoot","presentationRoot","selectOrderingRoot","recordAuthoredOrder","syntax","timeline","timelineOrderDiagnostics","all","diagnostics","diagnostic","deferImportedExampleTypes","candidates","CommandStreamCandidates","splitLines","physical","parseForAuthoring","physicalEventSources","result","index","sourceInventoryComplete","EventSourceReadConfidence","parsed","mergeDocuments","context","ParserContext","LineReader","effectiveStructuralInteractions","site","ancestor","validateSpecificationCases","validateSpecificationExampleTypes","effective","expandSpecificationExamples","validateEventSources","validateOperations","validatePublicEventUsage","validateInlineEvents","validateConstraintProperties","validateResponses","validateProjectionTargets","validateIdentifierCompliance","validateEventSubjects","validateReadModelKeys","validateReactionRefusals","validateSpecificationRedelivery","validateGuardedActions","validatePersonaCallers","validatePurposes","value","validateDependencyDeclarations","DeclaredDependencies","productionDestinationDiagnostics","existing","reported","normalized","path","normalizePlayPath","inMemoryDocumentSource"],"sources":["../../../../../../Compiler/Files/PlayApplicationAssembly.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 { validateSpecificationCases } from '../Parsing/SpecificationCaseValidator';\nimport { expandSpecificationExamples, validateSpecificationExampleTypes } from '../Parsing/SpecificationCommandExamples';\nimport { productionDestinationDiagnostics } from '../Diagnostics/ProductionDestinationDiagnostics';\nimport { validateConstraintProperties } from '../Parsing/ConstraintPropertyValidator';\nimport { validateDependencyDeclarations } from '../Dependencies/DeclaredDependencyTargets';\nimport { DeclaredDependencies } from '../Dependencies/DeclaredDependencies';\nimport { validateInlineEvents } from '../Parsing/InlineEventValidator';\nimport { LineReader } from '../Parsing/LineReader';\nimport { CommandStreamCandidates } from '../Parsing/CommandStreamCandidates';\nimport { validateEventSources } from '../Parsing/EventSourceValidator';\nimport { validateProjectionTargets } from '../Parsing/ProjectionTargetValidator';\nimport { validateIdentifierCompliance } from '../Parsing/IdentifierComplianceValidator';\nimport { validateEventSubjects } from '../Parsing/EventSubjectValidator';\nimport { validateReadModelKeys } from '../Parsing/ReadModelKeyValidator';\nimport { validateReactionRefusals } from '../Parsing/ReactionRefusalValidator';\nimport { validateSpecificationRedelivery } from '../Parsing/SpecificationRedeliveryValidator';\nimport { effectiveStructuralInteractions } from '../Parsing/StructuralInteractionSites';\nimport { validateGuardedActions } from '../Parsing/GuardedActionValidator';\nimport { validatePersonaCallers } from '../Parsing/PersonaCallerValidator';\nimport { validatePurposes } from '../Parsing/PurposeValidator';\nimport { splitLines } from '../Parsing/SourceLineSplitter';\nimport { ParserContext } from '../Parsing/ParserContext';\nimport { validateResponses } from '../Parsing/ResponseValidator';\nimport { validatePublicEventUsage } from '../Parsing/PublicEventUsageValidator';\nimport { validateOperations } from '../Parsing/OperationValidator';\nimport { CompilationResult, discoverImports, parseForAuthoring } from '../ScreenplayCompiler';\nimport { ApplicationSyntax } from '../Syntax/Structure';\nimport { EventSourceSyntax } from '../Syntax/EventSources';\nimport { EventSourceReadConfidence } from '../Syntax/EventSourceReadConfidence';\nimport { mergeDocuments } from './PlayFolderMerge';\nimport { inMemoryDocumentSource, PlacedPlayDocument, PlayDocumentSource } from './PlayDocumentSource';\nimport { normalizePlayPath } from './PlayGlob';\nimport { resolveImports } from './PlayImports';\nimport { recordAuthoredOrder } from './AuthoredOrder';\nimport { selectOrderingRoot } from './OrderingRoot';\nimport { timelineOrderDiagnostics } from './TimelineOrder';\n\n// One .play document of a folder: its path relative to the folder, and its text.\nexport interface PlayFileSource {\n readonly path: string;\n readonly source: string;\n}\n\n// One application compiled from documents: the documents that make it up, each with where its top level\n// belongs, and the merged syntax with every diagnostic - resolving, parsing and merging.\nexport interface ApplicationCompilation extends CompilationResult<ApplicationSyntax> {\n readonly documents: readonly PlacedPlayDocument[];\n}\n\n// Assembles one application from documents - following their imports from the roots, parsing each where it is\n// placed, and merging the lot. The port of the C# PlayApplicationAssembly.Compile.\nexport function assembleApplication(roots: Iterable<string>, source: PlayDocumentSource, languages?: ReadonlySet<string>, presentationRoot?: string | null): ApplicationCompilation {\n const rootPaths = [...roots];\n const { documents, diagnostics } = resolveImports(rootPaths, source, languages);\n const { result: merged, syntax } = parsePlacedDocumentsWithSyntax(documents, languages);\n // Resolution owns its import inventory; share one discovery between the presentation passes.\n const imports = new Map(documents.map(document => [document.path, discoverImports(document.source, document.path, languages)]));\n const orderingRoot = presentationRoot === null ? undefined : selectOrderingRoot(presentationRoot === undefined ? rootPaths : [presentationRoot], documents, languages, imports);\n if (orderingRoot !== undefined) recordAuthoredOrder(merged.value, [orderingRoot], documents, languages, syntax, imports);\n const timeline = orderingRoot === undefined ? [] : timelineOrderDiagnostics(merged.value);\n const all = [...diagnostics, ...merged.diagnostics, ...timeline];\n return { ...merged, documents, diagnostics: all, success: !all.some(diagnostic => diagnostic.severity === 'error') };\n}\n\n// Parses documents whose source identities and placements are already known (for example unsaved\n// editor buffers), then validates contracts against the merged declaration inventory. Editor callers may\n// defer example types whose imports are not in that inventory; resolved types are still checked.\nexport function parsePlacedDocuments(documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>, deferImportedExampleTypes = false): CompilationResult<ApplicationSyntax> & {\n readonly physicalEventSources: readonly { source: EventSourceSyntax; placementResolved: boolean }[];\n readonly sourceInventoryComplete: boolean;\n readonly continuationValues: ReturnType<typeof parseForAuthoring>['continuationValues'];\n} {\n return parsePlacedDocumentsWithSyntax(documents, languages, deferImportedExampleTypes).result;\n}\n\nfunction parsePlacedDocumentsWithSyntax(documents: readonly PlacedPlayDocument[], languages?: ReadonlySet<string>, deferImportedExampleTypes = false) {\n const candidates = CommandStreamCandidates.capturePlaced(documents.filter(document => document.isPlacementResolved !== false).map(document => ({ lines: splitLines(document.source, false, document.path), placement: document.placement })), languages);\n const physical = documents.map(document => parseForAuthoring(document.source, document.path, document.isPlacementResolved === false ? [] : document.placement, false, candidates, languages));\n const physicalEventSources = physical.flatMap((result, index) => (result.value.eventSources ?? []).map(source => ({ source, placementResolved: documents[index].isPlacementResolved !== false })));\n const sourceInventoryComplete = documents.every(document => document.isPlacementResolved !== false) && physical.every(result => !EventSourceReadConfidence.hasUnknownExtent(result.diagnostics));\n const parsed = physical.map((result, index) => documents[index].isPlacementResolved === false ? { ...result, value: { ...result.value, eventSources: [] } } : result);\n const merged = mergeDocuments(parsed);\n const context = new ParserContext(new LineReader([]), undefined, languages);\n if (merged.value.sourceOptions !== undefined) context.sourceOptions = merged.value.sourceOptions;\n context.guardedInteractions.push(...parsed.flatMap(document => document.guardedInteractions));\n context.interactionBehaviors.push(...parsed.flatMap(document => document.interactionBehaviors));\n context.interactionUses.push(...effectiveStructuralInteractions(merged.value).filter(site => 'behavior' in site),\n ...parsed.flatMap(document => document.interactionUses).filter(site => site.ancestors.some(ancestor => ancestor.keyword === 'screen')));\n context.continuationValues.push(...parsed.flatMap(document => document.continuationValues));\n validateSpecificationCases(merged.value, context);\n validateSpecificationExampleTypes(merged.value, context, deferImportedExampleTypes);\n const effective = expandSpecificationExamples(merged.value);\n validateEventSources(merged.value, context);\n validateOperations(merged.value, context);\n validatePublicEventUsage(merged.value, context);\n validateInlineEvents(merged.value, context);\n validateConstraintProperties(merged.value, context);\n validateResponses(effective, context, parsed.flatMap(document => document.inputUses));\n validateProjectionTargets(merged.value, context);\n validateIdentifierCompliance(effective, context);\n validateEventSubjects(merged.value, context);\n validateReadModelKeys(merged.value, context);\n validateReactionRefusals(merged.value, context);\n validateSpecificationRedelivery(merged.value, context);\n validateGuardedActions(merged.value, context);\n validatePersonaCallers(merged.value, context);\n validatePurposes(merged.value, context);\n const value = validateDependencyDeclarations(merged.value, context);\n DeclaredDependencies.validate(value, context);\n for (const diagnostic of productionDestinationDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n const existing = merged.diagnostics;\n const reported = new Set(existing.map(diagnosticKey));\n const all = [...existing, ...context.diagnostics.filter(diagnostic => !reported.has(diagnosticKey(diagnostic)))];\n return {\n result: { ...merged, value, diagnostics: all, success: !all.some(diagnostic => diagnostic.severity === 'error'), physicalEventSources, sourceInventoryComplete, continuationValues: context.continuationValues },\n syntax: new Map(parsed.map((result, index) => [documents[index].path, result.value])),\n };\n}\n\nfunction diagnosticKey(diagnostic: Diagnostic): string {\n return JSON.stringify([diagnostic.code, diagnostic.location.path, diagnostic.location.line, diagnostic.location.column]);\n}\n\n// Compiles documents held in memory, keyed by portable path, as one application. Without roots every\n// document is a root, in ordinal order of its path - a folder compiled as one application, where a file an\n// import places in a module or feature is placed there. With roots, only those documents and what they import\n// make up the application - a single file compiled with its imports followed. The default sort compares\n// UTF-16 code units, which is the C# ordinal order.\nexport function compileApplication(documents: ReadonlyMap<string, string>, roots?: readonly string[], languages?: ReadonlySet<string>, presentationRoot?: string | null): ApplicationCompilation {\n const normalized = new Map([...documents].map(([path, source]) => [normalizePlayPath(path), source]));\n return assembleApplication(roots ?? [...normalized.keys()].sort(), inMemoryDocumentSource(normalized), languages, presentationRoot);\n}\n\n// Compiles the documents of a folder as one application - the counterpart of the C# CompileFolder. Every\n// document is a root, read in ordinal order of its relative path as the C# compiler reads them, so a merge\n// keeps the same first declaration in either language; one an import places in a module or feature is\n// placed there.\nexport function parseFolder(files: readonly PlayFileSource[], languages?: ReadonlySet<string>): ApplicationCompilation {\n return compileApplication(new Map(files.map(file => [file.path, file.source])), undefined, languages);\n}\n\n"],"mappings":"ykFAuDA,SAAgB,oBAAoB,EAAyB,EAA4B,EAAiC,EAA0D,CAChL,IAAMA,EAAY,CAAC,GAAGC,CAAK,EACrB,CAAE,YAAW,eAAgBC,EAAeF,EAAWG,EAAQC,CAAS,EACxE,CAAE,OAAQC,EAAQ,UAAW,+BAA+BC,EAAWF,CAAS,EAEhFG,EAAU,IAAI,IAAID,EAAU,IAAI,GAAY,CAACE,EAAS,KAAMC,EAAgBD,EAAS,OAAQA,EAAS,KAAMJ,CAAS,CAAC,CAAC,CAAC,EACxHM,EAAeC,IAAqB,KAAO,IAAA,GAAYC,EAAmBD,IAAqB,IAAA,GAAYX,EAAY,CAACW,CAAgB,EAAGL,EAAWF,EAAWG,CAAO,EAC1KG,IAAiB,IAAA,IAAWG,EAAoBR,EAAO,MAAO,CAACK,CAAY,EAAGJ,EAAWF,EAAWU,EAAQP,CAAO,EACvH,IAAMQ,EAAWL,IAAiB,IAAA,GAAY,CAAC,EAAIM,EAAyBX,EAAO,KAAK,EAClFY,EAAM,CAAC,GAAGC,EAAa,GAAGb,EAAO,YAAa,GAAGU,CAAQ,EAC/D,MAAO,CAAE,GAAGV,EAAQ,YAAW,YAAaY,EAAK,QAAS,CAACA,EAAI,KAAK,GAAcE,EAAW,WAAa,OAAO,CAAE,CACvH,CAKA,SAAgB,qBAAqB,EAA0C,EAAiC,EAA4B,GAI1I,CACE,OAAO,+BAA+Bb,EAAWF,EAAWgB,CAAyB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,EAAWzD,EAAO,YAClB0D,EAAW,IAAI,IAAID,EAAS,IAAI,aAAa,CAAC,EAC9C7C,EAAM,CAAC,GAAG6C,EAAU,GAAG7B,EAAQ,YAAY,OAAO,GAAc,CAAC8B,EAAS,IAAI,cAAc5C,CAAU,CAAC,CAAC,CAAC,EAC/G,MAAO,CACH,OAAQ,CAAE,GAAGd,EAAQ,QAAO,YAAaY,EAAK,QAAS,CAACA,EAAI,KAAK,GAAcE,EAAW,WAAa,OAAO,EAAG,uBAAsB,0BAAyB,mBAAoBc,EAAQ,kBAAmB,EAC/M,OAAQ,IAAI,IAAIF,EAAO,KAAK,EAAQ,IAAU,CAACzB,EAAUsB,EAAM,CAAC,KAAMD,EAAO,KAAK,CAAC,CAAC,CACxF,CACJ,CAEA,SAAS,cAAc,EAAgC,CACnD,OAAO,KAAK,UAAU,CAACR,EAAW,KAAMA,EAAW,SAAS,KAAMA,EAAW,SAAS,KAAMA,EAAW,SAAS,MAAM,CAAC,CAC3H,CAOA,SAAgB,mBAAmB,EAAwC,EAA2B,EAAiC,EAA0D,CAC7L,IAAM6C,EAAa,IAAI,IAAI,CAAC,GAAG1D,CAAS,CAAC,CAAC,KAAK,CAAC2D,EAAM9D,KAAY,CAAC+D,EAAkBD,CAAI,EAAG9D,CAAM,CAAC,CAAC,EACpG,OAAO,oBAAoBF,GAAS,CAAC,GAAG+D,EAAW,KAAK,CAAC,CAAC,CAAC,KAAK,EAAGG,EAAuBH,CAAU,EAAG5D,EAAWO,CAAgB,CACtI"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";function inMemoryDocumentSource(e){return{filesBeneath:t=>[...e.keys()].filter(e=>t.length===0||e.startsWith(`${t}/`)),read:t=>{let n=e.get(t);if(n===void 0)throw Error(`There is no document '${t}'`);return n}}}export{inMemoryDocumentSource};
|
|
2
|
+
//# sourceMappingURL=PlayDocumentSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlayDocumentSource.js","names":["documents","folder","path","source"],"sources":["../../../../../../Compiler/Files/PlayDocumentSource.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 { PlayPlacement } from './PlayPlacement';\n\n// Where the documents an import names come from - a folder on disk, or the documents of a workspace. Every\n// path is portable: '/' separated and relative to one root. A path may begin with '..' when an import climbs\n// above that root. The port of the C# IPlayDocumentSource.\nexport interface PlayDocumentSource {\n // Every .play file beneath a portable folder path, at any depth - the empty folder is the root.\n filesBeneath(folder: string): Iterable<string>;\n\n // The source text of a document.\n read(path: string): string;\n}\n\n// A document of an application together with where its top level belongs.\nexport interface PlacedPlayDocument {\n readonly path: string;\n readonly source: string;\n readonly placement: PlayPlacement;\n // False for conflicting/cyclic placement and every descendant of such an importer.\n readonly isPlacementResolved?: boolean;\n}\n\n// A document source over documents held in memory, keyed by portable path.\nexport function inMemoryDocumentSource(documents: ReadonlyMap<string, string>): PlayDocumentSource {\n return {\n filesBeneath: folder => [...documents.keys()].filter(path => folder.length === 0 || path.startsWith(`${folder}/`)),\n read: path => {\n const source = documents.get(path);\n if (source === undefined) {\n throw new Error(`There is no document '${path}'`);\n }\n return source;\n },\n };\n}\n"],"mappings":"qDA0BA,SAAgB,uBAAuB,EAA4D,CAC/F,MAAO,CACH,aAAc,GAAU,CAAC,GAAGA,EAAU,KAAK,CAAC,CAAC,CAAC,OAAO,GAAQC,EAAO,SAAW,GAAKC,EAAK,WAAW,GAAGD,EAAO,EAAE,CAAC,EACjH,KAAM,GAAQ,CACV,IAAME,EAASH,EAAU,IAAIE,CAAI,EACjC,GAAIC,IAAW,IAAA,GACX,MAAU,MAAM,yBAAyBD,EAAK,EAAE,EAEpD,OAAOC,CACX,CACJ,CACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";const hasWildcard=e=>e.includes(`*`)||e.includes(`?`);function normalizePlayPath(e){let t=[];for(let n of e.replaceAll(`\\`,`/`).split(`/`).filter(e=>e.length>0))n!==`.`&&(n===`..`&&t.length>0&&t[t.length-1]!==`..`?t.pop():t.push(n));return t.join(`/`)}function resolvePlayPattern(e,t){let n=e.lastIndexOf(`/`),r=n>=0?e.substring(0,n):``;return normalizePlayPath(t.startsWith(`/`)?t.replace(/^\/+/,``):r.length===0?t:`${r}/${t}`)}function staticFolderOf(e){let t=e.split(`/`).slice(0,-1),n=t.findIndex(hasWildcard);return(n<0?t:t.slice(0,n)).join(`/`)}function matchesPlayPattern(e,t){return t.toLowerCase().endsWith(`.play`)&&toRegularExpression(e).test(t)}function toRegularExpression(e){let t=`^`,n=e.split(`/`);return n.forEach((e,r)=>{let i=r===n.length-1;if(e===`**`)t+=i?`.*`:`(?:[^/]+/)*`;else{for(let n of e)t+=n===`*`?`[^/]*`:n===`?`?`[^/]`:n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);i||(t+=`/`)}}),RegExp(`${t}$`,`u`)}export{hasWildcard,matchesPlayPattern,normalizePlayPath,resolvePlayPattern,staticFolderOf};
|
|
2
|
+
//# sourceMappingURL=PlayGlob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlayGlob.js","names":["pattern","segments","segment","path","each","slash","importingPath","folder","resolvedPattern","wildcard","expression","last","index","character"],"sources":["../../../../../../Compiler/Files/PlayGlob.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// Matches the path or glob pattern of a file import against portable '/' separated paths - the port of the\n// C# PlayGlob, so a folder resolves the same way in an editor and in a build. '**' as a whole segment matches\n// any number of folders, including none; '*' matches any run of characters within one segment and '?' one\n// character. A pattern is relative to the folder of the file that imports, may climb with '..', and only ever\n// matches .play files.\n\n// Whether a pattern holds a wildcard, as opposed to naming one file.\nexport const hasWildcard = (pattern: string): boolean => pattern.includes('*') || pattern.includes('?');\n\n// Normalizes a portable path - separators to '/', '.' segments removed, '..' applied. Leading '..' segments\n// that climb above the root are kept.\nexport function normalizePlayPath(path: string): string {\n const segments: string[] = [];\n for (const segment of path.replaceAll('\\\\', '/').split('/').filter(each => each.length > 0)) {\n if (segment === '.') continue;\n if (segment === '..' && segments.length > 0 && segments[segments.length - 1] !== '..') {\n segments.pop();\n continue;\n }\n segments.push(segment);\n }\n return segments.join('/');\n}\n\n// Resolves a pattern written in a file against the folder that file is in, relative to the same root as the\n// importing path.\nexport function resolvePlayPattern(importingPath: string, pattern: string): string {\n const slash = importingPath.lastIndexOf('/');\n const folder = slash >= 0 ? importingPath.substring(0, slash) : '';\n const combined = pattern.startsWith('/') ? pattern.replace(/^\\/+/, '') : (folder.length === 0 ? pattern : `${folder}/${pattern}`);\n return normalizePlayPath(combined);\n}\n\n// The folder a resolved pattern can only match beneath - everything before its first wildcard segment.\nexport function staticFolderOf(resolvedPattern: string): string {\n const segments = resolvedPattern.split('/').slice(0, -1);\n const wildcard = segments.findIndex(hasWildcard);\n return (wildcard < 0 ? segments : segments.slice(0, wildcard)).join('/');\n}\n\n// Whether a normalized portable path is a .play file a resolved pattern names.\nexport function matchesPlayPattern(resolvedPattern: string, path: string): boolean {\n return path.toLowerCase().endsWith('.play') && toRegularExpression(resolvedPattern).test(path);\n}\n\nfunction toRegularExpression(pattern: string): RegExp {\n let expression = '^';\n const segments = pattern.split('/');\n segments.forEach((segment, index) => {\n const last = index === segments.length - 1;\n if (segment === '**') {\n expression += last ? '.*' : '(?:[^/]+/)*';\n return;\n }\n for (const character of segment) {\n expression += character === '*' ? '[^/]*' : character === '?' ? '[^/]' : character.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n }\n if (!last) expression += '/';\n });\n return new RegExp(`${expression}$`, 'u');\n}\n"],"mappings":"qDAUA,MAAa,YAAe,GAA6BA,EAAQ,SAAS,GAAG,GAAKA,EAAQ,SAAS,GAAG,EAItG,SAAgB,kBAAkB,EAAsB,CACpD,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,sBAAuB,MAAM,EAEvHF,IAAM,GAAc,IAFmG,CAGhI,CAAC,EACU,OAAO,GAAGD,EAAW,GAAI,GAAG,CAC3C"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import"../Parsing/ImportDiscovery.js";import"../ScreenplayCompiler.js";
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{describePlacement as t,documentPlacement as n,isWithinOrSame as r,samePlacement as i}from"./PlayPlacement.js";import{placementFrom as a}from"../Parsing/ImportDiscovery.js";import{hasWildcard as o,matchesPlayPattern as s,normalizePlayPath as c,resolvePlayPattern as l,staticFolderOf as u}from"./PlayGlob.js";import{discoverImports as d}from"../ScreenplayCompiler.js";function resolveImports(e,t,n){let r=new Resolution(t,n);for(let t of new Set([...e].map(c)))r.addRoot(t);return r.settle(),{documents:r.documents(),diagnostics:r.diagnostics}}var Resolution=class{source;languages;diagnostics=[];#e=[];#t=/* @__PURE__ */ new Set;#n=/* @__PURE__ */ new Map;#r=/* @__PURE__ */ new Map;#i=/* @__PURE__ */ new Map;#a=/* @__PURE__ */ new Map;#o=[];#s=/* @__PURE__ */ new Map;#c=/* @__PURE__ */ new Set;constructor(e,t){this.source=e,this.languages=t}addRoot(e){this.#t.add(e),this.#u(e)}settle(){for(let e=this.#o.shift();e!==void 0;e=this.#o.shift())this.#f(e);this.#v();let e=[...this.#c];for(let t of e)for(let n of(this.#r.get(t)??[]).flatMap(e=>e.targets))this.#c.has(n)||(this.#c.add(n),e.push(n))}documents(){return this.#l().map(e=>({path:e,source:this.#n.get(e),placement:this.#h(e)??n,isPlacementResolved:!this.#c.has(e)}))}#l(){if(this.#t.size!==1)return[...this.#e];let e=/* @__PURE__ */ new Set,t=[];for(let n of this.#e){let r=[n];for(let n=r.pop();n!==void 0;n=r.pop())e.has(n)||(e.add(n),t.push(n),r.push(...(this.#r.get(n)??[]).flatMap(e=>e.targets).reverse()))}return t}#u(e){if(this.#n.has(e))return;this.#e.push(e);let t=this.source.read(e);this.#n.set(e,t),this.#r.set(e,d(t,e,this.languages).map(t=>({discovered:t,targets:this.#d(e,t)}))),this.#o.push(e)}#d(t,n){let{pattern:r,location:i}=n.fileImport,a=l(t,r),d=[...new Set([...this.source.filesBeneath(u(a))].map(c).filter(e=>e!==t&&s(a,e)))].sort();return d.length===0&&this.#y(o(r)?{severity:`warning`,code:e.FileImportMatchesNothing,message:`Import '${r}' matches no .play file`,location:i}:error(e.ImportedFileNotFound,`Imported file '${r}' does not exist`,i)),d}#f(t){let n=this.#h(t);this.#r.get(t).forEach(({discovered:r,targets:i},o)=>{let s=n===void 0?void 0:a(r,n);s!==void 0&&s.length>32&&(this.#y(error(e.ImportCycle,`Import '${r.fileImport.pattern}' places files deeper than 32 levels - the imports form a cycle`,r.fileImport.location)),this.#c.add(t),s=void 0);for(let e of i)this.#u(e),this.#p(e,t,o,s)})}#p(e,t,n,r){let a=this.#i.get(e)??/* @__PURE__ */ new Map;this.#i.set(e,a);let o=JSON.stringify([t,n]),s=a.get(o),c=r===void 0?a.delete(o):s===void 0||!i(s.placement,r);r!==void 0&&a.set(o,{importer:t,index:n,placement:r}),c&&this.#m(e)}#m(t){let n=this.#g(t),r=this.#a.get(t);if(!(r===void 0?n!==void 0:n===void 0||!i(r,n)))return;let a=(this.#s.get(t)??0)+1;if(this.#s.set(t,a),a>32){this.#c.add(t);for(let{discovered:{fileImport:n}}of this.#r.get(t))this.#y(error(e.ImportCycle,`Import '${n.pattern}' is part of imports that keep placing each other - the imports form a cycle`,n.location))}else n===void 0?this.#a.delete(t):this.#a.set(t,n),this.#o.push(t)}#h(e){return this.#a.get(e)??this.#g(e)}#g(e){return[...this.#t.has(e)?[n]:[],...this.#_(e).map(e=>e.placement)].reduce((e,t)=>e===void 0||r(t,e)?t:e,void 0)}#_(e){return[...this.#i.get(e)?.values()??[]].sort((e,t)=>e.importer===t.importer?e.index-t.index:e.importer<t.importer?-1:1)}#v(){for(let n of this.#e){let i=this.#h(n);if(i!==void 0){for(let{importer:a,index:o,placement:s}of this.#_(n))if(!r(i,s)){this.#c.add(n);let{fileImport:r}=this.#r.get(a)[o].discovered;this.#y(error(e.ConflictingImportPlacement,`'${n}' is imported into both ${t(i)} and ${t(s)} - a file belongs in one place`,r.location))}}}}#y(e){let t=keyOf(e);this.diagnostics.some(e=>keyOf(e)===t)||this.diagnostics.push(e)}};const keyOf=e=>JSON.stringify([e.severity,e.code,e.message,e.location]),error=(e,t,n)=>({severity:`error`,code:e,message:t,location:n});export{resolveImports};
|
|
2
|
+
//# sourceMappingURL=PlayImports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlayImports.js","names":["resolution","source","languages","root","roots","normalizePlayPath","#roots","#find","file","#pending","#propagate","#reportConflicts","unresolved","#unresolved","importer","target","#imports","imported","#orderedPaths","#sources","path","#placement","documentPlacement","#found","seen","ordered","pending","text","discoverImports","#targets","discovered","resolved","resolvePlayPattern","pattern","matches","staticFolderOf","matchesPlayPattern","#report","hasWildcard","DiagnosticCodes","location","placement","placementFrom","targets","#contribute","index","contributions","#contributions","key","current","changed","samePlacement","#recompute","#deepest","#placements","changes","#changes","fileImport","#ordered","contribution","deepest","isWithinOrSame","candidate","left","right","describePlacement","diagnostic","other"],"sources":["../../../../../../Compiler/Files/PlayImports.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 { DiscoveredImport, placementFrom } from '../Parsing/ImportDiscovery';\nimport { discoverImports } from '../ScreenplayCompiler';\nimport { PlacedPlayDocument, PlayDocumentSource } from './PlayDocumentSource';\nimport { hasWildcard, matchesPlayPattern, normalizePlayPath, resolvePlayPattern, staticFolderOf } from './PlayGlob';\nimport { describePlacement, documentPlacement, isWithinOrSame, PlayPlacement, samePlacement } from './PlayPlacement';\n\n// How deep a placement may get, and how often one file's placement may change, before the imports behind it\n// are taken to be a cycle.\nexport const maximumImportDepth = 32;\n\n// The documents of an application, and the diagnostics settling them produced.\nexport interface ResolvedImports {\n readonly documents: readonly PlacedPlayDocument[];\n readonly diagnostics: readonly Diagnostic[];\n}\n\n// Settles which documents make up an application and where each one's top level belongs, by following the\n// file imports from a set of root documents - the port of the C# PlayImports.Resolve.\n//\n// A root document is a whole document. Every file an import matches joins the application once, however many\n// imports match it. When several imports place the same file, the deepest placement wins; two placements where\n// neither lies inside the other are a conflict, and placements that keep deepening are an import cycle. A file's\n// placement depends on the placements of the files importing it, so it is recomputed from every importer's\n// current placement until nothing changes - the order files are found in never decides where one belongs. The\n// documents keep discovery order for multiple roots; a single root follows authored imports depth-first.\nexport function resolveImports(roots: Iterable<string>, source: PlayDocumentSource, languages?: ReadonlySet<string>): ResolvedImports {\n const resolution = new Resolution(source, languages);\n for (const root of new Set([...roots].map(normalizePlayPath))) {\n resolution.addRoot(root);\n }\n resolution.settle();\n return { documents: resolution.documents(), diagnostics: resolution.diagnostics };\n}\n\ninterface FoundImport {\n readonly discovered: DiscoveredImport;\n readonly targets: readonly string[];\n}\n\n// What each import currently contributes to a file's placement, keyed by the importing file and the import.\ntype Contributions = Map<string, { readonly importer: string; readonly index: number; readonly placement: PlayPlacement }>;\n\nclass Resolution {\n readonly diagnostics: Diagnostic[] = [];\n readonly #found: string[] = [];\n readonly #roots = new Set<string>();\n readonly #sources = new Map<string, string>();\n readonly #imports = new Map<string, readonly FoundImport[]>();\n readonly #contributions = new Map<string, Contributions>();\n readonly #placements = new Map<string, PlayPlacement>();\n readonly #pending: string[] = [];\n readonly #changes = new Map<string, number>();\n readonly #unresolved = new Set<string>();\n\n constructor(private readonly source: PlayDocumentSource, private readonly languages?: ReadonlySet<string>) {}\n\n addRoot(root: string): void {\n this.#roots.add(root);\n this.#find(root);\n }\n\n // Placements only deepen, and none is allowed past the maximum depth, so this ends.\n settle(): void {\n for (let file = this.#pending.shift(); file !== undefined; file = this.#pending.shift()) {\n this.#propagate(file);\n }\n this.#reportConflicts();\n const unresolved = [...this.#unresolved];\n for (const importer of unresolved) {\n for (const target of (this.#imports.get(importer) ?? []).flatMap(imported => imported.targets)) {\n if (!this.#unresolved.has(target)) {\n this.#unresolved.add(target);\n unresolved.push(target);\n }\n }\n }\n }\n\n documents(): PlacedPlayDocument[] {\n return this.#orderedPaths().map(path => ({ path, source: this.#sources.get(path) as string, placement: this.#placement(path) ?? documentPlacement, isPlacementResolved: !this.#unresolved.has(path) }));\n }\n\n #orderedPaths(): string[] {\n // Folder compilation keeps discovery order for merge precedence and event ownership.\n // AuthoredOrder records presentation ranks independently, including explicit pins before globs.\n if (this.#roots.size !== 1) return [...this.#found];\n const seen = new Set<string>();\n const ordered: string[] = [];\n for (const root of this.#found) {\n const pending = [root];\n for (let path = pending.pop(); path !== undefined; path = pending.pop()) {\n if (seen.has(path)) continue;\n seen.add(path);\n ordered.push(path);\n pending.push(...(this.#imports.get(path) ?? []).flatMap(imported => imported.targets).reverse());\n }\n }\n return ordered;\n }\n\n #find(file: string): void {\n if (this.#sources.has(file)) return;\n this.#found.push(file);\n const text = this.source.read(file);\n this.#sources.set(file, text);\n this.#imports.set(file, discoverImports(text, file, this.languages).map(discovered => ({ discovered, targets: this.#targets(file, discovered) })));\n this.#pending.push(file);\n }\n\n #targets(file: string, discovered: DiscoveredImport): string[] {\n const { pattern, location } = discovered.fileImport;\n const resolved = resolvePlayPattern(file, pattern);\n // The default sort compares UTF-16 code units, which is the C# ordinal order.\n const matches = [...new Set([...this.source.filesBeneath(staticFolderOf(resolved))]\n .map(normalizePlayPath)\n .filter(path => path !== file && matchesPlayPattern(resolved, path)))].sort();\n if (matches.length === 0) {\n this.#report(hasWildcard(pattern)\n ? { severity: 'warning', code: DiagnosticCodes.FileImportMatchesNothing, message: `Import '${pattern}' matches no .play file`, location }\n : error(DiagnosticCodes.ImportedFileNotFound, `Imported file '${pattern}' does not exist`, location));\n }\n return matches;\n }\n\n #propagate(file: string): void {\n const placement = this.#placement(file);\n (this.#imports.get(file) as readonly FoundImport[]).forEach(({ discovered, targets }, index) => {\n let target = placement === undefined ? undefined : placementFrom(discovered, placement);\n if (target !== undefined && target.length > maximumImportDepth) {\n this.#report(error(DiagnosticCodes.ImportCycle,\n `Import '${discovered.fileImport.pattern}' places files deeper than ${maximumImportDepth} levels - the imports form a cycle`, discovered.fileImport.location));\n this.#unresolved.add(file);\n target = undefined;\n }\n for (const path of targets) {\n this.#find(path);\n this.#contribute(path, file, index, target);\n }\n });\n }\n\n #contribute(file: string, importer: string, index: number, placement: PlayPlacement | undefined): void {\n const contributions = this.#contributions.get(file) ?? new Map();\n this.#contributions.set(file, contributions);\n const key = JSON.stringify([importer, index]);\n const current = contributions.get(key);\n const changed = placement === undefined\n ? contributions.delete(key)\n : current === undefined || !samePlacement(current.placement, placement);\n if (placement !== undefined) {\n contributions.set(key, { importer, index, placement });\n }\n if (changed) {\n this.#recompute(file);\n }\n }\n\n #recompute(file: string): void {\n const placement = this.#deepest(file);\n const current = this.#placements.get(file);\n const changed = current === undefined ? placement !== undefined : placement === undefined || !samePlacement(current, placement);\n if (!changed) return;\n\n // A placement that keeps changing is held up by imports that feed back into themselves.\n const changes = (this.#changes.get(file) ?? 0) + 1;\n this.#changes.set(file, changes);\n if (changes > maximumImportDepth) {\n this.#unresolved.add(file);\n for (const { discovered: { fileImport } } of this.#imports.get(file) as readonly FoundImport[]) {\n this.#report(error(DiagnosticCodes.ImportCycle,\n `Import '${fileImport.pattern}' is part of imports that keep placing each other - the imports form a cycle`, fileImport.location));\n }\n return;\n }\n if (placement === undefined) {\n this.#placements.delete(file);\n } else {\n this.#placements.set(file, placement);\n }\n this.#pending.push(file);\n }\n\n #placement(file: string): PlayPlacement | undefined {\n return this.#placements.get(file) ?? this.#deepest(file);\n }\n\n #deepest(file: string): PlayPlacement | undefined {\n const candidates = [...(this.#roots.has(file) ? [documentPlacement] : []), ...this.#ordered(file).map(contribution => contribution.placement)];\n return candidates.reduce<PlayPlacement | undefined>(\n (deepest, candidate) => deepest === undefined || isWithinOrSame(candidate, deepest) ? candidate : deepest, undefined);\n }\n\n #ordered(file: string) {\n return [...(this.#contributions.get(file)?.values() ?? [])]\n .sort((left, right) => left.importer === right.importer ? left.index - right.index : left.importer < right.importer ? -1 : 1);\n }\n\n #reportConflicts(): void {\n for (const file of this.#found) {\n const placement = this.#placement(file);\n if (placement === undefined) continue;\n for (const { importer, index, placement: contribution } of this.#ordered(file)) {\n if (!isWithinOrSame(placement, contribution)) {\n this.#unresolved.add(file);\n const { fileImport } = (this.#imports.get(importer) as readonly FoundImport[])[index].discovered;\n this.#report(error(DiagnosticCodes.ConflictingImportPlacement,\n `'${file}' is imported into both ${describePlacement(placement)} and ${describePlacement(contribution)} - a file belongs in one place`, fileImport.location));\n }\n }\n }\n }\n\n // Reports a diagnostic once - a file whose placement changes runs its imports again.\n #report(diagnostic: Diagnostic): void {\n const key = keyOf(diagnostic);\n if (!this.diagnostics.some(other => keyOf(other) === key)) {\n this.diagnostics.push(diagnostic);\n }\n }\n}\n\nconst keyOf = (diagnostic: Diagnostic): string => JSON.stringify([diagnostic.severity, diagnostic.code, diagnostic.message, diagnostic.location]);\nconst error = (code: string, message: string, location: SourceLocation): Diagnostic => ({ severity: 'error', code, message, location });\n"],"mappings":"8eA+BA,SAAgB,eAAe,EAAyB,EAA4B,EAAkD,CAClI,IAAMA,EAAa,IAAI,WAAWC,EAAQC,CAAS,EACnD,IAAK,IAAMC,KAAQ,IAAI,IAAI,CAAC,GAAGC,CAAK,CAAC,CAAC,IAAIC,CAAiB,CAAC,EACxDL,EAAW,QAAQG,CAAI,EAG3B,OADAH,EAAW,OAAO,EACX,CAAE,UAAWA,EAAW,UAAU,EAAG,YAAaA,EAAW,WAAY,CACpF,CAUA,IAAM,WAAN,KAAiB,CAYgB,OAA6C,UAX1E,YAAqC,CAAC,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WAAU,QAAO,UAAWkB,KAAkB,KAAKD,GAASlD,CAAI,EACzE,GAAI,CAACqD,EAAepB,EAAWkB,CAAY,EAAG,CAC1C,KAAK9C,GAAY,IAAIL,CAAI,EACzB,GAAM,CAAE,cAAgB,KAAKQ,GAAS,IAAIF,CAAQ,CAAC,CAA4B+B,EAAM,CAAC,WACtF,KAAKR,GAAQ,MAAME,EAAgB,2BAC/B,IAAI/B,EAAK,0BAA0ByD,EAAkBxB,CAAS,EAAE,OAAOwB,EAAkBN,CAAY,EAAE,gCAAiCF,EAAW,QAAQ,CAAC,CACpK,EAER,CACJ,CAGA,GAAQ,EAA8B,CAClC,IAAMT,EAAM,MAAMkB,CAAU,EACvB,KAAK,YAAY,KAAK,GAAS,MAAMC,CAAK,IAAMnB,CAAG,GACpD,KAAK,YAAY,KAAKkB,CAAU,CAExC,CACJ,EAEA,MAAM,MAAS,GAAmC,KAAK,UAAU,CAACA,EAAW,SAAUA,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,CAAC,EAC1I,OAAS,EAAc,EAAiB,KAA0C,CAAE,SAAU,QAAS,OAAM,UAAS,UAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";const e=[],isDocumentPlacement=e=>e.length===0;function describePlacement(e){return e.length===0?`the application`:e.length===1?`module '${e[0]}'`:`feature '${e.join(`.`)}'`}export{describePlacement,e as documentPlacement,isDocumentPlacement};
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";const e=[],isDocumentPlacement=e=>e.length===0;function describePlacement(e){return e.length===0?`the application`:e.length===1?`module '${e[0]}'`:`feature '${e.join(`.`)}'`}const isWithinOrSame=(e,t)=>t.length<=e.length&&t.every((t,n)=>t===e[n]),samePlacement=(e,t)=>e.length===t.length&&isWithinOrSame(e,t);export{describePlacement,e as documentPlacement,isDocumentPlacement,isWithinOrSame,samePlacement};
|
|
2
2
|
//# sourceMappingURL=PlayPlacement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayPlacement.js","names":["documentPlacement","placement"],"sources":["../../../../../../Compiler/Files/PlayPlacement.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// Where the top level of a .play file belongs: the module name followed by the names of the nested features,\n// outermost first, and empty for the application itself - the port of the C# PlayPlacement. A file is placed\n// by the import that brings it in: written inside 'module Ordering' and 'feature Orders', it places the\n// imported file at Ordering.Orders, so what the file declares at its top level is the body of that feature.\nexport type PlayPlacement = readonly string[];\n\n// The placement of a whole document - its top level is the application's.\nexport const documentPlacement: PlayPlacement = [];\n\n// Whether a file is a whole document rather than placed in a module or feature.\nexport const isDocumentPlacement = (placement: PlayPlacement): boolean => placement.length === 0;\n\n// The placement as it reads in a diagnostic, such as module 'Ordering' or feature 'Ordering.Orders'.\nexport function describePlacement(placement: PlayPlacement): string {\n if (placement.length === 0) return 'the application';\n if (placement.length === 1) return `module '${placement[0]}'`;\n return `feature '${placement.join('.')}'`;\n}\n\n// Whether one placement lies inside another, or is the same - the other's scope is a prefix of this one.\nexport const isWithinOrSame = (placement: PlayPlacement, other: PlayPlacement): boolean =>\n other.length <= placement.length && other.every((name, index) => name === placement[index]);\n\nexport const samePlacement = (left: PlayPlacement, right: PlayPlacement): boolean =>\n left.length === right.length && isWithinOrSame(left, right);\n"],"mappings":"qDAUA,MAAaA,EAAmC,CAAC,EAGpC,oBAAuB,GAAsCC,EAAU,SAAW,EAG/F,SAAgB,kBAAkB,EAAkC,CAGhE,OAFIA,EAAU,SAAW,EAAU,kBAC/BA,EAAU,SAAW,EAAU,WAAWA,EAAU,GAAG,GACpD,YAAYA,EAAU,KAAK,GAAG,EAAE,EAC3C"}
|
|
1
|
+
{"version":3,"file":"PlayPlacement.js","names":["documentPlacement","placement","other","name","index","left","right"],"sources":["../../../../../../Compiler/Files/PlayPlacement.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// Where the top level of a .play file belongs: the module name followed by the names of the nested features,\n// outermost first, and empty for the application itself - the port of the C# PlayPlacement. A file is placed\n// by the import that brings it in: written inside 'module Ordering' and 'feature Orders', it places the\n// imported file at Ordering.Orders, so what the file declares at its top level is the body of that feature.\nexport type PlayPlacement = readonly string[];\n\n// The placement of a whole document - its top level is the application's.\nexport const documentPlacement: PlayPlacement = [];\n\n// Whether a file is a whole document rather than placed in a module or feature.\nexport const isDocumentPlacement = (placement: PlayPlacement): boolean => placement.length === 0;\n\n// The placement as it reads in a diagnostic, such as module 'Ordering' or feature 'Ordering.Orders'.\nexport function describePlacement(placement: PlayPlacement): string {\n if (placement.length === 0) return 'the application';\n if (placement.length === 1) return `module '${placement[0]}'`;\n return `feature '${placement.join('.')}'`;\n}\n\n// Whether one placement lies inside another, or is the same - the other's scope is a prefix of this one.\nexport const isWithinOrSame = (placement: PlayPlacement, other: PlayPlacement): boolean =>\n other.length <= placement.length && other.every((name, index) => name === placement[index]);\n\nexport const samePlacement = (left: PlayPlacement, right: PlayPlacement): boolean =>\n left.length === right.length && isWithinOrSame(left, right);\n"],"mappings":"qDAUA,MAAaA,EAAmC,CAAC,EAGpC,oBAAuB,GAAsCC,EAAU,SAAW,EAG/F,SAAgB,kBAAkB,EAAkC,CAGhE,OAFIA,EAAU,SAAW,EAAU,kBAC/BA,EAAU,SAAW,EAAU,WAAWA,EAAU,GAAG,GACpD,YAAYA,EAAU,KAAK,GAAG,EAAE,EAC3C,CAGA,MAAa,gBAAkB,EAA0B,IACrDC,EAAM,QAAUD,EAAU,QAAUC,EAAM,OAAO,EAAM,IAAUC,IAASF,EAAUG,EAAM,EAEjF,eAAiB,EAAqB,IAC/CC,EAAK,SAAWC,EAAM,QAAU,eAAeD,EAAMC,CAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{eventDeclarations as t}from"../Syntax/EventDeclarations.js";import{authoredOrderKey as n,authoredOrderOf as r}from"./AuthoredOrder.js";import{buildingReadModelReferences as i,sliceReferences as a}from"../Dependencies/SliceReferences.js";import{stronglyConnectedGroups as o}from"../Dependencies/StronglyConnectedGroups.js";import{DependencyGraph as s}from"../Dependencies/DependencyGraph.js";import{ordinalIgnoreCaseKey as c}from"../Text/ordinalIgnoreCaseKey.js";function timelineOrderDiagnostics(
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{eventDeclarations as t}from"../Syntax/EventDeclarations.js";import{authoredOrderKey as n,authoredOrderOf as r}from"./AuthoredOrder.js";import{buildingReadModelReferences as i,sliceReferences as a}from"../Dependencies/SliceReferences.js";import{stronglyConnectedGroups as o}from"../Dependencies/StronglyConnectedGroups.js";import{DependencyGraph as s}from"../Dependencies/DependencyGraph.js";import{ordinalIgnoreCaseKey as c}from"../Text/ordinalIgnoreCaseKey.js";function timelineOrderDiagnostics(e){return timelineOrderFindings(e).map(e=>e.diagnostic)}function timelineOrderFindings(l,u=r(l)){let ordered=(e,t)=>e.map(e=>({syntax:e,rank:u.get(n([...t,e.name]))??2**53-1})).sort((e,t)=>e.rank-t.rank).map(e=>e.syntax),d=[],feature=(e,t)=>{let n=[...t,e.name];for(let t of ordered(e.slices,n))d.push({syntax:t,scope:[...n,t.name],identity:[...n.map(e=>`container:${e}`),`slice:${t.name}`],index:d.length});for(let t of ordered(e.features,n))feature(t,n)};for(let e of ordered(l.modules,[]))for(let t of ordered(e.features,[e.name]))feature(t,[e.name]);let f=new Map(d.map(e=>[e,/* @__PURE__ */ new Set([...t(e.syntax).map(e=>c(e.name)),...e.syntax.commands.flatMap(e=>e.produces.map(e=>c(e.event))),...e.syntax.reactions.flatMap(e=>e.triggers.flatMap(e=>e.produces.map(e=>c(e.event))))])])),p=/* @__PURE__ */ new Map;for(let e of d)for(let n of t(e.syntax)){let t=c(n.name);p.has(t)||p.set(t,e)}let m=/* @__PURE__ */ new Map;for(let e of d){let t=n(e.scope);m.has(t)||m.set(t,e)}let h=/* @__PURE__ */ new Map;for(let e of s.for(l,u).edges.filter(e=>e.kind===`decidesFrom`))for(let t of e.evidence){let r=n([...e.consumer.scope,t.name.toLowerCase()]);h.has(r)||h.set(r,m.get(n(e.producer.scope)))}let g=[];for(let e of d){let t=/* @__PURE__ */ new Set,r=a(e.syntax).references.filter(e=>e.timeline).map(e=>({event:e.name,location:e.location,readModel:e.targetKind===`ReadModel`}));for(let a of r){let r=c(a.event),o=`${a.readModel?`ReadModel`:`Event`}:${r}`;if(t.has(o))continue;t.add(o);let s=a.readModel?h.get(n([...e.scope,a.event.toLowerCase()])):p.get(r);if(s===void 0||s===e)continue;let l=0;for(;l<e.scope.length&&l<s.scope.length&&e.identity[l]===s.identity[l];)l++;if(l!==e.scope.length&&l!==s.scope.length){if(a.readModel){let t=e.identity.slice(0,l+1),n=new Set(d.filter(e=>t.every((t,n)=>e.identity[n]===t)).flatMap(e=>[...f.get(e)]));if(i(s.syntax,a.event).some(e=>e.timeline&&e.kind===`usesFactsFrom`&&e.targetKind===`Event`&&n.has(c(e.name))))continue}g.push({...a,consumer:e,producer:s,container:n(e.identity.slice(0,l)),left:e.identity[l],right:s.identity[l]})}}}let compare=(e,t)=>e.consumer.index-t.consumer.index||e.location.line-t.location.line||e.location.column-t.location.column,_=/* @__PURE__ */ new Set,v=[];for(let t of new Set(g.map(e=>e.container))){let r=g.filter(e=>e.container===t),i=/* @__PURE__ */ new Map;for(let e of r)i.has(e.left)||i.set(e.left,/* @__PURE__ */ new Set),i.has(e.right)||i.set(e.right,/* @__PURE__ */ new Set),i.get(e.left).add(e.right);for(let a of o(i).filter(e=>e.length>1)){let i=new Set(a),o=r.filter(e=>i.has(e.left)&&i.has(e.right));o.forEach(e=>_.add(e));let s=o.filter(e=>e.consumer.index<e.producer.index).sort(compare)[0];if(s===void 0)continue;let memberIndex=e=>Math.min(...o.flatMap(e=>[e.consumer,e.producer]).filter(n=>{let r=JSON.parse(t);return n.identity[r.length]===e}).map(e=>e.index));a.sort((e,t)=>memberIndex(e)-memberIndex(t)),v.push({edge:s,members:a,diagnostic:{severity:`information`,code:e.TimelineCycleGroup,message:`Timeline group ${a.map(e=>`${e.startsWith(`slice:`)?`slice`:t===n([])?`module`:`feature`} '${e.slice(e.indexOf(`:`)+1)}'`).join(`, `)} depend on each other's events or read models; reordering these members cannot make every dependency flow left to right.`,location:s.location}})}}for(let t of g){if(t.consumer.index>=t.producer.index||_.has(t))continue;let n=t.consumer.scope.slice(0,-1),r=t.producer.scope.length>t.consumer.scope.length&&n.every((e,n)=>t.producer.scope[n]===e),i=r?` The producer is in the consumer's own sub-feature; this cannot be fixed by reordering.`:` Consider drawing the producer before the consumer.`,a=t.readModel?`reads read model '${t.event}' built by`:`uses event '${t.event}' produced by`;v.push({edge:t,ownSubFeature:r,diagnostic:{severity:`information`,code:e.EventFromLaterSlice,message:`Slice '${t.consumer.syntax.name}' ${a} slice '${t.producer.syntax.name}' drawn after it.${i}`,location:t.location}})}return v.sort((e,t)=>compare(e.edge,t.edge)).map(({edge:e,diagnostic:t,members:r,ownSubFeature:i})=>({diagnostic:t,consumerScope:e.consumer.scope,producerScope:e.producer.scope,readModel:e.readModel,ownSubFeature:i===!0,key:n(r===void 0?[t.code,n(e.consumer.scope),...e.readModel?[`ReadModel`]:[],c(e.event)]:[t.code,e.container,...[...r].sort()])}))}export{timelineOrderDiagnostics,timelineOrderFindings};
|
|
2
2
|
//# sourceMappingURL=TimelineOrder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineOrder.js","names":["order","authoredOrderOf","application","items","authoredOrderKey","outer","syntax","left","right","item","slices","scope","slice","name","child","module","produced","eventDeclarations","ordinalIgnoreCaseKey","event","command","value","reaction","trigger","producers","byScope","key","readers","decision","DependencyGraph","edge","reference","edges","consumer","seen","references","sliceReferences","producer","common","side","facts","index","buildingReadModelReferences","suppressed","findings","container","local","graph","group","stronglyConnectedGroups","members","internal","first","member","DiagnosticCodes","parent","consequence","use","finding"],"sources":["../../../../../../Compiler/Files/TimelineOrder.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 { eventDeclarations } from '../Syntax/EventDeclarations';\nimport { buildingReadModelReferences, sliceReferences } from '../Dependencies/SliceReferences';\nimport { DependencyGraph } from '../Dependencies/DependencyGraph';\nimport { stronglyConnectedGroups } from '../Dependencies/StronglyConnectedGroups';\nimport { ApplicationSyntax, FeatureSyntax, SliceSyntax } from '../Syntax/Structure';\nimport { authoredOrderKey, authoredOrderOf } from './AuthoredOrder';\nimport { ordinalIgnoreCaseKey } from '../Text/ordinalIgnoreCaseKey';\n\ninterface Slice {\n syntax: SliceSyntax;\n scope: readonly string[];\n identity: readonly string[];\n index: number;\n}\ninterface Reference { event: string; location: SourceLocation; readModel: boolean }\ninterface Edge extends Reference { consumer: Slice; producer: Slice; left: string; right: string; container: string }\n\n// This pass only observes syntax. Its ranks and graph never enter the persisted model.\nexport function timelineOrderDiagnostics(application: ApplicationSyntax): Diagnostic[] {\n const order = authoredOrderOf(application);\n const ordered = <T extends { name: string }>(items: readonly T[], outer: readonly string[]): T[] => items\n .map(syntax => ({ syntax, rank: order.get(authoredOrderKey([...outer, syntax.name])) ?? Number.MAX_SAFE_INTEGER }))\n .sort((left, right) => left.rank - right.rank).map(item => item.syntax);\n const slices: Slice[] = [];\n const feature = (syntax: FeatureSyntax, outer: readonly string[]) => {\n const scope = [...outer, syntax.name];\n for (const slice of ordered(syntax.slices, scope)) slices.push({ syntax: slice, scope: [...scope, slice.name], identity: [...scope.map(name => `container:${name}`), `slice:${slice.name}`], index: slices.length });\n for (const child of ordered(syntax.features, scope)) feature(child, scope);\n };\n for (const module of ordered(application.modules, [])) {\n for (const child of ordered(module.features, [module.name])) feature(child, [module.name]);\n }\n const produced = new Map(slices.map(slice => [slice, new Set([\n ...eventDeclarations(slice.syntax).map(event => ordinalIgnoreCaseKey(event.name)),\n ...slice.syntax.commands.flatMap(command => command.produces.map(value => ordinalIgnoreCaseKey(value.event))),\n ...slice.syntax.reactions.flatMap(reaction => reaction.triggers.flatMap(trigger => trigger.produces.map(value => ordinalIgnoreCaseKey(value.event)))),\n ])]));\n const producers = new Map<string, Slice>();\n for (const slice of slices) {\n for (const event of eventDeclarations(slice.syntax)) {\n const name = ordinalIgnoreCaseKey(event.name);\n if (!producers.has(name)) producers.set(name, slice);\n }\n }\n // Use decidesFrom resolution, including builder preference and declaration fallback.\n const byScope = new Map<string, Slice>();\n for (const slice of slices) {\n const key = authoredOrderKey(slice.scope);\n if (!byScope.has(key)) byScope.set(key, slice);\n }\n const readers = new Map<string, Slice>();\n for (const decision of DependencyGraph.for(application, order).edges.filter(edge => edge.kind === 'decidesFrom')) {\n for (const reference of decision.evidence) {\n const key = authoredOrderKey([...decision.consumer.scope, reference.name.toLowerCase()]);\n if (!readers.has(key)) readers.set(key, byScope.get(authoredOrderKey(decision.producer.scope))!);\n }\n }\n const edges: Edge[] = [];\n for (const consumer of slices) {\n const seen = new Set<string>();\n const references = sliceReferences(consumer.syntax).references.filter(reference => reference.timeline)\n .map(reference => ({ event: reference.name, location: reference.location, readModel: reference.targetKind === 'ReadModel' }));\n for (const reference of references) {\n const name = ordinalIgnoreCaseKey(reference.event);\n const key = `${reference.readModel ? 'ReadModel' : 'Event'}:${name}`;\n if (seen.has(key)) continue;\n seen.add(key);\n const producer = reference.readModel ? readers.get(authoredOrderKey([...consumer.scope, reference.event.toLowerCase()])) : producers.get(name);\n if (producer === undefined || producer === consumer) continue;\n let common = 0;\n while (common < consumer.scope.length && common < producer.scope.length && consumer.identity[common] === producer.identity[common]) common++;\n if (common === consumer.scope.length || common === producer.scope.length) continue;\n // At the lowest common container, the reader's whole child supplies feedback\n // only for builders of the read model being read.\n // Exclude this read before SCC grouping, not just backward-edge emission.\n if (reference.readModel) {\n const side = consumer.identity.slice(0, common + 1);\n const facts = new Set(slices.filter(slice => side.every((name, index) => slice.identity[index] === name)).flatMap(slice => [...produced.get(slice)!]));\n if (buildingReadModelReferences(producer.syntax, reference.event).some(value => value.timeline && value.kind === 'usesFactsFrom' && value.targetKind === 'Event' && facts.has(ordinalIgnoreCaseKey(value.name)))) continue;\n }\n edges.push({ ...reference, consumer, producer, container: authoredOrderKey(consumer.identity.slice(0, common)), left: consumer.identity[common], right: producer.identity[common] });\n }\n }\n const compare = (left: Edge, right: Edge) => left.consumer.index - right.consumer.index || left.location.line - right.location.line || left.location.column - right.location.column;\n const suppressed = new Set<Edge>();\n const findings: { edge: Edge; diagnostic: Diagnostic }[] = [];\n for (const container of new Set(edges.map(edge => edge.container))) {\n const local = edges.filter(edge => edge.container === container);\n const graph = new Map<string, Set<string>>();\n for (const edge of local) {\n if (!graph.has(edge.left)) graph.set(edge.left, new Set());\n if (!graph.has(edge.right)) graph.set(edge.right, new Set());\n graph.get(edge.left)!.add(edge.right);\n }\n for (const group of stronglyConnectedGroups(graph).filter(group => group.length > 1)) {\n const members = new Set(group);\n const internal = local.filter(edge => members.has(edge.left) && members.has(edge.right));\n internal.forEach(edge => suppressed.add(edge));\n const first = internal.filter(edge => edge.consumer.index < edge.producer.index).sort(compare)[0];\n if (first === undefined) continue;\n const memberIndex = (member: string) => Math.min(...internal.flatMap(edge => [edge.consumer, edge.producer]).filter(slice => {\n const scope = JSON.parse(container) as string[];\n return slice.identity[scope.length] === member;\n }).map(slice => slice.index));\n group.sort((left, right) => memberIndex(left) - memberIndex(right));\n findings.push({ edge: first, diagnostic: { severity: 'information', code: DiagnosticCodes.TimelineCycleGroup, message: `Timeline group ${group.map(member => `${member.startsWith('slice:') ? 'slice' : container === authoredOrderKey([]) ? 'module' : 'feature'} '${member.slice(member.indexOf(':') + 1)}'`).join(', ')} depend on each other's events or read models; reordering these members cannot make every dependency flow left to right.`, location: first.location } });\n }\n }\n for (const edge of edges) {\n if (edge.consumer.index >= edge.producer.index || suppressed.has(edge)) continue;\n const parent = edge.consumer.scope.slice(0, -1);\n const ownSubFeature = edge.producer.scope.length > edge.consumer.scope.length && parent.every((name, index) => edge.producer.scope[index] === name);\n const consequence = ownSubFeature ? ' The producer is in the consumer\\'s own sub-feature; this cannot be fixed by reordering.' : ' Consider drawing the producer before the consumer.';\n const use = edge.readModel ? `reads read model '${edge.event}' built by` : `uses event '${edge.event}' produced by`;\n findings.push({ edge, diagnostic: { severity: 'information', code: DiagnosticCodes.EventFromLaterSlice, message: `Slice '${edge.consumer.syntax.name}' ${use} slice '${edge.producer.syntax.name}' drawn after it.${consequence}`, location: edge.location } });\n }\n return findings.sort((left, right) => compare(left.edge, right.edge)).map(finding => finding.diagnostic);\n}\n"],"mappings":"8kBAwBA,SAAgB,yBAAyB,EAA8C,CACnF,IAAMA,EAAQC,EAAgBC,CAAW,EACnC,SAAuC,EAAqB,IAAkCC,EAC/F,IAAI,IAAW,CAAE,SAAQ,KAAMH,EAAM,IAAII,EAAiB,CAAC,GAAGC,EAAOC,EAAO,IAAI,CAAC,CAAC,UAA6B,EAAE,CAAC,CAClH,MAAM,EAAM,IAAUC,EAAK,KAAOC,EAAM,IAAI,CAAC,CAAC,IAAI,GAAQC,EAAK,MAAM,EACpEC,EAAkB,CAAC,EACnB,SAAW,EAAuB,IAA6B,CACjE,IAAMC,EAAQ,CAAC,GAAGN,EAAOC,EAAO,IAAI,EACpC,IAAK,IAAMM,KAAS,QAAQN,EAAO,OAAQK,CAAK,EAAGD,EAAO,KAAK,CAAE,OAAQE,EAAO,MAAO,CAAC,GAAGD,EAAOC,EAAM,IAAI,EAAG,SAAU,CAAC,GAAGD,EAAM,IAAI,GAAQ,aAAaE,GAAM,EAAG,SAASD,EAAM,MAAM,EAA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EAAO,OAAO,EAAM,IAAUzB,EAAK,SAAS,MAAMW,KAAW5B,CAAI,EAC9G,0FAA6F,sDAC3H4C,EAAM3B,EAAK,UAAY,qBAAqBA,EAAK,MAAM,YAAc,eAAeA,EAAK,MAAM,eACrGc,EAAS,KAAK,CAAE,OAAM,WAAY,CAAE,SAAU,cAAe,KAAMU,EAAgB,oBAAqB,QAAS,UAAUxB,EAAK,SAAS,OAAO,KAAK,IAAI2B,EAAI,UAAU3B,EAAK,SAAS,OAAO,KAAK,mBAAmB0B,IAAe,SAAU1B,EAAK,QAAS,CAAE,CAAC,CAClQ,CACA,OAAOc,EAAS,MAAM,EAAM,IAAU,QAAQrC,EAAK,KAAMC,EAAM,IAAI,CAAC,CAAC,CAAC,IAAI,GAAWkD,EAAQ,UAAU,CAC3G"}
|
|
1
|
+
{"version":3,"file":"TimelineOrder.js","names":["application","finding","authoredOrderOf","items","order","authoredOrderKey","outer","syntax","left","right","item","slices","scope","slice","name","child","module","produced","eventDeclarations","ordinalIgnoreCaseKey","event","command","value","reaction","trigger","producers","byScope","key","readers","decision","DependencyGraph","edge","reference","edges","consumer","seen","references","sliceReferences","producer","common","side","facts","index","buildingReadModelReferences","suppressed","findings","container","local","graph","group","stronglyConnectedGroups","members","internal","first","member","DiagnosticCodes","parent","ownSubFeature","consequence","use","diagnostic"],"sources":["../../../../../../Compiler/Files/TimelineOrder.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 { eventDeclarations } from '../Syntax/EventDeclarations';\nimport { buildingReadModelReferences, sliceReferences } from '../Dependencies/SliceReferences';\nimport { DependencyGraph } from '../Dependencies/DependencyGraph';\nimport { stronglyConnectedGroups } from '../Dependencies/StronglyConnectedGroups';\nimport { ApplicationSyntax, FeatureSyntax, SliceSyntax } from '../Syntax/Structure';\nimport { authoredOrderKey, authoredOrderOf } from './AuthoredOrder';\nimport { ordinalIgnoreCaseKey } from '../Text/ordinalIgnoreCaseKey';\n\ninterface Slice {\n syntax: SliceSyntax;\n scope: readonly string[];\n identity: readonly string[];\n index: number;\n}\ninterface Reference { event: string; location: SourceLocation; readModel: boolean }\ninterface Edge extends Reference { consumer: Slice; producer: Slice; left: string; right: string; container: string }\n\n/** Structured presentation evidence for a repair; never serialized into the model. */\nexport interface TimelineFinding {\n readonly diagnostic: Diagnostic;\n readonly consumerScope: readonly string[];\n readonly producerScope: readonly string[];\n readonly readModel: boolean;\n readonly ownSubFeature: boolean;\n readonly key: string;\n}\n\n// This pass only observes syntax. Its ranks and graph never enter the persisted model.\nexport function timelineOrderDiagnostics(application: ApplicationSyntax): Diagnostic[] {\n return timelineOrderFindings(application).map(finding => finding.diagnostic);\n}\n\nexport function timelineOrderFindings(application: ApplicationSyntax, order: ReadonlyMap<string, number> = authoredOrderOf(application)): TimelineFinding[] {\n const ordered = <T extends { name: string }>(items: readonly T[], outer: readonly string[]): T[] => items\n .map(syntax => ({ syntax, rank: order.get(authoredOrderKey([...outer, syntax.name])) ?? Number.MAX_SAFE_INTEGER }))\n .sort((left, right) => left.rank - right.rank).map(item => item.syntax);\n const slices: Slice[] = [];\n const feature = (syntax: FeatureSyntax, outer: readonly string[]) => {\n const scope = [...outer, syntax.name];\n for (const slice of ordered(syntax.slices, scope)) slices.push({ syntax: slice, scope: [...scope, slice.name], identity: [...scope.map(name => `container:${name}`), `slice:${slice.name}`], index: slices.length });\n for (const child of ordered(syntax.features, scope)) feature(child, scope);\n };\n for (const module of ordered(application.modules, [])) {\n for (const child of ordered(module.features, [module.name])) feature(child, [module.name]);\n }\n const produced = new Map(slices.map(slice => [slice, new Set([\n ...eventDeclarations(slice.syntax).map(event => ordinalIgnoreCaseKey(event.name)),\n ...slice.syntax.commands.flatMap(command => command.produces.map(value => ordinalIgnoreCaseKey(value.event))),\n ...slice.syntax.reactions.flatMap(reaction => reaction.triggers.flatMap(trigger => trigger.produces.map(value => ordinalIgnoreCaseKey(value.event)))),\n ])]));\n const producers = new Map<string, Slice>();\n for (const slice of slices) {\n for (const event of eventDeclarations(slice.syntax)) {\n const name = ordinalIgnoreCaseKey(event.name);\n if (!producers.has(name)) producers.set(name, slice);\n }\n }\n // Use decidesFrom resolution, including builder preference and declaration fallback.\n const byScope = new Map<string, Slice>();\n for (const slice of slices) {\n const key = authoredOrderKey(slice.scope);\n if (!byScope.has(key)) byScope.set(key, slice);\n }\n const readers = new Map<string, Slice>();\n for (const decision of DependencyGraph.for(application, order).edges.filter(edge => edge.kind === 'decidesFrom')) {\n for (const reference of decision.evidence) {\n const key = authoredOrderKey([...decision.consumer.scope, reference.name.toLowerCase()]);\n if (!readers.has(key)) readers.set(key, byScope.get(authoredOrderKey(decision.producer.scope))!);\n }\n }\n const edges: Edge[] = [];\n for (const consumer of slices) {\n const seen = new Set<string>();\n const references = sliceReferences(consumer.syntax).references.filter(reference => reference.timeline)\n .map(reference => ({ event: reference.name, location: reference.location, readModel: reference.targetKind === 'ReadModel' }));\n for (const reference of references) {\n const name = ordinalIgnoreCaseKey(reference.event);\n const key = `${reference.readModel ? 'ReadModel' : 'Event'}:${name}`;\n if (seen.has(key)) continue;\n seen.add(key);\n const producer = reference.readModel ? readers.get(authoredOrderKey([...consumer.scope, reference.event.toLowerCase()])) : producers.get(name);\n if (producer === undefined || producer === consumer) continue;\n let common = 0;\n while (common < consumer.scope.length && common < producer.scope.length && consumer.identity[common] === producer.identity[common]) common++;\n if (common === consumer.scope.length || common === producer.scope.length) continue;\n // At the lowest common container, the reader's whole child supplies feedback\n // only for builders of the read model being read.\n // Exclude this read before SCC grouping, not just backward-edge emission.\n if (reference.readModel) {\n const side = consumer.identity.slice(0, common + 1);\n const facts = new Set(slices.filter(slice => side.every((name, index) => slice.identity[index] === name)).flatMap(slice => [...produced.get(slice)!]));\n if (buildingReadModelReferences(producer.syntax, reference.event).some(value => value.timeline && value.kind === 'usesFactsFrom' && value.targetKind === 'Event' && facts.has(ordinalIgnoreCaseKey(value.name)))) continue;\n }\n edges.push({ ...reference, consumer, producer, container: authoredOrderKey(consumer.identity.slice(0, common)), left: consumer.identity[common], right: producer.identity[common] });\n }\n }\n const compare = (left: Edge, right: Edge) => left.consumer.index - right.consumer.index || left.location.line - right.location.line || left.location.column - right.location.column;\n const suppressed = new Set<Edge>();\n const findings: { edge: Edge; diagnostic: Diagnostic; members?: readonly string[]; ownSubFeature?: boolean }[] = [];\n for (const container of new Set(edges.map(edge => edge.container))) {\n const local = edges.filter(edge => edge.container === container);\n const graph = new Map<string, Set<string>>();\n for (const edge of local) {\n if (!graph.has(edge.left)) graph.set(edge.left, new Set());\n if (!graph.has(edge.right)) graph.set(edge.right, new Set());\n graph.get(edge.left)!.add(edge.right);\n }\n for (const group of stronglyConnectedGroups(graph).filter(group => group.length > 1)) {\n const members = new Set(group);\n const internal = local.filter(edge => members.has(edge.left) && members.has(edge.right));\n internal.forEach(edge => suppressed.add(edge));\n const first = internal.filter(edge => edge.consumer.index < edge.producer.index).sort(compare)[0];\n if (first === undefined) continue;\n const memberIndex = (member: string) => Math.min(...internal.flatMap(edge => [edge.consumer, edge.producer]).filter(slice => {\n const scope = JSON.parse(container) as string[];\n return slice.identity[scope.length] === member;\n }).map(slice => slice.index));\n group.sort((left, right) => memberIndex(left) - memberIndex(right));\n findings.push({ edge: first, members: group, diagnostic: { severity: 'information', code: DiagnosticCodes.TimelineCycleGroup, message: `Timeline group ${group.map(member => `${member.startsWith('slice:') ? 'slice' : container === authoredOrderKey([]) ? 'module' : 'feature'} '${member.slice(member.indexOf(':') + 1)}'`).join(', ')} depend on each other's events or read models; reordering these members cannot make every dependency flow left to right.`, location: first.location } });\n }\n }\n for (const edge of edges) {\n if (edge.consumer.index >= edge.producer.index || suppressed.has(edge)) continue;\n const parent = edge.consumer.scope.slice(0, -1);\n const ownSubFeature = edge.producer.scope.length > edge.consumer.scope.length && parent.every((name, index) => edge.producer.scope[index] === name);\n const consequence = ownSubFeature ? ' The producer is in the consumer\\'s own sub-feature; this cannot be fixed by reordering.' : ' Consider drawing the producer before the consumer.';\n const use = edge.readModel ? `reads read model '${edge.event}' built by` : `uses event '${edge.event}' produced by`;\n findings.push({ edge, ownSubFeature, diagnostic: { severity: 'information', code: DiagnosticCodes.EventFromLaterSlice, message: `Slice '${edge.consumer.syntax.name}' ${use} slice '${edge.producer.syntax.name}' drawn after it.${consequence}`, location: edge.location } });\n }\n return findings.sort((left, right) => compare(left.edge, right.edge)).map(({ edge, diagnostic, members, ownSubFeature }) => ({\n diagnostic, consumerScope: edge.consumer.scope, producerScope: edge.producer.scope, readModel: edge.readModel, ownSubFeature: ownSubFeature === true,\n key: members === undefined ? authoredOrderKey([diagnostic.code, authoredOrderKey(edge.consumer.scope), ...(edge.readModel ? ['ReadModel'] : []), ordinalIgnoreCaseKey(edge.event)])\n : authoredOrderKey([diagnostic.code, edge.container, ...[...members].sort()]),\n }));\n}\n"],"mappings":"8kBAkCA,SAAgB,yBAAyB,EAA8C,CACnF,OAAO,sBAAsBA,CAAW,CAAC,CAAC,IAAI,GAAWC,EAAQ,UAAU,CAC/E,CAEA,SAAgB,sBAAsB,EAAgC,EAAqCC,EAAgBF,CAAW,EAAsB,CACxJ,IAAM,SAAuC,EAAqB,IAAkCG,EAC/F,IAAI,IAAW,CAAE,SAAQ,KAAMC,EAAM,IAAIC,EAAiB,CAAC,GAAGC,EAAOC,EAAO,IAAI,CAAC,CAAC,UAA6B,EAAE,CAAC,CAClH,MAAM,EAAM,IAAUC,EAAK,KAAOC,EAAM,IAAI,CAAC,CAAC,IAAI,GAAQC,EAAK,MAAM,EACpEC,EAAkB,CAAC,EACnB,SAAW,EAAuB,IAA6B,CACjE,IAAMC,EAAQ,CAAC,GAAGN,EAAOC,EAAO,IAAI,EACpC,IAAK,IAAMM,KAAS,QAAQN,EAAO,OAAQK,CAAK,EAAGD,EAAO,K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