@blxzer/cursor-trellis 0.2.4 → 0.2.5

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/smart-search.js +16 -13
  2. package/package.json +1 -1
@@ -1,21 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { createRequire } from "node:module";
4
3
  import { spawn } from "node:child_process";
4
+ import { dirname, join } from "node:path";
5
+ import { fileURLToPath } from "node:url";
5
6
 
6
- const require = createRequire(import.meta.url);
7
+ // Get the directory of this wrapper script
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = dirname(__filename);
7
10
 
8
- // Resolve @blxzer/smart-search package location
9
- let smartSearchBin;
10
- try {
11
- const smartSearchPackage = require.resolve("@blxzer/smart-search/package.json");
12
- const smartSearchRoot = smartSearchPackage.replace(/[\/\\]package\.json$/, "");
13
- smartSearchBin = `${smartSearchRoot}/bin/smart-search.js`;
14
- } catch (err) {
15
- console.error("Error: @blxzer/smart-search dependency not found.");
16
- console.error("Please reinstall: npm install -g @blxzer/cursor-trellis");
17
- process.exit(1);
18
- }
11
+ // smart-search is installed alongside cursor-trellis in node_modules
12
+ // Navigate from bin/ -> ../ -> node_modules/@blxzer/smart-search/bin/smart-search.js
13
+ const smartSearchBin = join(
14
+ __dirname,
15
+ "..",
16
+ "node_modules",
17
+ "@blxzer",
18
+ "smart-search",
19
+ "bin",
20
+ "smart-search.js"
21
+ );
19
22
 
20
23
  const child = spawn(process.execPath, [smartSearchBin, ...process.argv.slice(2)], {
21
24
  stdio: "inherit",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blxzer/cursor-trellis",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "AI capabilities grow like ivy — Trellis provides the structure to guide them along a disciplined path",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",