Skip to content

Commit

Permalink
Stop vendoring JSON3 and StructTypes (#108)
Browse files Browse the repository at this point in the history
* Stop vendoring JSON3 and StructTypes

* Fix CI

* Fix the docs build
  • Loading branch information
DilumAluthge authored Feb 19, 2021
1 parent 3748b6b commit 0658bdf
Show file tree
Hide file tree
Showing 50 changed files with 45 additions and 5,288 deletions.
4 changes: 2 additions & 2 deletions .ci/generate/develop.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Pkg
import Pkg

Pkg.activate(@__DIR__)

devpkgs = [
PackageSpec(path = joinpath(dirname(dirname(@__DIR__)), "Generate")),
Pkg.PackageSpec(path = joinpath(dirname(dirname(@__DIR__)), "Generate")),
]

Pkg.develop(devpkgs)
Expand Down
2 changes: 1 addition & 1 deletion .ci/generate/generate.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Generate
import Generate

fhir_versions = [:R4]

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
run: julia -e 'import Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
run: julia -e 'import CompatHelper; CompatHelper.main()'
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
with:
# version: '1'
version: '1.5.1'
- run: julia --color=yes -e 'using Pkg; VERSION >= v"1.5-" && !isdir(joinpath(DEPOT_PATH[1], "registries", "General")) && Pkg.Registry.add("General")'
- run: julia --color=yes -e 'import Pkg; VERSION >= v"1.5-" && !isdir(joinpath(DEPOT_PATH[1], "registries", "General")) && Pkg.Registry.add("General")'
shell: bash
env:
# We set `JULIA_PKG_SERVER` only for this step to enforce
Expand All @@ -72,16 +72,16 @@ jobs:
- run: julia --project=docs docs/develop.jl
- run: |
julia --project=docs -e '
using Documenter: doctest
using FHIRClient
using Generate
doctest(FHIRClient)'
import Documenter
import FHIRClient
import Generate
Documenter.doctest(FHIRClient)'
- run: |
julia --project=docs -e '
using Documenter: doctest
using FHIRClient
using Generate
doctest(Generate; manual = joinpath(pwd(), "docs", "src"))'
import Documenter
import FHIRClient
import Generate
Documenter.doctest(Generate; manual = joinpath(pwd(), "docs", "src"))'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 4 additions & 6 deletions Generate/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ uuid = "ff303c0d-e9c7-476c-bf3b-b5f85c44159a"
[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
# JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
# StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

[compat]
# JSON3 = "1.4"
Parsers = "1"
# StructTypes = "1"
JSON3 = "1.5.1"
StructTypes = "1.2.3"
ZipFile = "0.9.3"
10 changes: 2 additions & 8 deletions Generate/src/Generate.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
module Generate

include(joinpath(dirname(dirname(@__DIR__)), "vendored", "StructTypes.jl", "src", "StructTypes.jl"))
import .StructTypes
import Parsers
include(joinpath(dirname(dirname(@__DIR__)), "vendored", "JSON3.jl", "src", "JSON3.jl"))
import .JSON3

import Downloads
import .JSON3
import .StructTypes
import JSON3
import StructTypes
import ZipFile

export download_fhir_json_schema
Expand Down
3 changes: 0 additions & 3 deletions Generate/src/download.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import Downloads
import ZipFile

"""
download_fhir_json_schema(url::AbstractString)
Expand Down
9 changes: 0 additions & 9 deletions Generate/src/generate-fhir-types.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import .JSON3

const preamble = """
import Dates
import .JSON3
import SaferIntegers
# import StructTypes
import .StructTypes
import TimeZones
abstract type AbstractFHIRType
end
Expand Down
8 changes: 5 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
name = "FHIRClient"
uuid = "b44d2ca2-8176-4fa9-8684-826e17b2a2da"
authors = ["Dilum Aluthge", "Rhode Island Quality Institute", "contributors"]
version = "0.7.6"
version = "1.0.0-DEV"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
SaferIntegers = "88634af6-177f-5301-88b8-7819386cfa38"
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
HTTP = "0.8.19, 0.9"
Parsers = "1"
JSON3 = "1.5.1"
SaferIntegers = "2.5.1"
StructTypes = "1.2.3"
TimeZones = "1.5.2"
julia = "1.4"

Expand Down
6 changes: 3 additions & 3 deletions docs/develop.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Pkg
import Pkg

Pkg.activate(@__DIR__)

devpkgs = [
PackageSpec(path = dirname(@__DIR__)),
PackageSpec(path = joinpath(dirname(@__DIR__), "Generate")),
Pkg.PackageSpec(path = dirname(@__DIR__)),
Pkg.PackageSpec(path = joinpath(dirname(@__DIR__), "Generate")),
]

Pkg.develop(devpkgs)
Expand Down
12 changes: 6 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using FHIRClient
using Generate
using Documenter
import FHIRClient
import Generate
import Documenter

makedocs(;
Documenter.makedocs(;
modules=[FHIRClient, Generate],
authors="Dilum Aluthge, Rhode Island Quality Institute, and contributors",
repo="https://github.com/JuliaHealth/FHIRClient.jl/blob/{commit}{path}#L{line}",
sitename="FHIRClient.jl",
format=Documenter.HTML(;
format=Documenter.Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://JuliaHealth.github.io/FHIRClient.jl",
assets=String[],
Expand All @@ -22,6 +22,6 @@ makedocs(;
strict=true,
)

deploydocs(;
Documenter.deploydocs(;
repo="github.com/JuliaHealth/FHIRClient.jl",
)
12 changes: 2 additions & 10 deletions src/FHIRClient.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
module FHIRClient

include(joinpath(dirname(@__DIR__), "vendored", "StructTypes.jl", "src", "StructTypes.jl"))
import .StructTypes
import Parsers
include(joinpath(dirname(@__DIR__), "vendored", "JSON3.jl", "src", "JSON3.jl"))
import .JSON3

import Base64
import Dates
import HTTP
# import JSON3
import .JSON3
import JSON3
import SaferIntegers
# import StructTypes
import .StructTypes
import StructTypes
import TimeZones

include("types.jl")
Expand Down
7 changes: 0 additions & 7 deletions src/autogenerated/autogenerated-R4.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import Dates
import .JSON3
import SaferIntegers
# import StructTypes
import .StructTypes
import TimeZones

abstract type AbstractFHIRType
end

Expand Down
2 changes: 0 additions & 2 deletions src/headers.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Base64

function json_headers!(headers::AbstractDict)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
Expand Down
13 changes: 8 additions & 5 deletions src/r4.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import .JSON3
import .StructTypes

"""
FHIR version R4.
Expand All @@ -11,7 +8,13 @@ struct R4 <: FHIRVersion
end

module R4Types
import ..JSON3
import ..StructTypes

import Dates
import JSON3
import SaferIntegers
import StructTypes
import TimeZones

include("autogenerated/autogenerated-R4.jl")

end # end module R4Types
4 changes: 0 additions & 4 deletions src/requests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import HTTP
# import JSON3
import .JSON3

@inline function _request_http(verb::AbstractString,
full_url::HTTP.URI,
headers::AbstractDict,
Expand Down
2 changes: 0 additions & 2 deletions src/types.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import HTTP

"""
Supertype of the various authentication types.
Expand Down
7 changes: 1 addition & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ using Test

import Dates
import HTTP
# import JSON3
import JSON3
import Test

const JSON3 = FHIRClient.JSON3

import Dates
import .JSON3

@testset "FHIRClient.jl" begin
include("unit.jl")
include("integration.jl")
Expand Down
11 changes: 0 additions & 11 deletions vendored/JSON3.jl/.github/workflows/TagBot.yml

This file was deleted.

68 changes: 0 additions & 68 deletions vendored/JSON3.jl/.github/workflows/ci.yml

This file was deleted.

7 changes: 0 additions & 7 deletions vendored/JSON3.jl/.gitignore

This file was deleted.

22 changes: 0 additions & 22 deletions vendored/JSON3.jl/LICENSE.md

This file was deleted.

Loading

0 comments on commit 0658bdf

Please sign in to comment.