Skip to content

Commit 7ae1712

Browse files
committed
chore: update dependencies and tooling
1 parent 7fba1e6 commit 7ae1712

10 files changed

Lines changed: 201 additions & 149 deletions

File tree

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: deno
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
groups:
8+
deno-dependencies:
9+
patterns:
10+
- "*"
11+
12+
- package-ecosystem: deno
13+
directory: "/docs"
14+
schedule:
15+
interval: weekly
16+
groups:
17+
demo-dependencies:
18+
patterns:
19+
- "*"
20+
21+
- package-ecosystem: github-actions
22+
directory: "/"
23+
schedule:
24+
interval: weekly
25+
groups:
26+
github-actions:
27+
patterns:
28+
- "*"

.github/workflows/ci.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@ jobs:
1212

1313
steps:
1414
- name: Checkout repository
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v7
1616

1717
- name: Setup Deno
1818
uses: denoland/setup-deno@v2
1919
with:
2020
deno-version: v2.x
2121

22-
- name: Verify formatting
23-
run: deno fmt --check
22+
- name: Check
23+
run: deno task check
2424

25-
- name: Run linter
26-
run: deno lint
27-
28-
- name: Run tests
29-
run: deno task test
25+
- name: Validate package
26+
run: deno publish --dry-run

.github/workflows/deploy-demo.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@v4
31+
uses: actions/checkout@v7
3232
with:
3333
ref: ${{ inputs.ref || github.event.release.tag_name || github.ref }}
3434

@@ -37,14 +37,8 @@ jobs:
3737
with:
3838
deno-version: v2.x
3939

40-
- name: Verify formatting
41-
run: deno fmt --check
42-
43-
- name: Lint
44-
run: deno lint
45-
46-
- name: Tests
47-
run: deno task test
40+
- name: Check
41+
run: deno task check
4842

4943
- name: Deploy
5044
env:

.github/workflows/publish-jsr.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,45 +25,34 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v4
28+
uses: actions/checkout@v7
2929
with:
3030
fetch-depth: 0
3131
ref: ${{ inputs.tag || github.ref }}
3232

3333
- name: Setup Deno
34-
uses: denoland/setup-deno@v1
34+
uses: denoland/setup-deno@v2
3535
with:
3636
deno-version: v2.x
3737

38-
- name: Setup Node
39-
uses: actions/setup-node@v4
40-
with:
41-
node-version: 20
42-
4338
- name: Verify tag matches deno.json version
4439
shell: bash
4540
run: |
4641
set -euo pipefail
4742
raw_tag="${{ inputs.tag || github.ref_name }}"
4843
tag="${raw_tag#v}"
49-
version="$(node -p "require('./deno.json').version")"
44+
version="$(deno eval "console.log(JSON.parse(Deno.readTextFileSync('deno.json')).version)")"
5045
5146
if [[ "${tag}" != "${version}" ]]; then
5247
echo "Tag (${raw_tag}) does not match deno.json version (${version})."
5348
exit 1
5449
fi
5550
56-
- name: Format / Lint / Test
57-
run: |
58-
deno fmt --check
59-
deno lint
60-
deno task test
51+
- name: Check
52+
run: deno task check
6153

6254
- name: Publish
63-
run: |
64-
# Tokenless publishing requires linking the JSR package to this GitHub repository
65-
# in the package settings on jsr.io, and OIDC enabled via `id-token: write`.
66-
npx jsr publish
55+
run: deno publish
6756

6857
- name: Generate release notes
6958
shell: bash
@@ -93,7 +82,7 @@ jobs:
9382
} > RELEASE_NOTES.md
9483
9584
- name: Create GitHub Release
96-
uses: softprops/action-gh-release@v2
85+
uses: softprops/action-gh-release@v3
9786
with:
9887
tag_name: ${{ inputs.tag || github.ref_name }}
9988
name: ${{ inputs.tag || github.ref_name }}

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ same source image, slightly modified). Examples:
77

88
- A resized, compressed, slightly cropped, or color-altered image compared with
99
the original
10-
- A watermarked image versus it's source
10+
- A watermarked image versus its source
1111
- Meme images (mostly the same template, different text)
1212

1313
It does this by computing a `perceptual hash` of each image and then using it to
@@ -41,6 +41,8 @@ them:
4141
of the same base image
4242

4343
```ts
44+
import { compare, dhash } from "jsr:@claudiu-ceia/dhash";
45+
4446
const [hash1, hash2] = await Promise.all([
4547
dhash("./tests/dalle.png"),
4648
dhash("./tests/dalle-copyright.png"),
@@ -68,8 +70,12 @@ preserved.
6870

6971
## Development
7072

71-
- Run tests: `deno task test` (requires `--allow-read --allow-ffi --allow-env`
72-
because `sharp` uses native bindings and reads fixtures).
73+
- Run all checks: `deno task check`.
74+
- Run only tests: `deno task test` (requires
75+
`--allow-read --allow-write --allow-ffi --allow-env` because `sharp` uses
76+
native bindings, reads fixtures, and the `save()` test writes to a temporary
77+
directory).
78+
- Preview the JSR package: `deno publish --dry-run`.
7379

7480
## License
7581

deno.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "@claudiu-ceia/dhash",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"license": "MIT",
55
"exports": "./mod.ts",
66
"nodeModulesDir": "auto",
77
"publish": {
88
"exclude": [
99
".vscode",
10+
".github",
1011
"tests",
1112
"docs",
1213
"coverage",
@@ -15,14 +16,12 @@
1516
]
1617
},
1718
"tasks": {
18-
"test": "deno test --allow-read --allow-ffi --allow-env"
19+
"check": "deno fmt --check && deno lint && deno check mod.ts && deno check --config docs/deno.json docs/main.ts && deno task test",
20+
"test": "deno test --allow-read --allow-write --allow-ffi --allow-env"
1921
},
2022
"imports": {
21-
"@std/assert": "jsr:@std/assert@^1.0.18",
22-
"@std/path": "jsr:@std/path@^1.1.4",
23-
"dhash_jsr": "jsr:@claudiu-ceia/dhash@^0.3.2",
24-
"preact": "npm:preact@10.28.3",
25-
"preact-render-to-string": "npm:preact-render-to-string@6.6.5",
26-
"sharp": "npm:sharp@0.34.5"
23+
"@std/assert": "jsr:@std/assert@^1.0.19",
24+
"@std/path": "jsr:@std/path@^1.1.6",
25+
"sharp": "npm:sharp@0.35.3"
2726
}
2827
}

0 commit comments

Comments
 (0)