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
31 changes: 29 additions & 2 deletions .githooks/sync-versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,19 @@ function createFixtureRepo(): string {
})
writeJson(join(rootDir, 'cli', 'package.json'), {
name: '@truenine/memory-sync-cli',
version: initialVersion
version: initialVersion,
optionalDependencies: {
'@truenine/memory-sync-cli-darwin-arm64': initialVersion,
'@truenine/memory-sync-cli-linux-x64-gnu': initialVersion
}
})
writeJson(join(rootDir, 'mcp', 'package.json'), {
name: '@truenine/memory-sync-mcp',
version: initialVersion,
optionalDependencies: {
'@truenine/memory-sync-mcp-darwin-arm64': initialVersion,
'@truenine/memory-sync-mcp-linux-x64-gnu': initialVersion
}
})
writeJson(join(rootDir, 'gui', 'package.json'), {
name: '@truenine/memory-sync-gui',
Expand Down Expand Up @@ -121,7 +133,20 @@ function createFixtureRepo(): string {

function expectSharedVersionSurfaces(rootDir: string, nextVersion: string): void {
expect(JSON.parse(readFileSync(join(rootDir, 'package.json'), 'utf-8')) as {version: string}).toMatchObject({version: nextVersion})
expect(JSON.parse(readFileSync(join(rootDir, 'cli', 'package.json'), 'utf-8')) as {version: string}).toMatchObject({version: nextVersion})
expect(JSON.parse(readFileSync(join(rootDir, 'cli', 'package.json'), 'utf-8')) as {version: string, optionalDependencies: Record<string, string>}).toMatchObject({
version: nextVersion,
optionalDependencies: {
'@truenine/memory-sync-cli-darwin-arm64': nextVersion,
'@truenine/memory-sync-cli-linux-x64-gnu': nextVersion
}
})
expect(JSON.parse(readFileSync(join(rootDir, 'mcp', 'package.json'), 'utf-8')) as {version: string, optionalDependencies: Record<string, string>}).toMatchObject({
version: nextVersion,
optionalDependencies: {
'@truenine/memory-sync-mcp-darwin-arm64': nextVersion,
'@truenine/memory-sync-mcp-linux-x64-gnu': nextVersion
}
})
expect(JSON.parse(readFileSync(join(rootDir, 'gui', 'package.json'), 'utf-8')) as {version: string}).toMatchObject({version: nextVersion})
expect(JSON.parse(readFileSync(join(rootDir, 'doc', 'package.json'), 'utf-8')) as {version: string}).toMatchObject({version: nextVersion})
expect(JSON.parse(readFileSync(join(rootDir, 'cli', 'npm', 'darwin-arm64', 'package.json'), 'utf-8')) as {version: string}).toMatchObject({version: nextVersion})
Expand Down Expand Up @@ -171,6 +196,7 @@ describe('sync-versions hook', () => {
'gui/package.json',
'gui/src-tauri/Cargo.toml',
'gui/src-tauri/tauri.conf.json',
'mcp/package.json',
'package.json'
]))
})
Expand Down Expand Up @@ -202,6 +228,7 @@ describe('sync-versions hook', () => {
'gui/package.json',
'gui/src-tauri/Cargo.toml',
'gui/src-tauri/tauri.conf.json',
'mcp/package.json',
'package.json'
]))
})
Expand Down
35 changes: 34 additions & 1 deletion .githooks/sync-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,42 @@ function validateVersion(version: string, source: string): void {
}
}

function syncInternalDependencyVersions(json: VersionedJson, targetVersion: string): boolean {
let changed = false

for (const field of ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies']) {
const deps = json[field]
if (deps == null || typeof deps !== 'object' || Array.isArray(deps)) {
continue
}

for (const [name, value] of Object.entries(deps as Record<string, unknown>)) {
if (!name.startsWith('@truenine/memory-sync-')) {
continue
}

if (typeof value !== 'string' || value === targetVersion) {
continue
}

;(deps as Record<string, unknown>)[name] = targetVersion
changed = true
}
}

return changed
}

