Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tempo-monorepo",
"version": "3.5.0",
"version": "3.5.1",
"private": true,
"engines": {
"node": ">=20.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magmacomputing/library",
"version": "3.5.0",
"version": "3.5.1",
"description": "Shared utility library for Tempo",
"author": "Magma Computing Solutions",
"license": "MIT",
Expand Down
5 changes: 5 additions & 0 deletions packages/tempo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.5.1] - 2026-06-28

### Fixed
- **Term Registration Resilience**: Hardened `Tempo.extend` with structural deduplication to safely ignore redundant registrations of identical core terms. This prevents edge-case term collisions (e.g., `qtr`) in mixed module-loader environments like Vitest where Node ESM and Vite may evaluate plugins multiple times.

## [3.5.0] - 2026-06-28

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/tempo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magmacomputing/tempo",
"version": "3.5.0",
"version": "3.5.1",
"engines": {
"node": ">=20.0.0"
},
Expand Down
22 changes: 16 additions & 6 deletions packages/tempo/src/tempo.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,25 @@ export class Tempo {

if (Tempo._termMap.get(config.key) === config) return;
if (Tempo._termMap.has(config.key)) {
const existing = Tempo._termMap.get(config.key);
const rangesMatch = JSON.stringify(existing?.ranges) === JSON.stringify(config.ranges);
if (existing?.scope === config.scope && existing?.description === config.description && rangesMatch) {
logDebug(`[Tempo#extend] Duplicate term registration ignored for key: "${config.key}"`, state.config);
return;
}
logError(`[Tempo#extend] Term collision on key: "${config.key}". Registration aborted.`, state.config);
return;
}
if (config.scope && Tempo._termMap.get(config.scope) === config) { /* continue */ }
else if (config.scope && Tempo._termMap.has(config.scope)) {
logError(`[Tempo#extend] Term collision on scope: "${config.scope}". Registration aborted.`, state.config);
return;
const existingScope = Tempo._termMap.get(config.scope);
const rangesMatch = JSON.stringify(existingScope?.ranges) === JSON.stringify(config.ranges);
if (existingScope?.key === config.key && existingScope?.description === config.description && rangesMatch) {
/* continue */
} else {
logError(`[Tempo#extend] Term collision on scope: "${config.scope}". Registration aborted.`, state.config);
return;
}
Comment thread
magmacomputing marked this conversation as resolved.
}

Tempo._termMap.set(config.key, config);
Expand All @@ -596,13 +608,11 @@ export class Tempo {
if (r.key) {
let val: string | undefined;
if (isDefined(r.hour)) {
if (Number.isInteger(r.hour) && r.hour >= 0 && r.hour <= 23) {
if (Number.isInteger(r.hour) && r.hour >= 0 && r.hour <= 23)
val = `${r.hour}:${pad(r.minute ?? 0)}`;
}
} else if (r.month) {
if (Number.isInteger(r.month) && r.month >= 1 && r.month <= 12) {
if (Number.isInteger(r.month) && r.month >= 1 && r.month <= 12)
val = `${pad(r.day ?? 1)} ${monthKeys[r.month - 1]}`;
}
}

if (val) aliases.push([r.key, val]);
Expand Down
2 changes: 1 addition & 1 deletion packages/tempo/src/tempo.version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
* ⚠️ This file is auto-updated by `npm run build:version` (see `bin/update-version.mjs`).
* Do NOT edit manually — your changes will be overwritten on the next build.
*/
export const TEMPO_VERSION = '3.5.0';
export const TEMPO_VERSION = '3.5.1';
Loading