Skip to content

Commit f209787

Browse files
committed
Validate flags changed.
1 parent 0f72765 commit f209787

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

src/Compiler/Backend.gren

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ type Command
187187
| Make MakeFlags
188188
| Docs DocsFlags
189189
| PackageValidate PackageValidateFlags
190-
| PackageBump PackageValidateFlags
190+
| PackageBump PackageBumpFlags
191191
| PackageDiff PackageDiffFlags
192192

193193

@@ -244,6 +244,24 @@ type DocsOutput
244244

245245
{-|-}
246246
type alias PackageValidateFlags =
247+
{ projectPath : Path
248+
, knownVersions : Array SemanticVersion
249+
, previousVersion :
250+
Maybe
251+
{ outline : Outline
252+
, rootSources : Dict String String
253+
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
254+
}
255+
, currentVersion :
256+
{ outline : Outline
257+
, rootSources : Dict String String
258+
, dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
259+
}
260+
}
261+
262+
263+
{-|-}
264+
type alias PackageBumpFlags =
247265
{ projectPath : Path
248266
, knownVersions : Array SemanticVersion
249267
, publishedVersion :
@@ -372,13 +390,17 @@ commandEncoder interactive pathToString command =
372390
, { key = "dependencies", value = Json.dict identity depsToJson flags.currentVersion.dependencies }
373391
]
374392
}
375-
, { key = "published-version"
393+
, { key = "previous-version"
376394
, value =
377-
Json.object
378-
[ { key = "project-outline", value = Outline.toJson flags.publishedVersion.outline }
379-
, { key = "sources", value = Json.dict identity Json.string flags.publishedVersion.rootSources }
380-
, { key = "dependencies", value = Json.dict identity depsToJson flags.publishedVersion.dependencies }
381-
]
395+
maybeEncoder
396+
(\package ->
397+
Json.object
398+
[ { key = "project-outline", value = Outline.toJson package.outline }
399+
, { key = "sources", value = Json.dict identity Json.string package.rootSources }
400+
, { key = "dependencies", value = Json.dict identity depsToJson package.dependencies }
401+
]
402+
)
403+
flags.previousVersion
382404
}
383405
]
384406

0 commit comments

Comments
 (0)