@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.
- package/package.json +1 -1
- package/src/server.ts +12 -12
package/package.json
CHANGED
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
|
|
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
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
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
|
-
|
|
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-
|
|
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)
|