@base44-preview/cli 0.0.55-pr.545.7bded43 → 0.0.55-pr.545.cb11f3a
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 +19 -31
- package/dist/cli/index.js.map +5 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -234017,7 +234017,7 @@ function normalizeBase44Env() {
|
|
|
234017
234017
|
loadProjectEnvFiles();
|
|
234018
234018
|
|
|
234019
234019
|
// src/cli/index.ts
|
|
234020
|
-
import { dirname as dirname23, join as
|
|
234020
|
+
import { dirname as dirname23, join as join28 } from "node:path";
|
|
234021
234021
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
234022
234022
|
|
|
234023
234023
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -253896,9 +253896,6 @@ function getTypesCommand() {
|
|
|
253896
253896
|
return new Command("types").description("Manage TypeScript type generation").addCommand(getTypesGenerateCommand());
|
|
253897
253897
|
}
|
|
253898
253898
|
|
|
253899
|
-
// src/cli/commands/dev.ts
|
|
253900
|
-
import { join as join28 } from "node:path";
|
|
253901
|
-
|
|
253902
253899
|
// src/cli/dev/dev-server/main.ts
|
|
253903
253900
|
var import_cors = __toESM(require_lib4(), 1);
|
|
253904
253901
|
var import_express6 = __toESM(require_express(), 1);
|
|
@@ -257333,10 +257330,10 @@ async function createDevServer(options8) {
|
|
|
257333
257330
|
});
|
|
257334
257331
|
await base44ConfigWatcher.start();
|
|
257335
257332
|
let serveRunner;
|
|
257336
|
-
if (options8.serve
|
|
257333
|
+
if (options8.serve) {
|
|
257337
257334
|
serveRunner = new ServeRunner({
|
|
257338
|
-
command:
|
|
257339
|
-
cwd:
|
|
257335
|
+
command: options8.serve.command,
|
|
257336
|
+
cwd: options8.serve.cwd,
|
|
257340
257337
|
env: {
|
|
257341
257338
|
VITE_BASE44_APP_ID: options8.serve.appId,
|
|
257342
257339
|
VITE_BASE44_APP_BASE_URL: baseUrl
|
|
@@ -257356,7 +257353,10 @@ async function createDevServer(options8) {
|
|
|
257356
257353
|
serveRunner?.onExit(() => {
|
|
257357
257354
|
shutdown().finally(() => process.exit(1));
|
|
257358
257355
|
});
|
|
257359
|
-
serveRunner
|
|
257356
|
+
if (serveRunner) {
|
|
257357
|
+
devLogger.log(`Backend running on ${baseUrl}`);
|
|
257358
|
+
serveRunner.start();
|
|
257359
|
+
}
|
|
257360
257360
|
return { port, server };
|
|
257361
257361
|
}
|
|
257362
257362
|
|
|
@@ -257364,38 +257364,26 @@ async function createDevServer(options8) {
|
|
|
257364
257364
|
function localServerUrl(port) {
|
|
257365
257365
|
return `http://localhost:${port}`;
|
|
257366
257366
|
}
|
|
257367
|
-
async function writeEnvLocal(projectRoot, port, appId, log) {
|
|
257368
|
-
const envLocalPath = join28(projectRoot, ".env.local");
|
|
257369
|
-
await writeFile(envLocalPath, `VITE_BASE44_APP_ID=${appId}
|
|
257370
|
-
VITE_BASE44_APP_BASE_URL=${localServerUrl(port)}
|
|
257371
|
-
`);
|
|
257372
|
-
log.info("Wrote .env.local with app ID and dev server URL");
|
|
257373
|
-
}
|
|
257374
257367
|
async function devAction({ log }, options8) {
|
|
257375
257368
|
const port = options8.port ? Number(options8.port) : undefined;
|
|
257376
|
-
const
|
|
257377
|
-
|
|
257378
|
-
const appId =
|
|
257369
|
+
const { project: project2 } = await readProjectConfig();
|
|
257370
|
+
const serveCommand = project2.site?.serveCommand;
|
|
257371
|
+
const appId = serveCommand ? (await initAppContext()).id : undefined;
|
|
257379
257372
|
const { port: resolvedPort } = await createDevServer({
|
|
257380
257373
|
log,
|
|
257381
257374
|
port,
|
|
257382
257375
|
denoWrapperPath: getDenoWrapperPath(),
|
|
257383
|
-
serve:
|
|
257376
|
+
serve: serveCommand && appId ? { command: serveCommand, cwd: project2.root, appId } : undefined,
|
|
257384
257377
|
loadResources: async () => {
|
|
257385
|
-
const { functions, entities, project:
|
|
257386
|
-
|
|
257387
|
-
return { functions, entities, project: project2 };
|
|
257378
|
+
const { functions, entities, project: project3 } = await readProjectConfig();
|
|
257379
|
+
return { functions, entities, project: project3 };
|
|
257388
257380
|
}
|
|
257389
257381
|
});
|
|
257390
|
-
|
|
257391
|
-
|
|
257392
|
-
}
|
|
257393
|
-
return {
|
|
257394
|
-
outroMessage: `Dev server is available at ${theme.colors.links(localServerUrl(resolvedPort))}`
|
|
257395
|
-
};
|
|
257382
|
+
const outroMessage = serveCommand ? "Open your app at the URL printed by the frontend dev server (tagged [frontend] above)." : `Dev server is available at ${theme.colors.links(localServerUrl(resolvedPort))}`;
|
|
257383
|
+
return { outroMessage };
|
|
257396
257384
|
}
|
|
257397
257385
|
function getDevCommand() {
|
|
257398
|
-
return new Base44Command("dev").description("Start the development server").option("-p, --port <number>", "Port for the development server").
|
|
257386
|
+
return new Base44Command("dev").description("Start the development server").option("-p, --port <number>", "Port for the development server").action(devAction);
|
|
257399
257387
|
}
|
|
257400
257388
|
|
|
257401
257389
|
// src/core/exec/run-script.ts
|
|
@@ -261824,7 +261812,7 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
261824
261812
|
// src/cli/index.ts
|
|
261825
261813
|
var __dirname4 = dirname23(fileURLToPath6(import.meta.url));
|
|
261826
261814
|
async function runCLI(options8) {
|
|
261827
|
-
ensureNpmAssets(
|
|
261815
|
+
ensureNpmAssets(join28(__dirname4, "../assets"));
|
|
261828
261816
|
const errorReporter = new ErrorReporter;
|
|
261829
261817
|
errorReporter.registerProcessErrorHandlers();
|
|
261830
261818
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
@@ -261861,4 +261849,4 @@ export {
|
|
|
261861
261849
|
CLIExitError
|
|
261862
261850
|
};
|
|
261863
261851
|
|
|
261864
|
-
//# debugId=
|
|
261852
|
+
//# debugId=C52B3632157F5F1264756E2164756E21
|