production

tcmts.studio.production · #emqtbpc5 · term · runs on the server

uses node:fs

Production as the studio knows it: the server's address and its traces token, and when its traces were fetched.

import type { Codebase } from "#codebase/tcmts/cli/codebase";
import { productionFile } from "#codebase/tcmts/studio";
import fs from "node:fs";

export function production(
  cb: Codebase,
): { url: string; token: string; fetched?: number } | undefined {
  try {
    return JSON.parse(fs.readFileSync(productionFile(cb), "utf8")) as {
      url: string;
      token: string;
      fetched?: number;
    };
  } catch {
    return undefined;
  }
}

uses

used by