@gluonjs/compiler


@gluonjs/compiler / packages/compiler/src/diagnostics / gluonDiagnosticReferenceUrl

Function: gluonDiagnosticReferenceUrl()

gluonDiagnosticReferenceUrl(code, base?): string

Parameters

code

string

base?

string = '/diagnostics'

Returns

string

Example

Build a versioned documentation URL from a long or compact diagnostic code and a deployment-specific base path:

ts
import {
  GLUON_DIAGNOSTIC_CATALOG_VERSION,
  formatGluonDiagnostic,
  getGluonDiagnostic,
  gluonDiagnosticCatalog,
  gluonDiagnosticReferenceUrl,
  type GluonDiagnosticDefinition,
  type GluonDiagnosticSource,
} from '@gluonjs/compiler/diagnostics';

const definition: GluonDiagnosticDefinition | undefined =
  getGluonDiagnostic('GLUON_TEMPLATE_SLOT_UNKNOWN');
const source: GluonDiagnosticSource | undefined = definition?.source;
const message = formatGluonDiagnostic('GLUON_TEMPLATE_SLOT_UNKNOWN', 'product-card.ts:12');
const productionMessage = formatGluonDiagnostic('GLUON_TEMPLATE_SLOT_UNKNOWN', '', { production: true });
const url = gluonDiagnosticReferenceUrl('G1111', '/gluon/diagnostics');
console.log(GLUON_DIAGNOSTIC_CATALOG_VERSION, gluonDiagnosticCatalog.length, source, message, productionMessage, url);