Skip to content

Commit b0278ce

Browse files
authored
Merge pull request #220 from wolfadex/create-elm-package
Create a separate elm.json for the CLI and package
2 parents fe96f24 + 44bb562 commit b0278ce

38 files changed

+201
-96
lines changed

cli/elm.json

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"type": "application",
3+
"source-directories": [
4+
"src",
5+
"../src",
6+
"../codegen"
7+
],
8+
"elm-version": "0.19.1",
9+
"dependencies": {
10+
"direct": {
11+
"dillonkearns/elm-cli-options-parser": "3.2.0",
12+
"dillonkearns/elm-pages": "10.2.2",
13+
"elm/bytes": "1.0.8",
14+
"elm/core": "1.0.5",
15+
"elm/json": "1.1.3",
16+
"elm/regex": "1.0.0",
17+
"elm/url": "1.0.0",
18+
"elmcraft/core-extra": "2.2.0",
19+
"json-tools/json-schema": "1.0.2",
20+
"json-tools/json-value": "1.0.1",
21+
"mdgriffith/elm-codegen": "5.2.0",
22+
"miniBill/elm-fast-dict": "1.2.4",
23+
"myrho/yaml": "1.0.0",
24+
"turboMaCk/non-empty-list-alias": "1.4.0",
25+
"wolfadex/elm-ansi": "3.0.0",
26+
"wolfadex/elm-open-api": "2.0.0"
27+
},
28+
"indirect": {
29+
"Chadtech/elm-bool-extra": "2.4.2",
30+
"NoRedInk/elm-json-decode-pipeline": "1.0.1",
31+
"avh4/elm-color": "1.0.0",
32+
"danfishgold/base64-bytes": "1.1.0",
33+
"danyx23/elm-mimetype": "4.0.1",
34+
"dillonkearns/elm-bcp47-language-tag": "2.0.0",
35+
"dillonkearns/elm-date-or-date-time": "2.0.0",
36+
"dillonkearns/elm-form": "3.0.1",
37+
"dividat/elm-semver": "2.0.0",
38+
"elm/browser": "1.0.2",
39+
"elm/file": "1.0.5",
40+
"elm/html": "1.0.0",
41+
"elm/http": "2.0.0",
42+
"elm/parser": "1.1.0",
43+
"elm/random": "1.0.0",
44+
"elm/time": "1.0.0",
45+
"elm/virtual-dom": "1.0.4",
46+
"elm-community/basics-extra": "4.1.0",
47+
"elm-community/json-extra": "4.3.0",
48+
"elm-community/list-extra": "8.7.0",
49+
"elm-community/maybe-extra": "5.3.0",
50+
"fredcy/elm-parseint": "2.0.1",
51+
"jluckyiv/elm-utc-date-strings": "1.0.0",
52+
"justinmimbs/date": "4.1.0",
53+
"miniBill/elm-codec": "2.3.0",
54+
"miniBill/elm-unicode": "1.1.1",
55+
"myrho/elm-parser-extras": "1.0.1",
56+
"noahzgordon/elm-color-extra": "1.0.2",
57+
"robinheghan/fnv1a": "1.0.0",
58+
"robinheghan/murmur3": "1.0.0",
59+
"rtfeldman/elm-css": "18.0.0",
60+
"rtfeldman/elm-hex": "1.0.0",
61+
"rtfeldman/elm-iso8601-date-strings": "1.1.4",
62+
"stil4m/elm-syntax": "7.3.9",
63+
"stil4m/structured-writer": "1.0.3",
64+
"the-sett/elm-pretty-printer": "3.1.2",
65+
"the-sett/elm-syntax-dsl": "6.0.3",
66+
"zwilias/elm-utf-tools": "2.0.1"
67+
}
68+
},
69+
"test-dependencies": {
70+
"direct": {},
71+
"indirect": {}
72+
}
73+
}
File renamed without changes.

cli/src/TestGenScript.elm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,4 @@ run =
116116
, Pages.Script.exec "sh"
117117
[ "-c", "cd example && npx --no -- elm make src/Example.elm --output=/dev/null" ]
118118
]
119-
|> BackendTask.inDir "cli"
120119
)

elm.json

