@jimp/wasm-jxl 0.0.0-stage → 2.0.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.
@@ -0,0 +1,12 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { createRequire } from "node:module";
3
+ const require = createRequire(import.meta.url);
4
+ /**
5
+ * The @jsquash codecs fetch their wasm from a file: URL, which Node's fetch
6
+ * can't load, so read and compile it from disk instead.
7
+ */
8
+ export async function loadWasm(specifier) {
9
+ const wasm = await readFile(require.resolve(specifier));
10
+ return WebAssembly.compile(new Uint8Array(wasm));
11
+ }
12
+ //# sourceMappingURL=load-wasm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-wasm.js","sourceRoot":"","sources":["../../src/load-wasm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,SAAiB;IAEjB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACxD,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\n\nconst require = createRequire(import.meta.url);\n\n/**\n * The @jsquash codecs fetch their wasm from a file: URL, which Node's fetch\n * can't load, so read and compile it from disk instead.\n */\nexport async function loadWasm(\n specifier: string,\n): Promise<WebAssembly.Module | undefined> {\n const wasm = await readFile(require.resolve(specifier));\n return WebAssembly.compile(new Uint8Array(wasm));\n}\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
package/package.json CHANGED
@@ -1,6 +1,78 @@
1
1
  {
2
2
  "name": "@jimp/wasm-jxl",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.0.0",
4
+ "files": [
5
+ "dist"
6
+ ],
7
+ "repository": "jimp-dev/jimp",
8
+ "engines": {
9
+ "node": ">=22"
10
+ },
11
+ "scripts": {
12
+ "lint": "eslint .",
13
+ "test": "vitest",
14
+ "test:browser": "vitest --config vitest.config.browser.mjs",
15
+ "build": "tshy",
16
+ "dev": "tshy --watch",
17
+ "clean": "rimraf node_modules .tshy .tshy-build dist .turbo"
18
+ },
19
+ "author": "Andrew Lisowski <lisowski54@gmail.com>",
20
+ "license": "MIT",
21
+ "devDependencies": {
22
+ "@jimp/config-eslint": "2.0.0",
23
+ "@jimp/config-typescript": "2.0.0",
24
+ "@jimp/config-vitest": "2.0.0",
25
+ "@jimp/core": "2.0.0",
26
+ "@jimp/js-jpeg": "2.0.0",
27
+ "@jimp/js-png": "2.0.0",
28
+ "@jimp/test-utils": "2.0.0",
29
+ "@jimp/types": "2.0.0",
30
+ "@types/node": "^22.20.5",
31
+ "@vitest/browser": "^5.1.1",
32
+ "eslint": "^10.15.0",
33
+ "tshy": "~4.0.0",
34
+ "typescript": "^7.0.2",
35
+ "vite-plugin-node-polyfills": "^0.28.0",
36
+ "vitest": "^5.1.1"
37
+ },
38
+ "tshy": {
39
+ "exclude": [
40
+ "**/*.test.ts"
41
+ ],
42
+ "dialects": [
43
+ "esm"
44
+ ],
45
+ "esmDialects": [
46
+ "browser"
47
+ ],
48
+ "exports": {
49
+ "./package.json": "./package.json",
50
+ ".": "./src/index.ts"
51
+ }
52
+ },
53
+ "exports": {
54
+ "./package.json": "./package.json",
55
+ ".": {
56
+ "browser": {
57
+ "types": "./dist/browser/index.d.ts",
58
+ "default": "./dist/browser/index.js"
59
+ },
60
+ "import": {
61
+ "types": "./dist/esm/index.d.ts",
62
+ "default": "./dist/esm/index.js"
63
+ }
64
+ }
65
+ },
66
+ "type": "module",
67
+ "publishConfig": {
68
+ "access": "public"
69
+ },
70
+ "sideEffects": false,
71
+ "dependencies": {
72
+ "@jsquash/jxl": "1.3.0",
73
+ "buffer": "^6.0.3",
74
+ "zod": "^4.6.7"
75
+ },
76
+ "module": "./dist/esm/index.js",
77
+ "gitHead": "a0c6199088b0a3f28162a1742c9714b285dd194a"
78
+ }