Skip to content

Commit 90dec46

Browse files
authored
Fix some publish check failures; disable slow type checking for now (#31)
* Fix some publish check failures; disable slow type checking for now * Remove unused methods * Add lint / publish checks
1 parent 9bcffa0 commit 90dec46

File tree

5 files changed

+83
-12
lines changed

5 files changed

+83
-12
lines changed

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- uses: actions/checkout@v4
1717

1818
- name: Publish package
19-
run: npx jsr publish
19+
run: npx jsr publish --allow-slow-types

.github/workflows/verify.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Verify
2+
on:
3+
push:
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
11+
- name: Install Deno
12+
uses: denoland/setup-deno@v1
13+
with:
14+
deno-version: v1.x
15+
16+
- name: Lint
17+
run: deno lint
18+
19+
publishable:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install Deno
25+
uses: denoland/setup-deno@v1
26+
with:
27+
deno-version: v1.x
28+
29+
- name: Passes publish checks
30+
run: deno publish --dry-run --allow-slow-types

deno.json

+15
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,20 @@
77
"gen": "cargo test && deno run -A scripts/generate-zod.ts && deno run -A scripts/sync-versions.ts",
88
"build": "deno task gen && cargo build -F transparent",
99
"example:simple": "deno run -A examples/simple.ts"
10+
},
11+
"publish": {
12+
"include": ["README.md", "LICENSE", "src/**/*.ts"]
13+
},
14+
"imports": {
15+
"jsr:@std/fs": "jsr:@std/fs@^1.0.3",
16+
"jsr:@std/path": "jsr:@std/path@^1.0.6",
17+
"jsr:@std/ulid": "jsr:@std/ulid@^1.0.0",
18+
"npm:zod": "npm:zod@^3.23.8",
19+
"npm:type-fest": "npm:type-fest@^4.26.1"
20+
},
21+
"lint": {
22+
"rules": {
23+
"exclude": ["no-slow-types"]
24+
}
1025
}
1126
}

deno.lock

+32-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib.ts

+5-10
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import {
88
import { monotonicUlid as ulid } from "jsr:@std/ulid";
99
import type { Except } from "npm:type-fest";
1010
import { join } from "jsr:@std/path";
11-
import { ensureDir } from "jsr:@std/fs";
12-
import { exists } from "jsr:@std/fs";
11+
import { ensureDir, exists } from "jsr:@std/fs";
1312

1413
type JSON =
1514
| string
@@ -141,7 +140,7 @@ function getCacheDir(): string {
141140
}
142141
}
143142

144-
export async function createWebView(options: WebViewOptions) {
143+
export async function createWebView(options: WebViewOptions): Promise<WebView> {
145144
const binPath = await getWebViewBin(options);
146145
return new WebView(options, binPath);
147146
}
@@ -255,24 +254,20 @@ class WebView implements Disposable {
255254
/**
256255
* Gets the title of the webview.
257256
*/
258-
async getTitle() {
257+
async getTitle(): Promise<string> {
259258
const result = await this.#send({ $type: "getTitle" });
260259
return returnResult(result, "string");
261260
}
262261

263-
bind(name: string, callback: (...args: any[]) => any) {}
264-
265-
unbind(name: string) {}
266-
267262
/**
268263
* Evaluates JavaScript code in the webview.
269264
*/
270-
async eval(code: string) {
265+
async eval(code: string): Promise<void> {
271266
const result = await this.#send({ $type: "eval", js: code });
272267
return returnAck(result);
273268
}
274269

275-
async openDevTools() {
270+
async openDevTools(): Promise<void> {
276271
const result = await this.#send({ $type: "openDevTools" });
277272
return returnAck(result);
278273
}

0 commit comments

Comments
 (0)