@base44-preview/cli 0.1.5-pr.576.5e79c21 → 0.1.5-pr.576.9bcf925
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 +23 -94
- package/dist/cli/index.js.map +4 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -213884,7 +213884,7 @@ var require_parse_path = __commonJS((exports, module) => {
|
|
|
213884
213884
|
var reFirstKey = /^[^\[]*/;
|
|
213885
213885
|
var reDigitPath = /^\[(\d+)\]/;
|
|
213886
213886
|
var reNormalPath = /^\[([^\]]+)\]/;
|
|
213887
|
-
function
|
|
213887
|
+
function parsePath(key2) {
|
|
213888
213888
|
function failure() {
|
|
213889
213889
|
return [{ type: "object", key: key2, last: true }];
|
|
213890
213890
|
}
|
|
@@ -213925,7 +213925,7 @@ var require_parse_path = __commonJS((exports, module) => {
|
|
|
213925
213925
|
tail.last = true;
|
|
213926
213926
|
return steps;
|
|
213927
213927
|
}
|
|
213928
|
-
module.exports =
|
|
213928
|
+
module.exports = parsePath;
|
|
213929
213929
|
});
|
|
213930
213930
|
|
|
213931
213931
|
// ../../node_modules/append-field/lib/set-value.js
|
|
@@ -213996,10 +213996,10 @@ var require_set_value = __commonJS((exports, module) => {
|
|
|
213996
213996
|
|
|
213997
213997
|
// ../../node_modules/append-field/index.js
|
|
213998
213998
|
var require_append_field = __commonJS((exports, module) => {
|
|
213999
|
-
var
|
|
213999
|
+
var parsePath = require_parse_path();
|
|
214000
214000
|
var setValue = require_set_value();
|
|
214001
214001
|
function appendField(store, key2, value) {
|
|
214002
|
-
var steps =
|
|
214002
|
+
var steps = parsePath(key2);
|
|
214003
214003
|
steps.reduce(function(context, step) {
|
|
214004
214004
|
return setValue(context, step, context[step.key], value);
|
|
214005
214005
|
}, store);
|
|
@@ -214616,7 +214616,7 @@ var require_buffer_list = __commonJS((exports, module) => {
|
|
|
214616
214616
|
}
|
|
214617
214617
|
}, {
|
|
214618
214618
|
key: "join",
|
|
214619
|
-
value: function
|
|
214619
|
+
value: function join26(s5) {
|
|
214620
214620
|
if (this.length === 0)
|
|
214621
214621
|
return "";
|
|
214622
214622
|
var p4 = this.head;
|
|
@@ -218205,7 +218205,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
218205
218205
|
});
|
|
218206
218206
|
module.exports = __toCommonJS(src_exports);
|
|
218207
218207
|
var import_promises22 = __require("node:fs/promises");
|
|
218208
|
-
var
|
|
218208
|
+
var import_node_fs23 = __require("node:fs");
|
|
218209
218209
|
var DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
218210
218210
|
var CURSOR2 = "cursor";
|
|
218211
218211
|
var CURSOR_CLI = "cursor-cli";
|
|
@@ -218262,7 +218262,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
218262
218262
|
return { isAgent: true, agent: { name: REPLIT } };
|
|
218263
218263
|
}
|
|
218264
218264
|
try {
|
|
218265
|
-
await (0, import_promises22.access)(DEVIN_LOCAL_PATH,
|
|
218265
|
+
await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs23.constants.F_OK);
|
|
218266
218266
|
return { isAgent: true, agent: { name: DEVIN } };
|
|
218267
218267
|
} catch (error48) {}
|
|
218268
218268
|
return { isAgent: false, agent: undefined };
|
|
@@ -234033,7 +234033,7 @@ function normalizeBase44Env() {
|
|
|
234033
234033
|
loadProjectEnvFiles();
|
|
234034
234034
|
|
|
234035
234035
|
// src/cli/index.ts
|
|
234036
|
-
import { dirname as
|
|
234036
|
+
import { dirname as dirname24, join as join29 } from "node:path";
|
|
234037
234037
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
234038
234038
|
|
|
234039
234039
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -254951,7 +254951,7 @@ function getWorkspaceCommand() {
|
|
|
254951
254951
|
// src/cli/dev/dev-server/main.ts
|
|
254952
254952
|
var import_cors = __toESM(require_lib4(), 1);
|
|
254953
254953
|
var import_express6 = __toESM(require_express(), 1);
|
|
254954
|
-
import { dirname as
|
|
254954
|
+
import { dirname as dirname22, join as join28 } from "node:path";
|
|
254955
254955
|
|
|
254956
254956
|
// ../../node_modules/get-port/index.js
|
|
254957
254957
|
import net from "node:net";
|
|
@@ -255123,79 +255123,8 @@ function createDevLogger(label2, labelColor = theme.styles.dim) {
|
|
|
255123
255123
|
|
|
255124
255124
|
// src/cli/dev/dev-server/function-manager.ts
|
|
255125
255125
|
import { spawn as spawn2 } from "node:child_process";
|
|
255126
|
-
import { dirname as
|
|
255127
|
-
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
255128
|
-
|
|
255129
|
-
// src/cli/dev/dev-server/import-map.ts
|
|
255130
|
-
var import_json52 = __toESM(require_lib(), 1);
|
|
255131
|
-
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
255132
|
-
import { dirname as dirname19, join as join25, parse as parsePath } from "node:path";
|
|
255126
|
+
import { dirname as dirname19, join as join25 } from "node:path";
|
|
255133
255127
|
import { pathToFileURL } from "node:url";
|
|
255134
|
-
var DENO_CONFIG_NAMES = ["deno.json", "deno.jsonc"];
|
|
255135
|
-
function findDenoConfig(startDir) {
|
|
255136
|
-
const { root: root2 } = parsePath(startDir);
|
|
255137
|
-
let dir = startDir;
|
|
255138
|
-
while (true) {
|
|
255139
|
-
for (const name2 of DENO_CONFIG_NAMES) {
|
|
255140
|
-
const candidate = join25(dir, name2);
|
|
255141
|
-
if (existsSync2(candidate))
|
|
255142
|
-
return candidate;
|
|
255143
|
-
}
|
|
255144
|
-
if (dir === root2)
|
|
255145
|
-
return null;
|
|
255146
|
-
const parent = dirname19(dir);
|
|
255147
|
-
if (parent === dir)
|
|
255148
|
-
return null;
|
|
255149
|
-
dir = parent;
|
|
255150
|
-
}
|
|
255151
|
-
}
|
|
255152
|
-
function absolutize(value, baseUrl) {
|
|
255153
|
-
if (!value.startsWith("./") && !value.startsWith("../"))
|
|
255154
|
-
return value;
|
|
255155
|
-
return new URL(value, baseUrl).href;
|
|
255156
|
-
}
|
|
255157
|
-
function absolutizeEntries(entries, baseUrl) {
|
|
255158
|
-
return Object.fromEntries(Object.entries(entries).map(([key2, value]) => [
|
|
255159
|
-
absolutize(key2, baseUrl),
|
|
255160
|
-
absolutize(value, baseUrl)
|
|
255161
|
-
]));
|
|
255162
|
-
}
|
|
255163
|
-
function readImportMap(filePath) {
|
|
255164
|
-
const parsed = import_json52.default.parse(readFileSync3(filePath, "utf-8"));
|
|
255165
|
-
if (!parsed || typeof parsed !== "object")
|
|
255166
|
-
return {};
|
|
255167
|
-
const { imports, scopes } = parsed;
|
|
255168
|
-
return { imports, scopes };
|
|
255169
|
-
}
|
|
255170
|
-
function buildImportMapArg(baseImportMapPath, projectDir) {
|
|
255171
|
-
const baseUrl = pathToFileURL(baseImportMapPath).href;
|
|
255172
|
-
const base = readImportMap(baseImportMapPath);
|
|
255173
|
-
const merged = {
|
|
255174
|
-
imports: absolutizeEntries(base.imports ?? {}, baseUrl),
|
|
255175
|
-
scopes: {}
|
|
255176
|
-
};
|
|
255177
|
-
const projectConfigPath = findDenoConfig(projectDir);
|
|
255178
|
-
if (projectConfigPath) {
|
|
255179
|
-
const projectUrl = pathToFileURL(projectConfigPath).href;
|
|
255180
|
-
let project2 = {};
|
|
255181
|
-
try {
|
|
255182
|
-
project2 = readImportMap(projectConfigPath);
|
|
255183
|
-
} catch {
|
|
255184
|
-
project2 = {};
|
|
255185
|
-
}
|
|
255186
|
-
merged.imports = {
|
|
255187
|
-
...absolutizeEntries(project2.imports ?? {}, projectUrl),
|
|
255188
|
-
...merged.imports
|
|
255189
|
-
};
|
|
255190
|
-
for (const [scope, entries] of Object.entries(project2.scopes ?? {})) {
|
|
255191
|
-
merged.scopes[absolutize(scope, projectUrl)] = absolutizeEntries(entries, projectUrl);
|
|
255192
|
-
}
|
|
255193
|
-
}
|
|
255194
|
-
const json3 = JSON.stringify(merged);
|
|
255195
|
-
return `data:application/json,${encodeURIComponent(json3)}`;
|
|
255196
|
-
}
|
|
255197
|
-
|
|
255198
|
-
// src/cli/dev/dev-server/function-manager.ts
|
|
255199
255128
|
var READY_TIMEOUT = 30000;
|
|
255200
255129
|
|
|
255201
255130
|
class FunctionManager {
|
|
@@ -255278,11 +255207,11 @@ class FunctionManager {
|
|
|
255278
255207
|
}
|
|
255279
255208
|
spawnFunction(func, port) {
|
|
255280
255209
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
255281
|
-
const
|
|
255282
|
-
const process21 = spawn2("deno", ["run", "--allow-all", "--import-map",
|
|
255210
|
+
const importMapPath = join25(dirname19(this.wrapperPath), "import-map.json");
|
|
255211
|
+
const process21 = spawn2("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
255283
255212
|
env: {
|
|
255284
255213
|
...globalThis.process.env,
|
|
255285
|
-
FUNCTION_PATH:
|
|
255214
|
+
FUNCTION_PATH: pathToFileURL(func.entryPath).href,
|
|
255286
255215
|
FUNCTION_PORT: String(port),
|
|
255287
255216
|
FUNCTION_NAME: func.name
|
|
255288
255217
|
},
|
|
@@ -257382,9 +257311,9 @@ class NodeFsHandler {
|
|
|
257382
257311
|
if (this.fsw.closed) {
|
|
257383
257312
|
return;
|
|
257384
257313
|
}
|
|
257385
|
-
const
|
|
257314
|
+
const dirname21 = sp2.dirname(file2);
|
|
257386
257315
|
const basename7 = sp2.basename(file2);
|
|
257387
|
-
const parent = this.fsw._getWatchedDir(
|
|
257316
|
+
const parent = this.fsw._getWatchedDir(dirname21);
|
|
257388
257317
|
let prevStats = stats;
|
|
257389
257318
|
if (parent.has(basename7))
|
|
257390
257319
|
return;
|
|
@@ -257411,7 +257340,7 @@ class NodeFsHandler {
|
|
|
257411
257340
|
prevStats = newStats2;
|
|
257412
257341
|
}
|
|
257413
257342
|
} catch (error48) {
|
|
257414
|
-
this.fsw._remove(
|
|
257343
|
+
this.fsw._remove(dirname21, basename7);
|
|
257415
257344
|
}
|
|
257416
257345
|
} else if (parent.has(basename7)) {
|
|
257417
257346
|
const at13 = newStats.atimeMs;
|
|
@@ -258444,8 +258373,8 @@ async function createDevServer(options8) {
|
|
|
258444
258373
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
258445
258374
|
};
|
|
258446
258375
|
const base44ConfigWatcher = new WatchBase44({
|
|
258447
|
-
functions:
|
|
258448
|
-
entities:
|
|
258376
|
+
functions: join28(dirname22(project2.configPath), project2.functionsDir),
|
|
258377
|
+
entities: join28(dirname22(project2.configPath), project2.entitiesDir)
|
|
258449
258378
|
}, devLogger);
|
|
258450
258379
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
258451
258380
|
try {
|
|
@@ -258840,7 +258769,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
258840
258769
|
import { release, type } from "node:os";
|
|
258841
258770
|
|
|
258842
258771
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
258843
|
-
import { dirname as
|
|
258772
|
+
import { dirname as dirname23, posix, sep } from "path";
|
|
258844
258773
|
function createModulerModifier() {
|
|
258845
258774
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
258846
258775
|
return async (frames) => {
|
|
@@ -258849,7 +258778,7 @@ function createModulerModifier() {
|
|
|
258849
258778
|
return frames;
|
|
258850
258779
|
};
|
|
258851
258780
|
}
|
|
258852
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
258781
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname23(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
258853
258782
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
258854
258783
|
return (filename) => {
|
|
258855
258784
|
if (!filename)
|
|
@@ -263038,9 +262967,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
263038
262967
|
});
|
|
263039
262968
|
}
|
|
263040
262969
|
// src/cli/index.ts
|
|
263041
|
-
var __dirname4 =
|
|
262970
|
+
var __dirname4 = dirname24(fileURLToPath6(import.meta.url));
|
|
263042
262971
|
async function runCLI(options8) {
|
|
263043
|
-
ensureNpmAssets(
|
|
262972
|
+
ensureNpmAssets(join29(__dirname4, "../assets"));
|
|
263044
262973
|
const errorReporter = new ErrorReporter;
|
|
263045
262974
|
errorReporter.registerProcessErrorHandlers();
|
|
263046
262975
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -263079,4 +263008,4 @@ export {
|
|
|
263079
263008
|
CLIExitError
|
|
263080
263009
|
};
|
|
263081
263010
|
|
|
263082
|
-
//# debugId=
|
|
263011
|
+
//# debugId=95C06FCD441C783464756E2164756E21
|