aem-ext-daemon 0.3.0 → 0.3.1
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.
- package/bin/cli.js +8 -2
- package/dist/daemon.js +7 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -10,9 +10,15 @@
|
|
|
10
10
|
* npx aem-ext-daemon --reset # clear identity and re-pair
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import fs from "node:fs";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
13
16
|
import { Daemon } from "../dist/daemon.js";
|
|
14
17
|
import { resetIdentity, getConfigPath, getRailwayUrl } from "../dist/identity.js";
|
|
15
18
|
|
|
19
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, "..", "package.json"), "utf-8"));
|
|
21
|
+
|
|
16
22
|
const DEFAULT_SERVER = "https://adobe-extension-builder-production.up.railway.app";
|
|
17
23
|
|
|
18
24
|
function parseArgs(argv) {
|
|
@@ -61,13 +67,13 @@ if (args.help) {
|
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
if (args.version) {
|
|
64
|
-
console.log(
|
|
70
|
+
console.log(pkg.version);
|
|
65
71
|
process.exit(0);
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
if (args.reset) {
|
|
69
75
|
resetIdentity();
|
|
70
|
-
console.log("
|
|
76
|
+
console.log(" \u2713 Identity reset. Will re-pair on next connection.");
|
|
71
77
|
console.log("");
|
|
72
78
|
}
|
|
73
79
|
|
package/dist/daemon.js
CHANGED
|
@@ -10,11 +10,17 @@
|
|
|
10
10
|
* 6. Dispatch incoming tool_exec messages to capabilities
|
|
11
11
|
*/
|
|
12
12
|
import os from "node:os";
|
|
13
|
+
import fs from "node:fs";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
13
16
|
import { DaemonConnection } from "./connection.js";
|
|
14
17
|
import { ensureIdentity, getWorkspaceRoot, setWorkspaceRoot } from "./identity.js";
|
|
15
18
|
import { generatePairCode, displayPairCode } from "./pairing.js";
|
|
16
19
|
import { dispatch } from "./dispatcher.js";
|
|
17
|
-
|
|
20
|
+
// Read version from package.json so it stays in sync automatically
|
|
21
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
22
|
+
const pkgPath = path.resolve(__dirname, "..", "package.json");
|
|
23
|
+
const VERSION = JSON.parse(fs.readFileSync(pkgPath, "utf-8")).version || "0.0.0";
|
|
18
24
|
export class Daemon {
|
|
19
25
|
connection;
|
|
20
26
|
identity;
|