@base44-preview/cli 0.1.25-pr.647.fff4a17 → 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 +155 -119
- 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";
|
|
@@ -238340,8 +238402,8 @@ var FieldRLSSchema = looseObject({
|
|
|
238340
238402
|
update: RLSRuleSchema.optional(),
|
|
238341
238403
|
delete: RLSRuleSchema.optional()
|
|
238342
238404
|
});
|
|
238343
|
-
var
|
|
238344
|
-
|
|
238405
|
+
var PropertyDefinitionSchema = looseObject({
|
|
238406
|
+
type: union([string2(), array(string2())]),
|
|
238345
238407
|
title: string2().optional(),
|
|
238346
238408
|
description: string2().optional(),
|
|
238347
238409
|
minLength: number2().int().min(0).optional(),
|
|
@@ -238355,26 +238417,12 @@ var propertyFields = {
|
|
|
238355
238417
|
default: unknown().optional(),
|
|
238356
238418
|
$ref: string2().optional(),
|
|
238357
238419
|
rls: FieldRLSSchema.optional(),
|
|
238358
|
-
required: array(string2()).optional()
|
|
238359
|
-
};
|
|
238360
|
-
var NestedPropertyDefinitionSchema = looseObject({
|
|
238361
|
-
...propertyFields,
|
|
238362
|
-
type: PropertyTypeSchema.optional(),
|
|
238363
|
-
get items() {
|
|
238364
|
-
return NestedPropertyDefinitionSchema.optional();
|
|
238365
|
-
},
|
|
238366
|
-
get properties() {
|
|
238367
|
-
return record(string2(), NestedPropertyDefinitionSchema).optional();
|
|
238368
|
-
}
|
|
238369
|
-
});
|
|
238370
|
-
var PropertyDefinitionSchema = looseObject({
|
|
238371
|
-
...propertyFields,
|
|
238372
|
-
type: PropertyTypeSchema,
|
|
238420
|
+
required: array(string2()).optional(),
|
|
238373
238421
|
get items() {
|
|
238374
|
-
return
|
|
238422
|
+
return PropertyDefinitionSchema.optional();
|
|
238375
238423
|
},
|
|
238376
238424
|
get properties() {
|
|
238377
|
-
return record(string2(),
|
|
238425
|
+
return record(string2(), PropertyDefinitionSchema).optional();
|
|
238378
238426
|
}
|
|
238379
238427
|
});
|
|
238380
238428
|
var EntitySchema = looseObject({
|
|
@@ -239082,10 +239130,17 @@ async function openLogStream(filters) {
|
|
|
239082
239130
|
class ProjectConfigReader {
|
|
239083
239131
|
pluginSourceByNamespace = new Map;
|
|
239084
239132
|
async readProjectSettings(projectRoot) {
|
|
239085
|
-
const
|
|
239086
|
-
|
|
239087
|
-
|
|
239088
|
-
|
|
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
|
+
};
|
|
239089
239144
|
}
|
|
239090
239145
|
async readProjectConfig(projectRoot) {
|
|
239091
239146
|
const project = await this.readProjectSettings(projectRoot);
|
|
@@ -239115,26 +239170,37 @@ class ProjectConfigReader {
|
|
|
239115
239170
|
authConfig: localResources.authConfig
|
|
239116
239171
|
};
|
|
239117
239172
|
}
|
|
239118
|
-
|
|
239119
|
-
|
|
239120
|
-
|
|
239121
|
-
const configPath = findConfigInDir(projectRoot);
|
|
239122
|
-
found = configPath ? { root: projectRoot, configPath } : null;
|
|
239123
|
-
} else {
|
|
239124
|
-
found = findProjectRoot();
|
|
239173
|
+
findConfig(projectRoot) {
|
|
239174
|
+
if (!projectRoot) {
|
|
239175
|
+
return findProjectRoot();
|
|
239125
239176
|
}
|
|
239126
|
-
|
|
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"))) {
|
|
239127
239183
|
throw new ConfigNotFoundError(`Project root not found. Please ensure config.jsonc or config.json exists in the project directory or ${PROJECT_SUBDIR}/ subdirectory.`);
|
|
239128
239184
|
}
|
|
239129
|
-
|
|
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 };
|
|
239130
239188
|
}
|
|
239131
|
-
async
|
|
239132
|
-
|
|
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
|
+
}
|
|
239133
239197
|
const result = ProjectConfigSchema.safeParse(parsed);
|
|
239134
|
-
if (
|
|
239135
|
-
|
|
239198
|
+
if (result.success) {
|
|
239199
|
+
return result.data;
|
|
239136
239200
|
}
|
|
239137
|
-
|
|
239201
|
+
warnConfigFallback(`Invalid project configuration in ${configPath}; using defaults for the invalid fields:
|
|
239202
|
+
${prettifyError(result.error)}`);
|
|
239203
|
+
return salvageProjectConfig(parsed, result.error);
|
|
239138
239204
|
}
|
|
239139
239205
|
async readProjectResources(configPath, project, includeActors = true) {
|
|
239140
239206
|
const configDir = dirname10(configPath);
|
|
@@ -239165,10 +239231,19 @@ class ProjectConfigReader {
|
|
|
239165
239231
|
authConfig
|
|
239166
239232
|
};
|
|
239167
239233
|
}
|
|
239168
|
-
|
|
239169
|
-
|
|
239170
|
-
|
|
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);
|
|
239238
|
+
}
|
|
239239
|
+
return result.data;
|
|
239240
|
+
}
|
|
239241
|
+
withoutPluginsInPluginProject(project, configPath) {
|
|
239242
|
+
if (!project.plugin || project.plugins.length === 0) {
|
|
239243
|
+
return project;
|
|
239171
239244
|
}
|
|
239245
|
+
warnConfigFallback(`${configPath}: plugin projects cannot define plugins in this version; ignoring 'plugins'.`);
|
|
239246
|
+
return { ...project, plugins: [] };
|
|
239172
239247
|
}
|
|
239173
239248
|
registerPluginNamespace(namespace, source, configPath) {
|
|
239174
239249
|
const existingSource = this.pluginSourceByNamespace.get(namespace);
|
|
@@ -239185,10 +239260,15 @@ class ProjectConfigReader {
|
|
|
239185
239260
|
}
|
|
239186
239261
|
async readPluginConfig(plugin, hostConfigPath) {
|
|
239187
239262
|
const pluginRoot = resolvePluginRoot(plugin.source, dirname10(hostConfigPath));
|
|
239188
|
-
const
|
|
239189
|
-
|
|
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);
|
|
239190
239268
|
const namespace = requirePluginNamespace(project, plugin.source, configPath);
|
|
239191
|
-
|
|
239269
|
+
if (project.plugins.length > 0) {
|
|
239270
|
+
throw new ConfigInvalidError("Plugin projects cannot define plugins in this version.", configPath);
|
|
239271
|
+
}
|
|
239192
239272
|
return { configPath, namespace, project, source: plugin.source };
|
|
239193
239273
|
}
|
|
239194
239274
|
async readPluginResources(project, configPath, namespace) {
|
|
@@ -239267,13 +239347,16 @@ async function readProjectSettings(projectRoot) {
|
|
|
239267
239347
|
const reader = new ProjectConfigReader;
|
|
239268
239348
|
return await reader.readProjectSettings(projectRoot);
|
|
239269
239349
|
}
|
|
239350
|
+
function errorMessage(error) {
|
|
239351
|
+
return error instanceof Error ? error.message : String(error);
|
|
239352
|
+
}
|
|
239270
239353
|
// src/core/project/template.ts
|
|
239271
239354
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
239272
239355
|
var import_front_matter2 = __toESM(require_front_matter(), 1);
|
|
239273
239356
|
import { dirname as dirname11, join as join14 } from "node:path";
|
|
239274
239357
|
|
|
239275
239358
|
// src/core/assets.ts
|
|
239276
|
-
import { cpSync, existsSync } from "node:fs";
|
|
239359
|
+
import { cpSync, existsSync as existsSync2 } from "node:fs";
|
|
239277
239360
|
import { homedir as homedir2 } from "node:os";
|
|
239278
239361
|
import { join as join13 } from "node:path";
|
|
239279
239362
|
// package.json
|
|
@@ -239399,9 +239482,9 @@ function getExecWrapperPath() {
|
|
|
239399
239482
|
return join13(getBackendRuntimeDir(), "exec.ts");
|
|
239400
239483
|
}
|
|
239401
239484
|
function ensureNpmAssets(sourceDir) {
|
|
239402
|
-
if (
|
|
239485
|
+
if (existsSync2(ASSETS_DIR) && existsSync2(getBackendRuntimeDir()))
|
|
239403
239486
|
return;
|
|
239404
|
-
if (!
|
|
239487
|
+
if (!existsSync2(sourceDir))
|
|
239405
239488
|
return;
|
|
239406
239489
|
cpSync(sourceDir, ASSETS_DIR, { recursive: true });
|
|
239407
239490
|
}
|
|
@@ -240240,7 +240323,7 @@ function buildAssetsConfig(assetsConfig, progress) {
|
|
|
240240
240323
|
};
|
|
240241
240324
|
}
|
|
240242
240325
|
// ../../node_modules/is-plain-obj/index.js
|
|
240243
|
-
function
|
|
240326
|
+
function isPlainObject3(value) {
|
|
240244
240327
|
if (typeof value !== "object" || value === null) {
|
|
240245
240328
|
return false;
|
|
240246
240329
|
}
|
|
@@ -240264,7 +240347,7 @@ var normalizeFileUrl = (file) => file instanceof URL ? fileURLToPath2(file) : fi
|
|
|
240264
240347
|
// ../../node_modules/execa/lib/methods/parameters.js
|
|
240265
240348
|
var normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
|
|
240266
240349
|
const filePath = safeNormalizeFileUrl(rawFile, "First argument");
|
|
240267
|
-
const [commandArguments, options] =
|
|
240350
|
+
const [commandArguments, options] = isPlainObject3(rawArguments) ? [[], rawArguments] : [rawArguments, rawOptions];
|
|
240268
240351
|
if (!Array.isArray(commandArguments)) {
|
|
240269
240352
|
throw new TypeError(`Second argument must be either an array of arguments or an options object: ${commandArguments}`);
|
|
240270
240353
|
}
|
|
@@ -240276,7 +240359,7 @@ var normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
|
|
|
240276
240359
|
if (nullByteArgument !== undefined) {
|
|
240277
240360
|
throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${nullByteArgument}`);
|
|
240278
240361
|
}
|
|
240279
|
-
if (!
|
|
240362
|
+
if (!isPlainObject3(options)) {
|
|
240280
240363
|
throw new TypeError(`Last argument must be an options object: ${options}`);
|
|
240281
240364
|
}
|
|
240282
240365
|
return [filePath, normalizedArguments, options];
|
|
@@ -240413,7 +240496,7 @@ var parseExpression = (expression) => {
|
|
|
240413
240496
|
if (typeOfExpression === "number") {
|
|
240414
240497
|
return String(expression);
|
|
240415
240498
|
}
|
|
240416
|
-
if (
|
|
240499
|
+
if (isPlainObject3(expression) && (("stdout" in expression) || ("isMaxBuffer" in expression))) {
|
|
240417
240500
|
return getSubprocessResult(expression);
|
|
240418
240501
|
}
|
|
240419
240502
|
if (expression instanceof ChildProcess || Object.prototype.toString.call(expression) === "[object Promise]") {
|
|
@@ -240461,7 +240544,7 @@ var normalizeFdSpecificOption = (options, optionName) => {
|
|
|
240461
240544
|
return addDefaultValue(optionArray, optionName);
|
|
240462
240545
|
};
|
|
240463
240546
|
var getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length;
|
|
240464
|
-
var normalizeFdSpecificValue = (optionValue, optionArray, optionName) =>
|
|
240547
|
+
var normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject3(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue);
|
|
240465
240548
|
var normalizeOptionObject = (optionValue, optionArray, optionName) => {
|
|
240466
240549
|
for (const fdName of Object.keys(optionValue).sort(compareFdName)) {
|
|
240467
240550
|
for (const fdNumber of parseFdName(fdName, optionName, optionArray)) {
|
|
@@ -243537,10 +243620,10 @@ var checkBooleanOption = (value, optionName) => {
|
|
|
243537
243620
|
var isGenerator = (value) => isAsyncGenerator(value) || isSyncGenerator(value);
|
|
243538
243621
|
var isAsyncGenerator = (value) => Object.prototype.toString.call(value) === "[object AsyncGeneratorFunction]";
|
|
243539
243622
|
var isSyncGenerator = (value) => Object.prototype.toString.call(value) === "[object GeneratorFunction]";
|
|
243540
|
-
var isTransformOptions = (value) =>
|
|
243623
|
+
var isTransformOptions = (value) => isPlainObject3(value) && (value.transform !== undefined || value.final !== undefined);
|
|
243541
243624
|
var isUrl = (value) => Object.prototype.toString.call(value) === "[object URL]";
|
|
243542
243625
|
var isRegularUrl = (value) => isUrl(value) && value.protocol !== "file:";
|
|
243543
|
-
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);
|
|
243544
243627
|
var FILE_PATH_KEYS = new Set(["file", "append"]);
|
|
243545
243628
|
var isFilePathString = (file) => typeof file === "string";
|
|
243546
243629
|
var isUnknownStdioString = (type, value) => type === "native" && typeof value === "string" && !KNOWN_STDIO_STRINGS.has(value);
|
|
@@ -243657,7 +243740,7 @@ var normalizeDuplex = ({
|
|
|
243657
243740
|
};
|
|
243658
243741
|
};
|
|
243659
243742
|
var normalizeTransformStream = ({ stdioItem, stdioItem: { value }, index, newTransforms, direction }) => {
|
|
243660
|
-
const { transform, objectMode } =
|
|
243743
|
+
const { transform, objectMode } = isPlainObject3(value) ? value : { transform: value };
|
|
243661
243744
|
const { writableObjectMode, readableObjectMode } = getTransformObjectModes(objectMode, index, newTransforms, direction);
|
|
243662
243745
|
return {
|
|
243663
243746
|
...stdioItem,
|
|
@@ -243671,7 +243754,7 @@ var normalizeGenerator = ({ stdioItem, stdioItem: { value }, index, newTransform
|
|
|
243671
243754
|
binary: binaryOption = false,
|
|
243672
243755
|
preserveNewlines = false,
|
|
243673
243756
|
objectMode
|
|
243674
|
-
} =
|
|
243757
|
+
} = isPlainObject3(value) ? value : { transform: value };
|
|
243675
243758
|
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
243676
243759
|
const { writableObjectMode, readableObjectMode } = getTransformObjectModes(objectMode, index, newTransforms, direction);
|
|
243677
243760
|
return {
|
|
@@ -245607,7 +245690,7 @@ var unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fil
|
|
|
245607
245690
|
|
|
245608
245691
|
// ../../node_modules/execa/lib/pipe/setup.js
|
|
245609
245692
|
var pipeToSubprocess = (sourceInfo, ...pipeArguments) => {
|
|
245610
|
-
if (
|
|
245693
|
+
if (isPlainObject3(pipeArguments[0])) {
|
|
245611
245694
|
return pipeToSubprocess.bind(undefined, {
|
|
245612
245695
|
...sourceInfo,
|
|
245613
245696
|
boundOptions: { ...sourceInfo.boundOptions, ...pipeArguments[0] }
|
|
@@ -246626,7 +246709,7 @@ var mergeOptions = (boundOptions, options) => {
|
|
|
246626
246709
|
return { ...boundOptions, ...newOptions };
|
|
246627
246710
|
};
|
|
246628
246711
|
var mergeOption = (optionName, boundOptionValue, optionValue) => {
|
|
246629
|
-
if (DEEP_OPTIONS.has(optionName) &&
|
|
246712
|
+
if (DEEP_OPTIONS.has(optionName) && isPlainObject3(boundOptionValue) && isPlainObject3(optionValue)) {
|
|
246630
246713
|
return { ...boundOptionValue, ...optionValue };
|
|
246631
246714
|
}
|
|
246632
246715
|
return optionValue;
|
|
@@ -246649,7 +246732,7 @@ var createExeca = (mapArguments, boundOptions, deepOptions, setBoundExeca) => {
|
|
|
246649
246732
|
return boundExeca;
|
|
246650
246733
|
};
|
|
246651
246734
|
var callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, setBoundExeca, createNested }, firstArgument, ...nextArguments) => {
|
|
246652
|
-
if (
|
|
246735
|
+
if (isPlainObject3(firstArgument)) {
|
|
246653
246736
|
return createNested(mapArguments, mergeOptions(boundOptions, firstArgument), setBoundExeca);
|
|
246654
246737
|
}
|
|
246655
246738
|
const { file, commandArguments, options, isSync } = parseArguments({
|
|
@@ -246852,37 +246935,19 @@ async function deployAll(projectData, options) {
|
|
|
246852
246935
|
}
|
|
246853
246936
|
// src/core/project/target.ts
|
|
246854
246937
|
import { dirname as dirname13, join as join19, resolve as resolve6 } from "node:path";
|
|
246855
|
-
var DEFAULT_BUILD_COMMAND = "npm run build";
|
|
246856
|
-
var DEFAULT_OUTPUT_DIRECTORY = "dist";
|
|
246857
246938
|
async function resolveBuildTarget(projectRoot, overrides = {}) {
|
|
246858
246939
|
const project = await readSettingsIfPresent(projectRoot);
|
|
246859
246940
|
const root = project?.root ?? projectRoot ?? process.cwd();
|
|
246941
|
+
const site = project ? siteOrDefault(project) : DEFAULT_SITE;
|
|
246860
246942
|
return {
|
|
246861
246943
|
root,
|
|
246862
246944
|
configDir: project ? dirname13(project.configPath) : join19(root, PROJECT_SUBDIR),
|
|
246863
|
-
buildCommand:
|
|
246864
|
-
outputDir:
|
|
246945
|
+
buildCommand: site.buildCommand,
|
|
246946
|
+
outputDir: resolve6(root, overrides.outputDir ?? site.outputDirectory ?? DEFAULT_SITE.outputDirectory),
|
|
246865
246947
|
entitiesDir: project?.entitiesDir ?? "entities",
|
|
246866
246948
|
agentsDir: project?.agentsDir ?? "agents"
|
|
246867
246949
|
};
|
|
246868
246950
|
}
|
|
246869
|
-
function outputDirectory(project, root, override) {
|
|
246870
|
-
const configured = override ?? (project ? project.site?.outputDirectory : DEFAULT_OUTPUT_DIRECTORY);
|
|
246871
|
-
return configured ? resolve6(root, configured) : null;
|
|
246872
|
-
}
|
|
246873
|
-
function requireOutputDir(target) {
|
|
246874
|
-
if (target.outputDir === null) {
|
|
246875
|
-
throw new ConfigNotFoundError("No site configuration found.", {
|
|
246876
|
-
hints: [
|
|
246877
|
-
{
|
|
246878
|
-
message: `Add 'site.outputDirectory' to your config.jsonc (e.g., "site": { "outputDirectory": "dist" })`
|
|
246879
|
-
},
|
|
246880
|
-
{ message: `Or pass --output-dir <dir>, relative to ${target.root}` }
|
|
246881
|
-
]
|
|
246882
|
-
});
|
|
246883
|
-
}
|
|
246884
|
-
return target.outputDir;
|
|
246885
|
-
}
|
|
246886
246951
|
async function readSettingsIfPresent(projectRoot) {
|
|
246887
246952
|
try {
|
|
246888
246953
|
return await readProjectSettings(projectRoot);
|
|
@@ -247411,6 +247476,7 @@ class Base44Command extends Command2 {
|
|
|
247411
247476
|
}
|
|
247412
247477
|
action(fn) {
|
|
247413
247478
|
return super.action(async (...args) => {
|
|
247479
|
+
setConfigWarningHandler((message) => this.context.log.warn(message));
|
|
247414
247480
|
const jsonMode = this.context.jsonMode;
|
|
247415
247481
|
const quiet = this.context.isNonInteractive || jsonMode;
|
|
247416
247482
|
if (!quiet) {
|
|
@@ -249668,16 +249734,7 @@ function getFunctionsCommand() {
|
|
|
249668
249734
|
}
|
|
249669
249735
|
|
|
249670
249736
|
// src/cli/commands/project/site-build.ts
|
|
249671
|
-
async function runSiteBuild({ runTask }, { root, buildCommand, appId }) {
|
|
249672
|
-
if (!buildCommand) {
|
|
249673
|
-
throw new ConfigNotFoundError("No site build command found.", {
|
|
249674
|
-
hints: [
|
|
249675
|
-
{
|
|
249676
|
-
message: `Add a 'site' block to your config.jsonc (e.g., "site": { "buildCommand": "npm run build" }). Inside one, buildCommand defaults to "npm run build".`
|
|
249677
|
-
}
|
|
249678
|
-
]
|
|
249679
|
-
});
|
|
249680
|
-
}
|
|
249737
|
+
async function runSiteBuild({ runTask }, { root, buildCommand = DEFAULT_SITE.buildCommand, appId }) {
|
|
249681
249738
|
await runTask("Building site...", () => execa({
|
|
249682
249739
|
cwd: root,
|
|
249683
249740
|
shell: true,
|
|
@@ -250864,7 +250921,7 @@ async function collectArtifacts(target) {
|
|
|
250864
250921
|
const built = await resolveFullStackBuild(target.root);
|
|
250865
250922
|
const siteWorker = built ? await describeSiteWorker(built) : null;
|
|
250866
250923
|
return {
|
|
250867
|
-
assets: built ? built.assetsDir ? await collectBuildOutput(built.assetsDir) : [] : await collectBuildOutput(
|
|
250924
|
+
assets: built ? built.assetsDir ? await collectBuildOutput(built.assetsDir) : [] : await collectBuildOutput(target.outputDir, {
|
|
250868
250925
|
entryFile: ENTRY2
|
|
250869
250926
|
}),
|
|
250870
250927
|
...siteWorker ? { siteWorker } : {},
|
|
@@ -251468,15 +251525,6 @@ async function deployToDeploymentsApi(ctx, project, options) {
|
|
|
251468
251525
|
}
|
|
251469
251526
|
async function deployTarball({ runTask }, project) {
|
|
251470
251527
|
const outputDir = siteOutputDir(project);
|
|
251471
|
-
if (!outputDir) {
|
|
251472
|
-
throw new ConfigNotFoundError("No site configuration found.", {
|
|
251473
|
-
hints: [
|
|
251474
|
-
{
|
|
251475
|
-
message: `Add 'site.outputDirectory' to your config.jsonc (e.g., "site": { "outputDirectory": "dist" })`
|
|
251476
|
-
}
|
|
251477
|
-
]
|
|
251478
|
-
});
|
|
251479
|
-
}
|
|
251480
251528
|
const { appUrl } = await runTask("Creating archive and deploying site...", async () => await deploySite(outputDir), {
|
|
251481
251529
|
successMessage: "Site deployed successfully",
|
|
251482
251530
|
errorMessage: "Deployment failed"
|
|
@@ -251484,8 +251532,8 @@ async function deployTarball({ runTask }, project) {
|
|
|
251484
251532
|
return { outroMessage: `Visit your site at: ${appUrl}` };
|
|
251485
251533
|
}
|
|
251486
251534
|
function siteOutputDir(project) {
|
|
251487
|
-
const outputDirectory =
|
|
251488
|
-
return
|
|
251535
|
+
const { outputDirectory = DEFAULT_SITE.outputDirectory } = siteOrDefault(project);
|
|
251536
|
+
return resolve15(project.root, outputDirectory);
|
|
251489
251537
|
}
|
|
251490
251538
|
function getSiteDeployCommand() {
|
|
251491
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)");
|
|
@@ -251683,10 +251731,7 @@ async function siteDevAction(ctx, forwarded) {
|
|
|
251683
251731
|
throw new ConfigInvalidError("base44 site dev requires a linked local project. Run it from a project with base44/.app.jsonc.");
|
|
251684
251732
|
}
|
|
251685
251733
|
const project = await readProjectSettings(app.projectRoot);
|
|
251686
|
-
const site = project
|
|
251687
|
-
if (!site) {
|
|
251688
|
-
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".`);
|
|
251689
|
-
}
|
|
251734
|
+
const site = siteOrDefault(project);
|
|
251690
251735
|
const serveCommand = site.serveCommand ?? DEFAULT_SERVE_COMMAND;
|
|
251691
251736
|
const command = [serveCommand, ...forwarded].join(" ");
|
|
251692
251737
|
const runner = createServeCommandRunner({
|
|
@@ -251708,16 +251753,7 @@ async function installAction({
|
|
|
251708
251753
|
runTask
|
|
251709
251754
|
}) {
|
|
251710
251755
|
const project = await readProjectSettings();
|
|
251711
|
-
const installCommand = project
|
|
251712
|
-
if (!installCommand) {
|
|
251713
|
-
throw new ConfigNotFoundError("No site install command found.", {
|
|
251714
|
-
hints: [
|
|
251715
|
-
{
|
|
251716
|
-
message: `Add a 'site' block to your config.jsonc (e.g., "site": { "installCommand": "npm ci" }). Inside one, installCommand defaults to "npm install".`
|
|
251717
|
-
}
|
|
251718
|
-
]
|
|
251719
|
-
});
|
|
251720
|
-
}
|
|
251756
|
+
const { installCommand } = siteOrDefault(project);
|
|
251721
251757
|
await runTask("Installing site dependencies...", () => execa({ cwd: project.root, shell: true })`${installCommand}`, {
|
|
251722
251758
|
successMessage: "Dependencies installed",
|
|
251723
251759
|
errorMessage: "Install failed"
|
|
@@ -253196,7 +253232,7 @@ class Validator {
|
|
|
253196
253232
|
error: this.createValidationError(`Error in field ${fieldPath}: Input should be a valid ${types.join(" or ")}`)
|
|
253197
253233
|
};
|
|
253198
253234
|
}
|
|
253199
|
-
const propertyType = property.type
|
|
253235
|
+
const propertyType = property.type;
|
|
253200
253236
|
if (!fieldTypes.includes(propertyType)) {
|
|
253201
253237
|
return {
|
|
253202
253238
|
hasError: true,
|
|
@@ -256980,7 +257016,7 @@ function isBuiltin2(candidate, className) {
|
|
|
256980
257016
|
function isEvent(candidate) {
|
|
256981
257017
|
return !isUndefined(Event) && isInstanceOf(candidate, Event);
|
|
256982
257018
|
}
|
|
256983
|
-
function
|
|
257019
|
+
function isPlainObject4(candidate) {
|
|
256984
257020
|
return isBuiltin2(candidate, "Object");
|
|
256985
257021
|
}
|
|
256986
257022
|
function isInstanceOf(candidate, base) {
|
|
@@ -260116,7 +260152,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
260116
260152
|
const personProperties = {};
|
|
260117
260153
|
const groupProperties = {};
|
|
260118
260154
|
for (const [key, value] of Object.entries(eventProperties))
|
|
260119
|
-
if (
|
|
260155
|
+
if (isPlainObject4(value) && groups && key in groups) {
|
|
260120
260156
|
const groupProps = {};
|
|
260121
260157
|
for (const [groupKey, groupValue] of Object.entries(value))
|
|
260122
260158
|
groupProps[String(groupKey)] = String(groupValue);
|
|
@@ -260593,4 +260629,4 @@ export {
|
|
|
260593
260629
|
runCLI
|
|
260594
260630
|
};
|
|
260595
260631
|
|
|
260596
|
-
//# debugId=
|
|
260632
|
+
//# debugId=545CDC42F775B10764756E2164756E21
|