@base44-preview/cli 0.1.32-pr.660.402dccb → 0.1.32-pr.661.1ab377a
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/README.md +1 -0
- package/dist/cli/index.js +94 -61
- package/dist/cli/index.js.map +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ The CLI will guide you through project setup. For step-by-step tutorials, see th
|
|
|
70
70
|
| [`sandbox checkpoint`](https://docs.base44.com/developers/references/cli/commands/sandbox-checkpoint) | Save a restore point in the builder's version history; run it after each unit of work, since sandbox writes are committed but not checkpointed and a Restore or Revert in the builder discards everything after the last checkpoint |
|
|
71
71
|
| [`site deploy`](https://docs.base44.com/developers/references/cli/commands/site-deploy) | Deploy built site files to Base44 hosting |
|
|
72
72
|
| [`site open`](https://docs.base44.com/developers/references/cli/commands/site-open) | Open the published site in your browser |
|
|
73
|
+
| `drop [dir]` | Host a folder of static files (index.html at its root) on Base44 as a new app |
|
|
73
74
|
| [`types generate`](https://docs.base44.com/developers/references/cli/commands/types-generate) | Generate TypeScript types from project resources |
|
|
74
75
|
|
|
75
76
|
## Global flags
|
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" ?
|
|
31180
|
+
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join31(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
|
|
31260
|
+
function join31(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:
|
|
31971
|
+
join: join31,
|
|
31972
31972
|
line,
|
|
31973
31973
|
softline,
|
|
31974
31974
|
hardline,
|
|
@@ -124807,7 +124807,7 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124807
124807
|
}
|
|
124808
124808
|
}
|
|
124809
124809
|
}, ast_path_default, is_object_default, skipWhitespace, skipSpaces, skipToLineEnd, skipEverythingButNewLine, isNewlineCharacter = (character) => character === `
|
|
124810
|
-
` || character === "\r" || character === "\u2028" || character === "\u2029", skip_newline_default, has_newline_default, is_non_empty_array_default, get_sorted_child_nodes_default, childNodesCache, returnFalse = () => false, isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text), is_previous_line_empty_default, breakParent2, hardline2, indent2,
|
|
124810
|
+
` || character === "\r" || character === "\u2028" || character === "\u2029", skip_newline_default, has_newline_default, is_non_empty_array_default, get_sorted_child_nodes_default, childNodesCache, returnFalse = () => false, isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text), is_previous_line_empty_default, breakParent2, hardline2, indent2, join33, line22, lineSuffix2, create_print_pre_check_function_default = () => noop_default2, core_options_evaluate_default, arrayToReversed, toReversed, method_to_reversed_default, import_n_readlines, get_interpreter_default, getFileBasename = (file) => {
|
|
124811
124811
|
try {
|
|
124812
124812
|
return path112.basename(toPath3(file));
|
|
124813
124813
|
} catch {
|
|
@@ -134836,7 +134836,7 @@ ${codeblock}`, options8);
|
|
|
134836
134836
|
breakParent: breakParent2,
|
|
134837
134837
|
hardline: hardline2,
|
|
134838
134838
|
indent: indent2,
|
|
134839
|
-
join:
|
|
134839
|
+
join: join33,
|
|
134840
134840
|
line: line22,
|
|
134841
134841
|
lineSuffix: lineSuffix2
|
|
134842
134842
|
} = builders);
|
|
@@ -228838,7 +228838,7 @@ function normalizeBase44Env() {
|
|
|
228838
228838
|
loadProjectEnvFiles();
|
|
228839
228839
|
|
|
228840
228840
|
// src/cli/index.ts
|
|
228841
|
-
import { dirname as dirname29, join as
|
|
228841
|
+
import { dirname as dirname29, join as join41 } from "node:path";
|
|
228842
228842
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
228843
228843
|
|
|
228844
228844
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -240339,6 +240339,21 @@ function buildAssetsConfig(assetsConfig, progress) {
|
|
|
240339
240339
|
run_worker_first: runWorkerFirst
|
|
240340
240340
|
};
|
|
240341
240341
|
}
|
|
240342
|
+
// src/core/site/drop.ts
|
|
240343
|
+
import { basename as basename6, join as join19 } from "node:path";
|
|
240344
|
+
async function requireIndexHtml(siteDir) {
|
|
240345
|
+
if (!await pathExists(join19(siteDir, "index.html"))) {
|
|
240346
|
+
throw new InvalidInputError(`No index.html found in "${siteDir}" — a static site needs one at the folder root.`);
|
|
240347
|
+
}
|
|
240348
|
+
}
|
|
240349
|
+
async function dropSite(siteDir) {
|
|
240350
|
+
await requireIndexHtml(siteDir);
|
|
240351
|
+
const name = basename6(siteDir);
|
|
240352
|
+
const { projectId } = await createProject(name, `Static site '${name}'`);
|
|
240353
|
+
setAppContext({ id: projectId });
|
|
240354
|
+
const { appUrl } = await deploySite(siteDir);
|
|
240355
|
+
return { appId: projectId, appUrl };
|
|
240356
|
+
}
|
|
240342
240357
|
// ../../node_modules/is-plain-obj/index.js
|
|
240343
240358
|
function isPlainObject3(value) {
|
|
240344
240359
|
if (typeof value !== "object" || value === null) {
|
|
@@ -246951,14 +246966,14 @@ async function deployAll(projectData, options) {
|
|
|
246951
246966
|
return { connectorResults };
|
|
246952
246967
|
}
|
|
246953
246968
|
// src/core/project/target.ts
|
|
246954
|
-
import { dirname as dirname13, join as
|
|
246969
|
+
import { dirname as dirname13, join as join20, resolve as resolve6 } from "node:path";
|
|
246955
246970
|
async function resolveBuildTarget(projectRoot, overrides = {}) {
|
|
246956
246971
|
const project = await readSettingsIfPresent(projectRoot);
|
|
246957
246972
|
const root = project?.root ?? projectRoot ?? process.cwd();
|
|
246958
246973
|
const site = project ? siteOrDefault(project) : DEFAULT_SITE;
|
|
246959
246974
|
return {
|
|
246960
246975
|
root,
|
|
246961
|
-
configDir: project ? dirname13(project.configPath) :
|
|
246976
|
+
configDir: project ? dirname13(project.configPath) : join20(root, PROJECT_SUBDIR),
|
|
246962
246977
|
buildCommand: site.buildCommand,
|
|
246963
246978
|
outputDir: resolve6(root, overrides.outputDir ?? site.outputDirectory ?? DEFAULT_SITE.outputDirectory),
|
|
246964
246979
|
entitiesDir: project?.entitiesDir ?? "entities",
|
|
@@ -247820,7 +247835,7 @@ function getActorsCommand() {
|
|
|
247820
247835
|
}
|
|
247821
247836
|
|
|
247822
247837
|
// src/cli/commands/agent-skills/pull.ts
|
|
247823
|
-
import { dirname as dirname14, join as
|
|
247838
|
+
import { dirname as dirname14, join as join21 } from "node:path";
|
|
247824
247839
|
// src/core/utils/dependencies.ts
|
|
247825
247840
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
247826
247841
|
function verifyDenoInstalled(context) {
|
|
@@ -247909,7 +247924,7 @@ async function pullAction({
|
|
|
247909
247924
|
runTask
|
|
247910
247925
|
}) {
|
|
247911
247926
|
const { project } = await readProjectConfig();
|
|
247912
|
-
const dir =
|
|
247927
|
+
const dir = join21(dirname14(project.configPath), project.agentSkillsDir);
|
|
247913
247928
|
const remote = await runTask("Fetching agent skills from Base44", () => fetchAgentSkills(), {
|
|
247914
247929
|
successMessage: "Agent skills fetched successfully",
|
|
247915
247930
|
errorMessage: "Failed to fetch agent skills"
|
|
@@ -247965,14 +247980,14 @@ function getAgentSkillsCommand() {
|
|
|
247965
247980
|
}
|
|
247966
247981
|
|
|
247967
247982
|
// src/cli/commands/agents/pull.ts
|
|
247968
|
-
import { dirname as dirname15, join as
|
|
247983
|
+
import { dirname as dirname15, join as join22 } from "node:path";
|
|
247969
247984
|
async function pullAgentsAction({
|
|
247970
247985
|
log,
|
|
247971
247986
|
runTask
|
|
247972
247987
|
}) {
|
|
247973
247988
|
const { project } = await readProjectConfig();
|
|
247974
247989
|
const configDir = dirname15(project.configPath);
|
|
247975
|
-
const agentsDir =
|
|
247990
|
+
const agentsDir = join22(configDir, project.agentsDir);
|
|
247976
247991
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
247977
247992
|
return await fetchAgents();
|
|
247978
247993
|
}, {
|
|
@@ -248042,12 +248057,12 @@ function getAgentsCommand() {
|
|
|
248042
248057
|
}
|
|
248043
248058
|
|
|
248044
248059
|
// src/cli/commands/auth/password-login.ts
|
|
248045
|
-
import { dirname as dirname16, join as
|
|
248060
|
+
import { dirname as dirname16, join as join23 } from "node:path";
|
|
248046
248061
|
async function passwordLoginAction({ log, runTask }, action) {
|
|
248047
248062
|
const shouldEnable = action === "enable";
|
|
248048
248063
|
const { project } = await readProjectConfig();
|
|
248049
248064
|
const configDir = dirname16(project.configPath);
|
|
248050
|
-
const authDir =
|
|
248065
|
+
const authDir = join23(configDir, project.authDir);
|
|
248051
248066
|
const updated = await runTask("Updating local auth config", async () => {
|
|
248052
248067
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
248053
248068
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -248067,14 +248082,14 @@ function getPasswordLoginCommand() {
|
|
|
248067
248082
|
}
|
|
248068
248083
|
|
|
248069
248084
|
// src/cli/commands/auth/pull.ts
|
|
248070
|
-
import { dirname as dirname17, join as
|
|
248085
|
+
import { dirname as dirname17, join as join24 } from "node:path";
|
|
248071
248086
|
async function pullAuthAction({
|
|
248072
248087
|
log,
|
|
248073
248088
|
runTask
|
|
248074
248089
|
}) {
|
|
248075
248090
|
const { project } = await readProjectConfig();
|
|
248076
248091
|
const configDir = dirname17(project.configPath);
|
|
248077
|
-
const authDir =
|
|
248092
|
+
const authDir = join24(configDir, project.authDir);
|
|
248078
248093
|
const remoteConfig = await runTask("Fetching auth config from Base44", async () => {
|
|
248079
248094
|
return await pullAuthConfig();
|
|
248080
248095
|
}, {
|
|
@@ -248138,7 +248153,7 @@ function getAuthPushCommand() {
|
|
|
248138
248153
|
}
|
|
248139
248154
|
|
|
248140
248155
|
// src/cli/commands/auth/social-login.ts
|
|
248141
|
-
import { dirname as dirname18, join as
|
|
248156
|
+
import { dirname as dirname18, join as join25, resolve as resolve7 } from "node:path";
|
|
248142
248157
|
var PROVIDER_LABELS = {
|
|
248143
248158
|
google: "Google",
|
|
248144
248159
|
microsoft: "Microsoft",
|
|
@@ -248209,7 +248224,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask }, provider, a
|
|
|
248209
248224
|
}
|
|
248210
248225
|
const { project } = await readProjectConfig();
|
|
248211
248226
|
const configDir = dirname18(project.configPath);
|
|
248212
|
-
const authDir =
|
|
248227
|
+
const authDir = join25(configDir, project.authDir);
|
|
248213
248228
|
const { config: updated } = await runTask("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
248214
248229
|
if (clientSecret) {
|
|
248215
248230
|
await runTask("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -248234,7 +248249,7 @@ function getSocialLoginCommand() {
|
|
|
248234
248249
|
}
|
|
248235
248250
|
|
|
248236
248251
|
// src/cli/commands/auth/sso.ts
|
|
248237
|
-
import { dirname as dirname19, join as
|
|
248252
|
+
import { dirname as dirname19, join as join26, resolve as resolve8 } from "node:path";
|
|
248238
248253
|
var SSOConfigFileSchema = object({
|
|
248239
248254
|
provider: _enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
248240
248255
|
clientId: string2(),
|
|
@@ -248398,7 +248413,7 @@ async function ssoEnableAction({ isNonInteractive, runTask }, options) {
|
|
|
248398
248413
|
}
|
|
248399
248414
|
const { project } = await readProjectConfig();
|
|
248400
248415
|
const configDir = dirname19(project.configPath);
|
|
248401
|
-
const authDir =
|
|
248416
|
+
const authDir = join26(configDir, project.authDir);
|
|
248402
248417
|
await runTask("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
248403
248418
|
await runTask("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
248404
248419
|
return {
|
|
@@ -248414,7 +248429,7 @@ async function ssoDisableAction({ log, runTask }, options) {
|
|
|
248414
248429
|
}
|
|
248415
248430
|
const { project } = await readProjectConfig();
|
|
248416
248431
|
const configDir = dirname19(project.configPath);
|
|
248417
|
-
const authDir =
|
|
248432
|
+
const authDir = join26(configDir, project.authDir);
|
|
248418
248433
|
const updated = await runTask("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
248419
248434
|
await runTask("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
248420
248435
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -249296,13 +249311,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
249296
249311
|
}
|
|
249297
249312
|
|
|
249298
249313
|
// src/cli/commands/connectors/pull.ts
|
|
249299
|
-
import { dirname as dirname20, join as
|
|
249314
|
+
import { dirname as dirname20, join as join27, resolve as resolve9 } from "node:path";
|
|
249300
249315
|
async function resolveConnectorsDir(options) {
|
|
249301
249316
|
if (!getAppContext().projectRoot) {
|
|
249302
249317
|
return resolve9(options.dir ?? "connectors");
|
|
249303
249318
|
}
|
|
249304
249319
|
const { project } = await readProjectConfig();
|
|
249305
|
-
return
|
|
249320
|
+
return join27(dirname20(project.configPath), project.connectorsDir);
|
|
249306
249321
|
}
|
|
249307
249322
|
async function pullConnectorsAction({ log, runTask, jsonMode }, options) {
|
|
249308
249323
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -249482,6 +249497,23 @@ function getDashboardCommand() {
|
|
|
249482
249497
|
return new Command2("dashboard").description("Manage app dashboard").addCommand(getDashboardOpenCommand());
|
|
249483
249498
|
}
|
|
249484
249499
|
|
|
249500
|
+
// src/cli/commands/drop.ts
|
|
249501
|
+
import { resolve as resolve11 } from "node:path";
|
|
249502
|
+
async function dropAction({ runTask, jsonMode }, dir) {
|
|
249503
|
+
const { appId, appUrl } = await runTask("Creating app and deploying site...", async () => await dropSite(resolve11(dir)), {
|
|
249504
|
+
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
249505
|
+
errorMessage: "Drop failed"
|
|
249506
|
+
});
|
|
249507
|
+
return {
|
|
249508
|
+
outroMessage: `Visit your site at: ${theme.colors.links(appUrl)}`,
|
|
249509
|
+
stdout: jsonMode ? `${JSON.stringify({ appId, appUrl }, null, 2)}
|
|
249510
|
+
` : undefined
|
|
249511
|
+
};
|
|
249512
|
+
}
|
|
249513
|
+
function getDropCommand() {
|
|
249514
|
+
return new Base44Command("drop", { requireAppContext: false }).description("Host a folder of static files (index.html at its root) on Base44 as a new app").argument("[dir]", "Folder to deploy", ".").action(dropAction);
|
|
249515
|
+
}
|
|
249516
|
+
|
|
249485
249517
|
// src/cli/commands/entities/push.ts
|
|
249486
249518
|
async function pushEntitiesAction({ isNonInteractive, log, runTask }, options) {
|
|
249487
249519
|
const { entities } = await readProjectConfig();
|
|
@@ -249689,11 +249721,11 @@ function getListCommand() {
|
|
|
249689
249721
|
}
|
|
249690
249722
|
|
|
249691
249723
|
// src/cli/commands/functions/pull.ts
|
|
249692
|
-
import { dirname as dirname21, join as
|
|
249724
|
+
import { dirname as dirname21, join as join28 } from "node:path";
|
|
249693
249725
|
async function pullFunctionsAction({ log, runTask }, name) {
|
|
249694
249726
|
const { project, functions } = await readProjectConfig();
|
|
249695
249727
|
const configDir = dirname21(project.configPath);
|
|
249696
|
-
const functionsDir =
|
|
249728
|
+
const functionsDir = join28(configDir, project.functionsDir);
|
|
249697
249729
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
249698
249730
|
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
249699
249731
|
const { functions } = await listDeployedFunctions();
|
|
@@ -249803,11 +249835,11 @@ function getBuildCommand() {
|
|
|
249803
249835
|
}
|
|
249804
249836
|
|
|
249805
249837
|
// src/cli/commands/project/create.ts
|
|
249806
|
-
import { basename as
|
|
249838
|
+
import { basename as basename7, resolve as resolve12 } from "node:path";
|
|
249807
249839
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
249808
249840
|
|
|
249809
249841
|
// src/cli/commands/project/scaffold-shared.ts
|
|
249810
|
-
import { join as
|
|
249842
|
+
import { join as join29 } from "node:path";
|
|
249811
249843
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
249812
249844
|
async function getTemplateById(templateId) {
|
|
249813
249845
|
const templates = await listTemplates();
|
|
@@ -249870,7 +249902,7 @@ async function completeProjectSetup({
|
|
|
249870
249902
|
env: { VITE_BASE44_APP_ID: projectId }
|
|
249871
249903
|
})`${buildCommand}`;
|
|
249872
249904
|
updateMessage("Deploying site...");
|
|
249873
|
-
return await deploySite(
|
|
249905
|
+
return await deploySite(join29(resolvedPath, outputDirectory));
|
|
249874
249906
|
}, {
|
|
249875
249907
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
249876
249908
|
errorMessage: "Failed to deploy site"
|
|
@@ -249968,8 +250000,8 @@ async function createInteractive(options, ctx) {
|
|
|
249968
250000
|
name: () => {
|
|
249969
250001
|
return options.name ? Promise.resolve(options.name) : Ze({
|
|
249970
250002
|
message: "What is the name of your project?",
|
|
249971
|
-
placeholder:
|
|
249972
|
-
initialValue:
|
|
250003
|
+
placeholder: basename7(process.cwd()),
|
|
250004
|
+
initialValue: basename7(process.cwd()),
|
|
249973
250005
|
validate: (value) => {
|
|
249974
250006
|
if (!value || value.trim().length === 0) {
|
|
249975
250007
|
return "Every project deserves a name";
|
|
@@ -249999,7 +250031,7 @@ async function createInteractive(options, ctx) {
|
|
|
249999
250031
|
}, ctx);
|
|
250000
250032
|
}
|
|
250001
250033
|
async function createNonInteractive(options, ctx) {
|
|
250002
|
-
ctx.log.info(`Creating a new project at ${
|
|
250034
|
+
ctx.log.info(`Creating a new project at ${resolve12(options.path)}`);
|
|
250003
250035
|
const template = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
250004
250036
|
return await executeCreate({
|
|
250005
250037
|
template,
|
|
@@ -250023,7 +250055,7 @@ async function executeCreate({
|
|
|
250023
250055
|
}, ctx) {
|
|
250024
250056
|
const { log, runTask } = ctx;
|
|
250025
250057
|
const name = rawName.trim();
|
|
250026
|
-
const resolvedPath =
|
|
250058
|
+
const resolvedPath = resolve12(projectPath);
|
|
250027
250059
|
const organizationId = await resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive);
|
|
250028
250060
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
250029
250061
|
return await createProjectFiles({
|
|
@@ -250664,7 +250696,7 @@ function getLogsCommand() {
|
|
|
250664
250696
|
}
|
|
250665
250697
|
|
|
250666
250698
|
// src/cli/commands/project/scaffold.ts
|
|
250667
|
-
import { basename as
|
|
250699
|
+
import { basename as basename8, resolve as resolve13 } from "node:path";
|
|
250668
250700
|
function resolveAppId(options) {
|
|
250669
250701
|
const appId = options.appId;
|
|
250670
250702
|
if (!appId) {
|
|
@@ -250680,8 +250712,8 @@ function resolveAppId(options) {
|
|
|
250680
250712
|
async function scaffoldAction(ctx, name, options, command) {
|
|
250681
250713
|
const { log, runTask } = ctx;
|
|
250682
250714
|
const appId = resolveAppId(command.optsWithGlobals());
|
|
250683
|
-
const resolvedPath =
|
|
250684
|
-
const projectName = (name ??
|
|
250715
|
+
const resolvedPath = resolve13("./");
|
|
250716
|
+
const projectName = (name ?? basename8(resolvedPath)).trim();
|
|
250685
250717
|
const template = await getTemplateById("backend-only");
|
|
250686
250718
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
250687
250719
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
@@ -250886,7 +250918,7 @@ async function setEnvironmentVersion(environment, versionId, options = {}) {
|
|
|
250886
250918
|
}
|
|
250887
250919
|
// src/core/version/artifacts.ts
|
|
250888
250920
|
import { createHash as createHash3 } from "node:crypto";
|
|
250889
|
-
import { join as
|
|
250921
|
+
import { join as join30, resolve as resolve14 } from "node:path";
|
|
250890
250922
|
|
|
250891
250923
|
// src/core/version/functions.ts
|
|
250892
250924
|
import { createHash as createHash2 } from "node:crypto";
|
|
@@ -261607,7 +261639,7 @@ async function collectBuildOutput(outputDir, options = {}) {
|
|
|
261607
261639
|
}
|
|
261608
261640
|
async function describeSiteWorker(built) {
|
|
261609
261641
|
const { config, modules } = built;
|
|
261610
|
-
const entry =
|
|
261642
|
+
const entry = resolve14(config.configDir, config.main);
|
|
261611
261643
|
const main = modules.find((m) => m.absolutePath === entry)?.name;
|
|
261612
261644
|
if (!main) {
|
|
261613
261645
|
throw new InvalidInputError(`The Worker's entry module ${config.main} is not among the ${modules.length} modules collected from ${config.configDir}.`);
|
|
@@ -261638,14 +261670,14 @@ async function readRawResources(dir) {
|
|
|
261638
261670
|
const payloads = {};
|
|
261639
261671
|
for (const relativePath of files.sort()) {
|
|
261640
261672
|
const name = relativePath.replace(/\.jsonc?$/, "");
|
|
261641
|
-
payloads[name] = await readJsonFile(
|
|
261673
|
+
payloads[name] = await readJsonFile(join30(dir, ...relativePath.split("/")));
|
|
261642
261674
|
}
|
|
261643
261675
|
return payloads;
|
|
261644
261676
|
}
|
|
261645
261677
|
async function collectResources(configDir, dirs) {
|
|
261646
261678
|
const [entities, agents] = await Promise.all([
|
|
261647
|
-
readRawResources(
|
|
261648
|
-
readRawResources(
|
|
261679
|
+
readRawResources(join30(configDir, dirs.entitiesDir)),
|
|
261680
|
+
readRawResources(join30(configDir, dirs.agentsDir))
|
|
261649
261681
|
]);
|
|
261650
261682
|
return { entities, agents };
|
|
261651
261683
|
}
|
|
@@ -261657,7 +261689,7 @@ async function collectArtifacts(target) {
|
|
|
261657
261689
|
entryFile: ENTRY2
|
|
261658
261690
|
}),
|
|
261659
261691
|
...siteWorker ? { siteWorker } : {},
|
|
261660
|
-
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root,
|
|
261692
|
+
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root, join30(target.configDir, target.functionsDir))),
|
|
261661
261693
|
...await collectResources(target.configDir, target)
|
|
261662
261694
|
};
|
|
261663
261695
|
}
|
|
@@ -262115,7 +262147,7 @@ function getSecretsListCommand() {
|
|
|
262115
262147
|
}
|
|
262116
262148
|
|
|
262117
262149
|
// src/cli/commands/secrets/set.ts
|
|
262118
|
-
import { resolve as
|
|
262150
|
+
import { resolve as resolve15 } from "node:path";
|
|
262119
262151
|
function parseEntries(entries) {
|
|
262120
262152
|
const secrets = {};
|
|
262121
262153
|
for (const entry of entries) {
|
|
@@ -262146,7 +262178,7 @@ async function setSecretsAction({ log, runTask }, entries, options) {
|
|
|
262146
262178
|
validateInput(entries, options);
|
|
262147
262179
|
let secrets;
|
|
262148
262180
|
if (options.envFile) {
|
|
262149
|
-
secrets = await parseEnvFile(
|
|
262181
|
+
secrets = await parseEnvFile(resolve15(options.envFile));
|
|
262150
262182
|
if (Object.keys(secrets).length === 0) {
|
|
262151
262183
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
262152
262184
|
}
|
|
@@ -262175,7 +262207,7 @@ function getSecretsCommand() {
|
|
|
262175
262207
|
}
|
|
262176
262208
|
|
|
262177
262209
|
// src/cli/commands/site/deploy.ts
|
|
262178
|
-
import { resolve as
|
|
262210
|
+
import { resolve as resolve16 } from "node:path";
|
|
262179
262211
|
async function deployAction2(ctx, options) {
|
|
262180
262212
|
const { isNonInteractive } = ctx;
|
|
262181
262213
|
if (isNonInteractive && !options.yes) {
|
|
@@ -262244,7 +262276,7 @@ async function deployTarball({ runTask }, project) {
|
|
|
262244
262276
|
}
|
|
262245
262277
|
function siteOutputDir(project) {
|
|
262246
262278
|
const { outputDirectory = DEFAULT_SITE.outputDirectory } = siteOrDefault(project);
|
|
262247
|
-
return
|
|
262279
|
+
return resolve16(project.root, outputDirectory);
|
|
262248
262280
|
}
|
|
262249
262281
|
function getSiteDeployCommand() {
|
|
262250
262282
|
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)");
|
|
@@ -262588,10 +262620,10 @@ function toPascalCase(name) {
|
|
|
262588
262620
|
return name.split(/[-_\s]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
|
|
262589
262621
|
}
|
|
262590
262622
|
// src/core/types/update-project.ts
|
|
262591
|
-
import { join as
|
|
262623
|
+
import { join as join34 } from "node:path";
|
|
262592
262624
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
262593
262625
|
async function updateProjectConfig(projectRoot) {
|
|
262594
|
-
const tsconfigPath =
|
|
262626
|
+
const tsconfigPath = join34(projectRoot, "tsconfig.json");
|
|
262595
262627
|
if (!await pathExists(tsconfigPath)) {
|
|
262596
262628
|
return false;
|
|
262597
262629
|
}
|
|
@@ -263072,7 +263104,7 @@ function getWorkspaceCommand() {
|
|
|
263072
263104
|
// src/cli/dev/dev-server/main.ts
|
|
263073
263105
|
var import_cors = __toESM(require_lib4(), 1);
|
|
263074
263106
|
var import_express6 = __toESM(require_express(), 1);
|
|
263075
|
-
import { dirname as dirname27, join as
|
|
263107
|
+
import { dirname as dirname27, join as join39 } from "node:path";
|
|
263076
263108
|
|
|
263077
263109
|
// ../../node_modules/get-port/index.js
|
|
263078
263110
|
import net from "node:net";
|
|
@@ -263202,7 +263234,7 @@ var $tmpName = promisify12(tmp.tmpName);
|
|
|
263202
263234
|
|
|
263203
263235
|
// src/cli/dev/dev-server/function-manager.ts
|
|
263204
263236
|
import { spawn as spawn3 } from "node:child_process";
|
|
263205
|
-
import { dirname as dirname24, join as
|
|
263237
|
+
import { dirname as dirname24, join as join35 } from "node:path";
|
|
263206
263238
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
263207
263239
|
|
|
263208
263240
|
// src/cli/dev/dev-server/base-function-manager.ts
|
|
@@ -263307,7 +263339,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
263307
263339
|
}
|
|
263308
263340
|
spawnFunction(func, port) {
|
|
263309
263341
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
263310
|
-
const importMapPath =
|
|
263342
|
+
const importMapPath = join35(dirname24(this.wrapperPath), "import-map.json");
|
|
263311
263343
|
const process2 = spawn3("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
263312
263344
|
env: {
|
|
263313
263345
|
...globalThis.process.env,
|
|
@@ -263381,7 +263413,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
263381
263413
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
263382
263414
|
import { isBuiltin as isBuiltin3 } from "node:module";
|
|
263383
263415
|
import { homedir as homedir4 } from "node:os";
|
|
263384
|
-
import { join as
|
|
263416
|
+
import { join as join36 } from "node:path";
|
|
263385
263417
|
import { pathToFileURL as pathToFileURL7 } from "node:url";
|
|
263386
263418
|
var depsPromise;
|
|
263387
263419
|
function loadDeps() {
|
|
@@ -263502,9 +263534,9 @@ export default {
|
|
|
263502
263534
|
};
|
|
263503
263535
|
`;
|
|
263504
263536
|
function ensureBundlerConfig() {
|
|
263505
|
-
const dir =
|
|
263537
|
+
const dir = join36(homedir4(), ".base44", "function-bundler");
|
|
263506
263538
|
mkdirSync2(dir, { recursive: true });
|
|
263507
|
-
const configPath =
|
|
263539
|
+
const configPath = join36(dir, "deno.json");
|
|
263508
263540
|
writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
|
|
263509
263541
|
`);
|
|
263510
263542
|
return configPath;
|
|
@@ -266833,8 +266865,8 @@ async function createDevServer(options) {
|
|
|
266833
266865
|
broadcastEntityEvent(io, appId, entityName, event);
|
|
266834
266866
|
};
|
|
266835
266867
|
const base44ConfigWatcher = new WatchBase44({
|
|
266836
|
-
functions:
|
|
266837
|
-
entities:
|
|
266868
|
+
functions: join39(dirname27(project.configPath), project.functionsDir),
|
|
266869
|
+
entities: join39(dirname27(project.configPath), project.entitiesDir)
|
|
266838
266870
|
}, devLogger);
|
|
266839
266871
|
base44ConfigWatcher.on("change", async (name) => {
|
|
266840
266872
|
try {
|
|
@@ -267037,7 +267069,7 @@ function readExecEnvTarget(env = process.env) {
|
|
|
267037
267069
|
// src/core/exec/run-script.ts
|
|
267038
267070
|
import { spawn as spawn4 } from "node:child_process";
|
|
267039
267071
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
267040
|
-
import { join as
|
|
267072
|
+
import { join as join40 } from "node:path";
|
|
267041
267073
|
var SDK_SPECIFIER = '"npm:@base44/sdk"';
|
|
267042
267074
|
function wrapperSource(sdkVersion) {
|
|
267043
267075
|
const source = readFileSync4(getExecWrapperPath(), "utf-8");
|
|
@@ -267073,7 +267105,7 @@ async function runScript(options) {
|
|
|
267073
267105
|
writeFileSync3(tempWrapper.path, wrapperSource(sdkVersion), "utf-8");
|
|
267074
267106
|
const configDir = await $dir({ unsafeCleanup: true });
|
|
267075
267107
|
cleanupFns.push(configDir.cleanup);
|
|
267076
|
-
const configPath =
|
|
267108
|
+
const configPath = join40(configDir.path, "deno.json");
|
|
267077
267109
|
writeFileSync3(configPath, JSON.stringify(DENO_CONFIG), "utf-8");
|
|
267078
267110
|
try {
|
|
267079
267111
|
const exitCode = await new Promise((resolvePromise) => {
|
|
@@ -267194,7 +267226,7 @@ Examples:
|
|
|
267194
267226
|
}
|
|
267195
267227
|
|
|
267196
267228
|
// src/cli/commands/project/eject.ts
|
|
267197
|
-
import { resolve as
|
|
267229
|
+
import { resolve as resolve20 } from "node:path";
|
|
267198
267230
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
267199
267231
|
async function eject(ctx, options, command) {
|
|
267200
267232
|
const { log, runTask, isNonInteractive } = ctx;
|
|
@@ -267258,7 +267290,7 @@ async function eject(ctx, options, command) {
|
|
|
267258
267290
|
Ne("Operation cancelled.");
|
|
267259
267291
|
throw new CLIExitError(0);
|
|
267260
267292
|
}
|
|
267261
|
-
const resolvedPath =
|
|
267293
|
+
const resolvedPath = resolve20(selectedPath);
|
|
267262
267294
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
267263
267295
|
await createProjectFilesForExistingProject({
|
|
267264
267296
|
projectId,
|
|
@@ -267331,6 +267363,7 @@ function createProgram(context) {
|
|
|
267331
267363
|
program.addCommand(getDashboardCommand());
|
|
267332
267364
|
program.addCommand(getBuildCommand());
|
|
267333
267365
|
program.addCommand(getDeployCommand3());
|
|
267366
|
+
program.addCommand(getDropCommand());
|
|
267334
267367
|
program.addCommand(getVisibilityCommand());
|
|
267335
267368
|
program.addCommand(getLinkCommand());
|
|
267336
267369
|
program.addCommand(getEjectCommand());
|
|
@@ -271363,7 +271396,7 @@ function addCommandInfoToErrorReporter(program, errorReporter) {
|
|
|
271363
271396
|
// src/cli/index.ts
|
|
271364
271397
|
var __dirname4 = dirname29(fileURLToPath7(import.meta.url));
|
|
271365
271398
|
async function runCLI(options) {
|
|
271366
|
-
ensureNpmAssets(
|
|
271399
|
+
ensureNpmAssets(join41(__dirname4, "../assets"));
|
|
271367
271400
|
const errorReporter = new ErrorReporter;
|
|
271368
271401
|
errorReporter.registerProcessErrorHandlers();
|
|
271369
271402
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -271402,4 +271435,4 @@ export {
|
|
|
271402
271435
|
runCLI
|
|
271403
271436
|
};
|
|
271404
271437
|
|
|
271405
|
-
//# debugId=
|
|
271438
|
+
//# debugId=274F425C0531293164756E2164756E21
|