Skip to content

Commit 6f030c0

Browse files
committed
Merge remote-tracking branch 'origin/bump-0.1.14' into claude/bump-version-0-1-14-011CUudV9AWMeaQDzP9u7tia
# Conflicts: # packages/cli/src/utils/pack-courses.ts
2 parents 48c3d0d + 8df5c44 commit 6f030c0

File tree

21 files changed

+207
-72
lines changed

21 files changed

+207
-72
lines changed

packages/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.14-2",
6+
"version": "0.1.14",
77
"type": "module",
88
"description": "CLI scaffolding tool for vue-skuilder projects",
99
"bin": {
@@ -76,5 +76,5 @@
7676
"node": ">=18.0.0"
7777
},
7878
"packageManager": "yarn@4.6.0",
79-
"stableVersion": "0.1.13"
79+
"stableVersion": "0.1.14"
8080
}

packages/cli/src/commands/studio.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,11 @@ async function buildStudioUIWithCustomQuestions(
11421142
const distConfigPath = path.join(distPath, 'custom-questions-config.json');
11431143

11441144
if (fs.existsSync(sourceConfigPath)) {
1145-
fs.copyFileSync(sourceConfigPath, distConfigPath);
1145+
// Read, update import path, and write to dist
1146+
const configContent = JSON.parse(fs.readFileSync(sourceConfigPath, 'utf-8'));
1147+
// Use absolute path from root so browser can load it
1148+
configContent.importPath = '/assets/questions.mjs';
1149+
fs.writeFileSync(distConfigPath, JSON.stringify(configContent, null, 2));
11461150
console.log(chalk.gray(` Custom questions config copied to dist directory`));
11471151
}
11481152

packages/cli/src/mcp-server.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
import { initializeDataLayer, getDataLayer, initializeTuiLogging } from '@vue-skuilder/db';
55
import { MCPServer } from '@vue-skuilder/mcp';
6-
import { consoleLogger } from '@vue-skuilder/common';
6+
import { createFileLogger } from '@vue-skuilder/common';
77
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
8+
import * as path from 'path';
9+
import * as os from 'os';
810

911
initializeTuiLogging();
1012

@@ -44,11 +46,16 @@ async function main() {
4446
await initializeDataLayer(couchdbConfig);
4547
const courseDB = getDataLayer().getCourseDB(courseId);
4648

47-
// Create and start MCP server with console logger
49+
// Create file logger for debugging
50+
const logFilePath = path.join(os.tmpdir(), 'vue-skuilder-mcp-debug.log');
51+
const fileLogger = createFileLogger(logFilePath);
52+
console.error(`MCP Server: Debug logs will be written to ${logFilePath}`);
53+
54+
// Create and start MCP server with file logger
4855
const server = new MCPServer(courseDB, {
4956
enableSourceLinking: true,
5057
maxCardsPerQuery: 50,
51-
logger: consoleLogger,
58+
logger: fileLogger,
5259
});
5360

5461
const transport = new StdioServerTransport();

packages/client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.14-2",
6+
"version": "0.1.14",
77
"license": "MIT",
88
"main": "dist/index.js",
99
"module": "dist/index.esm.js",
@@ -47,5 +47,5 @@
4747
"tslib": "^2.6.2",
4848
"typescript": "~5.7.2"
4949
},
50-
"stableVersion": "0.1.13"
50+
"stableVersion": "0.1.14"
5151
}

packages/common-ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.14-2",
6+
"version": "0.1.14",
77
"main": "./dist/common-ui.umd.js",
88
"module": "./dist/common-ui.es.js",
99
"types": "./dist/index.d.ts",
@@ -70,5 +70,5 @@
7070
"vite": "^6.0.9",
7171
"vitest": "^3.0.5"
7272
},
73-
"stableVersion": "0.1.13"
73+
"stableVersion": "0.1.14"
7474
}

