@base44-preview/cli 0.1.15-pr.626.2b403ee → 0.1.15-pr.626.2df644b
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 +252 -306
- package/dist/cli/index.js.map +13 -14
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -239590,8 +239590,94 @@ async function createArchive(pathToArchive, targetArchivePath) {
|
|
|
239590
239590
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
239591
239591
|
import { join as join18 } from "node:path";
|
|
239592
239592
|
|
|
239593
|
-
// src/core/site/
|
|
239593
|
+
// src/core/site/manifest.ts
|
|
239594
|
+
import { createHash } from "node:crypto";
|
|
239595
|
+
import { createReadStream } from "node:fs";
|
|
239594
239596
|
import { stat } from "node:fs/promises";
|
|
239597
|
+
import { basename as basename5, extname, join as join16 } from "node:path";
|
|
239598
|
+
var MAX_ASSET_COUNT = 1e5;
|
|
239599
|
+
var ASSETS_IGNORE_FILE = ".assetsignore";
|
|
239600
|
+
var ALWAYS_IGNORED = new Set([
|
|
239601
|
+
ASSETS_IGNORE_FILE,
|
|
239602
|
+
"wrangler.json",
|
|
239603
|
+
".dev.vars"
|
|
239604
|
+
]);
|
|
239605
|
+
var MIME_TYPES = {
|
|
239606
|
+
".html": "text/html",
|
|
239607
|
+
".htm": "text/html",
|
|
239608
|
+
".css": "text/css",
|
|
239609
|
+
".js": "text/javascript",
|
|
239610
|
+
".mjs": "text/javascript",
|
|
239611
|
+
".json": "application/json",
|
|
239612
|
+
".map": "application/json",
|
|
239613
|
+
".txt": "text/plain",
|
|
239614
|
+
".xml": "application/xml",
|
|
239615
|
+
".svg": "image/svg+xml",
|
|
239616
|
+
".png": "image/png",
|
|
239617
|
+
".jpg": "image/jpeg",
|
|
239618
|
+
".jpeg": "image/jpeg",
|
|
239619
|
+
".gif": "image/gif",
|
|
239620
|
+
".webp": "image/webp",
|
|
239621
|
+
".avif": "image/avif",
|
|
239622
|
+
".ico": "image/x-icon",
|
|
239623
|
+
".woff": "font/woff",
|
|
239624
|
+
".woff2": "font/woff2",
|
|
239625
|
+
".ttf": "font/ttf",
|
|
239626
|
+
".otf": "font/otf",
|
|
239627
|
+
".eot": "application/vnd.ms-fontobject",
|
|
239628
|
+
".mp3": "audio/mpeg",
|
|
239629
|
+
".mp4": "video/mp4",
|
|
239630
|
+
".webm": "video/webm",
|
|
239631
|
+
".pdf": "application/pdf",
|
|
239632
|
+
".wasm": "application/wasm",
|
|
239633
|
+
".webmanifest": "application/manifest+json"
|
|
239634
|
+
};
|
|
239635
|
+
function getAssetContentType(filePath) {
|
|
239636
|
+
return MIME_TYPES[extname(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
239637
|
+
}
|
|
239638
|
+
async function walkBuildOutput(outputDir) {
|
|
239639
|
+
const found = await globby("**/*", {
|
|
239640
|
+
cwd: outputDir,
|
|
239641
|
+
dot: true,
|
|
239642
|
+
onlyFiles: true,
|
|
239643
|
+
followSymbolicLinks: false,
|
|
239644
|
+
ignoreFiles: [ASSETS_IGNORE_FILE]
|
|
239645
|
+
});
|
|
239646
|
+
return found.filter((path) => !ALWAYS_IGNORED.has(basename5(path))).sort();
|
|
239647
|
+
}
|
|
239648
|
+
async function hashAssetFile(appId, absolutePath) {
|
|
239649
|
+
const hash = createHash("sha256").update(Buffer.from(appId, "utf8"));
|
|
239650
|
+
for await (const chunk of createReadStream(absolutePath)) {
|
|
239651
|
+
hash.update(chunk);
|
|
239652
|
+
}
|
|
239653
|
+
return hash.digest("hex").slice(0, 32);
|
|
239654
|
+
}
|
|
239655
|
+
async function buildAssetManifest(assetsDir, appId) {
|
|
239656
|
+
const manifest = {};
|
|
239657
|
+
const filesByHash = new Map;
|
|
239658
|
+
const relativeFilePaths = await walkBuildOutput(assetsDir);
|
|
239659
|
+
if (relativeFilePaths.length > MAX_ASSET_COUNT) {
|
|
239660
|
+
throw new InvalidInputError(`Too many static assets: found ${relativeFilePaths.length}, the limit is ${MAX_ASSET_COUNT} files.`);
|
|
239661
|
+
}
|
|
239662
|
+
for (const relativePath of relativeFilePaths) {
|
|
239663
|
+
const absolutePath = join16(assetsDir, ...relativePath.split("/"));
|
|
239664
|
+
const { size } = await stat(absolutePath);
|
|
239665
|
+
const hash = await hashAssetFile(appId, absolutePath);
|
|
239666
|
+
manifest[`/${relativePath}`] = { hash, size };
|
|
239667
|
+
if (!filesByHash.has(hash)) {
|
|
239668
|
+
filesByHash.set(hash, {
|
|
239669
|
+
absolutePath,
|
|
239670
|
+
hash,
|
|
239671
|
+
size,
|
|
239672
|
+
contentType: getAssetContentType(absolutePath)
|
|
239673
|
+
});
|
|
239674
|
+
}
|
|
239675
|
+
}
|
|
239676
|
+
return { manifest, filesByHash };
|
|
239677
|
+
}
|
|
239678
|
+
|
|
239679
|
+
// src/core/site/modules.ts
|
|
239680
|
+
import { stat as stat2 } from "node:fs/promises";
|
|
239595
239681
|
import { relative as relative5, resolve as resolve3, sep } from "node:path";
|
|
239596
239682
|
var MAX_TOTAL_MODULE_BYTES = 40 * 1024 * 1024;
|
|
239597
239683
|
var MODULE_IGNORE = ["wrangler.json", ".dev.vars"];
|
|
@@ -239666,7 +239752,7 @@ async function collectModules(config) {
|
|
|
239666
239752
|
const modules = [...modulesByName.values()];
|
|
239667
239753
|
let totalBytes = 0;
|
|
239668
239754
|
for (const module of modules) {
|
|
239669
|
-
module.size = (await
|
|
239755
|
+
module.size = (await stat2(module.absolutePath)).size;
|
|
239670
239756
|
totalBytes += module.size;
|
|
239671
239757
|
}
|
|
239672
239758
|
if (totalBytes > MAX_TOTAL_MODULE_BYTES) {
|
|
@@ -239685,104 +239771,8 @@ function addSourcemap(modulesByName, configDir, name) {
|
|
|
239685
239771
|
});
|
|
239686
239772
|
}
|
|
239687
239773
|
|
|
239688
|
-
// src/core/site/
|
|
239689
|
-
import {
|
|
239690
|
-
var WRANGLER_REDIRECT_PATH = join16(".wrangler", "deploy", "config.json");
|
|
239691
|
-
var RedirectConfigSchema = looseObject({
|
|
239692
|
-
configPath: string2().min(1)
|
|
239693
|
-
});
|
|
239694
|
-
var WranglerConfigSchema = looseObject({
|
|
239695
|
-
main: string2().min(1, "wrangler config is missing a 'main' entry module"),
|
|
239696
|
-
no_bundle: boolean2().optional(),
|
|
239697
|
-
rules: array(looseObject({ type: string2(), globs: array(string2()) })).optional(),
|
|
239698
|
-
assets: looseObject({
|
|
239699
|
-
directory: string2().optional(),
|
|
239700
|
-
html_handling: string2().optional(),
|
|
239701
|
-
not_found_handling: string2().optional(),
|
|
239702
|
-
run_worker_first: union([boolean2(), array(string2())]).optional(),
|
|
239703
|
-
headers: string2().optional(),
|
|
239704
|
-
redirects: string2().optional()
|
|
239705
|
-
}).optional(),
|
|
239706
|
-
compatibility_date: string2().optional(),
|
|
239707
|
-
compatibility_flags: array(string2()).optional(),
|
|
239708
|
-
vars: record(string2(), unknown()).optional(),
|
|
239709
|
-
upload_source_maps: boolean2().optional()
|
|
239710
|
-
});
|
|
239711
|
-
async function detectFullStackArtifact(projectRoot) {
|
|
239712
|
-
const redirectPath = join16(projectRoot, WRANGLER_REDIRECT_PATH);
|
|
239713
|
-
return await pathExists(redirectPath) ? redirectPath : null;
|
|
239714
|
-
}
|
|
239715
|
-
async function resolveWranglerConfig(redirectPath) {
|
|
239716
|
-
const configPath = await resolveRedirectedConfigPath(redirectPath);
|
|
239717
|
-
const parsed = await readJsonFile(configPath);
|
|
239718
|
-
const result = WranglerConfigSchema.safeParse(parsed);
|
|
239719
|
-
if (!result.success) {
|
|
239720
|
-
throw new ConfigInvalidError(`Invalid wrangler config: ${prettifyError(result.error)}`, configPath);
|
|
239721
|
-
}
|
|
239722
|
-
const config = result.data;
|
|
239723
|
-
if (config.no_bundle !== true) {
|
|
239724
|
-
throw new InvalidInputError("This framework's output requires bundling; not yet supported. Base44 only deploys pre-bundled Workers output (no_bundle: true).");
|
|
239725
|
-
}
|
|
239726
|
-
const configDir = dirname12(configPath);
|
|
239727
|
-
const assetsDirectory = config.assets?.directory ? resolve4(configDir, config.assets.directory) : null;
|
|
239728
|
-
return {
|
|
239729
|
-
configPath,
|
|
239730
|
-
configDir,
|
|
239731
|
-
main: config.main,
|
|
239732
|
-
assetsDirectory,
|
|
239733
|
-
assetsConfig: config.assets ? toResolvedAssetsConfig(config.assets) : null,
|
|
239734
|
-
compatibilityDate: config.compatibility_date ?? null,
|
|
239735
|
-
compatibilityFlags: config.compatibility_flags ?? [],
|
|
239736
|
-
rules: (config.rules ?? []).map((rule) => ({
|
|
239737
|
-
type: rule.type,
|
|
239738
|
-
globs: rule.globs
|
|
239739
|
-
})),
|
|
239740
|
-
uploadSourceMaps: config.upload_source_maps ?? false
|
|
239741
|
-
};
|
|
239742
|
-
}
|
|
239743
|
-
async function resolveRedirectedConfigPath(redirectPath) {
|
|
239744
|
-
const parsed = await readJsonFile(redirectPath);
|
|
239745
|
-
const result = RedirectConfigSchema.safeParse(parsed);
|
|
239746
|
-
if (!result.success) {
|
|
239747
|
-
throw new ConfigInvalidError(`Invalid deploy redirect file: ${prettifyError(result.error)}`, redirectPath);
|
|
239748
|
-
}
|
|
239749
|
-
const configPath = resolve4(dirname12(redirectPath), result.data.configPath);
|
|
239750
|
-
if (!await pathExists(configPath)) {
|
|
239751
|
-
throw new ConfigInvalidError(`Wrangler config referenced by ${redirectPath} does not exist: ${configPath}`, redirectPath, {
|
|
239752
|
-
hints: [{ message: "Rebuild the project to regenerate the artifact" }]
|
|
239753
|
-
});
|
|
239754
|
-
}
|
|
239755
|
-
return configPath;
|
|
239756
|
-
}
|
|
239757
|
-
function toResolvedAssetsConfig(assets) {
|
|
239758
|
-
return {
|
|
239759
|
-
htmlHandling: assets.html_handling,
|
|
239760
|
-
notFoundHandling: assets.not_found_handling,
|
|
239761
|
-
runWorkerFirst: assets.run_worker_first,
|
|
239762
|
-
headers: assets.headers,
|
|
239763
|
-
redirects: assets.redirects
|
|
239764
|
-
};
|
|
239765
|
-
}
|
|
239766
|
-
|
|
239767
|
-
// src/core/site/full-stack.ts
|
|
239768
|
-
async function resolveFullStackBuild(projectRoot) {
|
|
239769
|
-
const redirectPath = await detectFullStackArtifact(projectRoot);
|
|
239770
|
-
if (!redirectPath) {
|
|
239771
|
-
return null;
|
|
239772
|
-
}
|
|
239773
|
-
const config = await resolveWranglerConfig(redirectPath);
|
|
239774
|
-
return {
|
|
239775
|
-
config,
|
|
239776
|
-
modules: await collectModules(config),
|
|
239777
|
-
assetsDir: config.assetsDirectory && await pathExists(config.assetsDirectory) ? config.assetsDirectory : null
|
|
239778
|
-
};
|
|
239779
|
-
}
|
|
239780
|
-
|
|
239781
|
-
// src/core/site/manifest.ts
|
|
239782
|
-
import { createHash } from "node:crypto";
|
|
239783
|
-
import { createReadStream } from "node:fs";
|
|
239784
|
-
import { stat as stat2 } from "node:fs/promises";
|
|
239785
|
-
import { basename as basename5, extname, join as join17 } from "node:path";
|
|
239774
|
+
// src/core/site/upload.ts
|
|
239775
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
239786
239776
|
|
|
239787
239777
|
// ../../node_modules/p-map/index.js
|
|
239788
239778
|
async function pMap(iterable, mapper, {
|
|
@@ -239908,99 +239898,7 @@ async function pMap(iterable, mapper, {
|
|
|
239908
239898
|
}
|
|
239909
239899
|
var pMapSkip = Symbol("skip");
|
|
239910
239900
|
|
|
239911
|
-
// src/core/site/manifest.ts
|
|
239912
|
-
var MAX_ASSET_COUNT = 1e5;
|
|
239913
|
-
var ASSETS_IGNORE_FILE = ".assetsignore";
|
|
239914
|
-
var ALWAYS_IGNORED = new Set([
|
|
239915
|
-
ASSETS_IGNORE_FILE,
|
|
239916
|
-
"wrangler.json",
|
|
239917
|
-
".dev.vars"
|
|
239918
|
-
]);
|
|
239919
|
-
var MIME_TYPES = {
|
|
239920
|
-
".html": "text/html",
|
|
239921
|
-
".htm": "text/html",
|
|
239922
|
-
".css": "text/css",
|
|
239923
|
-
".js": "text/javascript",
|
|
239924
|
-
".mjs": "text/javascript",
|
|
239925
|
-
".json": "application/json",
|
|
239926
|
-
".map": "application/json",
|
|
239927
|
-
".txt": "text/plain",
|
|
239928
|
-
".xml": "application/xml",
|
|
239929
|
-
".svg": "image/svg+xml",
|
|
239930
|
-
".png": "image/png",
|
|
239931
|
-
".jpg": "image/jpeg",
|
|
239932
|
-
".jpeg": "image/jpeg",
|
|
239933
|
-
".gif": "image/gif",
|
|
239934
|
-
".webp": "image/webp",
|
|
239935
|
-
".avif": "image/avif",
|
|
239936
|
-
".ico": "image/x-icon",
|
|
239937
|
-
".woff": "font/woff",
|
|
239938
|
-
".woff2": "font/woff2",
|
|
239939
|
-
".ttf": "font/ttf",
|
|
239940
|
-
".otf": "font/otf",
|
|
239941
|
-
".eot": "application/vnd.ms-fontobject",
|
|
239942
|
-
".mp3": "audio/mpeg",
|
|
239943
|
-
".mp4": "video/mp4",
|
|
239944
|
-
".webm": "video/webm",
|
|
239945
|
-
".pdf": "application/pdf",
|
|
239946
|
-
".wasm": "application/wasm",
|
|
239947
|
-
".webmanifest": "application/manifest+json"
|
|
239948
|
-
};
|
|
239949
|
-
function getAssetContentType(filePath) {
|
|
239950
|
-
return MIME_TYPES[extname(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
239951
|
-
}
|
|
239952
|
-
async function walkBuildOutput(outputDir) {
|
|
239953
|
-
const found = await globby("**/*", {
|
|
239954
|
-
cwd: outputDir,
|
|
239955
|
-
dot: true,
|
|
239956
|
-
onlyFiles: true,
|
|
239957
|
-
followSymbolicLinks: false,
|
|
239958
|
-
ignoreFiles: [ASSETS_IGNORE_FILE]
|
|
239959
|
-
});
|
|
239960
|
-
return found.filter((path) => !ALWAYS_IGNORED.has(basename5(path))).sort();
|
|
239961
|
-
}
|
|
239962
|
-
var STAT_CONCURRENCY = 32;
|
|
239963
|
-
async function describeBuildOutput(outputDir) {
|
|
239964
|
-
const relativePaths = await walkBuildOutput(outputDir);
|
|
239965
|
-
return await pMap(relativePaths, async (path) => {
|
|
239966
|
-
const absolutePath = join17(outputDir, ...path.split("/"));
|
|
239967
|
-
return { path, absolutePath, size: (await stat2(absolutePath)).size };
|
|
239968
|
-
}, { concurrency: STAT_CONCURRENCY });
|
|
239969
|
-
}
|
|
239970
|
-
async function hashFileInto(hash, absolutePath) {
|
|
239971
|
-
for await (const chunk of createReadStream(absolutePath)) {
|
|
239972
|
-
hash.update(chunk);
|
|
239973
|
-
}
|
|
239974
|
-
return hash;
|
|
239975
|
-
}
|
|
239976
|
-
async function hashAssetFile(appId, absolutePath) {
|
|
239977
|
-
const hash = await hashFileInto(createHash("sha256").update(Buffer.from(appId, "utf8")), absolutePath);
|
|
239978
|
-
return hash.digest("hex").slice(0, 32);
|
|
239979
|
-
}
|
|
239980
|
-
async function buildAssetManifest(assetsDir, appId) {
|
|
239981
|
-
const manifest = {};
|
|
239982
|
-
const filesByHash = new Map;
|
|
239983
|
-
const files = await describeBuildOutput(assetsDir);
|
|
239984
|
-
if (files.length > MAX_ASSET_COUNT) {
|
|
239985
|
-
throw new InvalidInputError(`Too many static assets: found ${files.length}, the limit is ${MAX_ASSET_COUNT} files.`);
|
|
239986
|
-
}
|
|
239987
|
-
for (const { path: relativePath, absolutePath, size } of files) {
|
|
239988
|
-
const hash = await hashAssetFile(appId, absolutePath);
|
|
239989
|
-
manifest[`/${relativePath}`] = { hash, size };
|
|
239990
|
-
if (!filesByHash.has(hash)) {
|
|
239991
|
-
filesByHash.set(hash, {
|
|
239992
|
-
absolutePath,
|
|
239993
|
-
hash,
|
|
239994
|
-
size,
|
|
239995
|
-
contentType: getAssetContentType(absolutePath)
|
|
239996
|
-
});
|
|
239997
|
-
}
|
|
239998
|
-
}
|
|
239999
|
-
return { manifest, filesByHash };
|
|
240000
|
-
}
|
|
240001
|
-
|
|
240002
239901
|
// src/core/site/upload.ts
|
|
240003
|
-
import { readFile as readFile2 } from "node:fs/promises";
|
|
240004
239902
|
var DEFAULT_UPLOAD_CONCURRENCY = 3;
|
|
240005
239903
|
var MAX_UPLOAD_CONCURRENCY = 50;
|
|
240006
239904
|
var MAX_UPLOAD_ATTEMPTS = 3;
|
|
@@ -240099,10 +239997,7 @@ async function uploadPresignedAsset(upload, assets) {
|
|
|
240099
239997
|
if (!file) {
|
|
240100
239998
|
throw new InternalError(`Server requested upload of unknown asset path: ${upload.path}`);
|
|
240101
239999
|
}
|
|
240102
|
-
await
|
|
240103
|
-
}
|
|
240104
|
-
async function putPresigned(upload, absolutePath) {
|
|
240105
|
-
const content = await readFile2(absolutePath);
|
|
240000
|
+
const content = await readFile2(file.absolutePath);
|
|
240106
240001
|
try {
|
|
240107
240002
|
await distribution_default.put(upload.url, {
|
|
240108
240003
|
body: new Uint8Array(content),
|
|
@@ -240118,6 +240013,85 @@ async function putPresigned(upload, absolutePath) {
|
|
|
240118
240013
|
}
|
|
240119
240014
|
}
|
|
240120
240015
|
|
|
240016
|
+
// src/core/site/wrangler-config.ts
|
|
240017
|
+
import { dirname as dirname12, join as join17, resolve as resolve4 } from "node:path";
|
|
240018
|
+
var WRANGLER_REDIRECT_PATH = join17(".wrangler", "deploy", "config.json");
|
|
240019
|
+
var RedirectConfigSchema = looseObject({
|
|
240020
|
+
configPath: string2().min(1)
|
|
240021
|
+
});
|
|
240022
|
+
var WranglerConfigSchema = looseObject({
|
|
240023
|
+
main: string2().min(1, "wrangler config is missing a 'main' entry module"),
|
|
240024
|
+
no_bundle: boolean2().optional(),
|
|
240025
|
+
rules: array(looseObject({ type: string2(), globs: array(string2()) })).optional(),
|
|
240026
|
+
assets: looseObject({
|
|
240027
|
+
directory: string2().optional(),
|
|
240028
|
+
html_handling: string2().optional(),
|
|
240029
|
+
not_found_handling: string2().optional(),
|
|
240030
|
+
run_worker_first: union([boolean2(), array(string2())]).optional(),
|
|
240031
|
+
headers: string2().optional(),
|
|
240032
|
+
redirects: string2().optional()
|
|
240033
|
+
}).optional(),
|
|
240034
|
+
compatibility_date: string2().optional(),
|
|
240035
|
+
compatibility_flags: array(string2()).optional(),
|
|
240036
|
+
vars: record(string2(), unknown()).optional(),
|
|
240037
|
+
upload_source_maps: boolean2().optional()
|
|
240038
|
+
});
|
|
240039
|
+
async function detectFullStackArtifact(projectRoot) {
|
|
240040
|
+
const redirectPath = join17(projectRoot, WRANGLER_REDIRECT_PATH);
|
|
240041
|
+
return await pathExists(redirectPath) ? redirectPath : null;
|
|
240042
|
+
}
|
|
240043
|
+
async function resolveWranglerConfig(redirectPath) {
|
|
240044
|
+
const configPath = await resolveRedirectedConfigPath(redirectPath);
|
|
240045
|
+
const parsed = await readJsonFile(configPath);
|
|
240046
|
+
const result = WranglerConfigSchema.safeParse(parsed);
|
|
240047
|
+
if (!result.success) {
|
|
240048
|
+
throw new ConfigInvalidError(`Invalid wrangler config: ${prettifyError(result.error)}`, configPath);
|
|
240049
|
+
}
|
|
240050
|
+
const config = result.data;
|
|
240051
|
+
if (config.no_bundle !== true) {
|
|
240052
|
+
throw new InvalidInputError("This framework's output requires bundling; not yet supported. Base44 only deploys pre-bundled Workers output (no_bundle: true).");
|
|
240053
|
+
}
|
|
240054
|
+
const configDir = dirname12(configPath);
|
|
240055
|
+
const assetsDirectory = config.assets?.directory ? resolve4(configDir, config.assets.directory) : null;
|
|
240056
|
+
return {
|
|
240057
|
+
configPath,
|
|
240058
|
+
configDir,
|
|
240059
|
+
main: config.main,
|
|
240060
|
+
assetsDirectory,
|
|
240061
|
+
assetsConfig: config.assets ? toResolvedAssetsConfig(config.assets) : null,
|
|
240062
|
+
compatibilityDate: config.compatibility_date ?? null,
|
|
240063
|
+
compatibilityFlags: config.compatibility_flags ?? [],
|
|
240064
|
+
rules: (config.rules ?? []).map((rule) => ({
|
|
240065
|
+
type: rule.type,
|
|
240066
|
+
globs: rule.globs
|
|
240067
|
+
})),
|
|
240068
|
+
uploadSourceMaps: config.upload_source_maps ?? false
|
|
240069
|
+
};
|
|
240070
|
+
}
|
|
240071
|
+
async function resolveRedirectedConfigPath(redirectPath) {
|
|
240072
|
+
const parsed = await readJsonFile(redirectPath);
|
|
240073
|
+
const result = RedirectConfigSchema.safeParse(parsed);
|
|
240074
|
+
if (!result.success) {
|
|
240075
|
+
throw new ConfigInvalidError(`Invalid deploy redirect file: ${prettifyError(result.error)}`, redirectPath);
|
|
240076
|
+
}
|
|
240077
|
+
const configPath = resolve4(dirname12(redirectPath), result.data.configPath);
|
|
240078
|
+
if (!await pathExists(configPath)) {
|
|
240079
|
+
throw new ConfigInvalidError(`Wrangler config referenced by ${redirectPath} does not exist: ${configPath}`, redirectPath, {
|
|
240080
|
+
hints: [{ message: "Rebuild the project to regenerate the artifact" }]
|
|
240081
|
+
});
|
|
240082
|
+
}
|
|
240083
|
+
return configPath;
|
|
240084
|
+
}
|
|
240085
|
+
function toResolvedAssetsConfig(assets) {
|
|
240086
|
+
return {
|
|
240087
|
+
htmlHandling: assets.html_handling,
|
|
240088
|
+
notFoundHandling: assets.not_found_handling,
|
|
240089
|
+
runWorkerFirst: assets.run_worker_first,
|
|
240090
|
+
headers: assets.headers,
|
|
240091
|
+
redirects: assets.redirects
|
|
240092
|
+
};
|
|
240093
|
+
}
|
|
240094
|
+
|
|
240121
240095
|
// src/core/site/deployment.ts
|
|
240122
240096
|
var NO_ASSETS = { manifest: {}, filesByHash: new Map };
|
|
240123
240097
|
var DEPLOYMENTS_API_ENV = "BASE44_DEPLOYMENTS_API";
|
|
@@ -240144,11 +240118,12 @@ async function deployToDeployments(options) {
|
|
|
240144
240118
|
return { deploymentId: finalized.deploymentId, gitHash };
|
|
240145
240119
|
}
|
|
240146
240120
|
async function resolveWorkerBuild(projectRoot, progress) {
|
|
240147
|
-
const
|
|
240148
|
-
if (!
|
|
240121
|
+
const redirectPath = await detectFullStackArtifact(projectRoot);
|
|
240122
|
+
if (!redirectPath) {
|
|
240149
240123
|
return null;
|
|
240150
240124
|
}
|
|
240151
|
-
const
|
|
240125
|
+
const config = await resolveWranglerConfig(redirectPath);
|
|
240126
|
+
const assetsDir = config.assetsDirectory && await pathExists(config.assetsDirectory) ? config.assetsDirectory : null;
|
|
240152
240127
|
return {
|
|
240153
240128
|
config: {
|
|
240154
240129
|
main: config.main,
|
|
@@ -240156,7 +240131,7 @@ async function resolveWorkerBuild(projectRoot, progress) {
|
|
|
240156
240131
|
compatibility_flags: config.compatibilityFlags,
|
|
240157
240132
|
assets: buildAssetsConfig(config.assetsConfig, progress)
|
|
240158
240133
|
},
|
|
240159
|
-
modules,
|
|
240134
|
+
modules: await collectModules(config),
|
|
240160
240135
|
assetsDir
|
|
240161
240136
|
};
|
|
240162
240137
|
}
|
|
@@ -247076,12 +247051,6 @@ async function ensureAppContext(ctx, options = {}) {
|
|
|
247076
247051
|
ctx.app = appContext;
|
|
247077
247052
|
ctx.errorReporter.setContext({ appId: appContext.id });
|
|
247078
247053
|
}
|
|
247079
|
-
function requireApp(ctx) {
|
|
247080
|
-
if (!ctx.app) {
|
|
247081
|
-
throw new InternalError("This command read an app context it never resolved — it is declared with requireAppContext: false.");
|
|
247082
|
-
}
|
|
247083
|
-
return ctx.app;
|
|
247084
|
-
}
|
|
247085
247054
|
|
|
247086
247055
|
// src/cli/utils/version-check.ts
|
|
247087
247056
|
async function checkForUpgrade() {
|
|
@@ -247293,9 +247262,6 @@ var EnvironmentResponseSchema = object({
|
|
|
247293
247262
|
// src/core/version/api.ts
|
|
247294
247263
|
var DEFAULT_VERSION_UPLOAD_CONCURRENCY = 8;
|
|
247295
247264
|
var MAX_VERSION_UPLOAD_CONCURRENCY = 16;
|
|
247296
|
-
function declaredFile({ path, size, digest }) {
|
|
247297
|
-
return { path, size, digest };
|
|
247298
|
-
}
|
|
247299
247265
|
async function post(path, json, doing) {
|
|
247300
247266
|
try {
|
|
247301
247267
|
return await getAppClient().post(path, { json, timeout: 180000 });
|
|
@@ -247319,41 +247285,36 @@ function parse10(schema, body, what) {
|
|
|
247319
247285
|
}
|
|
247320
247286
|
async function createVersion(artifacts, options = {}) {
|
|
247321
247287
|
const declared = parse10(DeclareVersionResponseSchema, await (await post("versions", {
|
|
247322
|
-
static_bundle: artifacts.files.map(
|
|
247323
|
-
|
|
247324
|
-
|
|
247325
|
-
|
|
247326
|
-
|
|
247327
|
-
assets: artifacts.siteWorker.assets.map(declaredFile),
|
|
247328
|
-
compatibility_date: artifacts.siteWorker.compatibilityDate,
|
|
247329
|
-
compatibility_flags: artifacts.siteWorker.compatibilityFlags
|
|
247330
|
-
}
|
|
247331
|
-
} : {},
|
|
247288
|
+
static_bundle: artifacts.files.map(({ path, size, digest }) => ({
|
|
247289
|
+
path,
|
|
247290
|
+
size,
|
|
247291
|
+
digest
|
|
247292
|
+
})),
|
|
247332
247293
|
entities: artifacts.entities,
|
|
247333
247294
|
agents: artifacts.agents,
|
|
247334
247295
|
source_commit: options.sourceCommit
|
|
247335
247296
|
}, "declaring a version")).json(), "declare");
|
|
247336
|
-
const declaredFiles = [
|
|
247337
|
-
...artifacts.files,
|
|
247338
|
-
...artifacts.siteWorker?.modules ?? [],
|
|
247339
|
-
...artifacts.siteWorker?.assets ?? []
|
|
247340
|
-
];
|
|
247341
247297
|
options.progress?.onDeclared?.({
|
|
247342
|
-
fileCount:
|
|
247298
|
+
fileCount: artifacts.files.length,
|
|
247343
247299
|
owedFiles: declared.uploads.length
|
|
247344
247300
|
});
|
|
247345
|
-
|
|
247346
|
-
|
|
247347
|
-
|
|
247348
|
-
|
|
247349
|
-
|
|
247350
|
-
|
|
247351
|
-
|
|
247352
|
-
|
|
247353
|
-
|
|
247354
|
-
|
|
247355
|
-
|
|
247356
|
-
|
|
247301
|
+
await uploadPresignedAssets(declared.uploads, {
|
|
247302
|
+
manifest: Object.fromEntries(artifacts.files.map((file) => [
|
|
247303
|
+
file.path,
|
|
247304
|
+
{ hash: file.digest, size: file.size }
|
|
247305
|
+
])),
|
|
247306
|
+
filesByHash: new Map(artifacts.files.map((file) => [
|
|
247307
|
+
file.digest,
|
|
247308
|
+
{
|
|
247309
|
+
absolutePath: file.absolutePath,
|
|
247310
|
+
hash: file.digest,
|
|
247311
|
+
size: file.size
|
|
247312
|
+
}
|
|
247313
|
+
]))
|
|
247314
|
+
}, {
|
|
247315
|
+
concurrency: options.concurrency ?? DEFAULT_VERSION_UPLOAD_CONCURRENCY,
|
|
247316
|
+
onProgress: options.progress?.onUpload
|
|
247317
|
+
});
|
|
247357
247318
|
return parse10(CreateVersionResponseSchema, await (await post(`versions/${encodeURIComponent(declared.sessionId)}/finalize`, {}, "creating a version")).json(), "create version");
|
|
247358
247319
|
}
|
|
247359
247320
|
async function setEnvironmentVersion(environment, versionId, options = {}) {
|
|
@@ -249761,54 +249722,44 @@ async function maybeAskToBuild(isNonInteractive, buildCommand) {
|
|
|
249761
249722
|
}
|
|
249762
249723
|
// src/core/version/artifacts.ts
|
|
249763
249724
|
import { createHash as createHash2 } from "node:crypto";
|
|
249764
|
-
import {
|
|
249725
|
+
import { createReadStream as createReadStream3 } from "node:fs";
|
|
249726
|
+
import { stat as stat3 } from "node:fs/promises";
|
|
249727
|
+
import { join as join27 } from "node:path";
|
|
249765
249728
|
var MAX_FILE_COUNT = 50000;
|
|
249766
249729
|
var HASH_CONCURRENCY = 32;
|
|
249767
249730
|
var ENTRY2 = "index.html";
|
|
249768
249731
|
async function digestFile(absolutePath) {
|
|
249769
|
-
const hash =
|
|
249732
|
+
const hash = createHash2("sha256");
|
|
249733
|
+
for await (const chunk of createReadStream3(absolutePath)) {
|
|
249734
|
+
hash.update(chunk);
|
|
249735
|
+
}
|
|
249770
249736
|
return `sha256:${hash.digest("hex")}`;
|
|
249771
249737
|
}
|
|
249772
|
-
async function collectBuildOutput(outputDir
|
|
249773
|
-
const
|
|
249774
|
-
if (
|
|
249738
|
+
async function collectBuildOutput(outputDir) {
|
|
249739
|
+
const relativePaths = await walkBuildOutput(outputDir);
|
|
249740
|
+
if (relativePaths.length === 0) {
|
|
249775
249741
|
throw new InvalidInputError(`No files found in ${outputDir}. Build the site before creating a version.`, {
|
|
249776
249742
|
hints: [
|
|
249777
249743
|
{ message: "Run 'base44 build' first", command: "base44 build" }
|
|
249778
249744
|
]
|
|
249779
249745
|
});
|
|
249780
249746
|
}
|
|
249781
|
-
if (
|
|
249782
|
-
throw new InvalidInputError(`Too many files: found ${
|
|
249747
|
+
if (relativePaths.length > MAX_FILE_COUNT) {
|
|
249748
|
+
throw new InvalidInputError(`Too many files: found ${relativePaths.length}, the limit is ${MAX_FILE_COUNT}.`);
|
|
249783
249749
|
}
|
|
249784
|
-
if (
|
|
249750
|
+
if (!relativePaths.includes(ENTRY2)) {
|
|
249785
249751
|
throw new InvalidInputError(`${outputDir} has no ${ENTRY2}, so nothing could enter the site.`);
|
|
249786
249752
|
}
|
|
249787
|
-
return await pMap(
|
|
249788
|
-
|
|
249789
|
-
|
|
249790
|
-
|
|
249791
|
-
|
|
249792
|
-
return null;
|
|
249793
|
-
}
|
|
249794
|
-
const { config, modules, assetsDir } = built;
|
|
249795
|
-
const entry = resolve10(config.configDir, config.main);
|
|
249796
|
-
const main = modules.find((m) => m.absolutePath === entry)?.name;
|
|
249797
|
-
if (!main) {
|
|
249798
|
-
throw new InvalidInputError(`The Worker's entry module ${config.main} is not among the ${modules.length} modules collected from ${config.configDir}.`);
|
|
249799
|
-
}
|
|
249800
|
-
return {
|
|
249801
|
-
main,
|
|
249802
|
-
modules: await pMap(modules, async ({ name, absolutePath, size }) => ({
|
|
249803
|
-
path: name,
|
|
249753
|
+
return await pMap(relativePaths, async (path) => {
|
|
249754
|
+
const absolutePath = join27(outputDir, ...path.split("/"));
|
|
249755
|
+
const { size } = await stat3(absolutePath);
|
|
249756
|
+
return {
|
|
249757
|
+
path,
|
|
249804
249758
|
absolutePath,
|
|
249805
249759
|
size,
|
|
249806
249760
|
digest: await digestFile(absolutePath)
|
|
249807
|
-
}
|
|
249808
|
-
|
|
249809
|
-
compatibilityDate: config.compatibilityDate,
|
|
249810
|
-
compatibilityFlags: config.compatibilityFlags
|
|
249811
|
-
};
|
|
249761
|
+
};
|
|
249762
|
+
}, { concurrency: HASH_CONCURRENCY });
|
|
249812
249763
|
}
|
|
249813
249764
|
async function readRawResources(dir) {
|
|
249814
249765
|
if (!await pathExists(dir)) {
|
|
@@ -249840,7 +249791,7 @@ function versionsApiEnabled(env = process.env) {
|
|
|
249840
249791
|
return value === "1" || value === "true";
|
|
249841
249792
|
}
|
|
249842
249793
|
// src/core/version/project.ts
|
|
249843
|
-
import { dirname as dirname21, join as join28, resolve as
|
|
249794
|
+
import { dirname as dirname21, join as join28, resolve as resolve10 } from "node:path";
|
|
249844
249795
|
var DEFAULT_BUILD_COMMAND = "npm run build";
|
|
249845
249796
|
var DEFAULT_OUTPUT_DIRECTORY = "dist";
|
|
249846
249797
|
async function resolvePublishTarget(projectRoot, overrides = {}) {
|
|
@@ -249857,7 +249808,7 @@ async function resolvePublishTarget(projectRoot, overrides = {}) {
|
|
|
249857
249808
|
}
|
|
249858
249809
|
function outputDirectory(project, root, override) {
|
|
249859
249810
|
const configured = override ?? (project ? project.site?.outputDirectory : DEFAULT_OUTPUT_DIRECTORY);
|
|
249860
|
-
return configured ?
|
|
249811
|
+
return configured ? resolve10(root, configured) : null;
|
|
249861
249812
|
}
|
|
249862
249813
|
function requireOutputDir(target) {
|
|
249863
249814
|
if (target.outputDir === null) {
|
|
@@ -249884,15 +249835,15 @@ async function readSettingsIfPresent(projectRoot) {
|
|
|
249884
249835
|
}
|
|
249885
249836
|
// src/cli/commands/project/build.ts
|
|
249886
249837
|
async function buildAction(ctx) {
|
|
249887
|
-
const app =
|
|
249888
|
-
const target = await resolvePublishTarget(app
|
|
249838
|
+
const { app } = ctx;
|
|
249839
|
+
const target = await resolvePublishTarget(app?.projectRoot);
|
|
249889
249840
|
await runSiteBuild(ctx, {
|
|
249890
249841
|
root: target.root,
|
|
249891
249842
|
buildCommand: target.buildCommand,
|
|
249892
|
-
appId: app
|
|
249843
|
+
appId: app?.id ?? ""
|
|
249893
249844
|
});
|
|
249894
249845
|
return {
|
|
249895
|
-
outroMessage: `Site built with app id ${theme.styles.bold(app
|
|
249846
|
+
outroMessage: `Site built with app id ${theme.styles.bold(app?.id ?? "")}`
|
|
249896
249847
|
};
|
|
249897
249848
|
}
|
|
249898
249849
|
function getBuildCommand() {
|
|
@@ -249900,7 +249851,7 @@ function getBuildCommand() {
|
|
|
249900
249851
|
}
|
|
249901
249852
|
|
|
249902
249853
|
// src/cli/commands/project/create.ts
|
|
249903
|
-
import { basename as basename6, resolve as
|
|
249854
|
+
import { basename as basename6, resolve as resolve11 } from "node:path";
|
|
249904
249855
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
249905
249856
|
|
|
249906
249857
|
// src/cli/commands/project/scaffold-shared.ts
|
|
@@ -250096,7 +250047,7 @@ async function createInteractive(options, ctx) {
|
|
|
250096
250047
|
}, ctx);
|
|
250097
250048
|
}
|
|
250098
250049
|
async function createNonInteractive(options, ctx) {
|
|
250099
|
-
ctx.log.info(`Creating a new project at ${
|
|
250050
|
+
ctx.log.info(`Creating a new project at ${resolve11(options.path)}`);
|
|
250100
250051
|
const template = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
250101
250052
|
return await executeCreate({
|
|
250102
250053
|
template,
|
|
@@ -250120,7 +250071,7 @@ async function executeCreate({
|
|
|
250120
250071
|
}, ctx) {
|
|
250121
250072
|
const { log, runTask } = ctx;
|
|
250122
250073
|
const name = rawName.trim();
|
|
250123
|
-
const resolvedPath =
|
|
250074
|
+
const resolvedPath = resolve11(projectPath);
|
|
250124
250075
|
const organizationId = await resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive);
|
|
250125
250076
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
250126
250077
|
return await createProjectFiles({
|
|
@@ -250761,7 +250712,7 @@ function getLogsCommand() {
|
|
|
250761
250712
|
}
|
|
250762
250713
|
|
|
250763
250714
|
// src/cli/commands/project/scaffold.ts
|
|
250764
|
-
import { basename as basename7, resolve as
|
|
250715
|
+
import { basename as basename7, resolve as resolve12 } from "node:path";
|
|
250765
250716
|
function resolveAppId(options) {
|
|
250766
250717
|
const appId = options.appId;
|
|
250767
250718
|
if (!appId) {
|
|
@@ -250777,7 +250728,7 @@ function resolveAppId(options) {
|
|
|
250777
250728
|
async function scaffoldAction(ctx, name, options, command) {
|
|
250778
250729
|
const { log, runTask } = ctx;
|
|
250779
250730
|
const appId = resolveAppId(command.optsWithGlobals());
|
|
250780
|
-
const resolvedPath =
|
|
250731
|
+
const resolvedPath = resolve12("./");
|
|
250781
250732
|
const projectName = (name ?? basename7(resolvedPath)).trim();
|
|
250782
250733
|
const template = await getTemplateById("backend-only");
|
|
250783
250734
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
@@ -250852,28 +250803,23 @@ function concurrencyOption() {
|
|
|
250852
250803
|
|
|
250853
250804
|
// src/cli/commands/publish.ts
|
|
250854
250805
|
async function publishAction(ctx, options) {
|
|
250855
|
-
const { runTask, log, jsonMode } = ctx;
|
|
250856
|
-
const
|
|
250857
|
-
const target = await resolvePublishTarget(app.projectRoot, {
|
|
250806
|
+
const { runTask, log, jsonMode, app } = ctx;
|
|
250807
|
+
const target = await resolvePublishTarget(app?.projectRoot, {
|
|
250858
250808
|
outputDir: options.outputDir
|
|
250859
250809
|
});
|
|
250860
250810
|
if (options.build !== false) {
|
|
250861
250811
|
await tagStep("build", () => runSiteBuild(ctx, {
|
|
250862
250812
|
root: target.root,
|
|
250863
250813
|
buildCommand: target.buildCommand,
|
|
250864
|
-
appId: app
|
|
250814
|
+
appId: app?.id ?? ""
|
|
250865
250815
|
}));
|
|
250866
250816
|
}
|
|
250867
250817
|
const gitHash = await resolveProvenanceCommit(target.root, options.gitHash);
|
|
250868
250818
|
const result = await runTask("Publishing...", async (updateMessage) => {
|
|
250869
|
-
const artifacts = await tagStep("create_version", async () => {
|
|
250870
|
-
|
|
250871
|
-
|
|
250872
|
-
|
|
250873
|
-
...siteWorker ? { siteWorker } : {},
|
|
250874
|
-
...await collectResources(target.configDir, target)
|
|
250875
|
-
};
|
|
250876
|
-
});
|
|
250819
|
+
const artifacts = await tagStep("create_version", async () => ({
|
|
250820
|
+
files: await collectBuildOutput(requireOutputDir(target)),
|
|
250821
|
+
...await collectResources(target.configDir, target)
|
|
250822
|
+
}));
|
|
250877
250823
|
return await publishVersion(artifacts, {
|
|
250878
250824
|
sourceCommit: gitHash,
|
|
250879
250825
|
target: options.target,
|
|
@@ -251266,7 +251212,7 @@ function getSecretsListCommand() {
|
|
|
251266
251212
|
}
|
|
251267
251213
|
|
|
251268
251214
|
// src/cli/commands/secrets/set.ts
|
|
251269
|
-
import { resolve as
|
|
251215
|
+
import { resolve as resolve13 } from "node:path";
|
|
251270
251216
|
function parseEntries(entries) {
|
|
251271
251217
|
const secrets = {};
|
|
251272
251218
|
for (const entry of entries) {
|
|
@@ -251297,7 +251243,7 @@ async function setSecretsAction({ log, runTask }, entries, options) {
|
|
|
251297
251243
|
validateInput(entries, options);
|
|
251298
251244
|
let secrets;
|
|
251299
251245
|
if (options.envFile) {
|
|
251300
|
-
secrets = await parseEnvFile(
|
|
251246
|
+
secrets = await parseEnvFile(resolve13(options.envFile));
|
|
251301
251247
|
if (Object.keys(secrets).length === 0) {
|
|
251302
251248
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
251303
251249
|
}
|
|
@@ -251326,7 +251272,7 @@ function getSecretsCommand() {
|
|
|
251326
251272
|
}
|
|
251327
251273
|
|
|
251328
251274
|
// src/cli/commands/site/deploy.ts
|
|
251329
|
-
import { resolve as
|
|
251275
|
+
import { resolve as resolve14 } from "node:path";
|
|
251330
251276
|
async function deployAction2(ctx, options) {
|
|
251331
251277
|
const { isNonInteractive } = ctx;
|
|
251332
251278
|
if (isNonInteractive && !options.yes) {
|
|
@@ -251404,7 +251350,7 @@ async function deployTarball({ runTask }, project) {
|
|
|
251404
251350
|
}
|
|
251405
251351
|
function siteOutputDir(project) {
|
|
251406
251352
|
const outputDirectory = project.site?.outputDirectory;
|
|
251407
|
-
return outputDirectory ?
|
|
251353
|
+
return outputDirectory ? resolve14(project.root, outputDirectory) : null;
|
|
251408
251354
|
}
|
|
251409
251355
|
function getSiteDeployCommand() {
|
|
251410
251356
|
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)");
|
|
@@ -253966,11 +253912,11 @@ import { relative as relative9 } from "node:path";
|
|
|
253966
253912
|
// ../../node_modules/chokidar/index.js
|
|
253967
253913
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
253968
253914
|
import { stat as statcb, Stats } from "node:fs";
|
|
253969
|
-
import { readdir as readdir3, stat as
|
|
253915
|
+
import { readdir as readdir3, stat as stat7 } from "node:fs/promises";
|
|
253970
253916
|
import * as sp3 from "node:path";
|
|
253971
253917
|
|
|
253972
253918
|
// ../../node_modules/readdirp/index.js
|
|
253973
|
-
import { lstat as lstat2, readdir as readdir2, realpath, stat as
|
|
253919
|
+
import { lstat as lstat2, readdir as readdir2, realpath, stat as stat5 } from "node:fs/promises";
|
|
253974
253920
|
import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
|
|
253975
253921
|
import { Readable as Readable6 } from "node:stream";
|
|
253976
253922
|
var EntryTypes = {
|
|
@@ -254052,7 +253998,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
254052
253998
|
const { root, type } = opts;
|
|
254053
253999
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
254054
254000
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
254055
|
-
const statMethod = opts.lstat ? lstat2 :
|
|
254001
|
+
const statMethod = opts.lstat ? lstat2 : stat5;
|
|
254056
254002
|
if (wantBigintFsStats) {
|
|
254057
254003
|
this._stat = (path) => statMethod(path, { bigint: true });
|
|
254058
254004
|
} else {
|
|
@@ -254205,7 +254151,7 @@ function readdirp(root, options = {}) {
|
|
|
254205
254151
|
|
|
254206
254152
|
// ../../node_modules/chokidar/handler.js
|
|
254207
254153
|
import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
|
|
254208
|
-
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as
|
|
254154
|
+
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat6 } from "node:fs/promises";
|
|
254209
254155
|
import { type as osType } from "node:os";
|
|
254210
254156
|
import * as sp2 from "node:path";
|
|
254211
254157
|
var STR_DATA = "data";
|
|
@@ -254231,7 +254177,7 @@ var EVENTS = {
|
|
|
254231
254177
|
};
|
|
254232
254178
|
var EV = EVENTS;
|
|
254233
254179
|
var THROTTLE_MODE_WATCH = "watch";
|
|
254234
|
-
var statMethods = { lstat: lstat3, stat:
|
|
254180
|
+
var statMethods = { lstat: lstat3, stat: stat6 };
|
|
254235
254181
|
var KEY_LISTENERS = "listeners";
|
|
254236
254182
|
var KEY_ERR = "errHandlers";
|
|
254237
254183
|
var KEY_RAW = "rawEmitters";
|
|
@@ -254702,7 +254648,7 @@ class NodeFsHandler {
|
|
|
254702
254648
|
return;
|
|
254703
254649
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
254704
254650
|
try {
|
|
254705
|
-
const newStats = await
|
|
254651
|
+
const newStats = await stat6(file);
|
|
254706
254652
|
if (this.fsw.closed)
|
|
254707
254653
|
return;
|
|
254708
254654
|
const at = newStats.atimeMs;
|
|
@@ -255374,7 +255320,7 @@ class FSWatcher extends EventEmitter3 {
|
|
|
255374
255320
|
const fullPath = opts.cwd ? sp3.join(opts.cwd, path) : path;
|
|
255375
255321
|
let stats;
|
|
255376
255322
|
try {
|
|
255377
|
-
stats = await
|
|
255323
|
+
stats = await stat7(fullPath);
|
|
255378
255324
|
} catch (err) {}
|
|
255379
255325
|
if (!stats || this.closed)
|
|
255380
255326
|
return;
|
|
@@ -256156,7 +256102,7 @@ Examples:
|
|
|
256156
256102
|
}
|
|
256157
256103
|
|
|
256158
256104
|
// src/cli/commands/project/eject.ts
|
|
256159
|
-
import { resolve as
|
|
256105
|
+
import { resolve as resolve18 } from "node:path";
|
|
256160
256106
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
256161
256107
|
async function eject(ctx, options, command) {
|
|
256162
256108
|
const { log, runTask, isNonInteractive } = ctx;
|
|
@@ -256220,7 +256166,7 @@ async function eject(ctx, options, command) {
|
|
|
256220
256166
|
Ne("Operation cancelled.");
|
|
256221
256167
|
throw new CLIExitError(0);
|
|
256222
256168
|
}
|
|
256223
|
-
const resolvedPath =
|
|
256169
|
+
const resolvedPath = resolve18(selectedPath);
|
|
256224
256170
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
256225
256171
|
await createProjectFilesForExistingProject({
|
|
256226
256172
|
projectId,
|
|
@@ -258364,7 +258310,7 @@ class ReduceableCache {
|
|
|
258364
258310
|
}
|
|
258365
258311
|
}
|
|
258366
258312
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs
|
|
258367
|
-
import { createReadStream as
|
|
258313
|
+
import { createReadStream as createReadStream4 } from "node:fs";
|
|
258368
258314
|
import { createInterface as createInterface2 } from "node:readline";
|
|
258369
258315
|
var LRU_FILE_CONTENTS_CACHE = new ReduceableCache(25);
|
|
258370
258316
|
var LRU_FILE_CONTENTS_FS_READ_FAILED = new ReduceableCache(20);
|
|
@@ -258408,7 +258354,7 @@ async function addSourceContext(frames) {
|
|
|
258408
258354
|
}
|
|
258409
258355
|
function getContextLinesFromFile(path, ranges, output) {
|
|
258410
258356
|
return new Promise((resolve) => {
|
|
258411
|
-
const stream =
|
|
258357
|
+
const stream = createReadStream4(path);
|
|
258412
258358
|
const lineReaded = createInterface2({
|
|
258413
258359
|
input: stream
|
|
258414
258360
|
});
|
|
@@ -260359,4 +260305,4 @@ export {
|
|
|
260359
260305
|
runCLI
|
|
260360
260306
|
};
|
|
260361
260307
|
|
|
260362
|
-
//# debugId=
|
|
260308
|
+
//# debugId=B07922109E14BECF64756E2164756E21
|