@base44-preview/cli 0.1.15-pr.626.ebb916a → 0.1.15-pr.628.ddce31b

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
@@ -31177,7 +31177,7 @@ function cleanDoc(doc) {
31177
31177
  return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc));
31178
31178
  }
31179
31179
  function replaceEndOfLine(doc, replacement = literalline) {
31180
- return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join30(replacement, currentDoc.split(`
31180
+ return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join28(replacement, currentDoc.split(`
31181
31181
  `)) : currentDoc);
31182
31182
  }
31183
31183
  function canBreakFn(doc) {
@@ -31257,7 +31257,7 @@ function indentIfBreak(contents, options) {
31257
31257
  negate: options.negate
31258
31258
  };
31259
31259
  }
31260
- function join30(separator, docs) {
31260
+ function join28(separator, docs) {
31261
31261
  assertDoc(separator);
31262
31262
  assertDocArray(docs);
31263
31263
  const parts = [];
@@ -31968,7 +31968,7 @@ var init_doc = __esm(() => {
31968
31968
  MODE_FLAT = Symbol("MODE_FLAT");
31969
31969
  DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
31970
31970
  builders = {
31971
- join: join30,
31971
+ join: join28,
31972
31972
  line,
31973
31973
  softline,
31974
31974
  hardline,
@@ -228783,7 +228783,7 @@ function normalizeBase44Env() {
228783
228783
  loadProjectEnvFiles();
228784
228784
 
228785
228785
  // src/cli/index.ts
228786
- import { dirname as dirname29, join as join39 } from "node:path";
228786
+ import { dirname as dirname28, join as join37 } from "node:path";
228787
228787
  import { fileURLToPath as fileURLToPath6 } from "node:url";
228788
228788
 
228789
228789
  // ../../node_modules/@clack/core/dist/index.mjs
@@ -239998,10 +239998,7 @@ async function uploadPresignedAsset(upload, assets) {
239998
239998
  try {
239999
239999
  await distribution_default.put(upload.url, {
240000
240000
  body: new Uint8Array(content),
240001
- headers: {
240002
- "Content-Type": upload.contentType,
240003
- ...upload.checksumSha256 ? { "x-amz-checksum-sha256": upload.checksumSha256 } : {}
240004
- },
240001
+ headers: { "Content-Type": upload.contentType },
240005
240002
  timeout: 120000,
240006
240003
  retry: UPLOAD_RETRY
240007
240004
  });
@@ -246672,13 +246669,6 @@ async function resolveGitHash(projectRoot, explicit) {
246672
246669
  }
246673
246670
  return hash;
246674
246671
  }
246675
- async function resolveProvenanceCommit(projectRoot, explicit) {
246676
- if (explicit) {
246677
- return await resolveGitHash(projectRoot, explicit);
246678
- }
246679
- const hash = await gitHead(projectRoot);
246680
- return hash && isGitCommitHash(hash) ? hash : undefined;
246681
- }
246682
246672
  async function gitHead(projectRoot) {
246683
246673
  try {
246684
246674
  const { stdout } = await execa("git", ["rev-parse", "HEAD"], {
@@ -247214,136 +247204,6 @@ async function resolveBranchName(name) {
247214
247204
  return matches[0].id;
247215
247205
  }
247216
247206
 
247217
- // src/core/version/publish.ts
247218
- import { randomUUID as randomUUID4 } from "node:crypto";
247219
-
247220
- // src/core/version/schema.ts
247221
- var DeclareVersionResponseSchema = object({
247222
- session_id: string2(),
247223
- uploads: array(object({
247224
- path: string2(),
247225
- url: string2(),
247226
- content_type: string2(),
247227
- content_length: number2(),
247228
- checksum_sha256: string2()
247229
- }))
247230
- }).transform((data) => ({
247231
- sessionId: data.session_id,
247232
- uploads: data.uploads.map((upload) => ({
247233
- path: upload.path,
247234
- url: upload.url,
247235
- contentType: upload.content_type,
247236
- contentLength: upload.content_length,
247237
- checksumSha256: upload.checksum_sha256
247238
- }))
247239
- }));
247240
- var CreateVersionResponseSchema = object({
247241
- version_id: string2(),
247242
- manifest_hash: string2(),
247243
- deduplicated: boolean2()
247244
- }).transform((data) => ({
247245
- versionId: data.version_id,
247246
- manifestHash: data.manifest_hash,
247247
- deduplicated: data.deduplicated
247248
- }));
247249
- var DeployVersionResponseSchema = object({
247250
- deployment_id: string2(),
247251
- manifest_hash: string2(),
247252
- revision: number2()
247253
- }).transform((data) => ({
247254
- deploymentId: data.deployment_id,
247255
- manifestHash: data.manifest_hash,
247256
- revision: data.revision
247257
- }));
247258
-
247259
- // src/core/version/api.ts
247260
- var DEFAULT_VERSION_UPLOAD_CONCURRENCY = 8;
247261
- var MAX_VERSION_UPLOAD_CONCURRENCY = 16;
247262
- async function post(path, json, doing) {
247263
- try {
247264
- return await getAppClient().post(path, { json, timeout: 180000 });
247265
- } catch (error) {
247266
- throw await ApiError.fromHttpError(error, doing);
247267
- }
247268
- }
247269
- function parse10(schema, body, what) {
247270
- const result = schema.safeParse(body);
247271
- if (!result.success) {
247272
- throw new SchemaValidationError(`Invalid ${what} response from server`, result.error);
247273
- }
247274
- return result.data;
247275
- }
247276
- async function createVersion(artifacts, options = {}) {
247277
- const declared = parse10(DeclareVersionResponseSchema, await (await post("versions", {
247278
- static_bundle: artifacts.files.map(({ path, size, digest }) => ({
247279
- path,
247280
- size,
247281
- digest
247282
- })),
247283
- entities: artifacts.entities,
247284
- agents: artifacts.agents,
247285
- source_commit: options.sourceCommit,
247286
- frontend_commit: options.sourceCommit
247287
- }, "declaring a version")).json(), "declare");
247288
- options.progress?.onDeclared?.({
247289
- fileCount: artifacts.files.length,
247290
- owedFiles: declared.uploads.length
247291
- });
247292
- await uploadPresignedAssets(declared.uploads, {
247293
- manifest: Object.fromEntries(artifacts.files.map((file) => [
247294
- file.path,
247295
- { hash: file.digest, size: file.size }
247296
- ])),
247297
- filesByHash: new Map(artifacts.files.map((file) => [
247298
- file.digest,
247299
- {
247300
- absolutePath: file.absolutePath,
247301
- hash: file.digest,
247302
- size: file.size,
247303
- contentType: "application/octet-stream"
247304
- }
247305
- ]))
247306
- }, {
247307
- concurrency: options.concurrency ?? DEFAULT_VERSION_UPLOAD_CONCURRENCY,
247308
- onProgress: options.progress?.onUpload
247309
- });
247310
- return parse10(CreateVersionResponseSchema, await (await post(`versions/${encodeURIComponent(declared.sessionId)}/finalize`, {}, "creating a version")).json(), "create version");
247311
- }
247312
- async function deployVersion(versionId, options = {}) {
247313
- return parse10(DeployVersionResponseSchema, await (await post(`versions/${encodeURIComponent(versionId)}/deployments`, {
247314
- ...options.target ? { target: options.target } : {},
247315
- ...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
247316
- }, "deploying a version")).json(), "deploy");
247317
- }
247318
-
247319
- // src/core/version/publish.ts
247320
- var STEP = Symbol.for("base44.publishStep");
247321
- async function tagStep(step, run) {
247322
- try {
247323
- return await run();
247324
- } catch (error) {
247325
- if (error !== null && typeof error === "object" && !(STEP in error)) {
247326
- Object.defineProperty(error, STEP, { value: step, enumerable: false });
247327
- }
247328
- throw error;
247329
- }
247330
- }
247331
- function stepOf(error) {
247332
- return error !== null && typeof error === "object" && STEP in error ? error[STEP] : undefined;
247333
- }
247334
- async function publishVersion(artifacts, options = {}) {
247335
- const version = await tagStep("create_version", () => createVersion(artifacts, {
247336
- sourceCommit: options.sourceCommit,
247337
- concurrency: options.concurrency,
247338
- progress: options.progress
247339
- }));
247340
- const deployment = await tagStep("deploy", () => deployVersion(version.versionId, {
247341
- target: options.target,
247342
- idempotencyKey: randomUUID4()
247343
- }));
247344
- return { ...version, ...deployment };
247345
- }
247346
-
247347
247207
  // src/cli/utils/command/Base44Command.ts
247348
247208
  function writeJsonSuccess(result) {
247349
247209
  if (result.stdout) {
@@ -247361,10 +247221,6 @@ function writeJsonError(error) {
247361
247221
  const envelope = {
247362
247222
  error: error instanceof Error ? error.message : String(error)
247363
247223
  };
247364
- const step = stepOf(error);
247365
- if (step !== undefined) {
247366
- envelope.step = step;
247367
- }
247368
247224
  if (isCLIError(error)) {
247369
247225
  envelope.code = error.code;
247370
247226
  if (error.details.length > 0) {
@@ -249707,154 +249563,33 @@ async function maybeAskToBuild(isNonInteractive, buildCommand) {
249707
249563
  });
249708
249564
  return !Ct(answer) && answer;
249709
249565
  }
249710
- // src/core/version/artifacts.ts
249711
- import { createHash as createHash2 } from "node:crypto";
249712
- import { createReadStream as createReadStream3 } from "node:fs";
249713
- import { stat as stat3 } from "node:fs/promises";
249714
- import { basename as basename6, join as join27 } from "node:path";
249715
- var MAX_FILE_COUNT = 1e5;
249716
- var ASSETS_IGNORE_FILE2 = ".assetsignore";
249717
- var ALWAYS_IGNORED2 = new Set([
249718
- ASSETS_IGNORE_FILE2,
249719
- "wrangler.json",
249720
- ".dev.vars"
249721
- ]);
249722
- var ENTRY2 = "index.html";
249723
- async function digestFile(absolutePath) {
249724
- const hash = createHash2("sha256");
249725
- for await (const chunk of createReadStream3(absolutePath)) {
249726
- hash.update(chunk);
249727
- }
249728
- return `sha256:${hash.digest("hex")}`;
249729
- }
249730
- async function collectBuildOutput(outputDir) {
249731
- const found = await globby("**/*", {
249732
- cwd: outputDir,
249733
- dot: true,
249734
- onlyFiles: true,
249735
- followSymbolicLinks: false,
249736
- ignoreFiles: [ASSETS_IGNORE_FILE2]
249737
- });
249738
- const relativePaths = found.filter((path) => !ALWAYS_IGNORED2.has(basename6(path))).sort();
249739
- if (relativePaths.length === 0) {
249740
- throw new InvalidInputError(`No files found in ${outputDir}. Build the site before creating a version.`, {
249741
- hints: [
249742
- { message: "Run 'base44 build' first", command: "base44 build" }
249743
- ]
249744
- });
249745
- }
249746
- if (relativePaths.length > MAX_FILE_COUNT) {
249747
- throw new InvalidInputError(`Too many files: found ${relativePaths.length}, the limit is ${MAX_FILE_COUNT}.`);
249748
- }
249749
- if (!relativePaths.includes(ENTRY2)) {
249750
- throw new InvalidInputError(`${outputDir} has no ${ENTRY2}, so nothing could enter the site.`);
249751
- }
249752
- return await Promise.all(relativePaths.map(async (path) => {
249753
- const absolutePath = join27(outputDir, ...path.split("/"));
249754
- const { size } = await stat3(absolutePath);
249755
- return {
249756
- path,
249757
- absolutePath,
249758
- size,
249759
- digest: await digestFile(absolutePath)
249760
- };
249761
- }));
249762
- }
249763
- async function readRawResources(dir) {
249764
- if (!await pathExists(dir)) {
249765
- return {};
249766
- }
249767
- const files = await globby(`**/*.${CONFIG_FILE_EXTENSION_GLOB}`, {
249768
- cwd: dir,
249769
- onlyFiles: true,
249770
- followSymbolicLinks: false
249771
- });
249772
- const payloads = {};
249773
- for (const relativePath of files.sort()) {
249774
- const name = relativePath.replace(/\.jsonc?$/, "");
249775
- payloads[name] = await readJsonFile(join27(dir, ...relativePath.split("/")));
249776
- }
249777
- return payloads;
249778
- }
249779
- async function collectResources(configDir, dirs) {
249780
- const [entities, agents] = await Promise.all([
249781
- readRawResources(join27(configDir, dirs.entitiesDir)),
249782
- readRawResources(join27(configDir, dirs.agentsDir))
249783
- ]);
249784
- return { entities, agents };
249785
- }
249786
- // src/core/version/gate.ts
249787
- var VERSIONS_API_ENV = "BASE44_VERSIONS_API";
249788
- function versionsApiEnabled(env = process.env) {
249789
- const value = env[VERSIONS_API_ENV];
249790
- return value === "1" || value === "true";
249791
- }
249792
- // src/core/version/project.ts
249793
- import { dirname as dirname21, join as join28, resolve as resolve10 } from "node:path";
249794
- var DEFAULT_BUILD_COMMAND = "npm run build";
249795
- var DEFAULT_OUTPUT_DIRECTORY = "dist";
249796
- async function resolvePublishTarget(projectRoot, overrides = {}) {
249797
- const project = await readSettingsIfPresent(projectRoot);
249798
- const root = project?.root ?? projectRoot ?? process.cwd();
249799
- return {
249800
- root,
249801
- configDir: project ? dirname21(project.configPath) : join28(root, PROJECT_SUBDIR),
249802
- buildCommand: project ? project.site?.buildCommand : DEFAULT_BUILD_COMMAND,
249803
- outputDir: outputDirectory(project, root, overrides.outputDir),
249804
- entitiesDir: project?.entitiesDir ?? "entities",
249805
- agentsDir: project?.agentsDir ?? "agents"
249806
- };
249807
- }
249808
- function outputDirectory(project, root, override) {
249809
- const configured = override ?? (project ? project.site?.outputDirectory : DEFAULT_OUTPUT_DIRECTORY);
249810
- return configured ? resolve10(root, configured) : null;
249811
- }
249812
- function requireOutputDir(target) {
249813
- if (target.outputDir === null) {
249814
- throw new ConfigNotFoundError("No site configuration found.", {
249815
- hints: [
249816
- {
249817
- message: `Add 'site.outputDirectory' to your config.jsonc (e.g., "site": { "outputDirectory": "dist" })`
249818
- },
249819
- { message: `Or pass --output-dir <dir>, relative to ${target.root}` }
249820
- ]
249821
- });
249822
- }
249823
- return target.outputDir;
249824
- }
249825
- async function readSettingsIfPresent(projectRoot) {
249826
- try {
249827
- return await readProjectSettings(projectRoot);
249828
- } catch (error) {
249829
- if (error instanceof ConfigNotFoundError) {
249830
- return null;
249831
- }
249832
- throw error;
249833
- }
249834
- }
249566
+
249835
249567
  // src/cli/commands/project/build.ts
249836
249568
  async function buildAction(ctx) {
249837
249569
  const { app } = ctx;
249838
- const target = await resolvePublishTarget(app?.projectRoot);
249570
+ if (!app?.projectRoot) {
249571
+ throw new ConfigInvalidError("base44 build requires a linked local project. Run it from a project with base44/.app.jsonc.");
249572
+ }
249573
+ const { project } = await readProjectConfig(app.projectRoot);
249839
249574
  await runSiteBuild(ctx, {
249840
- root: target.root,
249841
- buildCommand: target.buildCommand,
249842
- appId: app?.id ?? ""
249575
+ root: project.root,
249576
+ buildCommand: project.site?.buildCommand,
249577
+ appId: app.id
249843
249578
  });
249844
249579
  return {
249845
- outroMessage: `Site built with app id ${theme.styles.bold(app?.id ?? "")}`
249580
+ outroMessage: `Site built with app id ${theme.styles.bold(app.id)}`
249846
249581
  };
249847
249582
  }
249848
249583
  function getBuildCommand() {
249849
- return new Base44Command("build", { requireAuth: false }).description("Build the site with the Base44 app id injected").action(buildAction);
249584
+ return new Base44Command("build").description("Build the site with the Base44 app id injected").action(buildAction);
249850
249585
  }
249851
249586
 
249852
249587
  // src/cli/commands/project/create.ts
249853
- import { basename as basename7, resolve as resolve11 } from "node:path";
249588
+ import { basename as basename6, resolve as resolve10 } from "node:path";
249854
249589
  var import_kebabCase = __toESM(require_kebabCase(), 1);
249855
249590
 
249856
249591
  // src/cli/commands/project/scaffold-shared.ts
249857
- import { join as join29 } from "node:path";
249592
+ import { join as join27 } from "node:path";
249858
249593
  var DEFAULT_TEMPLATE_ID = "backend-only";
249859
249594
  async function getTemplateById(templateId) {
249860
249595
  const templates = await listTemplates();
@@ -249917,7 +249652,7 @@ async function completeProjectSetup({
249917
249652
  env: { VITE_BASE44_APP_ID: projectId }
249918
249653
  })`${buildCommand}`;
249919
249654
  updateMessage("Deploying site...");
249920
- return await deploySite(join29(resolvedPath, outputDirectory));
249655
+ return await deploySite(join27(resolvedPath, outputDirectory));
249921
249656
  }, {
249922
249657
  successMessage: theme.colors.base44Orange("Site deployed successfully"),
249923
249658
  errorMessage: "Failed to deploy site"
@@ -250015,8 +249750,8 @@ async function createInteractive(options, ctx) {
250015
249750
  name: () => {
250016
249751
  return options.name ? Promise.resolve(options.name) : Ze({
250017
249752
  message: "What is the name of your project?",
250018
- placeholder: basename7(process.cwd()),
250019
- initialValue: basename7(process.cwd()),
249753
+ placeholder: basename6(process.cwd()),
249754
+ initialValue: basename6(process.cwd()),
250020
249755
  validate: (value) => {
250021
249756
  if (!value || value.trim().length === 0) {
250022
249757
  return "Every project deserves a name";
@@ -250046,7 +249781,7 @@ async function createInteractive(options, ctx) {
250046
249781
  }, ctx);
250047
249782
  }
250048
249783
  async function createNonInteractive(options, ctx) {
250049
- ctx.log.info(`Creating a new project at ${resolve11(options.path)}`);
249784
+ ctx.log.info(`Creating a new project at ${resolve10(options.path)}`);
250050
249785
  const template = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
250051
249786
  return await executeCreate({
250052
249787
  template,
@@ -250070,7 +249805,7 @@ async function executeCreate({
250070
249805
  }, ctx) {
250071
249806
  const { log, runTask } = ctx;
250072
249807
  const name = rawName.trim();
250073
- const resolvedPath = resolve11(projectPath);
249808
+ const resolvedPath = resolve10(projectPath);
250074
249809
  const organizationId = await resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive);
250075
249810
  const { projectId } = await runTask("Setting up your project...", async () => {
250076
249811
  return await createProjectFiles({
@@ -250711,7 +250446,7 @@ function getLogsCommand() {
250711
250446
  }
250712
250447
 
250713
250448
  // src/cli/commands/project/scaffold.ts
250714
- import { basename as basename8, resolve as resolve12 } from "node:path";
250449
+ import { basename as basename7, resolve as resolve11 } from "node:path";
250715
250450
  function resolveAppId(options) {
250716
250451
  const appId = options.appId;
250717
250452
  if (!appId) {
@@ -250727,8 +250462,8 @@ function resolveAppId(options) {
250727
250462
  async function scaffoldAction(ctx, name, options, command) {
250728
250463
  const { log, runTask } = ctx;
250729
250464
  const appId = resolveAppId(command.optsWithGlobals());
250730
- const resolvedPath = resolve12("./");
250731
- const projectName = (name ?? basename8(resolvedPath)).trim();
250465
+ const resolvedPath = resolve11("./");
250466
+ const projectName = (name ?? basename7(resolvedPath)).trim();
250732
250467
  const template = await getTemplateById("backend-only");
250733
250468
  log.info(`Scaffolding project at ${resolvedPath}`);
250734
250469
  const { projectId } = await runTask("Setting up your project...", async () => {
@@ -250775,74 +250510,6 @@ function getVisibilityCommand() {
250775
250510
  ])).action(setVisibility);
250776
250511
  }
250777
250512
 
250778
- // src/cli/commands/versions/options.ts
250779
- function outputDirOption() {
250780
- return new Option2("--output-dir <dir>", "Build output directory (defaults to the project's, else dist)");
250781
- }
250782
- function targetOption() {
250783
- return new Option2("--target <name>", "Environment to serve the version at");
250784
- }
250785
- function gitHashOption() {
250786
- return new Option2("--git-hash <hash>", "Commit the build came from (defaults to the checkout's HEAD)").argParser((value) => {
250787
- if (!isGitCommitHash(value)) {
250788
- throw new InvalidArgumentError2("Expected a git commit hash (7-64 hex chars).");
250789
- }
250790
- return value;
250791
- });
250792
- }
250793
- function concurrencyOption() {
250794
- return new Option2("--concurrency <n>", "Parallel file uploads").default(DEFAULT_VERSION_UPLOAD_CONCURRENCY).argParser((value) => {
250795
- const parsed = Number(value);
250796
- if (!Number.isInteger(parsed) || parsed < 1 || parsed > MAX_VERSION_UPLOAD_CONCURRENCY) {
250797
- throw new InvalidArgumentError2(`Expected a whole number between 1 and ${MAX_VERSION_UPLOAD_CONCURRENCY}.`);
250798
- }
250799
- return parsed;
250800
- });
250801
- }
250802
-
250803
- // src/cli/commands/publish.ts
250804
- async function publishAction(ctx, options) {
250805
- const { runTask, log, jsonMode, app } = ctx;
250806
- const target = await resolvePublishTarget(app?.projectRoot, {
250807
- outputDir: options.outputDir
250808
- });
250809
- if (options.build !== false) {
250810
- await tagStep("build", () => runSiteBuild(ctx, {
250811
- root: target.root,
250812
- buildCommand: target.buildCommand,
250813
- appId: app?.id ?? ""
250814
- }));
250815
- }
250816
- const outputDir = requireOutputDir(target);
250817
- const gitHash = await resolveProvenanceCommit(target.root, options.gitHash);
250818
- const result = await runTask("Publishing...", async (updateMessage) => {
250819
- const artifacts = {
250820
- files: await collectBuildOutput(outputDir),
250821
- ...await collectResources(target.configDir, target)
250822
- };
250823
- return await publishVersion(artifacts, {
250824
- sourceCommit: gitHash,
250825
- target: options.target,
250826
- concurrency: options.concurrency,
250827
- progress: {
250828
- onDeclared: ({ fileCount, owedFiles }) => updateMessage(`Uploading ${owedFiles} of ${fileCount} files`),
250829
- onUpload: ({ uploadedFiles, totalFiles }) => updateMessage(`Uploaded ${uploadedFiles} of ${totalFiles} files`)
250830
- }
250831
- });
250832
- }, { successMessage: "Published", errorMessage: "Publish failed" });
250833
- if (!jsonMode) {
250834
- log.message(theme.styles.dim(`version ${result.versionId}${result.deduplicated ? " (existing content)" : ""}`));
250835
- }
250836
- return {
250837
- outroMessage: `Deployment ${result.deploymentId} at revision ${result.revision}`,
250838
- stdout: jsonMode ? `${JSON.stringify(result, null, 2)}
250839
- ` : undefined
250840
- };
250841
- }
250842
- function getPublishCommand() {
250843
- return new Base44Command("publish").description("Build the app, record it as a version, and serve that version").option("--no-build", "Publish the existing build output without rebuilding").addOption(outputDirOption()).addOption(targetOption()).addOption(gitHashOption()).addOption(concurrencyOption()).action(publishAction);
250844
- }
250845
-
250846
250513
  // src/core/resources/sandbox/schema.ts
250847
250514
  var FileErrorSchema = object({
250848
250515
  code: string2(),
@@ -251212,7 +250879,7 @@ function getSecretsListCommand() {
251212
250879
  }
251213
250880
 
251214
250881
  // src/cli/commands/secrets/set.ts
251215
- import { resolve as resolve13 } from "node:path";
250882
+ import { resolve as resolve12 } from "node:path";
251216
250883
  function parseEntries(entries) {
251217
250884
  const secrets = {};
251218
250885
  for (const entry of entries) {
@@ -251243,7 +250910,7 @@ async function setSecretsAction({ log, runTask }, entries, options) {
251243
250910
  validateInput(entries, options);
251244
250911
  let secrets;
251245
250912
  if (options.envFile) {
251246
- secrets = await parseEnvFile(resolve13(options.envFile));
250913
+ secrets = await parseEnvFile(resolve12(options.envFile));
251247
250914
  if (Object.keys(secrets).length === 0) {
251248
250915
  throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
251249
250916
  }
@@ -251272,7 +250939,7 @@ function getSecretsCommand() {
251272
250939
  }
251273
250940
 
251274
250941
  // src/cli/commands/site/deploy.ts
251275
- import { resolve as resolve14 } from "node:path";
250942
+ import { resolve as resolve13 } from "node:path";
251276
250943
  async function deployAction2(ctx, options) {
251277
250944
  const { isNonInteractive } = ctx;
251278
250945
  if (isNonInteractive && !options.yes) {
@@ -251350,7 +251017,7 @@ async function deployTarball({ runTask }, project) {
251350
251017
  }
251351
251018
  function siteOutputDir(project) {
251352
251019
  const outputDirectory = project.site?.outputDirectory;
251353
- return outputDirectory ? resolve14(project.root, outputDirectory) : null;
251020
+ return outputDirectory ? resolve13(project.root, outputDirectory) : null;
251354
251021
  }
251355
251022
  function getSiteDeployCommand() {
251356
251023
  const command = new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)");
@@ -251482,10 +251149,10 @@ function toPascalCase(name) {
251482
251149
  return name.split(/[-_\s]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
251483
251150
  }
251484
251151
  // src/core/types/update-project.ts
251485
- import { join as join33 } from "node:path";
251152
+ import { join as join30 } from "node:path";
251486
251153
  var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
251487
251154
  async function updateProjectConfig(projectRoot) {
251488
- const tsconfigPath = join33(projectRoot, "tsconfig.json");
251155
+ const tsconfigPath = join30(projectRoot, "tsconfig.json");
251489
251156
  if (!await pathExists(tsconfigPath)) {
251490
251157
  return false;
251491
251158
  }
@@ -251534,58 +251201,6 @@ function getTypesCommand() {
251534
251201
  return new Command2("types").description("Manage TypeScript type generation").addCommand(getTypesGenerateCommand());
251535
251202
  }
251536
251203
 
251537
- // src/cli/commands/versions/create.ts
251538
- async function createAction2({ runTask, jsonMode, app }, options) {
251539
- const target = await resolvePublishTarget(app?.projectRoot, {
251540
- outputDir: options.outputDir
251541
- });
251542
- const gitHash = await resolveProvenanceCommit(target.root, options.gitHash);
251543
- const version = await runTask("Creating version...", async (updateMessage) => await createVersion({
251544
- files: await collectBuildOutput(requireOutputDir(target)),
251545
- ...await collectResources(target.configDir, target)
251546
- }, {
251547
- sourceCommit: gitHash,
251548
- concurrency: options.concurrency,
251549
- progress: {
251550
- onDeclared: ({ fileCount, owedFiles }) => updateMessage(`Uploading ${owedFiles} of ${fileCount} files`),
251551
- onUpload: ({ uploadedFiles, totalFiles }) => updateMessage(`Uploaded ${uploadedFiles} of ${totalFiles} files`)
251552
- }
251553
- }), {
251554
- successMessage: "Version created",
251555
- errorMessage: "Create version failed"
251556
- });
251557
- return {
251558
- outroMessage: `Version ${version.versionId} (${version.manifestHash})`,
251559
- stdout: jsonMode ? `${JSON.stringify(version, null, 2)}
251560
- ` : undefined
251561
- };
251562
- }
251563
- function getVersionCreateCommand() {
251564
- return new Base44Command("create").description("Record the built output as a version, without deploying it").addOption(outputDirOption()).addOption(gitHashOption()).addOption(concurrencyOption()).action(createAction2);
251565
- }
251566
-
251567
- // src/cli/commands/versions/deploy.ts
251568
- import { randomUUID as randomUUID5 } from "node:crypto";
251569
- async function deployAction3({ runTask, jsonMode }, versionId, options) {
251570
- const deployment = await runTask(`Deploying version ${versionId}...`, async () => await deployVersion(versionId, {
251571
- target: options.target,
251572
- idempotencyKey: randomUUID5()
251573
- }), { successMessage: "Version deployed", errorMessage: "Deploy failed" });
251574
- return {
251575
- outroMessage: `Deployment ${deployment.deploymentId} at revision ${deployment.revision}`,
251576
- stdout: jsonMode ? `${JSON.stringify(deployment, null, 2)}
251577
- ` : undefined
251578
- };
251579
- }
251580
- function getVersionDeployCommand() {
251581
- return new Base44Command("deploy").description("Serve an already-recorded version (also how a rollback is done)").argument("<version-id>", "The version to serve").addOption(targetOption()).action(deployAction3);
251582
- }
251583
-
251584
- // src/cli/commands/versions/index.ts
251585
- function getVersionsCommand() {
251586
- return new Command2("versions").description("Record app versions and serve them").addCommand(getVersionCreateCommand()).addCommand(getVersionDeployCommand());
251587
- }
251588
-
251589
251204
  // src/core/resources/workflow/schema.ts
251590
251205
  var WorkflowRunStatusSchema = _enum([
251591
251206
  "running",
@@ -252002,7 +251617,7 @@ function createDevLogger(label, labelColor = theme.styles.dim) {
252002
251617
  // src/cli/dev/dev-server/main.ts
252003
251618
  var import_cors = __toESM(require_lib4(), 1);
252004
251619
  var import_express6 = __toESM(require_express(), 1);
252005
- import { dirname as dirname27, join as join38 } from "node:path";
251620
+ import { dirname as dirname26, join as join36 } from "node:path";
252006
251621
 
252007
251622
  // ../../node_modules/get-port/index.js
252008
251623
  import net from "node:net";
@@ -252132,7 +251747,7 @@ var $tmpName = promisify11(tmp.tmpName);
252132
251747
 
252133
251748
  // src/cli/dev/dev-server/function-manager.ts
252134
251749
  import { spawn as spawn2 } from "node:child_process";
252135
- import { dirname as dirname24, join as join34 } from "node:path";
251750
+ import { dirname as dirname23, join as join31 } from "node:path";
252136
251751
  import { pathToFileURL } from "node:url";
252137
251752
 
252138
251753
  // src/cli/dev/dev-server/base-function-manager.ts
@@ -252237,7 +251852,7 @@ class FunctionManager extends BaseFunctionManager {
252237
251852
  }
252238
251853
  spawnFunction(func, port) {
252239
251854
  this.logger.log(`Spawning function "${func.name}" on port ${port}`);
252240
- const importMapPath = join34(dirname24(this.wrapperPath), "import-map.json");
251855
+ const importMapPath = join31(dirname23(this.wrapperPath), "import-map.json");
252241
251856
  const process2 = spawn2("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
252242
251857
  env: {
252243
251858
  ...globalThis.process.env,
@@ -252311,7 +251926,7 @@ class FunctionManager extends BaseFunctionManager {
252311
251926
  import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
252312
251927
  import { isBuiltin } from "node:module";
252313
251928
  import { homedir as homedir3 } from "node:os";
252314
- import { join as join35 } from "node:path";
251929
+ import { join as join33 } from "node:path";
252315
251930
  import { pathToFileURL as pathToFileURL6 } from "node:url";
252316
251931
  var depsPromise;
252317
251932
  function loadDeps() {
@@ -252432,9 +252047,9 @@ export default {
252432
252047
  };
252433
252048
  `;
252434
252049
  function ensureBundlerConfig() {
252435
- const dir = join35(homedir3(), ".base44", "function-bundler");
252050
+ const dir = join33(homedir3(), ".base44", "function-bundler");
252436
252051
  mkdirSync2(dir, { recursive: true });
252437
- const configPath = join35(dir, "deno.json");
252052
+ const configPath = join33(dir, "deno.json");
252438
252053
  writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
252439
252054
  `);
252440
252055
  return configPath;
@@ -253815,11 +253430,11 @@ async function createEntityRoutes(db, logger, broadcast) {
253815
253430
  // src/cli/dev/dev-server/routes/integrations.ts
253816
253431
  var import_express5 = __toESM(require_express(), 1);
253817
253432
  var import_multer = __toESM(require_multer(), 1);
253818
- import { createHash as createHash3, randomUUID as randomUUID6 } from "node:crypto";
253433
+ import { createHash as createHash2, randomUUID as randomUUID4 } from "node:crypto";
253819
253434
  import fs28 from "node:fs";
253820
253435
  import path18 from "node:path";
253821
253436
  function createFileToken(fileUri) {
253822
- return createHash3("sha256").update(fileUri).digest("hex");
253437
+ return createHash2("sha256").update(fileUri).digest("hex");
253823
253438
  }
253824
253439
  function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
253825
253440
  const router = import_express5.Router({ mergeParams: true });
@@ -253832,14 +253447,14 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
253832
253447
  destination: mediaFilesDir,
253833
253448
  filename: (_req, file, cb) => {
253834
253449
  const ext = path18.extname(file.originalname);
253835
- cb(null, `${randomUUID6()}${ext}`);
253450
+ cb(null, `${randomUUID4()}${ext}`);
253836
253451
  }
253837
253452
  });
253838
253453
  const privateStorage = import_multer.default.diskStorage({
253839
253454
  destination: privateFilesDir,
253840
253455
  filename: (_req, file, cb) => {
253841
253456
  const ext = path18.extname(file.originalname);
253842
- cb(null, `${randomUUID6()}${ext}`);
253457
+ cb(null, `${randomUUID4()}${ext}`);
253843
253458
  }
253844
253459
  });
253845
253460
  const upload = import_multer.default({ storage, limits: { fileSize: MAX_FILE_SIZE } });
@@ -253909,11 +253524,11 @@ import { relative as relative9 } from "node:path";
253909
253524
  // ../../node_modules/chokidar/index.js
253910
253525
  import { EventEmitter as EventEmitter3 } from "node:events";
253911
253526
  import { stat as statcb, Stats } from "node:fs";
253912
- import { readdir as readdir3, stat as stat7 } from "node:fs/promises";
253527
+ import { readdir as readdir3, stat as stat6 } from "node:fs/promises";
253913
253528
  import * as sp3 from "node:path";
253914
253529
 
253915
253530
  // ../../node_modules/readdirp/index.js
253916
- import { lstat as lstat2, readdir as readdir2, realpath, stat as stat5 } from "node:fs/promises";
253531
+ import { lstat as lstat2, readdir as readdir2, realpath, stat as stat4 } from "node:fs/promises";
253917
253532
  import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
253918
253533
  import { Readable as Readable6 } from "node:stream";
253919
253534
  var EntryTypes = {
@@ -253995,7 +253610,7 @@ class ReaddirpStream extends Readable6 {
253995
253610
  const { root, type } = opts;
253996
253611
  this._fileFilter = normalizeFilter(opts.fileFilter);
253997
253612
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
253998
- const statMethod = opts.lstat ? lstat2 : stat5;
253613
+ const statMethod = opts.lstat ? lstat2 : stat4;
253999
253614
  if (wantBigintFsStats) {
254000
253615
  this._stat = (path) => statMethod(path, { bigint: true });
254001
253616
  } else {
@@ -254148,7 +253763,7 @@ function readdirp(root, options = {}) {
254148
253763
 
254149
253764
  // ../../node_modules/chokidar/handler.js
254150
253765
  import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
254151
- import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat6 } from "node:fs/promises";
253766
+ import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat5 } from "node:fs/promises";
254152
253767
  import { type as osType } from "node:os";
254153
253768
  import * as sp2 from "node:path";
254154
253769
  var STR_DATA = "data";
@@ -254174,7 +253789,7 @@ var EVENTS = {
254174
253789
  };
254175
253790
  var EV = EVENTS;
254176
253791
  var THROTTLE_MODE_WATCH = "watch";
254177
- var statMethods = { lstat: lstat3, stat: stat6 };
253792
+ var statMethods = { lstat: lstat3, stat: stat5 };
254178
253793
  var KEY_LISTENERS = "listeners";
254179
253794
  var KEY_ERR = "errHandlers";
254180
253795
  var KEY_RAW = "rawEmitters";
@@ -254645,7 +254260,7 @@ class NodeFsHandler {
254645
254260
  return;
254646
254261
  if (!newStats || newStats.mtimeMs === 0) {
254647
254262
  try {
254648
- const newStats = await stat6(file);
254263
+ const newStats = await stat5(file);
254649
254264
  if (this.fsw.closed)
254650
254265
  return;
254651
254266
  const at = newStats.atimeMs;
@@ -255317,7 +254932,7 @@ class FSWatcher extends EventEmitter3 {
255317
254932
  const fullPath = opts.cwd ? sp3.join(opts.cwd, path) : path;
255318
254933
  let stats;
255319
254934
  try {
255320
- stats = await stat7(fullPath);
254935
+ stats = await stat6(fullPath);
255321
254936
  } catch (err) {}
255322
254937
  if (!stats || this.closed)
255323
254938
  return;
@@ -255701,8 +255316,8 @@ async function createDevServer(options) {
255701
255316
  broadcastEntityEvent(io, appId, entityName, event);
255702
255317
  };
255703
255318
  const base44ConfigWatcher = new WatchBase44({
255704
- functions: join38(dirname27(project.configPath), project.functionsDir),
255705
- entities: join38(dirname27(project.configPath), project.entitiesDir)
255319
+ functions: join36(dirname26(project.configPath), project.functionsDir),
255320
+ entities: join36(dirname26(project.configPath), project.entitiesDir)
255706
255321
  }, devLogger);
255707
255322
  base44ConfigWatcher.on("change", async (name) => {
255708
255323
  try {
@@ -256099,7 +255714,7 @@ Examples:
256099
255714
  }
256100
255715
 
256101
255716
  // src/cli/commands/project/eject.ts
256102
- import { resolve as resolve18 } from "node:path";
255717
+ import { resolve as resolve17 } from "node:path";
256103
255718
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
256104
255719
  async function eject(ctx, options, command) {
256105
255720
  const { log, runTask, isNonInteractive } = ctx;
@@ -256163,7 +255778,7 @@ async function eject(ctx, options, command) {
256163
255778
  Ne("Operation cancelled.");
256164
255779
  throw new CLIExitError(0);
256165
255780
  }
256166
- const resolvedPath = resolve18(selectedPath);
255781
+ const resolvedPath = resolve17(selectedPath);
256167
255782
  await runTask("Downloading your project's code...", async (updateMessage) => {
256168
255783
  await createProjectFilesForExistingProject({
256169
255784
  projectId,
@@ -256247,10 +255862,6 @@ function createProgram(context) {
256247
255862
  program.addCommand(getBranchesCommand());
256248
255863
  program.addCommand(getAuthCommand());
256249
255864
  program.addCommand(getSiteCommand());
256250
- if (versionsApiEnabled()) {
256251
- program.addCommand(getPublishCommand());
256252
- program.addCommand(getVersionsCommand());
256253
- }
256254
255865
  program.addCommand(getTypesCommand());
256255
255866
  program.addCommand(getExecCommand());
256256
255867
  program.addCommand(getDevCommand());
@@ -256263,7 +255874,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
256263
255874
  import { release, type } from "node:os";
256264
255875
 
256265
255876
  // ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
256266
- import { dirname as dirname28, posix, sep as sep2 } from "path";
255877
+ import { dirname as dirname27, posix, sep as sep2 } from "path";
256267
255878
  function createModulerModifier() {
256268
255879
  const getModuleFromFileName = createGetModuleFromFilename();
256269
255880
  return async (frames) => {
@@ -256272,7 +255883,7 @@ function createModulerModifier() {
256272
255883
  return frames;
256273
255884
  };
256274
255885
  }
256275
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname28(process.argv[1]) : process.cwd(), isWindows = sep2 === "\\") {
255886
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname27(process.argv[1]) : process.cwd(), isWindows = sep2 === "\\") {
256276
255887
  const normalizedBase = isWindows ? normalizeWindowsPath2(basePath) : basePath;
256277
255888
  return (filename) => {
256278
255889
  if (!filename)
@@ -258307,7 +257918,7 @@ class ReduceableCache {
258307
257918
  }
258308
257919
  }
258309
257920
  // ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs
258310
- import { createReadStream as createReadStream4 } from "node:fs";
257921
+ import { createReadStream as createReadStream3 } from "node:fs";
258311
257922
  import { createInterface as createInterface2 } from "node:readline";
258312
257923
  var LRU_FILE_CONTENTS_CACHE = new ReduceableCache(25);
258313
257924
  var LRU_FILE_CONTENTS_FS_READ_FAILED = new ReduceableCache(20);
@@ -258351,7 +257962,7 @@ async function addSourceContext(frames) {
258351
257962
  }
258352
257963
  function getContextLinesFromFile(path, ranges, output) {
258353
257964
  return new Promise((resolve) => {
258354
- const stream = createReadStream4(path);
257965
+ const stream = createReadStream3(path);
258355
257966
  const lineReaded = createInterface2({
258356
257967
  input: stream
258357
257968
  });
@@ -260261,9 +259872,9 @@ function addCommandInfoToErrorReporter(program, errorReporter) {
260261
259872
  });
260262
259873
  }
260263
259874
  // src/cli/index.ts
260264
- var __dirname4 = dirname29(fileURLToPath6(import.meta.url));
259875
+ var __dirname4 = dirname28(fileURLToPath6(import.meta.url));
260265
259876
  async function runCLI(options) {
260266
- ensureNpmAssets(join39(__dirname4, "../assets"));
259877
+ ensureNpmAssets(join37(__dirname4, "../assets"));
260267
259878
  const errorReporter = new ErrorReporter;
260268
259879
  errorReporter.registerProcessErrorHandlers();
260269
259880
  const jsonMode = process.argv.includes("--json");
@@ -260302,4 +259913,4 @@ export {
260302
259913
  runCLI
260303
259914
  };
260304
259915
 
260305
- //# debugId=38C598563A079C3764756E2164756E21
259916
+ //# debugId=EF36A7D77029953264756E2164756E21