···
11
11
steps:
12
12
- name: "Install"
13
13
command: "npm ci"
14
14
+
- name: "Check"
15
15
+
command: "npm run check"
14
16
- name: "Build"
15
17
command: "npm run build"
···
25
25
```
26
26
27
27
Os arquivos serão gerados na pasta `dist/`.
28
28
+
29
29
+
`npm run format` formata os arquivos Elm.
···
1
1
{
2
2
"name": "minha-receita-graph",
3
3
-
"version": "1.0.0",
3
3
+
"version": "0.1.0",
4
4
"lockfileVersion": 3,
5
5
"requires": true,
6
6
"packages": {
7
7
"": {
8
8
"name": "minha-receita-graph",
9
9
-
"version": "1.0.0",
9
9
+
"version": "0.1.0",
10
10
"devDependencies": {
11
11
"elm": "^0.19.1-5",
12
12
+
"elm-format": "^0.8.8",
12
13
"elm-live": "^4.0.2"
13
14
}
15
15
+
},
16
16
+
"node_modules/@avh4/elm-format-darwin-arm64": {
17
17
+
"version": "0.8.8-1",
18
18
+
"resolved": "https://registry.npmjs.org/@avh4/elm-format-darwin-arm64/-/elm-format-darwin-arm64-0.8.8-1.tgz",
19
19
+
"integrity": "sha512-VDu3CRajhB/Sax+CEU4PhIzErBZv8vVxbk9Sk8seUHa1ngfICa3Ejoq3PhnoOFKYF1v1sSxNOC2RnUzvd/9bUw==",
20
20
+
"cpu": [
21
21
+
"arm64"
22
22
+
],
23
23
+
"dev": true,
24
24
+
"optional": true,
25
25
+
"os": [
26
26
+
"darwin"
27
27
+
]
28
28
+
},
29
29
+
"node_modules/@avh4/elm-format-darwin-x64": {
30
30
+
"version": "0.8.8-1",
31
31
+
"resolved": "https://registry.npmjs.org/@avh4/elm-format-darwin-x64/-/elm-format-darwin-x64-0.8.8-1.tgz",
32
32
+
"integrity": "sha512-9NAzi3HUBSHEIx3Nje+a6wFcv6RDKv2PO0OUNcV/XlS4Sou3r89xsYAVAXS8mi4+CKTdscyfSSkgGd8qiCCxAw==",
33
33
+
"cpu": [
34
34
+
"x64"
35
35
+
],
36
36
+
"dev": true,
37
37
+
"optional": true,
38
38
+
"os": [
39
39
+
"darwin"
40
40
+
]
41
41
+
},
42
42
+
"node_modules/@avh4/elm-format-linux-arm64": {
43
43
+
"version": "0.8.8-1",
44
44
+
"resolved": "https://registry.npmjs.org/@avh4/elm-format-linux-arm64/-/elm-format-linux-arm64-0.8.8-1.tgz",
45
45
+
"integrity": "sha512-VNuXYphgxtnk7Gw+VBgWBeA9k8wKSo9r/O2F7udgurokYLO8S+RGhLHgD9mb6Yecv/veWz4v9n/O0IggH/BOCQ==",
46
46
+
"cpu": [
47
47
+
"arm64"
48
48
+
],
49
49
+
"dev": true,
50
50
+
"optional": true,
51
51
+
"os": [
52
52
+
"linux"
53
53
+
]
54
54
+
},
55
55
+
"node_modules/@avh4/elm-format-linux-x64": {
56
56
+
"version": "0.8.8-1",
57
57
+
"resolved": "https://registry.npmjs.org/@avh4/elm-format-linux-x64/-/elm-format-linux-x64-0.8.8-1.tgz",
58
58
+
"integrity": "sha512-IvtmUTDw/V5mBeglLgtQMzWZPc0QvmqUmoJ+vipxYii3DJ/1KV2drtpvlLuFdBlFrehUivtrh4HhOTsdGXxyXQ==",
59
59
+
"cpu": [
60
60
+
"x64"
61
61
+
],
62
62
+
"dev": true,
63
63
+
"optional": true,
64
64
+
"os": [
65
65
+
"linux"
66
66
+
]
67
67
+
},
68
68
+
"node_modules/@avh4/elm-format-win32-x64": {
69
69
+
"version": "0.8.8-1",
70
70
+
"resolved": "https://registry.npmjs.org/@avh4/elm-format-win32-x64/-/elm-format-win32-x64-0.8.8-1.tgz",
71
71
+
"integrity": "sha512-qGYZM2oJFSVQ80Tayk1v15ba7PWCU3B89EkA3Fy4YQasvtA+UrYYR5Bv7MRF4kn6Zp7oSDk4FhknURFsZWZ7kg==",
72
72
+
"cpu": [
73
73
+
"x64"
74
74
+
],
75
75
+
"dev": true,
76
76
+
"optional": true,
77
77
+
"os": [
78
78
+
"win32"
79
79
+
]
14
80
},
15
81
"node_modules/ajv": {
16
82
"version": "6.15.0",
···
327
393
},
328
394
"engines": {
329
395
"node": ">=7.0.0"
396
396
+
}
397
397
+
},
398
398
+
"node_modules/elm-format": {
399
399
+
"version": "0.8.8",
400
400
+
"resolved": "https://registry.npmjs.org/elm-format/-/elm-format-0.8.8.tgz",
401
401
+
"integrity": "sha512-OJYUtVnepuy8UZdnL5OCjSxUY5+dIGP2NdWTB6icxVVOOH0b8MpJIijTPsGW+ztnv9yzSoTK0dhCuVDh+AGhNQ==",
402
402
+
"dev": true,
403
403
+
"hasInstallScript": true,
404
404
+
"bin": {
405
405
+
"elm-format": "bin/elm-format"
406
406
+
},
407
407
+
"optionalDependencies": {
408
408
+
"@avh4/elm-format-darwin-arm64": "0.8.8-1",
409
409
+
"@avh4/elm-format-darwin-x64": "0.8.8-1",
410
410
+
"@avh4/elm-format-linux-arm64": "0.8.8-1",
411
411
+
"@avh4/elm-format-linux-x64": "0.8.8-1",
412
412
+
"@avh4/elm-format-win32-x64": "0.8.8-1"
330
413
}
331
414
},
332
415
"node_modules/elm-hot": {
···
6
6
"scripts": {
7
7
"start": "node configure.js && elm-live src/Main.elm --dir=dist --port=${PORT:-8000} -- --output=dist/main.js --debug",
8
8
"build": "node configure.js && elm make src/Main.elm --output=dist/main.js",
9
9
+
"format": "elm-format --yes src/",
10
10
+
"check": "elm-format --validate src/",
9
11
"deploy": "node deploy.js"
10
12
},
11
13
"devDependencies": {
12
14
"elm": "^0.19.1-5",
15
15
+
"elm-format": "^0.8.8",
13
16
"elm-live": "^4.0.2"
14
17
}
15
18
}
···
1
1
module Main exposing (main)
2
2
3
3
import Api
4
4
-
import Format
5
4
import Browser
6
5
import Browser.Dom as Dom
7
6
import Browser.Events
8
7
import Browser.Navigation as Nav
9
8
import Dict exposing (Dict)
9
9
+
import Format
10
10
import Graph
11
11
import Html exposing (Html)
12
12
import Http
···
385
385
in
386
386
case existing.entity of
387
387
Person oldName oldCpf ->
388
388
-
{ existing | entity = Person name (if data.cpf /= Nothing then data.cpf else oldCpf) }
388
388
+
{ existing
389
389
+
| entity =
390
390
+
Person name
391
391
+
(if data.cpf /= Nothing then
392
392
+
data.cpf
393
393
+
394
394
+
else
395
395
+
oldCpf
396
396
+
)
397
397
+
}
389
398
390
399
_ ->
391
400
{ existing | entity = Person name data.cpf }
···
444
453
if partner.name /= Nothing || partner.cpf /= Nothing then
445
454
case existing.entity of
446
455
Person oldName oldCpf ->
447
447
-
{ existing | entity = Person (if partner.name /= Nothing then name else oldName) (if partner.cpf /= Nothing then partner.cpf else oldCpf) }
456
456
+
{ existing
457
457
+
| entity =
458
458
+
Person
459
459
+
(if partner.name /= Nothing then
460
460
+
name
461
461
+
462
462
+
else
463
463
+
oldName
464
464
+
)
465
465
+
(if partner.cpf /= Nothing then
466
466
+
partner.cpf
467
467
+
468
468
+
else
469
469
+
oldCpf
470
470
+
)
471
471
+
}
448
472
449
473
_ ->
450
474
{ existing | entity = entity }
···
1
1
module View exposing (view)
2
2
3
3
import Dict exposing (Dict)
4
4
-
import Html exposing (Html, a, button, div, footer, h1, header, input, label, main_, nav, small, text, ul, li, span)
5
5
-
import Html.Attributes exposing (class, for, id, placeholder, type_, value, attribute, href)
6
6
-
import Html.Events exposing (onClick, onInput, preventDefaultOn, custom)
4
4
+
import Format
5
5
+
import Html exposing (Html, a, button, div, footer, h1, header, input, label, li, main_, nav, small, span, text, ul)
6
6
+
import Html.Attributes exposing (attribute, class, for, href, id, placeholder, type_, value)
7
7
+
import Html.Events exposing (custom, onClick, onInput, preventDefaultOn)
7
8
import Json.Decode as Decode
8
9
import Set exposing (Set)
9
9
-
import Svg exposing (Svg, g, line, svg, text_, circle)
10
10
+
import Svg exposing (Svg, circle, g, line, svg, text_)
10
11
import Svg.Attributes as SA
11
12
import Svg.Events as SE
12
13
import Types exposing (..)
13
13
-
import Format
14
14
15
15
16
16
view : Model -> Html Msg
···
313
313
]
314
314
[ circle
315
315
[ SA.r (String.fromFloat radius)
316
316
-
, SA.class (nodeClass ++ (if isVisited then " visited" else " expandable") ++ (if node.error /= Nothing then " errored" else "") ++ (if isRoot then " root" else ""))
316
316
+
, SA.class
317
317
+
(nodeClass
318
318
+
++ (if isVisited then
319
319
+
" visited"
320
320
+
321
321
+
else
322
322
+
" expandable"
323
323
+
)
324
324
+
++ (if node.error /= Nothing then
325
325
+
" errored"
326
326
+
327
327
+
else
328
328
+
""
329
329
+
)
330
330
+
++ (if isRoot then
331
331
+
" root"
332
332
+
333
333
+
else
334
334
+
""
335
335
+
)
336
336
+
)
317
337
, onNodeMouseDown node
318
338
]
319
339
[]