sitepaige-mcp-server 0.6.0 → 0.7.0
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/defaultapp/db.ts +1 -1
- package/dist/blueprintWriter.js +10 -10
- package/dist/defaultapp/db.ts +1 -1
- package/dist/generators/db-template.txt +1 -1
- package/dist/generators/sql.js +3 -3
- package/manifest.json +2 -2
- package/package.json +1 -1
package/defaultapp/db.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface DatabaseConfig {
|
|
|
44
44
|
|
|
45
45
|
// Get database configuration from environment
|
|
46
46
|
export function getDatabaseConfig(): DatabaseConfig {
|
|
47
|
-
const dbType = (process.env.DATABASE_TYPE || '
|
|
47
|
+
const dbType = (process.env.DATABASE_TYPE || 'postgres').toLowerCase() as DatabaseType;
|
|
48
48
|
|
|
49
49
|
switch (dbType) {
|
|
50
50
|
case 'postgres':
|
package/dist/blueprintWriter.js
CHANGED
|
@@ -49,14 +49,14 @@ export async function writeProjectFromBlueprint(project, options) {
|
|
|
49
49
|
}));
|
|
50
50
|
// package.json first to allow immediate npm install
|
|
51
51
|
const projectName = project.name || undefined;
|
|
52
|
-
await writePackageJson(targetDir, projectName, options.databaseType || "
|
|
52
|
+
await writePackageJson(targetDir, projectName, options.databaseType || "postgres");
|
|
53
53
|
await writeNextConfig(targetDir);
|
|
54
54
|
await writeBaseAppSkeleton(targetDir);
|
|
55
55
|
// Copy default app files after base skeleton
|
|
56
|
-
await writeDefaultApp(targetDir, options.databaseType || "
|
|
56
|
+
await writeDefaultApp(targetDir, options.databaseType || "postgres");
|
|
57
57
|
await writeComponents(targetDir, blueprint);
|
|
58
|
-
await writeModelsSql(targetDir, blueprint, options.databaseType || "
|
|
59
|
-
await writeIncrementalMigrations(targetDir, blueprint, options.databaseType || "
|
|
58
|
+
await writeModelsSql(targetDir, blueprint, options.databaseType || "postgres");
|
|
59
|
+
await writeIncrementalMigrations(targetDir, blueprint, options.databaseType || "postgres");
|
|
60
60
|
// Process images: download to public/images and replace refs in blueprint before views/pages
|
|
61
61
|
const bpWithImages = await processBlueprintImages(targetDir, blueprint);
|
|
62
62
|
const viewMap = await writeViews(targetDir, bpWithImages, projectCode, project.AuthProviders);
|
|
@@ -99,18 +99,18 @@ export async function writeProjectPagesOnly(project, options) {
|
|
|
99
99
|
}
|
|
100
100
|
// package.json first to allow immediate npm install
|
|
101
101
|
const projectName = project.name || undefined;
|
|
102
|
-
await writePackageJson(targetDir, projectName, options.databaseType || "
|
|
102
|
+
await writePackageJson(targetDir, projectName, options.databaseType || "postgres");
|
|
103
103
|
await writeNextConfig(targetDir);
|
|
104
104
|
await writeBaseAppSkeleton(targetDir);
|
|
105
105
|
// Copy default app files after base skeleton
|
|
106
|
-
await writeDefaultApp(targetDir, options.databaseType || "
|
|
106
|
+
await writeDefaultApp(targetDir, options.databaseType || "postgres");
|
|
107
107
|
await writeComponents(targetDir, blueprint);
|
|
108
108
|
// Write database/models if requested and they exist in blueprint
|
|
109
109
|
const hasModels = blueprint.models && blueprint.models.length > 0;
|
|
110
110
|
if (options.writeApis && hasModels) {
|
|
111
111
|
await debugLog('[writeProjectPagesOnly] Writing models/migrations (writeApis=true and models exist)');
|
|
112
|
-
await writeModelsSql(targetDir, blueprint, options.databaseType || "
|
|
113
|
-
await writeIncrementalMigrations(targetDir, blueprint, options.databaseType || "
|
|
112
|
+
await writeModelsSql(targetDir, blueprint, options.databaseType || "postgres");
|
|
113
|
+
await writeIncrementalMigrations(targetDir, blueprint, options.databaseType || "postgres");
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
116
|
await debugLog('[writeProjectPagesOnly] Skipping models/migrations (writeApis=' + options.writeApis + ', hasModels=' + hasModels + ')');
|
|
@@ -145,8 +145,8 @@ export async function writeProjectBackendOnly(project, options) {
|
|
|
145
145
|
throw new Error("No code found in project data");
|
|
146
146
|
}
|
|
147
147
|
// Only write backend-specific files
|
|
148
|
-
await writeModelsSql(targetDir, blueprint, options.databaseType || "
|
|
149
|
-
await writeIncrementalMigrations(targetDir, blueprint, options.databaseType || "
|
|
148
|
+
await writeModelsSql(targetDir, blueprint, options.databaseType || "postgres");
|
|
149
|
+
await writeIncrementalMigrations(targetDir, blueprint, options.databaseType || "postgres");
|
|
150
150
|
await writeApis(targetDir, blueprint, projectCode);
|
|
151
151
|
// Write architecture documentation (now includes backend)
|
|
152
152
|
await writeArchitectureDoc(targetDir, blueprint);
|
package/dist/defaultapp/db.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface DatabaseConfig {
|
|
|
44
44
|
|
|
45
45
|
// Get database configuration from environment
|
|
46
46
|
export function getDatabaseConfig(): DatabaseConfig {
|
|
47
|
-
const dbType = (process.env.DATABASE_TYPE || '
|
|
47
|
+
const dbType = (process.env.DATABASE_TYPE || 'postgres').toLowerCase() as DatabaseType;
|
|
48
48
|
|
|
49
49
|
switch (dbType) {
|
|
50
50
|
case 'postgres':
|
|
@@ -44,7 +44,7 @@ export interface DatabaseConfig {
|
|
|
44
44
|
|
|
45
45
|
// Get database configuration from environment
|
|
46
46
|
export function getDatabaseConfig(): DatabaseConfig {
|
|
47
|
-
const dbType = (process.env.DATABASE_TYPE || '
|
|
47
|
+
const dbType = (process.env.DATABASE_TYPE || 'postgres').toLowerCase() as DatabaseType;
|
|
48
48
|
|
|
49
49
|
switch (dbType) {
|
|
50
50
|
case 'postgres':
|
package/dist/generators/sql.js
CHANGED
|
@@ -75,7 +75,7 @@ export async function writeModelsSql(targetDir, blueprint, databaseType = "sqlit
|
|
|
75
75
|
'BOOLEAN': 'BOOLEAN'
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
const dbTypeMap = typeMap[databaseType] || typeMap.
|
|
78
|
+
const dbTypeMap = typeMap[databaseType] || typeMap.postgres;
|
|
79
79
|
const quoteChar = databaseType === 'mysql' ? '`' : '"';
|
|
80
80
|
for (const model of models) {
|
|
81
81
|
const tableName = model.name || model.id || "table";
|
|
@@ -106,7 +106,7 @@ export async function writeModelsSql(targetDir, blueprint, databaseType = "sqlit
|
|
|
106
106
|
lines.push("");
|
|
107
107
|
await fsp.writeFile(basePath, lines.join("\n"), "utf8");
|
|
108
108
|
}
|
|
109
|
-
export function generateSQLFromMigrations(migrations, databaseType = "
|
|
109
|
+
export function generateSQLFromMigrations(migrations, databaseType = "postgres") {
|
|
110
110
|
// Database-specific type mappings
|
|
111
111
|
const typeMap = {
|
|
112
112
|
sqlite: {
|
|
@@ -158,7 +158,7 @@ export function generateSQLFromMigrations(migrations, databaseType = "sqlite") {
|
|
|
158
158
|
'BOOLEAN': 'BOOLEAN'
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
|
-
const dbTypeMap = typeMap[databaseType] || typeMap.
|
|
161
|
+
const dbTypeMap = typeMap[databaseType] || typeMap.postgres;
|
|
162
162
|
const quoteChar = databaseType === 'mysql' ? '`' : '"';
|
|
163
163
|
const sql = [];
|
|
164
164
|
for (const m of migrations) {
|
package/manifest.json
CHANGED
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
},
|
|
62
62
|
"databaseType": {
|
|
63
63
|
"type": "string",
|
|
64
|
-
"enum": ["
|
|
65
|
-
"description": "Database type to use (defaults to
|
|
64
|
+
"enum": ["postgres", "sqlite", "mysql"],
|
|
65
|
+
"description": "Database type to use (defaults to postgres)"
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"required": ["projectId", "targetDir"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sitepaige-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP server for generating web applications using SitePaige AI. Generate frontend (FREE/12 credits) then optionally add backend (50 credits)",
|
|
6
6
|
"keywords": [
|