Skip to content

Commit

Permalink
Fix references to Month.
Browse files Browse the repository at this point in the history
  • Loading branch information
AttilaMihaly committed Oct 31, 2023
1 parent e6c7bda commit 3e5640d
Show file tree
Hide file tree
Showing 8 changed files with 242 additions and 69 deletions.
292 changes: 235 additions & 57 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
},
"homepage": "https://github.com/Morgan-Stanley/morphir-elm#readme",
"devDependencies": {
"@morphir/typespec-sdk": "file:redistributable/TypeSpec/sdk",
"@types/inquirer": "^9.0.3",
"@types/jest": "^27.4.0",
"@types/mocha": "^9.0.0",
Expand All @@ -90,7 +91,6 @@
"typescript": "^4.4.3"
},
"dependencies": {
"@morphir/typespec-sdk": "^0.1.0",
"ajv": "^8.10.0",
"ajv-formats": "^2.1.1",
"chalk": "^4.1.1",
Expand Down
5 changes: 1 addition & 4 deletions redistributable/TypeSpec/sdk/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@ namespace Decimal {

namespace LocalDate {
scalar LocalDate extends plainDate;
scalar Month extends string;
}

namespace LocalTime {
scalar LocalTime extends plainTime;
}

namespace Month {
scalar Month extends string;
}


// Optional Types
namespace Maybe {
Expand Down
2 changes: 1 addition & 1 deletion src/Morphir/JsonSchema/Backend.elm
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ mapType qName typ =
( "Morphir.SDK:LocalTime:localTime", [] ) ->
Ok (String (StringConstraints (Just "time")))

( "Morphir.SDK:Month:month", [] ) ->
( "Morphir.SDK:LocalDate:month", [] ) ->
Ok
(OneOf
[ Const "January"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module TestModel.AdvancedTypes exposing (..)

import Morphir.SDK.Decimal exposing (..)
import Morphir.SDK.LocalDate exposing (LocalDate)
import Morphir.SDK.LocalDate exposing (LocalDate, Month)
import Morphir.SDK.LocalTime exposing (LocalTime)
import Morphir.SDK.Month exposing (Month)

import TestModel.BasicTypes exposing (..)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module TestModel.CustomTypes exposing (..)

import TestModel.AdvancedTypes exposing (Score)
import Morphir.SDK.Month exposing (Month)
import Morphir.SDK.LocalDate exposing (Month)


type PersonalData
Expand Down
2 changes: 1 addition & 1 deletion tests-integration/typespec/model/elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"direct": {
"elm/browser": "1.0.2",
"elm/core": "1.0.5",
"elm/time": "1.0.0",
"elm/html": "1.0.0"
},
"indirect": {
"elm/json": "1.1.3",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.3"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module TestModel.AdvancedTypes exposing (..)

import Morphir.SDK.Decimal exposing (Decimal)
import Morphir.SDK.LocalDate exposing (LocalDate)
import Morphir.SDK.LocalDate exposing (LocalDate, Month)
import Morphir.SDK.LocalTime exposing (LocalTime)
import Morphir.SDK.Month exposing (Month)


type alias Price =
Expand Down

0 comments on commit 3e5640d

Please sign in to comment.