olly-molly 0.2.18 → 0.2.19

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