@@ -7,7 +7,8 @@ module Compiler.Backend exposing
7
7
, MakeOutput(..)
8
8
, DocsFlags
9
9
, DocsOutput(..)
10
- , DiffArgs(..)
10
+ , PackageValidateFlags
11
+ , PackageDiffFlags
11
12
, encodeCommand
12
13
, run
13
14
--
@@ -187,24 +188,7 @@ type Command
187
188
| Docs DocsFlags
188
189
| PackageValidate PackageValidateFlags
189
190
| PackageBump PackageValidateFlags
190
- | PackageDiff DiffArgs
191
-
192
-
193
- {-|-}
194
- type alias PackageValidateFlags =
195
- { projectPath : Path
196
- , knownVersions : Array SemanticVersion
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
- }
207
- }
191
+ | PackageDiff PackageDiffFlags
208
192
209
193
210
194
{-|-}
@@ -259,11 +243,36 @@ type DocsOutput
259
243
260
244
261
245
{-|-}
262
- type DiffArgs
263
- = DiffLatest
264
- | DiffVersion SemanticVersion
265
- | DiffRange { lower : SemanticVersion, upper : SemanticVersion }
266
- | DiffGlobal { package : PackageName, lower : SemanticVersion, upper : SemanticVersion }
246
+ type alias PackageValidateFlags =
247
+ { projectPath : Path
248
+ , knownVersions : Array SemanticVersion
249
+ , publishedVersion :
250
+ { outline : Outline
251
+ , rootSources : Dict String String
252
+ , dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
253
+ }
254
+ , currentVersion :
255
+ { outline : Outline
256
+ , rootSources : Dict String String
257
+ , dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
258
+ }
259
+ }
260
+
261
+
262
+ {-|-}
263
+ type alias PackageDiffFlags =
264
+ { projectPath : Path
265
+ , firstPackage :
266
+ { outline : Outline
267
+ , rootSources : Dict String String
268
+ , dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
269
+ }
270
+ , secondPackage :
271
+ { outline : Outline
272
+ , rootSources : Dict String String
273
+ , dependencies : Dict String { outline : Outline.PkgOutline, sources : Dict String String }
274
+ }
275
+ }
267
276
268
277
269
278
{-|-}
@@ -397,33 +406,28 @@ commandEncoder interactive pathToString command =
397
406
}
398
407
]
399
408
400
- PackageDiff args ->
401
- when args is
402
- DiffLatest ->
403
- Json.object
404
- [ { key = "command", value = Json.string "packageDiffLatest" }
405
- ]
406
-
407
- DiffVersion ver ->
408
- Json.object
409
- [ { key = "command", value = Json.string "packageDiffVersion" }
410
- , { key = "version", value = SemanticVersion.toJson ver }
411
- ]
412
-
413
- DiffRange { lower = ver1, upper = ver2 } ->
409
+ PackageDiff flags ->
410
+ Json.object
411
+ [ { key = "command", value = Json.string "packageDiff" }
412
+ , { key = "interactive", value = Json.bool interactive }
413
+ , { key = "project-path", value = Json.string <| pathToString flags.projectPath }
414
+ , { key = "first-package"
415
+ , value =
414
416
Json.object
415
- [ { key = "command ", value = Json.string "packageDiffRange" }
416
- , { key = "from ", value = SemanticVersion.toJson ver1 }
417
- , { key = "to ", value = SemanticVersion.toJson ver2 }
417
+ [ { key = "project-outline ", value = Outline.toJson flags.firstPackage.outline }
418
+ , { key = "sources ", value = Json.dict identity Json.string flags.firstPackage.rootSources }
419
+ , { key = "dependencies ", value = Json.dict identity depsToJson flags.firstPackage.dependencies }
418
420
]
419
-
420
- DiffGlobal { package, lower = ver1, upper = ver2 } ->
421
+ }
422
+ , { key = "second-package"
423
+ , value =
421
424
Json.object
422
- [ { key = "command", value = Json.string "packageDiffGlobal" }
423
- , { key = "package", value = PackageName.toJson package }
424
- , { key = "from", value = SemanticVersion.toJson ver1 }
425
- , { key = "to", value = SemanticVersion.toJson ver2 }
425
+ [ { key = "project-outline", value = Outline.toJson flags.secondPackage.outline }
426
+ , { key = "sources", value = Json.dict identity Json.string flags.secondPackage.rootSources }
427
+ , { key = "dependencies", value = Json.dict identity depsToJson flags.secondPackage.dependencies }
426
428
]
429
+ }
430
+ ]
427
431
428
432
429
433
depsToJson : { outline : Outline.PkgOutline, sources : Dict String String } -> Json.Value
0 commit comments