@base44-preview/cli 0.0.32-pr.249.69186d6 → 0.0.32-pr.249.6b67311
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/dist/cli/index.js +14 -16
- package/dist/cli/index.js.map +6 -6
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -186681,7 +186681,9 @@ var theme = {
|
|
|
186681
186681
|
styles: {
|
|
186682
186682
|
header: source_default.dim,
|
|
186683
186683
|
bold: source_default.bold,
|
|
186684
|
-
dim: source_default.dim
|
|
186684
|
+
dim: source_default.dim,
|
|
186685
|
+
error: source_default.red,
|
|
186686
|
+
warn: source_default.yellow
|
|
186685
186687
|
},
|
|
186686
186688
|
format: {
|
|
186687
186689
|
errorContext(ctx) {
|
|
@@ -195354,8 +195356,8 @@ var dateTimeFormat = new Intl.DateTimeFormat([], {
|
|
|
195354
195356
|
hour12: false
|
|
195355
195357
|
});
|
|
195356
195358
|
var colorByType = {
|
|
195357
|
-
error:
|
|
195358
|
-
warn:
|
|
195359
|
+
error: theme.styles.error,
|
|
195360
|
+
warn: theme.styles.warn,
|
|
195359
195361
|
log: (text) => text
|
|
195360
195362
|
};
|
|
195361
195363
|
function createDevLogger(isPrefixed = true) {
|
|
@@ -195375,7 +195377,7 @@ function createDevLogger(isPrefixed = true) {
|
|
|
195375
195377
|
const prefixedLog = (type, msg) => {
|
|
195376
195378
|
const timestamp = dateTimeFormat.format(new Date);
|
|
195377
195379
|
const colorize = colorByType[type];
|
|
195378
|
-
console.log(`${
|
|
195380
|
+
console.log(`${theme.styles.dim(timestamp)} ${colorize(msg)}`);
|
|
195379
195381
|
};
|
|
195380
195382
|
return isPrefixed ? {
|
|
195381
195383
|
log: (msg) => prefixedLog("log", msg),
|
|
@@ -195399,7 +195401,7 @@ function createDevLogger(isPrefixed = true) {
|
|
|
195399
195401
|
}
|
|
195400
195402
|
|
|
195401
195403
|
// src/cli/dev/dev-server/function-manager.ts
|
|
195402
|
-
import { spawn as spawn2 } from "node:child_process";
|
|
195404
|
+
import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
195403
195405
|
import { dirname as dirname11, join as join15 } from "node:path";
|
|
195404
195406
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
195405
195407
|
var __dirname5 = dirname11(fileURLToPath7(import.meta.url));
|
|
@@ -195422,13 +195424,10 @@ class FunctionManager {
|
|
|
195422
195424
|
}
|
|
195423
195425
|
verifyDenoIsInstalled() {
|
|
195424
195426
|
if (this.functions.size > 0) {
|
|
195425
|
-
|
|
195426
|
-
|
|
195427
|
-
} catch {
|
|
195427
|
+
const result = spawnSync2("deno", ["--version"]);
|
|
195428
|
+
if (result.error) {
|
|
195428
195429
|
throw new DependencyNotFoundError("Deno is required to run functions", {
|
|
195429
|
-
hints: [
|
|
195430
|
-
{ message: "Install Deno from https://deno.com/download" }
|
|
195431
|
-
]
|
|
195430
|
+
hints: [{ message: "Install Deno from https://deno.com/download" }]
|
|
195432
195431
|
});
|
|
195433
195432
|
}
|
|
195434
195433
|
}
|
|
@@ -195645,9 +195644,7 @@ async function createDevServer(options8) {
|
|
|
195645
195644
|
}
|
|
195646
195645
|
next();
|
|
195647
195646
|
});
|
|
195648
|
-
const
|
|
195649
|
-
functionResource.readAll(join16(configDir, project2.functionsDir))
|
|
195650
|
-
]);
|
|
195647
|
+
const functions = await functionResource.readAll(join16(configDir, project2.functionsDir));
|
|
195651
195648
|
const devLogger = createDevLogger(false);
|
|
195652
195649
|
const functionManager = new FunctionManager(functions, devLogger);
|
|
195653
195650
|
functionManager.verifyDenoIsInstalled();
|
|
@@ -195667,12 +195664,13 @@ async function createDevServer(options8) {
|
|
|
195667
195664
|
} else {
|
|
195668
195665
|
reject(err);
|
|
195669
195666
|
}
|
|
195667
|
+
} else {
|
|
195670
195668
|
const shutdown = () => {
|
|
195671
195669
|
functionManager.stopAll();
|
|
195670
|
+
server.close();
|
|
195672
195671
|
};
|
|
195673
195672
|
process.on("SIGINT", shutdown);
|
|
195674
195673
|
process.on("SIGTERM", shutdown);
|
|
195675
|
-
} else {
|
|
195676
195674
|
resolve5({
|
|
195677
195675
|
port,
|
|
195678
195676
|
server
|
|
@@ -200077,4 +200075,4 @@ export {
|
|
|
200077
200075
|
CLIExitError
|
|
200078
200076
|
};
|
|
200079
200077
|
|
|
200080
|
-
//# debugId=
|
|
200078
|
+
//# debugId=C673BE16F37436A364756E2164756E21
|