From ef9c317fd84c1175146a79d89c59a41801021a3c Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Fri, 26 May 2023 15:18:56 -0400 Subject: [PATCH 1/2] refactor(utils): use deno config and bump deps --- packages/utils/deep-swap.js | 2 +- packages/utils/deno.jsonc | 12 ++++++++++++ packages/utils/dev_deps.js | 2 +- packages/utils/hyper-err.js | 4 ++-- packages/utils/scripts/test.sh | 1 - 5 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 packages/utils/deno.jsonc delete mode 100755 packages/utils/scripts/test.sh diff --git a/packages/utils/deep-swap.js b/packages/utils/deep-swap.js index 84365f76..0a8ff10f 100644 --- a/packages/utils/deep-swap.js +++ b/packages/utils/deep-swap.js @@ -1,4 +1,4 @@ -import * as R from 'https://cdn.skypack.dev/ramda@0.28.0' +import * as R from 'https://cdn.skypack.dev/ramda@0.29.0' const { curry, diff --git a/packages/utils/deno.jsonc b/packages/utils/deno.jsonc new file mode 100644 index 00000000..26d6ffc2 --- /dev/null +++ b/packages/utils/deno.jsonc @@ -0,0 +1,12 @@ +{ + "tasks": { + "test": "deno lint && deno fmt --check && deno test --no-check" + }, + "fmt": { + "include": ["./"], + "lineWidth": 100, + "singleQuote": true, + "semiColons": false + }, + "lock": false +} diff --git a/packages/utils/dev_deps.js b/packages/utils/dev_deps.js index 24cc0857..623d44f9 100644 --- a/packages/utils/dev_deps.js +++ b/packages/utils/dev_deps.js @@ -2,4 +2,4 @@ export { assert, assertEquals, assertThrows, -} from 'https://deno.land/std@0.128.0/testing/asserts.ts' +} from 'https://deno.land/std@0.188.0/testing/asserts.ts' diff --git a/packages/utils/hyper-err.js b/packages/utils/hyper-err.js index 6b59b98c..2d1844d3 100644 --- a/packages/utils/hyper-err.js +++ b/packages/utils/hyper-err.js @@ -1,4 +1,4 @@ -import * as R from 'https://cdn.skypack.dev/ramda@0.28.0' +import * as R from 'https://cdn.skypack.dev/ramda@0.29.0' const { ifElse, @@ -38,7 +38,7 @@ const checkIfDefined = (pred, msg) => ) export const isHyperErr = allPass([ - propEq('ok', false), + propEq(false, 'ok'), /** * should not have an _id. * Otherwise it's a document ie data.retrieveDocument diff --git a/packages/utils/scripts/test.sh b/packages/utils/scripts/test.sh deleted file mode 100755 index ffa03181..00000000 --- a/packages/utils/scripts/test.sh +++ /dev/null @@ -1 +0,0 @@ -deno lint && deno fmt --check && deno test \ No newline at end of file From 392225c6f152f6d7bcba2e132c5cf632f1537638 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Fri, 26 May 2023 15:19:10 -0400 Subject: [PATCH 2/2] ci(utils): combine workflows --- .github/workflows/publish-utils.yml | 21 ---------- .github/workflows/test-utils.yml | 27 ------------- .github/workflows/utils.yml | 62 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/publish-utils.yml delete mode 100644 .github/workflows/test-utils.yml create mode 100644 .github/workflows/utils.yml diff --git a/.github/workflows/publish-utils.yml b/.github/workflows/publish-utils.yml deleted file mode 100644 index 3b62793d..00000000 --- a/.github/workflows/publish-utils.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: publish hyper utils - -on: - push: - tags: - - "hyper-utils@*" - -jobs: - publish-egg: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - # - run: deno install -A -f --unstable --no-check https://x.nest.land/eggs@0.3.6/eggs.ts - # - run: | - # export PATH="/home/runner/.deno/bin:$PATH" - # eggs link ${{ secrets.NESTAPIKEY }} - # cd packages/utils - # eggs publish --yes diff --git a/.github/workflows/test-utils.yml b/.github/workflows/test-utils.yml deleted file mode 100644 index e73cc6a1..00000000 --- a/.github/workflows/test-utils.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: test hyper utils -on: - pull_request: - branches: - - main - paths: - - "packages/utils/**" - push: - branches: - - "main" - paths: - - "packages/utils/**" -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - deno-version: [1.x] - steps: - - uses: actions/checkout@v2 - - name: Use Deno ${{ matrix.deno-version }} - uses: denoland/setup-deno@v1 - with: - deno-version: ${{ matrix.deno-version }} - - run: cd packages/utils && ./scripts/test.sh - env: - CI: true diff --git a/.github/workflows/utils.yml b/.github/workflows/utils.yml new file mode 100644 index 00000000..1b30af99 --- /dev/null +++ b/.github/workflows/utils.yml @@ -0,0 +1,62 @@ +name: 🛠 Test & Deploy Utils + +on: + pull_request: + branches: + - main + paths: + - "packages/utils/**" + push: + branches: + - main + paths: + - "packages/utils/**" + tags: + - 'hyper-utils@*' + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + deno-version: [1.x] + + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v3 + + - name: 🦕 Setup Deno + uses: denoland/setup-deno@v1 + with: + deno-version: ${{ matrix.deno-version }} + + - name: ⚡ Run Tests + run: | + cd packages/utils + deno task test + env: + CI: true + + publish: + if: startsWith(github.ref, 'refs/tags/hyper-utils@') + needs: [test] + runs-on: ubuntu-latest + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v3 + + - name: 🦕 Setup Deno + uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + + # - name: 🥚 Setup Eggs CLI + # run: | + # deno install -A -f --unstable --no-check https://x.nest.land/eggs@0.3.10/eggs.ts + # export PATH="/home/runner/.deno/bin:$PATH" + # eggs link ${{ secrets.NESTAPIKEY }} + + # - name: 📘 Publish to Nest + # run: | + # cd packages/utils + # eggs publish --yes