@base44-preview/cli 0.1.14-pr.626.6952180 → 0.1.15-pr.626.7eafb3a
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 +37 -52
- package/dist/cli/index.js.map +16 -16
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -239236,7 +239236,7 @@ import { join as join13 } from "node:path";
|
|
|
239236
239236
|
// package.json
|
|
239237
239237
|
var package_default = {
|
|
239238
239238
|
name: "base44",
|
|
239239
|
-
version: "0.1.
|
|
239239
|
+
version: "0.1.15",
|
|
239240
239240
|
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
239241
239241
|
type: "module",
|
|
239242
239242
|
bin: {
|
|
@@ -239635,6 +239635,16 @@ var MIME_TYPES = {
|
|
|
239635
239635
|
function getAssetContentType(filePath) {
|
|
239636
239636
|
return MIME_TYPES[extname(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
239637
239637
|
}
|
|
239638
|
+
async function walkBuildOutput(outputDir) {
|
|
239639
|
+
const found = await globby("**/*", {
|
|
239640
|
+
cwd: outputDir,
|
|
239641
|
+
dot: true,
|
|
239642
|
+
onlyFiles: true,
|
|
239643
|
+
followSymbolicLinks: false,
|
|
239644
|
+
ignoreFiles: [ASSETS_IGNORE_FILE]
|
|
239645
|
+
});
|
|
239646
|
+
return found.filter((path) => !ALWAYS_IGNORED.has(basename5(path))).sort();
|
|
239647
|
+
}
|
|
239638
239648
|
async function hashAssetFile(appId, absolutePath) {
|
|
239639
239649
|
const hash = createHash("sha256").update(Buffer.from(appId, "utf8"));
|
|
239640
239650
|
for await (const chunk of createReadStream(absolutePath)) {
|
|
@@ -239645,18 +239655,11 @@ async function hashAssetFile(appId, absolutePath) {
|
|
|
239645
239655
|
async function buildAssetManifest(assetsDir, appId) {
|
|
239646
239656
|
const manifest = {};
|
|
239647
239657
|
const filesByHash = new Map;
|
|
239648
|
-
const
|
|
239649
|
-
cwd: assetsDir,
|
|
239650
|
-
dot: true,
|
|
239651
|
-
onlyFiles: true,
|
|
239652
|
-
followSymbolicLinks: false,
|
|
239653
|
-
ignoreFiles: [ASSETS_IGNORE_FILE]
|
|
239654
|
-
});
|
|
239655
|
-
const relativeFilePaths = found.filter((path) => !ALWAYS_IGNORED.has(basename5(path)));
|
|
239658
|
+
const relativeFilePaths = await walkBuildOutput(assetsDir);
|
|
239656
239659
|
if (relativeFilePaths.length > MAX_ASSET_COUNT) {
|
|
239657
239660
|
throw new InvalidInputError(`Too many static assets: found ${relativeFilePaths.length}, the limit is ${MAX_ASSET_COUNT} files.`);
|
|
239658
239661
|
}
|
|
239659
|
-
for (const relativePath of relativeFilePaths
|
|
239662
|
+
for (const relativePath of relativeFilePaths) {
|
|
239660
239663
|
const absolutePath = join16(assetsDir, ...relativePath.split("/"));
|
|
239661
239664
|
const { size } = await stat(absolutePath);
|
|
239662
239665
|
const hash = await hashAssetFile(appId, absolutePath);
|
|
@@ -247239,21 +247242,17 @@ var DeclareVersionResponseSchema = object({
|
|
|
247239
247242
|
}));
|
|
247240
247243
|
var CreateVersionResponseSchema = object({
|
|
247241
247244
|
version_id: string2(),
|
|
247242
|
-
manifest_hash: string2()
|
|
247243
|
-
deduplicated: boolean2()
|
|
247245
|
+
manifest_hash: string2()
|
|
247244
247246
|
}).transform((data) => ({
|
|
247245
247247
|
versionId: data.version_id,
|
|
247246
|
-
manifestHash: data.manifest_hash
|
|
247247
|
-
deduplicated: data.deduplicated
|
|
247248
|
+
manifestHash: data.manifest_hash
|
|
247248
247249
|
}));
|
|
247249
247250
|
var DeployVersionResponseSchema = object({
|
|
247250
247251
|
deployment_id: string2(),
|
|
247251
|
-
manifest_hash: string2()
|
|
247252
|
-
revision: number2()
|
|
247252
|
+
manifest_hash: string2()
|
|
247253
247253
|
}).transform((data) => ({
|
|
247254
247254
|
deploymentId: data.deployment_id,
|
|
247255
|
-
manifestHash: data.manifest_hash
|
|
247256
|
-
revision: data.revision
|
|
247255
|
+
manifestHash: data.manifest_hash
|
|
247257
247256
|
}));
|
|
247258
247257
|
|
|
247259
247258
|
// src/core/version/api.ts
|
|
@@ -247299,8 +247298,7 @@ async function createVersion(artifacts, options = {}) {
|
|
|
247299
247298
|
{
|
|
247300
247299
|
absolutePath: file.absolutePath,
|
|
247301
247300
|
hash: file.digest,
|
|
247302
|
-
size: file.size
|
|
247303
|
-
contentType: "application/octet-stream"
|
|
247301
|
+
size: file.size
|
|
247304
247302
|
}
|
|
247305
247303
|
]))
|
|
247306
247304
|
}, {
|
|
@@ -249711,14 +249709,9 @@ async function maybeAskToBuild(isNonInteractive, buildCommand) {
|
|
|
249711
249709
|
import { createHash as createHash2 } from "node:crypto";
|
|
249712
249710
|
import { createReadStream as createReadStream3 } from "node:fs";
|
|
249713
249711
|
import { stat as stat3 } from "node:fs/promises";
|
|
249714
|
-
import {
|
|
249715
|
-
var MAX_FILE_COUNT =
|
|
249716
|
-
var
|
|
249717
|
-
var ALWAYS_IGNORED2 = new Set([
|
|
249718
|
-
ASSETS_IGNORE_FILE2,
|
|
249719
|
-
"wrangler.json",
|
|
249720
|
-
".dev.vars"
|
|
249721
|
-
]);
|
|
249712
|
+
import { join as join27 } from "node:path";
|
|
249713
|
+
var MAX_FILE_COUNT = 50000;
|
|
249714
|
+
var HASH_CONCURRENCY = 32;
|
|
249722
249715
|
var ENTRY2 = "index.html";
|
|
249723
249716
|
async function digestFile(absolutePath) {
|
|
249724
249717
|
const hash = createHash2("sha256");
|
|
@@ -249728,14 +249721,7 @@ async function digestFile(absolutePath) {
|
|
|
249728
249721
|
return `sha256:${hash.digest("hex")}`;
|
|
249729
249722
|
}
|
|
249730
249723
|
async function collectBuildOutput(outputDir) {
|
|
249731
|
-
const
|
|
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();
|
|
249724
|
+
const relativePaths = await walkBuildOutput(outputDir);
|
|
249739
249725
|
if (relativePaths.length === 0) {
|
|
249740
249726
|
throw new InvalidInputError(`No files found in ${outputDir}. Build the site before creating a version.`, {
|
|
249741
249727
|
hints: [
|
|
@@ -249749,7 +249735,7 @@ async function collectBuildOutput(outputDir) {
|
|
|
249749
249735
|
if (!relativePaths.includes(ENTRY2)) {
|
|
249750
249736
|
throw new InvalidInputError(`${outputDir} has no ${ENTRY2}, so nothing could enter the site.`);
|
|
249751
249737
|
}
|
|
249752
|
-
return await
|
|
249738
|
+
return await pMap(relativePaths, async (path) => {
|
|
249753
249739
|
const absolutePath = join27(outputDir, ...path.split("/"));
|
|
249754
249740
|
const { size } = await stat3(absolutePath);
|
|
249755
249741
|
return {
|
|
@@ -249758,7 +249744,7 @@ async function collectBuildOutput(outputDir) {
|
|
|
249758
249744
|
size,
|
|
249759
249745
|
digest: await digestFile(absolutePath)
|
|
249760
249746
|
};
|
|
249761
|
-
})
|
|
249747
|
+
}, { concurrency: HASH_CONCURRENCY });
|
|
249762
249748
|
}
|
|
249763
249749
|
async function readRawResources(dir) {
|
|
249764
249750
|
if (!await pathExists(dir)) {
|
|
@@ -249850,7 +249836,7 @@ function getBuildCommand() {
|
|
|
249850
249836
|
}
|
|
249851
249837
|
|
|
249852
249838
|
// src/cli/commands/project/create.ts
|
|
249853
|
-
import { basename as
|
|
249839
|
+
import { basename as basename6, resolve as resolve11 } from "node:path";
|
|
249854
249840
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
249855
249841
|
|
|
249856
249842
|
// src/cli/commands/project/scaffold-shared.ts
|
|
@@ -250015,8 +250001,8 @@ async function createInteractive(options, ctx) {
|
|
|
250015
250001
|
name: () => {
|
|
250016
250002
|
return options.name ? Promise.resolve(options.name) : Ze({
|
|
250017
250003
|
message: "What is the name of your project?",
|
|
250018
|
-
placeholder:
|
|
250019
|
-
initialValue:
|
|
250004
|
+
placeholder: basename6(process.cwd()),
|
|
250005
|
+
initialValue: basename6(process.cwd()),
|
|
250020
250006
|
validate: (value) => {
|
|
250021
250007
|
if (!value || value.trim().length === 0) {
|
|
250022
250008
|
return "Every project deserves a name";
|
|
@@ -250707,11 +250693,11 @@ async function logsAction(ctx, options) {
|
|
|
250707
250693
|
function getLogsCommand() {
|
|
250708
250694
|
return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all deployed functions").option("--since <datetime>", "Show logs from this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).option("--until <datetime>", "Show logs until this time. ISO datetime or relative shorthand (e.g. 1h, 30m, 2d)", normalizeDatetime).addOption(new Option2("--level <level>", "Filter by log level").choices([
|
|
250709
250695
|
...LogLevelSchema.options
|
|
250710
|
-
])).option("-n, --limit <n>", "Results per page (1-1000; the server returns at most 500)").option("-f, --follow", "Stream new logs as they arrive").addOption(new Option2("--order <order>", "Sort order").choices(["asc", "desc"])).addOption(new Option2("--env <env>", "Which deployment to read logs from: preview (current draft) or prod (published).
|
|
250696
|
+
])).option("-n, --limit <n>", "Results per page (1-1000; the server returns at most 500)").option("-f, --follow", "Stream new logs as they arrive").addOption(new Option2("--order <order>", "Sort order").choices(["asc", "desc"])).addOption(new Option2("--env <env>", "Which deployment to read logs from: preview (current draft) or prod (published). Omit to read both.").choices([...LogEnvSchema.options])).action(logsAction);
|
|
250711
250697
|
}
|
|
250712
250698
|
|
|
250713
250699
|
// src/cli/commands/project/scaffold.ts
|
|
250714
|
-
import { basename as
|
|
250700
|
+
import { basename as basename7, resolve as resolve12 } from "node:path";
|
|
250715
250701
|
function resolveAppId(options) {
|
|
250716
250702
|
const appId = options.appId;
|
|
250717
250703
|
if (!appId) {
|
|
@@ -250728,7 +250714,7 @@ async function scaffoldAction(ctx, name, options, command) {
|
|
|
250728
250714
|
const { log, runTask } = ctx;
|
|
250729
250715
|
const appId = resolveAppId(command.optsWithGlobals());
|
|
250730
250716
|
const resolvedPath = resolve12("./");
|
|
250731
|
-
const projectName = (name ??
|
|
250717
|
+
const projectName = (name ?? basename7(resolvedPath)).trim();
|
|
250732
250718
|
const template = await getTemplateById("backend-only");
|
|
250733
250719
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
250734
250720
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
@@ -250813,13 +250799,12 @@ async function publishAction(ctx, options) {
|
|
|
250813
250799
|
appId: app?.id ?? ""
|
|
250814
250800
|
}));
|
|
250815
250801
|
}
|
|
250816
|
-
const outputDir = requireOutputDir(target);
|
|
250817
250802
|
const gitHash = await resolveProvenanceCommit(target.root, options.gitHash);
|
|
250818
250803
|
const result = await runTask("Publishing...", async (updateMessage) => {
|
|
250819
|
-
const artifacts = {
|
|
250820
|
-
files: await collectBuildOutput(
|
|
250804
|
+
const artifacts = await tagStep("create_version", async () => ({
|
|
250805
|
+
files: await collectBuildOutput(requireOutputDir(target)),
|
|
250821
250806
|
...await collectResources(target.configDir, target)
|
|
250822
|
-
};
|
|
250807
|
+
}));
|
|
250823
250808
|
return await publishVersion(artifacts, {
|
|
250824
250809
|
sourceCommit: gitHash,
|
|
250825
250810
|
target: options.target,
|
|
@@ -250831,10 +250816,10 @@ async function publishAction(ctx, options) {
|
|
|
250831
250816
|
});
|
|
250832
250817
|
}, { successMessage: "Published", errorMessage: "Publish failed" });
|
|
250833
250818
|
if (!jsonMode) {
|
|
250834
|
-
log.message(theme.styles.dim(`version ${result.versionId}
|
|
250819
|
+
log.message(theme.styles.dim(`version ${result.versionId}`));
|
|
250835
250820
|
}
|
|
250836
250821
|
return {
|
|
250837
|
-
outroMessage: `Deployment ${result.deploymentId}
|
|
250822
|
+
outroMessage: `Deployment ${result.deploymentId}`,
|
|
250838
250823
|
stdout: jsonMode ? `${JSON.stringify(result, null, 2)}
|
|
250839
250824
|
` : undefined
|
|
250840
250825
|
};
|
|
@@ -251572,7 +251557,7 @@ async function deployAction3({ runTask, jsonMode }, versionId, options) {
|
|
|
251572
251557
|
idempotencyKey: randomUUID5()
|
|
251573
251558
|
}), { successMessage: "Version deployed", errorMessage: "Deploy failed" });
|
|
251574
251559
|
return {
|
|
251575
|
-
outroMessage: `Deployment ${deployment.deploymentId}
|
|
251560
|
+
outroMessage: `Deployment ${deployment.deploymentId}`,
|
|
251576
251561
|
stdout: jsonMode ? `${JSON.stringify(deployment, null, 2)}
|
|
251577
251562
|
` : undefined
|
|
251578
251563
|
};
|
|
@@ -260302,4 +260287,4 @@ export {
|
|
|
260302
260287
|
runCLI
|
|
260303
260288
|
};
|
|
260304
260289
|
|
|
260305
|
-
//# debugId=
|
|
260290
|
+
//# debugId=38D4760AB5C212C864756E2164756E21
|