doku-app 0.1.2

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.
Files changed (2) hide show
  1. package/bin/doku.js +44 -0
  2. package/package.json +18 -0
package/bin/doku.js ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require("child_process");
4
+ const os = require("os");
5
+
6
+ const PLATFORMS = {
7
+ "darwin-arm64": "@doku-app/darwin-arm64",
8
+ "darwin-x64": "@doku-app/darwin-x64",
9
+ "linux-x64": "@doku-app/linux-x64",
10
+ "linux-arm64": "@doku-app/linux-arm64",
11
+ };
12
+
13
+ const key = `${os.platform()}-${os.arch()}`;
14
+ const pkg = PLATFORMS[key];
15
+
16
+ if (!pkg) {
17
+ console.error(`Unsupported platform: ${key}`);
18
+ process.exit(1);
19
+ }
20
+
21
+ let binPath;
22
+ try {
23
+ binPath = require.resolve(`${pkg}/bin/doku`);
24
+ } catch {
25
+ console.error(
26
+ `Platform package ${pkg} is not installed. Try reinstalling doku-app.`
27
+ );
28
+ process.exit(1);
29
+ }
30
+
31
+ const child = spawn(binPath, process.argv.slice(2), { stdio: "inherit" });
32
+
33
+ child.on("exit", (code, signal) => {
34
+ if (signal) {
35
+ process.kill(process.pid, signal);
36
+ } else {
37
+ process.exit(code ?? 1);
38
+ }
39
+ });
40
+
41
+ // Forward signals to child
42
+ for (const sig of ["SIGINT", "SIGTERM"]) {
43
+ process.on(sig, () => child.kill(sig));
44
+ }
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "doku-app",
3
+ "version": "0.1.2",
4
+ "description": "Document editor with integrated Claude Code chat",
5
+ "bin": {
6
+ "doku": "bin/doku.js"
7
+ },
8
+ "optionalDependencies": {
9
+ "@doku-app/darwin-arm64": "0.1.2",
10
+ "@doku-app/darwin-x64": "0.1.2",
11
+ "@doku-app/linux-x64": "0.1.2",
12
+ "@doku-app/linux-arm64": "0.1.2"
13
+ },
14
+ "files": [
15
+ "bin/"
16
+ ],
17
+ "license": "MIT"
18
+ }