@h-rig/core 0.0.6-alpha.10 → 0.0.6-alpha.103
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/src/define-config.d.ts +18 -0
- package/dist/src/define-config.js +20 -2
- package/dist/src/define-plugin.d.ts +9 -0
- package/dist/src/define-plugin.js +17 -0
- package/dist/src/engineReadModelReducer.d.ts +12 -0
- package/dist/src/engineReadModelReducer.js +6 -3
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.js +354 -22
- package/dist/src/load-config.d.ts +2 -0
- package/dist/src/load-config.js +257 -5
- package/dist/src/plugin-host.d.ts +40 -0
- package/dist/src/plugin-host.js +18 -0
- package/dist/src/plugin-runtime.d.ts +64 -0
- package/dist/src/rig-init-builder.d.ts +30 -0
- package/dist/src/rig-init-builder.js +3 -2
- package/dist/src/rigSelectors.d.ts +220 -0
- package/dist/src/rigSelectors.js +125 -4
- package/dist/src/taskGraph.d.ts +41 -0
- package/dist/src/taskGraph.js +164 -8
- package/dist/src/taskGraphCodes.d.ts +3 -0
- package/dist/src/taskGraphLayout.d.ts +60 -0
- package/dist/src/taskGraphLayout.js +22 -3
- package/package.json +6 -12
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { EngineReadModel, TaskSummary } from "@rig/contracts";
|
|
2
|
+
export type TaskGraphLane = Readonly<{
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
rowIndex: number;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
color: string;
|
|
11
|
+
taskCount: number;
|
|
12
|
+
}>;
|
|
13
|
+
export type TaskGraphStage = Readonly<{
|
|
14
|
+
index: number;
|
|
15
|
+
label: string;
|
|
16
|
+
x: number;
|
|
17
|
+
width: number;
|
|
18
|
+
}>;
|
|
19
|
+
export type TaskGraphNode = Readonly<{
|
|
20
|
+
id: string;
|
|
21
|
+
task: TaskSummary;
|
|
22
|
+
rowKey: string;
|
|
23
|
+
rowLabel: string;
|
|
24
|
+
rowIndex: number;
|
|
25
|
+
stage: number;
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
color: string;
|
|
31
|
+
taskCode: string | null;
|
|
32
|
+
strippedTitle: string;
|
|
33
|
+
depsIn: number;
|
|
34
|
+
depsOut: number;
|
|
35
|
+
runCount: number;
|
|
36
|
+
hasApprovals: boolean;
|
|
37
|
+
hasPendingUserInput: boolean;
|
|
38
|
+
hasRejectedReview: boolean;
|
|
39
|
+
hasFailedValidations: boolean;
|
|
40
|
+
artifactCount: number;
|
|
41
|
+
}>;
|
|
42
|
+
export type TaskGraphEdge = Readonly<{
|
|
43
|
+
id: string;
|
|
44
|
+
sourceId: string;
|
|
45
|
+
targetId: string;
|
|
46
|
+
color: string;
|
|
47
|
+
kind: "blocking" | "parent-child";
|
|
48
|
+
}>;
|
|
49
|
+
export type TaskGraphLayout = Readonly<{
|
|
50
|
+
lanes: readonly TaskGraphLane[];
|
|
51
|
+
stages: readonly TaskGraphStage[];
|
|
52
|
+
nodes: readonly TaskGraphNode[];
|
|
53
|
+
edges: readonly TaskGraphEdge[];
|
|
54
|
+
totalWidth: number;
|
|
55
|
+
totalHeight: number;
|
|
56
|
+
taskCount: number;
|
|
57
|
+
}>;
|
|
58
|
+
export declare function buildTaskGraphLayout(snapshot: EngineReadModel | null, tasks: readonly TaskSummary[], options?: {
|
|
59
|
+
showParentChild?: boolean;
|
|
60
|
+
}): TaskGraphLayout;
|
|
@@ -39,14 +39,33 @@ function stripTaskCode(label) {
|
|
|
39
39
|
function isObjectRecord(value) {
|
|
40
40
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
41
41
|
}
|
|
42
|
+
function readStringList(value) {
|
|
43
|
+
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && entry.length > 0) : [];
|
|
44
|
+
}
|
|
42
45
|
function readTaskMetadataStringList(task, key) {
|
|
46
|
+
const taskRecord = task;
|
|
47
|
+
const topLevel = readStringList(taskRecord[key]);
|
|
48
|
+
if (topLevel.length > 0)
|
|
49
|
+
return topLevel;
|
|
43
50
|
const metadata = isObjectRecord(task.metadata) ? task.metadata : null;
|
|
44
|
-
const
|
|
45
|
-
|
|
51
|
+
const metadataList = readStringList(metadata?.[key]);
|
|
52
|
+
if (metadataList.length > 0)
|
|
53
|
+
return metadataList;
|
|
54
|
+
if (key === "dependencies") {
|
|
55
|
+
return readStringList(metadata?.deps);
|
|
56
|
+
}
|
|
57
|
+
return [];
|
|
46
58
|
}
|
|
47
59
|
function readTaskSourceIssueId(task) {
|
|
60
|
+
if (typeof task.sourceIssueId === "string" && task.sourceIssueId.length > 0) {
|
|
61
|
+
return task.sourceIssueId;
|
|
62
|
+
}
|
|
48
63
|
const metadata = isObjectRecord(task.metadata) ? task.metadata : null;
|
|
49
|
-
|
|
64
|
+
if (typeof metadata?.sourceIssueId === "string" && metadata.sourceIssueId.length > 0) {
|
|
65
|
+
return metadata.sourceIssueId;
|
|
66
|
+
}
|
|
67
|
+
const rigMetadata = isObjectRecord(metadata?._rig) ? metadata._rig : null;
|
|
68
|
+
return typeof rigMetadata?.sourceIssueId === "string" && rigMetadata.sourceIssueId.length > 0 ? rigMetadata.sourceIssueId : null;
|
|
50
69
|
}
|
|
51
70
|
function resolveTaskReference(ref, tasksById, taskIdByExternalRef, taskIdBySourceIssueId) {
|
|
52
71
|
if (tasksById.has(ref))
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-rig/core",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
3
|
+
"version": "0.0.6-alpha.103",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Rig
|
|
5
|
+
"description": "Config and plugin composition library for Rig's OMP extension ecosystem; not a product host/runtime.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -10,19 +10,12 @@
|
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"types": "./dist/src/index.d.ts",
|
|
13
14
|
"import": "./dist/src/index.js"
|
|
14
15
|
},
|
|
15
16
|
"./load-config": {
|
|
17
|
+
"types": "./dist/src/load-config.d.ts",
|
|
16
18
|
"import": "./dist/src/load-config.js"
|
|
17
|
-
},
|
|
18
|
-
"./engineReadModelReducer": {
|
|
19
|
-
"import": "./dist/src/engineReadModelReducer.js"
|
|
20
|
-
},
|
|
21
|
-
"./rigSelectors": {
|
|
22
|
-
"import": "./dist/src/rigSelectors.js"
|
|
23
|
-
},
|
|
24
|
-
"./taskGraph": {
|
|
25
|
-
"import": "./dist/src/taskGraph.js"
|
|
26
19
|
}
|
|
27
20
|
},
|
|
28
21
|
"engines": {
|
|
@@ -30,8 +23,9 @@
|
|
|
30
23
|
},
|
|
31
24
|
"main": "./dist/src/index.js",
|
|
32
25
|
"module": "./dist/src/index.js",
|
|
26
|
+
"types": "./dist/src/index.d.ts",
|
|
33
27
|
"dependencies": {
|
|
34
|
-
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.
|
|
28
|
+
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.103",
|
|
35
29
|
"effect": "4.0.0-beta.78"
|
|
36
30
|
}
|
|
37
31
|
}
|