sitepaige-mcp-server 0.7.11 → 0.7.13

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) {
@@ -15,16 +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
-
24
- // Return existing pool if already initialized
25
- if (pool) {
26
- return pool;
27
- }
28
18
 
29
19
  try {
30
20
  // Create connection configuration
@@ -55,7 +45,8 @@ export async function db_init(): Promise<Pool> {
55
45
 
56
46
  return pool;
57
47
  } catch (error) {
58
- throw error;
48
+ console.error(error);
49
+ return null;
59
50
  }
60
51
  }
61
52
 
@@ -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();
@@ -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) {
@@ -15,16 +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
-
24
- // Return existing pool if already initialized
25
- if (pool) {
26
- return pool;
27
- }
28
18
 
29
19
  try {
30
20
  // Create connection configuration
@@ -55,7 +45,8 @@ export async function db_init(): Promise<Pool> {
55
45
 
56
46
  return pool;
57
47
  } catch (error) {
58
- throw error;
48
+ console.error(error);
49
+ return null;
59
50
  }
60
51
  }
61
52
 
@@ -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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sitepaige-mcp-server",
3
- "version": "0.7.11",
3
+ "version": "0.7.13",
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": [