@sonara/runtime-win32-x64 0.0.0-stage → 0.21.6

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.
Binary file
Binary file
Binary file
Binary file
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /** Absolute path of the bundled sonarad.exe (app.asar is rewritten to app.asar.unpacked). */
2
+ export declare function runtimePath(): string;
3
+ /** Folder with sonarad.exe and the files that ship next to it. */
4
+ export declare function runtimeDir(): string;
package/index.js ADDED
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // @sonara/runtime-win32-x64: where the bundled sonarad.exe lives.
3
+ const path = require("node:path");
4
+
5
+ /**
6
+ * Absolute path of the bundled sonarad.exe. Inside a packaged Electron app
7
+ * a path in app.asar is not executable, so it points at app.asar.unpacked
8
+ * (list this package in electron-builder `asarUnpack`, or copy bin/ with
9
+ * `extraResources` and use process.resourcesPath instead).
10
+ */
11
+ function runtimePath(dir = __dirname) {
12
+ return unpacked(path.join(dir, "bin", "sonarad.exe"));
13
+ }
14
+
15
+ /** Rewrite a path inside app.asar to app.asar.unpacked. */
16
+ function unpacked(p) {
17
+ return p.replace(/([\\/])app\.asar([\\/])/, "$1app.asar.unpacked$2");
18
+ }
19
+
20
+ /** Folder with sonarad.exe and the files that ship next to it. */
21
+ function runtimeDir(dir = __dirname) {
22
+ return unpacked(path.join(dir, "bin"));
23
+ }
24
+
25
+ module.exports = { runtimePath, runtimeDir };
package/package.json CHANGED
@@ -1,6 +1,32 @@
1
- {
2
- "name": "@sonara/runtime-win32-x64",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@sonara/runtime-win32-x64",
3
+ "version": "0.21.6",
4
+ "description": "The Sonara runtime (sonarad.exe) for Windows x64, to bundle with an app (electron-builder extraResources). Use with @sonara/client.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Maxaubert/Sonara.git",
9
+ "directory": "packaging/npm-runtime"
10
+ },
11
+ "keywords": ["sonara", "tts", "text-to-speech", "runtime", "electron"],
12
+ "os": ["win32"],
13
+ "cpu": ["x64"],
14
+ "engines": {
15
+ "node": ">=18"
16
+ },
17
+ "main": "./index.js",
18
+ "types": "./index.d.ts",
19
+ "files": [
20
+ "index.js",
21
+ "index.d.ts",
22
+ "bin/",
23
+ "LICENSE",
24
+ "THIRD_PARTY_NOTICES.md",
25
+ "README.md"
26
+ ],
27
+ "scripts": {
28
+ "build": "node scripts/build.mjs",
29
+ "test": "node --test test/runtime-path.test.cjs",
30
+ "prepack": "node scripts/build.mjs"
31
+ }
32
+ }