@base44-preview/cli 0.1.25-pr.647.62db7ea → 0.1.25-pr.649.7ebc862
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 +152 -103
- package/dist/cli/index.js.map +14 -13
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -236708,8 +236708,70 @@ async function getSiteUrl() {
|
|
|
236708
236708
|
return result.data.url;
|
|
236709
236709
|
}
|
|
236710
236710
|
// src/core/project/config.ts
|
|
236711
|
+
import { existsSync } from "node:fs";
|
|
236711
236712
|
import { dirname as dirname10, join as join12 } from "node:path";
|
|
236712
236713
|
|
|
236714
|
+
// src/core/project/fallback.ts
|
|
236715
|
+
var DEFAULT_SITE = {
|
|
236716
|
+
installCommand: "npm install",
|
|
236717
|
+
buildCommand: "npm run build",
|
|
236718
|
+
serveCommand: "npm run dev",
|
|
236719
|
+
outputDirectory: "./dist"
|
|
236720
|
+
};
|
|
236721
|
+
var PLACEHOLDER_APP_NAME = "base44-app";
|
|
236722
|
+
var warningHandler = () => {};
|
|
236723
|
+
var warned = new Set;
|
|
236724
|
+
function setConfigWarningHandler(handler) {
|
|
236725
|
+
warningHandler = handler;
|
|
236726
|
+
}
|
|
236727
|
+
function warnConfigFallback(message) {
|
|
236728
|
+
if (warned.has(message)) {
|
|
236729
|
+
return;
|
|
236730
|
+
}
|
|
236731
|
+
warned.add(message);
|
|
236732
|
+
warningHandler(message);
|
|
236733
|
+
}
|
|
236734
|
+
function defaultProjectConfig() {
|
|
236735
|
+
return ProjectConfigSchema.parse({
|
|
236736
|
+
name: PLACEHOLDER_APP_NAME,
|
|
236737
|
+
site: DEFAULT_SITE
|
|
236738
|
+
});
|
|
236739
|
+
}
|
|
236740
|
+
function salvageProjectConfig(raw, error) {
|
|
236741
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
236742
|
+
return defaultProjectConfig();
|
|
236743
|
+
}
|
|
236744
|
+
const fixed = { ...raw };
|
|
236745
|
+
for (const issue of error.issues) {
|
|
236746
|
+
if (issue.path.length === 0) {
|
|
236747
|
+
return defaultProjectConfig();
|
|
236748
|
+
}
|
|
236749
|
+
const [key, field] = issue.path.map(String);
|
|
236750
|
+
if (key === "name") {
|
|
236751
|
+
fixed.name = PLACEHOLDER_APP_NAME;
|
|
236752
|
+
} else if (key === "site") {
|
|
236753
|
+
fixed.site = field !== undefined && isPlainObject2(fixed.site) ? withoutKey(fixed.site, field) : DEFAULT_SITE;
|
|
236754
|
+
} else {
|
|
236755
|
+
fixed[key] = undefined;
|
|
236756
|
+
}
|
|
236757
|
+
}
|
|
236758
|
+
const result = ProjectConfigSchema.safeParse(fixed);
|
|
236759
|
+
return result.success ? result.data : defaultProjectConfig();
|
|
236760
|
+
}
|
|
236761
|
+
function siteOrDefault(project) {
|
|
236762
|
+
if (project.site) {
|
|
236763
|
+
return project.site;
|
|
236764
|
+
}
|
|
236765
|
+
warnConfigFallback(`${project.configPath} has no 'site' block; using the default site commands.`);
|
|
236766
|
+
return DEFAULT_SITE;
|
|
236767
|
+
}
|
|
236768
|
+
function withoutKey(record, key) {
|
|
236769
|
+
return Object.fromEntries(Object.entries(record).filter(([k]) => k !== key));
|
|
236770
|
+
}
|
|
236771
|
+
function isPlainObject2(value) {
|
|
236772
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
236773
|
+
}
|
|
236774
|
+
|
|
236713
236775
|
// src/core/project/plugins.ts
|
|
236714
236776
|
import { createRequire as createRequire2 } from "node:module";
|
|
236715
236777
|
import { dirname as dirname5, isAbsolute as isAbsolute2, join as join4, resolve } from "node:path";
|
|
@@ -238341,7 +238403,7 @@ var FieldRLSSchema = looseObject({
|
|
|
238341
238403
|
delete: RLSRuleSchema.optional()
|
|
238342
238404
|
});
|
|
238343
238405
|
var PropertyDefinitionSchema = looseObject({
|
|
238344
|
-
type: union([string2(), array(string2())])
|
|
238406
|
+
type: union([string2(), array(string2())]),
|
|
238345
238407
|
title: string2().optional(),
|
|
238346
238408
|
description: string2().optional(),
|
|
238347
238409
|
minLength: number2().int().min(0).optional(),
|
|
@@ -238363,13 +238425,12 @@ var PropertyDefinitionSchema = looseObject({
|
|
|
238363
238425
|
return record(string2(), PropertyDefinitionSchema).optional();
|
|
238364
238426
|
}
|
|
238365
238427
|
});
|
|
238366
|
-
var TopLevelPropertySchema = PropertyDefinitionSchema.refine((property) => property.type !== undefined, { message: "Top-level properties must declare a type", path: ["type"] });
|
|
238367
238428
|
var EntitySchema = looseObject({
|
|
238368
238429
|
type: literal("object").default("object"),
|
|
238369
238430
|
name: string2().min(1).regex(/^\w+$/, "Entity name must contain only letters, numbers, and underscores"),
|
|
238370
238431
|
title: string2().optional(),
|
|
238371
238432
|
description: string2().optional(),
|
|
238372
|
-
properties: record(string2(),
|
|
238433
|
+
properties: record(string2(), PropertyDefinitionSchema).default({}),
|
|
238373
238434
|
required: array(string2()).optional(),
|
|
238374
238435
|
rls: EntityRLSSchema.optional(),
|
|
238375
238436
|
source: ResourceSourceSchema.default({ type: "project" })
|
|
@@ -239069,10 +239130,17 @@ async function openLogStream(filters) {
|
|
|
239069
239130
|
class ProjectConfigReader {
|
|
239070
239131
|
pluginSourceByNamespace = new Map;
|
|
239071
239132
|
async readProjectSettings(projectRoot) {
|
|
239072
|
-
const
|
|
239073
|
-
|
|
239074
|
-
|
|
239075
|
-
|
|
239133
|
+
const found = this.findConfig(projectRoot);
|
|
239134
|
+
if (!found) {
|
|
239135
|
+
return this.defaultSettingsOrThrow(projectRoot);
|
|
239136
|
+
}
|
|
239137
|
+
const { root, configPath } = found;
|
|
239138
|
+
const project = await this.readConfigFileOrDefaults(configPath);
|
|
239139
|
+
return {
|
|
239140
|
+
...this.withoutPluginsInPluginProject(project, configPath),
|
|
239141
|
+
root,
|
|
239142
|
+
configPath
|
|
239143
|
+
};
|
|
239076
239144
|
}
|
|
239077
239145
|
async readProjectConfig(projectRoot) {
|
|
239078
239146
|
const project = await this.readProjectSettings(projectRoot);
|
|
@@ -239102,26 +239170,37 @@ class ProjectConfigReader {
|
|
|
239102
239170
|
authConfig: localResources.authConfig
|
|
239103
239171
|
};
|
|
239104
239172
|
}
|
|
239105
|
-
|
|
239106
|
-
|
|
239107
|
-
|
|
239108
|
-
const configPath = findConfigInDir(projectRoot);
|
|
239109
|
-
found = configPath ? { root: projectRoot, configPath } : null;
|
|
239110
|
-
} else {
|
|
239111
|
-
found = findProjectRoot();
|
|
239173
|
+
findConfig(projectRoot) {
|
|
239174
|
+
if (!projectRoot) {
|
|
239175
|
+
return findProjectRoot();
|
|
239112
239176
|
}
|
|
239113
|
-
|
|
239177
|
+
const configPath = findConfigInDir(projectRoot);
|
|
239178
|
+
return configPath ? { root: projectRoot, configPath } : null;
|
|
239179
|
+
}
|
|
239180
|
+
defaultSettingsOrThrow(projectRoot) {
|
|
239181
|
+
const root = projectRoot ?? process.cwd();
|
|
239182
|
+
if (!existsSync(join12(root, "package.json"))) {
|
|
239114
239183
|
throw new ConfigNotFoundError(`Project root not found. Please ensure config.jsonc or config.json exists in the project directory or ${PROJECT_SUBDIR}/ subdirectory.`);
|
|
239115
239184
|
}
|
|
239116
|
-
|
|
239185
|
+
const configPath = join12(root, PROJECT_SUBDIR, "config.jsonc");
|
|
239186
|
+
warnConfigFallback(`No ${PROJECT_SUBDIR}/config.jsonc found in ${root}; using the default project config.`);
|
|
239187
|
+
return { ...defaultProjectConfig(), root, configPath };
|
|
239117
239188
|
}
|
|
239118
|
-
async
|
|
239119
|
-
|
|
239189
|
+
async readConfigFileOrDefaults(configPath) {
|
|
239190
|
+
let parsed;
|
|
239191
|
+
try {
|
|
239192
|
+
parsed = await readJsonFile(configPath);
|
|
239193
|
+
} catch (error) {
|
|
239194
|
+
warnConfigFallback(`${configPath} could not be read (${errorMessage(error)}); using the default project config.`);
|
|
239195
|
+
return defaultProjectConfig();
|
|
239196
|
+
}
|
|
239120
239197
|
const result = ProjectConfigSchema.safeParse(parsed);
|
|
239121
|
-
if (
|
|
239122
|
-
|
|
239198
|
+
if (result.success) {
|
|
239199
|
+
return result.data;
|
|
239123
239200
|
}
|
|
239124
|
-
|
|
239201
|
+
warnConfigFallback(`Invalid project configuration in ${configPath}; using defaults for the invalid fields:
|
|
239202
|
+
${prettifyError(result.error)}`);
|
|
239203
|
+
return salvageProjectConfig(parsed, result.error);
|
|
239125
239204
|
}
|
|
239126
239205
|
async readProjectResources(configPath, project, includeActors = true) {
|
|
239127
239206
|
const configDir = dirname10(configPath);
|
|
@@ -239152,10 +239231,19 @@ class ProjectConfigReader {
|
|
|
239152
239231
|
authConfig
|
|
239153
239232
|
};
|
|
239154
239233
|
}
|
|
239155
|
-
|
|
239156
|
-
|
|
239157
|
-
|
|
239234
|
+
async readPluginConfigFile(configPath) {
|
|
239235
|
+
const result = ProjectConfigSchema.safeParse(await readJsonFile(configPath));
|
|
239236
|
+
if (!result.success) {
|
|
239237
|
+
throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
|
|
239158
239238
|
}
|
|
239239
|
+
return result.data;
|
|
239240
|
+
}
|
|
239241
|
+
withoutPluginsInPluginProject(project, configPath) {
|
|
239242
|
+
if (!project.plugin || project.plugins.length === 0) {
|
|
239243
|
+
return project;
|
|
239244
|
+
}
|
|
239245
|
+
warnConfigFallback(`${configPath}: plugin projects cannot define plugins in this version; ignoring 'plugins'.`);
|
|
239246
|
+
return { ...project, plugins: [] };
|
|
239159
239247
|
}
|
|
239160
239248
|
registerPluginNamespace(namespace, source, configPath) {
|
|
239161
239249
|
const existingSource = this.pluginSourceByNamespace.get(namespace);
|
|
@@ -239172,10 +239260,15 @@ class ProjectConfigReader {
|
|
|
239172
239260
|
}
|
|
239173
239261
|
async readPluginConfig(plugin, hostConfigPath) {
|
|
239174
239262
|
const pluginRoot = resolvePluginRoot(plugin.source, dirname10(hostConfigPath));
|
|
239175
|
-
const
|
|
239176
|
-
|
|
239263
|
+
const configPath = findConfigInDir(pluginRoot);
|
|
239264
|
+
if (!configPath) {
|
|
239265
|
+
throw new ConfigNotFoundError(`Project root not found. Please ensure config.jsonc or config.json exists in the project directory or ${PROJECT_SUBDIR}/ subdirectory.`);
|
|
239266
|
+
}
|
|
239267
|
+
const project = await this.readPluginConfigFile(configPath);
|
|
239177
239268
|
const namespace = requirePluginNamespace(project, plugin.source, configPath);
|
|
239178
|
-
|
|
239269
|
+
if (project.plugins.length > 0) {
|
|
239270
|
+
throw new ConfigInvalidError("Plugin projects cannot define plugins in this version.", configPath);
|
|
239271
|
+
}
|
|
239179
239272
|
return { configPath, namespace, project, source: plugin.source };
|
|
239180
239273
|
}
|
|
239181
239274
|
async readPluginResources(project, configPath, namespace) {
|
|
@@ -239254,13 +239347,16 @@ async function readProjectSettings(projectRoot) {
|
|
|
239254
239347
|
const reader = new ProjectConfigReader;
|
|
239255
239348
|
return await reader.readProjectSettings(projectRoot);
|
|
239256
239349
|
}
|
|
239350
|
+
function errorMessage(error) {
|
|
239351
|
+
return error instanceof Error ? error.message : String(error);
|
|
239352
|
+
}
|
|
239257
239353
|
// src/core/project/template.ts
|
|
239258
239354
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
239259
239355
|
var import_front_matter2 = __toESM(require_front_matter(), 1);
|
|
239260
239356
|
import { dirname as dirname11, join as join14 } from "node:path";
|
|
239261
239357
|
|
|
239262
239358
|
// src/core/assets.ts
|
|
239263
|
-
import { cpSync, existsSync } from "node:fs";
|
|
239359
|
+
import { cpSync, existsSync as existsSync2 } from "node:fs";
|
|
239264
239360
|
import { homedir as homedir2 } from "node:os";
|
|
239265
239361
|
import { join as join13 } from "node:path";
|
|
239266
239362
|
// package.json
|
|
@@ -239386,9 +239482,9 @@ function getExecWrapperPath() {
|
|
|
239386
239482
|
return join13(getBackendRuntimeDir(), "exec.ts");
|
|
239387
239483
|
}
|
|
239388
239484
|
function ensureNpmAssets(sourceDir) {
|
|
239389
|
-
if (
|
|
239485
|
+
if (existsSync2(ASSETS_DIR) && existsSync2(getBackendRuntimeDir()))
|
|
239390
239486
|
return;
|
|
239391
|
-
if (!
|
|
239487
|
+
if (!existsSync2(sourceDir))
|
|
239392
239488
|
return;
|
|
239393
239489
|
cpSync(sourceDir, ASSETS_DIR, { recursive: true });
|
|
239394
239490
|
}
|
|
@@ -240227,7 +240323,7 @@ function buildAssetsConfig(assetsConfig, progress) {
|
|
|
240227
240323
|
};
|
|
240228
240324
|
}
|
|
240229
240325
|
// ../../node_modules/is-plain-obj/index.js
|
|
240230
|
-
function
|
|
240326
|
+
function isPlainObject3(value) {
|
|
240231
240327
|
if (typeof value !== "object" || value === null) {
|
|
240232
240328
|
return false;
|
|
240233
240329
|
}
|
|
@@ -240251,7 +240347,7 @@ var normalizeFileUrl = (file) => file instanceof URL ? fileURLToPath2(file) : fi
|
|
|
240251
240347
|
// ../../node_modules/execa/lib/methods/parameters.js
|
|
240252
240348
|
var normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
|
|
240253
240349
|
const filePath = safeNormalizeFileUrl(rawFile, "First argument");
|
|
240254
|
-
const [commandArguments, options] =
|
|
240350
|
+
const [commandArguments, options] = isPlainObject3(rawArguments) ? [[], rawArguments] : [rawArguments, rawOptions];
|
|
240255
240351
|
if (!Array.isArray(commandArguments)) {
|
|
240256
240352
|
throw new TypeError(`Second argument must be either an array of arguments or an options object: ${commandArguments}`);
|
|
240257
240353
|
}
|
|
@@ -240263,7 +240359,7 @@ var normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
|
|
|
240263
240359
|
if (nullByteArgument !== undefined) {
|
|
240264
240360
|
throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${nullByteArgument}`);
|
|
240265
240361
|
}
|
|
240266
|
-
if (!
|
|
240362
|
+
if (!isPlainObject3(options)) {
|
|
240267
240363
|
throw new TypeError(`Last argument must be an options object: ${options}`);
|
|
240268
240364
|
}
|
|
240269
240365
|
return [filePath, normalizedArguments, options];
|
|
@@ -240400,7 +240496,7 @@ var parseExpression = (expression) => {
|
|
|
240400
240496
|
if (typeOfExpression === "number") {
|
|
240401
240497
|
return String(expression);
|
|
240402
240498
|
}
|
|
240403
|
-
if (
|
|
240499
|
+
if (isPlainObject3(expression) && (("stdout" in expression) || ("isMaxBuffer" in expression))) {
|
|
240404
240500
|
return getSubprocessResult(expression);
|
|
240405
240501
|
}
|
|
240406
240502
|
if (expression instanceof ChildProcess || Object.prototype.toString.call(expression) === "[object Promise]") {
|
|
@@ -240448,7 +240544,7 @@ var normalizeFdSpecificOption = (options, optionName) => {
|
|
|
240448
240544
|
return addDefaultValue(optionArray, optionName);
|
|
240449
240545
|
};
|
|
240450
240546
|
var getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
|
|
240451
|
-
var normalizeFdSpecificValue = (optionValue, optionArray, optionName) =>
|
|
240547
|
+
var normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject3(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
|
|
240452
240548
|
var normalizeOptionObject = (optionValue, optionArray, optionName) => {
|
|
240453
240549
|
for (const fdName of Object.keys(optionValue).sort(compareFdName)) {
|
|
240454
240550
|
for (const fdNumber of parseFdName(fdName, optionName, optionArray)) {
|
|
@@ -243524,10 +243620,10 @@ var checkBooleanOption = (value, optionName) => {
|
|
|
243524
243620
|
var isGenerator = (value) => isAsyncGenerator(value) || isSyncGenerator(value);
|
|
243525
243621
|
var isAsyncGenerator = (value) => Object.prototype.toString.call(value) === "[object AsyncGeneratorFunction]";
|
|
243526
243622
|
var isSyncGenerator = (value) => Object.prototype.toString.call(value) === "[object GeneratorFunction]";
|
|
243527
|
-
var isTransformOptions = (value) =>
|
|
243623
|
+
var isTransformOptions = (value) => isPlainObject3(value) && (value.transform !== undefined || value.final !== undefined);
|
|
243528
243624
|
var isUrl = (value) => Object.prototype.toString.call(value) === "[object URL]";
|
|
243529
243625
|
var isRegularUrl = (value) => isUrl(value) && value.protocol !== "file:";
|
|
243530
|
-
var isFilePathObject = (value) =>
|
|
243626
|
+
var isFilePathObject = (value) => isPlainObject3(value) && Object.keys(value).length > 0 && Object.keys(value).every((key) => FILE_PATH_KEYS.has(key)) && isFilePathString(value.file);
|
|
243531
243627
|
var FILE_PATH_KEYS = new Set(["file", "append"]);
|
|
243532
243628
|
var isFilePathString = (file) => typeof file === "string";
|
|
243533
243629
|
var isUnknownStdioString = (type, value) => type === "native" && typeof value === "string" && !KNOWN_STDIO_STRINGS.has(value);
|
|
@@ -243644,7 +243740,7 @@ var normalizeDuplex = ({
|
|
|
243644
243740
|
};
|
|
243645
243741
|
};
|
|
243646
243742
|
var normalizeTransformStream = ({ stdioItem, stdioItem: { value }, index, newTransforms, direction }) => {
|
|
243647
|
-
const { transform, objectMode } =
|
|
243743
|
+
const { transform, objectMode } = isPlainObject3(value) ? value : { transform: value };
|
|
243648
243744
|
const { writableObjectMode, readableObjectMode } = getTransformObjectModes(objectMode, index, newTransforms, direction);
|
|
243649
243745
|
return {
|
|
243650
243746
|
...stdioItem,
|
|
@@ -243658,7 +243754,7 @@ var normalizeGenerator = ({ stdioItem, stdioItem: { value }, index, newTransform
|
|
|
243658
243754
|
binary: binaryOption = false,
|
|
243659
243755
|
preserveNewlines = false,
|
|
243660
243756
|
objectMode
|
|
243661
|
-
} =
|
|
243757
|
+
} = isPlainObject3(value) ? value : { transform: value };
|
|
243662
243758
|
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
243663
243759
|
const { writableObjectMode, readableObjectMode } = getTransformObjectModes(objectMode, index, newTransforms, direction);
|
|
243664
243760
|
return {
|
|
@@ -245594,7 +245690,7 @@ var unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fil
|
|
|
245594
245690
|
|
|
245595
245691
|
// ../../node_modules/execa/lib/pipe/setup.js
|
|
245596
245692
|
var pipeToSubprocess = (sourceInfo, ...pipeArguments) => {
|
|
245597
|
-
if (
|
|
245693
|
+
if (isPlainObject3(pipeArguments[0])) {
|
|
245598
245694
|
return pipeToSubprocess.bind(undefined, {
|
|
245599
245695
|
...sourceInfo,
|
|
245600
245696
|
boundOptions: { ...sourceInfo.boundOptions, ...pipeArguments[0] }
|
|
@@ -246613,7 +246709,7 @@ var mergeOptions = (boundOptions, options) => {
|
|
|
246613
246709
|
return { ...boundOptions, ...newOptions };
|
|
246614
246710
|
};
|
|
246615
246711
|
var mergeOption = (optionName, boundOptionValue, optionValue) => {
|
|
246616
|
-
if (DEEP_OPTIONS.has(optionName) &&
|
|
246712
|
+
if (DEEP_OPTIONS.has(optionName) && isPlainObject3(boundOptionValue) && isPlainObject3(optionValue)) {
|
|
246617
246713
|
return { ...boundOptionValue, ...optionValue };
|
|
246618
246714
|
}
|
|
246619
246715
|
return optionValue;
|
|
@@ -246636,7 +246732,7 @@ var createExeca = (mapArguments, boundOptions, deepOptions, setBoundExeca) => {
|
|
|
246636
246732
|
return boundExeca;
|
|
246637
246733
|
};
|
|
246638
246734
|
var callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, setBoundExeca, createNested }, firstArgument, ...nextArguments) => {
|
|
246639
|
-
if (
|
|
246735
|
+
if (isPlainObject3(firstArgument)) {
|
|
246640
246736
|
return createNested(mapArguments, mergeOptions(boundOptions, firstArgument), setBoundExeca);
|
|
246641
246737
|
}
|
|
246642
246738
|
const { file, commandArguments, options, isSync } = parseArguments({
|
|
@@ -246839,37 +246935,19 @@ async function deployAll(projectData, options) {
|
|
|
246839
246935
|
}
|
|
246840
246936
|
// src/core/project/target.ts
|
|
246841
246937
|
import { dirname as dirname13, join as join19, resolve as resolve6 } from "node:path";
|
|
246842
|
-
var DEFAULT_BUILD_COMMAND = "npm run build";
|
|
246843
|
-
var DEFAULT_OUTPUT_DIRECTORY = "dist";
|
|
246844
246938
|
async function resolveBuildTarget(projectRoot, overrides = {}) {
|
|
246845
246939
|
const project = await readSettingsIfPresent(projectRoot);
|
|
246846
246940
|
const root = project?.root ?? projectRoot ?? process.cwd();
|
|
246941
|
+
const site = project ? siteOrDefault(project) : DEFAULT_SITE;
|
|
246847
246942
|
return {
|
|
246848
246943
|
root,
|
|
246849
246944
|
configDir: project ? dirname13(project.configPath) : join19(root, PROJECT_SUBDIR),
|
|
246850
|
-
buildCommand:
|
|
246851
|
-
outputDir:
|
|
246945
|
+
buildCommand: site.buildCommand,
|
|
246946
|
+
outputDir: resolve6(root, overrides.outputDir ?? site.outputDirectory ?? DEFAULT_SITE.outputDirectory),
|
|
246852
246947
|
entitiesDir: project?.entitiesDir ?? "entities",
|
|
246853
246948
|
agentsDir: project?.agentsDir ?? "agents"
|
|
246854
246949
|
};
|
|
246855
246950
|
}
|
|
246856
|
-
function outputDirectory(project, root, override) {
|
|
246857
|
-
const configured = override ?? (project ? project.site?.outputDirectory : DEFAULT_OUTPUT_DIRECTORY);
|
|
246858
|
-
return configured ? resolve6(root, configured) : null;
|
|
246859
|
-
}
|
|
246860
|
-
function requireOutputDir(target) {
|
|
246861
|
-
if (target.outputDir === null) {
|
|
246862
|
-
throw new ConfigNotFoundError("No site configuration found.", {
|
|
246863
|
-
hints: [
|
|
246864
|
-
{
|
|
246865
|
-
message: `Add 'site.outputDirectory' to your config.jsonc (e.g., "site": { "outputDirectory": "dist" })`
|
|
246866
|
-
},
|
|
246867
|
-
{ message: `Or pass --output-dir <dir>, relative to ${target.root}` }
|
|
246868
|
-
]
|
|
246869
|
-
});
|
|
246870
|
-
}
|
|
246871
|
-
return target.outputDir;
|
|
246872
|
-
}
|
|
246873
246951
|
async function readSettingsIfPresent(projectRoot) {
|
|
246874
246952
|
try {
|
|
246875
246953
|
return await readProjectSettings(projectRoot);
|
|
@@ -247398,6 +247476,7 @@ class Base44Command extends Command2 {
|
|
|
247398
247476
|
}
|
|
247399
247477
|
action(fn) {
|
|
247400
247478
|
return super.action(async (...args) => {
|
|
247479
|
+
setConfigWarningHandler((message) => this.context.log.warn(message));
|
|
247401
247480
|
const jsonMode = this.context.jsonMode;
|
|
247402
247481
|
const quiet = this.context.isNonInteractive || jsonMode;
|
|
247403
247482
|
if (!quiet) {
|
|
@@ -249655,16 +249734,7 @@ function getFunctionsCommand() {
|
|
|
249655
249734
|
}
|
|
249656
249735
|
|
|
249657
249736
|
// src/cli/commands/project/site-build.ts
|
|
249658
|
-
async function runSiteBuild({ runTask }, { root, buildCommand, appId }) {
|
|
249659
|
-
if (!buildCommand) {
|
|
249660
|
-
throw new ConfigNotFoundError("No site build command found.", {
|
|
249661
|
-
hints: [
|
|
249662
|
-
{
|
|
249663
|
-
message: `Add a 'site' block to your config.jsonc (e.g., "site": { "buildCommand": "npm run build" }). Inside one, buildCommand defaults to "npm run build".`
|
|
249664
|
-
}
|
|
249665
|
-
]
|
|
249666
|
-
});
|
|
249667
|
-
}
|
|
249737
|
+
async function runSiteBuild({ runTask }, { root, buildCommand = DEFAULT_SITE.buildCommand, appId }) {
|
|
249668
249738
|
await runTask("Building site...", () => execa({
|
|
249669
249739
|
cwd: root,
|
|
249670
249740
|
shell: true,
|
|
@@ -250851,7 +250921,7 @@ async function collectArtifacts(target) {
|
|
|
250851
250921
|
const built = await resolveFullStackBuild(target.root);
|
|
250852
250922
|
const siteWorker = built ? await describeSiteWorker(built) : null;
|
|
250853
250923
|
return {
|
|
250854
|
-
assets: built ? built.assetsDir ? await collectBuildOutput(built.assetsDir) : [] : await collectBuildOutput(
|
|
250924
|
+
assets: built ? built.assetsDir ? await collectBuildOutput(built.assetsDir) : [] : await collectBuildOutput(target.outputDir, {
|
|
250855
250925
|
entryFile: ENTRY2
|
|
250856
250926
|
}),
|
|
250857
250927
|
...siteWorker ? { siteWorker } : {},
|
|
@@ -251455,15 +251525,6 @@ async function deployToDeploymentsApi(ctx, project, options) {
|
|
|
251455
251525
|
}
|
|
251456
251526
|
async function deployTarball({ runTask }, project) {
|
|
251457
251527
|
const outputDir = siteOutputDir(project);
|
|
251458
|
-
if (!outputDir) {
|
|
251459
|
-
throw new ConfigNotFoundError("No site configuration found.", {
|
|
251460
|
-
hints: [
|
|
251461
|
-
{
|
|
251462
|
-
message: `Add 'site.outputDirectory' to your config.jsonc (e.g., "site": { "outputDirectory": "dist" })`
|
|
251463
|
-
}
|
|
251464
|
-
]
|
|
251465
|
-
});
|
|
251466
|
-
}
|
|
251467
251528
|
const { appUrl } = await runTask("Creating archive and deploying site...", async () => await deploySite(outputDir), {
|
|
251468
251529
|
successMessage: "Site deployed successfully",
|
|
251469
251530
|
errorMessage: "Deployment failed"
|
|
@@ -251471,8 +251532,8 @@ async function deployTarball({ runTask }, project) {
|
|
|
251471
251532
|
return { outroMessage: `Visit your site at: ${appUrl}` };
|
|
251472
251533
|
}
|
|
251473
251534
|
function siteOutputDir(project) {
|
|
251474
|
-
const outputDirectory =
|
|
251475
|
-
return
|
|
251535
|
+
const { outputDirectory = DEFAULT_SITE.outputDirectory } = siteOrDefault(project);
|
|
251536
|
+
return resolve15(project.root, outputDirectory);
|
|
251476
251537
|
}
|
|
251477
251538
|
function getSiteDeployCommand() {
|
|
251478
251539
|
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)");
|
|
@@ -251670,10 +251731,7 @@ async function siteDevAction(ctx, forwarded) {
|
|
|
251670
251731
|
throw new ConfigInvalidError("base44 site dev requires a linked local project. Run it from a project with base44/.app.jsonc.");
|
|
251671
251732
|
}
|
|
251672
251733
|
const project = await readProjectSettings(app.projectRoot);
|
|
251673
|
-
const site = project
|
|
251674
|
-
if (!site) {
|
|
251675
|
-
throw new InvalidInputError(`This project has no 'site' block in base44/config.jsonc, so there is no frontend to serve. Add one naming its serveCommand; site dev falls back to "npm run dev".`);
|
|
251676
|
-
}
|
|
251734
|
+
const site = siteOrDefault(project);
|
|
251677
251735
|
const serveCommand = site.serveCommand ?? DEFAULT_SERVE_COMMAND;
|
|
251678
251736
|
const command = [serveCommand, ...forwarded].join(" ");
|
|
251679
251737
|
const runner = createServeCommandRunner({
|
|
@@ -251695,16 +251753,7 @@ async function installAction({
|
|
|
251695
251753
|
runTask
|
|
251696
251754
|
}) {
|
|
251697
251755
|
const project = await readProjectSettings();
|
|
251698
|
-
const installCommand = project
|
|
251699
|
-
if (!installCommand) {
|
|
251700
|
-
throw new ConfigNotFoundError("No site install command found.", {
|
|
251701
|
-
hints: [
|
|
251702
|
-
{
|
|
251703
|
-
message: `Add a 'site' block to your config.jsonc (e.g., "site": { "installCommand": "npm ci" }). Inside one, installCommand defaults to "npm install".`
|
|
251704
|
-
}
|
|
251705
|
-
]
|
|
251706
|
-
});
|
|
251707
|
-
}
|
|
251756
|
+
const { installCommand } = siteOrDefault(project);
|
|
251708
251757
|
await runTask("Installing site dependencies...", () => execa({ cwd: project.root, shell: true })`${installCommand}`, {
|
|
251709
251758
|
successMessage: "Dependencies installed",
|
|
251710
251759
|
errorMessage: "Install failed"
|
|
@@ -253183,7 +253232,7 @@ class Validator {
|
|
|
253183
253232
|
error: this.createValidationError(`Error in field ${fieldPath}: Input should be a valid ${types.join(" or ")}`)
|
|
253184
253233
|
};
|
|
253185
253234
|
}
|
|
253186
|
-
const propertyType = property.type
|
|
253235
|
+
const propertyType = property.type;
|
|
253187
253236
|
if (!fieldTypes.includes(propertyType)) {
|
|
253188
253237
|
return {
|
|
253189
253238
|
hasError: true,
|
|
@@ -256967,7 +257016,7 @@ function isBuiltin2(candidate, className) {
|
|
|
256967
257016
|
function isEvent(candidate) {
|
|
256968
257017
|
return !isUndefined(Event) && isInstanceOf(candidate, Event);
|
|
256969
257018
|
}
|
|
256970
|
-
function
|
|
257019
|
+
function isPlainObject4(candidate) {
|
|
256971
257020
|
return isBuiltin2(candidate, "Object");
|
|
256972
257021
|
}
|
|
256973
257022
|
function isInstanceOf(candidate, base) {
|
|
@@ -260103,7 +260152,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
260103
260152
|
const personProperties = {};
|
|
260104
260153
|
const groupProperties = {};
|
|
260105
260154
|
for (const [key, value] of Object.entries(eventProperties))
|
|
260106
|
-
if (
|
|
260155
|
+
if (isPlainObject4(value) && groups && key in groups) {
|
|
260107
260156
|
const groupProps = {};
|
|
260108
260157
|
for (const [groupKey, groupValue] of Object.entries(value))
|
|
260109
260158
|
groupProps[String(groupKey)] = String(groupValue);
|
|
@@ -260580,4 +260629,4 @@ export {
|
|
|
260580
260629
|
runCLI
|
|
260581
260630
|
};
|
|
260582
260631
|
|
|
260583
|
-
//# debugId=
|
|
260632
|
+
//# debugId=545CDC42F775B10764756E2164756E21
|