Documentation

Versioning & Release Operations

Release Protocol • Automated Commit Metadata, Semantic Bumps & NPM Publishing


1. Automated Version Stamping (tools/generate-version.mjs)

Every repository in the XTND Vantage suite contains tools/generate-version.mjs.

Execution Behavior

During prebuild, pretest, or postinstall, the script:

  1. Queries the current Git short commit hash:
    git rev-parse --short HEAD
  2. Checks for uncommitted modifications via git status --porcelain. If dirty, appends -dirty to the commit hash (e.g. 2bd25c6-dirty).
  3. Determines local timestamp in Asia/Bangkok time (+07:00).
  4. Generates two version stamp artifacts:

TypeScript Version Constant (src/version.generated.ts):

// Auto-generated by tools/generate-version.mjs. Do not edit.
export const VERSION = '1.0.0';
export const GIT_SHA = '2bd25c6';
export const COMMITTED_AT = '2026-09-05T14:15:58+07:00';
export const COMPILED_AT = '2026-09-05T14:38:25+07:00';

Public JSON Metadata (public/version.json):

{
  "version": "1.0.0",
  "sha": "2bd25c6",
  "committedAt": "2026-09-05T14:15:58+07:00",
  "compiledAt": "2026-09-05T14:38:25+07:00"
}

2. Version Bumping Scripts

Each package.json provides scripts to bump versions without creating unwanted git tags:

# Bump patch: 1.0.0 -> 1.0.1
npm run bump:patch

# Bump minor: 1.0.0 -> 1.1.0
npm run bump:minor

# Bump major: 1.0.0 -> 2.0.0
npm run bump:major

3. Standalone SDK Publishing Workflow

When releasing updates to the three standalone client libraries:

  1. @xtnd-dynamics/xtnd-sonar-sdk
  2. @xtnd-dynamics/xtnd-radar-sdk
  3. @xtnd-dynamics/xtnd-argus-sdk

Release Steps:

# 1. Navigate to target SDK
cd Workspaces/xtnd-vantage/xtnd-sonar-sdk

# 2. Bump version
npm run bump:minor

# 3. Build & test
npm run build
npm test

# 4. Publish to NPM
npm publish --access public