persona-community-5/.pnpm-store/v3/files/d6/b6fec71f80b807b7ab8540718963b36aa626d889c48a21a4b4b595e017bd63bb8cd99ef5fcca7a5629bba54c4f508f4eaf3a7344ff1a1f6391edef07e14780
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

57 lines
2.4 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WorkflowDependsOn = void 0;
const WorkflowDependsOn = () => {
const seenWorkflow = new Set();
const existingSourceDescriptions = new Set();
const existingWorkflowIds = new Set();
return {
SourceDescriptions: {
enter(sourceDescriptions) {
for (const sourceDescription of sourceDescriptions) {
existingSourceDescriptions.add(sourceDescription.name);
}
},
},
Workflows: {
enter(workflows) {
for (const workflow of workflows) {
existingWorkflowIds.add(workflow.workflowId);
}
},
},
Workflow: {
leave(workflow, { report, location }) {
if (!workflow.dependsOn)
return;
for (const item of workflow.dependsOn) {
// Possible dependsOn workflow pattern: $sourceDescriptions.<name>.<workflowId>
if (item.startsWith('$sourceDescriptions.')) {
const sourceDescriptionName = item.split('.')[1];
if (!existingSourceDescriptions.has(sourceDescriptionName)) {
report({
message: `SourceDescription ${sourceDescriptionName} must be defined in sourceDescriptions.`,
location: location.child([`dependsOn`, workflow.dependsOn.indexOf(item)]),
});
}
}
if (!item.startsWith('$sourceDescriptions') && !existingWorkflowIds.has(item)) {
report({
message: `Workflow ${item} must be defined in workflows.`,
location: location.child([`dependsOn`, workflow.dependsOn.indexOf(item)]),
});
}
if (seenWorkflow.has(item)) {
report({
message: 'Every workflow in dependsOn must be unique.',
location: location.child([`dependsOn`]),
});
}
seenWorkflow.add(item);
}
},
},
};
};
exports.WorkflowDependsOn = WorkflowDependsOn;