Skip to content

Commit 2aca277

Browse files
committed
refactor(port-queue): move to deno 2 and refactor usages
1 parent af4cca9 commit 2aca277

File tree

11 files changed

+91
-66
lines changed

11 files changed

+91
-66
lines changed

.github/workflows/port-queue.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
deno-version: [1.x]
22+
deno-version: [2.x]
2323

2424
steps:
2525
- name: ⬇️ Checkout repo
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727

2828
- name: 🦕 Setup Deno
29-
uses: denoland/setup-deno@v1
29+
uses: denoland/setup-deno@v2
3030
with:
3131
deno-version: ${{ matrix.deno-version }}
3232

3333
- name: ⚡ Run Tests
34+
working-directory: packages/port-queue
3435
run: |
35-
cd packages/port-queue
3636
deno task test
3737
env:
3838
CI: true
@@ -43,12 +43,17 @@ jobs:
4343
runs-on: ubuntu-latest
4444
steps:
4545
- name: ⬇️ Checkout repo
46-
uses: actions/checkout@v3
46+
uses: actions/checkout@v4
4747

4848
- name: 🦕 Setup Deno
49-
uses: denoland/setup-deno@v1
49+
uses: denoland/setup-deno@v2
5050
with:
51-
deno-version: v1.x
51+
deno-version: v2.x
52+
53+
- name: ✨ Publish to JSR
54+
working-directory: packages/port-queue
55+
run: |
56+
deno publish --allow-slow-types
5257
5358
# - name: 🥚 Setup Eggs CLI
5459
# run: |

packages/port-queue/README.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
# README
1+
<h1 align="center">hyper-port-queue</h1>
2+
<p align="center">Port for the Queue Service in the <a href="https://hyper.io/">hyper</a> Service Framework</p>
3+
</p>
4+
<p align="center">
5+
<a href="https://nest.land/package/hyper-port-queue"><img src="https://nest.land/badge.svg" alt="Nest Badge" /></a>
6+
<a href="https://jsr.io/@hyper63/port-queue"><img src="https://jsr.io/badges/@hyper63/port-queue" alt="" /></a>
7+
<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>
8+
</p>
29

310
Queue Port
411

512
- Create a Queue
613
- Delete a Queue
7-
- Post a JOB to a Queue
8-
- Get Jobs from a queue
14+
- Post a Job to a Queue
15+
- Get Jobs from a Queue
916
- Cancel a Job
1017
- Retry a Job
1118

12-
## Documentation
19+
<!-- toc -->
1320

14-
https://docs.hyper63.com
21+
- [Test](#test)
1522

16-
## Dev Environment
23+
<!-- tocstop -->
1724

18-
### Build
25+
## Test
1926

2027
```
21-
yarn build
22-
```
23-
24-
### Test
25-
26-
```
27-
yarn test
28+
deno task test
2829
```

packages/port-queue/deno.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "@hyper63/port-queue",
3+
"version": "0.3.0",
4+
"exports": "./mod.ts",
5+
"tasks": {
6+
"test": "deno lint && deno fmt --check && deno test --no-check",
7+
"cache": "deno install --entrypoint mod.ts"
8+
},
9+
"imports": {
10+
"zod": "npm:[email protected]",
11+
"@std/assert": "jsr:@std/assert@1"
12+
},
13+
"fmt": {
14+
"include": ["./"],
15+
"lineWidth": 100,
16+
"singleQuote": true,
17+
"semiColons": false
18+
},
19+
"lint": {
20+
"rules": {
21+
"exclude": [
22+
"no-slow-types"
23+
]
24+
}
25+
},
26+
"publish": {
27+
"include": [
28+
"*"
29+
],
30+
"exclude": [
31+
"**/*.test.ts"
32+
]
33+
}
34+
}

packages/port-queue/deno.jsonc

-16
This file was deleted.

packages/port-queue/deno.lock

+27-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/port-queue/deps.ts

-1
This file was deleted.

packages/port-queue/dev_deps.ts

-5
This file was deleted.

packages/port-queue/egg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://x.nest.land/[email protected]/src/schema.json",
33
"name": "hyper-port-queue",
44
"entry": "./mod.ts",
5-
"description": "Hyper service framework port for Queue adapters",
5+
"description": "Port for the Queue Service in the hyper Service Framework",
66
"homepage": "https://github.com/hyper63/hyper",
77
"repo": "https://github.com/hyper63/hyper",
88
"version": "0.3.0",

packages/port-queue/mod.js

-1
This file was deleted.

packages/port-queue/mod.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// deno-lint-ignore-file no-unused-vars ban-ts-comment
2-
import { assert, assertRejects } from './dev_deps.ts'
2+
import { assert, assertRejects } from '@std/assert'
33

44
import { queue, type QueuePort } from './mod.ts'
55

packages/port-queue/port.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z, ZodRawShape } from './deps.ts'
1+
import { z, type ZodRawShape } from 'zod'
22

33
/**
44
* The hyper response schema. MOST adapter methods return this shape.

0 commit comments

Comments
 (0)