fields-and-cases 0.1.0.0 → 0.2.0.0
raw patch · 4 files changed
+44/−27 lines, 4 filesdep −limadep ~basePVP ok
version bump matches the API change (PVP)
Dependencies removed: lima
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−1
- fields-and-cases.cabal +5/−6
- tests/Readme.hs +15/−0
- tests/test.hs +19/−20
CHANGELOG.md view
@@ -1,4 +1,8 @@-# Revision history for haskell-codegen+# Revision history for fields-and-cases++## 0.2.0.0 -- 2024-08-16++* Support stackage ## 0.1.0.0 -- 2024-07-12
fields-and-cases.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: fields-and-cases-version: 0.1.0.0+version: 0.2.0.0 synopsis: Codegen Haskell types to other languages description: This package provides a way to generate code for other languages from Haskell types.@@ -52,9 +52,9 @@ import: common-opts exposed-modules: FieldsAndCases build-depends:- , base ^>=4.17.2.0- , relude >=1.2.1 && <1.3- , string-conversions >=0.4.0 && <0.5+ , base >=4.17.2.0 && <4.20+ , relude >=1.2.1 && <1.3+ , string-conversions >=0.4.0 && <0.5 hs-source-dirs: lib @@ -68,9 +68,8 @@ hs-source-dirs: tests main-is: test.hs build-depends:- , base ^>=4.17.2.0+ , base , fields-and-cases- , lima , process , regex-compat , relude
tests/Readme.hs view
@@ -386,3 +386,18 @@ let filePath = "tests/outputs/demo.ts" writeFile filePath (toString codeTypeScript) callCommand ("npx prettier --write " <> filePath)+++---++class Print a where+ print :: a -> Text+ default print :: Generic a => a -> Text+ print = undefined+++instance Print Text where+ print = id++instance Print Int where+ print = show
tests/test.hs view
@@ -6,7 +6,7 @@ import Data.Text (replace) import GHC.Generics import qualified GHC.Generics as GHC-import Lima.Converter (Format (..), convertTo, def)+--import Lima.Converter (Format (..), convertTo, def) import qualified Readme import Relude import Spec (unitTests)@@ -16,33 +16,32 @@ main :: IO () main = do- genReadme defaultMain tests -genReadme :: IO ()-genReadme = do- readmeMd <- readFileBS "README.md"+-- genReadme :: IO ()+-- genReadme = do+-- readmeMd <- readFileBS "README.md" - readmeHs <- readFileBS "tests/Readme.hs"+-- readmeHs <- readFileBS "tests/Readme.hs" - let readmeExample = convertTo Hs Md def (cs readmeHs)+-- let readmeExample = convertTo Hs Md def (cs readmeHs) - Readme.main+-- Readme.main - readmeOutputRust <- readFileBS "tests/outputs/demo.rs"- readmeOutputTypeScript <- readFileBS "tests/outputs/demo.ts"+-- readmeOutputRust <- readFileBS "tests/outputs/demo.rs"+-- readmeOutputTypeScript <- readFileBS "tests/outputs/demo.ts" - let readmeMd' =- cs readmeMd- & replaceSection "example" readmeExample- & replaceSection- "exampleOutRust"- ("```rust\n" <> cs readmeOutputRust <> "\n```")- & replaceSection- "exampleOutTypeScript"- ("```ts\n" <> cs readmeOutputTypeScript <> "\n```")+-- let readmeMd' =+-- cs readmeMd+-- & replaceSection "example" readmeExample+-- & replaceSection+-- "exampleOutRust"+-- ("```rust\n" <> cs readmeOutputRust <> "\n```")+-- & replaceSection+-- "exampleOutTypeScript"+-- ("```ts\n" <> cs readmeOutputTypeScript <> "\n```") - writeFileBS "README.md" (cs readmeMd')+-- writeFileBS "README.md" (cs readmeMd') tests :: TestTree tests = testGroup "Tests" [unitTests]