@base44-preview/cli 0.1.33-pr.643.5285041 → 0.1.33-pr.643.706636f
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 +44 -34
- package/dist/cli/index.js.map +6 -6
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -246850,22 +246850,21 @@ function isGitCommitHash(value) {
|
|
|
246850
246850
|
}
|
|
246851
246851
|
|
|
246852
246852
|
// src/core/site/git-hash.ts
|
|
246853
|
-
|
|
246854
|
-
|
|
246855
|
-
|
|
246856
|
-
|
|
246857
|
-
|
|
246858
|
-
|
|
246859
|
-
|
|
246860
|
-
|
|
246861
|
-
]
|
|
246862
|
-
});
|
|
246863
|
-
}
|
|
246864
|
-
return hash;
|
|
246853
|
+
function workerBuildNeedsGitHashError() {
|
|
246854
|
+
return new InvalidInputError("A full-stack build deploys by the commit that produced it, and none was given.", {
|
|
246855
|
+
hints: [
|
|
246856
|
+
{
|
|
246857
|
+
message: "Pass it with --git-hash, e.g. --git-hash $(git rev-parse HEAD)."
|
|
246858
|
+
}
|
|
246859
|
+
]
|
|
246860
|
+
});
|
|
246865
246861
|
}
|
|
246866
246862
|
async function resolveProvenanceCommit(projectRoot, explicit) {
|
|
246867
246863
|
if (explicit) {
|
|
246868
|
-
|
|
246864
|
+
if (!isGitCommitHash(explicit)) {
|
|
246865
|
+
throw new InvalidInputError(`'${explicit}' is not a git commit hash.`);
|
|
246866
|
+
}
|
|
246867
|
+
return explicit;
|
|
246869
246868
|
}
|
|
246870
246869
|
const hash = await gitHead(projectRoot);
|
|
246871
246870
|
return hash && isGitCommitHash(hash) ? hash : undefined;
|
|
@@ -246914,6 +246913,9 @@ async function deployAll(projectData, options) {
|
|
|
246914
246913
|
connectors,
|
|
246915
246914
|
authConfig
|
|
246916
246915
|
} = projectData;
|
|
246916
|
+
if (!options?.gitHash && await detectFullStackArtifact(project.root)) {
|
|
246917
|
+
throw workerBuildNeedsGitHashError();
|
|
246918
|
+
}
|
|
246917
246919
|
await setAppVisibility(project.visibility);
|
|
246918
246920
|
if (project.visibility) {
|
|
246919
246921
|
options?.onVisibilitySet?.(project.visibility);
|
|
@@ -246957,22 +246959,15 @@ async function deployAll(projectData, options) {
|
|
|
246957
246959
|
async function deployProjectSite(project, options) {
|
|
246958
246960
|
const outputDirectory = project.site?.outputDirectory;
|
|
246959
246961
|
const outputDir = outputDirectory ? resolve5(project.root, outputDirectory) : null;
|
|
246960
|
-
|
|
246961
|
-
|
|
246962
|
-
|
|
246963
|
-
}
|
|
246964
|
-
const gitHash = await resolveGitHash(project.root, options?.gitHash);
|
|
246965
|
-
return shipCommit(project.root, null, gitHash, options);
|
|
246962
|
+
const gitHash = options?.gitHash;
|
|
246963
|
+
if (gitHash && (outputDir || await detectFullStackArtifact(project.root))) {
|
|
246964
|
+
return shipCommit(project.root, outputDir, gitHash, options);
|
|
246966
246965
|
}
|
|
246967
|
-
|
|
246966
|
+
if (!outputDir) {
|
|
246968
246967
|
return;
|
|
246969
|
-
});
|
|
246970
|
-
if (!gitHash) {
|
|
246971
|
-
options?.onSiteProgress?.("No commit found for this build, so it was deployed without one. Commit your work to address deployments by it.");
|
|
246972
|
-
const { appUrl } = await deploySite(outputDir);
|
|
246973
|
-
return appUrl;
|
|
246974
246968
|
}
|
|
246975
|
-
|
|
246969
|
+
const { appUrl } = await deploySite(outputDir);
|
|
246970
|
+
return appUrl;
|
|
246976
246971
|
}
|
|
246977
246972
|
async function shipCommit(projectRoot, outputDir, gitHash, options) {
|
|
246978
246973
|
await deployToDeployments({
|
|
@@ -246984,9 +246979,6 @@ async function shipCommit(projectRoot, outputDir, gitHash, options) {
|
|
|
246984
246979
|
onAssets: ({ totalAssets, newAssets }) => options?.onSiteProgress?.(`Found ${totalAssets} static assets (${newAssets} new)`)
|
|
246985
246980
|
}
|
|
246986
246981
|
});
|
|
246987
|
-
if (options?.publish === false) {
|
|
246988
|
-
return;
|
|
246989
|
-
}
|
|
246990
246982
|
try {
|
|
246991
246983
|
const { appUrl } = await publishDeployment(gitHash);
|
|
246992
246984
|
return appUrl;
|
|
@@ -252063,7 +252055,6 @@ ${summaryLines.join(`
|
|
|
252063
252055
|
let actorCompleted = 0;
|
|
252064
252056
|
const result = await deployAll(projectData, {
|
|
252065
252057
|
gitHash: options.gitHash,
|
|
252066
|
-
publish: options.publish,
|
|
252067
252058
|
onSiteProgress: (message) => {
|
|
252068
252059
|
log.message(theme.styles.dim(message));
|
|
252069
252060
|
},
|
|
@@ -252102,7 +252093,7 @@ ${summaryLines.join(`
|
|
|
252102
252093
|
return { outroMessage: "App deployed successfully" };
|
|
252103
252094
|
}
|
|
252104
252095
|
function getDeployCommand3() {
|
|
252105
|
-
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, actors, agents, connectors, and site)").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)").
|
|
252096
|
+
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, actors, agents, connectors, and site)").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)").addOption(new Option2("--git-hash <hash>", "Deploy by the commit the build came from, through the deployments API").argParser(parseGitHash)).action(deployAction);
|
|
252106
252097
|
}
|
|
252107
252098
|
async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
|
|
252108
252099
|
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
@@ -264805,7 +264796,13 @@ async function deployToDeploymentsApi(ctx, project, options) {
|
|
|
264805
264796
|
const { runTask, log, jsonMode } = ctx;
|
|
264806
264797
|
const projectRoot = project.root;
|
|
264807
264798
|
const outputDir = siteOutputDir(project);
|
|
264808
|
-
const gitHash =
|
|
264799
|
+
const gitHash = options.gitHash;
|
|
264800
|
+
if (!gitHash) {
|
|
264801
|
+
if (await detectFullStackArtifact(projectRoot)) {
|
|
264802
|
+
throw workerBuildNeedsGitHashError();
|
|
264803
|
+
}
|
|
264804
|
+
return deployArchive(ctx, outputDir);
|
|
264805
|
+
}
|
|
264809
264806
|
const progressLines = [];
|
|
264810
264807
|
const warnings = [];
|
|
264811
264808
|
const { deploymentId } = await runTask("Deploying site...", async (updateMessage) => await deployToDeployments({
|
|
@@ -264839,6 +264836,8 @@ async function deployToDeploymentsApi(ctx, project, options) {
|
|
|
264839
264836
|
const published = options.publish ? await runTask("Publishing site...", async () => await publishDeployment(gitHash), { successMessage: "Site published", errorMessage: "Publish failed" }) : undefined;
|
|
264840
264837
|
if (published) {
|
|
264841
264838
|
log.message(`${theme.styles.header("App URL")}: ${theme.colors.links(published.appUrl)}`);
|
|
264839
|
+
} else {
|
|
264840
|
+
log.info("Not published: production still serves its previous build. Run again with --publish to serve this one.");
|
|
264842
264841
|
}
|
|
264843
264842
|
return {
|
|
264844
264843
|
outroMessage: `Deployment ${deploymentId} (commit ${gitHash.slice(0, 12)})`,
|
|
@@ -264846,12 +264845,23 @@ async function deployToDeploymentsApi(ctx, project, options) {
|
|
|
264846
264845
|
` : undefined
|
|
264847
264846
|
};
|
|
264848
264847
|
}
|
|
264848
|
+
async function deployArchive({ runTask, jsonMode }, outputDir) {
|
|
264849
|
+
const { appUrl } = await runTask("Creating archive and deploying site...", async () => await deploySite(outputDir), {
|
|
264850
|
+
successMessage: "Site deployed successfully",
|
|
264851
|
+
errorMessage: "Deployment failed"
|
|
264852
|
+
});
|
|
264853
|
+
return {
|
|
264854
|
+
outroMessage: `Visit your site at: ${appUrl}`,
|
|
264855
|
+
stdout: jsonMode ? `${JSON.stringify({ appUrl, published: true }, null, 2)}
|
|
264856
|
+
` : undefined
|
|
264857
|
+
};
|
|
264858
|
+
}
|
|
264849
264859
|
function siteOutputDir(project) {
|
|
264850
264860
|
const { outputDirectory = DEFAULT_SITE.outputDirectory } = siteOrDefault(project);
|
|
264851
264861
|
return resolve16(project.root, outputDirectory);
|
|
264852
264862
|
}
|
|
264853
264863
|
function getSiteDeployCommand() {
|
|
264854
|
-
return 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)").option("--publish", "Serve this build in production once it is deployed").addOption(new Option2("--git-hash <hash>", "
|
|
264864
|
+
return 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)").option("--publish", "Serve this build in production once it is deployed").addOption(new Option2("--git-hash <hash>", "Deploy by the commit the build came from, through the deployments API").argParser(parseGitHash)).addOption(new Option2("--concurrency <n>", "Parallel asset uploads").default(DEFAULT_UPLOAD_CONCURRENCY).argParser(parseConcurrency)).action(deployAction2);
|
|
264855
264865
|
}
|
|
264856
264866
|
function parseConcurrency(value) {
|
|
264857
264867
|
const parsed = Number(value);
|
|
@@ -273996,4 +274006,4 @@ export {
|
|
|
273996
274006
|
runCLI
|
|
273997
274007
|
};
|
|
273998
274008
|
|
|
273999
|
-
//# debugId=
|
|
274009
|
+
//# debugId=5C430C51A4BFB55664756E2164756E21
|