From b9fd4987a28f7eccb2c6c8e92d8aba8976613315 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Thu, 10 Oct 2024 09:50:51 -0400 Subject: [PATCH] refactor(port-data): move to deno 2 and refactor usages --- .github/workflows/port-data.yml | 22 +++++++++++----- packages/port-cache/README.md | 1 + packages/port-data/README.md | 1 + packages/port-data/deno.json | 36 ++++++++++++++++++++++++++ packages/port-data/deno.jsonc | 12 --------- packages/port-data/deno.lock | 46 +++++++++++++++++++-------------- packages/port-data/deps.ts | 1 - packages/port-data/dev_deps.ts | 1 - packages/port-data/egg.json | 2 +- packages/port-data/mod.js | 1 - packages/port-data/mod.test.ts | 2 +- packages/port-data/port.ts | 2 +- 12 files changed, 83 insertions(+), 44 deletions(-) create mode 100644 packages/port-data/deno.json delete mode 100644 packages/port-data/deno.jsonc delete mode 100644 packages/port-data/deps.ts delete mode 100644 packages/port-data/dev_deps.ts delete mode 100644 packages/port-data/mod.js diff --git a/.github/workflows/port-data.yml b/.github/workflows/port-data.yml index ae40d60c..89425b66 100644 --- a/.github/workflows/port-data.yml +++ b/.github/workflows/port-data.yml @@ -19,20 +19,20 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - deno-version: [1.x] + deno-version: [2.x] steps: - name: ⬇️ Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 🦕 Setup Deno - uses: denoland/setup-deno@v1 + uses: denoland/setup-deno@v2 with: deno-version: ${{ matrix.deno-version }} - name: ⚡ Run Tests + working-directory: packages/port-data run: | - cd packages/port-data deno task test env: CI: true @@ -41,14 +41,22 @@ jobs: if: startsWith(github.ref, 'refs/tags/hyper-port-data@') needs: [test] runs-on: ubuntu-latest + permissions: + contents: read + id-token: write steps: - name: ⬇️ Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 🦕 Setup Deno - uses: denoland/setup-deno@v1 + uses: denoland/setup-deno@v2 with: - deno-version: v1.x + deno-version: v2.x + + - name: ✨ Publish to JSR + working-directory: packages/port-data + run: | + deno publish --allow-slow-types # - name: 🥚 Setup Eggs CLI # run: | diff --git a/packages/port-cache/README.md b/packages/port-cache/README.md index 490a8871..95c417ee 100644 --- a/packages/port-cache/README.md +++ b/packages/port-cache/README.md @@ -2,6 +2,7 @@

The Cache Port for the hyper service framework

+ Nest Badge Test

diff --git a/packages/port-data/README.md b/packages/port-data/README.md index 218f7554..c29951b3 100644 --- a/packages/port-data/README.md +++ b/packages/port-data/README.md @@ -3,5 +3,6 @@

Nest Badge + Test

