@teambit/bit 2.2.22 → 2.2.23
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@2.2.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@2.2.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@2.2.23/dist/bit.compositions.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@2.2.23/dist/bit.docs.js';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -84,6 +84,14 @@ export declare class ServerCommander {
|
|
|
84
84
|
* real cause instead of a misleading 401/upgrade message from the server.
|
|
85
85
|
*/
|
|
86
86
|
private getServerTokenIfExists;
|
|
87
|
+
/**
|
|
88
|
+
* the port from the port file, proven to be served by a process whose cwd is this workspace.
|
|
89
|
+
*
|
|
90
|
+
* Only the `cli-server-port` command uses this. Its whole job is to answer "is there a usable
|
|
91
|
+
* server?" for external clients such as the VS Code extension, which expect no output when there
|
|
92
|
+
* isn't one — so it's worth two `lsof` subprocesses there. Running an actual command doesn't pay
|
|
93
|
+
* that: see the note in runCommandWithHttpServer.
|
|
94
|
+
*/
|
|
87
95
|
private getExistingUsedPort;
|
|
88
96
|
private isPortInUseForCurrentDir;
|
|
89
97
|
private getExistingPort;
|
package/dist/server-commander.js
CHANGED
|
@@ -144,6 +144,11 @@ class ServerPortFileNotFound extends Error {
|
|
|
144
144
|
super(`server port file not found at ${filePath}`);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
+
class ServerPortFileInvalid extends Error {
|
|
148
|
+
constructor(filePath, content) {
|
|
149
|
+
super(`server port file at ${filePath} does not contain a valid port: "${content}"`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
147
152
|
class ServerIsNotRunning extends Error {
|
|
148
153
|
constructor(port) {
|
|
149
154
|
super(`bit server is not running on port ${port}`);
|
|
@@ -171,7 +176,7 @@ class ServerCommander {
|
|
|
171
176
|
}
|
|
172
177
|
process.exit(0);
|
|
173
178
|
} catch (err) {
|
|
174
|
-
if (err instanceof ScopeNotFound || err instanceof ServerPortFileNotFound || err instanceof ServerIsNotRunning) {
|
|
179
|
+
if (err instanceof ScopeNotFound || err instanceof ServerPortFileNotFound || err instanceof ServerPortFileInvalid || err instanceof ServerIsNotRunning) {
|
|
175
180
|
throw err;
|
|
176
181
|
}
|
|
177
182
|
_legacy().loader.off();
|
|
@@ -190,7 +195,12 @@ class ServerCommander {
|
|
|
190
195
|
if (process.argv.includes(CMD_SERVER_PORT_DELETE)) return this.deletePortAndExit();
|
|
191
196
|
if (process.argv.includes(CMD_SERVER_TOKEN)) return this.printServerTokenAndExit();
|
|
192
197
|
(0, _bootstrap().printBitVersionIfAsked)();
|
|
193
|
-
|
|
198
|
+
// deliberately not validating the port here (see getExistingUsedPort): that costs two `lsof`
|
|
199
|
+
// subprocesses, ~320ms on every single command, to establish something the request itself
|
|
200
|
+
// already proves. Each server writes its token into its own scope dir, so a port file left
|
|
201
|
+
// behind pointing at another workspace's server gets a 401, and a dead port gets ECONNREFUSED
|
|
202
|
+
// — both handled below by dropping the stale file and falling back to running in-process.
|
|
203
|
+
const port = await this.getExistingPort();
|
|
194
204
|
const url = `http://${resolveDialHost()}:${port}/api`;
|
|
195
205
|
const shouldUsePTY = process.env.BIT_CLI_SERVER_PTY === 'true';
|
|
196
206
|
if (shouldUsePTY) {
|
|
@@ -215,29 +225,59 @@ class ServerCommander {
|
|
|
215
225
|
ttyPath,
|
|
216
226
|
isPty: shouldUsePTY
|
|
217
227
|
};
|
|
218
|
-
const
|
|
219
|
-
|
|
228
|
+
const post = async authToken => {
|
|
229
|
+
const headers = {
|
|
230
|
+
'Content-Type': 'application/json'
|
|
231
|
+
};
|
|
232
|
+
if (authToken) headers.Authorization = `Bearer ${authToken}`;
|
|
233
|
+
try {
|
|
234
|
+
return await (0, _nodeFetch().default)(`${url}/${endpoint}`, {
|
|
235
|
+
method: 'post',
|
|
236
|
+
body: JSON.stringify(body),
|
|
237
|
+
headers
|
|
238
|
+
});
|
|
239
|
+
} catch (err) {
|
|
240
|
+
if (err.code === 'ECONNREFUSED') {
|
|
241
|
+
await this.deleteServerPortFile();
|
|
242
|
+
throw new ServerIsNotRunning(port);
|
|
243
|
+
}
|
|
244
|
+
throw new Error(`failed to run command "${args.join(' ')}" on the server. ${err.message}`);
|
|
245
|
+
}
|
|
220
246
|
};
|
|
221
247
|
const token = this.getServerTokenIfExists();
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
throw new Error(`failed to run command "${args.join(' ')}" on the server. ${err.message}`);
|
|
248
|
+
let res = await post(token);
|
|
249
|
+
|
|
250
|
+
// a 401 has two possible causes, and they need opposite handling: either the port file points
|
|
251
|
+
// at a different workspace's server (stale, and dealt with below), or our own server restarted
|
|
252
|
+
// and rotated its token after we read it. The server writes the token file before it registers
|
|
253
|
+
// any route, so a server able to answer us has already published its current token — if what's
|
|
254
|
+
// on disk no longer matches what we sent, this is the restart case and retrying is enough.
|
|
255
|
+
// Without this, an unlucky command spanning a restart would delete the port file of a server
|
|
256
|
+
// that is alive and healthy, hiding it from every later client.
|
|
257
|
+
if (res.status === 401) {
|
|
258
|
+
const currentToken = this.getServerTokenIfExists();
|
|
259
|
+
if (currentToken && currentToken !== token) res = await post(currentToken);
|
|
236
260
|
}
|
|
237
261
|
if (res.ok) {
|
|
238
262
|
const results = await res.json();
|
|
263
|
+
// bit-server always answers this route with a { data, exitCode } object. Anything else means
|
|
264
|
+
// the port file points at some other listener that happened to accept the POST, so fail safe
|
|
265
|
+
// rather than reporting a foreign response as the command's result: drop the port file and
|
|
266
|
+
// let the command run in-process.
|
|
267
|
+
if (!results || typeof results !== 'object') {
|
|
268
|
+
await this.deleteServerPortFile();
|
|
269
|
+
throw new ServerIsNotRunning(port);
|
|
270
|
+
}
|
|
239
271
|
return results;
|
|
240
272
|
}
|
|
273
|
+
|
|
274
|
+
// 401 (still, after the retry above): the server on this port belongs to a different workspace,
|
|
275
|
+
// so it doesn't recognize our token. 404: whatever is listening there is not a bit server.
|
|
276
|
+
// Either way the port file is stale — drop it and let the caller fall back to in-process.
|
|
277
|
+
if (res.status === 401 || res.status === 404) {
|
|
278
|
+
await this.deleteServerPortFile();
|
|
279
|
+
throw new ServerIsNotRunning(port);
|
|
280
|
+
}
|
|
241
281
|
let jsonResponse;
|
|
242
282
|
try {
|
|
243
283
|
jsonResponse = await res.json();
|
|
@@ -349,7 +389,7 @@ Please run the command "bit server-forever" first to start the server.`));
|
|
|
349
389
|
process.stdout.write(port.toString());
|
|
350
390
|
process.exit(0);
|
|
351
391
|
} catch (err) {
|
|
352
|
-
if (err instanceof ScopeNotFound || err instanceof ServerPortFileNotFound || err instanceof ServerIsNotRunning) {
|
|
392
|
+
if (err instanceof ScopeNotFound || err instanceof ServerPortFileNotFound || err instanceof ServerPortFileInvalid || err instanceof ServerIsNotRunning) {
|
|
353
393
|
process.exit(0);
|
|
354
394
|
}
|
|
355
395
|
console.error(err.message); // eslint-disable-line no-console
|
|
@@ -435,6 +475,15 @@ Please run the command "bit server-forever" first to start the server.`));
|
|
|
435
475
|
throw err;
|
|
436
476
|
}
|
|
437
477
|
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* the port from the port file, proven to be served by a process whose cwd is this workspace.
|
|
481
|
+
*
|
|
482
|
+
* Only the `cli-server-port` command uses this. Its whole job is to answer "is there a usable
|
|
483
|
+
* server?" for external clients such as the VS Code extension, which expect no output when there
|
|
484
|
+
* isn't one — so it's worth two `lsof` subprocesses there. Running an actual command doesn't pay
|
|
485
|
+
* that: see the note in runCommandWithHttpServer.
|
|
486
|
+
*/
|
|
438
487
|
async getExistingUsedPort() {
|
|
439
488
|
const port = await this.getExistingPort();
|
|
440
489
|
const shouldSkipPortValidation = process.argv.includes(SKIP_PORT_VALIDATION_ARG);
|
|
@@ -460,15 +509,25 @@ Please run the command "bit server-forever" first to start the server.`));
|
|
|
460
509
|
}
|
|
461
510
|
async getExistingPort() {
|
|
462
511
|
const filePath = this.getServerPortFilePath();
|
|
512
|
+
let fileContent;
|
|
463
513
|
try {
|
|
464
|
-
|
|
465
|
-
return parseInt(fileContent, 10);
|
|
514
|
+
fileContent = await _fsExtra().default.readFile(filePath, 'utf8');
|
|
466
515
|
} catch (err) {
|
|
467
516
|
if (err.code === 'ENOENT') {
|
|
468
517
|
throw new ServerPortFileNotFound(filePath);
|
|
469
518
|
}
|
|
470
519
|
throw err;
|
|
471
520
|
}
|
|
521
|
+
const port = parseInt(fileContent.trim(), 10);
|
|
522
|
+
// the server writes this file with a plain overwrite, so a reader can catch it empty or
|
|
523
|
+
// half-written. Left unchecked that becomes NaN (or a truncated number) and surfaces as an
|
|
524
|
+
// opaque fetch failure, which exits instead of falling back in-process. Deliberately not
|
|
525
|
+
// deleting the file: a torn read means the server is mid-write, and the next command will see
|
|
526
|
+
// the complete value.
|
|
527
|
+
if (!Number.isInteger(port) || port <= 0 || port > 65535) {
|
|
528
|
+
throw new ServerPortFileInvalid(filePath, fileContent.trim());
|
|
529
|
+
}
|
|
530
|
+
return port;
|
|
472
531
|
}
|
|
473
532
|
async deleteServerPortFile() {
|
|
474
533
|
const filePath = this.getServerPortFilePath();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_nodeFetch","data","_interopRequireDefault","require","_net","_fsExtra","_child_process","_path","_os","_eventsource","_scopeModules","_chalk","_legacy","_bootstrap","_serverForever","e","__esModule","default","CMD_SERVER_PORT","CMD_SERVER_PORT_DELETE","CMD_SERVER_SOCKET_PORT","CMD_SERVER_TOKEN","SKIP_PORT_VALIDATION_ARG","ServerPortFileNotFound","Error","constructor","filePath","ServerIsNotRunning","port","ScopeNotFound","scopePath","ServerCommander","execute","results","runCommandWithHttpServer","exitCode","loader","off","dataToPrint","JSON","stringify","undefined","console","log","process","exit","err","error","chalk","red","message","shouldUseTTYPath","platform","env","BIT_CLI_SERVER_TTY","argv","includes","printPortAndExit","printSocketPortAndExit","deletePortAndExit","printServerTokenAndExit","printBitVersionIfAsked","getExistingUsedPort","url","resolveDialHost","shouldUsePTY","BIT_CLI_SERVER_PTY","connectToSocket","ttyPath","execSync","encoding","stdio","trim","initSSE","args","slice","on","endpoint","pwd","cwd","body","command","envBitFeatures","BIT_FEATURES","isPty","headers","token","getServerTokenIfExists","Authorization","res","fetch","method","code","deleteServerPortFile","join","ok","json","jsonResponse","statusText","Promise","resolve","reject","socketPort","getSocketPort","socket","net","createConnection","resetStdin","stdin","setRawMode","pause","destroy","resume","write","toString","end","stdout","cleanup","eventSourceOpts","eventSource","EventSource","onerror","_error","close","addEventListener","event","parsed","parse","getServerTokenFilePath","fs","readFile","findScopePath","readFileSync","getExistingPort","shouldSkipPortValidation","isPortInUse","isPortInUseForCurrentDir","pid","getPidByPort","dirUsedByPort","getCwdByPid","currentDir","getServerPortFilePath","fileContent","parseInt","remove","exports","shouldUseBitServer","commandsToSkip","hasFlag","BIT_CLI_SERVER","length","override","BIT_SERVER_HOST","split","startsWith","execCommand","cmd","exec","os","output","line","find","l","parts"],"sources":["server-commander.ts"],"sourcesContent":["/**\n * This file is responsible for interacting with bit through a long-running background process \"bit-server\" rather than directly.\n * Why not directly?\n * 1. startup cost. currently it takes around 1 second to bootstrap bit.\n * 2. an experimental package-manager saves node_modules in-memory. if a client starts a new process, it won't have the node_modules in-memory.\n *\n * In this file, there are three ways to achieve this. It's outlined in the order it was evolved.\n * The big challenge here is to show the output correctly to the client even though the server is running in a different process.\n *\n * 1. process.env.BIT_CLI_SERVER === 'true'\n * This method uses SSE - Server Send Events. The server sends events to the client with the output to print. The client listens to\n * these events and prints them. It's cumbersome. For this, the logger was changed and every time the logger needs to print to the console,\n * it was using this SSE to send events. Same with the loader.\n * Cons: Other output, such as pnpm, needs an extra effort to print - for pnpm, the \"process\" object was passed to pnpm\n * and its stdout was modified to use the SSE.\n * However, other tools that print directly to the console, such as Jest, won't work.\n *\n * 2. process.env.BIT_CLI_SERVER_TTY === 'true'\n * Because the terminal - tty is a fd (file descriptor) on mac/linux, it can be passed to the server. The server can write to this\n * fd and it will be printed to the client terminal. On the server, the process.stdout.write was monkey-patched to\n * write to the tty. (see cli-raw.route.ts file).\n * It solves the problem of Jest and other tools that print directly to the console.\n * Cons:\n * A. It doesn't work on Windows. Windows doesn't treat tty as a file descriptor.\n * B. We need two ways communication. Commands such as \"bit update\", display a prompt with option to select using the arrow keys.\n * This is not possible with the tty approach. Also, if the client hits Ctrl+C, the server won't know about it and it\n * won't kill the process.\n *\n * 3. process.env.BIT_CLI_SERVER_PTY === 'true'\n * This is the most advanced approach. It spawns a pty (pseudo terminal) process to communicate between the client and the server.\n * The client connects to the server using a socket. The server writes to the socket and the client reads from it.\n * The client also writes to the socket and the server reads from it. See server-forever.ts to understand better.\n * In order to pass terminal sequences, such as arrow keys or Ctrl+C, the stdin of the client is set to raw mode.\n * In theory, this approach could work by spawning a normal process, not pty, however, then, the stdin/stdout are non-tty,\n * and as a result, loaders such as Ora and chalk won't work.\n * With this new approach, we also support terminating and reloading the server. A new command is added\n * \"bit server-forever\", which spawns the pty-process. If the client hits Ctrl+C, this server-forever process will kill\n * the pty-process and re-load it.\n * Keep in mind, that to send the command and get the results, we still using http. The usage of the pty is only for\n * the input/output during the command.\n * I was trying to avoid the http, and use only the pty, by implementing readline to get the command from the socket,\n * but then I wasn't able to return the prompt to the user easily. So, I decided to keep the http for the request/response part.\n */\n\nimport fetch from 'node-fetch';\nimport net from 'net';\nimport fs from 'fs-extra';\nimport { exec, execSync } from 'child_process';\nimport { join } from 'path';\nimport os from 'os';\nimport EventSource from 'eventsource';\nimport { findScopePath } from '@teambit/scope.modules.find-scope-path';\nimport chalk from 'chalk';\nimport { loader } from '@teambit/legacy.loader';\nimport { printBitVersionIfAsked } from './bootstrap';\nimport { getPidByPort, getSocketPort } from './server-forever';\n\nconst CMD_SERVER_PORT = 'cli-server-port';\nconst CMD_SERVER_PORT_DELETE = 'cli-server-port-delete';\nconst CMD_SERVER_SOCKET_PORT = 'cli-server-socket-port';\nconst CMD_SERVER_TOKEN = 'cli-server-token';\nconst SKIP_PORT_VALIDATION_ARG = '--skip-port-validation';\n\nclass ServerPortFileNotFound extends Error {\n constructor(filePath: string) {\n super(`server port file not found at ${filePath}`);\n }\n}\nclass ServerIsNotRunning extends Error {\n constructor(port: number) {\n super(`bit server is not running on port ${port}`);\n }\n}\nclass ScopeNotFound extends Error {\n constructor(scopePath: string) {\n super(`scope not found at ${scopePath}`);\n }\n}\n\ntype CommandResult = { data: any; exitCode: number };\n\nexport class ServerCommander {\n async execute() {\n try {\n const results = await this.runCommandWithHttpServer();\n if (results) {\n const { data, exitCode } = results;\n loader.off();\n const dataToPrint = typeof data === 'string' ? data : JSON.stringify(data, undefined, 2);\n // eslint-disable-next-line no-console\n console.log(dataToPrint);\n process.exit(exitCode);\n }\n\n process.exit(0);\n } catch (err: any) {\n if (err instanceof ScopeNotFound || err instanceof ServerPortFileNotFound || err instanceof ServerIsNotRunning) {\n throw err;\n }\n loader.off();\n // eslint-disable-next-line no-console\n console.error(chalk.red(err.message));\n process.exit(1);\n }\n }\n\n private shouldUseTTYPath() {\n if (process.platform === 'win32') return false; // windows doesn't support tty path\n return process.env.BIT_CLI_SERVER_TTY === 'true';\n }\n\n async runCommandWithHttpServer(): Promise<CommandResult | undefined | void> {\n if (process.argv.includes(CMD_SERVER_PORT)) return this.printPortAndExit();\n if (process.argv.includes(CMD_SERVER_SOCKET_PORT)) return this.printSocketPortAndExit();\n if (process.argv.includes(CMD_SERVER_PORT_DELETE)) return this.deletePortAndExit();\n if (process.argv.includes(CMD_SERVER_TOKEN)) return this.printServerTokenAndExit();\n printBitVersionIfAsked();\n const port = await this.getExistingUsedPort();\n const url = `http://${resolveDialHost()}:${port}/api`;\n const shouldUsePTY = process.env.BIT_CLI_SERVER_PTY === 'true';\n\n if (shouldUsePTY) {\n await this.connectToSocket();\n }\n const ttyPath = this.shouldUseTTYPath()\n ? execSync('tty', {\n encoding: 'utf8',\n stdio: ['inherit', 'pipe', 'pipe'],\n }).trim()\n : undefined;\n if (!ttyPath && !shouldUsePTY) this.initSSE(url);\n // parse the args and options from the command\n const args = process.argv.slice(2);\n if (!args.includes('--json') && !args.includes('-j')) {\n loader.on();\n }\n const endpoint = `cli-raw`;\n const pwd = process.cwd();\n const body = { command: args, pwd, envBitFeatures: process.env.BIT_FEATURES, ttyPath, isPty: shouldUsePTY };\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\n const token = this.getServerTokenIfExists();\n if (token) headers.Authorization = `Bearer ${token}`;\n let res;\n try {\n res = await fetch(`${url}/${endpoint}`, {\n method: 'post',\n body: JSON.stringify(body),\n headers,\n });\n } catch (err: any) {\n if (err.code === 'ECONNREFUSED') {\n await this.deleteServerPortFile();\n throw new ServerIsNotRunning(port);\n }\n throw new Error(`failed to run command \"${args.join(' ')}\" on the server. ${err.message}`);\n }\n\n if (res.ok) {\n const results = await res.json();\n return results;\n }\n\n let jsonResponse;\n try {\n jsonResponse = await res.json();\n } catch {\n // the response is not json, ignore the body.\n }\n throw new Error(jsonResponse?.message || jsonResponse || res.statusText);\n }\n\n private async connectToSocket() {\n return new Promise<void>((resolve, reject) => {\n const socketPort = getSocketPort();\n const socket = net.createConnection({ port: socketPort });\n\n const resetStdin = () => {\n process.stdin.setRawMode(false);\n process.stdin.pause();\n };\n\n // Handle errors that occur before or after connection\n socket.on('error', (err: any) => {\n if (err.code === 'ECONNREFUSED') {\n reject(\n new Error(`Error: Unable to connect to the socket on port ${socketPort}.\nPlease run the command \"bit server-forever\" first to start the server.`)\n );\n }\n resetStdin();\n socket.destroy(); // Ensure the socket is fully closed\n reject(err);\n });\n\n // Handle successful connection\n socket.on('connect', () => {\n process.stdin.setRawMode(true);\n process.stdin.resume();\n\n // Forward stdin to the socket\n process.stdin.on('data', (data: any) => {\n socket.write(data);\n\n // Detect Ctrl+C (hex code '03')\n if (data.toString('hex') === '03') {\n // Important to write it to the socket so the server knows to kill the PTY process\n process.stdin.setRawMode(false);\n process.stdin.pause();\n socket.end();\n process.exit();\n }\n });\n\n // Forward data from the socket to stdout\n socket.on('data', (data: any) => {\n process.stdout.write(data);\n });\n\n // Handle socket close and end events\n const cleanup = () => {\n resetStdin();\n socket.destroy();\n };\n\n socket.on('close', cleanup);\n socket.on('end', cleanup);\n\n resolve(); // Connection successful, resolve the Promise\n });\n });\n }\n\n /**\n * Initialize the server-sent events (SSE) connection to the server.\n * This is used to print the logs and show the loader during the command.\n * Without this, it only shows the response from http server, but not the \"logger.console\" or \"logger.setStatusLine\" texts.\n *\n * I wasn't able to find a better way to do it. The challenge here is that the http server is running in a different\n * process, which is not connected to the current process in any way. (unlike the IDE which is its child process and\n * can access its stdout).\n * One of the attempts I made is sending the \"tty\" path to the server and let the server console log to that path, but\n * it didn't work well. It was printed only after the response came back from the server.\n */\n private initSSE(url: string) {\n const token = this.getServerTokenIfExists();\n const eventSourceOpts = token ? { headers: { Authorization: `Bearer ${token}` } } : undefined;\n const eventSource = new EventSource(`${url}/sse-events`, eventSourceOpts);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n eventSource.onerror = (_error: any) => {\n // eslint-disable-next-line no-console\n // console.error('Error occurred in SSE connection:', _error);\n // probably was unable to connect to the server and will throw ServerNotFound right after. no need to show this error.\n eventSource.close();\n };\n eventSource.addEventListener('onLoader', (event: any) => {\n const parsed = JSON.parse(event.data);\n const { method, args } = parsed;\n loader[method](...(args || []));\n });\n eventSource.addEventListener('onLogWritten', (event: any) => {\n const parsed = JSON.parse(event.data);\n process.stdout.write(parsed.message);\n });\n }\n\n private async printPortAndExit() {\n try {\n const port = await this.getExistingUsedPort();\n process.stdout.write(port.toString());\n process.exit(0);\n } catch (err: any) {\n if (err instanceof ScopeNotFound || err instanceof ServerPortFileNotFound || err instanceof ServerIsNotRunning) {\n process.exit(0);\n }\n console.error(err.message); // eslint-disable-line no-console\n process.exit(1);\n }\n }\n private async deletePortAndExit() {\n try {\n await this.deleteServerPortFile();\n process.exit(0);\n } catch {\n // probably file doesn't exist.\n process.exit(0);\n }\n }\n\n private printSocketPortAndExit() {\n try {\n const port = getSocketPort();\n process.stdout.write(port.toString());\n process.exit(0);\n } catch (err: any) {\n console.error(err.message); // eslint-disable-line no-console\n process.exit(1);\n }\n }\n\n /**\n * Print the per-server bearer token written by bit-server at startup, used\n * by clients (e.g. the bit-vscode extension) to authenticate to the local\n * HTTP API. Prints empty if no token file exists (older bit-server with no\n * auth requirement).\n */\n private async printServerTokenAndExit() {\n try {\n const filePath = this.getServerTokenFilePath();\n try {\n const token = await fs.readFile(filePath, 'utf8');\n process.stdout.write(token.trim());\n } catch (err: any) {\n if (err.code !== 'ENOENT') throw err;\n // No token file — old bit-server, no auth required. Print empty.\n }\n process.exit(0);\n } catch (err: any) {\n if (err instanceof ScopeNotFound) {\n process.exit(0);\n }\n console.error(err.message); // eslint-disable-line no-console\n process.exit(1);\n }\n }\n\n private getServerTokenFilePath() {\n const scopePath = findScopePath(process.cwd());\n if (!scopePath) {\n throw new ScopeNotFound(process.cwd());\n }\n return join(scopePath, 'server-token.txt');\n }\n\n /**\n * Read the server's bearer token, returning undefined if no token file\n * exists (older bit-server with no auth requirement) or scope can't be\n * resolved. Used by HTTP/SSE callers in this file to authenticate to the\n * running bit-server.\n *\n * Only ENOENT and ScopeNotFound are swallowed — other read errors\n * (EACCES, EPERM, corrupted file, …) are surfaced so the user sees the\n * real cause instead of a misleading 401/upgrade message from the server.\n */\n private getServerTokenIfExists(): string | undefined {\n let filePath: string;\n try {\n filePath = this.getServerTokenFilePath();\n } catch (err: any) {\n if (err instanceof ScopeNotFound) return undefined;\n throw err;\n }\n try {\n const token = fs.readFileSync(filePath, 'utf8').trim();\n return token || undefined;\n } catch (err: any) {\n if (err.code === 'ENOENT') return undefined;\n throw err;\n }\n }\n\n private async getExistingUsedPort(): Promise<number> {\n const port = await this.getExistingPort();\n const shouldSkipPortValidation = process.argv.includes(SKIP_PORT_VALIDATION_ARG);\n const isPortInUse = shouldSkipPortValidation ? true : await this.isPortInUseForCurrentDir(port);\n if (!isPortInUse) {\n await this.deleteServerPortFile();\n throw new ServerIsNotRunning(port);\n }\n\n return port;\n }\n\n private async isPortInUseForCurrentDir(port: number) {\n const pid = getPidByPort(port);\n if (!pid) {\n return false;\n }\n const dirUsedByPort = await getCwdByPid(pid);\n if (!dirUsedByPort) {\n // might not be supported by Windows. this is on-best-effort basis.\n return true;\n }\n const currentDir = process.cwd();\n return dirUsedByPort === currentDir;\n }\n\n private async getExistingPort(): Promise<number> {\n const filePath = this.getServerPortFilePath();\n try {\n const fileContent = await fs.readFile(filePath, 'utf8');\n return parseInt(fileContent, 10);\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n throw new ServerPortFileNotFound(filePath);\n }\n throw err;\n }\n }\n\n private async deleteServerPortFile() {\n const filePath = this.getServerPortFilePath();\n await fs.remove(filePath);\n }\n\n private getServerPortFilePath() {\n const scopePath = findScopePath(process.cwd());\n if (!scopePath) {\n throw new ScopeNotFound(process.cwd());\n }\n return join(scopePath, 'server-port.txt');\n }\n}\n\nexport function shouldUseBitServer() {\n const commandsToSkip = ['start', 'run', 'watch', 'server'];\n const hasFlag =\n process.env.BIT_CLI_SERVER === 'true' ||\n process.env.BIT_CLI_SERVER === '1' ||\n process.env.BIT_CLI_SERVER_PTY === 'true' ||\n process.env.BIT_CLI_SERVER_TTY === 'true';\n return (\n hasFlag &&\n process.argv.length > 2 && // if it has no args, it shows the help\n !commandsToSkip.includes(process.argv[2])\n );\n}\n\n/**\n * Address the CLI uses to dial the local bit-server. Mirrors the api-server's\n * bind host (`BIT_SERVER_HOST`) so the same env var works for both sides in\n * hosted environments. Two host values need translating: `0.0.0.0` / `::`\n * are bind-only wildcards — not valid as destinations — so dial loopback\n * instead. Raw IPv6 addresses get bracketed for URL safety.\n */\nfunction resolveDialHost(): string {\n const override = process.env.BIT_SERVER_HOST?.trim();\n if (!override) return '127.0.0.1';\n if (override === '0.0.0.0') return '127.0.0.1';\n if (override === '::') return '[::1]';\n // Bracket any literal IPv6 (contains ':' but isn't an IPv4 with port —\n // detected by 2+ colons).\n if (override.includes(':') && override.split(':').length > 2 && !override.startsWith('[')) {\n return `[${override}]`;\n }\n return override;\n}\n\n/**\n * Executes a command and returns stdout as a string.\n */\nfunction execCommand(cmd: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(cmd, { encoding: 'utf-8' }, (error, stdout) => {\n if (error) {\n return reject(error);\n }\n resolve(stdout.trim());\n });\n });\n}\n\n/**\n * Get the CWD of a process by PID.\n *\n * On Linux: readlink /proc/<pid>/cwd\n * On macOS: lsof -p <pid> and parse line with 'cwd'\n * On Windows: forget about it. tried with wmic, didn't went well.\n */\nasync function getCwdByPid(pid: string): Promise<string | null> {\n const platform = os.platform();\n\n try {\n if (platform === 'linux') {\n const cwd = await execCommand(`readlink /proc/${pid}/cwd`);\n return cwd || null;\n } else if (platform === 'darwin') {\n // macOS does not have /proc, but lsof -p <pid> shows cwd line like:\n // COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\n // node 12345 user cwd DIR 1,2 1024 56789 /Users/username/project\n const output = await execCommand(`lsof -p ${pid}`);\n const line = output.split('\\n').find((l) => l.includes(' cwd '));\n if (!line) return null;\n const parts = line.trim().split(/\\s+/);\n // The last part should be the directory path\n return parts[parts.length - 1] || null;\n } else if (platform === 'win32') {\n return null;\n } else {\n throw new Error(`Platform ${platform} not supported`);\n }\n } catch {\n return null;\n }\n}\n"],"mappings":";;;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,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_nodeFetch","data","_interopRequireDefault","require","_net","_fsExtra","_child_process","_path","_os","_eventsource","_scopeModules","_chalk","_legacy","_bootstrap","_serverForever","e","__esModule","default","CMD_SERVER_PORT","CMD_SERVER_PORT_DELETE","CMD_SERVER_SOCKET_PORT","CMD_SERVER_TOKEN","SKIP_PORT_VALIDATION_ARG","ServerPortFileNotFound","Error","constructor","filePath","ServerPortFileInvalid","content","ServerIsNotRunning","port","ScopeNotFound","scopePath","ServerCommander","execute","results","runCommandWithHttpServer","exitCode","loader","off","dataToPrint","JSON","stringify","undefined","console","log","process","exit","err","error","chalk","red","message","shouldUseTTYPath","platform","env","BIT_CLI_SERVER_TTY","argv","includes","printPortAndExit","printSocketPortAndExit","deletePortAndExit","printServerTokenAndExit","printBitVersionIfAsked","getExistingPort","url","resolveDialHost","shouldUsePTY","BIT_CLI_SERVER_PTY","connectToSocket","ttyPath","execSync","encoding","stdio","trim","initSSE","args","slice","on","endpoint","pwd","cwd","body","command","envBitFeatures","BIT_FEATURES","isPty","post","authToken","headers","Authorization","fetch","method","code","deleteServerPortFile","join","token","getServerTokenIfExists","res","status","currentToken","ok","json","jsonResponse","statusText","Promise","resolve","reject","socketPort","getSocketPort","socket","net","createConnection","resetStdin","stdin","setRawMode","pause","destroy","resume","write","toString","end","stdout","cleanup","eventSourceOpts","eventSource","EventSource","onerror","_error","close","addEventListener","event","parsed","parse","getExistingUsedPort","getServerTokenFilePath","fs","readFile","findScopePath","readFileSync","shouldSkipPortValidation","isPortInUse","isPortInUseForCurrentDir","pid","getPidByPort","dirUsedByPort","getCwdByPid","currentDir","getServerPortFilePath","fileContent","parseInt","Number","isInteger","remove","exports","shouldUseBitServer","commandsToSkip","hasFlag","BIT_CLI_SERVER","length","override","BIT_SERVER_HOST","split","startsWith","execCommand","cmd","exec","os","output","line","find","l","parts"],"sources":["server-commander.ts"],"sourcesContent":["/**\n * This file is responsible for interacting with bit through a long-running background process \"bit-server\" rather than directly.\n * Why not directly?\n * 1. startup cost. currently it takes around 1 second to bootstrap bit.\n * 2. an experimental package-manager saves node_modules in-memory. if a client starts a new process, it won't have the node_modules in-memory.\n *\n * In this file, there are three ways to achieve this. It's outlined in the order it was evolved.\n * The big challenge here is to show the output correctly to the client even though the server is running in a different process.\n *\n * 1. process.env.BIT_CLI_SERVER === 'true'\n * This method uses SSE - Server Send Events. The server sends events to the client with the output to print. The client listens to\n * these events and prints them. It's cumbersome. For this, the logger was changed and every time the logger needs to print to the console,\n * it was using this SSE to send events. Same with the loader.\n * Cons: Other output, such as pnpm, needs an extra effort to print - for pnpm, the \"process\" object was passed to pnpm\n * and its stdout was modified to use the SSE.\n * However, other tools that print directly to the console, such as Jest, won't work.\n *\n * 2. process.env.BIT_CLI_SERVER_TTY === 'true'\n * Because the terminal - tty is a fd (file descriptor) on mac/linux, it can be passed to the server. The server can write to this\n * fd and it will be printed to the client terminal. On the server, the process.stdout.write was monkey-patched to\n * write to the tty. (see cli-raw.route.ts file).\n * It solves the problem of Jest and other tools that print directly to the console.\n * Cons:\n * A. It doesn't work on Windows. Windows doesn't treat tty as a file descriptor.\n * B. We need two ways communication. Commands such as \"bit update\", display a prompt with option to select using the arrow keys.\n * This is not possible with the tty approach. Also, if the client hits Ctrl+C, the server won't know about it and it\n * won't kill the process.\n *\n * 3. process.env.BIT_CLI_SERVER_PTY === 'true'\n * This is the most advanced approach. It spawns a pty (pseudo terminal) process to communicate between the client and the server.\n * The client connects to the server using a socket. The server writes to the socket and the client reads from it.\n * The client also writes to the socket and the server reads from it. See server-forever.ts to understand better.\n * In order to pass terminal sequences, such as arrow keys or Ctrl+C, the stdin of the client is set to raw mode.\n * In theory, this approach could work by spawning a normal process, not pty, however, then, the stdin/stdout are non-tty,\n * and as a result, loaders such as Ora and chalk won't work.\n * With this new approach, we also support terminating and reloading the server. A new command is added\n * \"bit server-forever\", which spawns the pty-process. If the client hits Ctrl+C, this server-forever process will kill\n * the pty-process and re-load it.\n * Keep in mind, that to send the command and get the results, we still using http. The usage of the pty is only for\n * the input/output during the command.\n * I was trying to avoid the http, and use only the pty, by implementing readline to get the command from the socket,\n * but then I wasn't able to return the prompt to the user easily. So, I decided to keep the http for the request/response part.\n */\n\nimport fetch from 'node-fetch';\nimport net from 'net';\nimport fs from 'fs-extra';\nimport { exec, execSync } from 'child_process';\nimport { join } from 'path';\nimport os from 'os';\nimport EventSource from 'eventsource';\nimport { findScopePath } from '@teambit/scope.modules.find-scope-path';\nimport chalk from 'chalk';\nimport { loader } from '@teambit/legacy.loader';\nimport { printBitVersionIfAsked } from './bootstrap';\nimport { getPidByPort, getSocketPort } from './server-forever';\n\nconst CMD_SERVER_PORT = 'cli-server-port';\nconst CMD_SERVER_PORT_DELETE = 'cli-server-port-delete';\nconst CMD_SERVER_SOCKET_PORT = 'cli-server-socket-port';\nconst CMD_SERVER_TOKEN = 'cli-server-token';\nconst SKIP_PORT_VALIDATION_ARG = '--skip-port-validation';\n\nclass ServerPortFileNotFound extends Error {\n constructor(filePath: string) {\n super(`server port file not found at ${filePath}`);\n }\n}\nclass ServerPortFileInvalid extends Error {\n constructor(filePath: string, content: string) {\n super(`server port file at ${filePath} does not contain a valid port: \"${content}\"`);\n }\n}\nclass ServerIsNotRunning extends Error {\n constructor(port: number) {\n super(`bit server is not running on port ${port}`);\n }\n}\nclass ScopeNotFound extends Error {\n constructor(scopePath: string) {\n super(`scope not found at ${scopePath}`);\n }\n}\n\ntype CommandResult = { data: any; exitCode: number };\n\nexport class ServerCommander {\n async execute() {\n try {\n const results = await this.runCommandWithHttpServer();\n if (results) {\n const { data, exitCode } = results;\n loader.off();\n const dataToPrint = typeof data === 'string' ? data : JSON.stringify(data, undefined, 2);\n // eslint-disable-next-line no-console\n console.log(dataToPrint);\n process.exit(exitCode);\n }\n\n process.exit(0);\n } catch (err: any) {\n if (\n err instanceof ScopeNotFound ||\n err instanceof ServerPortFileNotFound ||\n err instanceof ServerPortFileInvalid ||\n err instanceof ServerIsNotRunning\n ) {\n throw err;\n }\n loader.off();\n // eslint-disable-next-line no-console\n console.error(chalk.red(err.message));\n process.exit(1);\n }\n }\n\n private shouldUseTTYPath() {\n if (process.platform === 'win32') return false; // windows doesn't support tty path\n return process.env.BIT_CLI_SERVER_TTY === 'true';\n }\n\n async runCommandWithHttpServer(): Promise<CommandResult | undefined | void> {\n if (process.argv.includes(CMD_SERVER_PORT)) return this.printPortAndExit();\n if (process.argv.includes(CMD_SERVER_SOCKET_PORT)) return this.printSocketPortAndExit();\n if (process.argv.includes(CMD_SERVER_PORT_DELETE)) return this.deletePortAndExit();\n if (process.argv.includes(CMD_SERVER_TOKEN)) return this.printServerTokenAndExit();\n printBitVersionIfAsked();\n // deliberately not validating the port here (see getExistingUsedPort): that costs two `lsof`\n // subprocesses, ~320ms on every single command, to establish something the request itself\n // already proves. Each server writes its token into its own scope dir, so a port file left\n // behind pointing at another workspace's server gets a 401, and a dead port gets ECONNREFUSED\n // — both handled below by dropping the stale file and falling back to running in-process.\n const port = await this.getExistingPort();\n const url = `http://${resolveDialHost()}:${port}/api`;\n const shouldUsePTY = process.env.BIT_CLI_SERVER_PTY === 'true';\n\n if (shouldUsePTY) {\n await this.connectToSocket();\n }\n const ttyPath = this.shouldUseTTYPath()\n ? execSync('tty', {\n encoding: 'utf8',\n stdio: ['inherit', 'pipe', 'pipe'],\n }).trim()\n : undefined;\n if (!ttyPath && !shouldUsePTY) this.initSSE(url);\n // parse the args and options from the command\n const args = process.argv.slice(2);\n if (!args.includes('--json') && !args.includes('-j')) {\n loader.on();\n }\n const endpoint = `cli-raw`;\n const pwd = process.cwd();\n const body = { command: args, pwd, envBitFeatures: process.env.BIT_FEATURES, ttyPath, isPty: shouldUsePTY };\n const post = async (authToken?: string) => {\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\n if (authToken) headers.Authorization = `Bearer ${authToken}`;\n try {\n return await fetch(`${url}/${endpoint}`, {\n method: 'post',\n body: JSON.stringify(body),\n headers,\n });\n } catch (err: any) {\n if (err.code === 'ECONNREFUSED') {\n await this.deleteServerPortFile();\n throw new ServerIsNotRunning(port);\n }\n throw new Error(`failed to run command \"${args.join(' ')}\" on the server. ${err.message}`);\n }\n };\n\n const token = this.getServerTokenIfExists();\n let res = await post(token);\n\n // a 401 has two possible causes, and they need opposite handling: either the port file points\n // at a different workspace's server (stale, and dealt with below), or our own server restarted\n // and rotated its token after we read it. The server writes the token file before it registers\n // any route, so a server able to answer us has already published its current token — if what's\n // on disk no longer matches what we sent, this is the restart case and retrying is enough.\n // Without this, an unlucky command spanning a restart would delete the port file of a server\n // that is alive and healthy, hiding it from every later client.\n if (res.status === 401) {\n const currentToken = this.getServerTokenIfExists();\n if (currentToken && currentToken !== token) res = await post(currentToken);\n }\n\n if (res.ok) {\n const results = await res.json();\n // bit-server always answers this route with a { data, exitCode } object. Anything else means\n // the port file points at some other listener that happened to accept the POST, so fail safe\n // rather than reporting a foreign response as the command's result: drop the port file and\n // let the command run in-process.\n if (!results || typeof results !== 'object') {\n await this.deleteServerPortFile();\n throw new ServerIsNotRunning(port);\n }\n return results;\n }\n\n // 401 (still, after the retry above): the server on this port belongs to a different workspace,\n // so it doesn't recognize our token. 404: whatever is listening there is not a bit server.\n // Either way the port file is stale — drop it and let the caller fall back to in-process.\n if (res.status === 401 || res.status === 404) {\n await this.deleteServerPortFile();\n throw new ServerIsNotRunning(port);\n }\n\n let jsonResponse;\n try {\n jsonResponse = await res.json();\n } catch {\n // the response is not json, ignore the body.\n }\n throw new Error(jsonResponse?.message || jsonResponse || res.statusText);\n }\n\n private async connectToSocket() {\n return new Promise<void>((resolve, reject) => {\n const socketPort = getSocketPort();\n const socket = net.createConnection({ port: socketPort });\n\n const resetStdin = () => {\n process.stdin.setRawMode(false);\n process.stdin.pause();\n };\n\n // Handle errors that occur before or after connection\n socket.on('error', (err: any) => {\n if (err.code === 'ECONNREFUSED') {\n reject(\n new Error(`Error: Unable to connect to the socket on port ${socketPort}.\nPlease run the command \"bit server-forever\" first to start the server.`)\n );\n }\n resetStdin();\n socket.destroy(); // Ensure the socket is fully closed\n reject(err);\n });\n\n // Handle successful connection\n socket.on('connect', () => {\n process.stdin.setRawMode(true);\n process.stdin.resume();\n\n // Forward stdin to the socket\n process.stdin.on('data', (data: any) => {\n socket.write(data);\n\n // Detect Ctrl+C (hex code '03')\n if (data.toString('hex') === '03') {\n // Important to write it to the socket so the server knows to kill the PTY process\n process.stdin.setRawMode(false);\n process.stdin.pause();\n socket.end();\n process.exit();\n }\n });\n\n // Forward data from the socket to stdout\n socket.on('data', (data: any) => {\n process.stdout.write(data);\n });\n\n // Handle socket close and end events\n const cleanup = () => {\n resetStdin();\n socket.destroy();\n };\n\n socket.on('close', cleanup);\n socket.on('end', cleanup);\n\n resolve(); // Connection successful, resolve the Promise\n });\n });\n }\n\n /**\n * Initialize the server-sent events (SSE) connection to the server.\n * This is used to print the logs and show the loader during the command.\n * Without this, it only shows the response from http server, but not the \"logger.console\" or \"logger.setStatusLine\" texts.\n *\n * I wasn't able to find a better way to do it. The challenge here is that the http server is running in a different\n * process, which is not connected to the current process in any way. (unlike the IDE which is its child process and\n * can access its stdout).\n * One of the attempts I made is sending the \"tty\" path to the server and let the server console log to that path, but\n * it didn't work well. It was printed only after the response came back from the server.\n */\n private initSSE(url: string) {\n const token = this.getServerTokenIfExists();\n const eventSourceOpts = token ? { headers: { Authorization: `Bearer ${token}` } } : undefined;\n const eventSource = new EventSource(`${url}/sse-events`, eventSourceOpts);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n eventSource.onerror = (_error: any) => {\n // eslint-disable-next-line no-console\n // console.error('Error occurred in SSE connection:', _error);\n // probably was unable to connect to the server and will throw ServerNotFound right after. no need to show this error.\n eventSource.close();\n };\n eventSource.addEventListener('onLoader', (event: any) => {\n const parsed = JSON.parse(event.data);\n const { method, args } = parsed;\n loader[method](...(args || []));\n });\n eventSource.addEventListener('onLogWritten', (event: any) => {\n const parsed = JSON.parse(event.data);\n process.stdout.write(parsed.message);\n });\n }\n\n private async printPortAndExit() {\n try {\n const port = await this.getExistingUsedPort();\n process.stdout.write(port.toString());\n process.exit(0);\n } catch (err: any) {\n if (\n err instanceof ScopeNotFound ||\n err instanceof ServerPortFileNotFound ||\n err instanceof ServerPortFileInvalid ||\n err instanceof ServerIsNotRunning\n ) {\n process.exit(0);\n }\n console.error(err.message); // eslint-disable-line no-console\n process.exit(1);\n }\n }\n private async deletePortAndExit() {\n try {\n await this.deleteServerPortFile();\n process.exit(0);\n } catch {\n // probably file doesn't exist.\n process.exit(0);\n }\n }\n\n private printSocketPortAndExit() {\n try {\n const port = getSocketPort();\n process.stdout.write(port.toString());\n process.exit(0);\n } catch (err: any) {\n console.error(err.message); // eslint-disable-line no-console\n process.exit(1);\n }\n }\n\n /**\n * Print the per-server bearer token written by bit-server at startup, used\n * by clients (e.g. the bit-vscode extension) to authenticate to the local\n * HTTP API. Prints empty if no token file exists (older bit-server with no\n * auth requirement).\n */\n private async printServerTokenAndExit() {\n try {\n const filePath = this.getServerTokenFilePath();\n try {\n const token = await fs.readFile(filePath, 'utf8');\n process.stdout.write(token.trim());\n } catch (err: any) {\n if (err.code !== 'ENOENT') throw err;\n // No token file — old bit-server, no auth required. Print empty.\n }\n process.exit(0);\n } catch (err: any) {\n if (err instanceof ScopeNotFound) {\n process.exit(0);\n }\n console.error(err.message); // eslint-disable-line no-console\n process.exit(1);\n }\n }\n\n private getServerTokenFilePath() {\n const scopePath = findScopePath(process.cwd());\n if (!scopePath) {\n throw new ScopeNotFound(process.cwd());\n }\n return join(scopePath, 'server-token.txt');\n }\n\n /**\n * Read the server's bearer token, returning undefined if no token file\n * exists (older bit-server with no auth requirement) or scope can't be\n * resolved. Used by HTTP/SSE callers in this file to authenticate to the\n * running bit-server.\n *\n * Only ENOENT and ScopeNotFound are swallowed — other read errors\n * (EACCES, EPERM, corrupted file, …) are surfaced so the user sees the\n * real cause instead of a misleading 401/upgrade message from the server.\n */\n private getServerTokenIfExists(): string | undefined {\n let filePath: string;\n try {\n filePath = this.getServerTokenFilePath();\n } catch (err: any) {\n if (err instanceof ScopeNotFound) return undefined;\n throw err;\n }\n try {\n const token = fs.readFileSync(filePath, 'utf8').trim();\n return token || undefined;\n } catch (err: any) {\n if (err.code === 'ENOENT') return undefined;\n throw err;\n }\n }\n\n /**\n * the port from the port file, proven to be served by a process whose cwd is this workspace.\n *\n * Only the `cli-server-port` command uses this. Its whole job is to answer \"is there a usable\n * server?\" for external clients such as the VS Code extension, which expect no output when there\n * isn't one — so it's worth two `lsof` subprocesses there. Running an actual command doesn't pay\n * that: see the note in runCommandWithHttpServer.\n */\n private async getExistingUsedPort(): Promise<number> {\n const port = await this.getExistingPort();\n const shouldSkipPortValidation = process.argv.includes(SKIP_PORT_VALIDATION_ARG);\n const isPortInUse = shouldSkipPortValidation ? true : await this.isPortInUseForCurrentDir(port);\n if (!isPortInUse) {\n await this.deleteServerPortFile();\n throw new ServerIsNotRunning(port);\n }\n\n return port;\n }\n\n private async isPortInUseForCurrentDir(port: number) {\n const pid = getPidByPort(port);\n if (!pid) {\n return false;\n }\n const dirUsedByPort = await getCwdByPid(pid);\n if (!dirUsedByPort) {\n // might not be supported by Windows. this is on-best-effort basis.\n return true;\n }\n const currentDir = process.cwd();\n return dirUsedByPort === currentDir;\n }\n\n private async getExistingPort(): Promise<number> {\n const filePath = this.getServerPortFilePath();\n let fileContent: string;\n try {\n fileContent = await fs.readFile(filePath, 'utf8');\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n throw new ServerPortFileNotFound(filePath);\n }\n throw err;\n }\n const port = parseInt(fileContent.trim(), 10);\n // the server writes this file with a plain overwrite, so a reader can catch it empty or\n // half-written. Left unchecked that becomes NaN (or a truncated number) and surfaces as an\n // opaque fetch failure, which exits instead of falling back in-process. Deliberately not\n // deleting the file: a torn read means the server is mid-write, and the next command will see\n // the complete value.\n if (!Number.isInteger(port) || port <= 0 || port > 65535) {\n throw new ServerPortFileInvalid(filePath, fileContent.trim());\n }\n return port;\n }\n\n private async deleteServerPortFile() {\n const filePath = this.getServerPortFilePath();\n await fs.remove(filePath);\n }\n\n private getServerPortFilePath() {\n const scopePath = findScopePath(process.cwd());\n if (!scopePath) {\n throw new ScopeNotFound(process.cwd());\n }\n return join(scopePath, 'server-port.txt');\n }\n}\n\nexport function shouldUseBitServer() {\n const commandsToSkip = ['start', 'run', 'watch', 'server'];\n const hasFlag =\n process.env.BIT_CLI_SERVER === 'true' ||\n process.env.BIT_CLI_SERVER === '1' ||\n process.env.BIT_CLI_SERVER_PTY === 'true' ||\n process.env.BIT_CLI_SERVER_TTY === 'true';\n return (\n hasFlag &&\n process.argv.length > 2 && // if it has no args, it shows the help\n !commandsToSkip.includes(process.argv[2])\n );\n}\n\n/**\n * Address the CLI uses to dial the local bit-server. Mirrors the api-server's\n * bind host (`BIT_SERVER_HOST`) so the same env var works for both sides in\n * hosted environments. Two host values need translating: `0.0.0.0` / `::`\n * are bind-only wildcards — not valid as destinations — so dial loopback\n * instead. Raw IPv6 addresses get bracketed for URL safety.\n */\nfunction resolveDialHost(): string {\n const override = process.env.BIT_SERVER_HOST?.trim();\n if (!override) return '127.0.0.1';\n if (override === '0.0.0.0') return '127.0.0.1';\n if (override === '::') return '[::1]';\n // Bracket any literal IPv6 (contains ':' but isn't an IPv4 with port —\n // detected by 2+ colons).\n if (override.includes(':') && override.split(':').length > 2 && !override.startsWith('[')) {\n return `[${override}]`;\n }\n return override;\n}\n\n/**\n * Executes a command and returns stdout as a string.\n */\nfunction execCommand(cmd: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(cmd, { encoding: 'utf-8' }, (error, stdout) => {\n if (error) {\n return reject(error);\n }\n resolve(stdout.trim());\n });\n });\n}\n\n/**\n * Get the CWD of a process by PID.\n *\n * On Linux: readlink /proc/<pid>/cwd\n * On macOS: lsof -p <pid> and parse line with 'cwd'\n * On Windows: forget about it. tried with wmic, didn't went well.\n */\nasync function getCwdByPid(pid: string): Promise<string | null> {\n const platform = os.platform();\n\n try {\n if (platform === 'linux') {\n const cwd = await execCommand(`readlink /proc/${pid}/cwd`);\n return cwd || null;\n } else if (platform === 'darwin') {\n // macOS does not have /proc, but lsof -p <pid> shows cwd line like:\n // COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\n // node 12345 user cwd DIR 1,2 1024 56789 /Users/username/project\n const output = await execCommand(`lsof -p ${pid}`);\n const line = output.split('\\n').find((l) => l.includes(' cwd '));\n if (!line) return null;\n const parts = line.trim().split(/\\s+/);\n // The last part should be the directory path\n return parts[parts.length - 1] || null;\n } else if (platform === 'win32') {\n return null;\n } else {\n throw new Error(`Platform ${platform} not supported`);\n }\n } catch {\n return null;\n }\n}\n"],"mappings":";;;;;;;AA4CA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,eAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,cAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,IAAA;EAAA,MAAAP,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAK,GAAA,YAAAA,CAA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C;MAClD,MAAM0B,IAAI,GAAGD,MAAM,CAACN,KAAK,CAAC,IAAI,CAAC,CAACQ,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACjH,QAAQ,CAAC,OAAO,CAAC,CAAC;MAChE,IAAI,CAAC+G,IAAI,EAAE,OAAO,IAAI;MACtB,MAAMG,KAAK,GAAGH,IAAI,CAAC/F,IAAI,CAAC,CAAC,CAACwF,KAAK,CAAC,KAAK,CAAC;MACtC;MACA,OAAOU,KAAK,CAACA,KAAK,CAACb,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI;IACxC,CAAC,MAAM,IAAIzG,QAAQ,KAAK,OAAO,EAAE;MAC/B,OAAO,IAAI;IACb,CAAC,MAAM;MACL,MAAM,IAAI9B,KAAK,CAAC,YAAY8B,QAAQ,gBAAgB,CAAC;IACvD;EACF,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/bit",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.23",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/harmony/bit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.harmony",
|
|
8
8
|
"name": "bit",
|
|
9
|
-
"version": "2.2.
|
|
9
|
+
"version": "2.2.23"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"comment-json": "4.2.5",
|
|
@@ -47,14 +47,19 @@
|
|
|
47
47
|
"@teambit/cli": "0.0.1379",
|
|
48
48
|
"@teambit/legacy.extension-data": "0.0.153",
|
|
49
49
|
"@teambit/bit.get-bit-version": "0.0.27",
|
|
50
|
+
"@teambit/dependency-resolver": "1.0.1142",
|
|
50
51
|
"@teambit/legacy.analytics": "0.0.106",
|
|
51
52
|
"@teambit/legacy.constants": "0.0.42",
|
|
52
53
|
"@teambit/legacy.loader": "0.0.30",
|
|
53
54
|
"@teambit/legacy.logger": "0.0.57",
|
|
55
|
+
"@teambit/aspect-loader": "1.0.1142",
|
|
54
56
|
"@teambit/bit-error": "0.0.404",
|
|
55
57
|
"@teambit/clear-cache": "0.0.588",
|
|
56
58
|
"@teambit/component-id": "1.2.4",
|
|
57
59
|
"@teambit/config": "0.0.1554",
|
|
60
|
+
"@teambit/envs": "1.0.1142",
|
|
61
|
+
"@teambit/generator": "1.0.1143",
|
|
62
|
+
"@teambit/host-initializer": "0.0.855",
|
|
58
63
|
"@teambit/legacy-bit-id": "1.1.3",
|
|
59
64
|
"@teambit/legacy.bit-map": "0.0.208",
|
|
60
65
|
"@teambit/legacy.consumer-component": "0.0.152",
|
|
@@ -64,24 +69,6 @@
|
|
|
64
69
|
"@teambit/scope.modules.find-scope-path": "0.0.44",
|
|
65
70
|
"@teambit/workspace.modules.node-modules-linker": "0.0.382",
|
|
66
71
|
"@teambit/workspace.modules.workspace-locator": "0.0.43",
|
|
67
|
-
"@teambit/cache": "0.0.1472",
|
|
68
|
-
"@teambit/community": "1.0.807",
|
|
69
|
-
"@teambit/config-store": "0.0.260",
|
|
70
|
-
"@teambit/express": "0.0.1478",
|
|
71
|
-
"@teambit/global-config": "0.0.1383",
|
|
72
|
-
"@teambit/logger": "0.0.1472",
|
|
73
|
-
"@teambit/mocha": "1.0.897",
|
|
74
|
-
"@teambit/panels": "0.0.1382",
|
|
75
|
-
"@teambit/variants": "0.0.1647",
|
|
76
|
-
"@teambit/worker": "0.0.1683",
|
|
77
|
-
"@teambit/ui-foundation.ui.navigation.react-router-adapter": "6.1.3",
|
|
78
|
-
"@teambit/base-react.navigation.link": "2.0.31",
|
|
79
|
-
"@teambit/harmony.content.cli-reference": "2.0.1231",
|
|
80
|
-
"@teambit/dependency-resolver": "1.0.1142",
|
|
81
|
-
"@teambit/aspect-loader": "1.0.1142",
|
|
82
|
-
"@teambit/envs": "1.0.1142",
|
|
83
|
-
"@teambit/generator": "1.0.1143",
|
|
84
|
-
"@teambit/host-initializer": "0.0.855",
|
|
85
72
|
"@teambit/api-reference": "1.0.1143",
|
|
86
73
|
"@teambit/api-server": "1.0.1175",
|
|
87
74
|
"@teambit/application": "1.0.1142",
|
|
@@ -89,6 +76,7 @@
|
|
|
89
76
|
"@teambit/babel": "1.0.1142",
|
|
90
77
|
"@teambit/builder": "1.0.1142",
|
|
91
78
|
"@teambit/bundler": "1.0.1142",
|
|
79
|
+
"@teambit/cache": "0.0.1472",
|
|
92
80
|
"@teambit/changelog": "1.0.1142",
|
|
93
81
|
"@teambit/checkout": "1.0.1144",
|
|
94
82
|
"@teambit/ci": "1.0.540",
|
|
@@ -96,6 +84,7 @@
|
|
|
96
84
|
"@teambit/cloud": "0.0.1442",
|
|
97
85
|
"@teambit/code": "1.0.1142",
|
|
98
86
|
"@teambit/command-bar": "1.0.1142",
|
|
87
|
+
"@teambit/community": "1.0.807",
|
|
99
88
|
"@teambit/compiler": "1.0.1142",
|
|
100
89
|
"@teambit/component-compare": "1.0.1142",
|
|
101
90
|
"@teambit/component-log": "1.0.1142",
|
|
@@ -105,6 +94,7 @@
|
|
|
105
94
|
"@teambit/component": "1.0.1142",
|
|
106
95
|
"@teambit/compositions": "1.0.1142",
|
|
107
96
|
"@teambit/config-merger": "0.0.1009",
|
|
97
|
+
"@teambit/config-store": "0.0.260",
|
|
108
98
|
"@teambit/dependencies": "1.0.1142",
|
|
109
99
|
"@teambit/deprecation": "1.0.1142",
|
|
110
100
|
"@teambit/dev-files": "1.0.1142",
|
|
@@ -116,9 +106,11 @@
|
|
|
116
106
|
"@teambit/env": "1.0.1142",
|
|
117
107
|
"@teambit/eslint": "1.0.1142",
|
|
118
108
|
"@teambit/export": "1.0.1142",
|
|
109
|
+
"@teambit/express": "0.0.1478",
|
|
119
110
|
"@teambit/forking": "1.0.1142",
|
|
120
111
|
"@teambit/formatter": "1.0.1142",
|
|
121
112
|
"@teambit/git": "1.0.1142",
|
|
113
|
+
"@teambit/global-config": "0.0.1383",
|
|
122
114
|
"@teambit/graph": "1.0.1142",
|
|
123
115
|
"@teambit/graphql": "1.0.1142",
|
|
124
116
|
"@teambit/harmony-ui-app": "1.0.1142",
|
|
@@ -133,9 +125,11 @@
|
|
|
133
125
|
"@teambit/lanes": "1.0.1164",
|
|
134
126
|
"@teambit/linter": "1.0.1142",
|
|
135
127
|
"@teambit/lister": "1.0.1142",
|
|
128
|
+
"@teambit/logger": "0.0.1472",
|
|
136
129
|
"@teambit/mdx": "1.0.1143",
|
|
137
130
|
"@teambit/merge-lanes": "1.0.1164",
|
|
138
131
|
"@teambit/merging": "1.0.1146",
|
|
132
|
+
"@teambit/mocha": "1.0.897",
|
|
139
133
|
"@teambit/mover": "1.0.1142",
|
|
140
134
|
"@teambit/multi-compiler": "1.0.1142",
|
|
141
135
|
"@teambit/multi-tester": "1.0.1142",
|
|
@@ -143,6 +137,7 @@
|
|
|
143
137
|
"@teambit/node": "1.0.1142",
|
|
144
138
|
"@teambit/notifications": "1.0.1143",
|
|
145
139
|
"@teambit/objects": "0.0.649",
|
|
140
|
+
"@teambit/panels": "0.0.1382",
|
|
146
141
|
"@teambit/pkg": "1.0.1142",
|
|
147
142
|
"@teambit/pnpm": "1.0.1182",
|
|
148
143
|
"@teambit/prettier": "1.0.1142",
|
|
@@ -168,13 +163,18 @@
|
|
|
168
163
|
"@teambit/ui": "1.0.1142",
|
|
169
164
|
"@teambit/user-agent": "1.0.1142",
|
|
170
165
|
"@teambit/validator": "0.0.379",
|
|
166
|
+
"@teambit/variants": "0.0.1647",
|
|
171
167
|
"@teambit/version-history": "0.0.934",
|
|
172
168
|
"@teambit/vue-aspect": "0.0.508",
|
|
173
169
|
"@teambit/watcher": "1.0.1142",
|
|
174
170
|
"@teambit/webpack": "1.0.1142",
|
|
171
|
+
"@teambit/worker": "0.0.1683",
|
|
175
172
|
"@teambit/workspace-config-files": "1.0.1142",
|
|
176
173
|
"@teambit/workspace": "1.0.1142",
|
|
177
|
-
"@teambit/yarn": "1.0.1143"
|
|
174
|
+
"@teambit/yarn": "1.0.1143",
|
|
175
|
+
"@teambit/ui-foundation.ui.navigation.react-router-adapter": "6.1.3",
|
|
176
|
+
"@teambit/base-react.navigation.link": "2.0.31",
|
|
177
|
+
"@teambit/harmony.content.cli-reference": "2.0.1232"
|
|
178
178
|
},
|
|
179
179
|
"devDependencies": {
|
|
180
180
|
"@types/fs-extra": "9.0.7",
|