Skip to content

Commit 5b87433

Browse files
authored
Merge pull request #129 from TrueNine/dev
Refactor config and plugin runtime handling across CLI, SDK, GUI, and docs
2 parents e3e60b0 + dcbbecc commit 5b87433

File tree

108 files changed

+2509
-2667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2509
-2667
lines changed

.github/actions/setup-rust/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
rust-version:
66
description: Rust toolchain version
77
required: false
8-
default: "1.88.0"
8+
default: "1.93.1"
99
targets:
1010
description: Additional Rust targets to install (comma-separated)
1111
required: false

.github/workflows/pull-request.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,15 @@ jobs:
121121

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

124-
- uses: ./.github/actions/setup-rust
124+
- name: Read GUI version
125+
id: gui-version
126+
run: |
127+
version="$(node -p 'require("./gui/package.json").version')"
128+
echo "version=$version" >> "$GITHUB_OUTPUT"
129+
130+
- uses: ./.github/actions/setup-tauri
125131
with:
126-
cache-key: pr
132+
version: ${{ steps.gui-version.outputs.version }}
127133

128134
- name: Build native modules
129135
run: pnpm run build:native
@@ -134,6 +140,34 @@ jobs:
134140
- name: Run all tests
135141
run: pnpm run test
136142

143+
test-gui:
144+
if: github.event.pull_request.draft == false
145+
runs-on: ubuntu-24.04
146+
timeout-minutes: 20
147+
steps:
148+
- uses: actions/checkout@v6
149+
150+
- uses: ./.github/actions/setup-node-pnpm
151+
152+
- name: Read GUI version
153+
id: gui-version
154+
run: |
155+
version="$(node -p 'require("./gui/package.json").version')"
156+
echo "version=$version" >> "$GITHUB_OUTPUT"
157+
158+
- uses: ./.github/actions/setup-tauri
159+
with:
160+
version: ${{ steps.gui-version.outputs.version }}
161+
162+
- name: Build native modules
163+
run: pnpm run build:native
164+
165+
- name: Build
166+
run: pnpm run build
167+
168+
- name: Run GUI tests
169+
run: pnpm turbo test --filter=@truenine/memory-sync-gui
170+
137171
test-sdk:
138172
if: github.event.pull_request.draft == false
139173
runs-on: ubuntu-24.04

