@absolutejs/absolute 0.19.0-beta.813 → 0.19.0-beta.815
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-5Ms3gR/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __require = import.meta.require;
|
|
3
3
|
|
|
4
|
-
// .angular-partial-tmp-
|
|
4
|
+
// .angular-partial-tmp-5Ms3gR/src/core/streamingSlotRegistrar.ts
|
|
5
5
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
6
6
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
7
7
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
|
48
48
|
getWarningController()?.maybeWarn(primitiveName);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
// .angular-partial-tmp-
|
|
51
|
+
// .angular-partial-tmp-5Ms3gR/src/core/streamingSlotRegistry.ts
|
|
52
52
|
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
53
53
|
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
54
54
|
var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
package/dist/cli/index.js
CHANGED
|
@@ -631,7 +631,7 @@ __export(exports_prerender, {
|
|
|
631
631
|
prerender: () => prerender,
|
|
632
632
|
PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
|
|
633
633
|
});
|
|
634
|
-
import { mkdirSync as mkdirSync3, readFileSync as
|
|
634
|
+
import { mkdirSync as mkdirSync3, readFileSync as readFileSync7 } from "fs";
|
|
635
635
|
import { join as join5 } from "path";
|
|
636
636
|
var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_TIMEOUT_MS = 30000, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
637
637
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
@@ -639,7 +639,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
639
639
|
}, readTimestamp = (htmlPath) => {
|
|
640
640
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
641
641
|
try {
|
|
642
|
-
const content =
|
|
642
|
+
const content = readFileSync7(metaPath, "utf-8");
|
|
643
643
|
return Number(content) || 0;
|
|
644
644
|
} catch {
|
|
645
645
|
return 0;
|
|
@@ -827,7 +827,7 @@ var init_prerender = () => {};
|
|
|
827
827
|
// src/build/nativeRewrite.ts
|
|
828
828
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
829
829
|
import { platform as platform4, arch as arch3 } from "os";
|
|
830
|
-
import { resolve as
|
|
830
|
+
import { resolve as resolve6 } from "path";
|
|
831
831
|
var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
832
832
|
if (nativeLib !== null)
|
|
833
833
|
return nativeLib;
|
|
@@ -845,7 +845,7 @@ var ffiDefinition, nativeLib = null, loadNative = () => {
|
|
|
845
845
|
if (!libPath)
|
|
846
846
|
return null;
|
|
847
847
|
try {
|
|
848
|
-
const fullPath =
|
|
848
|
+
const fullPath = resolve6(import.meta.dir, "../../native/packages", libPath);
|
|
849
849
|
const lib = dlopen(fullPath, ffiDefinition);
|
|
850
850
|
nativeLib = lib.symbols;
|
|
851
851
|
return nativeLib;
|
|
@@ -994,7 +994,7 @@ var exports_build = {};
|
|
|
994
994
|
__export(exports_build, {
|
|
995
995
|
build: () => build
|
|
996
996
|
});
|
|
997
|
-
import { resolve as
|
|
997
|
+
import { resolve as resolve9 } from "path";
|
|
998
998
|
var cliTag3 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[cli]\x1B[0m ${color}${message}\x1B[0m`, tryImportBuild2 = async (candidate) => {
|
|
999
999
|
try {
|
|
1000
1000
|
const mod = await import(candidate);
|
|
@@ -1014,7 +1014,7 @@ var cliTag3 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1014
1014
|
}
|
|
1015
1015
|
return resolveBuildModule2(remaining);
|
|
1016
1016
|
}, build = async (outdir, configPath2) => {
|
|
1017
|
-
const resolvedOutdir =
|
|
1017
|
+
const resolvedOutdir = resolve9(outdir ?? "build");
|
|
1018
1018
|
const buildStart = performance.now();
|
|
1019
1019
|
process.stdout.write(cliTag3("\x1B[36m", "Building assets"));
|
|
1020
1020
|
const buildConfig = await loadConfig(configPath2);
|
|
@@ -1022,8 +1022,8 @@ var cliTag3 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1022
1022
|
buildConfig.mode = "production";
|
|
1023
1023
|
try {
|
|
1024
1024
|
const buildApp = await resolveBuildModule2([
|
|
1025
|
-
|
|
1026
|
-
|
|
1025
|
+
resolve9(import.meta.dir, "..", "..", "core", "build"),
|
|
1026
|
+
resolve9(import.meta.dir, "..", "build")
|
|
1027
1027
|
]);
|
|
1028
1028
|
if (!buildApp)
|
|
1029
1029
|
throw new Error("Could not locate build module");
|
|
@@ -1149,16 +1149,16 @@ __export(exports_compile, {
|
|
|
1149
1149
|
var {env: env3 } = globalThis.Bun;
|
|
1150
1150
|
import {
|
|
1151
1151
|
cpSync,
|
|
1152
|
-
existsSync as
|
|
1152
|
+
existsSync as existsSync10,
|
|
1153
1153
|
mkdirSync as mkdirSync5,
|
|
1154
1154
|
readdirSync as readdirSync2,
|
|
1155
|
-
readFileSync as
|
|
1156
|
-
rmSync as
|
|
1155
|
+
readFileSync as readFileSync10,
|
|
1156
|
+
rmSync as rmSync3,
|
|
1157
1157
|
statSync,
|
|
1158
1158
|
unlinkSync as unlinkSync2,
|
|
1159
1159
|
writeFileSync as writeFileSync3
|
|
1160
1160
|
} from "fs";
|
|
1161
|
-
import { basename as basename2, dirname as dirname3, join as join7, relative, resolve as
|
|
1161
|
+
import { basename as basename2, dirname as dirname3, join as join7, relative, resolve as resolve10 } from "path";
|
|
1162
1162
|
var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[cli]\x1B[0m ${color}${message}\x1B[0m`, compileBanner = (version2) => {
|
|
1163
1163
|
const resolvedVersion = version2 || "unknown";
|
|
1164
1164
|
console.log("");
|
|
@@ -1203,12 +1203,12 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1203
1203
|
return result;
|
|
1204
1204
|
}, copyServerRuntimeAssetReferences = (outdir) => {
|
|
1205
1205
|
const copied = new Set;
|
|
1206
|
-
const normalizedOutdir =
|
|
1206
|
+
const normalizedOutdir = resolve10(outdir);
|
|
1207
1207
|
const copyReference = (filePath, relPath) => {
|
|
1208
|
-
const assetSource =
|
|
1209
|
-
if (!
|
|
1208
|
+
const assetSource = resolve10(dirname3(filePath), relPath);
|
|
1209
|
+
if (!existsSync10(assetSource) || !statSync(assetSource).isFile())
|
|
1210
1210
|
return;
|
|
1211
|
-
const assetTarget =
|
|
1211
|
+
const assetTarget = resolve10(normalizedOutdir, relPath.replace(/^\.\//, ""));
|
|
1212
1212
|
if (assetTarget !== normalizedOutdir && !assetTarget.startsWith(`${normalizedOutdir}/`))
|
|
1213
1213
|
return;
|
|
1214
1214
|
if (copied.has(assetTarget))
|
|
@@ -1218,7 +1218,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1218
1218
|
cpSync(assetSource, assetTarget, { force: true });
|
|
1219
1219
|
};
|
|
1220
1220
|
for (const filePath of collectProjectSourceFiles(process.cwd())) {
|
|
1221
|
-
const source =
|
|
1221
|
+
const source = readFileSync10(filePath, "utf-8");
|
|
1222
1222
|
SERVER_RUNTIME_ASSET_RE.lastIndex = 0;
|
|
1223
1223
|
let match;
|
|
1224
1224
|
while ((match = SERVER_RUNTIME_ASSET_RE.exec(source)) !== null) {
|
|
@@ -1247,7 +1247,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1247
1247
|
}
|
|
1248
1248
|
}, readPackageVersion4 = (candidate) => {
|
|
1249
1249
|
try {
|
|
1250
|
-
const pkg = JSON.parse(
|
|
1250
|
+
const pkg = JSON.parse(readFileSync10(candidate, "utf-8"));
|
|
1251
1251
|
if (pkg.name !== "@absolutejs/absolute")
|
|
1252
1252
|
return null;
|
|
1253
1253
|
const ver = pkg.version;
|
|
@@ -1282,18 +1282,18 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1282
1282
|
return resolveBuildModule3(remaining);
|
|
1283
1283
|
}, resolveJsxDevRuntimeCompatPath2 = () => {
|
|
1284
1284
|
const candidates = [
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1285
|
+
resolve10(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
1286
|
+
resolve10(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js"),
|
|
1287
|
+
resolve10(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.ts"),
|
|
1288
|
+
resolve10(import.meta.dir, "..", "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
1289
|
+
resolve10(import.meta.dir, "..", "..", "..", "react", "jsxDevRuntimeCompat.js"),
|
|
1290
|
+
resolve10(import.meta.dir, "..", "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
1291
1291
|
];
|
|
1292
1292
|
for (const candidate of candidates) {
|
|
1293
|
-
if (
|
|
1293
|
+
if (existsSync10(candidate))
|
|
1294
1294
|
return candidate;
|
|
1295
1295
|
}
|
|
1296
|
-
return
|
|
1296
|
+
return resolve10(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js");
|
|
1297
1297
|
}, jsxDevRuntimeCompatPath2, shouldEmbedCompiledAsset = (relativePath, skip = new Set) => {
|
|
1298
1298
|
if (skip.has(relativePath))
|
|
1299
1299
|
return false;
|
|
@@ -1306,11 +1306,11 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1306
1306
|
return true;
|
|
1307
1307
|
}, tryReadNodePackageJson = (packageDir) => {
|
|
1308
1308
|
try {
|
|
1309
|
-
return JSON.parse(
|
|
1309
|
+
return JSON.parse(readFileSync10(join7(packageDir, "package.json"), "utf-8"));
|
|
1310
1310
|
} catch {
|
|
1311
1311
|
return null;
|
|
1312
1312
|
}
|
|
1313
|
-
}, resolveProjectPackageDir = (specifier) =>
|
|
1313
|
+
}, resolveProjectPackageDir = (specifier) => resolve10(process.cwd(), "node_modules", ...specifier.split("/")), copyPackageToBuild = (specifier, outdir, seen) => {
|
|
1314
1314
|
if (seen.has(specifier))
|
|
1315
1315
|
return;
|
|
1316
1316
|
const srcDir = resolveProjectPackageDir(specifier);
|
|
@@ -1319,7 +1319,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1319
1319
|
return;
|
|
1320
1320
|
seen.add(specifier);
|
|
1321
1321
|
const destDir = join7(outdir, "node_modules", ...specifier.split("/"));
|
|
1322
|
-
|
|
1322
|
+
rmSync3(destDir, { force: true, recursive: true });
|
|
1323
1323
|
cpSync(srcDir, destDir, {
|
|
1324
1324
|
filter(source) {
|
|
1325
1325
|
const rel = relative(srcDir, source);
|
|
@@ -1340,8 +1340,8 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1340
1340
|
}, copyAngularRuntimePackages = (buildConfig, outdir) => {
|
|
1341
1341
|
if (!buildConfig.angularDirectory)
|
|
1342
1342
|
return;
|
|
1343
|
-
const angularScopeDir =
|
|
1344
|
-
const angularPackages =
|
|
1343
|
+
const angularScopeDir = resolve10(process.cwd(), "node_modules", "@angular");
|
|
1344
|
+
const angularPackages = existsSync10(angularScopeDir) ? readdirSync2(angularScopeDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).filter((entry) => entry.name !== "compiler-cli").map((entry) => `@angular/${entry.name}`) : [];
|
|
1345
1345
|
const roots = new Set([
|
|
1346
1346
|
...angularPackages,
|
|
1347
1347
|
"rxjs",
|
|
@@ -1365,7 +1365,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1365
1365
|
copyAngularRuntimePackages(buildConfig, outdir);
|
|
1366
1366
|
}, collectRuntimePackageSpecifiers = (distDir) => {
|
|
1367
1367
|
const nodeModulesDir = join7(distDir, "node_modules");
|
|
1368
|
-
if (!
|
|
1368
|
+
if (!existsSync10(nodeModulesDir))
|
|
1369
1369
|
return [];
|
|
1370
1370
|
const specifiers = [];
|
|
1371
1371
|
for (const entry of readdirSync2(nodeModulesDir, { withFileTypes: true })) {
|
|
@@ -1407,11 +1407,11 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1407
1407
|
const packageDir = join7(distDir, "node_modules", ...packageSpecifier.split("/"));
|
|
1408
1408
|
const subpath = specifier.slice(packageSpecifier.length);
|
|
1409
1409
|
const subPackageDir = subpath ? join7(packageDir, ...subpath.slice(1).split("/")) : null;
|
|
1410
|
-
const resolvedPackageDir = subPackageDir &&
|
|
1410
|
+
const resolvedPackageDir = subPackageDir && existsSync10(join7(subPackageDir, "package.json")) ? subPackageDir : packageDir;
|
|
1411
1411
|
const packageJsonPath = join7(resolvedPackageDir, "package.json");
|
|
1412
|
-
if (!
|
|
1412
|
+
if (!existsSync10(packageJsonPath))
|
|
1413
1413
|
return null;
|
|
1414
|
-
const pkg = JSON.parse(
|
|
1414
|
+
const pkg = JSON.parse(readFileSync10(packageJsonPath, "utf-8"));
|
|
1415
1415
|
const exportKey = resolvedPackageDir === subPackageDir ? "." : subpath ? `.${subpath}` : ".";
|
|
1416
1416
|
const rootExport = pkg.exports?.[exportKey];
|
|
1417
1417
|
const entry = pickExportEntry(rootExport) ?? (resolvedPackageDir === subPackageDir || !subpath ? pkg.module ?? pkg.main ?? "index.js" : `.${subpath}`);
|
|
@@ -1434,7 +1434,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1434
1434
|
}, findContainingRuntimePackageDir = (filePath) => {
|
|
1435
1435
|
let dir = dirname3(filePath);
|
|
1436
1436
|
while (dir !== dirname3(dir)) {
|
|
1437
|
-
if (isNodeModulesPath(dir) &&
|
|
1437
|
+
if (isNodeModulesPath(dir) && existsSync10(join7(dir, "package.json"))) {
|
|
1438
1438
|
return dir;
|
|
1439
1439
|
}
|
|
1440
1440
|
dir = dirname3(dir);
|
|
@@ -1469,10 +1469,10 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
1469
1469
|
if (!filePath || seen.has(filePath))
|
|
1470
1470
|
continue;
|
|
1471
1471
|
seen.add(filePath);
|
|
1472
|
-
const source =
|
|
1472
|
+
const source = readFileSync10(filePath, "utf-8");
|
|
1473
1473
|
const rewritten = source.replace(MODULE_SPECIFIER_RE, (match, prefix, quote, specifier) => {
|
|
1474
1474
|
if (typeof specifier === "string" && specifier.startsWith(".")) {
|
|
1475
|
-
enqueue(resolveRuntimeJsFile(
|
|
1475
|
+
enqueue(resolveRuntimeJsFile(resolve10(dirname3(filePath), specifier)));
|
|
1476
1476
|
return match;
|
|
1477
1477
|
}
|
|
1478
1478
|
const packageImportTarget = resolveRuntimeJsFile(resolvePackageImportEntryFile(filePath, specifier) ?? "");
|
|
@@ -1557,7 +1557,7 @@ import { pathToFileURL } from "node:url";
|
|
|
1557
1557
|
const SERVER_MODULE = (runtimeDir: string) => import(pathToFileURL(join(runtimeDir, ${JSON.stringify(serverBundleName)})).href);
|
|
1558
1558
|
const RUNTIME_BUILD_ID = ${JSON.stringify(runtimeBuildId)};
|
|
1559
1559
|
const RUNTIME_CONFIG_SOURCE = ${JSON.stringify(runtimeConfigSource)};
|
|
1560
|
-
const ORIGINAL_BUILD_DIR = ${JSON.stringify(
|
|
1560
|
+
const ORIGINAL_BUILD_DIR = ${JSON.stringify(resolve10(distDir))};
|
|
1561
1561
|
const ORIGINAL_BUILD_DIR_NORMALIZED = ORIGINAL_BUILD_DIR.replace(/\\\\/g, "/");
|
|
1562
1562
|
|
|
1563
1563
|
// \u2500\u2500 Asset URL \u2192 embedded path map \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
@@ -1854,16 +1854,16 @@ console.log(\`
|
|
|
1854
1854
|
return false;
|
|
1855
1855
|
return true;
|
|
1856
1856
|
}), compile = async (serverEntry, outdir, outfile, configPath2) => {
|
|
1857
|
-
const resolvedOutdir =
|
|
1857
|
+
const resolvedOutdir = resolve10(outdir ?? "dist");
|
|
1858
1858
|
await withBuildDirectoryLock(resolvedOutdir, () => compileUnlocked(serverEntry, resolvedOutdir, outfile, configPath2));
|
|
1859
1859
|
}, compileUnlocked = async (serverEntry, resolvedOutdir, outfile, configPath2) => {
|
|
1860
1860
|
const prerenderPort = Number(env3.COMPILE_PORT) || Number(env3.PORT) || DEFAULT_PORT + 1;
|
|
1861
1861
|
killStaleProcesses(prerenderPort);
|
|
1862
1862
|
const entryName = basename2(serverEntry).replace(/\.[^.]+$/, "");
|
|
1863
|
-
const resolvedOutfile =
|
|
1863
|
+
const resolvedOutfile = resolve10(outfile ?? "compiled-server");
|
|
1864
1864
|
const absoluteVersion = resolvePackageVersion3([
|
|
1865
|
-
|
|
1866
|
-
|
|
1865
|
+
resolve10(import.meta.dir, "..", "..", "..", "package.json"),
|
|
1866
|
+
resolve10(import.meta.dir, "..", "..", "package.json")
|
|
1867
1867
|
]);
|
|
1868
1868
|
compileBanner(absoluteVersion);
|
|
1869
1869
|
const totalStart = performance.now();
|
|
@@ -1874,8 +1874,8 @@ console.log(\`
|
|
|
1874
1874
|
buildConfig.mode = "production";
|
|
1875
1875
|
try {
|
|
1876
1876
|
const build2 = await resolveBuildModule3([
|
|
1877
|
-
|
|
1878
|
-
|
|
1877
|
+
resolve10(import.meta.dir, "..", "..", "core", "build"),
|
|
1878
|
+
resolve10(import.meta.dir, "..", "build")
|
|
1879
1879
|
]);
|
|
1880
1880
|
if (!build2)
|
|
1881
1881
|
throw new Error("Could not locate build module");
|
|
@@ -1890,7 +1890,7 @@ console.log(\`
|
|
|
1890
1890
|
process.stdout.write(cliTag4("\x1B[36m", "Bundling production server"));
|
|
1891
1891
|
const serverBundle = await Bun.build({
|
|
1892
1892
|
define: { "process.env.NODE_ENV": '"production"' },
|
|
1893
|
-
entrypoints: [
|
|
1893
|
+
entrypoints: [resolve10(serverEntry)],
|
|
1894
1894
|
external: resolveServerBundleExternals(buildConfig),
|
|
1895
1895
|
outdir: resolvedOutdir,
|
|
1896
1896
|
plugins: [
|
|
@@ -1908,13 +1908,13 @@ console.log(\`
|
|
|
1908
1908
|
console.error(cliTag4("\x1B[31m", "Server bundle failed."));
|
|
1909
1909
|
process.exit(1);
|
|
1910
1910
|
}
|
|
1911
|
-
const outputPath =
|
|
1912
|
-
if (!
|
|
1911
|
+
const outputPath = resolve10(resolvedOutdir, `${entryName}.js`);
|
|
1912
|
+
if (!existsSync10(outputPath)) {
|
|
1913
1913
|
console.error(cliTag4("\x1B[31m", `Expected output not found: ${outputPath}`));
|
|
1914
1914
|
process.exit(1);
|
|
1915
1915
|
}
|
|
1916
|
-
if (
|
|
1917
|
-
const vendorDir =
|
|
1916
|
+
if (existsSync10(resolve10(resolvedOutdir, "angular", "vendor", "server"))) {
|
|
1917
|
+
const vendorDir = resolve10(resolvedOutdir, "angular", "vendor", "server");
|
|
1918
1918
|
const vendorEntries = readdirSync2(vendorDir).filter((f) => f.endsWith(".js"));
|
|
1919
1919
|
const angularServerVendorPaths = {};
|
|
1920
1920
|
for (const file of vendorEntries) {
|
|
@@ -1923,7 +1923,7 @@ console.log(\`
|
|
|
1923
1923
|
if (scope !== "angular" || rest.length === 0)
|
|
1924
1924
|
continue;
|
|
1925
1925
|
const specifier = `@angular/${rest.join("/")}`;
|
|
1926
|
-
const relPath = relative(dirname3(outputPath),
|
|
1926
|
+
const relPath = relative(dirname3(outputPath), resolve10(vendorDir, file));
|
|
1927
1927
|
angularServerVendorPaths[specifier] = relPath.startsWith(".") ? relPath : `./${relPath}`;
|
|
1928
1928
|
}
|
|
1929
1929
|
if (Object.keys(angularServerVendorPaths).length > 0) {
|
|
@@ -1935,7 +1935,7 @@ console.log(\`
|
|
|
1935
1935
|
copyServerRuntimeAssetReferences(resolvedOutdir);
|
|
1936
1936
|
const prerenderStart = performance.now();
|
|
1937
1937
|
process.stdout.write(cliTag4("\x1B[36m", "Pre-rendering pages"));
|
|
1938
|
-
|
|
1938
|
+
rmSync3(join7(resolvedOutdir, "_prerendered"), {
|
|
1939
1939
|
force: true,
|
|
1940
1940
|
recursive: true
|
|
1941
1941
|
});
|
|
@@ -2047,8 +2047,8 @@ var exports_typecheck = {};
|
|
|
2047
2047
|
__export(exports_typecheck, {
|
|
2048
2048
|
typecheck: () => typecheck
|
|
2049
2049
|
});
|
|
2050
|
-
import { resolve as
|
|
2051
|
-
import { existsSync as
|
|
2050
|
+
import { resolve as resolve11, join as join8 } from "path";
|
|
2051
|
+
import { existsSync as existsSync11, readFileSync as readFileSync11 } from "fs";
|
|
2052
2052
|
import { mkdir as mkdir3, writeFile as writeFile2 } from "fs/promises";
|
|
2053
2053
|
var isCommandService3 = (service) => service.kind === "command" || Array.isArray(service.command), getTypecheckTargets = async (configPath2) => {
|
|
2054
2054
|
const rawConfig = await loadRawConfig(configPath2);
|
|
@@ -2068,8 +2068,8 @@ var isCommandService3 = (service) => service.kind === "command" || Array.isArray
|
|
|
2068
2068
|
const exitCode = await proc.exited;
|
|
2069
2069
|
return { exitCode, name, output: (stdout + stderr).trim() };
|
|
2070
2070
|
}, shellEscape = (value) => `'${value.replaceAll("'", "'\\''")}'`, runShell = async (name, command) => run(name, ["/bin/bash", "-lc", command]), findBin = (name) => {
|
|
2071
|
-
const local =
|
|
2072
|
-
return
|
|
2071
|
+
const local = resolve11("node_modules", ".bin", name);
|
|
2072
|
+
return existsSync11(local) ? local : null;
|
|
2073
2073
|
}, ANSI_COLOR_REGEX, ANSI_PURPLE_REGEX, ANSI_CYAN_REGEX, ANSI_TOKEN_END_REGEX, stripAnsi3 = (str) => str.replace(ANSI_COLOR_REGEX, ""), formatSvelteOutput = (output) => {
|
|
2074
2074
|
const cwd = `${process.cwd()}/`;
|
|
2075
2075
|
const summaryMatch = stripAnsi3(output).match(/svelte-check found (\d+) error/);
|
|
@@ -2116,15 +2116,15 @@ Found ${errorCount} error${suffix}.`;
|
|
|
2116
2116
|
return formatted;
|
|
2117
2117
|
}, ABSOLUTE_INTERNAL_EXCLUDES, resolveAbsoluteTypeFile = (fileName) => {
|
|
2118
2118
|
const candidates = [
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2119
|
+
resolve11("node_modules/@absolutejs/absolute/dist/types", fileName),
|
|
2120
|
+
resolve11(import.meta.dir, "../types", fileName),
|
|
2121
|
+
resolve11(import.meta.dir, "../../types", fileName),
|
|
2122
|
+
resolve11(import.meta.dir, "../../../types", fileName)
|
|
2123
2123
|
];
|
|
2124
|
-
return candidates.find((candidate) =>
|
|
2124
|
+
return candidates.find((candidate) => existsSync11(candidate)) ?? candidates[0];
|
|
2125
2125
|
}, ABSOLUTE_TYPECHECK_FILES, readProjectTsconfig = () => {
|
|
2126
2126
|
try {
|
|
2127
|
-
return JSON.parse(
|
|
2127
|
+
return JSON.parse(readFileSync11(resolve11("tsconfig.json"), "utf-8"));
|
|
2128
2128
|
} catch {
|
|
2129
2129
|
return {};
|
|
2130
2130
|
}
|
|
@@ -2158,13 +2158,13 @@ Found ${errorCount} error${suffix}.`;
|
|
|
2158
2158
|
rootDir: ".."
|
|
2159
2159
|
},
|
|
2160
2160
|
exclude: getProjectTypecheckExcludes(),
|
|
2161
|
-
extends:
|
|
2161
|
+
extends: resolve11("tsconfig.json"),
|
|
2162
2162
|
include: getProjectTypecheckIncludes()
|
|
2163
2163
|
}, null, "\t")).then(() => run("vue-tsc", [
|
|
2164
2164
|
vueTscBin,
|
|
2165
2165
|
"--noEmit",
|
|
2166
2166
|
"--project",
|
|
2167
|
-
|
|
2167
|
+
resolve11(vueTsconfigPath),
|
|
2168
2168
|
"--incremental",
|
|
2169
2169
|
"--tsBuildInfoFile",
|
|
2170
2170
|
join8(cacheDir, "vue-tsc.tsbuildinfo"),
|
|
@@ -2186,10 +2186,10 @@ Found ${errorCount} error${suffix}.`;
|
|
|
2186
2186
|
rootDir: ".."
|
|
2187
2187
|
},
|
|
2188
2188
|
exclude: ABSOLUTE_INTERNAL_EXCLUDES.map(toGeneratedConfigPath),
|
|
2189
|
-
extends:
|
|
2189
|
+
extends: resolve11("tsconfig.json"),
|
|
2190
2190
|
include: [`../${angularDir}/**/*`]
|
|
2191
2191
|
}, null, "\t"));
|
|
2192
|
-
return runShell("ngc", `${shellEscape(ngcBin)} -p ${shellEscape(
|
|
2192
|
+
return runShell("ngc", `${shellEscape(ngcBin)} -p ${shellEscape(resolve11(angularTsconfigPath))}`);
|
|
2193
2193
|
}, buildTscCheck = (cacheDir) => {
|
|
2194
2194
|
const tscBin = findBin("tsc");
|
|
2195
2195
|
if (!tscBin) {
|
|
@@ -2202,13 +2202,13 @@ Found ${errorCount} error${suffix}.`;
|
|
|
2202
2202
|
rootDir: ".."
|
|
2203
2203
|
},
|
|
2204
2204
|
exclude: getProjectTypecheckExcludes(),
|
|
2205
|
-
extends:
|
|
2205
|
+
extends: resolve11("tsconfig.json"),
|
|
2206
2206
|
include: getProjectTypecheckIncludes()
|
|
2207
2207
|
}, null, "\t")).then(() => run("tsc", [
|
|
2208
2208
|
tscBin,
|
|
2209
2209
|
"--noEmit",
|
|
2210
2210
|
"--project",
|
|
2211
|
-
|
|
2211
|
+
resolve11(tscConfigPath),
|
|
2212
2212
|
"--incremental",
|
|
2213
2213
|
"--tsBuildInfoFile",
|
|
2214
2214
|
join8(cacheDir, "tsc.tsbuildinfo"),
|
|
@@ -2222,14 +2222,14 @@ Found ${errorCount} error${suffix}.`;
|
|
|
2222
2222
|
}
|
|
2223
2223
|
const svelteTsconfigPath = join8(cacheDir, "tsconfig.svelte-check.json");
|
|
2224
2224
|
await writeFile2(svelteTsconfigPath, JSON.stringify({
|
|
2225
|
-
extends:
|
|
2225
|
+
extends: resolve11("tsconfig.json"),
|
|
2226
2226
|
files: ABSOLUTE_TYPECHECK_FILES,
|
|
2227
2227
|
include: [`../${svelteDir}/**/*`]
|
|
2228
2228
|
}, null, "\t"));
|
|
2229
2229
|
return run("svelte-check", [
|
|
2230
2230
|
svelteBin,
|
|
2231
2231
|
"--tsconfig",
|
|
2232
|
-
|
|
2232
|
+
resolve11(svelteTsconfigPath),
|
|
2233
2233
|
"--threshold",
|
|
2234
2234
|
"error",
|
|
2235
2235
|
"--compiler-warnings",
|
|
@@ -2852,33 +2852,234 @@ var dev = async (serverEntry, configPath2) => {
|
|
|
2852
2852
|
};
|
|
2853
2853
|
|
|
2854
2854
|
// src/cli/scripts/eslint.ts
|
|
2855
|
+
import { existsSync as existsSync6, readFileSync as readFileSync5, rmSync as rmSync2 } from "fs";
|
|
2856
|
+
import { resolve as resolve4 } from "path";
|
|
2857
|
+
var DEFAULT_CACHE_LOCATION = ".absolutejs/eslint-cache";
|
|
2858
|
+
var getCacheLocation = () => process.env.ABSOLUTE_ESLINT_CACHE?.trim() || DEFAULT_CACHE_LOCATION;
|
|
2859
|
+
var CONFIG_CANDIDATES = [
|
|
2860
|
+
"eslint.config.js",
|
|
2861
|
+
"eslint.config.mjs",
|
|
2862
|
+
"eslint.config.cjs",
|
|
2863
|
+
"eslint.config.ts",
|
|
2864
|
+
"eslint.config.mts",
|
|
2865
|
+
"eslint.config.cts"
|
|
2866
|
+
];
|
|
2867
|
+
var FLAG_VALUE_FLAGS = new Set([
|
|
2868
|
+
"-c",
|
|
2869
|
+
"--config",
|
|
2870
|
+
"--cache-location",
|
|
2871
|
+
"--cache-strategy",
|
|
2872
|
+
"--ignore-path",
|
|
2873
|
+
"--ignore-pattern",
|
|
2874
|
+
"--rule",
|
|
2875
|
+
"--rulesdir",
|
|
2876
|
+
"--ext",
|
|
2877
|
+
"-f",
|
|
2878
|
+
"--format",
|
|
2879
|
+
"--max-warnings",
|
|
2880
|
+
"--parser",
|
|
2881
|
+
"--parser-options",
|
|
2882
|
+
"--plugin",
|
|
2883
|
+
"--global",
|
|
2884
|
+
"--env",
|
|
2885
|
+
"--report-unused-disable-directives-severity",
|
|
2886
|
+
"--resolve-plugins-relative-to",
|
|
2887
|
+
"-o",
|
|
2888
|
+
"--output-file",
|
|
2889
|
+
"--flag",
|
|
2890
|
+
"--inspect-config",
|
|
2891
|
+
"--stats",
|
|
2892
|
+
"--concurrency"
|
|
2893
|
+
]);
|
|
2894
|
+
var hasUserPositional = (args) => {
|
|
2895
|
+
for (let i = 0;i < args.length; i++) {
|
|
2896
|
+
const arg = args[i];
|
|
2897
|
+
if (arg === undefined)
|
|
2898
|
+
continue;
|
|
2899
|
+
if (arg.startsWith("-")) {
|
|
2900
|
+
if (arg.includes("="))
|
|
2901
|
+
continue;
|
|
2902
|
+
if (FLAG_VALUE_FLAGS.has(arg))
|
|
2903
|
+
i++;
|
|
2904
|
+
continue;
|
|
2905
|
+
}
|
|
2906
|
+
return true;
|
|
2907
|
+
}
|
|
2908
|
+
return false;
|
|
2909
|
+
};
|
|
2910
|
+
var findConfigPath = () => {
|
|
2911
|
+
const cwd = process.cwd();
|
|
2912
|
+
for (const name of CONFIG_CANDIDATES) {
|
|
2913
|
+
const candidate = resolve4(cwd, name);
|
|
2914
|
+
if (existsSync6(candidate))
|
|
2915
|
+
return candidate;
|
|
2916
|
+
}
|
|
2917
|
+
return null;
|
|
2918
|
+
};
|
|
2919
|
+
var hasKey = (objectLiteralSource, key) => {
|
|
2920
|
+
const pattern = new RegExp(`(^|[\\s,{])${key}\\s*:`, "m");
|
|
2921
|
+
return pattern.test(objectLiteralSource);
|
|
2922
|
+
};
|
|
2923
|
+
var extractTopLevelObjectLiterals = (source) => {
|
|
2924
|
+
const arrayStart = source.search(/defineConfig\s*\(\s*\[|export\s+default\s*\[/);
|
|
2925
|
+
if (arrayStart === -1)
|
|
2926
|
+
return [];
|
|
2927
|
+
const fromArray = source.slice(arrayStart);
|
|
2928
|
+
const openBracket = fromArray.indexOf("[");
|
|
2929
|
+
if (openBracket === -1)
|
|
2930
|
+
return [];
|
|
2931
|
+
const blocks = [];
|
|
2932
|
+
let depth = 0;
|
|
2933
|
+
let blockStart = -1;
|
|
2934
|
+
let inString = null;
|
|
2935
|
+
let inLineComment = false;
|
|
2936
|
+
let inBlockComment = false;
|
|
2937
|
+
for (let i = openBracket;i < fromArray.length; i++) {
|
|
2938
|
+
const char = fromArray[i];
|
|
2939
|
+
const next = fromArray[i + 1];
|
|
2940
|
+
if (inLineComment) {
|
|
2941
|
+
if (char === `
|
|
2942
|
+
`)
|
|
2943
|
+
inLineComment = false;
|
|
2944
|
+
continue;
|
|
2945
|
+
}
|
|
2946
|
+
if (inBlockComment) {
|
|
2947
|
+
if (char === "*" && next === "/") {
|
|
2948
|
+
inBlockComment = false;
|
|
2949
|
+
i++;
|
|
2950
|
+
}
|
|
2951
|
+
continue;
|
|
2952
|
+
}
|
|
2953
|
+
if (inString) {
|
|
2954
|
+
if (char === "\\") {
|
|
2955
|
+
i++;
|
|
2956
|
+
continue;
|
|
2957
|
+
}
|
|
2958
|
+
if (char === inString)
|
|
2959
|
+
inString = null;
|
|
2960
|
+
continue;
|
|
2961
|
+
}
|
|
2962
|
+
if (char === "/" && next === "/") {
|
|
2963
|
+
inLineComment = true;
|
|
2964
|
+
continue;
|
|
2965
|
+
}
|
|
2966
|
+
if (char === "/" && next === "*") {
|
|
2967
|
+
inBlockComment = true;
|
|
2968
|
+
i++;
|
|
2969
|
+
continue;
|
|
2970
|
+
}
|
|
2971
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
2972
|
+
inString = char;
|
|
2973
|
+
continue;
|
|
2974
|
+
}
|
|
2975
|
+
if (char === "{") {
|
|
2976
|
+
if (depth === 0)
|
|
2977
|
+
blockStart = i;
|
|
2978
|
+
depth++;
|
|
2979
|
+
} else if (char === "}") {
|
|
2980
|
+
depth--;
|
|
2981
|
+
if (depth === 0 && blockStart !== -1) {
|
|
2982
|
+
blocks.push(fromArray.slice(blockStart, i + 1));
|
|
2983
|
+
blockStart = -1;
|
|
2984
|
+
}
|
|
2985
|
+
} else if (char === "]" && depth === 0) {
|
|
2986
|
+
break;
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
return blocks;
|
|
2990
|
+
};
|
|
2991
|
+
var checkForMisplacedIgnores = () => {
|
|
2992
|
+
const configPath2 = findConfigPath();
|
|
2993
|
+
if (!configPath2)
|
|
2994
|
+
return;
|
|
2995
|
+
let source;
|
|
2996
|
+
try {
|
|
2997
|
+
source = readFileSync5(configPath2, "utf-8");
|
|
2998
|
+
} catch {
|
|
2999
|
+
return;
|
|
3000
|
+
}
|
|
3001
|
+
const blocks = extractTopLevelObjectLiterals(source);
|
|
3002
|
+
let offenderCount = 0;
|
|
3003
|
+
for (const block of blocks) {
|
|
3004
|
+
if (hasKey(block, "ignores") && hasKey(block, "files")) {
|
|
3005
|
+
offenderCount++;
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
if (offenderCount === 0)
|
|
3009
|
+
return;
|
|
3010
|
+
const yellow = "\x1B[33m";
|
|
3011
|
+
const reset = "\x1B[0m";
|
|
3012
|
+
const bold = "\x1B[1m";
|
|
3013
|
+
console.warn(`${yellow}${bold}\u26A0 ESLint flat-config warning${reset}${yellow}: found ${offenderCount} config block(s) where \`ignores\` lives alongside \`files\`. In ESLint v9, \`ignores\` is only a *global* ignore when it's the sole key in its config object \u2014 otherwise it just suppresses that block's own rules and ESLint still walks every other directory (including node_modules), making lint extremely slow.
|
|
3014
|
+
|
|
3015
|
+
Move ignores into a standalone block at the top of your config:
|
|
3016
|
+
|
|
3017
|
+
export default defineConfig([
|
|
3018
|
+
{ ignores: ['node_modules/**', 'dist/**', 'build/**', '.absolutejs/**'] },
|
|
3019
|
+
pluginJs.configs.recommended,
|
|
3020
|
+
...
|
|
3021
|
+
]);
|
|
3022
|
+
|
|
3023
|
+
Detected at: ${configPath2}${reset}`);
|
|
3024
|
+
};
|
|
3025
|
+
var formatDuration = (ms) => {
|
|
3026
|
+
if (ms < 1000)
|
|
3027
|
+
return `${ms}ms`;
|
|
3028
|
+
if (ms < 60000)
|
|
3029
|
+
return `${(ms / 1000).toFixed(2)}s`;
|
|
3030
|
+
const minutes = Math.floor(ms / 60000);
|
|
3031
|
+
const seconds = Math.round(ms % 60000 / 1000);
|
|
3032
|
+
return `${minutes}m ${seconds}s`;
|
|
3033
|
+
};
|
|
3034
|
+
var handleClearCache = (cacheLocation) => {
|
|
3035
|
+
try {
|
|
3036
|
+
rmSync2(cacheLocation, { force: true });
|
|
3037
|
+
console.log(`\x1B[32m\u2713\x1B[0m Cleared cache: ${cacheLocation}`);
|
|
3038
|
+
} catch (err) {
|
|
3039
|
+
console.error(`\x1B[31m\u2717\x1B[0m Failed to clear cache at ${cacheLocation}:`, err);
|
|
3040
|
+
process.exit(1);
|
|
3041
|
+
}
|
|
3042
|
+
};
|
|
2855
3043
|
var eslint = async (args) => {
|
|
3044
|
+
const cacheLocation = getCacheLocation();
|
|
3045
|
+
if (args.includes("--clear-cache")) {
|
|
3046
|
+
handleClearCache(cacheLocation);
|
|
3047
|
+
return;
|
|
3048
|
+
}
|
|
3049
|
+
checkForMisplacedIgnores();
|
|
2856
3050
|
const command = [
|
|
2857
3051
|
"bun",
|
|
2858
3052
|
"eslint",
|
|
2859
3053
|
"--cache",
|
|
2860
3054
|
"--cache-location",
|
|
2861
|
-
|
|
3055
|
+
cacheLocation,
|
|
2862
3056
|
...args,
|
|
2863
|
-
"."
|
|
3057
|
+
...hasUserPositional(args) ? [] : ["."]
|
|
2864
3058
|
];
|
|
3059
|
+
const dim = "\x1B[2m";
|
|
3060
|
+
const reset = "\x1B[0m";
|
|
3061
|
+
console.log(`${dim}cache: ${cacheLocation} (subsequent runs only re-lint changed files)${reset}`);
|
|
3062
|
+
const startedAt = Date.now();
|
|
2865
3063
|
const proc = Bun.spawn(command, {
|
|
2866
3064
|
stderr: "inherit",
|
|
2867
3065
|
stdout: "inherit"
|
|
2868
3066
|
});
|
|
2869
3067
|
const exitCode = await proc.exited;
|
|
2870
|
-
|
|
3068
|
+
const elapsed = formatDuration(Date.now() - startedAt);
|
|
3069
|
+
if (exitCode !== 0) {
|
|
3070
|
+
console.log(`${dim}elapsed: ${elapsed}${reset}`);
|
|
2871
3071
|
process.exit(exitCode);
|
|
2872
|
-
|
|
3072
|
+
}
|
|
3073
|
+
console.log(`\x1B[32m\u2713\x1B[0m Passed ${dim}(${elapsed})${reset}`);
|
|
2873
3074
|
};
|
|
2874
3075
|
|
|
2875
3076
|
// src/cli/scripts/info.ts
|
|
2876
3077
|
init_constants();
|
|
2877
3078
|
init_utils();
|
|
2878
3079
|
import { execSync as execSync2 } from "child_process";
|
|
2879
|
-
import { existsSync as
|
|
3080
|
+
import { existsSync as existsSync7, readFileSync as readFileSync6 } from "fs";
|
|
2880
3081
|
import { arch as arch2, cpus, platform as platform3, totalmem, version } from "os";
|
|
2881
|
-
import { resolve as
|
|
3082
|
+
import { resolve as resolve5 } from "path";
|
|
2882
3083
|
var bold = (str) => `\x1B[1m${str}\x1B[0m`;
|
|
2883
3084
|
var getBinaryVersion = (binary, flag = "--version") => {
|
|
2884
3085
|
try {
|
|
@@ -2898,7 +3099,7 @@ var getPackageVersion = (packageName) => {
|
|
|
2898
3099
|
const pkgPath = __require.resolve(`${packageName}/package.json`, {
|
|
2899
3100
|
paths: [process.cwd()]
|
|
2900
3101
|
});
|
|
2901
|
-
const pkg = JSON.parse(
|
|
3102
|
+
const pkg = JSON.parse(readFileSync6(pkgPath, "utf-8"));
|
|
2902
3103
|
const ver = pkg.version;
|
|
2903
3104
|
return ver;
|
|
2904
3105
|
} catch {
|
|
@@ -2908,10 +3109,10 @@ var getPackageVersion = (packageName) => {
|
|
|
2908
3109
|
var getAbsoluteVersion = () => {
|
|
2909
3110
|
try {
|
|
2910
3111
|
const candidates = [
|
|
2911
|
-
|
|
2912
|
-
|
|
3112
|
+
resolve5(import.meta.dir, "..", "..", "package.json"),
|
|
3113
|
+
resolve5(import.meta.dir, "..", "..", "..", "package.json")
|
|
2913
3114
|
];
|
|
2914
|
-
const pkgPath = candidates.find((candidate) =>
|
|
3115
|
+
const pkgPath = candidates.find((candidate) => existsSync7(candidate));
|
|
2915
3116
|
if (pkgPath)
|
|
2916
3117
|
return readPackageVersion(pkgPath);
|
|
2917
3118
|
} catch {
|
|
@@ -2920,7 +3121,7 @@ var getAbsoluteVersion = () => {
|
|
|
2920
3121
|
return getPackageVersion("@absolutejs/absolute");
|
|
2921
3122
|
};
|
|
2922
3123
|
var readPackageVersion = (pkgPath) => {
|
|
2923
|
-
const pkg = JSON.parse(
|
|
3124
|
+
const pkg = JSON.parse(readFileSync6(pkgPath, "utf-8"));
|
|
2924
3125
|
const ver = pkg.version;
|
|
2925
3126
|
return ver;
|
|
2926
3127
|
};
|
|
@@ -2952,7 +3153,7 @@ var detectCI = () => {
|
|
|
2952
3153
|
};
|
|
2953
3154
|
var isDockerEnvironment = () => {
|
|
2954
3155
|
try {
|
|
2955
|
-
return
|
|
3156
|
+
return existsSync7("/.dockerenv");
|
|
2956
3157
|
} catch {
|
|
2957
3158
|
return false;
|
|
2958
3159
|
}
|
|
@@ -3163,8 +3364,8 @@ init_startupBanner();
|
|
|
3163
3364
|
init_telemetryEvent();
|
|
3164
3365
|
init_utils();
|
|
3165
3366
|
var {env: env2 } = globalThis.Bun;
|
|
3166
|
-
import { existsSync as
|
|
3167
|
-
import { basename, resolve as
|
|
3367
|
+
import { existsSync as existsSync8, readFileSync as readFileSync8 } from "fs";
|
|
3368
|
+
import { basename, resolve as resolve7 } from "path";
|
|
3168
3369
|
var cliTag2 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[cli]\x1B[0m ${color}${message}\x1B[0m`;
|
|
3169
3370
|
var resolvePackageVersion = (candidates) => {
|
|
3170
3371
|
for (const candidate of candidates) {
|
|
@@ -3177,7 +3378,7 @@ var resolvePackageVersion = (candidates) => {
|
|
|
3177
3378
|
};
|
|
3178
3379
|
var readPackageVersion2 = (candidate) => {
|
|
3179
3380
|
try {
|
|
3180
|
-
const pkg = JSON.parse(
|
|
3381
|
+
const pkg = JSON.parse(readFileSync8(candidate, "utf-8"));
|
|
3181
3382
|
if (pkg.name !== "@absolutejs/absolute")
|
|
3182
3383
|
return null;
|
|
3183
3384
|
const ver = pkg.version;
|
|
@@ -3219,18 +3420,18 @@ var handleBundleFailure = (serverBundle, bundleStart, serverEntry) => {
|
|
|
3219
3420
|
};
|
|
3220
3421
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
3221
3422
|
const candidates = [
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3423
|
+
resolve7(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
3424
|
+
resolve7(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js"),
|
|
3425
|
+
resolve7(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.ts"),
|
|
3426
|
+
resolve7(import.meta.dir, "..", "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
3427
|
+
resolve7(import.meta.dir, "..", "..", "..", "react", "jsxDevRuntimeCompat.js"),
|
|
3428
|
+
resolve7(import.meta.dir, "..", "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
3228
3429
|
];
|
|
3229
3430
|
for (const candidate of candidates) {
|
|
3230
|
-
if (
|
|
3431
|
+
if (existsSync8(candidate))
|
|
3231
3432
|
return candidate;
|
|
3232
3433
|
}
|
|
3233
|
-
return
|
|
3434
|
+
return resolve7(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js");
|
|
3234
3435
|
};
|
|
3235
3436
|
var jsxDevRuntimeCompatPath = resolveJsxDevRuntimeCompatPath();
|
|
3236
3437
|
var prerenderStaticPages = async (outputPath, prerenderPort, resolvedOutdir, staticConfig, absoluteVersion, configPath2) => {
|
|
@@ -3257,10 +3458,10 @@ var start = async (serverEntry, outdir, configPath2) => {
|
|
|
3257
3458
|
const port = Number(env2.PORT) || DEFAULT_PORT;
|
|
3258
3459
|
killStaleProcesses(port);
|
|
3259
3460
|
const entryName = basename(serverEntry).replace(/\.[^.]+$/, "");
|
|
3260
|
-
const resolvedOutdir =
|
|
3461
|
+
const resolvedOutdir = resolve7(outdir ?? "dist");
|
|
3261
3462
|
const absoluteVersion = resolvePackageVersion([
|
|
3262
|
-
|
|
3263
|
-
|
|
3463
|
+
resolve7(import.meta.dir, "..", "..", "..", "package.json"),
|
|
3464
|
+
resolve7(import.meta.dir, "..", "..", "package.json")
|
|
3264
3465
|
]);
|
|
3265
3466
|
const buildStepStart = performance.now();
|
|
3266
3467
|
process.stdout.write(cliTag2("\x1B[36m", `Building assets`));
|
|
@@ -3277,8 +3478,8 @@ var start = async (serverEntry, outdir, configPath2) => {
|
|
|
3277
3478
|
].filter((val) => Boolean(val));
|
|
3278
3479
|
try {
|
|
3279
3480
|
const build = await resolveBuildModule([
|
|
3280
|
-
|
|
3281
|
-
|
|
3481
|
+
resolve7(import.meta.dir, "..", "..", "core", "build"),
|
|
3482
|
+
resolve7(import.meta.dir, "..", "build")
|
|
3282
3483
|
]);
|
|
3283
3484
|
if (!build)
|
|
3284
3485
|
throw new Error("Could not locate build module");
|
|
@@ -3358,7 +3559,7 @@ var start = async (serverEntry, outdir, configPath2) => {
|
|
|
3358
3559
|
};
|
|
3359
3560
|
const serverBundle = await Bun.build({
|
|
3360
3561
|
define: { "process.env.NODE_ENV": '"production"' },
|
|
3361
|
-
entrypoints: [
|
|
3562
|
+
entrypoints: [resolve7(serverEntry)],
|
|
3362
3563
|
external: [
|
|
3363
3564
|
"react",
|
|
3364
3565
|
"react/jsx-runtime",
|
|
@@ -3385,14 +3586,14 @@ var start = async (serverEntry, outdir, configPath2) => {
|
|
|
3385
3586
|
if (!serverBundle.success) {
|
|
3386
3587
|
handleBundleFailure(serverBundle, bundleStart, serverEntry);
|
|
3387
3588
|
}
|
|
3388
|
-
const outputPath =
|
|
3389
|
-
if (!
|
|
3589
|
+
const outputPath = resolve7(resolvedOutdir, `${entryName}.js`);
|
|
3590
|
+
if (!existsSync8(outputPath)) {
|
|
3390
3591
|
console.error(cliTag2("\x1B[31m", `Expected output not found: ${outputPath}`));
|
|
3391
3592
|
process.exit(1);
|
|
3392
3593
|
}
|
|
3393
|
-
if (
|
|
3594
|
+
if (existsSync8(resolve7(resolvedOutdir, "angular", "vendor", "server"))) {
|
|
3394
3595
|
const { readdirSync } = await import("fs");
|
|
3395
|
-
const vendorDir =
|
|
3596
|
+
const vendorDir = resolve7(resolvedOutdir, "angular", "vendor", "server");
|
|
3396
3597
|
const vendorEntries = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
3397
3598
|
const angularServerVendorPaths = {};
|
|
3398
3599
|
const { relative: pathRelative, dirname: pathDirname } = await import("path");
|
|
@@ -3402,7 +3603,7 @@ var start = async (serverEntry, outdir, configPath2) => {
|
|
|
3402
3603
|
if (scope !== "angular" || rest.length === 0)
|
|
3403
3604
|
continue;
|
|
3404
3605
|
const specifier = `@angular/${rest.join("/")}`;
|
|
3405
|
-
const relPath = pathRelative(pathDirname(outputPath),
|
|
3606
|
+
const relPath = pathRelative(pathDirname(outputPath), resolve7(vendorDir, file));
|
|
3406
3607
|
angularServerVendorPaths[specifier] = relPath.startsWith(".") ? relPath : `./${relPath}`;
|
|
3407
3608
|
}
|
|
3408
3609
|
if (Object.keys(angularServerVendorPaths).length > 0) {
|
|
@@ -3420,7 +3621,7 @@ var start = async (serverEntry, outdir, configPath2) => {
|
|
|
3420
3621
|
if (buildConfig.static) {
|
|
3421
3622
|
await prerenderStaticPages(outputPath, port + 1, resolvedOutdir, buildConfig.static, absoluteVersion, configPath2);
|
|
3422
3623
|
}
|
|
3423
|
-
const usesDocker =
|
|
3624
|
+
const usesDocker = existsSync8(resolve7(COMPOSE_PATH));
|
|
3424
3625
|
const scripts = usesDocker ? await readDbScripts() : null;
|
|
3425
3626
|
if (scripts)
|
|
3426
3627
|
await startDatabase(scripts);
|
|
@@ -3487,15 +3688,15 @@ init_loadConfig();
|
|
|
3487
3688
|
init_getDurationString();
|
|
3488
3689
|
import {
|
|
3489
3690
|
appendFileSync,
|
|
3490
|
-
existsSync as
|
|
3691
|
+
existsSync as existsSync9,
|
|
3491
3692
|
mkdirSync as mkdirSync4,
|
|
3492
3693
|
readdirSync,
|
|
3493
|
-
readFileSync as
|
|
3694
|
+
readFileSync as readFileSync9,
|
|
3494
3695
|
unlinkSync,
|
|
3495
3696
|
writeFileSync as writeFileSync2
|
|
3496
3697
|
} from "fs";
|
|
3497
3698
|
import { createConnection } from "net";
|
|
3498
|
-
import { resolve as
|
|
3699
|
+
import { resolve as resolve8 } from "path";
|
|
3499
3700
|
|
|
3500
3701
|
// src/cli/workspaceTui.ts
|
|
3501
3702
|
init_constants();
|
|
@@ -4157,11 +4358,11 @@ var sleep = (durationMs) => Bun.sleep(durationMs);
|
|
|
4157
4358
|
var stripAnsi2 = (value) => value.replace(ANSI_REGEX2, "");
|
|
4158
4359
|
var sanitizeLogFileName = (value) => value.replace(/[^a-zA-Z0-9._-]/g, "_") || "unknown";
|
|
4159
4360
|
var createWorkspaceLogSink = (appendLog) => {
|
|
4160
|
-
const logDirectory =
|
|
4361
|
+
const logDirectory = resolve8(".absolutejs", "workspace", "logs");
|
|
4161
4362
|
mkdirSync4(logDirectory, { recursive: true });
|
|
4162
|
-
readdirSync(logDirectory).filter((file) => file.endsWith(".log")).forEach((file) => unlinkSync(
|
|
4163
|
-
writeFileSync2(
|
|
4164
|
-
writeFileSync2(
|
|
4363
|
+
readdirSync(logDirectory).filter((file) => file.endsWith(".log")).forEach((file) => unlinkSync(resolve8(logDirectory, file)));
|
|
4364
|
+
writeFileSync2(resolve8(logDirectory, "all.log"), "");
|
|
4365
|
+
writeFileSync2(resolve8(logDirectory, "workspace.log"), "");
|
|
4165
4366
|
const initializedSources = new Set(["workspace"]);
|
|
4166
4367
|
const writeLog = (source, message, level) => {
|
|
4167
4368
|
const cleanMessage = stripAnsi2(message).trimEnd();
|
|
@@ -4171,13 +4372,13 @@ var createWorkspaceLogSink = (appendLog) => {
|
|
|
4171
4372
|
const timestamp = new Date().toISOString();
|
|
4172
4373
|
const line = `[${timestamp}] [${level}] [${source}] ${cleanMessage}
|
|
4173
4374
|
`;
|
|
4174
|
-
const sourceFile =
|
|
4375
|
+
const sourceFile = resolve8(logDirectory, `${sanitizeLogFileName(source)}.log`);
|
|
4175
4376
|
if (!initializedSources.has(source)) {
|
|
4176
4377
|
writeFileSync2(sourceFile, "");
|
|
4177
4378
|
initializedSources.add(source);
|
|
4178
4379
|
}
|
|
4179
4380
|
appendFileSync(sourceFile, line);
|
|
4180
|
-
appendFileSync(
|
|
4381
|
+
appendFileSync(resolve8(logDirectory, "all.log"), line);
|
|
4181
4382
|
};
|
|
4182
4383
|
return {
|
|
4183
4384
|
appendLog: (source, message, level = "info") => {
|
|
@@ -4189,7 +4390,7 @@ var createWorkspaceLogSink = (appendLog) => {
|
|
|
4189
4390
|
};
|
|
4190
4391
|
var readPackageVersion3 = (candidate) => {
|
|
4191
4392
|
try {
|
|
4192
|
-
const pkg = JSON.parse(
|
|
4393
|
+
const pkg = JSON.parse(readFileSync9(candidate, "utf-8"));
|
|
4193
4394
|
if (pkg.name !== "@absolutejs/absolute") {
|
|
4194
4395
|
return null;
|
|
4195
4396
|
}
|
|
@@ -4201,9 +4402,9 @@ var readPackageVersion3 = (candidate) => {
|
|
|
4201
4402
|
};
|
|
4202
4403
|
var resolvePackageVersion2 = () => {
|
|
4203
4404
|
const candidates = [
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4405
|
+
resolve8(import.meta.dir, "..", "..", "package.json"),
|
|
4406
|
+
resolve8(import.meta.dir, "..", "..", "..", "package.json"),
|
|
4407
|
+
resolve8(import.meta.dir, "..", "..", "..", "..", "package.json")
|
|
4207
4408
|
];
|
|
4208
4409
|
for (const candidate of candidates) {
|
|
4209
4410
|
const version2 = readPackageVersion3(candidate);
|
|
@@ -4551,15 +4752,15 @@ var createWorkspaceServiceEnv = (services) => {
|
|
|
4551
4752
|
var getDefinedProcessEnv = () => Object.fromEntries(Object.entries(process.env).filter((entry) => typeof entry[1] === "string"));
|
|
4552
4753
|
var resolveAbsoluteServiceConfigPath = (service, cwd, options) => {
|
|
4553
4754
|
if (service.config)
|
|
4554
|
-
return
|
|
4755
|
+
return resolve8(cwd, service.config);
|
|
4555
4756
|
if (options.configPath)
|
|
4556
|
-
return
|
|
4757
|
+
return resolve8(options.configPath);
|
|
4557
4758
|
if (process.env.ABSOLUTE_CONFIG)
|
|
4558
|
-
return
|
|
4759
|
+
return resolve8(process.env.ABSOLUTE_CONFIG);
|
|
4559
4760
|
return;
|
|
4560
4761
|
};
|
|
4561
4762
|
var resolveService = (name, service, workspaceEnv, options) => {
|
|
4562
|
-
const cwd =
|
|
4763
|
+
const cwd = resolve8(service.cwd ?? ".");
|
|
4563
4764
|
const envVars = Object.assign(getDefinedProcessEnv(), workspaceEnv, service.env, {
|
|
4564
4765
|
ABSOLUTE_WORKSPACE_MANAGED: "1",
|
|
4565
4766
|
ABSOLUTE_WORKSPACE_SERVICE_NAME: name,
|
|
@@ -4601,8 +4802,8 @@ var resolveService = (name, service, workspaceEnv, options) => {
|
|
|
4601
4802
|
var resolveServiceBuildDirectory = (service) => {
|
|
4602
4803
|
if (!isAbsoluteService(service))
|
|
4603
4804
|
return null;
|
|
4604
|
-
const cwd =
|
|
4605
|
-
return
|
|
4805
|
+
const cwd = resolve8(service.cwd ?? ".");
|
|
4806
|
+
return resolve8(cwd, service.buildDirectory ?? "build");
|
|
4606
4807
|
};
|
|
4607
4808
|
var findSharedWorkspaceBuildDirectories = (services) => {
|
|
4608
4809
|
const byBuildDirectory = new Map;
|
|
@@ -4790,7 +4991,7 @@ var workspace = async (subcommand, options) => {
|
|
|
4790
4991
|
const resolved = resolveService(name, service, workspaceEnv, options);
|
|
4791
4992
|
const port = (resolved.service.port ?? Number(resolved.env.PORT ?? "")) || DEFAULT_PORT;
|
|
4792
4993
|
killStaleServicePort(port);
|
|
4793
|
-
if (isAbsoluteService(resolved.service) && resolved.configPath && !
|
|
4994
|
+
if (isAbsoluteService(resolved.service) && resolved.configPath && !existsSync9(resolved.configPath)) {
|
|
4794
4995
|
throw new Error(`${name} references missing config "${resolved.configPath}"`);
|
|
4795
4996
|
}
|
|
4796
4997
|
serviceBootStartedAt.set(name, performance.now());
|
|
@@ -1 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run ESLint with sensible absolutejs defaults.
|
|
3
|
+
*
|
|
4
|
+
* - Caching: enabled by default, cache file location overridable via
|
|
5
|
+
* the `ABSOLUTE_ESLINT_CACHE` env var (default: `.absolutejs/eslint-cache`).
|
|
6
|
+
* - Implicit lint target: `.` is appended only when the user hasn't
|
|
7
|
+
* supplied a positional path of their own. So `bun lint src/backend/`
|
|
8
|
+
* lints just that directory — not the whole repo plus `src/backend/`.
|
|
9
|
+
* - `--clear-cache`: handled by this script (not passed to ESLint),
|
|
10
|
+
* wipes the cache file and exits cleanly.
|
|
11
|
+
*
|
|
12
|
+
* NOTE: this script does NOT pass `--fix`. Autofixing is opt-in via the
|
|
13
|
+
* standard ESLint flag — `bun lint --fix` works because user args are
|
|
14
|
+
* spread through to the underlying `bun eslint` invocation. Users who
|
|
15
|
+
* see files getting auto-fixed without `--fix` are typically running an
|
|
16
|
+
* editor extension (VS Code's `editor.codeActionsOnSave` is the usual
|
|
17
|
+
* suspect) — that's IDE behavior, not this CLI.
|
|
18
|
+
*/
|
|
1
19
|
export declare const eslint: (args: string[]) => Promise<void>;
|
package/package.json
CHANGED