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
23 changes: 10 additions & 13 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
Expand Up @@ -127,6 +127,6 @@
"i18next": "^26.0.6",
"react-i18next": "^17.0.4",
"react-is": "^19.2.5",
"toktrack": "2.5.0"
"toktrack": "2.6.0"
}
}
4 changes: 2 additions & 2 deletions shared/toktrack-version.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** Canonical npm package name used for toktrack lookups and execution. */
export const TOKTRACK_PACKAGE_NAME: 'toktrack'
/** Pinned toktrack version validated by TTDash. */
export const TOKTRACK_VERSION: '2.5.0'
export const TOKTRACK_VERSION: '2.6.0'
/** Fully qualified toktrack package spec used by npm and bun executors. */
export const TOKTRACK_PACKAGE_SPEC: 'toktrack@2.5.0'
export const TOKTRACK_PACKAGE_SPEC: 'toktrack@2.6.0'
2 changes: 1 addition & 1 deletion shared/toktrack-version.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const TOKTRACK_PACKAGE_NAME = 'toktrack'
const TOKTRACK_VERSION = '2.5.0'
const TOKTRACK_VERSION = '2.6.0'
const TOKTRACK_PACKAGE_SPEC = `${TOKTRACK_PACKAGE_NAME}@${TOKTRACK_VERSION}`

module.exports = {
Expand Down
8 changes: 7 additions & 1 deletion tests/e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'node:fs'
import fsPromises from 'node:fs/promises'
import path from 'node:path'
import { expect, type Download, type Page } from '@playwright/test'
import { TOKTRACK_VERSION } from '../../shared/toktrack-version.js'

export const sampleUsagePath = path.join(process.cwd(), 'examples', 'sample-usage.json')

Expand Down Expand Up @@ -154,7 +155,12 @@ export async function mockAutoImportStream(page: Page) {
},
body: [
'event: check',
'data: {"tool":"toktrack","status":"found","method":"mock","version":"2.5.0"}',
`data: ${JSON.stringify({
tool: 'toktrack',
status: 'found',
method: 'mock',
version: TOKTRACK_VERSION,
})}`,
'',
'event: progress',
'data: {"key":"startingLocalImport"}',
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '@/lib/api'
import { DEFAULT_APP_SETTINGS } from '@/lib/app-settings'
import { initI18n } from '@/lib/i18n'
import { TOKTRACK_VERSION } from '../../shared/toktrack-version.js'

describe('api error handling', () => {
beforeEach(async () => {
Expand Down Expand Up @@ -254,7 +255,7 @@ describe('api error handling', () => {
vi.fn().mockResolvedValue(
new Response(
JSON.stringify({
configuredVersion: '2.5.0',
configuredVersion: TOKTRACK_VERSION,
latestVersion: '2.4.1',
isLatest: false,
lookupStatus: 'ok',
Expand All @@ -268,7 +269,7 @@ describe('api error handling', () => {
)

await expect(fetchToktrackVersionStatus()).resolves.toEqual({
configuredVersion: '2.5.0',
configuredVersion: TOKTRACK_VERSION,
latestVersion: '2.4.1',
isLatest: false,
lookupStatus: 'ok',
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/auto-import.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { startAutoImport, translateAutoImportEvent } from '@/lib/auto-import'
import { TOKTRACK_PACKAGE_SPEC } from '../../shared/toktrack-version.js'

const translations = {
'autoImportModal.startingLocalImport': 'Starte toktrack-Import...',
Expand Down Expand Up @@ -59,11 +60,11 @@ describe('translateAutoImportEvent', () => {
translateAutoImportEvent(
{
key: 'loadingUsageData',
vars: { command: 'npx --yes toktrack@2.5.0 daily --json' },
vars: { command: `npx --yes ${TOKTRACK_PACKAGE_SPEC} daily --json` },
},
translate,
),
).toBe('Lade Nutzungsdaten via npx --yes toktrack@2.5.0 daily --json...')
).toBe(`Lade Nutzungsdaten via npx --yes ${TOKTRACK_PACKAGE_SPEC} daily --json...`)
expect(
translateAutoImportEvent(
{
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/runtime-state.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ describe('server runtime state services', () => {
expect(load).toHaveBeenCalledWith('first')
expect(requestedLabels).toEqual(['first'])

resolveLookup({ status: 'ok', value: '2.5.0' })
resolveLookup({ status: 'ok', value: 'fresh-value' })

await expect(firstLookup).resolves.toEqual({ status: 'ok', value: '2.5.0' })
await expect(secondLookup).resolves.toEqual({ status: 'ok', value: '2.5.0' })
await expect(firstLookup).resolves.toEqual({ status: 'ok', value: 'fresh-value' })
await expect(secondLookup).resolves.toEqual({ status: 'ok', value: 'fresh-value' })

now.mockReturnValue(1099)
await expect(cache.lookup('cached')).resolves.toEqual({ status: 'ok', value: '2.5.0' })
await expect(cache.lookup('cached')).resolves.toEqual({ status: 'ok', value: 'fresh-value' })
expect(load).toHaveBeenCalledTimes(1)

now.mockReturnValue(1101)
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/startup-runtime.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createRequire } from 'node:module'
import { describe, expect, it, vi } from 'vitest'
import { TOKTRACK_VERSION } from '../../shared/toktrack-version.js'

const require = createRequire(import.meta.url)
const { createStartupRuntime, formatCurrency, formatInteger } =
Expand Down Expand Up @@ -72,7 +73,7 @@ function createStartupRuntimeFixture(overrides: Record<string, unknown> = {}) {
autoImportRuntime: {
formatAutoImportMessageEvent: (event: { key: string }) => event.key,
performAutoImport: vi.fn(async ({ onCheck, onProgress, onOutput }) => {
onCheck({ status: 'found', method: 'local', version: '2.5.0' })
onCheck({ status: 'found', method: 'local', version: TOKTRACK_VERSION })
onProgress({ key: 'processingUsageData' })
onOutput('toktrack output')
return { days: 2, totalCost: 1.23 }
Expand Down Expand Up @@ -243,7 +244,7 @@ describe('startup runtime', () => {
await runtime.runStartupAutoLoad()

expect(markStartupAutoLoadCompleted).toHaveBeenCalledTimes(1)
expect(logs).toContain('toktrack found (local, v2.5.0)')
expect(logs).toContain(`toktrack found (local, v${TOKTRACK_VERSION})`)
expect(logs).toContain('processingUsageData')
expect(logs).toContain('Auto-load complete: imported 2 days, $ 1.23.')
})
Expand Down
Loading