@base44-preview/cli 0.0.51-pr.516.d918801 → 0.0.51-pr.517.51e5d60

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 CHANGED
@@ -218270,7 +218270,7 @@ var require_dist5 = __commonJS((exports, module) => {
218270
218270
  });
218271
218271
 
218272
218272
  // src/cli/index.ts
218273
- import { dirname as dirname20, join as join26 } from "node:path";
218273
+ import { dirname as dirname20, join as join27 } from "node:path";
218274
218274
  import { fileURLToPath as fileURLToPath6 } from "node:url";
218275
218275
 
218276
218276
  // ../../node_modules/@clack/core/dist/index.mjs
@@ -253458,6 +253458,7 @@ function getTypesCommand() {
253458
253458
 
253459
253459
  // src/cli/commands/dev.ts
253460
253460
  import process21 from "node:process";
253461
+ import { join as join26 } from "node:path";
253461
253462
 
253462
253463
  // src/cli/dev/dev-server/main.ts
253463
253464
  var import_cors = __toESM(require_lib4(), 1);
@@ -253804,7 +253805,9 @@ function createFunctionRouter(manager, logger2) {
253804
253805
  if (xAppId) {
253805
253806
  proxyReq.setHeader("Base44-App-Id", xAppId);
253806
253807
  }
253807
- proxyReq.setHeader("Base44-Service-Authorization", authorization ?? "Bearer base44-dev-service-token");
253808
+ if (authorization) {
253809
+ proxyReq.setHeader("Base44-Service-Authorization", authorization);
253810
+ }
253808
253811
  proxyReq.setHeader("Base44-Api-Url", `${req.protocol}://${req.headers.host}`);
253809
253812
  },
253810
253813
  error: (err, _req, res) => {
@@ -256801,6 +256804,7 @@ async function createDevServer(options8) {
256801
256804
  // src/cli/commands/dev.ts
256802
256805
  async function devAction({ log }, options8) {
256803
256806
  const port = options8.port ? Number(options8.port) : undefined;
256807
+ let projectRoot;
256804
256808
  const { port: resolvedPort } = await createDevServer({
256805
256809
  log,
256806
256810
  port,
@@ -256808,9 +256812,20 @@ async function devAction({ log }, options8) {
256808
256812
  denoWrapperPath: getDenoWrapperPath(),
256809
256813
  loadResources: async () => {
256810
256814
  const { functions, entities, project: project2 } = await readProjectConfig();
256815
+ projectRoot = project2.root;
256811
256816
  return { functions, entities, project: project2 };
256812
256817
  }
256813
256818
  });
256819
+ if (projectRoot) {
256820
+ const envLocalPath = join26(projectRoot, ".env.local");
256821
+ if (!await pathExists(envLocalPath)) {
256822
+ const { id: appId } = await initAppConfig();
256823
+ await writeFile(envLocalPath, `VITE_BASE44_APP_ID=${appId}
256824
+ VITE_BASE44_APP_BASE_URL=http://localhost:${resolvedPort}
256825
+ `);
256826
+ log.info("Created .env.local with app ID and dev server URL");
256827
+ }
256828
+ }
256814
256829
  return {
256815
256830
  outroMessage: `Dev server is available at ${theme.colors.links(`http://localhost:${resolvedPort}`)}`
256816
256831
  };
@@ -261244,7 +261259,7 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
261244
261259
  // src/cli/index.ts
261245
261260
  var __dirname4 = dirname20(fileURLToPath6(import.meta.url));
261246
261261
  async function runCLI(options8) {
261247
- ensureNpmAssets(join26(__dirname4, "../assets"));
261262
+ ensureNpmAssets(join27(__dirname4, "../assets"));
261248
261263
  const errorReporter = new ErrorReporter;
261249
261264
  errorReporter.registerProcessErrorHandlers();
261250
261265
  const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
@@ -261281,4 +261296,4 @@ export {
261281
261296
  CLIExitError
261282
261297
  };
261283
261298
 
261284
- //# debugId=1A2210510CD4F25D64756E2164756E21
261299
+ //# debugId=9B391BFD9F0AF05564756E2164756E21