@spikard/wasm 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,37 +1,50 @@
1
1
  {
2
2
  "name": "@spikard/wasm",
3
- "version": "0.6.1",
4
- "description": "WebAssembly bindings for spikard - High-performance HTTP framework",
5
- "main": "dist-bundler/spikard_wasm.js",
6
- "types": "dist-bundler/spikard_wasm.d.ts",
3
+ "version": "0.7.0",
4
+ "description": "Spikard HTTP framework for WebAssembly and edge runtimes with full TypeScript support, targeting browsers, Deno, Cloudflare Workers, and Node.js.",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
7
8
  "exports": {
8
9
  ".": {
9
- "import": "./dist-bundler/spikard_wasm.js",
10
- "types": "./dist-bundler/spikard_wasm.d.ts",
11
- "default": "./dist-bundler/spikard_wasm.js"
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
12
13
  },
13
- "./dist-node": {
14
- "import": "./dist-node/spikard_wasm.js",
15
- "require": "./dist-node/spikard_wasm.js",
16
- "types": "./dist-node/spikard_wasm.d.ts"
17
- },
18
- "./dist-node/*": "./dist-node/*",
19
- "./dist-web": {
20
- "import": "./dist-web/spikard_wasm.js",
21
- "types": "./dist-web/spikard_wasm.d.ts"
22
- },
23
- "./dist-web/*": "./dist-web/*"
14
+ "./node": {
15
+ "types": "./dist/node.d.ts",
16
+ "import": "./dist/node.mjs",
17
+ "require": "./dist/node.js"
18
+ }
24
19
  },
25
- "license": "MIT",
20
+ "scripts": {
21
+ "prepare:wasm": "rm -rf runtime && mkdir -p runtime && cp ../../crates/spikard-wasm/dist-node/* runtime/ && node scripts/patch-wasm-loader.cjs",
22
+ "build": "pnpm run prepare:wasm && tsup",
23
+ "typecheck": "tsc --noEmit",
24
+ "lint": "biome check src",
25
+ "lint:fix": "biome check --write src",
26
+ "test": "vitest run",
27
+ "test:watch": "vitest",
28
+ "test:cov": "vitest run --coverage",
29
+ "clean": "rm -rf dist node_modules"
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "README.md",
34
+ "package.json"
35
+ ],
26
36
  "keywords": [
27
- "wasm",
28
- "webassembly",
29
37
  "http",
30
38
  "framework",
31
- "rust",
32
- "performance",
33
- "web",
34
- "api"
39
+ "wasm",
40
+ "webassembly",
41
+ "edge",
42
+ "typescript",
43
+ "cloudflare-workers",
44
+ "deno",
45
+ "fetch-api",
46
+ "async",
47
+ "router"
35
48
  ],
36
49
  "author": {
37
50
  "name": "Na'aman Hirschfeld",
@@ -39,32 +52,27 @@
39
52
  },
40
53
  "repository": {
41
54
  "type": "git",
42
- "url": "https://github.com/Goldziher/spikard"
55
+ "url": "https://github.com/Goldziher/spikard.git",
56
+ "directory": "packages/wasm"
43
57
  },
44
- "homepage": "https://github.com/Goldziher/spikard",
58
+ "homepage": "https://github.com/Goldziher/spikard/tree/main/packages/wasm",
45
59
  "bugs": {
46
60
  "url": "https://github.com/Goldziher/spikard/issues"
47
61
  },
48
- "files": [
49
- "README.md",
50
- "dist-bundler",
51
- "dist-node",
52
- "dist-web"
53
- ],
54
- "scripts": {
55
- "build": "pnpm run build:bundler",
56
- "build:bundler": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target bundler --out-dir dist-bundler --release",
57
- "build:web": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target web --out-dir dist-web --release",
58
- "build:node": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target nodejs --out-dir dist-node --release",
59
- "build:all": "pnpm run build:bundler && pnpm run build:node && pnpm run build:web",
60
- "test": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target web && PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack test --node",
61
- "clean": "rm -rf dist-bundler dist-node dist-web node_modules"
62
- },
62
+ "license": "MIT",
63
63
  "devDependencies": {
64
- "wasm-pack": "^0.13.1"
64
+ "@biomejs/biome": "^2.3.10",
65
+ "@types/node": "^25.0.3",
66
+ "@vitest/coverage-v8": "^4.0.16",
67
+ "tsup": "^8.5.1",
68
+ "typescript": "^5.9.3",
69
+ "vitest": "^4.0.16"
70
+ },
71
+ "dependencies": {
72
+ "fflate": "^0.8.2",
73
+ "zod": "^4.2.1"
65
74
  },
66
- "publishConfig": {
67
- "registry": "https://registry.npmjs.org/",
68
- "access": "public"
75
+ "engines": {
76
+ "node": ">=18"
69
77
  }
70
78
  }
@@ -1,34 +0,0 @@
1
- {
2
- "name": "spikard-wasm",
3
- "type": "module",
4
- "collaborators": [
5
- "Na'aman Hirschfeld <nhirschfeld@gmail.com>"
6
- ],
7
- "description": "WebAssembly bindings for Spikard HTTP framework via wasm-bindgen",
8
- "version": "0.6.1",
9
- "license": "MIT",
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/Goldziher/spikard"
13
- },
14
- "files": [
15
- "spikard_wasm_bg.wasm",
16
- "spikard_wasm.js",
17
- "spikard_wasm_bg.js",
18
- "spikard_wasm.d.ts"
19
- ],
20
- "main": "spikard_wasm.js",
21
- "homepage": "https://github.com/Goldziher/spikard",
22
- "types": "spikard_wasm.d.ts",
23
- "sideEffects": [
24
- "./spikard_wasm.js",
25
- "./snippets/*"
26
- ],
27
- "keywords": [
28
- "wasm",
29
- "webassembly",
30
- "bindings",
31
- "http",
32
- "framework"
33
- ]
34
- }
@@ -1,28 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
-
4
- export class TestClient {
5
- free(): void;
6
- [Symbol.dispose](): void;
7
- /**
8
- * Handle a generic HTTP request. Takes a JSON string with method, path, headers, and body.
9
- */
10
- handle_request(request_json: string): Promise<any>;
11
- get(path: string, headers: any): Promise<any>;
12
- /**
13
- * Build a [`TestClient`] from serialized route metadata, handler map, server config, and lifecycle hooks.
14
- */
15
- constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null, dependencies?: any | null);
16
- put(path: string, options: any): Promise<any>;
17
- head(path: string, headers: any): Promise<any>;
18
- post(path: string, options: any): Promise<any>;
19
- patch(path: string, options: any): Promise<any>;
20
- trace(path: string, headers: any): Promise<any>;
21
- delete(path: string, headers: any): Promise<any>;
22
- options(path: string, headers: any): Promise<any>;
23
- }
24
-
25
- /**
26
- * Initialize the WASM module (sets panic hook).
27
- */
28
- export function init(): void;
@@ -1,5 +0,0 @@
1
- import * as wasm from "./spikard_wasm_bg.wasm";
2
- export * from "./spikard_wasm_bg.js";
3
- import { __wbg_set_wasm } from "./spikard_wasm_bg.js";
4
- __wbg_set_wasm(wasm);
5
- wasm.__wbindgen_start();