@arcjet/analyze-wasm 1.0.0-beta.8 → 1.0.0-beta.9
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/README.md +3 -0
- package/index.js +1 -0
- package/package.json +26 -17
- package/wasm.d.ts +0 -28
package/README.md
CHANGED
|
@@ -22,6 +22,9 @@ against common attacks.
|
|
|
22
22
|
|
|
23
23
|
This package provides WebAssembly bindings to [Arcjet's][arcjet] local analysis engine.
|
|
24
24
|
|
|
25
|
+
- [npm package (`@arcjet/analyze-wasm`)](https://www.npmjs.com/package/@arcjet/analyze-wasm)
|
|
26
|
+
- [GitHub source code (`analyze-wasm/` in `arcjet/arcjet-js`)](https://github.com/arcjet/arcjet-js/tree/main/analyze-wasm)
|
|
27
|
+
|
|
25
28
|
## Installation
|
|
26
29
|
|
|
27
30
|
```shell
|
package/index.js
CHANGED
|
@@ -16,6 +16,7 @@ async function moduleFromPath(path) {
|
|
|
16
16
|
if (path === "arcjet_analyze_js_req.component.core3.wasm") {
|
|
17
17
|
return componentCore3WasmPromise;
|
|
18
18
|
}
|
|
19
|
+
// TODO(@wooorm-arcjet): figure out a test case that makes this throw.
|
|
19
20
|
throw new Error(`Unknown path: ${path}`);
|
|
20
21
|
}
|
|
21
22
|
async function initializeWasm(coreImports) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcjet/analyze-wasm",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.9",
|
|
4
4
|
"description": "WebAssembly bindings to Arcjet's local analysis engine",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"analyze",
|
|
7
|
+
"arcjet",
|
|
8
|
+
"attack",
|
|
9
|
+
"limit",
|
|
10
|
+
"protect",
|
|
11
|
+
"verify",
|
|
12
|
+
"wasm"
|
|
13
|
+
],
|
|
5
14
|
"license": "Apache-2.0",
|
|
6
15
|
"homepage": "https://arcjet.com",
|
|
7
16
|
"repository": {
|
|
@@ -30,32 +39,32 @@
|
|
|
30
39
|
"default": "./index.js"
|
|
31
40
|
},
|
|
32
41
|
"files": [
|
|
33
|
-
"LICENSE",
|
|
34
|
-
"README.md",
|
|
35
42
|
"_virtual/",
|
|
36
43
|
"wasm/",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
44
|
+
"edge-light.d.ts",
|
|
45
|
+
"edge-light.js",
|
|
46
|
+
"index.d.ts",
|
|
47
|
+
"index.js",
|
|
48
|
+
"workerd.d.ts",
|
|
49
|
+
"workerd.js"
|
|
40
50
|
],
|
|
41
51
|
"scripts": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"build": "npm run jco
|
|
52
|
+
"build:jco": "jco transpile --instantiation async --no-wasi-shim --out-dir wasm/ -- wasm/arcjet_analyze_js_req.component.wasm",
|
|
53
|
+
"build:rollup": "rollup --config rollup.config.js",
|
|
54
|
+
"build": "npm run build:jco && npm run build:rollup",
|
|
45
55
|
"lint": "eslint .",
|
|
46
|
-
"
|
|
47
|
-
"test": "
|
|
56
|
+
"prepublishOnly": "npm run build",
|
|
57
|
+
"test": "npm run build && npm run lint"
|
|
48
58
|
},
|
|
49
59
|
"dependencies": {},
|
|
50
60
|
"devDependencies": {
|
|
51
|
-
"@arcjet/eslint-config": "1.0.0-beta.
|
|
52
|
-
"@arcjet/rollup-config": "1.0.0-beta.
|
|
53
|
-
"@arcjet/tsconfig": "1.0.0-beta.
|
|
61
|
+
"@arcjet/eslint-config": "1.0.0-beta.9",
|
|
62
|
+
"@arcjet/rollup-config": "1.0.0-beta.9",
|
|
63
|
+
"@arcjet/tsconfig": "1.0.0-beta.9",
|
|
54
64
|
"@bytecodealliance/jco": "1.5.0",
|
|
55
|
-
"@rollup/wasm-node": "4.
|
|
65
|
+
"@rollup/wasm-node": "4.44.2",
|
|
56
66
|
"@types/node": "18.18.0",
|
|
57
|
-
"eslint": "9.
|
|
58
|
-
"expect": "29.7.0",
|
|
67
|
+
"eslint": "9.30.1",
|
|
59
68
|
"typescript": "5.8.3"
|
|
60
69
|
},
|
|
61
70
|
"publishConfig": {
|
package/wasm.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vercel uses the `.wasm?module` suffix to make WebAssembly available in their
|
|
3
|
-
* Vercel Functions product.
|
|
4
|
-
*
|
|
5
|
-
* https://vercel.com/docs/functions/wasm#using-a-webassembly-file
|
|
6
|
-
*/
|
|
7
|
-
declare module "*.wasm?module" {
|
|
8
|
-
export default WebAssembly.Module;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The Cloudflare docs say they support the `.wasm?module` suffix, but that
|
|
13
|
-
* seems to no longer be the case with Wrangler 2 so we need to have separate
|
|
14
|
-
* imports for just the `.wasm` files.
|
|
15
|
-
*
|
|
16
|
-
* https://developers.cloudflare.com/workers/runtime-apis/webassembly/javascript/#bundling
|
|
17
|
-
*/
|
|
18
|
-
declare module "*.wasm" {
|
|
19
|
-
export default WebAssembly.Module;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Our Rollup build turns `.wasm?js` imports into JS imports that provide the
|
|
24
|
-
* `wasm()` function which decodes a base64 Data URL into a WebAssembly Module
|
|
25
|
-
*/
|
|
26
|
-
declare module "*.wasm?js" {
|
|
27
|
-
export function wasm(): Promise<WebAssembly.Module>;
|
|
28
|
-
}
|