@base44-preview/cli 0.3.5-pr.703.cda6ca8 → 0.3.5-pr.704.9ebdc72
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 +53 -272
- package/dist/cli/index.js.map +11 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,6 +83,7 @@ These work with any command:
|
|
|
83
83
|
| Flag | Description |
|
|
84
84
|
| ---- | ----------- |
|
|
85
85
|
| `--app-id <id>` | Target a Base44 app explicitly (overrides the linked project and `BASE44_APP_ID`) |
|
|
86
|
+
| `--hostname <host>` | Send every request to this Base44 host instead of `app.base44.com`, e.g. `base44 login --hostname acme.base44.com` (overrides `BASE44_API_URL`; a full URL also works). Pass it on every command, or set `BASE44_API_URL` once |
|
|
86
87
|
| `--json` | Emit machine-readable JSON to stdout and run in silent mode |
|
|
87
88
|
|
|
88
89
|
### `--json`
|
package/dist/cli/index.js
CHANGED
|
@@ -31560,7 +31560,7 @@ function cleanDoc(doc) {
|
|
|
31560
31560
|
return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc));
|
|
31561
31561
|
}
|
|
31562
31562
|
function replaceEndOfLine(doc, replacement = literalline) {
|
|
31563
|
-
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ?
|
|
31563
|
+
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join32(replacement, currentDoc.split(`
|
|
31564
31564
|
`)) : currentDoc);
|
|
31565
31565
|
}
|
|
31566
31566
|
function canBreakFn(doc) {
|
|
@@ -31640,7 +31640,7 @@ function indentIfBreak(contents, options) {
|
|
|
31640
31640
|
negate: options.negate
|
|
31641
31641
|
};
|
|
31642
31642
|
}
|
|
31643
|
-
function
|
|
31643
|
+
function join32(separator, docs) {
|
|
31644
31644
|
assertDoc(separator);
|
|
31645
31645
|
assertDocArray(docs);
|
|
31646
31646
|
const parts = [];
|
|
@@ -32351,7 +32351,7 @@ var init_doc = __esm(() => {
|
|
|
32351
32351
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
32352
32352
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
32353
32353
|
builders = {
|
|
32354
|
-
join:
|
|
32354
|
+
join: join32,
|
|
32355
32355
|
line,
|
|
32356
32356
|
softline,
|
|
32357
32357
|
hardline,
|
|
@@ -125190,7 +125190,7 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
125190
125190
|
}
|
|
125191
125191
|
}
|
|
125192
125192
|
}, ast_path_default, is_object_default, skipWhitespace, skipSpaces, skipToLineEnd, skipEverythingButNewLine, isNewlineCharacter = (character) => character === `
|
|
125193
|
-
` || 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,
|
|
125193
|
+
` || 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, join34, 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) => {
|
|
125194
125194
|
try {
|
|
125195
125195
|
return path112.basename(toPath3(file));
|
|
125196
125196
|
} catch {
|
|
@@ -135219,7 +135219,7 @@ ${codeblock}`, options8);
|
|
|
135219
135219
|
breakParent: breakParent2,
|
|
135220
135220
|
hardline: hardline2,
|
|
135221
135221
|
indent: indent2,
|
|
135222
|
-
join:
|
|
135222
|
+
join: join34,
|
|
135223
135223
|
line: line22,
|
|
135224
135224
|
lineSuffix: lineSuffix2
|
|
135225
135225
|
} = builders);
|
|
@@ -228886,10 +228886,23 @@ function normalizeBase44Env() {
|
|
|
228886
228886
|
}
|
|
228887
228887
|
|
|
228888
228888
|
// src/cli/bootstrap-env.ts
|
|
228889
|
+
function applyHostnameFlag(argv) {
|
|
228890
|
+
const i = argv.findIndex((arg) => arg === "--hostname" || arg.startsWith("--hostname="));
|
|
228891
|
+
if (i === -1) {
|
|
228892
|
+
return;
|
|
228893
|
+
}
|
|
228894
|
+
const value = argv[i].includes("=") ? argv[i].slice("--hostname=".length) : argv[i + 1];
|
|
228895
|
+
if (!value || value.startsWith("-")) {
|
|
228896
|
+
return;
|
|
228897
|
+
}
|
|
228898
|
+
const url = value.includes("://") ? value : `https://${value}`;
|
|
228899
|
+
process.env.BASE44_API_URL = url.replace(/\/+$/, "");
|
|
228900
|
+
}
|
|
228901
|
+
applyHostnameFlag(process.argv);
|
|
228889
228902
|
loadProjectEnvFiles();
|
|
228890
228903
|
|
|
228891
228904
|
// src/cli/index.ts
|
|
228892
|
-
import { dirname as dirname31, join as
|
|
228905
|
+
import { dirname as dirname31, join as join42 } from "node:path";
|
|
228893
228906
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
228894
228907
|
|
|
228895
228908
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -252869,33 +252882,6 @@ function declaredActor({
|
|
|
252869
252882
|
static_egress: staticEgress
|
|
252870
252883
|
};
|
|
252871
252884
|
}
|
|
252872
|
-
function declaredRoutes({
|
|
252873
|
-
pages,
|
|
252874
|
-
home,
|
|
252875
|
-
entityPages,
|
|
252876
|
-
entityFreePaths
|
|
252877
|
-
}) {
|
|
252878
|
-
return {
|
|
252879
|
-
pages: pages.map(({ path, name, file, requiresAuth, binding, segmentValues }) => ({
|
|
252880
|
-
path,
|
|
252881
|
-
name,
|
|
252882
|
-
file,
|
|
252883
|
-
...requiresAuth ? { requires_auth: true } : {},
|
|
252884
|
-
...binding ? {
|
|
252885
|
-
binding: {
|
|
252886
|
-
entity: binding.entity,
|
|
252887
|
-
param: binding.param,
|
|
252888
|
-
field: binding.field,
|
|
252889
|
-
...binding.extraParams ? { extra_params: binding.extraParams } : {}
|
|
252890
|
-
}
|
|
252891
|
-
} : {},
|
|
252892
|
-
...segmentValues ? { segment_values: segmentValues } : {}
|
|
252893
|
-
})),
|
|
252894
|
-
home,
|
|
252895
|
-
...entityPages ? { entity_pages: entityPages } : {},
|
|
252896
|
-
...entityFreePaths ? { entity_free_paths: entityFreePaths } : {}
|
|
252897
|
-
};
|
|
252898
|
-
}
|
|
252899
252885
|
function actorUploadPath(actor) {
|
|
252900
252886
|
return `actors/${actor.name}.mjs`;
|
|
252901
252887
|
}
|
|
@@ -252958,7 +252944,6 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252958
252944
|
agents: artifacts.agents,
|
|
252959
252945
|
mcp_config: artifacts.mcpConfig,
|
|
252960
252946
|
agent_skills: artifacts.agentSkills,
|
|
252961
|
-
...artifacts.routes ? { routes: declaredRoutes(artifacts.routes) } : {},
|
|
252962
252947
|
source_commit: options.sourceCommit
|
|
252963
252948
|
}, "declaring a version")).json(), "declare");
|
|
252964
252949
|
const declaredFiles = [
|
|
@@ -253004,7 +252989,7 @@ async function setEnvironmentVersion(environment, versionId, options = {}) {
|
|
|
253004
252989
|
}
|
|
253005
252990
|
// src/core/version/artifacts.ts
|
|
253006
252991
|
import { createHash as createHash3 } from "node:crypto";
|
|
253007
|
-
import { join as
|
|
252992
|
+
import { join as join30, resolve as resolve14 } from "node:path";
|
|
253008
252993
|
|
|
253009
252994
|
// src/core/version/actors.ts
|
|
253010
252995
|
import { dirname as dirname22, relative as relative7, resolve as resolve13 } from "node:path";
|
|
@@ -264751,205 +264736,6 @@ async function publishVersion(artifacts, options = {}) {
|
|
|
264751
264736
|
};
|
|
264752
264737
|
}
|
|
264753
264738
|
|
|
264754
|
-
// src/core/version/routes.ts
|
|
264755
|
-
import { join as join30 } from "node:path";
|
|
264756
|
-
var RoutesFileSchema = object({
|
|
264757
|
-
pages: array(object({
|
|
264758
|
-
path: string2().startsWith("/"),
|
|
264759
|
-
name: string2().min(1),
|
|
264760
|
-
file: string2().min(1),
|
|
264761
|
-
requires_auth: boolean2().optional(),
|
|
264762
|
-
binding: object({
|
|
264763
|
-
entity: string2().min(1),
|
|
264764
|
-
param: string2().min(1),
|
|
264765
|
-
field: string2().min(1),
|
|
264766
|
-
extra_params: record(string2(), string2()).optional()
|
|
264767
|
-
}).optional(),
|
|
264768
|
-
segment_values: record(string2(), array(string2())).optional()
|
|
264769
|
-
})),
|
|
264770
|
-
home: string2().nullable().optional(),
|
|
264771
|
-
entity_pages: record(string2(), array(string2())).optional(),
|
|
264772
|
-
entity_free_paths: array(string2()).optional()
|
|
264773
|
-
}).transform((data) => ({
|
|
264774
|
-
pages: data.pages.map((page) => ({
|
|
264775
|
-
path: page.path,
|
|
264776
|
-
name: page.name,
|
|
264777
|
-
file: page.file,
|
|
264778
|
-
...page.requires_auth ? { requiresAuth: true } : {},
|
|
264779
|
-
...page.binding ? {
|
|
264780
|
-
binding: {
|
|
264781
|
-
entity: page.binding.entity,
|
|
264782
|
-
param: page.binding.param,
|
|
264783
|
-
field: page.binding.field,
|
|
264784
|
-
...page.binding.extra_params ? { extraParams: page.binding.extra_params } : {}
|
|
264785
|
-
}
|
|
264786
|
-
} : {},
|
|
264787
|
-
...page.segment_values ? { segmentValues: page.segment_values } : {}
|
|
264788
|
-
})),
|
|
264789
|
-
home: data.home ?? null,
|
|
264790
|
-
...data.entity_pages ? { entityPages: data.entity_pages } : {},
|
|
264791
|
-
...data.entity_free_paths ? { entityFreePaths: data.entity_free_paths } : {}
|
|
264792
|
-
}));
|
|
264793
|
-
async function readRoutesFile(path) {
|
|
264794
|
-
const parsed = RoutesFileSchema.safeParse(await readJsonFile(path));
|
|
264795
|
-
if (!parsed.success) {
|
|
264796
|
-
throw new SchemaValidationError("Invalid routes file", parsed.error, path);
|
|
264797
|
-
}
|
|
264798
|
-
return parsed.data;
|
|
264799
|
-
}
|
|
264800
|
-
async function collectRoutes(projectRoot, routesFile) {
|
|
264801
|
-
if (routesFile) {
|
|
264802
|
-
return await readRoutesFile(routesFile);
|
|
264803
|
-
}
|
|
264804
|
-
const pages = await collectPages(projectRoot);
|
|
264805
|
-
return pages ? { pages, home: pages[0]?.name ?? null } : null;
|
|
264806
|
-
}
|
|
264807
|
-
var ROUTES_DIR = "src/routes";
|
|
264808
|
-
var ROUTE_TREE = "src/routeTree.gen.ts";
|
|
264809
|
-
var ROUTE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".js"];
|
|
264810
|
-
var DOT_SPLIT = /\.(?![^[]*\])/;
|
|
264811
|
-
var BRACKETS = /\[([^\]]*)\]/g;
|
|
264812
|
-
var BRACE_PARAM = /\{(-?)\$([^{}[\]]+)\}(?![^[]*\])/;
|
|
264813
|
-
var COMPANION_SUFFIXES = new Set([
|
|
264814
|
-
"component",
|
|
264815
|
-
"errorComponent",
|
|
264816
|
-
"notFoundComponent",
|
|
264817
|
-
"pendingComponent",
|
|
264818
|
-
"loader"
|
|
264819
|
-
]);
|
|
264820
|
-
var SERVER_KEY = /\bserver\s*:\s*\{/;
|
|
264821
|
-
var COMPONENT_KEY = /\bcomponent['"]?\s*[:,}(]/;
|
|
264822
|
-
|
|
264823
|
-
class Segment {
|
|
264824
|
-
text;
|
|
264825
|
-
url;
|
|
264826
|
-
leadEscaped;
|
|
264827
|
-
literal;
|
|
264828
|
-
constructor(raw) {
|
|
264829
|
-
this.text = raw.replace(BRACKETS, "$1");
|
|
264830
|
-
this.leadEscaped = raw.startsWith("[");
|
|
264831
|
-
this.literal = raw === this.text;
|
|
264832
|
-
const name = raw.length > 1 && raw.endsWith("_") ? raw.slice(0, -1) : raw;
|
|
264833
|
-
const param = BRACE_PARAM.exec(name);
|
|
264834
|
-
this.url = param ? `:${param[2]}${param[1] ? "?" : ""}` : name.replace(BRACKETS, "$1");
|
|
264835
|
-
}
|
|
264836
|
-
isToken(...tokens) {
|
|
264837
|
-
return this.literal && tokens.includes(this.text);
|
|
264838
|
-
}
|
|
264839
|
-
isPathless() {
|
|
264840
|
-
return !this.leadEscaped && this.text.startsWith("_");
|
|
264841
|
-
}
|
|
264842
|
-
isGroup() {
|
|
264843
|
-
return !this.leadEscaped && this.text.startsWith("(") && this.text.endsWith(")");
|
|
264844
|
-
}
|
|
264845
|
-
}
|
|
264846
|
-
function segmentsOf(relativePath) {
|
|
264847
|
-
const segments = [];
|
|
264848
|
-
for (const name of relativePath.split("/")) {
|
|
264849
|
-
if (name.startsWith("-")) {
|
|
264850
|
-
return null;
|
|
264851
|
-
}
|
|
264852
|
-
for (const raw of name.split(DOT_SPLIT)) {
|
|
264853
|
-
if (!raw) {
|
|
264854
|
-
continue;
|
|
264855
|
-
}
|
|
264856
|
-
const segment = new Segment(raw);
|
|
264857
|
-
if (!segment.text || !segment.leadEscaped && segment.text.startsWith("__")) {
|
|
264858
|
-
return null;
|
|
264859
|
-
}
|
|
264860
|
-
segments.push(segment);
|
|
264861
|
-
}
|
|
264862
|
-
}
|
|
264863
|
-
return segments.length > 0 ? segments : null;
|
|
264864
|
-
}
|
|
264865
|
-
function pageName(parts) {
|
|
264866
|
-
if (parts.length === 0) {
|
|
264867
|
-
return "Home";
|
|
264868
|
-
}
|
|
264869
|
-
return parts.flatMap((part) => part.split(/[^A-Za-z0-9]/)).filter(Boolean).map((piece) => piece.charAt(0).toUpperCase() + piece.slice(1)).join("");
|
|
264870
|
-
}
|
|
264871
|
-
function pageOfRouteFile(relativePath) {
|
|
264872
|
-
const segments = segmentsOf(relativePath);
|
|
264873
|
-
if (segments === null || segments[0].isToken("api")) {
|
|
264874
|
-
return null;
|
|
264875
|
-
}
|
|
264876
|
-
if (segments[segments.length - 1].isToken("lazy")) {
|
|
264877
|
-
segments.pop();
|
|
264878
|
-
}
|
|
264879
|
-
const last = () => segments[segments.length - 1];
|
|
264880
|
-
if (last()?.isToken(...COMPANION_SUFFIXES)) {
|
|
264881
|
-
return null;
|
|
264882
|
-
}
|
|
264883
|
-
let poppedIndex = false;
|
|
264884
|
-
while (last()?.isToken("index", "route")) {
|
|
264885
|
-
poppedIndex ||= last()?.text === "index";
|
|
264886
|
-
segments.pop();
|
|
264887
|
-
}
|
|
264888
|
-
const end = last();
|
|
264889
|
-
if (end && !poppedIndex && (end.isPathless() || end.isGroup())) {
|
|
264890
|
-
return null;
|
|
264891
|
-
}
|
|
264892
|
-
const urlSegments = [];
|
|
264893
|
-
for (const segment of segments) {
|
|
264894
|
-
if (segment.isPathless() || segment.isGroup()) {
|
|
264895
|
-
continue;
|
|
264896
|
-
}
|
|
264897
|
-
let url = segment.url;
|
|
264898
|
-
if (!segment.leadEscaped && url === "$") {
|
|
264899
|
-
return null;
|
|
264900
|
-
}
|
|
264901
|
-
if (!segment.leadEscaped && url.startsWith("$")) {
|
|
264902
|
-
url = `:${url.slice(1)}`;
|
|
264903
|
-
}
|
|
264904
|
-
urlSegments.push(url);
|
|
264905
|
-
}
|
|
264906
|
-
return { path: `/${urlSegments.join("/")}`, name: pageName(urlSegments) };
|
|
264907
|
-
}
|
|
264908
|
-
function isServerOnly(source) {
|
|
264909
|
-
return SERVER_KEY.test(source) && !COMPONENT_KEY.test(source);
|
|
264910
|
-
}
|
|
264911
|
-
function byCodePoint2(a, b) {
|
|
264912
|
-
return a < b ? -1 : a > b ? 1 : 0;
|
|
264913
|
-
}
|
|
264914
|
-
async function collectPages(projectRoot) {
|
|
264915
|
-
if (!await pathExists(join30(projectRoot, ROUTE_TREE))) {
|
|
264916
|
-
return null;
|
|
264917
|
-
}
|
|
264918
|
-
const routesDir = join30(projectRoot, ROUTES_DIR);
|
|
264919
|
-
const files = await pathExists(routesDir) ? await globby("**/*", {
|
|
264920
|
-
cwd: routesDir,
|
|
264921
|
-
onlyFiles: true,
|
|
264922
|
-
followSymbolicLinks: false
|
|
264923
|
-
}) : [];
|
|
264924
|
-
const byPath = new Map;
|
|
264925
|
-
for (const relativeFile of files.sort(byCodePoint2)) {
|
|
264926
|
-
const extension = ROUTE_EXTENSIONS.find((ext) => relativeFile.endsWith(ext));
|
|
264927
|
-
if (!extension || relativeFile.endsWith(".d.ts")) {
|
|
264928
|
-
continue;
|
|
264929
|
-
}
|
|
264930
|
-
const page = pageOfRouteFile(relativeFile.slice(0, -extension.length));
|
|
264931
|
-
if (page === null || byPath.has(page.path)) {
|
|
264932
|
-
continue;
|
|
264933
|
-
}
|
|
264934
|
-
if (isServerOnly(await readTextFile(join30(routesDir, relativeFile)))) {
|
|
264935
|
-
continue;
|
|
264936
|
-
}
|
|
264937
|
-
byPath.set(page.path, {
|
|
264938
|
-
name: page.name,
|
|
264939
|
-
file: `${ROUTES_DIR}/${relativeFile}`
|
|
264940
|
-
});
|
|
264941
|
-
}
|
|
264942
|
-
const taken = new Set;
|
|
264943
|
-
return [...byPath].sort(([a], [b]) => a === "/" ? -1 : b === "/" ? 1 : byCodePoint2(a, b)).map(([path, { name, file }]) => {
|
|
264944
|
-
let unique = name;
|
|
264945
|
-
for (let n = 2;taken.has(unique); n++) {
|
|
264946
|
-
unique = `${name}${n}`;
|
|
264947
|
-
}
|
|
264948
|
-
taken.add(unique);
|
|
264949
|
-
return { path, name: unique, file };
|
|
264950
|
-
});
|
|
264951
|
-
}
|
|
264952
|
-
|
|
264953
264739
|
// src/core/version/artifacts.ts
|
|
264954
264740
|
var MAX_FILE_COUNT = 50000;
|
|
264955
264741
|
var HASH_CONCURRENCY = 32;
|
|
@@ -265010,12 +264796,12 @@ async function readRawResources(dir) {
|
|
|
265010
264796
|
const payloads = {};
|
|
265011
264797
|
for (const relativePath of files.sort()) {
|
|
265012
264798
|
const name = relativePath.replace(/\.jsonc?$/, "");
|
|
265013
|
-
payloads[name] = await readJsonFile(
|
|
264799
|
+
payloads[name] = await readJsonFile(join30(dir, ...relativePath.split("/")));
|
|
265014
264800
|
}
|
|
265015
264801
|
return payloads;
|
|
265016
264802
|
}
|
|
265017
264803
|
async function readMcpConfig(configDir) {
|
|
265018
|
-
const path =
|
|
264804
|
+
const path = join30(configDir, "mcp", "config.json");
|
|
265019
264805
|
return await pathExists(path) ? await readTextFile(path) : "";
|
|
265020
264806
|
}
|
|
265021
264807
|
async function readAgentSkillFiles(dir) {
|
|
@@ -265029,32 +264815,30 @@ async function readAgentSkillFiles(dir) {
|
|
|
265029
264815
|
});
|
|
265030
264816
|
const skills = {};
|
|
265031
264817
|
for (const file of files.sort()) {
|
|
265032
|
-
skills[file.replace(/\.md$/, "")] = await readTextFile(
|
|
264818
|
+
skills[file.replace(/\.md$/, "")] = await readTextFile(join30(dir, file));
|
|
265033
264819
|
}
|
|
265034
264820
|
return skills;
|
|
265035
264821
|
}
|
|
265036
264822
|
async function collectResources(configDir, dirs) {
|
|
265037
264823
|
const [entities, agents, mcpConfig, agentSkills] = await Promise.all([
|
|
265038
|
-
readRawResources(
|
|
265039
|
-
readRawResources(
|
|
264824
|
+
readRawResources(join30(configDir, dirs.entitiesDir)),
|
|
264825
|
+
readRawResources(join30(configDir, dirs.agentsDir)),
|
|
265040
264826
|
readMcpConfig(configDir),
|
|
265041
|
-
readAgentSkillFiles(
|
|
264827
|
+
readAgentSkillFiles(join30(configDir, dirs.agentSkillsDir))
|
|
265042
264828
|
]);
|
|
265043
264829
|
return { entities, agents, mcpConfig, agentSkills };
|
|
265044
264830
|
}
|
|
265045
|
-
async function collectArtifacts(target
|
|
264831
|
+
async function collectArtifacts(target) {
|
|
265046
264832
|
const built = await resolveFullStackBuild(target.root);
|
|
265047
264833
|
const siteWorker = built ? await describeSiteWorker(built) : null;
|
|
265048
|
-
const routes = await collectRoutes(target.root, options.routesFile);
|
|
265049
264834
|
return {
|
|
265050
264835
|
assets: built ? built.assetsDir ? await collectBuildOutput(built.assetsDir) : [] : await collectBuildOutput(target.outputDir, {
|
|
265051
264836
|
entryFile: ENTRY2
|
|
265052
264837
|
}),
|
|
265053
264838
|
...siteWorker ? { siteWorker } : {},
|
|
265054
|
-
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root,
|
|
265055
|
-
actors: await tagStep2("build", () => compileActors(
|
|
265056
|
-
...await collectResources(target.configDir, target)
|
|
265057
|
-
...routes ? { routes } : {}
|
|
264839
|
+
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root, join30(target.configDir, target.functionsDir))),
|
|
264840
|
+
actors: await tagStep2("build", () => compileActors(join30(target.configDir, target.actorsDir))),
|
|
264841
|
+
...await collectResources(target.configDir, target)
|
|
265058
264842
|
};
|
|
265059
264843
|
}
|
|
265060
264844
|
// src/core/version/gate.ts
|
|
@@ -265073,9 +264857,6 @@ function targetOption() {
|
|
|
265073
264857
|
function gitHashOption() {
|
|
265074
264858
|
return new Option2("--git-hash <hash>", "Commit the build came from (defaults to the checkout's HEAD)").argParser(parseGitHash);
|
|
265075
264859
|
}
|
|
265076
|
-
function routesFileOption() {
|
|
265077
|
-
return new Option2("--routes-file <path>", "The app's routes as JSON, instead of reading them from its route files");
|
|
265078
|
-
}
|
|
265079
264860
|
function concurrencyOption() {
|
|
265080
264861
|
return new Option2("--concurrency <n>", "Parallel file uploads").default(DEFAULT_VERSION_UPLOAD_CONCURRENCY).argParser((value) => {
|
|
265081
264862
|
const parsed = Number(value);
|
|
@@ -265100,7 +264881,7 @@ async function publishAction(ctx, options) {
|
|
|
265100
264881
|
}
|
|
265101
264882
|
const gitHash = await resolveProvenanceCommit(target.root, options.gitHash);
|
|
265102
264883
|
const result = await runTask("Publishing...", async (updateMessage) => {
|
|
265103
|
-
const artifacts = await tagStep2("create_version", () => collectArtifacts(target
|
|
264884
|
+
const artifacts = await tagStep2("create_version", () => collectArtifacts(target));
|
|
265104
264885
|
return await publishVersion(artifacts, {
|
|
265105
264886
|
sourceCommit: gitHash,
|
|
265106
264887
|
target: options.target,
|
|
@@ -265121,7 +264902,7 @@ async function publishAction(ctx, options) {
|
|
|
265121
264902
|
};
|
|
265122
264903
|
}
|
|
265123
264904
|
function getPublishCommand() {
|
|
265124
|
-
return new Base44Command("publish").description("Build the app, record it as a version, and serve that version").option("--no-build", "Publish the existing build output without rebuilding").addOption(outputDirOption()).addOption(targetOption()).addOption(gitHashOption()).addOption(concurrencyOption()).
|
|
264905
|
+
return new Base44Command("publish").description("Build the app, record it as a version, and serve that version").option("--no-build", "Publish the existing build output without rebuilding").addOption(outputDirOption()).addOption(targetOption()).addOption(gitHashOption()).addOption(concurrencyOption()).action(publishAction);
|
|
265125
264906
|
}
|
|
265126
264907
|
|
|
265127
264908
|
// src/core/resources/sandbox/schema.ts
|
|
@@ -266029,7 +265810,7 @@ async function prepareSessionImages(content) {
|
|
|
266029
265810
|
import { createReadStream as createReadStream3 } from "node:fs";
|
|
266030
265811
|
import { realpath, rm as rm3, stat as stat6 } from "node:fs/promises";
|
|
266031
265812
|
import { homedir as homedir4 } from "node:os";
|
|
266032
|
-
import { dirname as dirname23, join as
|
|
265813
|
+
import { dirname as dirname23, join as join31 } from "node:path";
|
|
266033
265814
|
import { createInterface as createInterface2 } from "node:readline";
|
|
266034
265815
|
|
|
266035
265816
|
// ../../node_modules/tmp-promise/index.js
|
|
@@ -266042,8 +265823,8 @@ var $dir = async (options) => dirWithOptions(options);
|
|
|
266042
265823
|
var $tmpName = promisify12(tmp.tmpName);
|
|
266043
265824
|
|
|
266044
265825
|
// src/core/session-import/sessions.ts
|
|
266045
|
-
var claudeDir = () => process.env.CLAUDE_CONFIG_DIR ||
|
|
266046
|
-
var codexDir = () => process.env.CODEX_HOME ||
|
|
265826
|
+
var claudeDir = () => process.env.CLAUDE_CONFIG_DIR || join31(homedir4(), ".claude");
|
|
265827
|
+
var codexDir = () => process.env.CODEX_HOME || join31(homedir4(), ".codex");
|
|
266047
265828
|
async function scanLines(path, pick, maxLines = Number.POSITIVE_INFINITY) {
|
|
266048
265829
|
const lines = createInterface2({ input: createReadStream3(path) });
|
|
266049
265830
|
let count = 0;
|
|
@@ -266199,7 +265980,7 @@ async function teleportSession(sessionId, cwd) {
|
|
|
266199
265980
|
throw new InvalidInputError("Run this from a folder with the app's GitHub repository, so the session can be checked out.");
|
|
266200
265981
|
}
|
|
266201
265982
|
const tmp = await $dir({ unsafeCleanup: true });
|
|
266202
|
-
const repo =
|
|
265983
|
+
const repo = join31(tmp.path, "repo");
|
|
266203
265984
|
let projectFolder;
|
|
266204
265985
|
try {
|
|
266205
265986
|
await execa("git", ["clone", "--quiet", origin.stdout, repo]);
|
|
@@ -266788,10 +266569,10 @@ function toPascalCase(name) {
|
|
|
266788
266569
|
return name.split(/[-_\s]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
|
|
266789
266570
|
}
|
|
266790
266571
|
// src/core/types/update-project.ts
|
|
266791
|
-
import { join as
|
|
266572
|
+
import { join as join35 } from "node:path";
|
|
266792
266573
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
266793
266574
|
async function updateProjectConfig(projectRoot) {
|
|
266794
|
-
const tsconfigPath =
|
|
266575
|
+
const tsconfigPath = join35(projectRoot, "tsconfig.json");
|
|
266795
266576
|
if (!await pathExists(tsconfigPath)) {
|
|
266796
266577
|
return false;
|
|
266797
266578
|
}
|
|
@@ -266847,7 +266628,7 @@ async function createAction2(ctx, options) {
|
|
|
266847
266628
|
outputDir: options.outputDir
|
|
266848
266629
|
});
|
|
266849
266630
|
const gitHash = await resolveProvenanceCommit(target.root, options.gitHash);
|
|
266850
|
-
const version = await runTask("Creating version...", async (updateMessage) => await createVersion(await collectArtifacts(target
|
|
266631
|
+
const version = await runTask("Creating version...", async (updateMessage) => await createVersion(await collectArtifacts(target), {
|
|
266851
266632
|
sourceCommit: gitHash,
|
|
266852
266633
|
concurrency: options.concurrency,
|
|
266853
266634
|
progress: {
|
|
@@ -266865,7 +266646,7 @@ async function createAction2(ctx, options) {
|
|
|
266865
266646
|
};
|
|
266866
266647
|
}
|
|
266867
266648
|
function getVersionCreateCommand() {
|
|
266868
|
-
return new Base44Command("create").description("Record the built output as a version, without deploying it").addOption(outputDirOption()).addOption(gitHashOption()).addOption(concurrencyOption()).
|
|
266649
|
+
return new Base44Command("create").description("Record the built output as a version, without deploying it").addOption(outputDirOption()).addOption(gitHashOption()).addOption(concurrencyOption()).action(createAction2);
|
|
266869
266650
|
}
|
|
266870
266651
|
|
|
266871
266652
|
// src/cli/commands/versions/deploy.ts
|
|
@@ -267272,7 +267053,7 @@ function getWorkspaceCommand() {
|
|
|
267272
267053
|
// src/cli/dev/dev-server/main.ts
|
|
267273
267054
|
var import_cors = __toESM(require_lib4(), 1);
|
|
267274
267055
|
var import_express6 = __toESM(require_express(), 1);
|
|
267275
|
-
import { dirname as dirname29, join as
|
|
267056
|
+
import { dirname as dirname29, join as join40 } from "node:path";
|
|
267276
267057
|
|
|
267277
267058
|
// ../../node_modules/get-port/index.js
|
|
267278
267059
|
import net from "node:net";
|
|
@@ -267393,7 +267174,7 @@ var import_http_proxy_middleware2 = __toESM(require_dist2(), 1);
|
|
|
267393
267174
|
|
|
267394
267175
|
// src/cli/dev/dev-server/function-manager.ts
|
|
267395
267176
|
import { spawn as spawn3 } from "node:child_process";
|
|
267396
|
-
import { dirname as dirname26, join as
|
|
267177
|
+
import { dirname as dirname26, join as join36 } from "node:path";
|
|
267397
267178
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
267398
267179
|
|
|
267399
267180
|
// src/cli/dev/dev-server/base-function-manager.ts
|
|
@@ -267498,7 +267279,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
267498
267279
|
}
|
|
267499
267280
|
spawnFunction(func, port) {
|
|
267500
267281
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
267501
|
-
const importMapPath =
|
|
267282
|
+
const importMapPath = join36(dirname26(this.wrapperPath), "import-map.json");
|
|
267502
267283
|
const process2 = spawn3("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
267503
267284
|
env: {
|
|
267504
267285
|
...globalThis.process.env,
|
|
@@ -267572,7 +267353,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
267572
267353
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
267573
267354
|
import { isBuiltin as isBuiltin3 } from "node:module";
|
|
267574
267355
|
import { homedir as homedir5 } from "node:os";
|
|
267575
|
-
import { join as
|
|
267356
|
+
import { join as join37 } from "node:path";
|
|
267576
267357
|
import { pathToFileURL as pathToFileURL7 } from "node:url";
|
|
267577
267358
|
var depsPromise;
|
|
267578
267359
|
function loadDeps() {
|
|
@@ -267693,9 +267474,9 @@ export default {
|
|
|
267693
267474
|
};
|
|
267694
267475
|
`;
|
|
267695
267476
|
function ensureBundlerConfig() {
|
|
267696
|
-
const dir =
|
|
267477
|
+
const dir = join37(homedir5(), ".base44", "function-bundler");
|
|
267697
267478
|
mkdirSync2(dir, { recursive: true });
|
|
267698
|
-
const configPath =
|
|
267479
|
+
const configPath = join37(dir, "deno.json");
|
|
267699
267480
|
writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
|
|
267700
267481
|
`);
|
|
267701
267482
|
return configPath;
|
|
@@ -271024,8 +270805,8 @@ async function createDevServer(options) {
|
|
|
271024
270805
|
broadcastEntityEvent(io, appId, entityName, event);
|
|
271025
270806
|
};
|
|
271026
270807
|
const base44ConfigWatcher = new WatchBase44({
|
|
271027
|
-
functions:
|
|
271028
|
-
entities:
|
|
270808
|
+
functions: join40(dirname29(project.configPath), project.functionsDir),
|
|
270809
|
+
entities: join40(dirname29(project.configPath), project.entitiesDir)
|
|
271029
270810
|
}, devLogger);
|
|
271030
270811
|
base44ConfigWatcher.on("change", async (name) => {
|
|
271031
270812
|
try {
|
|
@@ -271228,7 +271009,7 @@ function readExecEnvTarget(env = process.env) {
|
|
|
271228
271009
|
// src/core/exec/run-script.ts
|
|
271229
271010
|
import { spawn as spawn4 } from "node:child_process";
|
|
271230
271011
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
271231
|
-
import { join as
|
|
271012
|
+
import { join as join41 } from "node:path";
|
|
271232
271013
|
var SDK_SPECIFIER = '"npm:@base44/sdk"';
|
|
271233
271014
|
function wrapperSource(sdkVersion) {
|
|
271234
271015
|
const source = readFileSync4(getExecWrapperPath(), "utf-8");
|
|
@@ -271275,7 +271056,7 @@ async function runScript(options) {
|
|
|
271275
271056
|
writeFileSync3(tempWrapper.path, wrapperSource(sdkVersion), "utf-8");
|
|
271276
271057
|
const configDir = await $dir({ unsafeCleanup: true });
|
|
271277
271058
|
cleanupFns.push(configDir.cleanup);
|
|
271278
|
-
const configPath =
|
|
271059
|
+
const configPath = join41(configDir.path, "deno.json");
|
|
271279
271060
|
writeFileSync3(configPath, JSON.stringify(DENO_CONFIG), "utf-8");
|
|
271280
271061
|
try {
|
|
271281
271062
|
const exitCode = await new Promise((resolvePromise) => {
|
|
@@ -271516,7 +271297,7 @@ function getEjectCommand() {
|
|
|
271516
271297
|
// src/cli/program.ts
|
|
271517
271298
|
function createProgram(context) {
|
|
271518
271299
|
const program = new Command2;
|
|
271519
|
-
program.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(package_default.version).option("--branch <name>", "Target an app branch by exact name (sandbox commands only)").addOption(new Option2("--app-id <id>", "Base44 app ID to use").env(BASE44_APP_ID_ENV_VAR)).addOption(new Option2("--json", "Output machine-readable JSON to stdout (status/logs go to stderr)"));
|
|
271300
|
+
program.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(package_default.version).option("--branch <name>", "Target an app branch by exact name (sandbox commands only)").addOption(new Option2("--app-id <id>", "Base44 app ID to use").env(BASE44_APP_ID_ENV_VAR)).option("--hostname <host>", "Base44 host to send every request to (overrides BASE44_API_URL)").addOption(new Option2("--json", "Output machine-readable JSON to stdout (status/logs go to stderr)"));
|
|
271520
271301
|
program.configureHelp({
|
|
271521
271302
|
sortSubcommands: true
|
|
271522
271303
|
});
|
|
@@ -275567,7 +275348,7 @@ function addCommandInfoToErrorReporter(program, errorReporter) {
|
|
|
275567
275348
|
// src/cli/index.ts
|
|
275568
275349
|
var __dirname4 = dirname31(fileURLToPath7(import.meta.url));
|
|
275569
275350
|
async function runCLI(options) {
|
|
275570
|
-
ensureNpmAssets(
|
|
275351
|
+
ensureNpmAssets(join42(__dirname4, "../assets"));
|
|
275571
275352
|
const errorReporter = new ErrorReporter;
|
|
275572
275353
|
errorReporter.registerProcessErrorHandlers();
|
|
275573
275354
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -275606,4 +275387,4 @@ export {
|
|
|
275606
275387
|
runCLI
|
|
275607
275388
|
};
|
|
275608
275389
|
|
|
275609
|
-
//# debugId=
|
|
275390
|
+
//# debugId=3C0AE8361C6AA70364756E2164756E21
|