@insforge/mcp 1.2.4-deployment.4 → 1.2.4-deployment.6
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.
|
@@ -7,7 +7,6 @@ import { promises as fs } from "fs";
|
|
|
7
7
|
import { exec } from "child_process";
|
|
8
8
|
import { promisify } from "util";
|
|
9
9
|
import { tmpdir } from "os";
|
|
10
|
-
import { createWriteStream } from "fs";
|
|
11
10
|
import archiver from "archiver";
|
|
12
11
|
|
|
13
12
|
// src/shared/response-handler.ts
|
|
@@ -2038,45 +2037,38 @@ To: Your current project directory
|
|
|
2038
2037
|
});
|
|
2039
2038
|
const createResult = await handleApiResponse(createResponse);
|
|
2040
2039
|
const { id: deploymentId, uploadUrl, uploadFields } = createResult;
|
|
2041
|
-
const
|
|
2042
|
-
await new Promise((resolve, reject) => {
|
|
2043
|
-
const output = createWriteStream(zipPath);
|
|
2040
|
+
const zipBuffer = await new Promise((resolve, reject) => {
|
|
2044
2041
|
const archive = archiver("zip", { zlib: { level: 9 } });
|
|
2042
|
+
const chunks = [];
|
|
2043
|
+
archive.on("data", (chunk) => chunks.push(chunk));
|
|
2044
|
+
archive.on("end", () => resolve(Buffer.concat(chunks)));
|
|
2045
2045
|
archive.on("error", (err) => reject(err));
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
archive.pipe(output);
|
|
2049
|
-
archive.glob("**/*", {
|
|
2050
|
-
cwd: sourceDirectory,
|
|
2051
|
-
ignore: [
|
|
2052
|
-
"node_modules/**",
|
|
2053
|
-
".git/**",
|
|
2054
|
-
".next/**",
|
|
2055
|
-
"dist/**",
|
|
2056
|
-
".env.local",
|
|
2057
|
-
".DS_Store"
|
|
2058
|
-
],
|
|
2059
|
-
dot: true
|
|
2060
|
-
// Include dotfiles like .env
|
|
2046
|
+
archive.on("warning", (err) => {
|
|
2047
|
+
console.warn("Archiver warning:", err.message);
|
|
2061
2048
|
});
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2049
|
+
const excludePatterns = [
|
|
2050
|
+
"node_modules",
|
|
2051
|
+
".git",
|
|
2052
|
+
".next",
|
|
2053
|
+
"dist",
|
|
2054
|
+
"build",
|
|
2055
|
+
".env.local",
|
|
2056
|
+
".DS_Store"
|
|
2057
|
+
];
|
|
2058
|
+
archive.directory(sourceDirectory, false, (entry) => {
|
|
2059
|
+
const normalizedName = entry.name.replace(/\\/g, "/");
|
|
2060
|
+
for (const pattern of excludePatterns) {
|
|
2061
|
+
if (normalizedName.startsWith(pattern + "/") || normalizedName === pattern || normalizedName.endsWith("/" + pattern) || normalizedName.includes("/" + pattern + "/")) {
|
|
2062
|
+
return false;
|
|
2074
2063
|
}
|
|
2075
|
-
throw err;
|
|
2076
2064
|
}
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2065
|
+
if (normalizedName.endsWith(".log")) {
|
|
2066
|
+
return false;
|
|
2067
|
+
}
|
|
2068
|
+
return entry;
|
|
2069
|
+
});
|
|
2070
|
+
archive.finalize();
|
|
2071
|
+
});
|
|
2080
2072
|
const uploadFormData = new FormData();
|
|
2081
2073
|
for (const [key, value] of Object.entries(uploadFields)) {
|
|
2082
2074
|
uploadFormData.append(key, value);
|
|
@@ -2094,8 +2086,6 @@ To: Your current project directory
|
|
|
2094
2086
|
const uploadError = await uploadResponse.text();
|
|
2095
2087
|
throw new Error(`Failed to upload zip file: ${uploadError}`);
|
|
2096
2088
|
}
|
|
2097
|
-
await fs.unlink(zipPath).catch(() => {
|
|
2098
|
-
});
|
|
2099
2089
|
const startBody = {};
|
|
2100
2090
|
if (projectSettings) startBody.projectSettings = projectSettings;
|
|
2101
2091
|
if (envVars) startBody.envVars = envVars;
|
package/dist/http-server.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED