@pixelbyte-software/pixcode 1.40.3 → 1.40.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.
- package/README.md +3 -0
- package/dist/assets/{index-Cc_ji8dI.js → index-DROaSsD_.js} +50 -50
- package/dist/assets/index-LZgOC7Q_.css +32 -0
- package/dist/index.html +2 -2
- package/dist/landing.html +1 -1
- package/dist-server/server/routes/live-view.js +2 -2
- package/dist-server/server/routes/live-view.js.map +1 -1
- package/dist-server/server/services/install-jobs.js +1 -1
- package/dist-server/server/services/install-jobs.js.map +1 -1
- package/dist-server/server/services/live-view.js +125 -8
- package/dist-server/server/services/live-view.js.map +1 -1
- package/dist-server/server/services/managed-runtimes.js +409 -0
- package/dist-server/server/services/managed-runtimes.js.map +1 -0
- package/package.json +1 -1
- package/scripts/smoke/live-view-integration.mjs +67 -6
- package/server/routes/live-view.js +2 -2
- package/server/services/install-jobs.js +1 -1
- package/server/services/live-view.js +130 -8
- package/server/services/managed-runtimes.js +439 -0
- package/dist/assets/index-I_EBn-XU.css +0 -32
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { promises as fs } from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import * as tar from 'tar';
|
|
6
|
+
import { buildCliSpawnEnv, findExecutableOnPath, resolveNpmCommand } from './install-jobs.js';
|
|
7
|
+
const DEFAULT_RUNTIMES_HOME = path.join(os.homedir(), '.pixcode', 'runtimes');
|
|
8
|
+
const MANIFEST_FILE = 'pixcode-runtime.json';
|
|
9
|
+
const installLocks = new Map();
|
|
10
|
+
function runtimesHome(env = process.env) {
|
|
11
|
+
return env.PIXCODE_MANAGED_RUNTIMES_HOME || DEFAULT_RUNTIMES_HOME;
|
|
12
|
+
}
|
|
13
|
+
function runtimeDir(id, env = process.env) {
|
|
14
|
+
return path.join(runtimesHome(env), id);
|
|
15
|
+
}
|
|
16
|
+
function manifestPath(id, env = process.env) {
|
|
17
|
+
return path.join(runtimeDir(id, env), MANIFEST_FILE);
|
|
18
|
+
}
|
|
19
|
+
async function fileExists(filePath) {
|
|
20
|
+
try {
|
|
21
|
+
const stats = await fs.stat(filePath);
|
|
22
|
+
return stats.isFile();
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function readManifest(id, env = process.env) {
|
|
29
|
+
try {
|
|
30
|
+
const content = await fs.readFile(manifestPath(id, env), 'utf8');
|
|
31
|
+
const manifest = JSON.parse(content);
|
|
32
|
+
if (manifest?.executablePath && await fileExists(manifest.executablePath)) {
|
|
33
|
+
return manifest;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// Missing or malformed manifests are treated as not installed.
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
function platformTokens() {
|
|
42
|
+
if (process.platform === 'win32')
|
|
43
|
+
return ['windows'];
|
|
44
|
+
if (process.platform === 'darwin')
|
|
45
|
+
return ['mac', 'darwin'];
|
|
46
|
+
if (process.platform === 'linux')
|
|
47
|
+
return ['linux'];
|
|
48
|
+
return [process.platform];
|
|
49
|
+
}
|
|
50
|
+
function archTokens() {
|
|
51
|
+
if (process.arch === 'x64')
|
|
52
|
+
return ['x86_64', 'amd64', 'x64'];
|
|
53
|
+
if (process.arch === 'arm64')
|
|
54
|
+
return ['aarch64', 'arm64'];
|
|
55
|
+
return [process.arch];
|
|
56
|
+
}
|
|
57
|
+
function scoreFrankenPhpAsset(assetName) {
|
|
58
|
+
const name = assetName.toLowerCase();
|
|
59
|
+
if (!name.includes('frankenphp'))
|
|
60
|
+
return -1;
|
|
61
|
+
if (name.includes('debug'))
|
|
62
|
+
return -1;
|
|
63
|
+
if (!platformTokens().some((token) => name.includes(token)))
|
|
64
|
+
return -1;
|
|
65
|
+
if (!archTokens().some((token) => name.includes(token)))
|
|
66
|
+
return -1;
|
|
67
|
+
let score = 10;
|
|
68
|
+
if (process.platform === 'win32' && name.endsWith('.zip'))
|
|
69
|
+
score += 10;
|
|
70
|
+
if (process.platform !== 'win32' && !name.endsWith('.zip'))
|
|
71
|
+
score += 10;
|
|
72
|
+
if (!name.includes('gnu'))
|
|
73
|
+
score += 2;
|
|
74
|
+
if (name.endsWith('.tar.gz') || name.endsWith('.tgz'))
|
|
75
|
+
score += 1;
|
|
76
|
+
return score;
|
|
77
|
+
}
|
|
78
|
+
function selectFrankenPhpAsset(release) {
|
|
79
|
+
const assets = Array.isArray(release?.assets) ? release.assets : [];
|
|
80
|
+
const candidates = assets
|
|
81
|
+
.map((asset) => ({ asset, score: scoreFrankenPhpAsset(asset.name || '') }))
|
|
82
|
+
.filter((entry) => entry.score >= 0)
|
|
83
|
+
.sort((a, b) => b.score - a.score);
|
|
84
|
+
return candidates[0]?.asset || null;
|
|
85
|
+
}
|
|
86
|
+
async function fetchJson(url, env = process.env) {
|
|
87
|
+
const headers = {
|
|
88
|
+
Accept: 'application/vnd.github+json',
|
|
89
|
+
'User-Agent': 'Pixcode Live View',
|
|
90
|
+
};
|
|
91
|
+
if (env.GITHUB_TOKEN)
|
|
92
|
+
headers.Authorization = `Bearer ${env.GITHUB_TOKEN}`;
|
|
93
|
+
const response = await fetch(url, { headers });
|
|
94
|
+
if (!response.ok) {
|
|
95
|
+
throw new Error(`Runtime metadata request failed with HTTP ${response.status}`);
|
|
96
|
+
}
|
|
97
|
+
return response.json();
|
|
98
|
+
}
|
|
99
|
+
async function downloadFile(url, targetFile, env = process.env) {
|
|
100
|
+
const headers = { 'User-Agent': 'Pixcode Live View' };
|
|
101
|
+
if (env.GITHUB_TOKEN && url.includes('github.com'))
|
|
102
|
+
headers.Authorization = `Bearer ${env.GITHUB_TOKEN}`;
|
|
103
|
+
const response = await fetch(url, { headers });
|
|
104
|
+
if (!response.ok) {
|
|
105
|
+
throw new Error(`Runtime download failed with HTTP ${response.status}`);
|
|
106
|
+
}
|
|
107
|
+
const buffer = Buffer.from(await response.arrayBuffer());
|
|
108
|
+
await fs.writeFile(targetFile, buffer);
|
|
109
|
+
}
|
|
110
|
+
function runProcess(command, args, options = {}) {
|
|
111
|
+
return new Promise((resolve, reject) => {
|
|
112
|
+
let stderr = '';
|
|
113
|
+
const child = spawn(command, args, {
|
|
114
|
+
...options,
|
|
115
|
+
stdio: ['ignore', 'ignore', 'pipe'],
|
|
116
|
+
windowsHide: true,
|
|
117
|
+
});
|
|
118
|
+
child.stderr.on('data', (chunk) => {
|
|
119
|
+
stderr += chunk.toString();
|
|
120
|
+
});
|
|
121
|
+
child.on('error', reject);
|
|
122
|
+
child.on('close', (code) => {
|
|
123
|
+
if (code === 0) {
|
|
124
|
+
resolve();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
reject(new Error(`${command} exited with code ${code}${stderr ? `: ${stderr.trim()}` : ''}`));
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
async function extractZip(archivePath, targetDir, env = process.env) {
|
|
132
|
+
if (process.platform === 'win32') {
|
|
133
|
+
const shell = env.ComSpec || process.env.ComSpec || 'powershell.exe';
|
|
134
|
+
const isCmd = shell.toLowerCase().endsWith('cmd.exe');
|
|
135
|
+
if (isCmd) {
|
|
136
|
+
await runProcess('powershell.exe', [
|
|
137
|
+
'-NoProfile',
|
|
138
|
+
'-ExecutionPolicy',
|
|
139
|
+
'Bypass',
|
|
140
|
+
'-Command',
|
|
141
|
+
'Expand-Archive -Force -LiteralPath $args[0] -DestinationPath $args[1]',
|
|
142
|
+
archivePath,
|
|
143
|
+
targetDir,
|
|
144
|
+
], { env });
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
await runProcess(shell, [
|
|
148
|
+
'-NoProfile',
|
|
149
|
+
'-ExecutionPolicy',
|
|
150
|
+
'Bypass',
|
|
151
|
+
'-Command',
|
|
152
|
+
'Expand-Archive -Force -LiteralPath $args[0] -DestinationPath $args[1]',
|
|
153
|
+
archivePath,
|
|
154
|
+
targetDir,
|
|
155
|
+
], { env });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
await runProcess('unzip', ['-q', archivePath, '-d', targetDir], { env });
|
|
159
|
+
}
|
|
160
|
+
async function extractTarGz(archivePath, targetDir, env = process.env) {
|
|
161
|
+
void env;
|
|
162
|
+
await tar.x({
|
|
163
|
+
file: archivePath,
|
|
164
|
+
cwd: targetDir,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
async function findRuntimeExecutable(searchRoot, binaryName) {
|
|
168
|
+
const expectedNames = process.platform === 'win32'
|
|
169
|
+
? [`${binaryName}.exe`, binaryName]
|
|
170
|
+
: [binaryName];
|
|
171
|
+
const stack = [searchRoot];
|
|
172
|
+
while (stack.length > 0) {
|
|
173
|
+
const current = stack.pop();
|
|
174
|
+
const entries = await fs.readdir(current, { withFileTypes: true }).catch(() => []);
|
|
175
|
+
for (const entry of entries) {
|
|
176
|
+
const full = path.join(current, entry.name);
|
|
177
|
+
if (entry.isDirectory()) {
|
|
178
|
+
stack.push(full);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if (entry.isFile() && expectedNames.includes(entry.name)) {
|
|
182
|
+
return full;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
async function installFrankenPhp(env = process.env) {
|
|
189
|
+
const releaseApiUrl = env.PIXCODE_FRANKENPHP_RELEASE_API
|
|
190
|
+
|| 'https://api.github.com/repos/php/frankenphp/releases/latest';
|
|
191
|
+
const release = env.PIXCODE_FRANKENPHP_URL ? null : await fetchJson(releaseApiUrl, env);
|
|
192
|
+
const asset = env.PIXCODE_FRANKENPHP_URL
|
|
193
|
+
? {
|
|
194
|
+
name: path.basename(new URL(env.PIXCODE_FRANKENPHP_URL).pathname),
|
|
195
|
+
browser_download_url: env.PIXCODE_FRANKENPHP_URL,
|
|
196
|
+
}
|
|
197
|
+
: selectFrankenPhpAsset(release);
|
|
198
|
+
if (!asset?.browser_download_url) {
|
|
199
|
+
throw new Error('No FrankenPHP binary is available for this operating system and CPU architecture.');
|
|
200
|
+
}
|
|
201
|
+
const baseDir = runtimeDir('frankenphp', env);
|
|
202
|
+
const stagingDir = path.join(baseDir, `.staging-${Date.now()}`);
|
|
203
|
+
const currentDir = path.join(baseDir, 'current');
|
|
204
|
+
await fs.mkdir(stagingDir, { recursive: true });
|
|
205
|
+
const archivePath = path.join(stagingDir, asset.name || 'frankenphp');
|
|
206
|
+
await downloadFile(asset.browser_download_url, archivePath, env);
|
|
207
|
+
let executablePath = archivePath;
|
|
208
|
+
const assetName = (asset.name || '').toLowerCase();
|
|
209
|
+
if (assetName.endsWith('.zip')) {
|
|
210
|
+
await extractZip(archivePath, stagingDir, env);
|
|
211
|
+
executablePath = await findRuntimeExecutable(stagingDir, 'frankenphp');
|
|
212
|
+
if (!executablePath) {
|
|
213
|
+
throw new Error('Downloaded FrankenPHP archive did not contain a frankenphp executable.');
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else if (assetName.endsWith('.tar.gz') || assetName.endsWith('.tgz')) {
|
|
217
|
+
await extractTarGz(archivePath, stagingDir, env);
|
|
218
|
+
executablePath = await findRuntimeExecutable(stagingDir, 'frankenphp');
|
|
219
|
+
if (!executablePath) {
|
|
220
|
+
throw new Error('Downloaded FrankenPHP archive did not contain a frankenphp executable.');
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (process.platform !== 'win32') {
|
|
224
|
+
await fs.chmod(executablePath, 0o755).catch(() => undefined);
|
|
225
|
+
}
|
|
226
|
+
await fs.rm(currentDir, { recursive: true, force: true });
|
|
227
|
+
await fs.mkdir(currentDir, { recursive: true });
|
|
228
|
+
const finalName = process.platform === 'win32' ? 'frankenphp.exe' : 'frankenphp';
|
|
229
|
+
const finalExecutable = path.join(currentDir, finalName);
|
|
230
|
+
await fs.copyFile(executablePath, finalExecutable);
|
|
231
|
+
if (process.platform !== 'win32') {
|
|
232
|
+
await fs.chmod(finalExecutable, 0o755).catch(() => undefined);
|
|
233
|
+
}
|
|
234
|
+
const manifest = {
|
|
235
|
+
id: 'frankenphp',
|
|
236
|
+
label: 'Pixcode PHP runtime',
|
|
237
|
+
provider: 'FrankenPHP',
|
|
238
|
+
version: release?.tag_name || 'custom',
|
|
239
|
+
executablePath: finalExecutable,
|
|
240
|
+
sourceUrl: asset.browser_download_url,
|
|
241
|
+
installedAt: new Date().toISOString(),
|
|
242
|
+
};
|
|
243
|
+
await fs.writeFile(manifestPath('frankenphp', env), JSON.stringify(manifest, null, 2));
|
|
244
|
+
await fs.rm(stagingDir, { recursive: true, force: true }).catch(() => undefined);
|
|
245
|
+
return manifest;
|
|
246
|
+
}
|
|
247
|
+
async function installNpmRuntime(env = process.env) {
|
|
248
|
+
const registryUrl = env.PIXCODE_NPM_RUNTIME_REGISTRY
|
|
249
|
+
|| 'https://registry.npmjs.org/npm/latest';
|
|
250
|
+
const metadata = await fetchJson(registryUrl, env);
|
|
251
|
+
const tarballUrl = metadata?.dist?.tarball;
|
|
252
|
+
if (!tarballUrl) {
|
|
253
|
+
throw new Error('No npm runtime tarball is available from the npm registry.');
|
|
254
|
+
}
|
|
255
|
+
const baseDir = runtimeDir('npm', env);
|
|
256
|
+
const stagingDir = path.join(baseDir, `.staging-${Date.now()}`);
|
|
257
|
+
const currentDir = path.join(baseDir, 'current');
|
|
258
|
+
await fs.mkdir(stagingDir, { recursive: true });
|
|
259
|
+
const archivePath = path.join(stagingDir, 'npm-runtime.tgz');
|
|
260
|
+
await downloadFile(tarballUrl, archivePath, env);
|
|
261
|
+
await extractTarGz(archivePath, stagingDir, env);
|
|
262
|
+
const packageDir = path.join(stagingDir, 'package');
|
|
263
|
+
const executablePath = path.join(packageDir, 'bin', 'npm-cli.js');
|
|
264
|
+
if (!(await fileExists(executablePath))) {
|
|
265
|
+
throw new Error('Downloaded npm runtime did not contain bin/npm-cli.js.');
|
|
266
|
+
}
|
|
267
|
+
await fs.rm(currentDir, { recursive: true, force: true });
|
|
268
|
+
await fs.cp(packageDir, currentDir, { recursive: true, force: true });
|
|
269
|
+
const finalExecutable = path.join(currentDir, 'bin', 'npm-cli.js');
|
|
270
|
+
const manifest = {
|
|
271
|
+
id: 'npm',
|
|
272
|
+
label: 'Pixcode Node package runner',
|
|
273
|
+
provider: 'npm',
|
|
274
|
+
version: metadata?.version || 'latest',
|
|
275
|
+
executablePath: finalExecutable,
|
|
276
|
+
runner: 'node',
|
|
277
|
+
sourceUrl: tarballUrl,
|
|
278
|
+
installedAt: new Date().toISOString(),
|
|
279
|
+
};
|
|
280
|
+
await fs.writeFile(manifestPath('npm', env), JSON.stringify(manifest, null, 2));
|
|
281
|
+
await fs.rm(stagingDir, { recursive: true, force: true }).catch(() => undefined);
|
|
282
|
+
return manifest;
|
|
283
|
+
}
|
|
284
|
+
export async function getManagedRuntimeStatus(id, options = {}) {
|
|
285
|
+
const env = options.env || process.env;
|
|
286
|
+
const preferManaged = Boolean(options.preferManaged);
|
|
287
|
+
if (id !== 'frankenphp' && id !== 'npm') {
|
|
288
|
+
return {
|
|
289
|
+
id,
|
|
290
|
+
status: 'unsupported',
|
|
291
|
+
installable: false,
|
|
292
|
+
reason: 'Pixcode does not have a managed runtime for this stack yet.',
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
if (id === 'npm') {
|
|
296
|
+
if (!preferManaged) {
|
|
297
|
+
const spawnEnv = buildCliSpawnEnv(env);
|
|
298
|
+
const npmExecutable = resolveNpmCommand(spawnEnv);
|
|
299
|
+
if (npmExecutable) {
|
|
300
|
+
return {
|
|
301
|
+
id,
|
|
302
|
+
label: 'npm',
|
|
303
|
+
status: 'system',
|
|
304
|
+
installable: true,
|
|
305
|
+
executablePath: npmExecutable,
|
|
306
|
+
runner: npmExecutable.endsWith('.js') ? 'node' : undefined,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
const manifest = await readManifest(id, env);
|
|
311
|
+
if (manifest) {
|
|
312
|
+
return {
|
|
313
|
+
id,
|
|
314
|
+
label: manifest.label || 'Pixcode Node package runner',
|
|
315
|
+
status: 'installed',
|
|
316
|
+
installable: true,
|
|
317
|
+
executablePath: manifest.executablePath,
|
|
318
|
+
runner: manifest.runner || 'node',
|
|
319
|
+
version: manifest.version,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
return {
|
|
323
|
+
id,
|
|
324
|
+
label: 'Pixcode Node package runner',
|
|
325
|
+
provider: 'npm',
|
|
326
|
+
status: 'missing',
|
|
327
|
+
installable: true,
|
|
328
|
+
reason: 'Pixcode will prepare a local Node package runner automatically before starting this project.',
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
if (!preferManaged) {
|
|
332
|
+
const spawnEnv = buildCliSpawnEnv(env);
|
|
333
|
+
const systemExecutable = findExecutableOnPath('frankenphp', spawnEnv);
|
|
334
|
+
if (systemExecutable) {
|
|
335
|
+
return {
|
|
336
|
+
id,
|
|
337
|
+
label: 'FrankenPHP',
|
|
338
|
+
status: 'system',
|
|
339
|
+
installable: true,
|
|
340
|
+
executablePath: systemExecutable,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
const manifest = await readManifest(id, env);
|
|
345
|
+
if (manifest) {
|
|
346
|
+
return {
|
|
347
|
+
id,
|
|
348
|
+
label: manifest.label || 'Pixcode PHP runtime',
|
|
349
|
+
status: 'installed',
|
|
350
|
+
installable: true,
|
|
351
|
+
executablePath: manifest.executablePath,
|
|
352
|
+
version: manifest.version,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
return {
|
|
356
|
+
id,
|
|
357
|
+
label: 'Pixcode PHP runtime',
|
|
358
|
+
provider: 'FrankenPHP',
|
|
359
|
+
status: 'missing',
|
|
360
|
+
installable: true,
|
|
361
|
+
reason: 'Pixcode will prepare a local PHP runtime automatically before starting this project.',
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
export async function ensureManagedRuntime(id, options = {}) {
|
|
365
|
+
const env = options.env || process.env;
|
|
366
|
+
const status = await getManagedRuntimeStatus(id, {
|
|
367
|
+
env,
|
|
368
|
+
preferManaged: options.preferManaged,
|
|
369
|
+
});
|
|
370
|
+
if (status.executablePath)
|
|
371
|
+
return status;
|
|
372
|
+
if (!status.installable) {
|
|
373
|
+
throw new Error(status.reason || 'This runtime cannot be prepared automatically.');
|
|
374
|
+
}
|
|
375
|
+
const lockKey = `${runtimesHome(env)}:${id}`;
|
|
376
|
+
if (installLocks.has(lockKey))
|
|
377
|
+
return installLocks.get(lockKey);
|
|
378
|
+
const installPromise = (async () => {
|
|
379
|
+
if (id === 'frankenphp') {
|
|
380
|
+
const manifest = await installFrankenPhp(env);
|
|
381
|
+
return {
|
|
382
|
+
id,
|
|
383
|
+
label: manifest.label,
|
|
384
|
+
status: 'installed',
|
|
385
|
+
installable: true,
|
|
386
|
+
executablePath: manifest.executablePath,
|
|
387
|
+
version: manifest.version,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
if (id === 'npm') {
|
|
391
|
+
const manifest = await installNpmRuntime(env);
|
|
392
|
+
return {
|
|
393
|
+
id,
|
|
394
|
+
label: manifest.label,
|
|
395
|
+
status: 'installed',
|
|
396
|
+
installable: true,
|
|
397
|
+
executablePath: manifest.executablePath,
|
|
398
|
+
runner: manifest.runner || 'node',
|
|
399
|
+
version: manifest.version,
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
throw new Error(`Unsupported managed runtime: ${id}`);
|
|
403
|
+
})().finally(() => {
|
|
404
|
+
installLocks.delete(lockKey);
|
|
405
|
+
});
|
|
406
|
+
installLocks.set(lockKey, installPromise);
|
|
407
|
+
return installPromise;
|
|
408
|
+
}
|
|
409
|
+
//# sourceMappingURL=managed-runtimes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-runtimes.js","sour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;YACjB,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC;YAC9C,OAAO;gBACL,EAAE;gBACF,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,MAAM,EAAE,WAAW;gBACnB,WAAW,EAAE,IAAI;gBACjB,cAAc,EAAE,QAAQ,CAAC,cAAc;gBACvC,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,MAAM;gBACjC,OAAO,EAAE,QAAQ,CAAC,OAAO;aAC1B,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,EAAE,EAAE,CAAC,CAAC;IACxD,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;QAChB,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC1C,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixelbyte-software/pixcode",
|
|
3
|
-
"version": "1.40.
|
|
3
|
+
"version": "1.40.5",
|
|
4
4
|
"description": "Self-hosted AI coding agent control room for Claude Code, Cursor CLI, OpenAI Codex, Gemini CLI, Qwen Code, and OpenCode with chat, files, shell, Git, orchestration, API keys, Telegram, MCP, plugins, themes, and desktop/server deployment.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist-server/server/index.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mkdtemp, writeFile } from 'node:fs/promises';
|
|
1
|
+
import { chmod, mkdtemp, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { tmpdir } from 'node:os';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
@@ -83,11 +83,37 @@ assert.ok(
|
|
|
83
83
|
liveViewPanel.includes('targetUnavailableReason') && liveViewPanel.includes('liveView.runnerUnavailable'),
|
|
84
84
|
'Live View panel should show a clear unavailable-runner message before launching a missing runtime.',
|
|
85
85
|
);
|
|
86
|
+
assert.ok(
|
|
87
|
+
liveViewPanel.includes('managedRuntime') && liveViewPanel.includes('liveView.managedRuntimePreparing'),
|
|
88
|
+
'Live View panel should explain that Pixcode can prepare managed runtimes automatically.',
|
|
89
|
+
);
|
|
90
|
+
assert.ok(
|
|
91
|
+
liveViewPanel.includes('isPreparingManagedRuntime') && liveViewPanel.includes('liveView.preparingRuntime'),
|
|
92
|
+
'Live View panel should show a visible in-progress state while Pixcode downloads and installs a managed runtime.',
|
|
93
|
+
);
|
|
86
94
|
assert.ok(
|
|
87
95
|
liveViewPanel.includes("runAction('restart')"),
|
|
88
96
|
'Live View panel should expose a restart action for failed process runners.',
|
|
89
97
|
);
|
|
90
98
|
|
|
99
|
+
const managedRuntimes = await read('server/services/managed-runtimes.js');
|
|
100
|
+
assert.ok(
|
|
101
|
+
managedRuntimes.includes("process.platform === 'win32'") && managedRuntimes.includes("process.platform === 'darwin'") && managedRuntimes.includes("process.platform === 'linux'"),
|
|
102
|
+
'Managed runtime selection should explicitly handle Windows, macOS, and Linux assets.',
|
|
103
|
+
);
|
|
104
|
+
assert.ok(
|
|
105
|
+
managedRuntimes.includes('extractZip') && managedRuntimes.includes('extractTarGz'),
|
|
106
|
+
'Managed runtime installation should handle common Windows zip and macOS/Linux tarball assets.',
|
|
107
|
+
);
|
|
108
|
+
assert.ok(
|
|
109
|
+
managedRuntimes.includes('preferManaged'),
|
|
110
|
+
'Managed PHP Live View should be able to skip external runtimes and prefer Pixcode-owned binaries.',
|
|
111
|
+
);
|
|
112
|
+
assert.ok(
|
|
113
|
+
managedRuntimes.includes("id === 'npm'") && managedRuntimes.includes('installNpmRuntime'),
|
|
114
|
+
'Managed runtimes should include a Pixcode-owned npm runner for JavaScript projects when npm is not on PATH.',
|
|
115
|
+
);
|
|
116
|
+
|
|
91
117
|
const serverIndex = await read('server/index.js');
|
|
92
118
|
assert.ok(
|
|
93
119
|
serverIndex.includes("app.use('/api/live-view', authenticateToken, liveViewRoutes)"),
|
|
@@ -138,6 +164,18 @@ const viteTarget = await detectLiveViewTarget(viteProject);
|
|
|
138
164
|
assert.equal(viteTarget.available, true, 'Vite projects should be detected.');
|
|
139
165
|
assert.equal(viteTarget.command?.id, 'npm-dev-vite', 'Vite projects should get a Vite-aware command.');
|
|
140
166
|
|
|
167
|
+
const viteMissingNpmTarget = await detectLiveViewTarget(viteProject, {
|
|
168
|
+
env: {
|
|
169
|
+
...process.env,
|
|
170
|
+
PATH: '',
|
|
171
|
+
Path: '',
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
assert.equal(viteMissingNpmTarget.available, true, 'Vite projects should remain runnable through a Pixcode-managed package runner when npm is missing from PATH.');
|
|
175
|
+
assert.equal(viteMissingNpmTarget.command?.id, 'npm-dev-vite', 'Vite projects should keep the original Vite command identity.');
|
|
176
|
+
assert.equal(viteMissingNpmTarget.managedRuntime?.id, 'npm', 'Missing npm should select the Pixcode-managed npm runner.');
|
|
177
|
+
assert.equal(viteMissingNpmTarget.managedRuntime?.status, 'missing', 'Missing npm should report that the managed package runner still needs preparation.');
|
|
178
|
+
|
|
141
179
|
const djangoTarget = await detectLiveViewTarget(djangoProject);
|
|
142
180
|
assert.equal(djangoTarget.available, true, 'Django projects should be detected from manage.py.');
|
|
143
181
|
assert.equal(djangoTarget.command?.id, 'python-django', 'Django projects should get a runserver command.');
|
|
@@ -148,14 +186,37 @@ const phpMissingRuntimeTarget = await detectLiveViewTarget(phpProject, {
|
|
|
148
186
|
PATH: '',
|
|
149
187
|
},
|
|
150
188
|
});
|
|
151
|
-
assert.equal(phpMissingRuntimeTarget.available,
|
|
189
|
+
assert.equal(phpMissingRuntimeTarget.available, true, 'PHP projects should remain runnable through a Pixcode-managed runtime when php is missing from PATH.');
|
|
152
190
|
assert.equal(phpMissingRuntimeTarget.framework, 'PHP', 'Missing PHP runtime diagnostics should keep the detected framework.');
|
|
153
|
-
assert.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
191
|
+
assert.equal(phpMissingRuntimeTarget.managedRuntime?.id, 'frankenphp', 'Missing PHP should select the Pixcode-managed FrankenPHP runtime.');
|
|
192
|
+
assert.equal(phpMissingRuntimeTarget.managedRuntime?.status, 'missing', 'Missing PHP should report that the managed runtime still needs preparation.');
|
|
193
|
+
assert.equal(phpMissingRuntimeTarget.command?.id, 'frankenphp-php-server', 'Missing PHP should use a managed FrankenPHP server command.');
|
|
194
|
+
assert.ok(
|
|
195
|
+
!/PATH/i.test(phpMissingRuntimeTarget.reason || ''),
|
|
196
|
+
'Missing PHP should use product language instead of exposing PATH setup as the primary message.',
|
|
157
197
|
);
|
|
158
198
|
|
|
199
|
+
const fakeBin = path.join(workspace, 'fake-bin');
|
|
200
|
+
await mkdir(fakeBin, { recursive: true });
|
|
201
|
+
const fakePhp = path.join(fakeBin, process.platform === 'win32' ? 'php.cmd' : 'php');
|
|
202
|
+
await writeFile(fakePhp, process.platform === 'win32' ? '@echo off\r\nexit /b 0\r\n' : '#!/bin/sh\nexit 0\n');
|
|
203
|
+
if (process.platform !== 'win32') {
|
|
204
|
+
await chmod(fakePhp, 0o755);
|
|
205
|
+
}
|
|
206
|
+
const fakePath = process.platform === 'win32'
|
|
207
|
+
? `${fakeBin};${process.env.PATH || ''}`
|
|
208
|
+
: `${fakeBin}:${process.env.PATH || ''}`;
|
|
209
|
+
const phpSystemRuntimeTarget = await detectLiveViewTarget(phpProject, {
|
|
210
|
+
env: {
|
|
211
|
+
...process.env,
|
|
212
|
+
PATH: fakePath,
|
|
213
|
+
Path: fakePath,
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
assert.equal(phpSystemRuntimeTarget.available, true, 'PHP projects should stay runnable when php exists on PATH.');
|
|
217
|
+
assert.equal(phpSystemRuntimeTarget.command?.id, 'frankenphp-php-server', 'PHP projects should still use the Pixcode-managed runtime even when external php exists.');
|
|
218
|
+
assert.equal(phpSystemRuntimeTarget.managedRuntime?.id, 'frankenphp', 'PHP projects should prefer the Pixcode-owned FrankenPHP runtime instead of external php.');
|
|
219
|
+
|
|
159
220
|
const staticSession = await startLiveView('static-smoke', staticProject);
|
|
160
221
|
assert.equal(staticSession.status, 'running', 'Static Live View should start without a child process.');
|
|
161
222
|
assert.match(staticSession.sharePath, /^\/live\/[a-f0-9]{24}\/$/, 'Live View should expose a random public share path.');
|
|
@@ -50,8 +50,8 @@ function buildLiveViewSuggestions(session, reason) {
|
|
|
50
50
|
const suggestions = [];
|
|
51
51
|
|
|
52
52
|
if (framework.includes('php')) {
|
|
53
|
-
suggestions.push('
|
|
54
|
-
suggestions.push('If
|
|
53
|
+
suggestions.push('Pixcode can prepare a local PHP runtime automatically and keep it under your user profile.');
|
|
54
|
+
suggestions.push('If the automatic runtime download fails, check the Live View panel logs and retry.');
|
|
55
55
|
suggestions.push('Check that the project has an index.php or a valid PHP router file in the selected project root.');
|
|
56
56
|
} else if (
|
|
57
57
|
framework.includes('javascript')
|
|
@@ -459,7 +459,7 @@ export function findExecutableOnPath(name, env = process.env) {
|
|
|
459
459
|
* more reliable than trusting PATH — when Pixcode runs as a daemon, PATH
|
|
460
460
|
* is often minimal and doesn't include the user's node install.
|
|
461
461
|
*/
|
|
462
|
-
function resolveNpmCommand(env = process.env) {
|
|
462
|
+
export function resolveNpmCommand(env = process.env) {
|
|
463
463
|
const nodeDir = path.dirname(process.execPath);
|
|
464
464
|
const isWindows = process.platform === 'win32';
|
|
465
465
|
const candidates = isWindows
|