olly-molly 0.2.18 → 0.2.20

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/cli.js +18 -9
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -88,6 +88,11 @@ function getLocalVersion() {
88
88
 
89
89
  const CUSTOM_PROFILES_DIR = path.join(APP_DIR, 'custom-profiles');
90
90
 
91
+ function hasProductionBuild(standaloneServerPath) {
92
+ return fs.existsSync(path.join(APP_DIR, '.next', 'BUILD_ID')) ||
93
+ fs.existsSync(standaloneServerPath);
94
+ }
95
+
91
96
  function backupUserData() {
92
97
  const backupDir = path.join(os.tmpdir(), 'olly-molly-backup');
93
98
  fs.mkdirSync(backupDir, { recursive: true });
@@ -142,6 +147,7 @@ async function main() {
142
147
  const localVersion = getLocalVersion();
143
148
  const npmVersion = await getNpmVersion();
144
149
  const prebuiltUrl = getPrebuiltUrl(npmVersion);
150
+ const standaloneServerPath = path.join(APP_DIR, '.next', 'standalone', 'server.js');
145
151
 
146
152
  async function downloadApp() {
147
153
  if (prebuiltUrl) {
@@ -183,8 +189,14 @@ async function main() {
183
189
  execSync('npm install --omit=dev', { cwd: APP_DIR, stdio: 'inherit' });
184
190
  }
185
191
 
192
+ if (usedPrebuilt && !fs.existsSync(standaloneServerPath)) {
193
+ usedPrebuilt = false;
194
+ needsInstall = true;
195
+ needsBuild = true;
196
+ }
197
+
186
198
  // Build
187
- if (needsBuild || !fs.existsSync(path.join(APP_DIR, '.next'))) {
199
+ if (needsBuild || !hasProductionBuild(standaloneServerPath)) {
188
200
  console.log('\nšŸ”Ø Building...\n');
189
201
  execSync('npm run build', { cwd: APP_DIR, stdio: 'inherit' });
190
202
  }
@@ -204,19 +216,16 @@ async function main() {
204
216
 
205
217
  let server;
206
218
  if (usedPrebuilt) {
207
- const serverPath = path.join(APP_DIR, '.next', 'standalone', 'server.js');
208
- if (!fs.existsSync(serverPath)) {
209
- throw new Error('Prebuilt bundle missing .next/standalone/server.js');
210
- }
211
- server = spawn('node', [serverPath], {
219
+ server = spawn('node', [standaloneServerPath], {
212
220
  cwd: APP_DIR,
213
221
  stdio: 'inherit',
214
222
  env: { ...process.env, PORT: '1234' },
215
- shell: true
223
+ shell: false
216
224
  });
217
225
  } else {
218
- server = spawn('npx', ['next', 'start', '--port', '1234'], {
219
- cwd: APP_DIR, stdio: 'inherit', shell: true
226
+ const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
227
+ server = spawn(npxCmd, ['next', 'start', '--port', '1234'], {
228
+ cwd: APP_DIR, stdio: 'inherit', shell: false
220
229
  });
221
230
  }
222
231
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "olly-molly",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
4
4
  "description": "Your AI Development Team, Running Locally - Manage AI agents (PM, Frontend, Backend, QA) from a beautiful kanban board",
5
5
  "keywords": [
6
6
  "ai",