@fedify/amqp 0.2.0 → 0.3.0-dev.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/FUNDING.yaml +1 -0
- package/.github/workflows/main.yaml +93 -0
- package/.vscode/extensions.json +6 -0
- package/.vscode/settings.json +33 -0
- package/.zed/settings.json +30 -0
- package/README.md +19 -0
- package/deno.json +51 -0
- package/deno.lock +684 -0
- package/mod.ts +1 -0
- package/package.json +30 -32
- package/src/mod.ts +1 -0
- package/src/mq.test.ts +186 -0
- package/src/mq.ts +214 -0
- package/tsdown.config.ts +7 -0
- package/esm/mod.js +0 -1
- package/esm/package.json +0 -3
- package/esm/src/mod.js +0 -1
- package/esm/src/mq.js +0 -139
- package/script/mod.js +0 -17
- package/script/package.json +0 -3
- package/script/src/mod.js +0 -17
- package/script/src/mq.js +0 -143
- package/types/mod.d.ts +0 -2
- package/types/mod.d.ts.map +0 -1
- package/types/src/mod.d.ts +0 -2
- package/types/src/mod.d.ts.map +0 -1
- package/types/src/mq.d.ts +0 -51
- package/types/src/mq.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: dahlia
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
name: main
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
|
|
4
|
+
jobs:
|
|
5
|
+
test:
|
|
6
|
+
runs-on: ubuntu-latest
|
|
7
|
+
permissions:
|
|
8
|
+
checks: write
|
|
9
|
+
pull-requests: write
|
|
10
|
+
services:
|
|
11
|
+
rabbitmq:
|
|
12
|
+
image: rabbitmq
|
|
13
|
+
env:
|
|
14
|
+
RABBITMQ_DEFAULT_USER: guest
|
|
15
|
+
RABBITMQ_DEFAULT_PASS: guest
|
|
16
|
+
ports:
|
|
17
|
+
- 5672:5672
|
|
18
|
+
env:
|
|
19
|
+
AMQP_URL: amqp://guest:guest@localhost:5672
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: denoland/setup-deno@v1
|
|
23
|
+
with:
|
|
24
|
+
deno-version: v2.x
|
|
25
|
+
- uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: latest
|
|
28
|
+
- uses: oven-sh/setup-bun@v1
|
|
29
|
+
with:
|
|
30
|
+
bun-version: latest
|
|
31
|
+
- uses: pnpm/action-setup@v4
|
|
32
|
+
with:
|
|
33
|
+
version: latest
|
|
34
|
+
- run: deno task test --junit-path=.test-report.xml
|
|
35
|
+
- uses: EnricoMi/publish-unit-test-result-action@v2
|
|
36
|
+
if: always()
|
|
37
|
+
with:
|
|
38
|
+
files: .test-report.xml
|
|
39
|
+
- run: deno task check
|
|
40
|
+
- run: pnpm install
|
|
41
|
+
- run: pnpm test
|
|
42
|
+
- run: pnpm test:bun
|
|
43
|
+
|
|
44
|
+
publish:
|
|
45
|
+
if: github.event_name == 'push'
|
|
46
|
+
needs: [test]
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
permissions:
|
|
49
|
+
contents: read
|
|
50
|
+
id-token: write
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/checkout@v4
|
|
53
|
+
- uses: denoland/setup-deno@v1
|
|
54
|
+
with:
|
|
55
|
+
deno-version: v2.x
|
|
56
|
+
- uses: actions/setup-node@v4
|
|
57
|
+
with:
|
|
58
|
+
node-version: latest
|
|
59
|
+
- uses: pnpm/action-setup@v4
|
|
60
|
+
with:
|
|
61
|
+
version: latest
|
|
62
|
+
- if: github.ref_type == 'branch'
|
|
63
|
+
run: |
|
|
64
|
+
jq \
|
|
65
|
+
--arg build "$GITHUB_RUN_NUMBER" \
|
|
66
|
+
--arg commit "${GITHUB_SHA::8}" \
|
|
67
|
+
'.version = .version + "-dev." + $build + "+" + $commit' \
|
|
68
|
+
deno.json > deno.json.tmp
|
|
69
|
+
mv deno.json.tmp deno.json
|
|
70
|
+
jq \
|
|
71
|
+
--arg build "$GITHUB_RUN_NUMBER" \
|
|
72
|
+
--arg commit "${GITHUB_SHA::8}" \
|
|
73
|
+
'.version = .version + "-dev." + $build + "+" + $commit' \
|
|
74
|
+
package.json > package.json.tmp
|
|
75
|
+
mv package.json.tmp package.json
|
|
76
|
+
- if: github.ref_type == 'tag'
|
|
77
|
+
run: |
|
|
78
|
+
set -ex
|
|
79
|
+
[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]
|
|
80
|
+
[[ "$(jq -r .version package.json)" = "$GITHUB_REF_NAME" ]]
|
|
81
|
+
- run: pnpm install && pnpm build
|
|
82
|
+
- run: |
|
|
83
|
+
set -ex
|
|
84
|
+
pnpm config set //registry.npmjs.org/:_authToken "$NPM_AUTH_TOKEN"
|
|
85
|
+
if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then
|
|
86
|
+
pnpm publish --no-git-checks --access public
|
|
87
|
+
else
|
|
88
|
+
pnpm publish --no-git-checks --access public --tag dev
|
|
89
|
+
fi
|
|
90
|
+
env:
|
|
91
|
+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
92
|
+
NPM_CONFIG_PROVENANCE: "true"
|
|
93
|
+
- run: deno publish --allow-dirty
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cSpell.enabled": false,
|
|
3
|
+
"deno.enable": true,
|
|
4
|
+
"deno.unstable": [
|
|
5
|
+
"temporal"
|
|
6
|
+
],
|
|
7
|
+
"editor.detectIndentation": false,
|
|
8
|
+
"editor.indentSize": 2,
|
|
9
|
+
"editor.insertSpaces": true,
|
|
10
|
+
"files.eol": "\n",
|
|
11
|
+
"files.insertFinalNewline": true,
|
|
12
|
+
"files.trimFinalNewlines": true,
|
|
13
|
+
"[json]": {
|
|
14
|
+
"editor.defaultFormatter": "vscode.json-language-features",
|
|
15
|
+
"editor.formatOnSave": true
|
|
16
|
+
},
|
|
17
|
+
"[jsonc]": {
|
|
18
|
+
"editor.defaultFormatter": "vscode.json-language-features",
|
|
19
|
+
"editor.formatOnSave": true
|
|
20
|
+
},
|
|
21
|
+
"[typescript]": {
|
|
22
|
+
"editor.defaultFormatter": "denoland.vscode-deno",
|
|
23
|
+
"editor.formatOnSave": true,
|
|
24
|
+
"editor.codeActionsOnSave": {
|
|
25
|
+
"source.sortImports": "always"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"cSpell.words": [
|
|
29
|
+
"fedify",
|
|
30
|
+
"unlisten",
|
|
31
|
+
"UNLOGGED"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deno": {
|
|
3
|
+
"enable": true
|
|
4
|
+
},
|
|
5
|
+
"ensure_final_newline_on_save": true,
|
|
6
|
+
"format_on_save": "on",
|
|
7
|
+
"formatter": "language_server",
|
|
8
|
+
"languages": {
|
|
9
|
+
"TypeScript": {
|
|
10
|
+
"language_servers": [
|
|
11
|
+
"deno",
|
|
12
|
+
"!typescript-language-server",
|
|
13
|
+
"!vtsls",
|
|
14
|
+
"!eslint",
|
|
15
|
+
"..."
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"TSX": {
|
|
19
|
+
"language_servers": [
|
|
20
|
+
"deno",
|
|
21
|
+
"!typescript-language-server",
|
|
22
|
+
"!vtsls",
|
|
23
|
+
"!eslint",
|
|
24
|
+
"..."
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"show_wrap_guides": true,
|
|
29
|
+
"wrap_guides": [80]
|
|
30
|
+
}
|
package/README.md
CHANGED
|
@@ -30,6 +30,17 @@ const federation = createFederation({
|
|
|
30
30
|
});
|
|
31
31
|
~~~~
|
|
32
32
|
|
|
33
|
+
The `AmqpMessageQueue` constructor accepts options as the second
|
|
34
|
+
parameter, which can be used to configure the message queue:
|
|
35
|
+
|
|
36
|
+
~~~~ typescript
|
|
37
|
+
new AmqpMessageQueue(await connect("amqp://localhost"), {
|
|
38
|
+
queue: "my_queue",
|
|
39
|
+
})
|
|
40
|
+
~~~~
|
|
41
|
+
|
|
42
|
+
For more details, please refer to the docs of [`AmqpMessageQueueOptions`].
|
|
43
|
+
|
|
33
44
|
[JSR]: https://jsr.io/@fedify/amqp
|
|
34
45
|
[JSR badge]: https://jsr.io/badges/@fedify/amqp
|
|
35
46
|
[npm]: https://www.npmjs.com/package/@fedify/amqp
|
|
@@ -41,6 +52,7 @@ const federation = createFederation({
|
|
|
41
52
|
[`KvStore`]: https://jsr.io/@fedify/fedify/doc/federation/~/KvStore
|
|
42
53
|
[`MessageQueue`]: https://jsr.io/@fedify/fedify/doc/federation/~/MessageQueue
|
|
43
54
|
[`AmqpMessageQueue`]: https://jsr.io/@fedify/amqp/doc/mq/~/AmqpMessageQueue
|
|
55
|
+
[`AmqpMessageQueueOptions`] https://jsr.io/@fedify/amqp/doc/mq/~/AmqpMessageQueueOptions
|
|
44
56
|
|
|
45
57
|
|
|
46
58
|
Installation
|
|
@@ -68,6 +80,13 @@ bun add @fedify/amqp
|
|
|
68
80
|
Changelog
|
|
69
81
|
---------
|
|
70
82
|
|
|
83
|
+
### Version 0.3.0
|
|
84
|
+
|
|
85
|
+
To be released.
|
|
86
|
+
|
|
87
|
+
- The type of the `AmqpMessageQueue()` constructor's first parameter has been
|
|
88
|
+
changed from `Connection` to `ChannelModel`.
|
|
89
|
+
|
|
71
90
|
### Version 0.2.0
|
|
72
91
|
|
|
73
92
|
Released on March 28, 2025.
|
package/deno.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fedify/amqp",
|
|
3
|
+
"version": "0.3.0-dev.17+484159bd",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./mod.ts",
|
|
7
|
+
"./mq": "./src/mq.ts"
|
|
8
|
+
},
|
|
9
|
+
"imports": {
|
|
10
|
+
"@fedify/fedify": "jsr:@fedify/fedify@^1.7.0-dev.887+013dabb5",
|
|
11
|
+
"@hongminhee/suite": "jsr:@hongminhee/suite@^0.6.3",
|
|
12
|
+
"@std/assert": "jsr:@std/assert@^1.0.13",
|
|
13
|
+
"@std/async": "jsr:@std/async@^1.0.13",
|
|
14
|
+
"amqplib": "npm:amqplib@^0.10.8",
|
|
15
|
+
"tsdown": "npm:tsdown@^0.12.7"
|
|
16
|
+
},
|
|
17
|
+
"nodeModulesDir": "auto",
|
|
18
|
+
"unstable": [
|
|
19
|
+
"temporal"
|
|
20
|
+
],
|
|
21
|
+
"exclude": [
|
|
22
|
+
".github",
|
|
23
|
+
"node_modules",
|
|
24
|
+
"npm",
|
|
25
|
+
"pnpm-lock.yaml"
|
|
26
|
+
],
|
|
27
|
+
"tasks": {
|
|
28
|
+
"build": "pnpm build",
|
|
29
|
+
"check": "deno fmt --check && deno lint && deno check */*.ts",
|
|
30
|
+
"test": "deno test --allow-net --allow-env",
|
|
31
|
+
"test:node": {
|
|
32
|
+
"dependencies": [
|
|
33
|
+
"build"
|
|
34
|
+
],
|
|
35
|
+
"command": "node --experimental-transform-types --test"
|
|
36
|
+
},
|
|
37
|
+
"test:bun": {
|
|
38
|
+
"dependencies": [
|
|
39
|
+
"build"
|
|
40
|
+
],
|
|
41
|
+
"command": "bun test --timeout 15000"
|
|
42
|
+
},
|
|
43
|
+
"test-all": {
|
|
44
|
+
"dependencies": [
|
|
45
|
+
"test",
|
|
46
|
+
"test:node",
|
|
47
|
+
"test:bun"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|