@base44-preview/cli 0.1.23-pr.645.fe2ea5c → 0.1.25-pr.647.62db7ea

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.
@@ -42,9 +42,8 @@ if (!appBaseUrl) {
42
42
  Deno.exit(1);
43
43
  }
44
44
 
45
- // Exact version: an unversioned specifier makes Deno resolve "latest" from npm on
46
- // every fresh cache, so a pre-cached SDK is never used.
47
- import { createClient } from "npm:@base44/sdk@0.8.52";
45
+ // runScript pins this to BASE44_EXEC_SDK_VERSION when set; otherwise Deno resolves latest.
46
+ import { createClient } from "npm:@base44/sdk";
48
47
 
49
48
  const customHeaders: Record<string, string> = {};
50
49
  if (isPrivileged) customHeaders["X-Bypass-RLS"] = "true";
package/dist/cli/index.js CHANGED
@@ -228810,7 +228810,7 @@ function normalizeBase44Env() {
228810
228810
  loadProjectEnvFiles();
228811
228811
 
228812
228812
  // src/cli/index.ts
228813
- import { dirname as dirname29, join as join39 } from "node:path";
228813
+ import { dirname as dirname29, join as join40 } from "node:path";
228814
228814
  import { fileURLToPath as fileURLToPath6 } from "node:url";
228815
228815
 
228816
228816
  // ../../node_modules/@clack/core/dist/index.mjs
@@ -238341,7 +238341,7 @@ var FieldRLSSchema = looseObject({
238341
238341
  delete: RLSRuleSchema.optional()
238342
238342
  });
238343
238343
  var PropertyDefinitionSchema = looseObject({
238344
- type: union([string2(), array(string2())]),
238344
+ type: union([string2(), array(string2())]).optional(),
238345
238345
  title: string2().optional(),
238346
238346
  description: string2().optional(),
238347
238347
  minLength: number2().int().min(0).optional(),
@@ -238363,12 +238363,13 @@ var PropertyDefinitionSchema = looseObject({
238363
238363
  return record(string2(), PropertyDefinitionSchema).optional();
238364
238364
  }
238365
238365
  });
238366
+ var TopLevelPropertySchema = PropertyDefinitionSchema.refine((property) => property.type !== undefined, { message: "Top-level properties must declare a type", path: ["type"] });
238366
238367
  var EntitySchema = looseObject({
238367
238368
  type: literal("object").default("object"),
238368
238369
  name: string2().min(1).regex(/^\w+$/, "Entity name must contain only letters, numbers, and underscores"),
238369
238370
  title: string2().optional(),
238370
238371
  description: string2().optional(),
238371
- properties: record(string2(), PropertyDefinitionSchema).default({}),
238372
+ properties: record(string2(), TopLevelPropertySchema).default({}),
238372
238373
  required: array(string2()).optional(),
238373
238374
  rls: EntityRLSSchema.optional(),
238374
238375
  source: ResourceSourceSchema.default({ type: "project" })
@@ -239265,7 +239266,7 @@ import { join as join13 } from "node:path";
239265
239266
  // package.json
239266
239267
  var package_default = {
239267
239268
  name: "base44",
239268
- version: "0.1.23",
239269
+ version: "0.1.25",
239269
239270
  description: "Base44 CLI - Unified interface for managing Base44 applications",
239270
239271
  type: "module",
239271
239272
  bin: {
@@ -251668,7 +251669,7 @@ async function siteDevAction(ctx, forwarded) {
251668
251669
  if (!app?.projectRoot) {
251669
251670
  throw new ConfigInvalidError("base44 site dev requires a linked local project. Run it from a project with base44/.app.jsonc.");
251670
251671
  }
251671
- const { project } = await readProjectConfig(app.projectRoot);
251672
+ const project = await readProjectSettings(app.projectRoot);
251672
251673
  const site = project.site;
251673
251674
  if (!site) {
251674
251675
  throw new InvalidInputError(`This project has no 'site' block in base44/config.jsonc, so there is no frontend to serve. Add one naming its serveCommand; site dev falls back to "npm run dev".`);
@@ -251693,7 +251694,7 @@ function getSiteDevCommand() {
251693
251694
  async function installAction({
251694
251695
  runTask
251695
251696
  }) {
251696
- const { project } = await readProjectConfig();
251697
+ const project = await readProjectSettings();
251697
251698
  const installCommand = project.site?.installCommand;
251698
251699
  if (!installCommand) {
251699
251700
  throw new ConfigNotFoundError("No site install command found.", {
@@ -253182,7 +253183,7 @@ class Validator {
253182
253183
  error: this.createValidationError(`Error in field ${fieldPath}: Input should be a valid ${types.join(" or ")}`)
253183
253184
  };
253184
253185
  }
253185
- const propertyType = property.type;
253186
+ const propertyType = property.type ?? "string";
253186
253187
  if (!fieldTypes.includes(propertyType)) {
253187
253188
  return {
253188
253189
  hasError: true,
@@ -256177,6 +256178,15 @@ var DATA_ENV_ENV_VAR = "BASE44_DATA_ENV";
256177
256178
  function read3(env, name) {
256178
256179
  return env[name]?.trim() || undefined;
256179
256180
  }
256181
+ var SDK_VERSION_VAR = "BASE44_EXEC_SDK_VERSION";
256182
+ var SDK_VERSION_RE = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
256183
+ function readExecSdkVersion(env = process.env) {
256184
+ const version = read3(env, SDK_VERSION_VAR);
256185
+ if (version && !SDK_VERSION_RE.test(version)) {
256186
+ throw new InvalidInputError(`${SDK_VERSION_VAR} must be an exact version such as 0.8.52.`);
256187
+ }
256188
+ return version;
256189
+ }
256180
256190
  function hasExecEnvTarget(env = process.env) {
256181
256191
  return EXEC_ENV_VARS.some((name) => read3(env, name) !== undefined);
256182
256192
  }
@@ -256204,7 +256214,13 @@ function readExecEnvTarget(env = process.env) {
256204
256214
  }
256205
256215
  // src/core/exec/run-script.ts
256206
256216
  import { spawn as spawn4 } from "node:child_process";
256207
- import { copyFileSync, writeFileSync as writeFileSync3 } from "node:fs";
256217
+ import { readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "node:fs";
256218
+ import { join as join39 } from "node:path";
256219
+ var SDK_SPECIFIER = '"npm:@base44/sdk"';
256220
+ function wrapperSource(sdkVersion) {
256221
+ const source = readFileSync3(getExecWrapperPath(), "utf-8");
256222
+ return sdkVersion ? source.replace(SDK_SPECIFIER, `"npm:@base44/sdk@${sdkVersion}"`) : source;
256223
+ }
256208
256224
  var DENO_CONFIG = {
256209
256225
  minimumDependencyAge: { exclude: ["npm:@base44/sdk"] }
256210
256226
  };
@@ -256222,7 +256238,7 @@ function inheritedEnv() {
256222
256238
  return env;
256223
256239
  }
256224
256240
  async function runScript(options) {
256225
- const { appId, code, local, privileged, dataEnv, serviceToken } = options;
256241
+ const { appId, code, local, privileged, dataEnv, serviceToken, sdkVersion } = options;
256226
256242
  verifyDenoInstalled("to run scripts with exec");
256227
256243
  const cleanupFns = [];
256228
256244
  const tempScript = await $file({ postfix: ".ts" });
@@ -256232,10 +256248,11 @@ async function runScript(options) {
256232
256248
  const [appUserToken, appBaseUrl] = local ? [local.token, local.serverUrl] : await Promise.all([getAppUserToken(), getSiteUrl()]);
256233
256249
  const tempWrapper = await $file({ postfix: ".ts" });
256234
256250
  cleanupFns.push(tempWrapper.cleanup);
256235
- copyFileSync(getExecWrapperPath(), tempWrapper.path);
256236
- const tempConfig = await $file({ postfix: ".json" });
256237
- cleanupFns.push(tempConfig.cleanup);
256238
- writeFileSync3(tempConfig.path, JSON.stringify(DENO_CONFIG), "utf-8");
256251
+ writeFileSync3(tempWrapper.path, wrapperSource(sdkVersion), "utf-8");
256252
+ const configDir = await $dir({ unsafeCleanup: true });
256253
+ cleanupFns.push(configDir.cleanup);
256254
+ const configPath = join39(configDir.path, "deno.json");
256255
+ writeFileSync3(configPath, JSON.stringify(DENO_CONFIG), "utf-8");
256239
256256
  try {
256240
256257
  const exitCode = await new Promise((resolvePromise) => {
256241
256258
  const child = spawn4("deno", [
@@ -256243,7 +256260,7 @@ async function runScript(options) {
256243
256260
  "--allow-all",
256244
256261
  "--node-modules-dir=none",
256245
256262
  "--config",
256246
- tempConfig.path,
256263
+ configPath,
256247
256264
  tempWrapper.path
256248
256265
  ], {
256249
256266
  env: {
@@ -256304,6 +256321,7 @@ async function execAction({ app, isNonInteractive }, options) {
256304
256321
  });
256305
256322
  }
256306
256323
  const envTarget = readExecEnvTarget();
256324
+ const sdkVersion = readExecSdkVersion();
256307
256325
  if (envTarget && options.local) {
256308
256326
  throw new InvalidInputError("--local cannot be used when BASE44_EXEC_ACCESS_TOKEN and BASE44_EXEC_SERVER_URL are set.");
256309
256327
  }
@@ -256329,7 +256347,8 @@ async function execAction({ app, isNonInteractive }, options) {
256329
256347
  local,
256330
256348
  privileged: options.privileged,
256331
256349
  dataEnv: options.dataEnv,
256332
- serviceToken: envTarget?.serviceToken
256350
+ serviceToken: envTarget?.serviceToken,
256351
+ sdkVersion
256333
256352
  });
256334
256353
  if (exitCode !== 0) {
256335
256354
  process.exitCode = exitCode;
@@ -260522,7 +260541,7 @@ function addCommandInfoToErrorReporter(program, errorReporter) {
260522
260541
  // src/cli/index.ts
260523
260542
  var __dirname4 = dirname29(fileURLToPath6(import.meta.url));
260524
260543
  async function runCLI(options) {
260525
- ensureNpmAssets(join39(__dirname4, "../assets"));
260544
+ ensureNpmAssets(join40(__dirname4, "../assets"));
260526
260545
  const errorReporter = new ErrorReporter;
260527
260546
  errorReporter.registerProcessErrorHandlers();
260528
260547
  const jsonMode = process.argv.includes("--json");
@@ -260561,4 +260580,4 @@ export {
260561
260580
  runCLI
260562
260581
  };
260563
260582
 
260564
- //# debugId=BB80D6E0BB39AF1564756E2164756E21
260583
+ //# debugId=618459366066EF9064756E2164756E21