packages/common/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.14-2",
6+
"version": "0.1.14",
77
"type": "module",
88
"main": "dist/index.js",
99
"module": "dist/index.mjs",
@@ -33,7 +33,8 @@
3333
},
3434
"dependencies": {
3535
"moment": "^2.30.1",
36-
"zod": "^4.0.0"
36+
"zod": "^3.23.8",
37+
"zod-to-json-schema": "^3.23.5"
3738
},
38-
"stableVersion": "0.1.13"
39+
"stableVersion": "0.1.14"
3940
}

packages/common/src/logger.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,40 @@ export const consoleLogger: SkLogger = {
3434
warn: (message: string, ...args: unknown[]) => console.warn(message, ...args), // eslint-disable-line no-console
3535
error: (message: string, ...args: unknown[]) => console.error(message, ...args), // eslint-disable-line no-console
3636
};
37+
38+
/**
39+
* File-based logger for Node.js debugging contexts
40+
* Appends logs to a file with timestamps
41+
*/
42+
export function createFileLogger(filePath: string): SkLogger {
43+
// Lazy import fs to avoid bundling issues
44+
let fs: any = null;
45+
46+
const writeLog = (level: string, message: string, ...args: unknown[]) => {
47+
if (!fs) {
48+
try {
49+
fs = require('fs');
50+
} catch (e) {
51+
// File logging not available in this context
52+
return;
53+
}
54+
}
55+
56+
const timestamp = new Date().toISOString();
57+
const argsStr = args.length > 0 ? ' ' + JSON.stringify(args) : '';
58+
const logLine = `[${timestamp}] [${level}] ${message}${argsStr}\n`;
59+
60+
try {
61+
fs.appendFileSync(filePath, logLine, 'utf8');
62+
} catch (e) {
63+
// Silently fail if we can't write to the file
64+
}
65+
};
66+
67+
return {
68+
debug: (message: string, ...args: unknown[]) => writeLog('DEBUG', message, ...args),
69+
info: (message: string, ...args: unknown[]) => writeLog('INFO', message, ...args),
70+
warn: (message: string, ...args: unknown[]) => writeLog('WARN', message, ...args),
71+
error: (message: string, ...args: unknown[]) => writeLog('ERROR', message, ...args),
72+
};
73+
}

packages/common/src/schemas/dataShapeToZod.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { z, ZodRawShape } from 'zod';
2+
import { zodToJsonSchema } from 'zod-to-json-schema';
23
import { DataShape, FieldDefinition, FieldType, Status } from '../index.js';
34

45
/**
@@ -110,10 +111,10 @@ export function toZod(dataShape: DataShape): z.ZodObject<ZodRawShape> {
110111
}
111112

112113
/**
113-
* Converts a DataShape to JSON Schema string using Zod v4 native conversion
114+
* Converts a DataShape to JSON Schema string using zod-to-json-schema
114115
*/
115116
export function toZodJSON(dataShape: DataShape): string {
116117
const zodSchema = toZod(dataShape);
117-
const jsonSchema = z.toJSONSchema(zodSchema);
118+
const jsonSchema = zodToJsonSchema(zodSchema);
118119
return JSON.stringify(jsonSchema, null, 2);
119120
}

packages/courseware/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.14-2",
6+
"version": "0.1.14",
77
"type": "module",
88
"main": "./dist/index.cjs.js",
99
"module": "./dist/index.mjs",
@@ -61,5 +61,5 @@
6161
"peerDependencies": {
6262
"vue": "^3.2.0"
6363
},
64-
"stableVersion": "0.1.13"
64+
"stableVersion": "0.1.14"
6565
}

packages/db/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.1.14-2",
6+
"version": "0.1.14",
77
"description": "Database layer for vue-skuilder",
88
"main": "dist/index.js",
99
"module": "dist/index.mjs",
@@ -57,5 +57,5 @@
5757
"tsup": "^8.0.2",
5858
"typescript": "~5.7.2"
5959
},
60-
"stableVersion": "0.1.13"
60+
"stableVersion": "0.1.14"
6161
}

0 commit comments

Comments
 (0)