2022-07-25 14:34:33 +00:00
|
|
|
module ProjectItem = ReducerProject_ProjectItem
|
|
|
|
|
2022-08-22 06:50:59 +00:00
|
|
|
@genType.opaque
|
2022-09-11 15:22:07 +00:00
|
|
|
type project = {
|
|
|
|
items: Belt.MutableMap.String.t<ProjectItem.t>,
|
2022-09-16 20:30:44 +00:00
|
|
|
mutable stdLib: Reducer_Namespace.t,
|
2022-09-17 22:19:08 +00:00
|
|
|
mutable environment: Reducer_T.environment,
|
2022-09-11 15:22:07 +00:00
|
|
|
mutable previousRunOrder: array<string>,
|
|
|
|
}
|
2022-07-25 14:34:33 +00:00
|
|
|
type t = project
|
|
|
|
|
2022-09-11 15:22:07 +00:00
|
|
|
// these functions are used in ReducerProject_Topology, so they are defined here to avoid circular dependencies
|
|
|
|
let getSourceIds = (project: t): array<string> => Belt.MutableMap.String.keysToArray(project.items)
|
2022-08-14 14:14:14 +00:00
|
|
|
|
2022-09-11 15:22:07 +00:00
|
|
|
let getItem = (project: t, sourceId: string) =>
|
2022-09-24 23:16:14 +00:00
|
|
|
Belt.MutableMap.String.getWithDefault(project.items, sourceId, ProjectItem.emptyItem(sourceId))
|