Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish
name: Publish Deno Client
on:
workflow_run:
workflows: ["Verify", "Release Rust Binary"]
Expand All @@ -9,6 +9,9 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/clients/deno

permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
experimental: true

- name: Passes publish checks
run: deno publish --dry-run
run: mise run verify-publish:*

codegen-up-to-date:
runs-on: ubuntu-latest
Expand Down
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
"pwa-node": "${workspaceFolder}/.vscode/mise-tools/node"
},
"deno.path": "${workspaceFolder}/.vscode/mise-tools/deno",
"mise.configureExtensionsUseSymLinks": true
"mise.configureExtensionsUseSymLinks": true,
"deno.enablePaths": [
"scripts",
"src/clients/deno"
]
}
10 changes: 9 additions & 1 deletion mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ depends = ["gen:rust"]
sources = ["schemas/*", "scripts/generate-schema.ts"]
outputs = ["src/clients/deno/schemas.ts"]

## Publishing

[tasks."verify-publish:deno"]
description = "Verify the deno client is pulishable"
dir = "src/clients/deno"
run = "deno publish --dry-run"

[tasks.gen]
description = "Run all code gen tasks"
depends = ["gen:*"]
Expand Down Expand Up @@ -76,5 +83,6 @@ depends = ["lint:*"]
[tasks."example:deno"]
description = "Run a deno example"
depends = ["build:deno"]
env = { WEBVIEW_BIN = "target/debug/deno-webview" }
env = { WEBVIEW_BIN = "../../../target/debug/deno-webview" }
run = "deno run -E -R --allow-run examples/{{arg(name=\"example\")}}.ts"
dir = "src/clients/deno"
3 changes: 2 additions & 1 deletion scripts/generate-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { match, P } from "npm:ts-pattern";
import type { JSONSchema, JSONSchemaTypeName } from "../json-schema.d.ts";

const schemasDir = new URL("../schemas", import.meta.url).pathname;
const outputFile = new URL("../src/schemas.ts", import.meta.url).pathname;
const outputFile =
new URL("../src/clients/deno/schemas.ts", import.meta.url).pathname;

// defining an IR
interface DocIR {
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const latestVersion = await Deno
).then((config) => config.package.version);

// Read the content of src/lib.ts
const libPath = "./src/lib.ts";
const libPath = "./src/clients/deno/main.ts";
const libContent = await Deno.readTextFile(libPath);

// Replace the version in the URL
Expand Down
5 changes: 3 additions & 2 deletions deno.json → src/clients/deno/deno.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "@justbe/webview",
"exports": "./src/lib.ts",
"exports": "./main.ts",
"license": "MIT",
"version": "0.0.17",
"publish": {
"include": ["README.md", "LICENSE", "src/**/*.ts"]
"include": ["README.md", "LICENSE", "*.ts"]
},
"imports": {
"jsr:@std/fs": "jsr:@std/fs@^1.0.3",
Expand Down
42 changes: 42 additions & 0 deletions src/clients/deno/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/ipc.ts → src/clients/deno/examples/ipc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createWebView } from "../src/lib.ts";
import { createWebView } from "../main.ts";

using webview = await createWebView({
title: "Simple",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createWebView } from "../src/lib.ts";
import { createWebView } from "../main.ts";

using webview = await createWebView({
title: "Load Html Example",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createWebView } from "../src/lib.ts";
import { createWebView } from "../main.ts";

using webview = await createWebView({
title: "Load Url Example",
Expand Down
2 changes: 1 addition & 1 deletion examples/simple.ts → src/clients/deno/examples/simple.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createWebView } from "../src/lib.ts";
import { createWebView } from "../main.ts";

using webview = await createWebView({
title: "Simple",
Expand Down
2 changes: 1 addition & 1 deletion examples/tldraw.ts → src/clients/deno/examples/tldraw.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createWebView } from "../src/lib.ts";
import { createWebView } from "../main.ts";
import * as esbuild from "https://deno.land/x/esbuild@v0.24.0/wasm.js";

const tldrawApp = `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createWebView } from "../src/lib.ts";
import { createWebView } from "../main.ts";

using webview = await createWebView({
title: "Window Size",
Expand Down
File renamed without changes.
File renamed without changes.