Skip to content

Commit

Permalink
refactor(port-queue): 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 af4cca9 commit 2aca277
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 66 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/port-queue.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-queue
run: |
cd packages/port-queue
deno task test
env:
CI: true
Expand All @@ -43,12 +43,17 @@ jobs:
runs-on: ubuntu-latest
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-queue
run: |
deno publish --allow-slow-types
# - name: 🥚 Setup Eggs CLI
# run: |
Expand Down
29 changes: 15 additions & 14 deletions packages/port-queue/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
# README
<h1 align="center">hyper-port-queue</h1>
<p align="center">Port for the Queue 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-queue"><img src="https://nest.land/badge.svg" alt="Nest Badge" /></a>
<a href="https://jsr.io/@hyper63/port-queue"><img src="https://jsr.io/badges/@hyper63/port-queue" alt="" /></a>
<a href="https://github.com/hyper63/hyper63/actions/workflows/port-queue.yml"><img src="https://github.com/hyper63/hyper63/actions/workflows/port-queue.yml/badge.svg" alt="Test" /></a>
</p>

Queue Port

- Create a Queue
- Delete a Queue
- Post a JOB to a Queue
- Get Jobs from a queue
- Post a Job to a Queue
- Get Jobs from a Queue
- Cancel a Job
- Retry a Job

## Documentation
<!-- toc -->

https://docs.hyper63.com
- [Test](#test)

## Dev Environment
<!-- tocstop -->

### Build
## Test

```
yarn build
```

### Test

```
yarn test
deno task test
```
34 changes: 34 additions & 0 deletions packages/port-queue/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@hyper63/port-queue",
"version": "0.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:[email protected]",
"@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-queue/deno.jsonc

This file was deleted.

46 changes: 27 additions & 19 deletions packages/port-queue/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-queue/deps.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/port-queue/dev_deps.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/port-queue/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-queue",
"entry": "./mod.ts",
"description": "Hyper service framework port for Queue adapters",
"description": "Port for the Queue Service in the hyper Service Framework",
"homepage": "https://github.com/hyper63/hyper",
"repo": "https://github.com/hyper63/hyper",
"version": "0.3.0",
Expand Down
1 change: 0 additions & 1 deletion packages/port-queue/mod.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/port-queue/mod.test.ts
Original file line number Diff line number Diff line change
@@ -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 { queue, type QueuePort } from './mod.ts'

Expand Down
2 changes: 1 addition & 1 deletion packages/port-queue/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 2aca277

Please sign in to comment.