@fedify/postgres 0.3.0-dev.22 → 0.4.0-dev.30
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 +2 -0
- package/.github/workflows/main.yaml +100 -0
- package/.vscode/extensions.json +6 -0
- package/.vscode/settings.json +33 -0
- package/.zed/settings.json +30 -0
- package/README.md +5 -1
- package/deno.json +34 -0
- package/deno.json.tmp +34 -0
- package/deno.lock +767 -0
- package/mod.ts +1 -0
- package/package.json +31 -42
- package/src/kv.test.ts +137 -0
- package/src/kv.ts +146 -0
- package/src/mod.ts +2 -0
- package/src/mq.test.ts +114 -0
- package/src/mq.ts +261 -0
- package/src/utils.ts +7 -0
- package/tsdown.config.ts +12 -0
- package/esm/_dnt.shims.js +0 -64
- package/esm/mod.js +0 -1
- package/esm/package.json +0 -3
- package/esm/src/kv.js +0 -125
- package/esm/src/mod.js +0 -2
- package/esm/src/mq.js +0 -225
- package/esm/src/utils.js +0 -5
- package/script/_dnt.shims.js +0 -69
- package/script/mod.js +0 -17
- package/script/package.json +0 -3
- package/script/src/kv.js +0 -129
- package/script/src/mod.js +0 -18
- package/script/src/mq.js +0 -255
- package/script/src/utils.js +0 -8
- package/types/_dnt.shims.d.ts +0 -9
- package/types/_dnt.shims.d.ts.map +0 -1
- package/types/mod.d.ts +0 -2
- package/types/mod.d.ts.map +0 -1
- package/types/src/kv.d.ts +0 -56
- package/types/src/kv.d.ts.map +0 -1
- package/types/src/mod.d.ts +0 -3
- package/types/src/mod.d.ts.map +0 -1
- package/types/src/mq.d.ts +0 -63
- package/types/src/mq.d.ts.map +0 -1
- package/types/src/utils.d.ts +0 -3
- package/types/src/utils.d.ts.map +0 -1
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
postgres:
|
|
12
|
+
image: postgres
|
|
13
|
+
env:
|
|
14
|
+
POSTGRES_USER: postgres
|
|
15
|
+
POSTGRES_PASSWORD: postgres
|
|
16
|
+
POSTGRES_DB: postgres
|
|
17
|
+
options: >-
|
|
18
|
+
--health-cmd pg_isready
|
|
19
|
+
--health-interval 10s
|
|
20
|
+
--health-timeout 5s
|
|
21
|
+
--health-retries 5
|
|
22
|
+
ports:
|
|
23
|
+
- 5432:5432
|
|
24
|
+
env:
|
|
25
|
+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
- uses: denoland/setup-deno@v1
|
|
29
|
+
with:
|
|
30
|
+
deno-version: v2.x
|
|
31
|
+
- uses: pnpm/action-setup@v4
|
|
32
|
+
with:
|
|
33
|
+
version: 10
|
|
34
|
+
- uses: actions/setup-node@v4
|
|
35
|
+
with:
|
|
36
|
+
node-version: lts/*
|
|
37
|
+
cache: pnpm
|
|
38
|
+
- uses: oven-sh/setup-bun@v1
|
|
39
|
+
with:
|
|
40
|
+
bun-version: latest
|
|
41
|
+
- run: deno task test --junit-path=.test-report.xml
|
|
42
|
+
- uses: EnricoMi/publish-unit-test-result-action@v2
|
|
43
|
+
if: always()
|
|
44
|
+
with:
|
|
45
|
+
files: .test-report.xml
|
|
46
|
+
- run: deno task check
|
|
47
|
+
- run: pnpm install
|
|
48
|
+
- run: pnpm test
|
|
49
|
+
- run: pnpm test:bun
|
|
50
|
+
|
|
51
|
+
publish:
|
|
52
|
+
if: github.event_name == 'push'
|
|
53
|
+
needs: [test]
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
permissions:
|
|
56
|
+
contents: read
|
|
57
|
+
id-token: write
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v4
|
|
60
|
+
- uses: denoland/setup-deno@v1
|
|
61
|
+
with:
|
|
62
|
+
deno-version: v2.x
|
|
63
|
+
- uses: pnpm/action-setup@v4
|
|
64
|
+
with:
|
|
65
|
+
version: 10
|
|
66
|
+
- uses: actions/setup-node@v4
|
|
67
|
+
with:
|
|
68
|
+
node-version: lts/*
|
|
69
|
+
cache: pnpm
|
|
70
|
+
- if: github.ref_type == 'branch'
|
|
71
|
+
run: |
|
|
72
|
+
set -ex
|
|
73
|
+
jq \
|
|
74
|
+
--arg build "$GITHUB_RUN_NUMBER" \
|
|
75
|
+
--arg commit "${GITHUB_SHA::8}" \
|
|
76
|
+
'.version = .version + "-dev." + $build + "+" + $commit' \
|
|
77
|
+
deno.json > deno.json.tmp
|
|
78
|
+
jq \
|
|
79
|
+
--arg build "$GITHUB_RUN_NUMBER" \
|
|
80
|
+
'.version = .version + "-dev." + $build' \
|
|
81
|
+
package.json > package.json.tmp
|
|
82
|
+
mv package.json.tmp package.json
|
|
83
|
+
- if: github.ref_type == 'tag'
|
|
84
|
+
run: |
|
|
85
|
+
set -ex
|
|
86
|
+
[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]
|
|
87
|
+
[[ "$(jq -r .version package.json)" = "$GITHUB_REF_NAME" ]]
|
|
88
|
+
- run: |
|
|
89
|
+
set -ex
|
|
90
|
+
pnpm install
|
|
91
|
+
pnpm config set //registry.npmjs.org/:_authToken "$NPM_AUTH_TOKEN"
|
|
92
|
+
if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then
|
|
93
|
+
pnpm publish --provenance --access public --no-git-checks
|
|
94
|
+
else
|
|
95
|
+
pnpm publish --provenance --access public --no-git-checks --tag dev
|
|
96
|
+
fi
|
|
97
|
+
env:
|
|
98
|
+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
99
|
+
NPM_CONFIG_PROVENANCE: "true"
|
|
100
|
+
- run: deno publish --allow-dirty
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deno.enable": true,
|
|
3
|
+
"deno.unstable": [
|
|
4
|
+
"temporal"
|
|
5
|
+
],
|
|
6
|
+
"editor.detectIndentation": false,
|
|
7
|
+
"editor.indentSize": 2,
|
|
8
|
+
"editor.insertSpaces": true,
|
|
9
|
+
"files.eol": "\n",
|
|
10
|
+
"files.insertFinalNewline": true,
|
|
11
|
+
"files.trimFinalNewlines": true,
|
|
12
|
+
"[json]": {
|
|
13
|
+
"editor.defaultFormatter": "vscode.json-language-features",
|
|
14
|
+
"editor.formatOnSave": true
|
|
15
|
+
},
|
|
16
|
+
"[jsonc]": {
|
|
17
|
+
"editor.defaultFormatter": "vscode.json-language-features",
|
|
18
|
+
"editor.formatOnSave": true
|
|
19
|
+
},
|
|
20
|
+
"[typescript]": {
|
|
21
|
+
"editor.defaultFormatter": "denoland.vscode-deno",
|
|
22
|
+
"editor.formatOnSave": true,
|
|
23
|
+
"editor.codeActionsOnSave": {
|
|
24
|
+
"source.sortImports": "always"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"cSpell.words": [
|
|
28
|
+
"fedify",
|
|
29
|
+
"logtape",
|
|
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
|
@@ -64,10 +64,14 @@ bun add @fedify/postgres
|
|
|
64
64
|
Changelog
|
|
65
65
|
---------
|
|
66
66
|
|
|
67
|
-
### Version 0.
|
|
67
|
+
### Version 0.4.0
|
|
68
68
|
|
|
69
69
|
To be released.
|
|
70
70
|
|
|
71
|
+
### Version 0.3.0
|
|
72
|
+
|
|
73
|
+
Released on March 28, 2025.
|
|
74
|
+
|
|
71
75
|
- Added `PostgresMessageQueue.enqueueMany()` method for efficiently enqueuing
|
|
72
76
|
multiple messages at once.
|
|
73
77
|
|
package/deno.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fedify/postgres",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./mod.ts",
|
|
7
|
+
"./kv": "./src/kv.ts",
|
|
8
|
+
"./mq": "./src/mq.ts"
|
|
9
|
+
},
|
|
10
|
+
"imports": {
|
|
11
|
+
"@deno/dnt": "jsr:@deno/dnt@^0.41.3",
|
|
12
|
+
"@fedify/fedify": "jsr:@fedify/fedify@1.7.2",
|
|
13
|
+
"@logtape/logtape": "jsr:@logtape/logtape@^1.0.0",
|
|
14
|
+
"@std/assert": "jsr:@std/assert@^1.0.4",
|
|
15
|
+
"@std/async": "jsr:@std/async@^1.0.5",
|
|
16
|
+
"postgres": "npm:postgres@^3.4.7",
|
|
17
|
+
"tsdown": "npm:tsdown@^0.12.9"
|
|
18
|
+
},
|
|
19
|
+
"nodeModulesDir": "none",
|
|
20
|
+
"unstable": [
|
|
21
|
+
"temporal"
|
|
22
|
+
],
|
|
23
|
+
"exclude": [
|
|
24
|
+
".github",
|
|
25
|
+
".test-report.xml",
|
|
26
|
+
"npm",
|
|
27
|
+
"pnpm-lock.yaml"
|
|
28
|
+
],
|
|
29
|
+
"tasks": {
|
|
30
|
+
"check": "deno fmt --check && deno lint && deno check */*.ts",
|
|
31
|
+
"test": "deno test --allow-net --allow-env",
|
|
32
|
+
"dnt": "deno run -A dnt.ts"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/deno.json.tmp
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fedify/postgres",
|
|
3
|
+
"version": "0.4.0-dev.30+5c54214c",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./mod.ts",
|
|
7
|
+
"./kv": "./src/kv.ts",
|
|
8
|
+
"./mq": "./src/mq.ts"
|
|
9
|
+
},
|
|
10
|
+
"imports": {
|
|
11
|
+
"@deno/dnt": "jsr:@deno/dnt@^0.41.3",
|
|
12
|
+
"@fedify/fedify": "jsr:@fedify/fedify@1.7.2",
|
|
13
|
+
"@logtape/logtape": "jsr:@logtape/logtape@^1.0.0",
|
|
14
|
+
"@std/assert": "jsr:@std/assert@^1.0.4",
|
|
15
|
+
"@std/async": "jsr:@std/async@^1.0.5",
|
|
16
|
+
"postgres": "npm:postgres@^3.4.7",
|
|
17
|
+
"tsdown": "npm:tsdown@^0.12.9"
|
|
18
|
+
},
|
|
19
|
+
"nodeModulesDir": "none",
|
|
20
|
+
"unstable": [
|
|
21
|
+
"temporal"
|
|
22
|
+
],
|
|
23
|
+
"exclude": [
|
|
24
|
+
".github",
|
|
25
|
+
".test-report.xml",
|
|
26
|
+
"npm",
|
|
27
|
+
"pnpm-lock.yaml"
|
|
28
|
+
],
|
|
29
|
+
"tasks": {
|
|
30
|
+
"check": "deno fmt --check && deno lint && deno check */*.ts",
|
|
31
|
+
"test": "deno test --allow-net --allow-env",
|
|
32
|
+
"dnt": "deno run -A dnt.ts"
|
|
33
|
+
}
|
|
34
|
+
}
|