@kya-os/mcp-i 1.5.9-canary.12 ā 1.5.9-canary.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.
package/README.md
CHANGED
package/dist/compiler/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { type Middleware } from "../types/middleware";
|
|
|
2
2
|
export type CompilerMode = "development" | "production";
|
|
3
3
|
export interface CompileOptions {
|
|
4
4
|
onBuild?: () => void;
|
|
5
|
+
platform?: 'vercel';
|
|
5
6
|
}
|
|
6
|
-
export declare function compile({ onBuild }?: CompileOptions): Promise<void>;
|
|
7
|
+
export declare function compile({ onBuild, platform }?: CompileOptions): Promise<void>;
|
package/dist/compiler/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const start_http_server_1 = require("./start-http-server");
|
|
|
40
40
|
const path_validation_1 = require("../utils/path-validation");
|
|
41
41
|
const utils_1 = require("./config/utils");
|
|
42
42
|
dotenv_1.default.config();
|
|
43
|
-
async function compile({ onBuild } = {}) {
|
|
43
|
+
async function compile({ onBuild, platform } = {}) {
|
|
44
44
|
// Initialize compiler context if not already set
|
|
45
45
|
const mode = process.env.NODE_ENV === "production" ? "production" : "development";
|
|
46
46
|
// Use compiler context provider to set up the context properly
|
|
@@ -50,11 +50,11 @@ async function compile({ onBuild } = {}) {
|
|
|
50
50
|
projectRoot: process.cwd(),
|
|
51
51
|
platforms: {},
|
|
52
52
|
}, () => {
|
|
53
|
-
compileInternal({ onBuild }).then(resolve).catch(reject);
|
|
53
|
+
compileInternal({ onBuild, platform }).then(resolve).catch(reject);
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
async function compileInternal({ onBuild } = {}) {
|
|
57
|
+
async function compileInternal({ onBuild, platform } = {}) {
|
|
58
58
|
const { mode } = compiler_context_1.compilerContext.getContext();
|
|
59
59
|
const { toolPaths } = compiler_context_1.compilerContext.getContext();
|
|
60
60
|
const startTime = Date.now();
|
|
@@ -145,14 +145,33 @@ async function compileInternal({ onBuild } = {}) {
|
|
|
145
145
|
onBuild?.();
|
|
146
146
|
// In production mode, close watcher and compiler, then resolve
|
|
147
147
|
if (mode === "production") {
|
|
148
|
-
watcher.close().then(() => {
|
|
148
|
+
watcher.close().then(async () => {
|
|
149
149
|
// Close webpack compiler to release all resources
|
|
150
|
-
compiler.close((compilerCloseErr) => {
|
|
150
|
+
compiler.close(async (compilerCloseErr) => {
|
|
151
151
|
if (compilerCloseErr) {
|
|
152
152
|
console.error('Error closing webpack compiler:', compilerCloseErr);
|
|
153
153
|
reject(compilerCloseErr);
|
|
154
154
|
}
|
|
155
155
|
else {
|
|
156
|
+
// Platform-specific post-build steps
|
|
157
|
+
if (platform === 'vercel') {
|
|
158
|
+
try {
|
|
159
|
+
console.log('\nš¦ Building Vercel deployment package...');
|
|
160
|
+
// Dynamic import of Vercel build utilities
|
|
161
|
+
// This will be available when @kya-os/mcp-i-vercel is installed
|
|
162
|
+
const vercelModule = await import('@kya-os/mcp-i-vercel/build').catch((importErr) => {
|
|
163
|
+
throw new Error(`Cannot find @kya-os/mcp-i-vercel package. ` +
|
|
164
|
+
`Install it with: npm install @kya-os/mcp-i-vercel\n` +
|
|
165
|
+
`Original error: ${importErr instanceof Error ? importErr.message : String(importErr)}`);
|
|
166
|
+
});
|
|
167
|
+
await vercelModule.buildVercelOutput();
|
|
168
|
+
}
|
|
169
|
+
catch (vercelBuildErr) {
|
|
170
|
+
console.error('Error building Vercel output:', vercelBuildErr);
|
|
171
|
+
reject(vercelBuildErr);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
156
175
|
resolve();
|
|
157
176
|
}
|
|
158
177
|
});
|