taglib-wasm 1.5.2 → 1.5.3

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.
@@ -2419,7 +2419,7 @@ var VERSION;
2419
2419
  var init_version = __esm({
2420
2420
  "src/version.ts"() {
2421
2421
  "use strict";
2422
- VERSION = "1.5.2";
2422
+ VERSION = "1.5.3";
2423
2423
  }
2424
2424
  });
2425
2425
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @fileoverview Main module exports for TagLib-Wasm
3
3
  *
4
- * TagLib v2.3 compiled to WebAssembly with TypeScript bindings
4
+ * TagLib v2.3.1 compiled to WebAssembly with TypeScript bindings
5
5
  * for universal audio metadata handling across all JavaScript runtimes.
6
6
  *
7
7
  * @module TagLib-Wasm
@@ -2351,7 +2351,7 @@ var VERSION;
2351
2351
  var init_version = __esm({
2352
2352
  "src/version.ts"() {
2353
2353
  "use strict";
2354
- VERSION = "1.5.2";
2354
+ VERSION = "1.5.3";
2355
2355
  }
2356
2356
  });
2357
2357
 
@@ -8,6 +8,18 @@
8
8
  */
9
9
  import { TagLib } from "./taglib.js";
10
10
  export { isDenoCompiled } from "./runtime/deno-detect.js";
11
+ /**
12
+ * Where {@link prepareWasmForEmbedding} looks for the Emscripten binary, in
13
+ * order, resolved relative to this module.
14
+ *
15
+ * `build/` comes first deliberately: it holds the committed, authoritative
16
+ * artifact, while `dist/` is gitignored scratch that only the npm chain
17
+ * (`build:copy-wasm`/`postbuild`) refreshes. A stale `dist/` in a working
18
+ * checkout would otherwise silently shadow a freshly built binary. Published
19
+ * packages ship no `build/` (it is absent from package.json's `files`), so
20
+ * resolution there falls through to `dist/` exactly as before.
21
+ */
22
+ export declare const WASM_EMBED_SEARCH_PATHS: readonly string[];
11
23
  /**
12
24
  * Initialize TagLib with automatic handling for Deno compiled binaries.
13
25
  *
@@ -1 +1 @@
1
- {"version":3,"file":"deno-compile.d.ts","sourceRoot":"","sources":["../../src/deno-compile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,wBAAwB,CAC5C,gBAAgB,SAAsB,GACrC,OAAO,CAAC,MAAM,CAAC,CA8BjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,SAAsB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA6Cf"}
1
+ {"version":3,"file":"deno-compile.d.ts","sourceRoot":"","sources":["../../src/deno-compile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAIpD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,wBAAwB,CAC5C,gBAAgB,SAAsB,GACrC,OAAO,CAAC,MAAM,CAAC,CA8BjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,SAAsB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAuCf"}
@@ -3,6 +3,11 @@ import { FileOperationError } from "./errors/classes.js";
3
3
  import { isDenoCompiled } from "./runtime/deno-detect.js";
4
4
  import { fileUrlToPath } from "./utils/path.js";
5
5
  import { isDenoCompiled as isDenoCompiled2 } from "./runtime/deno-detect.js";
6
+ const WASM_EMBED_SEARCH_PATHS = [
7
+ "../build/taglib-web.wasm",
8
+ "../dist/taglib-web.wasm",
9
+ "./node_modules/taglib-wasm/dist/taglib-web.wasm"
10
+ ];
6
11
  async function initializeForDenoCompile(embeddedWasmPath = "./taglib-web.wasm") {
7
12
  if (isDenoCompiled()) {
8
13
  const strategies = [
@@ -30,14 +35,9 @@ async function initializeForDenoCompile(embeddedWasmPath = "./taglib-web.wasm")
30
35
  }
31
36
  async function prepareWasmForEmbedding(outputPath = "./taglib-web.wasm") {
32
37
  try {
33
- const possiblePaths = [
34
- new URL("../dist/taglib-web.wasm", import.meta.url),
35
- new URL("../taglib-web.wasm", import.meta.url),
36
- new URL(
37
- "./node_modules/taglib-wasm/dist/taglib-web.wasm",
38
- import.meta.url
39
- )
40
- ];
38
+ const possiblePaths = WASM_EMBED_SEARCH_PATHS.map(
39
+ (p) => new URL(p, import.meta.url)
40
+ );
41
41
  let wasmData = null;
42
42
  let sourcePath = null;
43
43
  for (const path of possiblePaths) {
@@ -68,6 +68,7 @@ async function prepareWasmForEmbedding(outputPath = "./taglib-web.wasm") {
68
68
  }
69
69
  }
70
70
  export {
71
+ WASM_EMBED_SEARCH_PATHS,
71
72
  initializeForDenoCompile,
72
73
  isDenoCompiled2 as isDenoCompiled,
73
74
  prepareWasmForEmbedding
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.5.2";
1
+ export declare const VERSION = "1.5.3";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
- const VERSION = "1.5.2";
1
+ const VERSION = "1.5.3";
2
2
  export {
3
3
  VERSION
4
4
  };
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taglib-wasm",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "TagLib-Wasm is the universal tagging library for TypeScript/JavaScript platforms: Browsers, Node.js, Deno, Bun, Cloudflare Workers, and Electron apps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -74,11 +74,14 @@
74
74
  "LICENSE"
75
75
  ],
76
76
  "scripts": {
77
- "build:wasm": "./build/build-wasm.sh",
77
+ "build:wasm": "npm run build:wasm:emscripten && npm run build:wasm:wasi",
78
+ "build:wasm:emscripten": "./build/build-wasm.sh",
79
+ "build:wasm:wasi": "./build/build-wasi.sh",
78
80
  "build:ts": "tsc && deno run --allow-read --allow-write --allow-run --allow-env scripts/build-js.mjs",
79
81
  "postbuild": "deno run --allow-read --allow-write --allow-run --allow-env scripts/postbuild.mjs",
80
82
  "build:copy-wasm": "mkdir -p dist && cp build/taglib-web.wasm build/taglib-wasi.wasm build/taglib-wrapper.js build/taglib-wrapper.d.ts dist/",
81
- "build": "npm run build:wasm && npm run build:copy-wasm && npm run build:ts && npm run postbuild",
83
+ "build:clean": "mkdir -p dist && find dist -mindepth 1 -maxdepth 1 ! -name wasi -exec rm -rf {} +",
84
+ "build": "npm run build:clean && npm run build:wasm:emscripten && npm run build:copy-wasm && npm run build:ts && npm run postbuild",
82
85
  "test": "deno test --allow-read --allow-write --allow-env tests/",
83
86
  "test:all": "deno test --allow-read --allow-write --allow-env tests/index.test.ts",
84
87
  "test:core": "deno test --allow-read --allow-write --allow-env tests/taglib.test.ts",