@donkeylabs/mcp 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.ts +12 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donkeylabs/mcp",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "MCP server for AI-assisted development with @donkeylabs/server",
5
5
  "type": "module",
6
6
  "main": "./src/server.ts",
package/src/server.ts CHANGED
@@ -1261,28 +1261,28 @@ ${ctxComment}
1261
1261
  if (hasSchema) {
1262
1262
  mkdirSync(join(pluginDir, "migrations"), { recursive: true });
1263
1263
 
1264
- const migrationContent = `import { Kysely, sql } from "kysely";
1264
+ const migrationContent = `import { Kysely } from "kysely";
1265
1265
 
1266
1266
  /**
1267
1267
  * Migration: 001_initial
1268
1268
  * Created: ${new Date().toISOString()}
1269
1269
  * Plugin: ${name}
1270
+ *
1271
+ * Use Kysely schema builder methods - NOT raw SQL.
1272
+ * See docs/database.md for examples.
1270
1273
  */
1271
1274
 
1272
1275
  export async function up(db: Kysely<any>): Promise<void> {
1273
- // Create your tables here
1274
- // Example:
1275
- // await db.schema
1276
- // .createTable("${name}")
1277
- // .addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
1278
- // .addColumn("name", "text", (col) => col.notNull())
1279
- // .addColumn("created_at", "text", (col) => col.defaultTo(sql\`CURRENT_TIMESTAMP\`))
1280
- // .execute();
1276
+ await db.schema
1277
+ .createTable("${name}")
1278
+ .addColumn("id", "text", (col) => col.primaryKey())
1279
+ .addColumn("name", "text", (col) => col.notNull())
1280
+ .addColumn("created_at", "text", (col) => col.notNull())
1281
+ .execute();
1281
1282
  }
1282
1283
 
1283
1284
  export async function down(db: Kysely<any>): Promise<void> {
1284
- // Drop your tables here
1285
- // await db.schema.dropTable("${name}").execute();
1285
+ await db.schema.dropTable("${name}").execute();
1286
1286
  }
1287
1287
  `;
1288
1288
  await Bun.write(join(pluginDir, "migrations", "001_initial.ts"), migrationContent);
@@ -1308,7 +1308,7 @@ server.registerPlugin(${name}Plugin);
1308
1308
 
1309
1309
  **Location:** ${projectConfig.pluginsDir}/${name}/
1310
1310
  **Files created:**
1311
- - index.ts (plugin definition)${hasSchema ? "\n- schema.ts (database types)\n- migrations/001_initial.sql" : ""}
1311
+ - index.ts (plugin definition)${hasSchema ? "\n- migrations/001_initial.ts (Kysely migration)\n- schema.ts (auto-generated by donkeylabs generate)" : ""}
1312
1312
 
1313
1313
  **Plugin features:**
1314
1314
  ${hasSchema ? "- ✅ Database schema (withSchema<>)\n" : ""}${hasConfig ? "- ✅ Configurable (withConfig<>)\n" : ""}- Service with ctx.core (logger, cache, events, cron, jobs, sse, rateLimiter)