function syncJsonVersion(
filePath: string,
targetVersion: string,
changedPaths: Set<string>,
): void {
try {
const json = readJsonFile(filePath)
if (json.version === targetVersion) {
const dependenciesChanged = syncInternalDependencyVersions(json, targetVersion)

if (json.version === targetVersion && !dependenciesChanged) {
return
}

Expand Down Expand Up @@ -411,6 +439,11 @@ export function runSyncVersions(options: SyncVersionsOptions = {}): SyncVersions

validateVersion(currentRootVersion, 'root package.json')

const target = resolveTargetVersion(rootDir, currentRootVersion, options.requestedVersion)
const changedPaths = new Set<string>()

syncJsonVersion(rootPackagePath, target.version, changedPaths)

const packageJsonPaths = discoverFilesByName(rootDir, 'package.json')
.filter(filePath => resolve(filePath) !== rootPackagePath)
.sort()
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,25 @@ jobs:
- name: Rust unit tests
run: cargo test --workspace --exclude tnmsg --exclude tnmsc-integrate-tests --exclude tnmsc-local-tests --exclude tnmsm-integrate-tests --lib --bins

packaging-smoke:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v6

- uses: ./.github/actions/setup-node-pnpm

- uses: ./.github/actions/setup-rust
with:
cache-key: ci-packaging-smoke

- name: CLI packaging smoke
run: cargo test -p tnmsc-integrate-tests packaging_smoke_covers_release_binary_and_global_install -- --exact --nocapture

- name: MCP packaging smoke
run: cargo test -p tnmsm-integrate-tests packaging_smoke_covers_release_binary_and_global_install -- --exact --nocapture

gui-smoke:
needs: changes
if: |
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,20 @@ jobs:
- name: Build CLI package
run: cargo build --release -p tnmsc

- name: Smoke test CLI main package
shell: bash
run: |
set -euo pipefail
pack_dir="$(mktemp -d)"
trap 'rm -rf "$pack_dir"' EXIT
pnpm -C cli pack --pack-destination "$pack_dir"
cli_tarball="$(find "$pack_dir" -maxdepth 1 -name '*.tgz' -print -quit)"
test -n "$cli_tarball"
npm install -g "$cli_tarball"
command -v tnmsc
tnmsc help >/tmp/tnmsc-help.txt
grep -q 'install' /tmp/tnmsc-help.txt

- name: Publish CLI package
uses: ./.github/actions/npm-publish-package
with:
Expand Down Expand Up @@ -382,6 +396,20 @@ jobs:
- name: Build MCP package
run: cargo build --release -p tnmsm

- name: Smoke test MCP main package
shell: bash
run: |
set -euo pipefail
pack_dir="$(mktemp -d)"
trap 'rm -rf "$pack_dir"' EXIT
pnpm -C mcp pack --pack-destination "$pack_dir"
mcp_tarball="$(find "$pack_dir" -maxdepth 1 -name '*.tgz' -print -quit)"
test -n "$mcp_tarball"
npm install -g "$mcp_tarball"
command -v tnmsm
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | tnmsm >/tmp/tnmsm-initialize.json
grep -q '"jsonrpc":"2.0"' /tmp/tnmsm-initialize.json

- name: Publish MCP package
uses: ./.github/actions/npm-publish-package
with:
Expand Down
18 changes: 9 additions & 9 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ members = [
]

[workspace.package]
version = "2026.10422.10749"
version = "2026.10424.111"
edition = "2024"
rust-version = "1.88"
license = "AGPL-3.0-only"
Expand Down
3 changes: 3 additions & 0 deletions cli/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
*
!bin
!bin/
!bin/tnmsc.js
!schema
!schema/
!schema/tnmsc.schema.json
Expand Down
Loading
Loading