specrails-hub 1.2.0 → 1.2.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.
@@ -627,17 +627,20 @@ function isProcessRunning(pid) {
627
627
  }
628
628
  }
629
629
  function hubServerPath() {
630
- // CLI lives at cli/dist/specrails-hub.js; server is at server/dist/index.js (built)
631
- // In dev mode with tsx, we resolve from __filename
632
- const base = path_1.default.resolve(__dirname, '..');
633
- // Try compiled JS first, then fall back to tsx dev path
634
- const compiled = path_1.default.join(base, 'server', 'dist', 'index.js');
635
- const devTs = path_1.default.join(base, 'server', 'index.ts');
636
- if (fs_1.default.existsSync(compiled))
637
- return compiled;
630
+ // __dirname differs by runtime:
631
+ // compiled (npm install): <root>/cli/dist/ → need ../../server/dist/index.js
632
+ // tsx dev: <root>/cli/ → need ../server/dist/index.js
633
+ // Try both, compiled path first.
634
+ const fromDist = path_1.default.resolve(__dirname, '..', '..', 'server', 'dist', 'index.js');
635
+ const fromSrc = path_1.default.resolve(__dirname, '..', 'server', 'dist', 'index.js');
636
+ const devTs = path_1.default.resolve(__dirname, '..', 'server', 'index.ts');
637
+ if (fs_1.default.existsSync(fromDist))
638
+ return fromDist;
639
+ if (fs_1.default.existsSync(fromSrc))
640
+ return fromSrc;
638
641
  if (fs_1.default.existsSync(devTs))
639
642
  return devTs;
640
- return compiled;
643
+ return fromDist;
641
644
  }
642
645
  async function hubStart(port) {
643
646
  const pid = readPid();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specrails-hub",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "bin": {
5
5
  "specrails-hub": "cli/dist/specrails-hub.js"
6
6
  },