Skip to content

Commit

Permalink
ci: add jsr slow types check (#76)
Browse files Browse the repository at this point in the history
JSR prevents packages with "slow types" [1] from being published to the registry without special configuration.

Add a CI check for slow types and fix existing failures.
  • Loading branch information
chrisdickinson authored Jul 16, 2024
1 parent 95699b0 commit 3dec0d6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ jobs:
- name: Test
run: npm run test

jsr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: denoland/[email protected]

- name: jsr slow types check
run: deno publish --dry-run

docs:
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 12 additions & 2 deletions jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
"name": "@extism/extism",
"version": "0.0.0-replaced-by-ci",
"exports": "./src/mod.ts",
"include": ["./src/**/*.ts", "LICENSE", "README.md", "types", "tsconfig.json"],
"exclude": ["./src/mod.test.ts"]
"publish": {
"include": [
"./src/**/*.ts",
"LICENSE",
"README.md",
"types",
"tsconfig.json"
],
"exclude": [
"./src/mod.test.ts"
]
}
}
10 changes: 5 additions & 5 deletions src/call-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class CallContext {
return this.alloc(n);
},

free: (addr: number) => {
free: (addr: number): void => {
this.#blocks[Block.addressToIndex(addr)] = null;
},

Expand All @@ -206,14 +206,14 @@ export class CallContext {
return block?.view.getBigUint64(Number(offset), true) as bigint;
},

store_u8: (addr: bigint, n: number) => {
store_u8: (addr: bigint, n: number): void => {
const blockIdx = Block.addressToIndex(addr);
const offset = Block.maskAddress(addr);
const block = this.#blocks[blockIdx];
block?.view.setUint8(Number(offset), Number(n));
},

store_u64: (addr: bigint, n: bigint) => {
store_u64: (addr: bigint, n: bigint): void => {
const blockIdx = Block.addressToIndex(addr);
const offset = Block.maskAddress(addr);
const block = this.#blocks[blockIdx];
Expand All @@ -239,7 +239,7 @@ export class CallContext {
return this.#input?.view.getBigUint64(Number(offset), true) as bigint;
},

output_set: (addr: bigint, length: bigint) => {
output_set: (addr: bigint, length: bigint): void => {
const blockIdx = Block.addressToIndex(addr);
const block = this.#blocks[blockIdx];
if (!block) {
Expand All @@ -253,7 +253,7 @@ export class CallContext {
this.#stack[this.#stack.length - 1][1] = blockIdx;
},

error_set: (addr: bigint) => {
error_set: (addr: bigint): void => {
const blockIdx = Block.addressToIndex(addr);
const block = this.#blocks[blockIdx];
if (!block) {
Expand Down

0 comments on commit 3dec0d6

Please sign in to comment.