add web-app stub

This commit is contained in:
2026-08-19 14:57:14 +02:00
parent 05c0f4e37c
commit 49a59cfad6
15 changed files with 2001 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>WASM Demo</title>
</head>
<body>
<button id="my-button">Do greet</button>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
+29
View File
@@ -0,0 +1,29 @@
{
"name": "web",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"build": "run-s wasm-pack:release tsc vite:build",
"dev": "run-s wasm-pack:dev vite:dev",
"tsc": "tsc",
"vite:build": "vite build",
"vite:dev": "vite -c vite.config.dev.ts",
"vite:preview": "vite preview",
"wasm-pack:dev": "wasm-pack build --dev --features wasm-bindgen --manifest-path ../Cargo.toml",
"wasm-pack:release": "wasm-pack build --features wasm-bindgen --manifest-path ../Cargo.toml"
},
"devDependencies": {
"npm-run-all": "^4.1.5",
"typescript": "~6.0.2",
"vite": "^8.2.0",
"vite-plugin-top-level-await": "^1.6.0",
"vite-plugin-wasm": "^3.6.0",
"vite-plugin-wasm-pack-watcher": "^1.0.1"
},
"dependencies": {
"esbuild": "^0.28.2",
"rollup": "^4.62.4",
"wordle-solver": "link:../pkg"
}
}
+7
View File
@@ -0,0 +1,7 @@
import { greet } from "wordle-solver";
const button = document.getElementById("my-button")!;
button.addEventListener("click", () => {
greet();
});
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "es2023",
"module": "esnext",
"lib": ["ES2023", "DOM"],
"types": ["vite/client"],
"allowArbitraryExtensions": true,
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}
+12
View File
@@ -0,0 +1,12 @@
import { defineConfig } from "vite";
import wasm from "vite-plugin-wasm";
import wasmPackWatchPlugin from "vite-plugin-wasm-pack-watcher";
export default defineConfig({
build: {
watch: {
include: ["src/**/*.ts", "../src/**/*.rs"],
},
},
plugins: [wasmPackWatchPlugin(), wasm()],
});
+6
View File
@@ -0,0 +1,6 @@
import { defineConfig } from "vite";
import wasm from "vite-plugin-wasm";
export default defineConfig({
plugins: [wasm()],
});
+1855
View File
File diff suppressed because it is too large Load Diff