diff --git a/packages/port-data/deno.json b/packages/port-data/deno.json new file mode 100644 index 00000000..bf1824e3 --- /dev/null +++ b/packages/port-data/deno.json @@ -0,0 +1,36 @@ +{ + "name": "@hyper63/port-data", + "version": "2.3.0", + "exports": "./mod.ts", + "tasks": { + "test": "deno lint && deno fmt --check && deno test --no-check", + "cache": "deno install --entrypoint mod.ts" + }, + "imports": { + "zod": "npm:zod@3.20.5", + "@std/assert": "jsr:@std/assert@1" + }, + "fmt": { + "include": [ + "./" + ], + "lineWidth": 100, + "singleQuote": true, + "semiColons": false + }, + "lint": { + "rules": { + "exclude": [ + "no-slow-types" + ] + } + }, + "publish": { + "include": [ + "*" + ], + "exclude": [ + "**/*.test.ts" + ] + } +} diff --git a/packages/port-data/deno.jsonc b/packages/port-data/deno.jsonc deleted file mode 100644 index 30e3367c..00000000 --- a/packages/port-data/deno.jsonc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "tasks": { - "test": "deno lint && deno fmt --check && deno test --no-check", - "cache": "deno cache --lock=deno.lock --lock-write mod.test.ts" - }, - "fmt": { - "include": ["./"], - "lineWidth": 100, - "singleQuote": true, - "semiColons": false - } -} diff --git a/packages/port-data/deno.lock b/packages/port-data/deno.lock index fbef7756..b4015bf0 100644 --- a/packages/port-data/deno.lock +++ b/packages/port-data/deno.lock @@ -1,22 +1,30 @@ { - "version": "2", - "remote": { - "https://deno.land/std@0.178.0/fmt/colors.ts": "938c5d44d889fb82eff6c358bea8baa7e85950a16c9f6dae3ec3a7a729164471", - "https://deno.land/std@0.178.0/testing/_diff.ts": "1a3c044aedf77647d6cac86b798c6417603361b66b54c53331b312caeb447aea", - "https://deno.land/std@0.178.0/testing/_format.ts": "a69126e8a469009adf4cf2a50af889aca364c349797e63174884a52ff75cf4c7", - "https://deno.land/std@0.178.0/testing/asserts.ts": "984ab0bfb3faeed92ffaa3a6b06536c66811185328c5dd146257c702c41b01ab", - "https://deno.land/x/zod@v3.20.5/ZodError.ts": "10bb0d014b0ece532c3bc395c50ae25996315a5897c0216517d9174c2fb570b5", - "https://deno.land/x/zod@v3.20.5/errors.ts": "5285922d2be9700cc0c70c95e4858952b07ae193aa0224be3cbd5cd5567eabef", - "https://deno.land/x/zod@v3.20.5/external.ts": "a6cfbd61e9e097d5f42f8a7ed6f92f93f51ff927d29c9fbaec04f03cbce130fe", - "https://deno.land/x/zod@v3.20.5/helpers/enumUtil.ts": "54efc393cc9860e687d8b81ff52e980def00fa67377ad0bf8b3104f8a5bf698c", - "https://deno.land/x/zod@v3.20.5/helpers/errorUtil.ts": "7a77328240be7b847af6de9189963bd9f79cab32bbc61502a9db4fe6683e2ea7", - "https://deno.land/x/zod@v3.20.5/helpers/parseUtil.ts": "51a76c126ee212be86013d53a9d07f87e9ae04bb1496f2558e61b62cb74a6aa8", - "https://deno.land/x/zod@v3.20.5/helpers/partialUtil.ts": "8dc921a02b47384cf52217c7e539268daf619f89319b75bdf13ea178815725df", - "https://deno.land/x/zod@v3.20.5/helpers/typeAliases.ts": "0fda31a063c6736fc3cf9090dd94865c811dfff4f3cb8707b932bf937c6f2c3e", - "https://deno.land/x/zod@v3.20.5/helpers/util.ts": "0e7366354b1a5070408c1c48d01c7e33d374ca70806f5003b12ff527795c578c", - "https://deno.land/x/zod@v3.20.5/index.ts": "035a7422d9f2be54daa0fe464254b69225b443000673e4794095d672471e8792", - "https://deno.land/x/zod@v3.20.5/locales/en.ts": "ac7210faad6e67ec4f6dbe7062886f04db79ce91ae5ee6c9f64cbdf6221bc80e", - "https://deno.land/x/zod@v3.20.5/mod.ts": "64e55237cb4410e17d968cd08975566059f27638ebb0b86048031b987ba251c4", - "https://deno.land/x/zod@v3.20.5/types.ts": "6ddc4608e70d75f2e06f9cc14aa406df4d80f420c0eef64f2f02d429853c0c38" + "version": "4", + "specifiers": { + "jsr:@std/assert@1": "1.0.6", + "jsr:@std/internal@^1.0.4": "1.0.4", + "npm:zod@3.20.5": "3.20.5" + }, + "jsr": { + "@std/assert@1.0.6": { + "integrity": "1904c05806a25d94fe791d6d883b685c9e2dcd60e4f9fc30f4fc5cf010c72207", + "dependencies": [ + "jsr:@std/internal" + ] + }, + "@std/internal@1.0.4": { + "integrity": "62e8e4911527e5e4f307741a795c0b0a9e6958d0b3790716ae71ce085f755422" + } + }, + "npm": { + "zod@3.20.5": { + "integrity": "sha512-BTAAliwfoB9dWf2hC+TXlyWKk/YTqRGZjHQR0WLC2A2pzierWo7KuQ1ebjS4SNaFaxg/lDItzl9/QTgLjcHbgw==" + } + }, + "workspace": { + "dependencies": [ + "jsr:@std/assert@1", + "npm:zod@3.20.5" + ] } } diff --git a/packages/port-data/deps.ts b/packages/port-data/deps.ts deleted file mode 100644 index 0a1b36d8..00000000 --- a/packages/port-data/deps.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'https://deno.land/x/zod@v3.20.5/mod.ts' diff --git a/packages/port-data/dev_deps.ts b/packages/port-data/dev_deps.ts deleted file mode 100644 index 562ba2f5..00000000 --- a/packages/port-data/dev_deps.ts +++ /dev/null @@ -1 +0,0 @@ -export { assert, assertRejects } from 'https://deno.land/std@0.178.0/testing/asserts.ts' diff --git a/packages/port-data/egg.json b/packages/port-data/egg.json index 3f7f965d..b628f7db 100644 --- a/packages/port-data/egg.json +++ b/packages/port-data/egg.json @@ -2,7 +2,7 @@ "$schema": "https://x.nest.land/eggs@0.3.8/src/schema.json", "name": "hyper-port-data", "entry": "./mod.ts", - "description": "Hyper service framework port for Data adapters", + "description": "Port for the Data Service in the hyper Service Framework", "homepage": "https://github.com/hyper63/hyper", "repo": "https://github.com/hyper63/hyper", "version": "2.3.0", diff --git a/packages/port-data/mod.js b/packages/port-data/mod.js deleted file mode 100644 index 8833f3be..00000000 --- a/packages/port-data/mod.js +++ /dev/null @@ -1 +0,0 @@ -export * from './mod.ts' diff --git a/packages/port-data/mod.test.ts b/packages/port-data/mod.test.ts index faf92ca2..9e77320b 100644 --- a/packages/port-data/mod.test.ts +++ b/packages/port-data/mod.test.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-unused-vars ban-ts-comment -import { assert, assertRejects } from './dev_deps.ts' +import { assert, assertRejects } from '@std/assert' import { data, type DataPort } from './mod.ts' diff --git a/packages/port-data/port.ts b/packages/port-data/port.ts index 9f2f1d42..2afc8cc1 100644 --- a/packages/port-data/port.ts +++ b/packages/port-data/port.ts @@ -1,4 +1,4 @@ -import { z, ZodRawShape } from './deps.ts' +import { z, type ZodRawShape } from 'zod' /** * The hyper response schema. MOST adapter methods return this shape.