{"version":3,"sources":["../../src/build-info.ts","../../src/lib/internal/build-info/generate.ts","../../src/lib/internal/build-info/load.ts"],"sourcesContent":["// Build info generation and loading utilities\n\n// All types\nexport type {\n  BuildInfo,\n  BuildInfoStatus,\n  GenerateBuildInfoOptions,\n  GenerationResult,\n  SaveResult,\n  LoadResult,\n} from './lib/internal/build-info/types';\n\n// Generation functionality\nexport { GenerateBuildInfo } from './lib/internal/build-info/generate';\n\n// Loading functionality\nexport {\n  loadBuildInfo,\n  DEFAULT_BUILD_INFO,\n} from './lib/internal/build-info/load';\n","import { exec } from 'child_process';\nimport { promisify } from 'util';\nimport * as path from 'path';\nimport { promises as fs } from 'fs';\nimport type {\n  BuildInfo,\n  GenerateBuildInfoOptions,\n  GenerationResult,\n  SaveResult,\n} from './types';\n\nconst execAsync = promisify(exec);\n\n// Fallback value for when build info cannot be determined\nconst FALLBACK_VALUE = '(unknown)';\n\n// Core BuildInfo property names that cannot be overridden by custom properties\nconst CORE_BUILD_INFO_PROPERTIES = new Set([\n  'build_timestamp',\n  'version',\n  'git_hash',\n  'git_branch',\n]);\n\n// Get the current timestamp\nfunction getBuildTimestamp(): string {\n  return new Date().toISOString();\n}\n\n// Check if git CLI is available\nasync function isGitAvailable(): Promise<boolean> {\n  try {\n    await execAsync('git --version');\n    return true;\n  } catch {\n    return false;\n  }\n}\n\n// Get the current git hash\nasync function getGitHash(workingDir: string): Promise<{\n  value: string;\n  warning?: string;\n}> {\n  try {\n    // Get the short hash (7 characters)\n    const { stdout } = await execAsync('git rev-parse --short HEAD', {\n      cwd: workingDir,\n      encoding: 'utf8',\n    });\n\n    return { value: stdout.trim() };\n  } catch (error) {\n    return {\n      value: FALLBACK_VALUE,\n      warning: `Error getting git hash: ${error instanceof Error ? error.message : String(error)}`,\n    };\n  }\n}\n\n// Get the current git branch\nasync function getGitBranch(workingDir: string): Promise<{\n  value: string;\n  warning?: string;\n}> {\n  try {\n    const { stdout } = await execAsync('git rev-parse --abbrev-ref HEAD', {\n      cwd: workingDir,\n      encoding: 'utf8',\n    });\n\n    return { value: stdout.trim() };\n  } catch (error) {\n    return {\n      value: FALLBACK_VALUE,\n      warning: `Error getting git branch: ${error instanceof Error ? error.message : String(error)}`,\n    };\n  }\n}\n\nexport class GenerateBuildInfo {\n  private workingDir: string;\n  private version?: string;\n  private customProperties: Record<string, unknown>;\n  private lastGeneratedResults?: GenerationResult;\n\n  /**\n   * Creates a new build info generator\n   *\n   * @param options - Configuration options for the build info generator\n   */\n  constructor(options: GenerateBuildInfoOptions = {}) {\n    this.workingDir = options.workingDir || process.cwd();\n    this.version = options.version;\n    this.customProperties = options.customProperties || {};\n  }\n\n  /**\n   * Generates build information and stores it internally\n   *\n   * @returns The generated build info results with warnings\n   */\n  public async generateInfo(): Promise<GenerationResult> {\n    const buildTimestamp = getBuildTimestamp();\n    const warnings: string[] = [];\n\n    // Check if git is available first\n    const isGitCLIAvailable = await isGitAvailable();\n\n    if (!isGitCLIAvailable) {\n      warnings.push('Git CLI not found. Build info will use fallback values.');\n    }\n\n    // Check project version if needed\n    let version = this.version;\n\n    if (!version) {\n      // no version provided, try to read from package.json\n      try {\n        const packageJSONPath = path.join(this.workingDir, 'package.json');\n        const packageJSONContent = await fs.readFile(packageJSONPath, 'utf8');\n        const packageJSON = JSON.parse(packageJSONContent) as {\n          version?: string;\n        };\n\n        // version found in package.json\n        if (packageJSON.version && typeof packageJSON.version === 'string') {\n          version = packageJSON.version;\n        }\n      } catch (error) {\n        warnings.push(\n          `Error reading package.json: ${error instanceof Error ? error.message : String(error)}`,\n        );\n      }\n    }\n\n    // Get git hash and branch\n    let gitHash = FALLBACK_VALUE;\n    let gitBranch = FALLBACK_VALUE;\n\n    if (isGitCLIAvailable) {\n      // get git hash\n      const gitHashResult = await getGitHash(this.workingDir);\n\n      if (gitHashResult.warning) {\n        warnings.push(gitHashResult.warning);\n      }\n\n      gitHash = gitHashResult.value;\n\n      // get git branch\n      const gitBranchResult = await getGitBranch(this.workingDir);\n\n      if (gitBranchResult.warning) {\n        warnings.push(gitBranchResult.warning);\n      }\n\n      gitBranch = gitBranchResult.value;\n    }\n\n    // Filter custom properties to prevent conflicts with core BuildInfo properties\n    const filteredCustomProperties: Record<string, unknown> = {};\n\n    for (const [key, value] of Object.entries(this.customProperties)) {\n      if (CORE_BUILD_INFO_PROPERTIES.has(key)) {\n        warnings.push(\n          `Custom property \"${key}\" conflicts with core BuildInfo property and will be ignored`,\n        );\n      } else {\n        filteredCustomProperties[key] = value;\n      }\n    }\n\n    // create build info object\n    const buildInfo: BuildInfo = {\n      build_timestamp: buildTimestamp,\n      version: version ?? FALLBACK_VALUE,\n      git_hash: gitHash,\n      git_branch: gitBranch,\n      // Spread filtered custom properties\n      ...filteredCustomProperties,\n    };\n\n    // create results object\n    const results: GenerationResult = {\n      buildInfo,\n      warnings,\n    };\n\n    // save results and return\n    this.lastGeneratedResults = results;\n    return results;\n  }\n\n  /**\n   * Generates the TypeScript source code for build info. Uses last generated results if available,\n   * otherwise calls generateInfo() first.\n   *\n   * @returns Promise that resolves to the generated TypeScript source code\n   */\n  public async generateSourceCode(): Promise<string> {\n    const resultsToSave =\n      this.lastGeneratedResults || (await this.generateInfo());\n\n    // Indentation for object properties\n    const indent = '  ';\n\n    // Core properties that always exist\n    const coreProperties = [\n      {\n        key: 'build_timestamp',\n        value: resultsToSave.buildInfo.build_timestamp,\n        exportName: 'BUILD_TIMESTAMP',\n      },\n      {\n        key: 'version',\n        value: resultsToSave.buildInfo.version,\n        exportName: 'APP_VERSION',\n      },\n      {\n        key: 'git_hash',\n        value: resultsToSave.buildInfo.git_hash,\n        exportName: 'GIT_HASH',\n      },\n      {\n        key: 'git_branch',\n        value: resultsToSave.buildInfo.git_branch,\n        exportName: 'GIT_BRANCH',\n      },\n    ];\n\n    // Build the BUILD_INFO object content\n    const buildInfoObjectLines: string[] = [];\n\n    // Add core properties\n    for (const prop of coreProperties) {\n      buildInfoObjectLines.push(indent + prop.key + \": '\" + prop.value + \"',\");\n    }\n\n    // Add custom properties\n    for (const [key, value] of Object.entries(resultsToSave.buildInfo)) {\n      // Skip core properties we already handled\n      if (!coreProperties.some((p) => p.key === key)) {\n        const serializedValue = JSON.stringify(value);\n        buildInfoObjectLines.push(indent + key + ': ' + serializedValue + ',');\n      }\n    }\n\n    // Build the complete file content as lines array\n    const lines: string[] = [];\n\n    // Header comments\n    lines.push('// This file is auto-generated. Do not edit manually.');\n    lines.push('// Generated on ' + resultsToSave.buildInfo.build_timestamp);\n    lines.push('');\n\n    // BUILD_INFO object\n    lines.push('export const BUILD_INFO = {');\n    lines.push(...buildInfoObjectLines);\n    lines.push('};');\n    lines.push('');\n\n    // Individual exports for core properties\n    lines.push('// Export individual properties for convenience');\n\n    for (const prop of coreProperties) {\n      lines.push(\n        'export const ' + prop.exportName + \" = '\" + prop.value + \"';\",\n      );\n    }\n\n    // Return the generated source code\n    return lines.join('\\n');\n  }\n\n  /**\n   * Generates human-readable JSON representation of build info. Uses last generated results if available,\n   * otherwise calls generateInfo() first.\n   *\n   * @returns Promise that resolves to the formatted JSON string\n   */\n  public async generateJSON(): Promise<string> {\n    const resultsToSave =\n      this.lastGeneratedResults || (await this.generateInfo());\n\n    return JSON.stringify(resultsToSave.buildInfo, null, 2);\n  }\n\n  /**\n   * Saves build info as TypeScript file. Uses last generated results if available,\n   * otherwise calls generateInfo() first.\n   *\n   * @param fileName File name to save (will be joined with workingDir). Defaults to 'current-build-info.ts'\n   * @returns Promise that resolves to save result with warnings\n   */\n  public async saveTS(\n    fileName: string = 'current-build-info.ts',\n  ): Promise<SaveResult> {\n    const resultsToSave =\n      this.lastGeneratedResults || (await this.generateInfo());\n\n    const sourceCode = await this.generateSourceCode();\n    const filePath = path.join(this.workingDir, fileName);\n    await fs.writeFile(filePath, sourceCode, 'utf8');\n\n    return {\n      saved: true,\n      warnings: resultsToSave.warnings,\n    };\n  }\n\n  /**\n   * Saves build info as JSON file. Uses last generated results if available,\n   * otherwise calls generateInfo() first.\n   *\n   * @param fileName File name to save (will be joined with workingDir). Defaults to 'current-build-info.json'\n   * @returns Promise that resolves to save result with warnings\n   */\n  public async saveJSON(\n    fileName: string = 'current-build-info.json',\n  ): Promise<SaveResult> {\n    const resultsToSave =\n      this.lastGeneratedResults || (await this.generateInfo());\n\n    const jsonContent = await this.generateJSON();\n    const filePath = path.join(this.workingDir, fileName);\n    await fs.writeFile(filePath, jsonContent, 'utf8');\n\n    return {\n      saved: true,\n      warnings: resultsToSave.warnings,\n    };\n  }\n\n  /**\n   * Gets the last generated build info results without regenerating\n   *\n   * @returns The last generated build info results, or undefined if none generated yet\n   */\n  public getLastGeneratedInfo(): GenerationResult | undefined {\n    return this.lastGeneratedResults;\n  }\n}\n","/**\n * Build Info Utilities\n *\n * This module provides utilities for accessing build information\n * in a way that works with both HMR and built environments,\n * and is compatible with various bundlers.\n */\n\n// Import shared types\nimport type { BuildInfo, LoadResult } from './types';\n\n/**\n * Default build info for development environments\n * Uses Unix epoch timestamp to make it clear this is fallback data\n */\nexport const DEFAULT_BUILD_INFO: BuildInfo = {\n  version: '1.0.0',\n  git_hash: 'dev',\n  git_branch: 'dev',\n  build_timestamp: '1970-01-01T00:00:00.000Z', // Unix epoch - clearly fake!\n};\n\n/**\n * Type guard to check if an unknown value is a valid BuildInfo object\n */\nfunction isValidBuildInfo(value: unknown): value is BuildInfo {\n  return (\n    value !== null &&\n    typeof value === 'object' &&\n    typeof (value as Record<string, unknown>).build_timestamp === 'string' &&\n    typeof (value as Record<string, unknown>).version === 'string' &&\n    typeof (value as Record<string, unknown>).git_hash === 'string' &&\n    typeof (value as Record<string, unknown>).git_branch === 'string'\n  );\n}\n\n/**\n * Load build information\n *\n * @param isBuilt Whether the app is running from a built artifact (true = load the file, false = return default)\n * @param importPromise A promise that imports the build info module (passed as a function to avoid bundler issues)\n * @returns A promise that resolves to the build info result containing both the info and status\n */\nexport async function loadBuildInfo(\n  isBuilt: boolean,\n  importPromise: () => Promise<unknown>,\n): Promise<LoadResult> {\n  // Not built (e.g. HMR mode) — return default without attempting the import\n  if (!isBuilt) {\n    return {\n      status: 'DEFAULT_NOT_BUILT',\n      isDefault: true,\n      info: DEFAULT_BUILD_INFO,\n    };\n  }\n\n  try {\n    // Built mode — try to load the build info from the generated file\n    const buildInfoModule = await importPromise();\n\n    if (\n      buildInfoModule &&\n      typeof buildInfoModule === 'object' &&\n      'BUILD_INFO' in buildInfoModule\n    ) {\n      const loadedInfo = (buildInfoModule as { BUILD_INFO: unknown })\n        .BUILD_INFO;\n\n      // Validate that BUILD_INFO is actually a valid BuildInfo object\n      if (isValidBuildInfo(loadedInfo)) {\n        return {\n          status: 'LOADED_SUCCESSFULLY',\n          isDefault: false,\n          info: loadedInfo,\n        };\n      } else {\n        return {\n          status: 'MODULE_INVALID_DATA',\n          isDefault: true,\n          info: DEFAULT_BUILD_INFO,\n        };\n      }\n    } else {\n      return {\n        status: 'MODULE_MISSING_DATA',\n        isDefault: true,\n        info: DEFAULT_BUILD_INFO,\n      };\n    }\n  } catch {\n    return {\n      status: 'IMPORT_ERROR',\n      isDefault: true,\n      info: DEFAULT_BUILD_INFO,\n    };\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,2BAAqB;AACrB,kBAA0B;AAC1B,WAAsB;AACtB,gBAA+B;AAQ/B,IAAM,gBAAY,uBAAU,yBAAI;AAGhC,IAAM,iBAAiB;AAGvB,IAAM,6BAA6B,oBAAI,IAAI;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,SAAS,oBAA4B;AACnC,UAAO,oBAAI,KAAK,GAAE,YAAY;AAChC;AAGA,eAAe,iBAAmC;AAChD,MAAI;AACF,UAAM,UAAU,eAAe;AAC/B,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGA,eAAe,WAAW,YAGvB;AACD,MAAI;AAEF,UAAM,EAAE,OAAO,IAAI,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