.github/workflows/release-cli.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,33 @@ jobs:
248248
fi
249249
done <<< "$CLI_NATIVE_BINDING_PREFIXES"
250250
done
251+
- name: Validate NAPI binary format and size
252+
shell: bash
253+
run: |
254+
shopt -s nullglob
255+
min_size=$((1024 * 1024))
256+
for target_dir in cli/npm/*/; do
257+
if [ ! -f "${target_dir}package.json" ]; then
258+
continue
259+
fi
260+
for node_file in "${target_dir}"*.node; do
261+
if [ ! -f "$node_file" ]; then
262+
continue
263+
fi
264+
size=$(stat -c%s "$node_file" 2>/dev/null || stat -f%z "$node_file" 2>/dev/null || echo 0)
265+
if [ "$size" -lt "$min_size" ]; then
266+
echo "ERROR: ${node_file} is too small (${size} bytes), expected at least ${min_size} bytes"
267+
exit 1
268+
fi
269+
file_output=$(file "$node_file")
270+
echo "File info for ${node_file}: ${file_output}"
271+
if [[ "$file_output" == *"ELF"* ]] || [[ "$file_output" == *"Mach-O"* ]] || [[ "$file_output" == *"PE"* ]]; then
272+
echo "OK: ${node_file} is a valid native binary"
273+
else
274+
echo "WARNING: ${node_file} format could not be verified as ELF/Mach-O/PE"
275+
fi
276+
done
277+
done
251278
- name: Publish CLI platform sub-packages
252279
uses: ./.github/actions/npm-publish-package
253280
with:

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
"dist",
3434
"dist/tnmsc.schema.json"
3535
],
36+
"engines": {
37+
"node": ">= 22"
38+
},
3639
"napi": {
3740
"binaryName": "napi-memory-sync-cli",
3841
"targets": [

cli/src/commands/PluginsCommand.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,10 @@ export class PluginsCommand implements Command {
55
readonly name = 'plugins'
66

77
async execute(ctx: CommandContext): Promise<CommandResult> {
8-
const {logger, outputPlugins, userConfigOptions} = ctx
8+
const {logger, outputPlugins} = ctx
99
const pluginInfos: JsonPluginInfo[] = []
1010

11-
for (const plugin of userConfigOptions.plugins) {
12-
pluginInfos.push({
13-
name: plugin.name,
14-
kind: 'Output',
15-
description: plugin.name,
16-
dependencies: [...plugin.dependsOn ?? []]
17-
})
18-
}
19-
20-
const registeredNames = new Set(pluginInfos.map(plugin => plugin.name))
2111
for (const plugin of outputPlugins) {
22-
if (registeredNames.has(plugin.name)) continue
2312
pluginInfos.push({
2413
name: plugin.name,
2514
kind: 'Output',

cli/src/plugin.config.ts

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
CursorOutputPlugin,
88
defineConfig,
99
DroidCLIOutputPlugin,
10-
EditorConfigOutputPlugin,
1110
GeminiCLIOutputPlugin,
1211
GitExcludeOutputPlugin,
1312
JetBrainsAIAssistantCodexOutputPlugin,
@@ -24,6 +23,10 @@ import {
2423
ZedIDEConfigOutputPlugin
2524
} from '@truenine/memory-sync-sdk'
2625

26+
type DefineConfigWithOutputPlugins = Parameters<typeof defineConfig>[0] & {
27+
readonly outputPlugins: PipelineConfig['outputPlugins']
28+
}
29+
2730
export function resolveRuntimeCommandFromArgv(argv: readonly string[] = process.argv): RuntimeCommand {
2831
const args = argv.filter((arg): arg is string => arg != null)
2932
const userArgs = args.slice(2)
@@ -39,34 +42,33 @@ export async function createDefaultPluginConfig(
3942
runtimeCommand: RuntimeCommand = resolveRuntimeCommandFromArgv(argv),
4043
executionCwd: string = process.cwd()
4144
): Promise<PipelineConfig> {
45+
const outputPlugins: PipelineConfig['outputPlugins'] = [
46+
new AgentsOutputPlugin(),
47+
new ClaudeCodeCLIOutputPlugin(),
48+
new CodexCLIOutputPlugin(),
49+
new JetBrainsAIAssistantCodexOutputPlugin(),
50+
new DroidCLIOutputPlugin(),
51+
new GeminiCLIOutputPlugin(),
52+
new KiroCLIOutputPlugin(),
53+
new OpencodeCLIOutputPlugin(),
54+
new QoderIDEPluginOutputPlugin(),
55+
new TraeIDEOutputPlugin(),
56+
new TraeCNIDEOutputPlugin(),
57+
new WarpIDEOutputPlugin(),
58+
new WindsurfOutputPlugin(),
59+
new CursorOutputPlugin(),
60+
new GitExcludeOutputPlugin(),
61+
new JetBrainsIDECodeStyleConfigOutputPlugin(),
62+
new VisualStudioCodeIDEConfigOutputPlugin(),
63+
new ZedIDEConfigOutputPlugin(),
64+
new ReadmeMdConfigFileOutputPlugin()
65+
]
66+
4267
return defineConfig({
4368
executionCwd,
4469
runtimeCommand,
45-
pluginOptions: {
46-
plugins: [
47-
new AgentsOutputPlugin(),
48-
new ClaudeCodeCLIOutputPlugin(),
49-
new CodexCLIOutputPlugin(),
50-
new JetBrainsAIAssistantCodexOutputPlugin(),
51-
new DroidCLIOutputPlugin(),
52-
new GeminiCLIOutputPlugin(),
53-
new KiroCLIOutputPlugin(),
54-
new OpencodeCLIOutputPlugin(),
55-
new QoderIDEPluginOutputPlugin(),
56-
new TraeIDEOutputPlugin(),
57-
new TraeCNIDEOutputPlugin(),
58-
new WarpIDEOutputPlugin(),
59-
new WindsurfOutputPlugin(),
60-
new CursorOutputPlugin(),
61-
new GitExcludeOutputPlugin(),
62-
new JetBrainsIDECodeStyleConfigOutputPlugin(),
63-
new EditorConfigOutputPlugin(),
64-
new VisualStudioCodeIDEConfigOutputPlugin(),
65-
new ZedIDEConfigOutputPlugin(),
66-
new ReadmeMdConfigFileOutputPlugin()
67-
]
68-
}
69-
})
70+
outputPlugins
71+
} as DefineConfigWithOutputPlugins)
7072
}
7173

7274
export default createDefaultPluginConfig

cli/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"@truenine/plugin-claude-code-cli": ["./src/plugins/plugin-claude-code-cli.ts"],
2727
"@truenine/plugin-cursor": ["./src/plugins/plugin-cursor.ts"],
2828
"@truenine/plugin-droid-cli": ["./src/plugins/plugin-droid-cli.ts"],
29-
"@truenine/plugin-editorconfig": ["./src/plugins/plugin-editorconfig.ts"],
3029
"@truenine/plugin-gemini-cli": ["./src/plugins/plugin-gemini-cli.ts"],
3130
"@truenine/plugin-git-exclude": ["./src/plugins/plugin-git-exclude.ts"],
3231
"@truenine/plugin-jetbrains-ai-codex": ["./src/plugins/plugin-jetbrains-ai-codex.ts"],
@@ -37,7 +36,7 @@
3736
"@truenine/plugin-readme": ["./src/plugins/plugin-readme.ts"],
3837
"@truenine/plugin-trae-ide": ["./src/plugins/plugin-trae-ide.ts"],
3938
"@truenine/plugin-vscode": ["./src/plugins/plugin-vscode.ts"],
40-
"@truenine/plugin-warp-ide": ["./src/plugins/plugin-warp-ide.ts"],
39+
"@truenine/plugin-warp-ide": ["../sdk/src/plugins/WarpIDEOutputPlugin.ts"],
4140
"@truenine/plugin-windsurf": ["./src/plugins/plugin-windsurf.ts"],
4241
"@truenine/plugin-zed": ["./src/plugins/plugin-zed.ts"]
4342
},

doc/app/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type {Metadata} from 'next'
22
import {Inter, JetBrains_Mono} from 'next/font/google'
3-
import {getSiteUrl, siteConfig} from '../lib/site'
3+
import React from 'react'
4+
import {getSiteUrl, siteConfig} from '@/lib/site'
45
import 'nextra-theme-docs/style.css'
56
import './globals.scss'
67

doc/app/robots.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type {MetadataRoute} from 'next'
2-
import {getSiteUrl} from '../lib/site'
2+
import {getSiteUrl} from '@/lib/site'
33

44
export default function robots(): MetadataRoute.Robots {
55
const siteUrl = getSiteUrl()

0 commit comments

Comments
 (0)