@base44-preview/cli 0.0.32-pr.249.da1c23d → 0.0.32-pr.249.f254b7b
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 +62 -69
- package/dist/cli/index.js.map +8 -8
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -186024,7 +186024,7 @@ async function handleUnauthorized(request, _options, response) {
|
|
|
186024
186024
|
return;
|
|
186025
186025
|
}
|
|
186026
186026
|
retriedRequests.add(request);
|
|
186027
|
-
return distribution_default(request, {
|
|
186027
|
+
return distribution_default(request.clone(), {
|
|
186028
186028
|
headers: { Authorization: `Bearer ${newAccessToken}` }
|
|
186029
186029
|
});
|
|
186030
186030
|
}
|
|
@@ -195206,62 +195206,10 @@ function getTypesCommand(context) {
|
|
|
195206
195206
|
return new Command("types").description("Manage TypeScript type generation").addCommand(getTypesGenerateCommand(context));
|
|
195207
195207
|
}
|
|
195208
195208
|
|
|
195209
|
-
// src/cli/dev/createDevLogger.ts
|
|
195210
|
-
var dateTimeFormat = new Intl.DateTimeFormat([], {
|
|
195211
|
-
hour: "2-digit",
|
|
195212
|
-
minute: "2-digit",
|
|
195213
|
-
second: "2-digit",
|
|
195214
|
-
hour12: false
|
|
195215
|
-
});
|
|
195216
|
-
var colorByType = {
|
|
195217
|
-
error: source_default.red,
|
|
195218
|
-
warn: source_default.yellow,
|
|
195219
|
-
log: (text) => text
|
|
195220
|
-
};
|
|
195221
|
-
function createDevLogger(isPrefixed = true) {
|
|
195222
|
-
const print = (type, msg) => {
|
|
195223
|
-
const colorize = colorByType[type];
|
|
195224
|
-
switch (type) {
|
|
195225
|
-
case "error":
|
|
195226
|
-
console.error(colorize(msg));
|
|
195227
|
-
break;
|
|
195228
|
-
case "warn":
|
|
195229
|
-
console.warn(colorize(msg));
|
|
195230
|
-
break;
|
|
195231
|
-
default:
|
|
195232
|
-
console.log(msg);
|
|
195233
|
-
}
|
|
195234
|
-
};
|
|
195235
|
-
const prefixedLog = (type, msg) => {
|
|
195236
|
-
const timestamp = dateTimeFormat.format(new Date);
|
|
195237
|
-
const colorize = colorByType[type];
|
|
195238
|
-
console.log(`${source_default.gray(timestamp)} ${colorize(msg)}`);
|
|
195239
|
-
};
|
|
195240
|
-
return isPrefixed ? {
|
|
195241
|
-
log: (msg) => prefixedLog("log", msg),
|
|
195242
|
-
error: (msg, err) => {
|
|
195243
|
-
prefixedLog("error", msg);
|
|
195244
|
-
if (err) {
|
|
195245
|
-
prefixedLog("error", String(err));
|
|
195246
|
-
}
|
|
195247
|
-
},
|
|
195248
|
-
warn: (msg) => prefixedLog("warn", msg)
|
|
195249
|
-
} : {
|
|
195250
|
-
log: (msg) => print("log", msg),
|
|
195251
|
-
error: (msg, err) => {
|
|
195252
|
-
print("error", msg);
|
|
195253
|
-
if (err) {
|
|
195254
|
-
print("error", String(err));
|
|
195255
|
-
}
|
|
195256
|
-
},
|
|
195257
|
-
warn: (msg) => print("warn", msg)
|
|
195258
|
-
};
|
|
195259
|
-
}
|
|
195260
|
-
|
|
195261
195209
|
// src/cli/dev/dev-server/main.ts
|
|
195210
|
+
import { dirname as dirname12, join as join16 } from "node:path";
|
|
195262
195211
|
var import_cors = __toESM(require_lib4(), 1);
|
|
195263
195212
|
var import_express2 = __toESM(require_express(), 1);
|
|
195264
|
-
import { dirname as dirname12, join as join16 } from "node:path";
|
|
195265
195213
|
|
|
195266
195214
|
// node_modules/get-port/index.js
|
|
195267
195215
|
import net from "node:net";
|
|
@@ -195380,6 +195328,58 @@ async function getPorts(options8) {
|
|
|
195380
195328
|
// src/cli/dev/dev-server/main.ts
|
|
195381
195329
|
var import_http_proxy_middleware = __toESM(require_dist2(), 1);
|
|
195382
195330
|
|
|
195331
|
+
// src/cli/dev/createDevLogger.ts
|
|
195332
|
+
var dateTimeFormat = new Intl.DateTimeFormat([], {
|
|
195333
|
+
hour: "2-digit",
|
|
195334
|
+
minute: "2-digit",
|
|
195335
|
+
second: "2-digit",
|
|
195336
|
+
hour12: false
|
|
195337
|
+
});
|
|
195338
|
+
var colorByType = {
|
|
195339
|
+
error: source_default.red,
|
|
195340
|
+
warn: source_default.yellow,
|
|
195341
|
+
log: (text) => text
|
|
195342
|
+
};
|
|
195343
|
+
function createDevLogger(isPrefixed = true) {
|
|
195344
|
+
const print = (type, msg) => {
|
|
195345
|
+
const colorize = colorByType[type];
|
|
195346
|
+
switch (type) {
|
|
195347
|
+
case "error":
|
|
195348
|
+
console.error(colorize(msg));
|
|
195349
|
+
break;
|
|
195350
|
+
case "warn":
|
|
195351
|
+
console.warn(colorize(msg));
|
|
195352
|
+
break;
|
|
195353
|
+
default:
|
|
195354
|
+
console.log(msg);
|
|
195355
|
+
}
|
|
195356
|
+
};
|
|
195357
|
+
const prefixedLog = (type, msg) => {
|
|
195358
|
+
const timestamp = dateTimeFormat.format(new Date);
|
|
195359
|
+
const colorize = colorByType[type];
|
|
195360
|
+
console.log(`${source_default.gray(timestamp)} ${colorize(msg)}`);
|
|
195361
|
+
};
|
|
195362
|
+
return isPrefixed ? {
|
|
195363
|
+
log: (msg) => prefixedLog("log", msg),
|
|
195364
|
+
error: (msg, err) => {
|
|
195365
|
+
prefixedLog("error", msg);
|
|
195366
|
+
if (err) {
|
|
195367
|
+
prefixedLog("error", String(err));
|
|
195368
|
+
}
|
|
195369
|
+
},
|
|
195370
|
+
warn: (msg) => prefixedLog("warn", msg)
|
|
195371
|
+
} : {
|
|
195372
|
+
log: (msg) => print("log", msg),
|
|
195373
|
+
error: (msg, err) => {
|
|
195374
|
+
print("error", msg);
|
|
195375
|
+
if (err) {
|
|
195376
|
+
print("error", String(err));
|
|
195377
|
+
}
|
|
195378
|
+
},
|
|
195379
|
+
warn: (msg) => print("warn", msg)
|
|
195380
|
+
};
|
|
195381
|
+
}
|
|
195382
|
+
|
|
195383
195383
|
// src/cli/dev/dev-server/function-manager.ts
|
|
195384
195384
|
import { spawn as spawn2 } from "node:child_process";
|
|
195385
195385
|
import { dirname as dirname11, join as join15 } from "node:path";
|
|
@@ -195574,13 +195574,7 @@ function proxyRequest(req, res, port, logger) {
|
|
|
195574
195574
|
}
|
|
195575
195575
|
resolve5();
|
|
195576
195576
|
});
|
|
195577
|
-
|
|
195578
|
-
const bodyString = JSON.stringify(req.body);
|
|
195579
|
-
proxyReq.setHeader("Content-Type", "application/json");
|
|
195580
|
-
proxyReq.setHeader("Content-Length", Buffer.byteLength(bodyString));
|
|
195581
|
-
proxyReq.write(bodyString);
|
|
195582
|
-
}
|
|
195583
|
-
proxyReq.end();
|
|
195577
|
+
req.pipe(proxyReq);
|
|
195584
195578
|
});
|
|
195585
195579
|
}
|
|
195586
195580
|
|
|
@@ -195588,7 +195582,7 @@ function proxyRequest(req, res, port, logger) {
|
|
|
195588
195582
|
var DEFAULT_PORT = 4400;
|
|
195589
195583
|
var BASE44_APP_URL = "https://base44.app";
|
|
195590
195584
|
async function createDevServer(options8) {
|
|
195591
|
-
const {
|
|
195585
|
+
const { port: userPort } = options8;
|
|
195592
195586
|
const port = userPort ?? await getPorts({ port: DEFAULT_PORT });
|
|
195593
195587
|
const { project: project2 } = await readProjectConfig();
|
|
195594
195588
|
const configDir = dirname12(project2.configPath);
|
|
@@ -195612,14 +195606,14 @@ async function createDevServer(options8) {
|
|
|
195612
195606
|
const [functions] = await Promise.all([
|
|
195613
195607
|
functionResource.readAll(join16(configDir, project2.functionsDir))
|
|
195614
195608
|
]);
|
|
195615
|
-
const
|
|
195616
|
-
|
|
195617
|
-
|
|
195609
|
+
const devLogger = createDevLogger(false);
|
|
195610
|
+
const functionManager = new FunctionManager(functions, devLogger);
|
|
195611
|
+
M2.info(`Loaded functions: ${functions.map((f7) => f7.name).join(", ") || "(none)"}`);
|
|
195612
|
+
const functionRoutes = createFunctionRoutes(functionManager, devLogger);
|
|
195618
195613
|
app.use("/api/apps/:appId/functions", functionRoutes);
|
|
195619
195614
|
app.use((req, res, next) => {
|
|
195620
195615
|
return remoteProxy(req, res, next);
|
|
195621
195616
|
});
|
|
195622
|
-
app.use(import_express2.default.json());
|
|
195623
195617
|
return new Promise((resolve5, reject) => {
|
|
195624
195618
|
const server = app.listen(port, "127.0.0.1", (err) => {
|
|
195625
195619
|
if (err) {
|
|
@@ -195642,8 +195636,7 @@ async function createDevServer(options8) {
|
|
|
195642
195636
|
async function devAction(options8) {
|
|
195643
195637
|
const port = options8.port ? Number(options8.port) : undefined;
|
|
195644
195638
|
const { port: resolvedPort } = await createDevServer({
|
|
195645
|
-
port
|
|
195646
|
-
logger: createDevLogger()
|
|
195639
|
+
port
|
|
195647
195640
|
});
|
|
195648
195641
|
return {
|
|
195649
195642
|
outroMessage: `Dev server is available at ${theme.colors.links(`http://localhost:${resolvedPort}`)}`
|
|
@@ -200034,4 +200027,4 @@ export {
|
|
|
200034
200027
|
CLIExitError
|
|
200035
200028
|
};
|
|
200036
200029
|
|
|
200037
|
-
//# debugId=
|
|
200030
|
+
//# debugId=63AA06F29016555964756E2164756E21
|