Skip to content

Commit

Permalink
Merge pull request #12 from skanehira/support-v1.25
Browse files Browse the repository at this point in the history
feat: support Deno version 1.25+
  • Loading branch information
skanehira authored Sep 13, 2022
2 parents 230d24a + 1c6baeb commit ba6885e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
os:
# wait fix https://github.com/denoland/deno_bindgen/issues/91
# - windows-latest
- macos-latest
- ubuntu-latest
toolchain: [stable]
deno_version: ["v1.24.3"]
deno_version: [v1.x]
runs-on: ${{ matrix.os }}
steps:
- name: Install dependencies
Expand All @@ -63,7 +67,9 @@ jobs:
deno-version: ${{ matrix.deno_version }}
- name: Install deno_bindgen
run: |
deno install -Afq -n deno_bindgen https://deno.land/x/deno_bindgen/cli.ts
# FIXME: Install from GitHub as the latest commit supports FFI destructive changes but has not been released.
# deno install -Afq -n deno_bindgen https://deno.land/x/deno_bindgen/cli.ts
deno install -Afq -n deno_bindgen https://raw.githubusercontent.com/denoland/deno_bindgen/main/cli.ts
- name: Test
run: |
make test
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Deno module to generate images from source code using [Aloxaf/silicon](https://g
## Dependencies
Please refer silicon's [dependencies](https://github.com/Aloxaf/silicon#dependencies)

## Support Version

| `deno-silicon` | `Deno` |
|----------------|----------------------|
| v0.0.2 | `v1.24.3` or earlier |
| v0.0.3 | `v1.25.0` or later |

## Usage
You can call `generateImage(code, language, options)` to generates image from source code.

Expand Down
5 changes: 3 additions & 2 deletions bindings/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function readPointer(v: any): Uint8Array {
}

const url = new URL(
"https://github.com/skanehira/deno-silicon/releases/download/v0.0.2/",
"https://github.com/skanehira/deno-silicon/releases/download/v0.0.3/",
import.meta.url,
)
let uri = url.toString()
Expand Down Expand Up @@ -105,7 +105,8 @@ export function font_list() {
}
export function generate(a0: Options) {
const a0_buf = encode(JSON.stringify(a0))
let rawResult = _lib.symbols.generate(a0_buf, a0_buf.byteLength)
const a0_ptr = Deno.UnsafePointer.of(a0_buf)
let rawResult = _lib.symbols.generate(a0_ptr, a0_buf.byteLength)
const result = readPointer(rawResult)
return JSON.parse(decode(result)) as SiliconResult
}
Expand Down

0 comments on commit ba6885e

Please sign in to comment.