@base44-preview/cli 0.1.15-pr.626.cb0717a → 0.1.15-pr.626.da7a7d8
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 +137 -90
- package/dist/cli/index.js.map +10 -10
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -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);
|
|
@@ -239994,7 +239997,10 @@ async function uploadPresignedAsset(upload, assets) {
|
|
|
239994
239997
|
if (!file) {
|
|
239995
239998
|
throw new InternalError(`Server requested upload of unknown asset path: ${upload.path}`);
|
|
239996
239999
|
}
|
|
239997
|
-
|
|
240000
|
+
await putPresigned(upload, file.absolutePath);
|
|
240001
|
+
}
|
|
240002
|
+
async function putPresigned(upload, absolutePath) {
|
|
240003
|
+
const content = await readFile2(absolutePath);
|
|
239998
240004
|
try {
|
|
239999
240005
|
await distribution_default.put(upload.url, {
|
|
240000
240006
|
body: new Uint8Array(content),
|
|
@@ -247244,17 +247250,24 @@ var CreateVersionResponseSchema = object({
|
|
|
247244
247250
|
versionId: data.version_id,
|
|
247245
247251
|
manifestHash: data.manifest_hash
|
|
247246
247252
|
}));
|
|
247247
|
-
var
|
|
247248
|
-
|
|
247249
|
-
|
|
247253
|
+
var EnvironmentResponseSchema = object({
|
|
247254
|
+
name: string2(),
|
|
247255
|
+
version_id: string2(),
|
|
247256
|
+
manifest_hash: string2(),
|
|
247257
|
+
deployment_id: string2()
|
|
247250
247258
|
}).transform((data) => ({
|
|
247251
|
-
|
|
247252
|
-
|
|
247259
|
+
name: data.name,
|
|
247260
|
+
versionId: data.version_id,
|
|
247261
|
+
manifestHash: data.manifest_hash,
|
|
247262
|
+
deploymentId: data.deployment_id
|
|
247253
247263
|
}));
|
|
247254
247264
|
|
|
247255
247265
|
// src/core/version/api.ts
|
|
247256
247266
|
var DEFAULT_VERSION_UPLOAD_CONCURRENCY = 8;
|
|
247257
247267
|
var MAX_VERSION_UPLOAD_CONCURRENCY = 16;
|
|
247268
|
+
function declaredFile({ path, size, digest }) {
|
|
247269
|
+
return { path, size, digest };
|
|
247270
|
+
}
|
|
247258
247271
|
async function post(path, json, doing) {
|
|
247259
247272
|
try {
|
|
247260
247273
|
return await getAppClient().post(path, { json, timeout: 180000 });
|
|
@@ -247262,6 +247275,13 @@ async function post(path, json, doing) {
|
|
|
247262
247275
|
throw await ApiError.fromHttpError(error, doing);
|
|
247263
247276
|
}
|
|
247264
247277
|
}
|
|
247278
|
+
async function patch(path, json, doing) {
|
|
247279
|
+
try {
|
|
247280
|
+
return await getAppClient().patch(path, { json, timeout: 180000 });
|
|
247281
|
+
} catch (error) {
|
|
247282
|
+
throw await ApiError.fromHttpError(error, doing);
|
|
247283
|
+
}
|
|
247284
|
+
}
|
|
247265
247285
|
function parse10(schema, body, what) {
|
|
247266
247286
|
const result = schema.safeParse(body);
|
|
247267
247287
|
if (!result.success) {
|
|
@@ -247271,48 +247291,51 @@ function parse10(schema, body, what) {
|
|
|
247271
247291
|
}
|
|
247272
247292
|
async function createVersion(artifacts, options = {}) {
|
|
247273
247293
|
const declared = parse10(DeclareVersionResponseSchema, await (await post("versions", {
|
|
247274
|
-
static_bundle: artifacts.files.map(
|
|
247275
|
-
|
|
247276
|
-
|
|
247277
|
-
|
|
247278
|
-
|
|
247294
|
+
static_bundle: artifacts.files.map(declaredFile),
|
|
247295
|
+
...artifacts.siteWorker ? {
|
|
247296
|
+
site_worker: {
|
|
247297
|
+
main: artifacts.siteWorker.main,
|
|
247298
|
+
modules: artifacts.siteWorker.modules.map(declaredFile),
|
|
247299
|
+
compatibility_date: artifacts.siteWorker.compatibilityDate,
|
|
247300
|
+
compatibility_flags: artifacts.siteWorker.compatibilityFlags
|
|
247301
|
+
}
|
|
247302
|
+
} : {},
|
|
247279
247303
|
entities: artifacts.entities,
|
|
247280
247304
|
agents: artifacts.agents,
|
|
247281
|
-
source_commit: options.sourceCommit
|
|
247282
|
-
frontend_commit: options.sourceCommit
|
|
247305
|
+
source_commit: options.sourceCommit
|
|
247283
247306
|
}, "declaring a version")).json(), "declare");
|
|
247307
|
+
const declaredFiles = [
|
|
247308
|
+
...artifacts.files,
|
|
247309
|
+
...artifacts.siteWorker?.modules ?? []
|
|
247310
|
+
];
|
|
247284
247311
|
options.progress?.onDeclared?.({
|
|
247285
|
-
fileCount:
|
|
247312
|
+
fileCount: declaredFiles.length,
|
|
247286
247313
|
owedFiles: declared.uploads.length
|
|
247287
247314
|
});
|
|
247288
|
-
|
|
247289
|
-
|
|
247290
|
-
|
|
247291
|
-
|
|
247292
|
-
|
|
247293
|
-
|
|
247294
|
-
|
|
247295
|
-
|
|
247296
|
-
|
|
247297
|
-
|
|
247298
|
-
|
|
247299
|
-
|
|
247300
|
-
]))
|
|
247301
|
-
}, {
|
|
247302
|
-
concurrency: options.concurrency ?? DEFAULT_VERSION_UPLOAD_CONCURRENCY,
|
|
247303
|
-
onProgress: options.progress?.onUpload
|
|
247304
|
-
});
|
|
247315
|
+
if (declared.uploads.length !== declaredFiles.length) {
|
|
247316
|
+
throw new InternalError(`Declared ${declaredFiles.length} files but the server signed ${declared.uploads.length} upload URLs.`);
|
|
247317
|
+
}
|
|
247318
|
+
let uploadedFiles = 0;
|
|
247319
|
+
await pMap(declared.uploads, async (upload, index) => {
|
|
247320
|
+
await putPresigned(upload, declaredFiles[index].absolutePath);
|
|
247321
|
+
uploadedFiles++;
|
|
247322
|
+
options.progress?.onUpload?.({
|
|
247323
|
+
uploadedFiles,
|
|
247324
|
+
totalFiles: declared.uploads.length
|
|
247325
|
+
});
|
|
247326
|
+
}, { concurrency: options.concurrency ?? DEFAULT_VERSION_UPLOAD_CONCURRENCY });
|
|
247305
247327
|
return parse10(CreateVersionResponseSchema, await (await post(`versions/${encodeURIComponent(declared.sessionId)}/finalize`, {}, "creating a version")).json(), "create version");
|
|
247306
247328
|
}
|
|
247307
|
-
async function
|
|
247308
|
-
return parse10(
|
|
247309
|
-
|
|
247329
|
+
async function setEnvironmentVersion(environment, versionId, options = {}) {
|
|
247330
|
+
return parse10(EnvironmentResponseSchema, await (await patch(`environments/${encodeURIComponent(environment)}`, {
|
|
247331
|
+
version_id: versionId,
|
|
247310
247332
|
...options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}
|
|
247311
|
-
}, "
|
|
247333
|
+
}, "setting the environment's version")).json(), "environment");
|
|
247312
247334
|
}
|
|
247313
247335
|
|
|
247314
247336
|
// src/core/version/publish.ts
|
|
247315
247337
|
var STEP = Symbol.for("base44.publishStep");
|
|
247338
|
+
var DEFAULT_ENVIRONMENT = "production";
|
|
247316
247339
|
async function tagStep(step, run) {
|
|
247317
247340
|
try {
|
|
247318
247341
|
return await run();
|
|
@@ -247332,11 +247355,15 @@ async function publishVersion(artifacts, options = {}) {
|
|
|
247332
247355
|
concurrency: options.concurrency,
|
|
247333
247356
|
progress: options.progress
|
|
247334
247357
|
}));
|
|
247335
|
-
const
|
|
247336
|
-
target: options.target,
|
|
247358
|
+
const environment = await tagStep("deploy", () => setEnvironmentVersion(options.target ?? DEFAULT_ENVIRONMENT, version.versionId, {
|
|
247337
247359
|
idempotencyKey: randomUUID4()
|
|
247338
247360
|
}));
|
|
247339
|
-
return {
|
|
247361
|
+
return {
|
|
247362
|
+
environment: environment.name,
|
|
247363
|
+
versionId: environment.versionId,
|
|
247364
|
+
manifestHash: environment.manifestHash,
|
|
247365
|
+
deploymentId: environment.deploymentId
|
|
247366
|
+
};
|
|
247340
247367
|
}
|
|
247341
247368
|
|
|
247342
247369
|
// src/cli/utils/command/Base44Command.ts
|
|
@@ -249706,15 +249733,9 @@ async function maybeAskToBuild(isNonInteractive, buildCommand) {
|
|
|
249706
249733
|
import { createHash as createHash2 } from "node:crypto";
|
|
249707
249734
|
import { createReadStream as createReadStream3 } from "node:fs";
|
|
249708
249735
|
import { stat as stat3 } from "node:fs/promises";
|
|
249709
|
-
import {
|
|
249736
|
+
import { join as join27, resolve as resolve10 } from "node:path";
|
|
249710
249737
|
var MAX_FILE_COUNT = 50000;
|
|
249711
249738
|
var HASH_CONCURRENCY = 32;
|
|
249712
|
-
var ASSETS_IGNORE_FILE2 = ".assetsignore";
|
|
249713
|
-
var ALWAYS_IGNORED2 = new Set([
|
|
249714
|
-
ASSETS_IGNORE_FILE2,
|
|
249715
|
-
"wrangler.json",
|
|
249716
|
-
".dev.vars"
|
|
249717
|
-
]);
|
|
249718
249739
|
var ENTRY2 = "index.html";
|
|
249719
249740
|
async function digestFile(absolutePath) {
|
|
249720
249741
|
const hash = createHash2("sha256");
|
|
@@ -249724,14 +249745,7 @@ async function digestFile(absolutePath) {
|
|
|
249724
249745
|
return `sha256:${hash.digest("hex")}`;
|
|
249725
249746
|
}
|
|
249726
249747
|
async function collectBuildOutput(outputDir) {
|
|
249727
|
-
const
|
|
249728
|
-
cwd: outputDir,
|
|
249729
|
-
dot: true,
|
|
249730
|
-
onlyFiles: true,
|
|
249731
|
-
followSymbolicLinks: false,
|
|
249732
|
-
ignoreFiles: [ASSETS_IGNORE_FILE2]
|
|
249733
|
-
});
|
|
249734
|
-
const relativePaths = found.filter((path) => !ALWAYS_IGNORED2.has(basename6(path))).sort();
|
|
249748
|
+
const relativePaths = await walkBuildOutput(outputDir);
|
|
249735
249749
|
if (relativePaths.length === 0) {
|
|
249736
249750
|
throw new InvalidInputError(`No files found in ${outputDir}. Build the site before creating a version.`, {
|
|
249737
249751
|
hints: [
|
|
@@ -249756,6 +249770,31 @@ async function collectBuildOutput(outputDir) {
|
|
|
249756
249770
|
};
|
|
249757
249771
|
}, { concurrency: HASH_CONCURRENCY });
|
|
249758
249772
|
}
|
|
249773
|
+
async function collectSiteWorker(projectRoot) {
|
|
249774
|
+
const redirectPath = await detectFullStackArtifact(projectRoot);
|
|
249775
|
+
if (!redirectPath) {
|
|
249776
|
+
return null;
|
|
249777
|
+
}
|
|
249778
|
+
const config = await resolveWranglerConfig(redirectPath);
|
|
249779
|
+
const modules = await collectModules(config);
|
|
249780
|
+
const entry = resolve10(config.configDir, config.main);
|
|
249781
|
+
const main = modules.find((m) => m.absolutePath === entry)?.name;
|
|
249782
|
+
if (!main) {
|
|
249783
|
+
throw new InvalidInputError(`The Worker's entry module ${config.main} is not among the ${modules.length} modules collected from ${config.configDir}.`);
|
|
249784
|
+
}
|
|
249785
|
+
return {
|
|
249786
|
+
main,
|
|
249787
|
+
modules: await pMap(modules, async ({ name, absolutePath, size }) => ({
|
|
249788
|
+
path: name,
|
|
249789
|
+
absolutePath,
|
|
249790
|
+
size,
|
|
249791
|
+
digest: await digestFile(absolutePath)
|
|
249792
|
+
}), { concurrency: HASH_CONCURRENCY }),
|
|
249793
|
+
compatibilityDate: config.compatibilityDate,
|
|
249794
|
+
compatibilityFlags: config.compatibilityFlags,
|
|
249795
|
+
assetsDir: config.assetsDirectory && await pathExists(config.assetsDirectory) ? config.assetsDirectory : null
|
|
249796
|
+
};
|
|
249797
|
+
}
|
|
249759
249798
|
async function readRawResources(dir) {
|
|
249760
249799
|
if (!await pathExists(dir)) {
|
|
249761
249800
|
return {};
|
|
@@ -249786,7 +249825,7 @@ function versionsApiEnabled(env = process.env) {
|
|
|
249786
249825
|
return value === "1" || value === "true";
|
|
249787
249826
|
}
|
|
249788
249827
|
// src/core/version/project.ts
|
|
249789
|
-
import { dirname as dirname21, join as join28, resolve as
|
|
249828
|
+
import { dirname as dirname21, join as join28, resolve as resolve11 } from "node:path";
|
|
249790
249829
|
var DEFAULT_BUILD_COMMAND = "npm run build";
|
|
249791
249830
|
var DEFAULT_OUTPUT_DIRECTORY = "dist";
|
|
249792
249831
|
async function resolvePublishTarget(projectRoot, overrides = {}) {
|
|
@@ -249803,7 +249842,7 @@ async function resolvePublishTarget(projectRoot, overrides = {}) {
|
|
|
249803
249842
|
}
|
|
249804
249843
|
function outputDirectory(project, root, override) {
|
|
249805
249844
|
const configured = override ?? (project ? project.site?.outputDirectory : DEFAULT_OUTPUT_DIRECTORY);
|
|
249806
|
-
return configured ?
|
|
249845
|
+
return configured ? resolve11(root, configured) : null;
|
|
249807
249846
|
}
|
|
249808
249847
|
function requireOutputDir(target) {
|
|
249809
249848
|
if (target.outputDir === null) {
|
|
@@ -249846,7 +249885,7 @@ function getBuildCommand() {
|
|
|
249846
249885
|
}
|
|
249847
249886
|
|
|
249848
249887
|
// src/cli/commands/project/create.ts
|
|
249849
|
-
import { basename as
|
|
249888
|
+
import { basename as basename6, resolve as resolve12 } from "node:path";
|
|
249850
249889
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
249851
249890
|
|
|
249852
249891
|
// src/cli/commands/project/scaffold-shared.ts
|
|
@@ -250011,8 +250050,8 @@ async function createInteractive(options, ctx) {
|
|
|
250011
250050
|
name: () => {
|
|
250012
250051
|
return options.name ? Promise.resolve(options.name) : Ze({
|
|
250013
250052
|
message: "What is the name of your project?",
|
|
250014
|
-
placeholder:
|
|
250015
|
-
initialValue:
|
|
250053
|
+
placeholder: basename6(process.cwd()),
|
|
250054
|
+
initialValue: basename6(process.cwd()),
|
|
250016
250055
|
validate: (value) => {
|
|
250017
250056
|
if (!value || value.trim().length === 0) {
|
|
250018
250057
|
return "Every project deserves a name";
|
|
@@ -250042,7 +250081,7 @@ async function createInteractive(options, ctx) {
|
|
|
250042
250081
|
}, ctx);
|
|
250043
250082
|
}
|
|
250044
250083
|
async function createNonInteractive(options, ctx) {
|
|
250045
|
-
ctx.log.info(`Creating a new project at ${
|
|
250084
|
+
ctx.log.info(`Creating a new project at ${resolve12(options.path)}`);
|
|
250046
250085
|
const template = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
250047
250086
|
return await executeCreate({
|
|
250048
250087
|
template,
|
|
@@ -250066,7 +250105,7 @@ async function executeCreate({
|
|
|
250066
250105
|
}, ctx) {
|
|
250067
250106
|
const { log, runTask } = ctx;
|
|
250068
250107
|
const name = rawName.trim();
|
|
250069
|
-
const resolvedPath =
|
|
250108
|
+
const resolvedPath = resolve12(projectPath);
|
|
250070
250109
|
const organizationId = await resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive);
|
|
250071
250110
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
250072
250111
|
return await createProjectFiles({
|
|
@@ -250707,7 +250746,7 @@ function getLogsCommand() {
|
|
|
250707
250746
|
}
|
|
250708
250747
|
|
|
250709
250748
|
// src/cli/commands/project/scaffold.ts
|
|
250710
|
-
import { basename as
|
|
250749
|
+
import { basename as basename7, resolve as resolve13 } from "node:path";
|
|
250711
250750
|
function resolveAppId(options) {
|
|
250712
250751
|
const appId = options.appId;
|
|
250713
250752
|
if (!appId) {
|
|
@@ -250723,8 +250762,8 @@ function resolveAppId(options) {
|
|
|
250723
250762
|
async function scaffoldAction(ctx, name, options, command) {
|
|
250724
250763
|
const { log, runTask } = ctx;
|
|
250725
250764
|
const appId = resolveAppId(command.optsWithGlobals());
|
|
250726
|
-
const resolvedPath =
|
|
250727
|
-
const projectName = (name ??
|
|
250765
|
+
const resolvedPath = resolve13("./");
|
|
250766
|
+
const projectName = (name ?? basename7(resolvedPath)).trim();
|
|
250728
250767
|
const template = await getTemplateById("backend-only");
|
|
250729
250768
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
250730
250769
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
@@ -250811,10 +250850,15 @@ async function publishAction(ctx, options) {
|
|
|
250811
250850
|
}
|
|
250812
250851
|
const gitHash = await resolveProvenanceCommit(target.root, options.gitHash);
|
|
250813
250852
|
const result = await runTask("Publishing...", async (updateMessage) => {
|
|
250814
|
-
const artifacts = await tagStep("create_version", async () =>
|
|
250815
|
-
|
|
250816
|
-
|
|
250817
|
-
|
|
250853
|
+
const artifacts = await tagStep("create_version", async () => {
|
|
250854
|
+
const siteWorker = await collectSiteWorker(target.root);
|
|
250855
|
+
const outputDir = siteWorker?.assetsDir ?? requireOutputDir(target);
|
|
250856
|
+
return {
|
|
250857
|
+
files: await collectBuildOutput(outputDir),
|
|
250858
|
+
...siteWorker ? { siteWorker } : {},
|
|
250859
|
+
...await collectResources(target.configDir, target)
|
|
250860
|
+
};
|
|
250861
|
+
});
|
|
250818
250862
|
return await publishVersion(artifacts, {
|
|
250819
250863
|
sourceCommit: gitHash,
|
|
250820
250864
|
target: options.target,
|
|
@@ -250829,7 +250873,7 @@ async function publishAction(ctx, options) {
|
|
|
250829
250873
|
log.message(theme.styles.dim(`version ${result.versionId}`));
|
|
250830
250874
|
}
|
|
250831
250875
|
return {
|
|
250832
|
-
outroMessage:
|
|
250876
|
+
outroMessage: `${result.environment} now serves ${result.versionId}`,
|
|
250833
250877
|
stdout: jsonMode ? `${JSON.stringify(result, null, 2)}
|
|
250834
250878
|
` : undefined
|
|
250835
250879
|
};
|
|
@@ -251207,7 +251251,7 @@ function getSecretsListCommand() {
|
|
|
251207
251251
|
}
|
|
251208
251252
|
|
|
251209
251253
|
// src/cli/commands/secrets/set.ts
|
|
251210
|
-
import { resolve as
|
|
251254
|
+
import { resolve as resolve14 } from "node:path";
|
|
251211
251255
|
function parseEntries(entries) {
|
|
251212
251256
|
const secrets = {};
|
|
251213
251257
|
for (const entry of entries) {
|
|
@@ -251238,7 +251282,7 @@ async function setSecretsAction({ log, runTask }, entries, options) {
|
|
|
251238
251282
|
validateInput(entries, options);
|
|
251239
251283
|
let secrets;
|
|
251240
251284
|
if (options.envFile) {
|
|
251241
|
-
secrets = await parseEnvFile(
|
|
251285
|
+
secrets = await parseEnvFile(resolve14(options.envFile));
|
|
251242
251286
|
if (Object.keys(secrets).length === 0) {
|
|
251243
251287
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
251244
251288
|
}
|
|
@@ -251267,7 +251311,7 @@ function getSecretsCommand() {
|
|
|
251267
251311
|
}
|
|
251268
251312
|
|
|
251269
251313
|
// src/cli/commands/site/deploy.ts
|
|
251270
|
-
import { resolve as
|
|
251314
|
+
import { resolve as resolve15 } from "node:path";
|
|
251271
251315
|
async function deployAction2(ctx, options) {
|
|
251272
251316
|
const { isNonInteractive } = ctx;
|
|
251273
251317
|
if (isNonInteractive && !options.yes) {
|
|
@@ -251345,7 +251389,7 @@ async function deployTarball({ runTask }, project) {
|
|
|
251345
251389
|
}
|
|
251346
251390
|
function siteOutputDir(project) {
|
|
251347
251391
|
const outputDirectory = project.site?.outputDirectory;
|
|
251348
|
-
return outputDirectory ?
|
|
251392
|
+
return outputDirectory ? resolve15(project.root, outputDirectory) : null;
|
|
251349
251393
|
}
|
|
251350
251394
|
function getSiteDeployCommand() {
|
|
251351
251395
|
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)");
|
|
@@ -251562,18 +251606,21 @@ function getVersionCreateCommand() {
|
|
|
251562
251606
|
// src/cli/commands/versions/deploy.ts
|
|
251563
251607
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
251564
251608
|
async function deployAction3({ runTask, jsonMode }, versionId, options) {
|
|
251565
|
-
const
|
|
251566
|
-
|
|
251609
|
+
const environment = options.target ?? DEFAULT_ENVIRONMENT;
|
|
251610
|
+
const result = await runTask(`Pointing ${environment} at ${versionId}...`, async () => await setEnvironmentVersion(environment, versionId, {
|
|
251567
251611
|
idempotencyKey: randomUUID5()
|
|
251568
|
-
}), {
|
|
251612
|
+
}), {
|
|
251613
|
+
successMessage: "Environment updated",
|
|
251614
|
+
errorMessage: "Could not update the environment"
|
|
251615
|
+
});
|
|
251569
251616
|
return {
|
|
251570
|
-
outroMessage:
|
|
251571
|
-
stdout: jsonMode ? `${JSON.stringify(
|
|
251617
|
+
outroMessage: `${result.name} now serves ${result.versionId}`,
|
|
251618
|
+
stdout: jsonMode ? `${JSON.stringify(result, null, 2)}
|
|
251572
251619
|
` : undefined
|
|
251573
251620
|
};
|
|
251574
251621
|
}
|
|
251575
251622
|
function getVersionDeployCommand() {
|
|
251576
|
-
return new Base44Command("deploy").description("
|
|
251623
|
+
return new Base44Command("deploy").description("Point an environment at an already-recorded version (also the rollback)").argument("<version-id>", "The version to serve").option("--target <name>", "Environment to point at it").action(deployAction3);
|
|
251577
251624
|
}
|
|
251578
251625
|
|
|
251579
251626
|
// src/cli/commands/versions/index.ts
|
|
@@ -256094,7 +256141,7 @@ Examples:
|
|
|
256094
256141
|
}
|
|
256095
256142
|
|
|
256096
256143
|
// src/cli/commands/project/eject.ts
|
|
256097
|
-
import { resolve as
|
|
256144
|
+
import { resolve as resolve19 } from "node:path";
|
|
256098
256145
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
256099
256146
|
async function eject(ctx, options, command) {
|
|
256100
256147
|
const { log, runTask, isNonInteractive } = ctx;
|
|
@@ -256158,7 +256205,7 @@ async function eject(ctx, options, command) {
|
|
|
256158
256205
|
Ne("Operation cancelled.");
|
|
256159
256206
|
throw new CLIExitError(0);
|
|
256160
256207
|
}
|
|
256161
|
-
const resolvedPath =
|
|
256208
|
+
const resolvedPath = resolve19(selectedPath);
|
|
256162
256209
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
256163
256210
|
await createProjectFilesForExistingProject({
|
|
256164
256211
|
projectId,
|
|
@@ -260297,4 +260344,4 @@ export {
|
|
|
260297
260344
|
runCLI
|
|
260298
260345
|
};
|
|
260299
260346
|
|
|
260300
|
-
//# debugId=
|
|
260347
|
+
//# debugId=1EF49975E5A11DC264756E2164756E21
|