@teambit/bit 1.13.165 → 1.13.167

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@1.13.165/dist/bit.compositions.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@1.13.165/dist/bit.docs.js';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@1.13.167/dist/bit.compositions.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_bit@1.13.167/dist/bit.docs.js';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -65,6 +65,25 @@ export declare class ServerCommander {
65
65
  private printPortAndExit;
66
66
  private deletePortAndExit;
67
67
  private printSocketPortAndExit;
68
+ /**
69
+ * Print the per-server bearer token written by bit-server at startup, used
70
+ * by clients (e.g. the bit-vscode extension) to authenticate to the local
71
+ * HTTP API. Prints empty if no token file exists (older bit-server with no
72
+ * auth requirement).
73
+ */
74
+ private printServerTokenAndExit;
75
+ private getServerTokenFilePath;
76
+ /**
77
+ * Read the server's bearer token, returning undefined if no token file
78
+ * exists (older bit-server with no auth requirement) or scope can't be
79
+ * resolved. Used by HTTP/SSE callers in this file to authenticate to the
80
+ * running bit-server.
81
+ *
82
+ * Only ENOENT and ScopeNotFound are swallowed — other read errors
83
+ * (EACCES, EPERM, corrupted file, …) are surfaced so the user sees the
84
+ * real cause instead of a misleading 401/upgrade message from the server.
85
+ */
86
+ private getServerTokenIfExists;
68
87
  private getExistingUsedPort;
69
88
  private isPortInUseForCurrentDir;
70
89
  private getExistingPort;
@@ -137,6 +137,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
137
137
  const CMD_SERVER_PORT = 'cli-server-port';
138
138
  const CMD_SERVER_PORT_DELETE = 'cli-server-port-delete';
139
139
  const CMD_SERVER_SOCKET_PORT = 'cli-server-socket-port';
140
+ const CMD_SERVER_TOKEN = 'cli-server-token';
140
141
  const SKIP_PORT_VALIDATION_ARG = '--skip-port-validation';
141
142
  class ServerPortFileNotFound extends Error {
142
143
  constructor(filePath) {
@@ -187,6 +188,7 @@ class ServerCommander {
187
188
  if (process.argv.includes(CMD_SERVER_PORT)) return this.printPortAndExit();
188
189
  if (process.argv.includes(CMD_SERVER_SOCKET_PORT)) return this.printSocketPortAndExit();
189
190
  if (process.argv.includes(CMD_SERVER_PORT_DELETE)) return this.deletePortAndExit();
191
+ if (process.argv.includes(CMD_SERVER_TOKEN)) return this.printServerTokenAndExit();
190
192
  (0, _bootstrap().printBitVersionIfAsked)();
191
193
  const port = await this.getExistingUsedPort();
192
194
  const url = `http://localhost:${port}/api`;
@@ -213,14 +215,17 @@ class ServerCommander {
213
215
  ttyPath,
214
216
  isPty: shouldUsePTY
215
217
  };
218
+ const headers = {
219
+ 'Content-Type': 'application/json'
220
+ };
221
+ const token = this.getServerTokenIfExists();
222
+ if (token) headers.Authorization = `Bearer ${token}`;
216
223
  let res;
217
224
  try {
218
225
  res = await (0, _nodeFetch().default)(`${url}/${endpoint}`, {
219
226
  method: 'post',
220
227
  body: JSON.stringify(body),
221
- headers: {
222
- 'Content-Type': 'application/json'
223
- }
228
+ headers
224
229
  });
225
230
  } catch (err) {
226
231
  if (err.code === 'ECONNREFUSED') {
@@ -311,7 +316,13 @@ Please run the command "bit server-forever" first to start the server.`));
311
316
  * it didn't work well. It was printed only after the response came back from the server.
312
317
  */
313
318
  initSSE(url) {
314
- const eventSource = new (_eventsource().default)(`${url}/sse-events`);
319
+ const token = this.getServerTokenIfExists();
320
+ const eventSourceOpts = token ? {
321
+ headers: {
322
+ Authorization: `Bearer ${token}`
323
+ }
324
+ } : undefined;
325
+ const eventSource = new (_eventsource().default)(`${url}/sse-events`, eventSourceOpts);
315
326
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
316
327
  eventSource.onerror = _error => {
317
328
  // eslint-disable-next-line no-console
@@ -364,6 +375,66 @@ Please run the command "bit server-forever" first to start the server.`));
364
375
  process.exit(1);
365
376
  }
366
377
  }
378
+
379
+ /**
380
+ * Print the per-server bearer token written by bit-server at startup, used
381
+ * by clients (e.g. the bit-vscode extension) to authenticate to the local
382
+ * HTTP API. Prints empty if no token file exists (older bit-server with no
383
+ * auth requirement).
384
+ */
385
+ async printServerTokenAndExit() {
386
+ try {
387
+ const filePath = this.getServerTokenFilePath();
388
+ try {
389
+ const token = await _fsExtra().default.readFile(filePath, 'utf8');
390
+ process.stdout.write(token.trim());
391
+ } catch (err) {
392
+ if (err.code !== 'ENOENT') throw err;
393
+ // No token file — old bit-server, no auth required. Print empty.
394
+ }
395
+ process.exit(0);
396
+ } catch (err) {
397
+ if (err instanceof ScopeNotFound) {
398
+ process.exit(0);
399
+ }
400
+ console.error(err.message); // eslint-disable-line no-console
401
+ process.exit(1);
402
+ }
403
+ }
404
+ getServerTokenFilePath() {
405
+ const scopePath = (0, _scopeModules().findScopePath)(process.cwd());
406
+ if (!scopePath) {
407
+ throw new ScopeNotFound(process.cwd());
408
+ }
409
+ return (0, _path().join)(scopePath, 'server-token.txt');
410
+ }
411
+
412
+ /**
413
+ * Read the server's bearer token, returning undefined if no token file
414
+ * exists (older bit-server with no auth requirement) or scope can't be
415
+ * resolved. Used by HTTP/SSE callers in this file to authenticate to the
416
+ * running bit-server.
417
+ *
418
+ * Only ENOENT and ScopeNotFound are swallowed — other read errors
419
+ * (EACCES, EPERM, corrupted file, …) are surfaced so the user sees the
420
+ * real cause instead of a misleading 401/upgrade message from the server.
421
+ */
422
+ getServerTokenIfExists() {
423
+ let filePath;
424
+ try {
425
+ filePath = this.getServerTokenFilePath();
426
+ } catch (err) {
427
+ if (err instanceof ScopeNotFound) return undefined;
428
+ throw err;
429
+ }
430
+ try {
431
+ const token = _fsExtra().default.readFileSync(filePath, 'utf8').trim();
432
+ return token || undefined;
433
+ } catch (err) {
434
+ if (err.code === 'ENOENT') return undefined;
435
+ throw err;
436
+ }
437
+ }
367
438
  async getExistingUsedPort() {
368
439
  const port = await this.getExistingPort();
369
440
  const shouldSkipPortValidation = process.argv.includes(SKIP_PORT_VALIDATION_ARG);
@@ -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","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","printBitVersionIfAsked","getExistingUsedPort","url","shouldUsePTY","BIT_CLI_SERVER_PTY","connectToSocket","ttyPath","execSync","encoding","stdio","trim","initSSE","args","slice","on","endpoint","pwd","cwd","body","command","envBitFeatures","BIT_FEATURES","isPty","res","fetch","method","headers","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","eventSource","EventSource","onerror","_error","close","addEventListener","event","parsed","parse","getExistingPort","shouldSkipPortValidation","isPortInUse","isPortInUseForCurrentDir","pid","getPidByPort","dirUsedByPort","getCwdByPid","currentDir","getServerPortFilePath","fileContent","fs","readFile","parseInt","remove","findScopePath","exports","shouldUseBitServer","commandsToSkip","hasFlag","BIT_CLI_SERVER","length","execCommand","cmd","exec","os","output","line","split","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 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 printBitVersionIfAsked();\n const port = await this.getExistingUsedPort();\n const url = `http://localhost:${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 let res;\n try {\n res = await fetch(`${url}/${endpoint}`, {\n method: 'post',\n body: JSON.stringify(body),\n headers: { 'Content-Type': 'application/json' },\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 eventSource = new EventSource(`${url}/sse-events`);\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 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 * 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,IA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,CAAC,CAAC;EAE9B,IAAI;IACF,IAAIA,QAAQ,KAAK,OAAO,EAAE;MACxB,MAAMyB,GAAG,GAAG,MAAMmE,WAAW,CAAC,kBAAkBlB,GAAG,MAAM,CAAC;MAC1D,OAAOjD,GAAG,IAAI,IAAI;IACpB,CAAC,MAAM,IAAIzB,QAAQ,KAAK,QAAQ,EAAE;MAChC;MACA;MACA;MACA,MAAMgG,MAAM,GAAG,MAAMJ,WAAW,CAAC,WAAWlB,GAAG,EAAE,CAAC;MAClD,MAAMuB,IAAI,GAAGD,MAAM,CAACE,KAAK,CAAC,IAAI,CAAC,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAAChG,QAAQ,CAAC,OAAO,CAAC,CAAC;MAChE,IAAI,CAAC6F,IAAI,EAAE,OAAO,IAAI;MACtB,MAAMI,KAAK,GAAGJ,IAAI,CAAC/E,IAAI,CAAC,CAAC,CAACgF,KAAK,CAAC,KAAK,CAAC;MACtC;MACA,OAAOG,KAAK,CAACA,KAAK,CAACV,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI;IACxC,CAAC,MAAM,IAAI3F,QAAQ,KAAK,OAAO,EAAE;MAC/B,OAAO,IAAI;IACb,CAAC,MAAM;MACL,MAAM,IAAI5B,KAAK,CAAC,YAAY4B,QAAQ,gBAAgB,CAAC;IACvD;EACF,CAAC,CAAC,MAAM;IACN,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","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","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","execCommand","cmd","exec","os","output","line","split","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://localhost:${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 * 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;EA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
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/bit",
3
- "version": "1.13.165",
3
+ "version": "1.13.167",
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": "1.13.165"
9
+ "version": "1.13.167"
10
10
  },
11
11
  "dependencies": {
12
12
  "comment-json": "4.2.5",
@@ -51,10 +51,14 @@
51
51
  "@teambit/legacy.constants": "0.0.26",
52
52
  "@teambit/legacy.loader": "0.0.18",
53
53
  "@teambit/legacy.logger": "0.0.38",
54
+ "@teambit/aspect-loader": "1.0.972",
54
55
  "@teambit/bit-error": "0.0.404",
55
56
  "@teambit/clear-cache": "0.0.541",
56
57
  "@teambit/component-id": "1.2.4",
57
58
  "@teambit/config": "0.0.1495",
59
+ "@teambit/envs": "1.0.972",
60
+ "@teambit/generator": "1.0.973",
61
+ "@teambit/host-initializer": "0.0.685",
58
62
  "@teambit/legacy-bit-id": "1.1.3",
59
63
  "@teambit/legacy.bit-map": "0.0.168",
60
64
  "@teambit/legacy.consumer-component": "0.0.112",
@@ -64,37 +68,21 @@
64
68
  "@teambit/scope.modules.find-scope-path": "0.0.27",
65
69
  "@teambit/workspace.modules.node-modules-linker": "0.0.341",
66
70
  "@teambit/workspace.modules.workspace-locator": "0.0.27",
67
- "@teambit/cache": "0.0.1413",
68
- "@teambit/cli-mcp-server": "0.0.169",
69
- "@teambit/community": "1.0.748",
70
- "@teambit/config-store": "0.0.200",
71
- "@teambit/express": "0.0.1419",
72
- "@teambit/global-config": "0.0.1323",
73
- "@teambit/logger": "0.0.1413",
74
- "@teambit/mocha": "1.0.838",
75
- "@teambit/panels": "0.0.1323",
76
- "@teambit/variants": "0.0.1588",
77
- "@teambit/worker": "0.0.1624",
78
- "@teambit/ui-foundation.ui.navigation.react-router-adapter": "6.1.3",
79
- "@teambit/base-react.navigation.link": "2.0.31",
80
- "@teambit/harmony.content.cli-reference": "2.0.1025",
81
- "@teambit/aspect-loader": "1.0.972",
82
- "@teambit/envs": "1.0.972",
83
- "@teambit/generator": "1.0.973",
84
- "@teambit/host-initializer": "0.0.685",
85
71
  "@teambit/api-reference": "1.0.972",
86
- "@teambit/api-server": "1.0.996",
72
+ "@teambit/api-server": "1.0.997",
87
73
  "@teambit/application": "1.0.972",
88
74
  "@teambit/aspect": "1.0.972",
89
75
  "@teambit/babel": "1.0.972",
90
76
  "@teambit/builder": "1.0.972",
91
77
  "@teambit/bundler": "1.0.972",
78
+ "@teambit/cache": "0.0.1413",
92
79
  "@teambit/changelog": "1.0.972",
93
80
  "@teambit/checkout": "1.0.973",
94
- "@teambit/ci": "1.0.352",
81
+ "@teambit/cli-mcp-server": "0.0.169",
95
82
  "@teambit/cloud": "0.0.1264",
96
83
  "@teambit/code": "1.0.972",
97
84
  "@teambit/command-bar": "1.0.972",
85
+ "@teambit/community": "1.0.748",
98
86
  "@teambit/compiler": "1.0.972",
99
87
  "@teambit/component-compare": "1.0.972",
100
88
  "@teambit/component-log": "1.0.972",
@@ -104,6 +92,7 @@
104
92
  "@teambit/component": "1.0.972",
105
93
  "@teambit/compositions": "1.0.972",
106
94
  "@teambit/config-merger": "0.0.839",
95
+ "@teambit/config-store": "0.0.200",
107
96
  "@teambit/dependencies": "1.0.972",
108
97
  "@teambit/dependency-resolver": "1.0.972",
109
98
  "@teambit/deprecation": "1.0.972",
@@ -115,9 +104,11 @@
115
104
  "@teambit/env": "1.0.972",
116
105
  "@teambit/eslint": "1.0.972",
117
106
  "@teambit/export": "1.0.972",
107
+ "@teambit/express": "0.0.1419",
118
108
  "@teambit/forking": "1.0.972",
119
109
  "@teambit/formatter": "1.0.972",
120
110
  "@teambit/git": "1.0.972",
111
+ "@teambit/global-config": "0.0.1323",
121
112
  "@teambit/graph": "1.0.972",
122
113
  "@teambit/graphql": "1.0.972",
123
114
  "@teambit/harmony-ui-app": "1.0.972",
@@ -131,9 +122,11 @@
131
122
  "@teambit/lanes": "1.0.988",
132
123
  "@teambit/linter": "1.0.972",
133
124
  "@teambit/lister": "1.0.972",
125
+ "@teambit/logger": "0.0.1413",
134
126
  "@teambit/mdx": "1.0.972",
135
127
  "@teambit/merge-lanes": "1.0.988",
136
128
  "@teambit/merging": "1.0.974",
129
+ "@teambit/mocha": "1.0.838",
137
130
  "@teambit/mover": "1.0.972",
138
131
  "@teambit/multi-compiler": "1.0.972",
139
132
  "@teambit/multi-tester": "1.0.972",
@@ -141,6 +134,7 @@
141
134
  "@teambit/node": "1.0.972",
142
135
  "@teambit/notifications": "1.0.972",
143
136
  "@teambit/objects": "0.0.479",
137
+ "@teambit/panels": "0.0.1323",
144
138
  "@teambit/pkg": "1.0.972",
145
139
  "@teambit/pnpm": "1.0.999",
146
140
  "@teambit/prettier": "1.0.972",
@@ -166,13 +160,19 @@
166
160
  "@teambit/ui": "1.0.972",
167
161
  "@teambit/user-agent": "1.0.972",
168
162
  "@teambit/validator": "0.0.208",
163
+ "@teambit/variants": "0.0.1588",
169
164
  "@teambit/version-history": "0.0.764",
170
165
  "@teambit/vue-aspect": "0.0.338",
171
166
  "@teambit/watcher": "1.0.972",
172
167
  "@teambit/webpack": "1.0.972",
168
+ "@teambit/worker": "0.0.1624",
173
169
  "@teambit/workspace-config-files": "1.0.972",
174
170
  "@teambit/workspace": "1.0.972",
175
- "@teambit/yarn": "1.0.972"
171
+ "@teambit/yarn": "1.0.972",
172
+ "@teambit/ui-foundation.ui.navigation.react-router-adapter": "6.1.3",
173
+ "@teambit/base-react.navigation.link": "2.0.31",
174
+ "@teambit/harmony.content.cli-reference": "2.0.1027",
175
+ "@teambit/ci": "1.0.353"
176
176
  },
177
177
  "devDependencies": {
178
178
  "@types/fs-extra": "9.0.7",