Skip to content

Commit

Permalink
fix: Bump JSR version and update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
eliassjogreen committed Oct 23, 2024
1 parent db15a43 commit d11d31e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: v2.x

- name: install webkit2gtk (Linux)
if: matrix.os == 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install stable deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: v2.x

- name: Run check
run: deno task check
Expand Down
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webview/webview",
"version": "0.8.0",
"version": "0.8.1",
"exports": "./mod.ts",
"lock": false,
"tasks": {
Expand All @@ -17,5 +17,5 @@
"fmt": {
"exclude": ["webview/"]
},
"imports": { "@denosaurs/plug": "jsr:@denosaurs/plug@^1.0.5" }
"imports": { "@denosaurs/plug": "jsr:@denosaurs/plug@^1.0.6" }
}
1 change: 1 addition & 0 deletions examples/ssr/worker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/// <reference lib="deno.ns" />

import { serve } from "https://deno.land/[email protected]/http/server.ts";
// deno-lint-ignore verbatim-module-syntax
import { h, ssr, tw } from "https://crux.land/[email protected]";

const Hello = (props: { name: string }) => (
Expand Down
59 changes: 4 additions & 55 deletions script/build.bat
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
@echo off

echo Prepare directories...
set script_dir=%~dp0
set src_dir=%script_dir%..\webview
set build_dir=%script_dir%..\build
mkdir "%build_dir%"

echo Webview directory: %src_dir%
echo Build directory: %build_dir%

:: If you update the nuget package, change its version here
set nuget_version=1.0.1150.38
echo Using Nuget Package microsoft.web.webview2.%nuget_version%
if not exist "%script_dir%\microsoft.web.webview2.%nuget_version%" (
curl -sSLO https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
nuget.exe install Microsoft.Web.Webview2 -Version %nuget_version% -OutputDirectory %script_dir%
echo Nuget package installed
)

echo Looking for vswhere.exe...
set "vswhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%vswhere%" set "vswhere=%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
Expand All @@ -37,40 +18,8 @@ if not exist "%vc_dir%\Common7\Tools\vsdevcmd.bat" (
)
echo Found %vc_dir%

:: 4100: unreferenced formal parameter
set warning_params=/W4 /wd4100

:: build dlls if not found
if not exist "%src_dir%\dll\x64\webview.dll" (
mkdir "%src_dir%\dll\x86"
mkdir "%src_dir%\dll\x64"
copy "%script_dir%\microsoft.web.webview2.%nuget_version%\build\native\x64\WebView2Loader.dll" "%src_dir%\dll\x64"
copy "%script_dir%\microsoft.web.webview2.%nuget_version%\build\native\x86\WebView2Loader.dll" "%src_dir%\dll\x86"

call "%vc_dir%\Common7\Tools\vsdevcmd.bat" -arch=x86 -host_arch=x64

echo "Building webview.dll (x86)"
cl %warning_params% ^
/D "WEBVIEW_API=__declspec(dllexport)" ^
/I "%script_dir%\microsoft.web.webview2.%nuget_version%\build\native\include" ^
"%script_dir%\microsoft.web.webview2.%nuget_version%\build\native\x86\WebView2Loader.dll.lib" ^
/std:c++17 /EHsc "/Fo%build_dir%"\ ^
"%src_dir%\webview.cc" /link /DLL "/OUT:%src_dir%\dll\x86\webview.dll" || exit \b

call "%vc_dir%\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64
echo "Building webview.dll (x64)"
cl %warning_params% ^
/D "WEBVIEW_API=__declspec(dllexport)" ^
/I "%script_dir%\microsoft.web.webview2.%nuget_version%\build\native\include" ^
"%script_dir%\microsoft.web.webview2.%nuget_version%\build\native\x64\WebView2Loader.dll.lib" ^
/std:c++17 /EHsc "/Fo%build_dir%"\ ^
"%src_dir%\webview.cc" /link /DLL "/OUT:%src_dir%\dll\x64\webview.dll" || exit \b
)
if not exist "%build_dir%\webview.dll" (
copy "%src_dir%\dll\x64\webview.dll" %build_dir%
)
if not exist "%build_dir%\WebView2Loader.dll" (
copy "%script_dir%\microsoft.web.webview2.%nuget_version%\build\native\x64\WebView2Loader.dll" "%build_dir%"
)

call "%vc_dir%\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64
cd %~dp0..\webview

cmake -G "Ninja Multi-Config" -B build -S .
cmake --build build --config Release
2 changes: 1 addition & 1 deletion src/ffi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import manifest from "../deno.json" with { type: "json" };

import { dlopen, download } from "@denosaurs/plug";
import { Webview } from "./webview.ts";
import type { Webview } from "./webview.ts";

const version = manifest.version;
const cache = Deno.env.get("PLUGIN_URL") === undefined ? "use" : "reloadAll";
Expand Down
2 changes: 1 addition & 1 deletion webview
Submodule webview updated 114 files

0 comments on commit d11d31e

Please sign in to comment.