wasm-image-optimization 1.2.28 → 1.2.30

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/next-web-worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK1C,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,GAClE,YAAY,CACV,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EACvE,CAAC,CACF,CAAC;AAEJ,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC5D,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC/D,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { createWorker } from \"worker-lib\";\nimport type { WorkerType } from \"./_web-worker.js\";\nimport type { OptimizeParams, OptimizeResult } from \"../types/index.js\";\nexport type { OptimizeParams, OptimizeResult };\n\nconst { execute, setLimit, close, waitAll, waitReady, launchWorker } =\n createWorker<WorkerType>(\n () => new Worker(new URL(\"../esm/next-web-worker.js\", import.meta.url)),\n 5\n );\n\nexport const optimizeImage = async (params: OptimizeParams) =>\n execute(\"optimizeImage\", params);\n\nexport const optimizeImageExt = async (params: OptimizeParams) =>\n execute(\"optimizeImageExt\", params);\n\nexport { setLimit, close, waitAll, waitReady, launchWorker };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/next-web-worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK1C,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,GAClE,YAAY,CACV,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EACvE,CAAC,CACF,CAAC;AAEJ,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC5D,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC/D,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { createWorker } from \"worker-lib\";\nimport type { WorkerType } from \"./_web-worker.js\";\nimport type { OptimizeParams, OptimizeResult } from \"../types/index.js\";\nexport type { OptimizeParams, OptimizeResult };\n\nconst { execute, setLimit, close, waitAll, waitReady, launchWorker } =\n createWorker<WorkerType>(\n () => new Worker(new URL(\"../esm/next-web-worker.js\", import.meta.url)),\n 5,\n );\n\nexport const optimizeImage = async (params: OptimizeParams) =>\n execute(\"optimizeImage\", params);\n\nexport const optimizeImageExt = async (params: OptimizeParams) =>\n execute(\"optimizeImageExt\", params);\n\nexport { setLimit, close, waitAll, waitReady, launchWorker };\n"]}
@@ -1,3 +1,3 @@
1
1
  import type { Plugin } from "vite";
