Skip to content

Commit c9e136a

Browse files
committed
Bump backend command requires the actual projects for comparison.
1 parent c1553e4 commit c9e136a

File tree

1 file changed

+43
-10
lines changed

1 file changed

+43
-10
lines changed

src/Compiler/Backend.gren

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,16 @@ type Command
194194
type alias PackageValidateFlags =
195195
{ projectPath : Path
196196
, knownVersions : Array SemanticVersion
197-
, outline : Outline
198-
, rootSources : Dict String String
199-
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
197+
, publishedVersion :
198+
{ outline : Outline
199+
, rootSources : Dict String String
200+
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
201+
}
202+
, currentVersion :
203+
{ outline : Outline
204+
, rootSources : Dict String String
205+
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
206+
}
200207
}
201208

202209

@@ -344,13 +351,26 @@ commandEncoder interactive pathToString command =
344351

345352
PackageValidate flags ->
346353
Json.object
347-
[ { key = "command", value = Json.string "packageValidate" }
354+
[ { key = "command", value = Json.string "packageBump" }
348355
, { key = "interactive", value = Json.bool interactive }
349356
, { key = "known-versions", value = Json.array SemanticVersion.toJson flags.knownVersions }
350357
, { key = "project-path", value = Json.string <| pathToString flags.projectPath }
351-
, { key = "project-outline", value = Outline.toJson flags.outline }
352-
, { key = "sources", value = Json.dict identity Json.string flags.rootSources }
353-
, { key = "dependencies", value = Json.dict identity depsToJson flags.dependencies }
358+
, { key = "current-version"
359+
, value =
360+
Json.object
361+
[ { key = "project-outline", value = Outline.toJson flags.currentVersion.outline }
362+
, { key = "sources", value = Json.dict identity Json.string flags.currentVersion.rootSources }
363+
, { key = "dependencies", value = Json.dict identity depsToJson flags.currentVersion.dependencies }
364+
]
365+
}
366+
, { key = "published-version"
367+
, value =
368+
Json.object
369+
[ { key = "project-outline", value = Outline.toJson flags.publishedVersion.outline }
370+
, { key = "sources", value = Json.dict identity Json.string flags.publishedVersion.rootSources }
371+
, { key = "dependencies", value = Json.dict identity depsToJson flags.publishedVersion.dependencies }
372+
]
373+
}
354374
]
355375

356376
PackageBump flags ->
@@ -359,9 +379,22 @@ commandEncoder interactive pathToString command =
359379
, { key = "interactive", value = Json.bool interactive }
360380
, { key = "known-versions", value = Json.array SemanticVersion.toJson flags.knownVersions }
361381
, { key = "project-path", value = Json.string <| pathToString flags.projectPath }
362-
, { key = "project-outline", value = Outline.toJson flags.outline }
363-
, { key = "sources", value = Json.dict identity Json.string flags.rootSources }
364-
, { key = "dependencies", value = Json.dict identity depsToJson flags.dependencies }
382+
, { key = "current-version"
383+
, value =
384+
Json.object
385+
[ { key = "project-outline", value = Outline.toJson flags.currentVersion.outline }
386+
, { key = "sources", value = Json.dict identity Json.string flags.currentVersion.rootSources }
387+
, { key = "dependencies", value = Json.dict identity depsToJson flags.currentVersion.dependencies }
388+
]
389+
}
390+
, { key = "published-version"
391+
, value =
392+
Json.object
393+
[ { key = "project-outline", value = Outline.toJson flags.publishedVersion.outline }
394+
, { key = "sources", value = Json.dict identity Json.string flags.publishedVersion.rootSources }
395+
, { key = "dependencies", value = Json.dict identity depsToJson flags.publishedVersion.dependencies }
396+
]
397+
}
365398
]
366399

367400
PackageDiff args ->

0 commit comments

Comments
 (0)