sitepaige-mcp-server 0.7.12 → 0.7.14

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.
@@ -15,11 +15,7 @@ let pool: mysql.Pool | null = null;
15
15
  * @returns Database client (Pool)
16
16
  */
17
17
  export async function db_init(): Promise<mysql.Pool> {
18
- // Skip database initialization during build time
19
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
20
- // Return a mock pool object that won't cause errors
21
- return {} as mysql.Pool;
22
- }
18
+
23
19
 
24
20
  // Return existing pool if already initialized
25
21
  if (pool) {
@@ -63,10 +59,7 @@ export async function db_query(
63
59
  query: string,
64
60
  params?: any[]
65
61
  ): Promise<any[]> {
66
- // Return empty results during build time
67
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
68
- return [];
69
- }
62
+
70
63
 
71
64
  try {
72
65
  // MySQL uses ? placeholders like SQLite, so no conversion needed
@@ -15,11 +15,6 @@ let pool: Pool | null = null;
15
15
  * @returns Database client (Pool)
16
16
  */
17
17
  export async function db_init(): Promise<Pool> {
18
- // Skip database initialization during build time
19
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
20
- // Return a mock pool object that won't cause errors
21
- return {} as Pool;
22
- }
23
18
 
24
19
  try {
25
20
  // Create connection configuration
@@ -67,11 +62,7 @@ export async function db_query(
67
62
  query: string,
68
63
  params?: any[]
69
64
  ): Promise<any[]> {
70
- // Return empty results during build time
71
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
72
- return [];
73
- }
74
-
65
+
75
66
  try {
76
67
  // Convert SQLite ? placeholders to PostgreSQL $1, $2, etc.
77
68
  let pgQuery = query;
@@ -52,12 +52,7 @@ function getDefaultDbPath(): string {
52
52
  * @returns Database client
53
53
  */
54
54
  export async function db_init(): Promise<Database.Database> {
55
- // Skip database initialization during build time
56
- // Check if we're in a build environment by detecting the absence of runtime variables
57
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
58
- // Return a mock database object that won't cause errors during static generation
59
- return {} as Database.Database;
60
- }
55
+
61
56
 
62
57
  // Always use the default path - no parameter needed
63
58
  const actualPath = getDefaultDbPath();
@@ -102,10 +97,7 @@ export async function db_query(
102
97
  query: string,
103
98
  params?: any[]
104
99
  ): Promise<any[]> {
105
- // Return empty results during build time
106
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
107
- return [];
108
- }
100
+
109
101
 
110
102
  try {
111
103
  // Convert booleans to integers for SQLite3 compatibility
@@ -15,11 +15,7 @@ let pool: mysql.Pool | null = null;
15
15
  * @returns Database client (Pool)
16
16
  */
17
17
  export async function db_init(): Promise<mysql.Pool> {
18
- // Skip database initialization during build time
19
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
20
- // Return a mock pool object that won't cause errors
21
- return {} as mysql.Pool;
22
- }
18
+
23
19
 
24
20
  // Return existing pool if already initialized
25
21
  if (pool) {
@@ -63,10 +59,7 @@ export async function db_query(
63
59
  query: string,
64
60
  params?: any[]
65
61
  ): Promise<any[]> {
66
- // Return empty results during build time
67
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
68
- return [];
69
- }
62
+
70
63
 
71
64
  try {
72
65
  // MySQL uses ? placeholders like SQLite, so no conversion needed
@@ -15,11 +15,6 @@ let pool: Pool | null = null;
15
15
  * @returns Database client (Pool)
16
16
  */
17
17
  export async function db_init(): Promise<Pool> {
18
- // Skip database initialization during build time
19
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
20
- // Return a mock pool object that won't cause errors
21
- return {} as Pool;
22
- }
23
18
 
24
19
  try {
25
20
  // Create connection configuration
@@ -67,11 +62,7 @@ export async function db_query(
67
62
  query: string,
68
63
  params?: any[]
69
64
  ): Promise<any[]> {
70
- // Return empty results during build time
71
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
72
- return [];
73
- }
74
-
65
+
75
66
  try {
76
67
  // Convert SQLite ? placeholders to PostgreSQL $1, $2, etc.
77
68
  let pgQuery = query;
@@ -52,12 +52,7 @@ function getDefaultDbPath(): string {
52
52
  * @returns Database client
53
53
  */
54
54
  export async function db_init(): Promise<Database.Database> {
55
- // Skip database initialization during build time
56
- // Check if we're in a build environment by detecting the absence of runtime variables
57
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
58
- // Return a mock database object that won't cause errors during static generation
59
- return {} as Database.Database;
60
- }
55
+
61
56
 
62
57
  // Always use the default path - no parameter needed
63
58
  const actualPath = getDefaultDbPath();
@@ -102,10 +97,7 @@ export async function db_query(
102
97
  query: string,
103
98
  params?: any[]
104
99
  ): Promise<any[]> {
105
- // Return empty results during build time
106
- if (typeof window === 'undefined' && !process.env.HOSTNAME && process.env.NODE_ENV === 'production') {
107
- return [];
108
- }
100
+
109
101
 
110
102
  try {
111
103
  // Convert booleans to integers for SQLite3 compatibility
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sitepaige-mcp-server",
3
- "version": "0.7.12",
3
+ "version": "0.7.14",
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": [