Skip to content

Commit

Permalink
refactor(port-storage): move to deno 2 and refactor usages
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Oct 10, 2024
1 parent fb60a3e commit af4cca9
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 59 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/port-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-storage
run: |
cd packages/port-storage
deno task test
env:
CI: true
Expand All @@ -41,14 +41,22 @@ jobs:
if: startsWith(github.ref, 'refs/tags/hyper-port-storage@')
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-storage
run: |
deno publish --allow-slow-types
# - name: 🥚 Setup Eggs CLI
# run: |
Expand Down
2 changes: 1 addition & 1 deletion packages/port-cache/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">hyper-port-cache</h1>
<p align="center">The Cache Port for the <a href="https://hyper.io/">hyper</a> service framework</p>
<p align="center">Port for the Cache Service in the <a href="https://hyper.io/">hyper</a> Service Framework</p>
</p>
<p align="center">
<a href="https://nest.land/package/hyper-port-cache"><img src="https://nest.land/badge.svg" alt="Nest Badge" /></a>
Expand Down
2 changes: 1 addition & 1 deletion packages/port-data/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">hyper-port-data</h1>
<p align="center">The Data Port for the <a href="https://hyper.io/">hyper</a> service framework</p>
<p align="center">Port for the Data Service in the <a href="https://hyper.io/">hyper</a> Service Framework</p>
</p>
<p align="center">
<a href="https://nest.land/package/hyper-port-data"><img src="https://nest.land/badge.svg" alt="Nest Badge" /></a>
Expand Down
11 changes: 10 additions & 1 deletion packages/port-storage/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<h1 align="center">hyper-port-storage</h1>
<p align="center">The Storage Port for the <a href="https://hyper.io/">hyper</a> service framework</p>
<p align="center">Port for the Storage Service in the <a href="https://hyper.io/">hyper</a> Service Framework</p>
</p>
<p align="center">
<a href="https://nest.land/package/hyper-port-storage"><img src="https://nest.land/badge.svg" alt="Nest Badge" /></a>
<a href="https://jsr.io/@hyper63/port-storage"><img src="https://jsr.io/badges/@hyper63/port-storage" alt="" /></a>
<a href="https://github.com/hyper63/hyper63/actions/workflows/port-storage.yml"><img src="https://github.com/hyper63/hyper63/actions/workflows/port-storage.yml/badge.svg" alt="Test" /></a>
</p>

Expand All @@ -11,6 +12,14 @@
hyper63 port is a module that valiadates the schema of an adapter. In this case the storage port
validates the schema of a storage adapter.

<!-- toc -->

- [Usage](#usage)
- [Test](#test)
- [License](#license)

<!-- tocstop -->

## Usage

## Test
Expand Down
37 changes: 37 additions & 0 deletions packages/port-storage/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@hyper63/port-storage",
"version": "2.0.1",
"exports": "./mod.ts",
"tasks": {
"test": "deno lint && deno fmt --check && deno test --no-check",
"cache": "deno install --entrypoint mod.ts"
},
"imports": {
"zod": "npm:[email protected]",
"@std/io/buffer": "jsr:@std/[email protected]/buffer",
"@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"
]
}
}
16 changes: 0 additions & 16 deletions packages/port-storage/deno.jsonc

This file was deleted.

62 changes: 39 additions & 23 deletions packages/port-storage/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/port-storage/deps.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/port-storage/dev_deps.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/port-storage/egg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://x.nest.land/[email protected]/src/schema.json",
"name": "hyper-port-storage",
"entry": "./mod.ts",
"description": "Hyper service framework port for Storage adapters",
"description": "Port for the Storage Service in the hyper Service Framework",
"homepage": "https://github.com/hyper63/hyper",
"repo": "https://github.com/hyper63/hyper",
"version": "2.0.1",
Expand Down
2 changes: 0 additions & 2 deletions packages/port-storage/mod.js

This file was deleted.

7 changes: 4 additions & 3 deletions packages/port-storage/mod.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// deno-lint-ignore-file no-unused-vars ban-ts-comment
import { assert, assertRejects, Buffer } from './dev_deps.ts'
import { assert, assertRejects } from '@std/assert'
import { Buffer } from '@std/io/buffer'

import { storage, type StoragePort } from './mod.ts'

Expand Down Expand Up @@ -70,7 +71,7 @@ Deno.test('storage', async (t) => {
})

await t.step('putObject', async (t) => {
await t.step('always validate \'bucket\' and \'object\' params', async () => {
await t.step("always validate 'bucket' and 'object' params", async () => {
let err = await adapter
.putObject({
bucket: 'foo',
Expand Down Expand Up @@ -278,7 +279,7 @@ Deno.test('storage', async (t) => {
})

await t.step('getObject', async (t) => {
await t.step('always validate \'bucket\' and \'object\' params', async () => {
await t.step("always validate 'bucket' and 'object' params", async () => {
let err = await adapter
.getObject({
bucket: 'foo',
Expand Down
2 changes: 1 addition & 1 deletion packages/port-storage/port.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit af4cca9

Please sign in to comment.