2
- declare const _default: () => Plugin[];
2
+ declare const _default: (assetsPath?: string) => Plugin[];
3
3
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
- export default () => {
3
+ export default (assetsPath) => {
4
4
  let config;
5
5
  return [
6
6
  {
@@ -21,7 +21,9 @@ export default () => {
21
21
  config = _config;
22
22
  },
23
23
  writeBundle() {
24
- fs.copyFileSync("node_modules/wasm-image-optimization/dist/esm/libImage.wasm", path.resolve(config.build.outDir, "assets/libImage.wasm"));
24
+ fs.copyFileSync("node_modules/wasm-image-optimization/dist/esm/libImage.wasm", assetsPath
25
+ ? path.resolve(assetsPath, "libImage.wasm")
26
+ : path.resolve(config.build.outDir, "assets/libImage.wasm"));
25
27
  },
26
28
  },
27
29
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vite-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,eAAe,GAAa,EAAE;IAC5B,IAAI,MAAsB,CAAC;IAC3B,OAAO;QACL;YACE,IAAI,EAAE,+BAA+B;YACrC,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,GAAG,EAAE;gBACX,OAAO;oBACL,YAAY,EAAE;wBACZ,OAAO,EAAE,CAAC,yBAAyB,CAAC;qBACrC;iBACF,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,+BAA+B;YACrC,KAAK,EAAE,OAAO;YACd,cAAc,CAAC,OAAO;gBACpB,MAAM,GAAG,OAAO,CAAC;YACnB,CAAC;YACD,WAAW;gBACT,EAAE,CAAC,YAAY,CACb,6DAA6D,EAC7D,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAC1D,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { Plugin, ResolvedConfig } from \"vite\";\n\nexport default (): Plugin[] => {\n let config: ResolvedConfig;\n return [\n {\n name: \"wasm-image-optimization-serve\",\n apply: \"serve\",\n config: () => {\n return {\n optimizeDeps: {\n exclude: [\"wasm-image-optimization\"],\n },\n };\n },\n },\n {\n name: \"wasm-image-optimization-build\",\n apply: \"build\",\n configResolved(_config) {\n config = _config;\n },\n writeBundle() {\n fs.copyFileSync(\n \"node_modules/wasm-image-optimization/dist/esm/libImage.wasm\",\n path.resolve(config.build.outDir, \"assets/libImage.wasm\"),\n );\n },\n },\n ];\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vite-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,eAAe,CAAC,UAAmB,EAAY,EAAE;IAC/C,IAAI,MAAsB,CAAC;IAC3B,OAAO;QACL;YACE,IAAI,EAAE,+BAA+B;YACrC,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,GAAG,EAAE;gBACX,OAAO;oBACL,YAAY,EAAE;wBACZ,OAAO,EAAE,CAAC,yBAAyB,CAAC;qBACrC;iBACF,CAAC;YACJ,CAAC;SACF;QACD;YACE,IAAI,EAAE,+BAA+B;YACrC,KAAK,EAAE,OAAO;YACd,cAAc,CAAC,OAAO;gBACpB,MAAM,GAAG,OAAO,CAAC;YACnB,CAAC;YACD,WAAW;gBACT,EAAE,CAAC,YAAY,CACb,6DAA6D,EAC7D,UAAU;oBACR,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,eAAe,CAAC;oBAC3C,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAC9D,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { Plugin, ResolvedConfig } from \"vite\";\n\nexport default (assetsPath?: string): Plugin[] => {\n let config: ResolvedConfig;\n return [\n {\n name: \"wasm-image-optimization-serve\",\n apply: \"serve\",\n config: () => {\n return {\n optimizeDeps: {\n exclude: [\"wasm-image-optimization\"],\n },\n };\n },\n },\n {\n name: \"wasm-image-optimization-build\",\n apply: \"build\",\n configResolved(_config) {\n config = _config;\n },\n writeBundle() {\n fs.copyFileSync(\n \"node_modules/wasm-image-optimization/dist/esm/libImage.wasm\",\n assetsPath\n ? path.resolve(assetsPath, \"libImage.wasm\")\n : path.resolve(config.build.outDir, \"assets/libImage.wasm\")\n );\n },\n },\n ];\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vite-web-worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK1C,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,GAClE,YAAY,CACV,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EACvE,CAAC,CACF,CAAC;AAEJ,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC5D,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC/D,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { createWorker } from \"worker-lib\";\nimport type { WorkerType } from \"./_web-worker.js\";\nimport type { OptimizeParams, OptimizeResult } from \"../types/index.js\";\nexport type { OptimizeParams, OptimizeResult };\n\nconst { execute, setLimit, close, waitAll, waitReady, launchWorker } =\n createWorker<WorkerType>(\n () => new Worker(new URL(\"../esm/vite-web-worker.js\", import.meta.url)),\n 5\n );\n\nexport const optimizeImage = async (params: OptimizeParams) =>\n execute(\"optimizeImage\", params);\n\nexport const optimizeImageExt = async (params: OptimizeParams) =>\n execute(\"optimizeImageExt\", params);\n\nexport { setLimit, close, waitAll, waitReady, launchWorker };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vite-web-worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK1C,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,GAClE,YAAY,CACV,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EACvE,CAAC,CACF,CAAC;AAEJ,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC5D,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC/D,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { createWorker } from \"worker-lib\";\nimport type { WorkerType } from \"./_web-worker.js\";\nimport type { OptimizeParams, OptimizeResult } from \"../types/index.js\";\nexport type { OptimizeParams, OptimizeResult };\n\nconst { execute, setLimit, close, waitAll, waitReady, launchWorker } =\n createWorker<WorkerType>(\n () => new Worker(new URL(\"../esm/vite-web-worker.js\", import.meta.url)),\n 5,\n );\n\nexport const optimizeImage = async (params: OptimizeParams) =>\n execute(\"optimizeImage\", params);\n\nexport const optimizeImageExt = async (params: OptimizeParams) =>\n execute(\"optimizeImageExt\", params);\n\nexport { setLimit, close, waitAll, waitReady, launchWorker };\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wasm-image-optimization",
3
3
  "description": "Optimize images with wasm on edge runtime",
4
- "version": "1.2.28",
4
+ "version": "1.2.30",
5
5
  "scripts": {
6
6
  "test": "yarn ts-node test",
7
7
  "lint:fix": "eslint --fix src/ && prettier -w src",
@@ -103,22 +103,22 @@
103
103
  "worker-lib": "2.0.7"
104
104
  },
105
105
  "devDependencies": {
106
- "@eslint/js": "9.21.0",
107
- "@types/node": "22.13.9",
108
- "@typescript-eslint/eslint-plugin": "^8.26.0",
109
- "@typescript-eslint/parser": "^8.26.0",
106
+ "@eslint/js": "9.26.0",
107
+ "@types/node": "22.15.3",
108
+ "@typescript-eslint/eslint-plugin": "^8.31.1",
109
+ "@typescript-eslint/parser": "^8.31.1",
110
110
  "cpy-cli": "^5.0.0",
111
- "esbuild": "0.25.0",
112
- "eslint": "9.21.0",
113
- "eslint-config-prettier": "^10.0.2",
114
- "eslint-import-resolver-typescript": "^3.8.3",
111
+ "esbuild": "0.25.3",
112
+ "eslint": "9.26.0",
113
+ "eslint-config-prettier": "^10.1.2",
114
+ "eslint-import-resolver-typescript": "^4.3.4",
115
115
  "eslint-plugin-import": "^2.31.0",
116
116
  "prettier": "^3.5.3",
117
117
  "ts-node": "^10.9.2",
118
- "tsx": "4.19.3",
119
- "typescript": "^5.8.2",
120
- "typescript-eslint": "^8.26.0",
121
- "vite": "6.2.0"
118
+ "tsx": "4.19.4",
119
+ "typescript": "^5.8.3",
120
+ "typescript-eslint": "^8.31.1",
121
+ "vite": "6.3.4"
122
122
  },
123
123
  "publishConfig": {
124
124
  "access": "public"