From d72bd9744a81f94edb9b4e36ea5a5c177dd146e5 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Fri, 19 Jul 2024 09:57:39 -0600 Subject: [PATCH] move Blammo into a subdirectory (#46) --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 18 +++++++++++++++--- Blammo.cabal => Blammo/Blammo.cabal | 0 CHANGELOG.md => Blammo/CHANGELOG.md | 0 LICENSE => Blammo/LICENSE | 0 README.lhs => Blammo/README.lhs | 0 README.md => Blammo/README.md | 0 {files => Blammo/files}/blammo.png | Bin {files => Blammo/files}/example-wide.hs | 0 {files => Blammo/files}/example.hs | 0 {files => Blammo/files}/multiline.png | Bin {files => Blammo/files}/readme-json.png | Bin .../files}/readme-terminal-debug.png | Bin {files => Blammo/files}/readme-terminal.png | Bin package.yaml => Blammo/package.yaml | 0 {src => Blammo/src}/Blammo/Logging.hs | 0 {src => Blammo/src}/Blammo/Logging/Colors.hs | 0 .../src}/Blammo/Logging/Internal/Logger.hs | 0 .../src}/Blammo/Logging/LogSettings.hs | 0 .../src}/Blammo/Logging/LogSettings/Env.hs | 0 .../Blammo/Logging/LogSettings/LogLevels.hs | 0 {src => Blammo/src}/Blammo/Logging/Logger.hs | 0 {src => Blammo/src}/Blammo/Logging/Simple.hs | 0 .../src}/Blammo/Logging/Terminal.hs | 0 .../src}/Blammo/Logging/Terminal/LogPiece.hs | 0 {src => Blammo/src}/Blammo/Logging/Test.hs | 3 ++- .../src}/Blammo/Logging/WithLogger.hs | 0 {src => Blammo/src}/Data/Aeson/Compat.hs | 0 .../src}/Network/Wai/Middleware/Logging.hs | 0 .../src}/System/Log/FastLogger/Compat.hs | 0 .../Blammo/Logging/LogSettings/EnvSpec.hs | 0 .../Logging/LogSettings/LogLevelsSpec.hs | 0 .../tests}/Blammo/Logging/LoggerSpec.hs | 0 .../tests}/Blammo/Logging/TerminalSpec.hs | 0 {tests => Blammo/tests}/Spec.hs | 0 stack-lts-14.27.yaml | 3 +++ stack-lts-16.31.yaml | 3 +++ stack-lts-18.28.yaml | 3 +++ stack-lts-19.33.yaml | 3 +++ stack-nightly.yaml | 3 +++ stack.yaml | 3 +++ 41 files changed, 36 insertions(+), 5 deletions(-) rename Blammo.cabal => Blammo/Blammo.cabal (100%) rename CHANGELOG.md => Blammo/CHANGELOG.md (100%) rename LICENSE => Blammo/LICENSE (100%) rename README.lhs => Blammo/README.lhs (100%) rename README.md => Blammo/README.md (100%) rename {files => Blammo/files}/blammo.png (100%) rename {files => Blammo/files}/example-wide.hs (100%) rename {files => Blammo/files}/example.hs (100%) rename {files => Blammo/files}/multiline.png (100%) rename {files => Blammo/files}/readme-json.png (100%) rename {files => Blammo/files}/readme-terminal-debug.png (100%) rename {files => Blammo/files}/readme-terminal.png (100%) rename package.yaml => Blammo/package.yaml (100%) rename {src => Blammo/src}/Blammo/Logging.hs (100%) rename {src => Blammo/src}/Blammo/Logging/Colors.hs (100%) rename {src => Blammo/src}/Blammo/Logging/Internal/Logger.hs (100%) rename {src => Blammo/src}/Blammo/Logging/LogSettings.hs (100%) rename {src => Blammo/src}/Blammo/Logging/LogSettings/Env.hs (100%) rename {src => Blammo/src}/Blammo/Logging/LogSettings/LogLevels.hs (100%) rename {src => Blammo/src}/Blammo/Logging/Logger.hs (100%) rename {src => Blammo/src}/Blammo/Logging/Simple.hs (100%) rename {src => Blammo/src}/Blammo/Logging/Terminal.hs (100%) rename {src => Blammo/src}/Blammo/Logging/Terminal/LogPiece.hs (100%) rename {src => Blammo/src}/Blammo/Logging/Test.hs (92%) rename {src => Blammo/src}/Blammo/Logging/WithLogger.hs (100%) rename {src => Blammo/src}/Data/Aeson/Compat.hs (100%) rename {src => Blammo/src}/Network/Wai/Middleware/Logging.hs (100%) rename {src => Blammo/src}/System/Log/FastLogger/Compat.hs (100%) rename {tests => Blammo/tests}/Blammo/Logging/LogSettings/EnvSpec.hs (100%) rename {tests => Blammo/tests}/Blammo/Logging/LogSettings/LogLevelsSpec.hs (100%) rename {tests => Blammo/tests}/Blammo/Logging/LoggerSpec.hs (100%) rename {tests => Blammo/tests}/Blammo/Logging/TerminalSpec.hs (100%) rename {tests => Blammo/tests}/Spec.hs (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e926ed3..f103e37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,4 +38,4 @@ jobs: - uses: haskell-actions/hlint-run@v2 with: fail-on: warning - path: '["src/", "tests/"]' + path: '["Blammo/src/", "Blammo/tests/"]' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1dc079..7ea067c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,15 +7,27 @@ on: jobs: release: runs-on: ubuntu-latest + + strategy: + matrix: + package: + - Blammo + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - id: tag uses: freckle/haskell-tag-action@v1 + with: + package-yaml: ${{ matrix.package }}/package.yaml + tag-prefix: ${{ matrix.package }}-v env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: steps.tag.outputs.tag - uses: freckle/stack-upload-action@v2 + run: stack upload --pvp-bounds lower + with: + working-directory: ${{ matrix.package }} env: - HACKAGE_API_KEY: ${{ secrets.HACKAGE_UPLOAD_API_KEY }} + HACKAGE_KEY: ${{ secrets.HACKAGE_UPLOAD_API_KEY }} + STACK_YAML: ../stack-lts-14.27.yaml diff --git a/Blammo.cabal b/Blammo/Blammo.cabal similarity index 100% rename from Blammo.cabal rename to Blammo/Blammo.cabal diff --git a/CHANGELOG.md b/Blammo/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to Blammo/CHANGELOG.md diff --git a/LICENSE b/Blammo/LICENSE similarity index 100% rename from LICENSE rename to Blammo/LICENSE diff --git a/README.lhs b/Blammo/README.lhs similarity index 100% rename from README.lhs rename to Blammo/README.lhs diff --git a/README.md b/Blammo/README.md similarity index 100% rename from README.md rename to Blammo/README.md diff --git a/files/blammo.png b/Blammo/files/blammo.png similarity index 100% rename from files/blammo.png rename to Blammo/files/blammo.png diff --git a/files/example-wide.hs b/Blammo/files/example-wide.hs similarity index 100% rename from files/example-wide.hs rename to Blammo/files/example-wide.hs diff --git a/files/example.hs b/Blammo/files/example.hs similarity index 100% rename from files/example.hs rename to Blammo/files/example.hs diff --git a/files/multiline.png b/Blammo/files/multiline.png similarity index 100% rename from files/multiline.png rename to Blammo/files/multiline.png diff --git a/files/readme-json.png b/Blammo/files/readme-json.png similarity index 100% rename from files/readme-json.png rename to Blammo/files/readme-json.png diff --git a/files/readme-terminal-debug.png b/Blammo/files/readme-terminal-debug.png similarity index 100% rename from files/readme-terminal-debug.png rename to Blammo/files/readme-terminal-debug.png diff --git a/files/readme-terminal.png b/Blammo/files/readme-terminal.png similarity index 100% rename from files/readme-terminal.png rename to Blammo/files/readme-terminal.png diff --git a/package.yaml b/Blammo/package.yaml similarity index 100% rename from package.yaml rename to Blammo/package.yaml diff --git a/src/Blammo/Logging.hs b/Blammo/src/Blammo/Logging.hs similarity index 100% rename from src/Blammo/Logging.hs rename to Blammo/src/Blammo/Logging.hs diff --git a/src/Blammo/Logging/Colors.hs b/Blammo/src/Blammo/Logging/Colors.hs similarity index 100% rename from src/Blammo/Logging/Colors.hs rename to Blammo/src/Blammo/Logging/Colors.hs diff --git a/src/Blammo/Logging/Internal/Logger.hs b/Blammo/src/Blammo/Logging/Internal/Logger.hs similarity index 100% rename from src/Blammo/Logging/Internal/Logger.hs rename to Blammo/src/Blammo/Logging/Internal/Logger.hs diff --git a/src/Blammo/Logging/LogSettings.hs b/Blammo/src/Blammo/Logging/LogSettings.hs similarity index 100% rename from src/Blammo/Logging/LogSettings.hs rename to Blammo/src/Blammo/Logging/LogSettings.hs diff --git a/src/Blammo/Logging/LogSettings/Env.hs b/Blammo/src/Blammo/Logging/LogSettings/Env.hs similarity index 100% rename from src/Blammo/Logging/LogSettings/Env.hs rename to Blammo/src/Blammo/Logging/LogSettings/Env.hs diff --git a/src/Blammo/Logging/LogSettings/LogLevels.hs b/Blammo/src/Blammo/Logging/LogSettings/LogLevels.hs similarity index 100% rename from src/Blammo/Logging/LogSettings/LogLevels.hs rename to Blammo/src/Blammo/Logging/LogSettings/LogLevels.hs diff --git a/src/Blammo/Logging/Logger.hs b/Blammo/src/Blammo/Logging/Logger.hs similarity index 100% rename from src/Blammo/Logging/Logger.hs rename to Blammo/src/Blammo/Logging/Logger.hs diff --git a/src/Blammo/Logging/Simple.hs b/Blammo/src/Blammo/Logging/Simple.hs similarity index 100% rename from src/Blammo/Logging/Simple.hs rename to Blammo/src/Blammo/Logging/Simple.hs diff --git a/src/Blammo/Logging/Terminal.hs b/Blammo/src/Blammo/Logging/Terminal.hs similarity index 100% rename from src/Blammo/Logging/Terminal.hs rename to Blammo/src/Blammo/Logging/Terminal.hs diff --git a/src/Blammo/Logging/Terminal/LogPiece.hs b/Blammo/src/Blammo/Logging/Terminal/LogPiece.hs similarity index 100% rename from src/Blammo/Logging/Terminal/LogPiece.hs rename to Blammo/src/Blammo/Logging/Terminal/LogPiece.hs diff --git a/src/Blammo/Logging/Test.hs b/Blammo/src/Blammo/Logging/Test.hs similarity index 92% rename from src/Blammo/Logging/Test.hs rename to Blammo/src/Blammo/Logging/Test.hs index 56c46b6..b9007c9 100644 --- a/src/Blammo/Logging/Test.hs +++ b/Blammo/src/Blammo/Logging/Test.hs @@ -33,6 +33,7 @@ appendLogStr (LoggedMessages ref) str = appendLogStrLn :: MonadIO m => LoggedMessages -> LogStr -> m () appendLogStrLn lm = appendLogStr lm . (<> "\n") -getLoggedMessages :: MonadIO m => LoggedMessages -> m [Either String LoggedMessage] +getLoggedMessages + :: MonadIO m => LoggedMessages -> m [Either String LoggedMessage] getLoggedMessages (LoggedMessages ref) = map (eitherDecodeStrict . fromLogStr) . DList.toList <$> readIORef ref diff --git a/src/Blammo/Logging/WithLogger.hs b/Blammo/src/Blammo/Logging/WithLogger.hs similarity index 100% rename from src/Blammo/Logging/WithLogger.hs rename to Blammo/src/Blammo/Logging/WithLogger.hs diff --git a/src/Data/Aeson/Compat.hs b/Blammo/src/Data/Aeson/Compat.hs similarity index 100% rename from src/Data/Aeson/Compat.hs rename to Blammo/src/Data/Aeson/Compat.hs diff --git a/src/Network/Wai/Middleware/Logging.hs b/Blammo/src/Network/Wai/Middleware/Logging.hs similarity index 100% rename from src/Network/Wai/Middleware/Logging.hs rename to Blammo/src/Network/Wai/Middleware/Logging.hs diff --git a/src/System/Log/FastLogger/Compat.hs b/Blammo/src/System/Log/FastLogger/Compat.hs similarity index 100% rename from src/System/Log/FastLogger/Compat.hs rename to Blammo/src/System/Log/FastLogger/Compat.hs diff --git a/tests/Blammo/Logging/LogSettings/EnvSpec.hs b/Blammo/tests/Blammo/Logging/LogSettings/EnvSpec.hs similarity index 100% rename from tests/Blammo/Logging/LogSettings/EnvSpec.hs rename to Blammo/tests/Blammo/Logging/LogSettings/EnvSpec.hs diff --git a/tests/Blammo/Logging/LogSettings/LogLevelsSpec.hs b/Blammo/tests/Blammo/Logging/LogSettings/LogLevelsSpec.hs similarity index 100% rename from tests/Blammo/Logging/LogSettings/LogLevelsSpec.hs rename to Blammo/tests/Blammo/Logging/LogSettings/LogLevelsSpec.hs diff --git a/tests/Blammo/Logging/LoggerSpec.hs b/Blammo/tests/Blammo/Logging/LoggerSpec.hs similarity index 100% rename from tests/Blammo/Logging/LoggerSpec.hs rename to Blammo/tests/Blammo/Logging/LoggerSpec.hs diff --git a/tests/Blammo/Logging/TerminalSpec.hs b/Blammo/tests/Blammo/Logging/TerminalSpec.hs similarity index 100% rename from tests/Blammo/Logging/TerminalSpec.hs rename to Blammo/tests/Blammo/Logging/TerminalSpec.hs diff --git a/tests/Spec.hs b/Blammo/tests/Spec.hs similarity index 100% rename from tests/Spec.hs rename to Blammo/tests/Spec.hs diff --git a/stack-lts-14.27.yaml b/stack-lts-14.27.yaml index 1fa1040..dadaea7 100644 --- a/stack-lts-14.27.yaml +++ b/stack-lts-14.27.yaml @@ -13,3 +13,6 @@ extra-deps: - hspec-discover-2.7.9 - primitive-0.7.4.0 - these-1.1 + +packages: + - Blammo diff --git a/stack-lts-16.31.yaml b/stack-lts-16.31.yaml index 699a013..d38865c 100644 --- a/stack-lts-16.31.yaml +++ b/stack-lts-16.31.yaml @@ -6,3 +6,6 @@ extra-deps: - monad-logger-0.3.39 - monad-logger-aeson-0.4.0.3 - context-0.2.0.0 + +packages: + - Blammo diff --git a/stack-lts-18.28.yaml b/stack-lts-18.28.yaml index 99399eb..d032620 100644 --- a/stack-lts-18.28.yaml +++ b/stack-lts-18.28.yaml @@ -4,3 +4,6 @@ extra-deps: - monad-logger-0.3.39 - monad-logger-aeson-0.4.0.3 - context-0.2.0.0 + +packages: + - Blammo diff --git a/stack-lts-19.33.yaml b/stack-lts-19.33.yaml index 1547da5..5ea02fc 100644 --- a/stack-lts-19.33.yaml +++ b/stack-lts-19.33.yaml @@ -4,3 +4,6 @@ extra-deps: - monad-logger-0.3.39 - monad-logger-aeson-0.4.0.3 - context-0.2.0.1 + +packages: + - Blammo diff --git a/stack-nightly.yaml b/stack-nightly.yaml index c1f9979..e69bf39 100644 --- a/stack-nightly.yaml +++ b/stack-nightly.yaml @@ -5,3 +5,6 @@ extra-deps: allow-newer: true allow-newer-deps: - monad-logger-aeson + +packages: + - Blammo diff --git a/stack.yaml b/stack.yaml index 4abbef3..2eb4a76 100644 --- a/stack.yaml +++ b/stack.yaml @@ -6,3 +6,6 @@ extra-deps: allow-newer: true allow-newer-deps: - monad-logger-aeson + +packages: + - Blammo