projax 1.3.1 → 1.3.3

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.
@@ -55,8 +55,11 @@ function loadCore() {
55
55
  return cachedCore;
56
56
  }
57
57
  const candidates = [
58
+ path.join(__dirname, 'core', 'index.js'),
58
59
  path.join(__dirname, 'core'),
60
+ path.join(__dirname, '..', 'core', 'dist', 'index.js'),
59
61
  path.join(__dirname, '..', 'core', 'dist'),
62
+ path.join(__dirname, '..', '..', 'core', 'dist', 'index.js'),
60
63
  path.join(__dirname, '..', '..', 'core', 'dist'),
61
64
  'projax-core',
62
65
  ];
@@ -55,12 +55,12 @@ function resolveCore() {
55
55
  return cachedCore;
56
56
  }
57
57
  const candidates = [
58
- // Packaged desktop build (core copied into dist/core)
58
+ path.join(__dirname, 'core', 'index.js'),
59
59
  path.join(__dirname, 'core'),
60
- // Running from workspace build output
60
+ path.join(__dirname, '..', '..', 'core', 'dist', 'index.js'),
61
61
  path.join(__dirname, '..', '..', 'core', 'dist'),
62
+ path.join(__dirname, '..', 'core', 'dist', 'index.js'),
62
63
  path.join(__dirname, '..', 'core', 'dist'),
63
- // Fallback: installed module (during development)
64
64
  'projax-core',
65
65
  ];
66
66
  for (const candidate of candidates) {
package/dist/index.js CHANGED
@@ -102,11 +102,27 @@ async function checkAPIStatus() {
102
102
  }
103
103
  return { running: false, port: null };
104
104
  }
105
+ function resolveApiEntry() {
106
+ const candidates = [
107
+ // Packaged CLI (dist/api/index.js)
108
+ path.join(__dirname, 'api', 'index.js'),
109
+ // Development builds inside workspace
110
+ path.join(__dirname, '..', 'api', 'dist', 'index.js'),
111
+ path.join(__dirname, '..', '..', 'api', 'dist', 'index.js'),
112
+ path.join(__dirname, '..', '..', '..', 'api', 'dist', 'index.js'),
113
+ ];
114
+ for (const candidate of candidates) {
115
+ if (fs.existsSync(candidate)) {
116
+ return candidate;
117
+ }
118
+ }
119
+ return null;
120
+ }
105
121
  // Function to start the API server
106
122
  async function startAPIServer(silent = false) {
107
123
  const { spawn } = require('child_process');
108
- const apiPath = path.join(__dirname, '..', '..', 'api', 'dist', 'index.js');
109
- if (!fs.existsSync(apiPath)) {
124
+ const apiPath = resolveApiEntry();
125
+ if (!apiPath) {
110
126
  if (!silent) {
111
127
  console.error('Error: API server not found. Please build it first: npm run build --workspace=packages/api');
112
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projax",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "CLI tool for managing local development projects",
5
5
  "main": "dist/index.js",
6
6
  "bin": {