beauticode-dsh 1.0.1 → 1.0.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.
@@ -11,7 +11,23 @@ import os from "node:os";
11
11
  import path from "node:path";
12
12
  import { fileURLToPath, pathToFileURL } from "node:url";
13
13
 
14
- const here = path.dirname(fileURLToPath(import.meta.url));
14
+ function findPackageRoot(startDir) {
15
+ let dir = startDir;
16
+ for (let i = 0; i < 5; i += 1) {
17
+ if (
18
+ fs.existsSync(path.join(dir, "package.json")) &&
19
+ fs.existsSync(path.join(dir, "index.mjs"))
20
+ ) {
21
+ return dir;
22
+ }
23
+ const parent = path.dirname(dir);
24
+ if (parent === dir) break;
25
+ dir = parent;
26
+ }
27
+ return startDir;
28
+ }
29
+
30
+ const here = findPackageRoot(path.dirname(fileURLToPath(import.meta.url)));
15
31
  const pluginName = "beauticode-dsh";
16
32
  const bridgeId = "beauticode-bridge";
17
33
 
package/cli.js CHANGED
@@ -11,7 +11,23 @@ import os from "node:os";
11
11
  import path from "node:path";
12
12
  import { fileURLToPath, pathToFileURL } from "node:url";
13
13
 
14
- const here = path.dirname(fileURLToPath(import.meta.url));
14
+ function findPackageRoot(startDir) {
15
+ let dir = startDir;
16
+ for (let i = 0; i < 5; i += 1) {
17
+ if (
18
+ fs.existsSync(path.join(dir, "package.json")) &&
19
+ fs.existsSync(path.join(dir, "index.mjs"))
20
+ ) {
21
+ return dir;
22
+ }
23
+ const parent = path.dirname(dir);
24
+ if (parent === dir) break;
25
+ dir = parent;
26
+ }
27
+ return startDir;
28
+ }
29
+
30
+ const here = findPackageRoot(path.dirname(fileURLToPath(import.meta.url)));
15
31
  const pluginName = "beauticode-dsh";
16
32
  const bridgeId = "beauticode-bridge";
17
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beauticode-dsh",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Cordis plugin: image/video backgrounds for DeepSeek Harness web.",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",