Lines changed: 21 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,28 @@
11
{
2-
"type": "application",
3-
"source-directories": [
4-
"src",
5-
"codegen",
6-
"cli/src"
2+
"type": "package",
3+
"name": "wolfadex/elm-open-api-cli",
4+
"summary": "A CLI tool for generating Elm modules from Open API specs. ",
5+
"license": "MIT",
6+
"version": "1.0.0",
7+
"exposed-modules": [
8+
"OpenApi.Config",
9+
"OpenApi.Generate"
710
],
8-
"elm-version": "0.19.1",
11+
"elm-version": "0.19.0 <= v < 0.20.0",
912
"dependencies": {
10-
"direct": {
11-
"dillonkearns/elm-cli-options-parser": "3.2.0",
12-
"dillonkearns/elm-pages": "10.2.0",
13-
"elm/core": "1.0.5",
14-
"elm/json": "1.1.3",
15-
"elm/regex": "1.0.0",
16-
"elm/url": "1.0.0",
17-
"elmcraft/core-extra": "2.1.0",
18-
"json-tools/json-schema": "1.0.2",
19-
"json-tools/json-value": "1.0.1",
20-
"mdgriffith/elm-codegen": "5.2.0",
21-
"miniBill/elm-fast-dict": "1.2.1",
22-
"myrho/yaml": "1.0.0",
23-
"turboMaCk/non-empty-list-alias": "1.4.0",
24-
"wolfadex/elm-ansi": "3.0.0",
25-
"wolfadex/elm-open-api": "2.0.0"
26-
},
27-
"indirect": {
28-
"Chadtech/elm-bool-extra": "2.4.2",
29-
"NoRedInk/elm-json-decode-pipeline": "1.0.1",
30-
"avh4/elm-color": "1.0.0",
31-
"danfishgold/base64-bytes": "1.1.0",
32-
"danyx23/elm-mimetype": "4.0.1",
33-
"dillonkearns/elm-bcp47-language-tag": "2.0.0",
34-
"dillonkearns/elm-date-or-date-time": "2.0.0",
35-
"dillonkearns/elm-form": "3.0.1",
36-
"dividat/elm-semver": "2.0.0",
37-
"elm/browser": "1.0.2",
38-
"elm/bytes": "1.0.8",
39-
"elm/file": "1.0.5",
40-
"elm/html": "1.0.0",
41-
"elm/http": "2.0.0",
42-
"elm/parser": "1.1.0",
43-
"elm/random": "1.0.0",
44-
"elm/time": "1.0.0",
45-
"elm/virtual-dom": "1.0.3",
46-
"elm-community/basics-extra": "4.1.0",
47-
"elm-community/json-extra": "4.3.0",
48-
"elm-community/list-extra": "8.7.0",
49-
"elm-community/maybe-extra": "5.3.0",
50-
"fredcy/elm-parseint": "2.0.1",
51-
"jluckyiv/elm-utc-date-strings": "1.0.0",
52-
"justinmimbs/date": "4.1.0",
53-
"miniBill/elm-codec": "2.2.0",
54-
"miniBill/elm-unicode": "1.1.1",
55-
"myrho/elm-parser-extras": "1.0.1",
56-
"noahzgordon/elm-color-extra": "1.0.2",
57-
"robinheghan/fnv1a": "1.0.0",
58-
"robinheghan/murmur3": "1.0.0",
59-
"rtfeldman/elm-css": "18.0.0",
60-
"rtfeldman/elm-hex": "1.0.0",
61-
"rtfeldman/elm-iso8601-date-strings": "1.1.4",
62-
"stil4m/elm-syntax": "7.3.8",
63-
"stil4m/structured-writer": "1.0.3",
64-
"the-sett/elm-pretty-printer": "3.1.0",
65-
"the-sett/elm-syntax-dsl": "6.0.3",
66-
"zwilias/elm-utf-tools": "2.0.1"
67-
}
13+
"elm/core": "1.0.0 <= v < 2.0.0",
14+
"elm/json": "1.1.3 <= v < 2.0.0",
15+
"elm/regex": "1.0.0 <= v < 2.0.0",
16+
"elm/url": "1.0.0 <= v < 2.0.0",
17+
"elmcraft/core-extra": "2.2.0 <= v < 3.0.0",
18+
"json-tools/json-schema": "1.0.0 <= v < 2.0.0",
19+
"mdgriffith/elm-codegen": "5.2.0 <= v < 6.0.0",
20+
"miniBill/elm-fast-dict": "1.2.0 <= v < 2.0.0",
21+
"turboMaCk/non-empty-list-alias": "1.4.0 <= v < 2.0.0",
22+
"wolfadex/elm-open-api": "2.0.0 <= v < 3.0.0"
6823
},
6924
"test-dependencies": {
70-
"direct": {
71-
"elm-explorations/test": "2.2.0",
72-
"miniBill/elm-unicode": "1.1.1"
73-
},
74-
"indirect": {}
25+
"elm-explorations/test": "2.2.0 <= v < 3.0.0",
26+
"miniBill/elm-unicode": "1.1.1 <= v < 2.0.0"
7527
}
7628
}

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
"bin": "dist/elm-open-api.js",
77
"type": "module",
88
"scripts": {
9-
"dev": "elm-pages run src/Cli.elm",
10-
"build": "elm-pages bundle-script src/Cli.elm --output dist/elm-open-api.js --debug",
9+
"dev": "cd cli && elm-pages run src/Cli.elm",
10+
"docs": "elm make --docs=docs.json",
11+
"build": "cd cli && elm-pages bundle-script src/Cli.elm --output ../dist/elm-open-api.js --debug",
1112
"review": "elm-review",
1213
"review:watch": "elm-review --watch --fix",
1314
"format": "elm-format src tests --validate",
1415
"test": "elm-test",
15-
"test:gen": "elm-pages run cli/src/TestGenScript.elm",
16+
"test:gen": "cd cli && elm-pages run src/TestGenScript.elm",
1617
"test:watch": "elm-test --watch",
1718
"pub": "npm run build && npm publish"
1819
},

review/src/ReviewConfig.elm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ exceptCodegenRules =
5252
, NoExposingEverything.rule
5353
, NoImportingEverything.rule []
5454
, NoMissingTypeAnnotation.rule
55+
|> Rule.ignoreErrorsForDirectories [ "src/Gen" ]
5556
, NoMissingTypeAnnotationInLetIn.rule
5657
, NoMissingTypeExpose.rule
5758
, NoSimpleLetBody.rule
@@ -73,9 +74,9 @@ includingCodegenRules : List Rule
7374
includingCodegenRules =
7475
[ NoUnused.Exports.rule
7576
|> Rule.ignoreErrorsForFiles
76-
[ "src/Cli.elm"
77+
[ "cli/src/Cli.elm"
7778
, "src/OpenApi/Config.elm"
78-
, "src/TestGenScript.elm"
79+
, "cli/src/TestGenScript.elm"
7980
]
8081
, NoUnused.Variables.rule
8182
]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": 1,
3+
"automatically created by": "elm-review suppress",
4+
"learn more": "elm-review suppress --help",
5+
"suppressions": [
6+
{ "count": 33, "filePath": "src/OpenApi/Config.elm" },
7+
{ "count": 6, "filePath": "src/OpenApi/Generate.elm" }
8+
]
9+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": 1,
3+
"automatically created by": "elm-review suppress",
4+
"learn more": "elm-review suppress --help",
5+
"suppressions": [
6+
{ "count": 3, "filePath": "src/Gen/BackendTask/Http.elm" },
7+
{ "count": 3, "filePath": "src/Gen/Dict.elm" },
8+
{ "count": 3, "filePath": "src/Gen/Http.elm" },
9+
{ "count": 3, "filePath": "src/Gen/Result.elm" },
10+
{ "count": 2, "filePath": "src/Gen/BackendTask.elm" },
11+
{ "count": 2, "filePath": "src/Gen/List.elm" },
12+
{ "count": 2, "filePath": "src/Gen/Task.elm" }
13+
]
14+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": 1,
3+
"automatically created by": "elm-review suppress",
4+
"learn more": "elm-review suppress --help",
5+
"suppressions": [
6+
{ "count": 4, "filePath": "src/OpenApi/Config.elm" },
7+
{ "count": 1, "filePath": "src/OpenApi/Generate.elm" }
8+
]
9+
}

review/suppressed/NoUnused.Exports.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"automatically created by": "elm-review suppress",
44
"learn more": "elm-review suppress --help",
55
"suppressions": [
6-
{ "count": 1, "filePath": "cli/src/TestGenScript.elm" }
6+
{ "count": 1, "filePath": "src/BackendTask/Extra.elm" },
7+
{ "count": 1, "filePath": "src/OpenApi/Common/Internal.elm" }
78
]
89
}

0 commit comments

Comments
 (0)