@absolutejs/absolute 0.19.0-beta.1105 → 0.19.0-beta.1107
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-1tyy8v/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-1tyy8v/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-1tyy8v/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
|
@@ -169997,7 +169997,7 @@ var isRecord = (value) => typeof value === "object" && value !== null, getIsland
|
|
|
169997
169997
|
var init_islands = () => {};
|
|
169998
169998
|
|
|
169999
169999
|
// src/build/islandEntries.ts
|
|
170000
|
-
import { dirname as
|
|
170000
|
+
import { dirname as dirname4, extname, join as join8, relative, resolve as resolve6 } from "path";
|
|
170001
170001
|
var import_typescript, frameworks, isRecord2 = (value) => typeof value === "object" && value !== null, resolveRegistryExport = (mod) => {
|
|
170002
170002
|
if (isRecord2(mod.islandRegistry))
|
|
170003
170003
|
return mod.islandRegistry;
|
|
@@ -170008,7 +170008,7 @@ var import_typescript, frameworks, isRecord2 = (value) => typeof value === "obje
|
|
|
170008
170008
|
if (sourcePath.startsWith("file://")) {
|
|
170009
170009
|
return new URL(sourcePath).pathname;
|
|
170010
170010
|
}
|
|
170011
|
-
return resolve6(
|
|
170011
|
+
return resolve6(dirname4(registryPath), sourcePath);
|
|
170012
170012
|
}, getObjectPropertyName = (name) => {
|
|
170013
170013
|
if (import_typescript.default.isIdentifier(name) || import_typescript.default.isStringLiteral(name)) {
|
|
170014
170014
|
return name.text;
|
|
@@ -170396,7 +170396,7 @@ __export(exports_prerender, {
|
|
|
170396
170396
|
prerender: () => prerender,
|
|
170397
170397
|
PRERENDER_BYPASS_HEADER: () => PRERENDER_BYPASS_HEADER
|
|
170398
170398
|
});
|
|
170399
|
-
import { mkdirSync as
|
|
170399
|
+
import { mkdirSync as mkdirSync6, readFileSync as readFileSync10 } from "fs";
|
|
170400
170400
|
import { join as join9 } from "path";
|
|
170401
170401
|
var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_TIMEOUT_MS = 30000, DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
170402
170402
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
@@ -170498,7 +170498,7 @@ var SERVER_OUTPUT_LIMIT = 4000, STARTUP_POLL_INTERVAL_MS = 100, DEFAULT_STARTUP_
|
|
|
170498
170498
|
log?.(` Pre-rendered ${route} \u2192 ${fileName} (${html.length} bytes)`);
|
|
170499
170499
|
}, prerender = async (port, outDir, staticConfig, log) => {
|
|
170500
170500
|
const prerenderDir = join9(outDir, "_prerendered");
|
|
170501
|
-
|
|
170501
|
+
mkdirSync6(prerenderDir, { recursive: true });
|
|
170502
170502
|
const baseUrl = `http://localhost:${port}`;
|
|
170503
170503
|
let routes;
|
|
170504
170504
|
if (staticConfig.routes === "all") {
|
|
@@ -172502,10 +172502,10 @@ var init_mem = __esm(() => {
|
|
|
172502
172502
|
// src/cli/config/schema/fromType.ts
|
|
172503
172503
|
import {
|
|
172504
172504
|
existsSync as existsSync14,
|
|
172505
|
-
mkdirSync as
|
|
172505
|
+
mkdirSync as mkdirSync8,
|
|
172506
172506
|
readFileSync as readFileSync16,
|
|
172507
172507
|
statSync as statSync2,
|
|
172508
|
-
writeFileSync as
|
|
172508
|
+
writeFileSync as writeFileSync7
|
|
172509
172509
|
} from "fs";
|
|
172510
172510
|
import { resolve as resolve11 } from "path";
|
|
172511
172511
|
var import_typescript3, VIRTUAL_NAME = "__absolute_type_introspect__.ts", MAX_DEPTH = 6, isFrameworkRepo = (cwd) => {
|
|
@@ -172565,10 +172565,10 @@ var import_typescript3, VIRTUAL_NAME = "__absolute_type_introspect__.ts", MAX_DE
|
|
|
172565
172565
|
return null;
|
|
172566
172566
|
}, writeDiskCache = (cwd, typeName, signature, fields, specifier) => {
|
|
172567
172567
|
try {
|
|
172568
|
-
|
|
172568
|
+
mkdirSync8(resolve11(cwd, ".absolutejs", "config-schema"), {
|
|
172569
172569
|
recursive: true
|
|
172570
172570
|
});
|
|
172571
|
-
|
|
172571
|
+
writeFileSync7(cacheFile(cwd, typeName, specifier), JSON.stringify({ fields, signature }));
|
|
172572
172572
|
} catch {}
|
|
172573
172573
|
}, docOf = (symbol, checker) => import_typescript3.default.displayPartsToString(symbol.getDocumentationComment(checker)).trim(), typeOfSymbol = (symbol, checker) => {
|
|
172574
172574
|
const declaration = symbol.valueDeclaration ?? symbol.declarations?.[0];
|
|
@@ -172966,7 +172966,7 @@ var init_frameworks = __esm(() => {
|
|
|
172966
172966
|
});
|
|
172967
172967
|
|
|
172968
172968
|
// src/cli/generate/context.ts
|
|
172969
|
-
import { dirname as
|
|
172969
|
+
import { dirname as dirname5, isAbsolute, join as join14, relative as relative3, resolve as resolve13 } from "path";
|
|
172970
172970
|
var asString = (value) => typeof value === "string" ? value : undefined, isRecord3 = (value) => typeof value === "object" && value !== null, resolveDir = (cwd, value) => isAbsolute(value) ? value : resolve13(cwd, value), resolveStylesDir = (cwd, config) => {
|
|
172971
172971
|
const styles = config.stylesConfig;
|
|
172972
172972
|
if (typeof styles === "string")
|
|
@@ -172979,7 +172979,7 @@ var asString = (value) => typeof value === "string" ? value : undefined, isRecor
|
|
|
172979
172979
|
return resolve13(cwd, "src/frontend/styles/indexes");
|
|
172980
172980
|
}, configuredFrameworks = (project) => FRAMEWORK_KEYS2.filter((key) => project.frameworkDirs[key] !== undefined), frontendRootFor = (project, framework) => {
|
|
172981
172981
|
const dir = project.frameworkDirs[framework];
|
|
172982
|
-
return dir ?
|
|
172982
|
+
return dir ? dirname5(dir) : resolve13(project.cwd, "src/frontend");
|
|
172983
172983
|
}, resolveProject = async (cwd, configOverride) => {
|
|
172984
172984
|
const loaded = await loadConfig(configOverride);
|
|
172985
172985
|
const config = isRecord3(loaded) ? loaded : {};
|
|
@@ -173057,8 +173057,8 @@ var emptyOutcome = () => ({
|
|
|
173057
173057
|
});
|
|
173058
173058
|
|
|
173059
173059
|
// src/cli/generate/routeWiring.ts
|
|
173060
|
-
import { existsSync as existsSync16, readFileSync as readFileSync18, readdirSync as readdirSync4, writeFileSync as
|
|
173061
|
-
import { dirname as
|
|
173060
|
+
import { existsSync as existsSync16, readFileSync as readFileSync18, readdirSync as readdirSync4, writeFileSync as writeFileSync8 } from "fs";
|
|
173061
|
+
import { dirname as dirname6, join as join15 } from "path";
|
|
173062
173062
|
var import_typescript5, DEFAULT_SEPARATOR = `
|
|
173063
173063
|
`, BOUNDARY_USE, applyEdits = (text, edits) => {
|
|
173064
173064
|
const ordered = [...edits].sort((first, second) => second.start - first.start);
|
|
@@ -173223,7 +173223,7 @@ ${newLines.join(`
|
|
|
173223
173223
|
}
|
|
173224
173224
|
return null;
|
|
173225
173225
|
}, findRoutingFile = (serverEntry) => {
|
|
173226
|
-
const pluginsDir = join15(
|
|
173226
|
+
const pluginsDir = join15(dirname6(serverEntry), "plugins");
|
|
173227
173227
|
const preferred = join15(pluginsDir, "pagesPlugin.ts");
|
|
173228
173228
|
if (hasChain(preferred))
|
|
173229
173229
|
return preferred;
|
|
@@ -173234,7 +173234,7 @@ ${newLines.join(`
|
|
|
173234
173234
|
return serverEntry;
|
|
173235
173235
|
return null;
|
|
173236
173236
|
}, buildRouteContext = (input, routingFile) => {
|
|
173237
|
-
const specifier = `${toModuleSpecifier(
|
|
173237
|
+
const specifier = `${toModuleSpecifier(dirname6(routingFile), stripExtension(input.pageFileAbs))}${input.def.pageImportExtension ?? ""}`;
|
|
173238
173238
|
return {
|
|
173239
173239
|
cssAssetKey: input.cssAssetKey,
|
|
173240
173240
|
indexKey: input.indexKey,
|
|
@@ -173270,7 +173270,7 @@ ${newLines.join(`
|
|
|
173270
173270
|
start: offset,
|
|
173271
173271
|
text: `${separator}.use(${pluginName})`
|
|
173272
173272
|
});
|
|
173273
|
-
|
|
173273
|
+
writeFileSync8(serverEntry, applyEdits(text, edits), "utf-8");
|
|
173274
173274
|
return { kind: "edited", routingFile: serverEntry };
|
|
173275
173275
|
}, wireRoute = (input) => {
|
|
173276
173276
|
const routingFile = findRoutingFile(input.serverEntry);
|
|
@@ -173306,7 +173306,7 @@ ${routeExpr}`
|
|
|
173306
173306
|
start: offset,
|
|
173307
173307
|
text: `${separator}${routeExpr}`
|
|
173308
173308
|
});
|
|
173309
|
-
|
|
173309
|
+
writeFileSync8(routingFile, applyEdits(text, edits), "utf-8");
|
|
173310
173310
|
return { kind: "edited", routingFile };
|
|
173311
173311
|
};
|
|
173312
173312
|
var init_routeWiring = __esm(() => {
|
|
@@ -173316,8 +173316,8 @@ var init_routeWiring = __esm(() => {
|
|
|
173316
173316
|
});
|
|
173317
173317
|
|
|
173318
173318
|
// src/cli/generate/generateApi.ts
|
|
173319
|
-
import { existsSync as existsSync17, mkdirSync as
|
|
173320
|
-
import { dirname as
|
|
173319
|
+
import { existsSync as existsSync17, mkdirSync as mkdirSync9, writeFileSync as writeFileSync9 } from "fs";
|
|
173320
|
+
import { dirname as dirname7, join as join16 } from "path";
|
|
173321
173321
|
var apiPluginTemplate = (pluginName, base) => `import { Elysia } from 'elysia';
|
|
173322
173322
|
|
|
173323
173323
|
export const ${pluginName} = new Elysia()
|
|
@@ -173329,16 +173329,16 @@ export const ${pluginName} = new Elysia()
|
|
|
173329
173329
|
const pluginName = `${camel}Plugin`;
|
|
173330
173330
|
const base = `/api/${kebab}`;
|
|
173331
173331
|
const outcome = { ...emptyOutcome(), route: base };
|
|
173332
|
-
const pluginsDir = join16(
|
|
173332
|
+
const pluginsDir = join16(dirname7(project.serverEntry), "plugins");
|
|
173333
173333
|
const fileAbs = join16(pluginsDir, `${pluginName}.ts`);
|
|
173334
173334
|
if (existsSync17(fileAbs)) {
|
|
173335
173335
|
outcome.notes.push(`${pluginName} already exists at ${fileAbs} \u2014 skipped.`);
|
|
173336
173336
|
return outcome;
|
|
173337
173337
|
}
|
|
173338
|
-
|
|
173339
|
-
|
|
173338
|
+
mkdirSync9(pluginsDir, { recursive: true });
|
|
173339
|
+
writeFileSync9(fileAbs, apiPluginTemplate(pluginName, base), "utf-8");
|
|
173340
173340
|
outcome.created.push(fileAbs);
|
|
173341
|
-
const specifier = toModuleSpecifier(
|
|
173341
|
+
const specifier = toModuleSpecifier(dirname7(project.serverEntry), fileAbs.replace(/\.ts$/, ""));
|
|
173342
173342
|
const wired = wirePluginUse(project.serverEntry, pluginName, specifier);
|
|
173343
173343
|
if (wired.kind === "edited")
|
|
173344
173344
|
outcome.updated.push(wired.routingFile);
|
|
@@ -173404,8 +173404,8 @@ var init_componentTemplates = __esm(() => {
|
|
|
173404
173404
|
});
|
|
173405
173405
|
|
|
173406
173406
|
// src/cli/generate/generateComponent.ts
|
|
173407
|
-
import { existsSync as existsSync18, mkdirSync as
|
|
173408
|
-
import { dirname as
|
|
173407
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync10, writeFileSync as writeFileSync10 } from "fs";
|
|
173408
|
+
import { dirname as dirname8, join as join17 } from "path";
|
|
173409
173409
|
var generateComponent = (project, framework, rawName) => {
|
|
173410
173410
|
const def = frameworks2[framework];
|
|
173411
173411
|
const pascal = toPascalCase(rawName);
|
|
@@ -173421,8 +173421,8 @@ var generateComponent = (project, framework, rawName) => {
|
|
|
173421
173421
|
outcome.notes.push(`${pascal} already exists at ${fileAbs} \u2014 skipped.`);
|
|
173422
173422
|
return outcome;
|
|
173423
173423
|
}
|
|
173424
|
-
|
|
173425
|
-
|
|
173424
|
+
mkdirSync10(dirname8(fileAbs), { recursive: true });
|
|
173425
|
+
writeFileSync10(fileAbs, componentTemplates[framework]({
|
|
173426
173426
|
kebab,
|
|
173427
173427
|
pascal,
|
|
173428
173428
|
title: toTitleCase(rawName)
|
|
@@ -173503,8 +173503,8 @@ var init_cssStrategy = __esm(() => {
|
|
|
173503
173503
|
});
|
|
173504
173504
|
|
|
173505
173505
|
// src/cli/generate/navData.ts
|
|
173506
|
-
import { existsSync as existsSync20, mkdirSync as
|
|
173507
|
-
import { dirname as
|
|
173506
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync11, readFileSync as readFileSync19, writeFileSync as writeFileSync11 } from "fs";
|
|
173507
|
+
import { dirname as dirname9 } from "path";
|
|
173508
173508
|
var import_typescript7, NAV_DATA_TEMPLATE = `type NavItem = {
|
|
173509
173509
|
href: string;
|
|
173510
173510
|
label: string;
|
|
@@ -173581,8 +173581,8 @@ ${indent}${entry}`;
|
|
|
173581
173581
|
}, upsertNavItem = (navDataPath, item) => {
|
|
173582
173582
|
const created = !existsSync20(navDataPath);
|
|
173583
173583
|
if (created) {
|
|
173584
|
-
|
|
173585
|
-
|
|
173584
|
+
mkdirSync11(dirname9(navDataPath), { recursive: true });
|
|
173585
|
+
writeFileSync11(navDataPath, NAV_DATA_TEMPLATE, "utf-8");
|
|
173586
173586
|
}
|
|
173587
173587
|
const existing = readNavItems(navDataPath);
|
|
173588
173588
|
if (existing.some((candidate) => candidate.href === item.href)) {
|
|
@@ -173594,7 +173594,7 @@ ${indent}${entry}`;
|
|
|
173594
173594
|
if (!array)
|
|
173595
173595
|
return { changed: created, created, items: existing };
|
|
173596
173596
|
const entry = `{ href: '${item.href}', label: '${item.label}' }`;
|
|
173597
|
-
|
|
173597
|
+
writeFileSync11(navDataPath, insertElement(text, array, sourceFile, entry), "utf-8");
|
|
173598
173598
|
return { changed: true, created, items: [...existing, item] };
|
|
173599
173599
|
};
|
|
173600
173600
|
var init_navData = __esm(() => {
|
|
@@ -173748,15 +173748,15 @@ var init_pageTemplates = __esm(() => {
|
|
|
173748
173748
|
// src/cli/generate/generatePage.ts
|
|
173749
173749
|
import {
|
|
173750
173750
|
existsSync as existsSync21,
|
|
173751
|
-
mkdirSync as
|
|
173751
|
+
mkdirSync as mkdirSync12,
|
|
173752
173752
|
readFileSync as readFileSync20,
|
|
173753
173753
|
readdirSync as readdirSync5,
|
|
173754
|
-
writeFileSync as
|
|
173754
|
+
writeFileSync as writeFileSync12
|
|
173755
173755
|
} from "fs";
|
|
173756
|
-
import { dirname as
|
|
173756
|
+
import { dirname as dirname10, join as join19, relative as relative4 } from "path";
|
|
173757
173757
|
var writeNew = (path, contents) => {
|
|
173758
|
-
|
|
173759
|
-
|
|
173758
|
+
mkdirSync12(dirname10(path), { recursive: true });
|
|
173759
|
+
writeFileSync12(path, contents, "utf-8");
|
|
173760
173760
|
}, toHref = (fromDir, toFile) => {
|
|
173761
173761
|
const rel = relative4(fromDir, toFile).split("\\").join("/");
|
|
173762
173762
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
@@ -173765,7 +173765,7 @@ var writeNew = (path, contents) => {
|
|
|
173765
173765
|
const synced = syncStaticNav(html, items);
|
|
173766
173766
|
if (synced === null || synced === html)
|
|
173767
173767
|
return false;
|
|
173768
|
-
|
|
173768
|
+
writeFileSync12(file, synced, "utf-8");
|
|
173769
173769
|
return true;
|
|
173770
173770
|
}, resyncStaticPages = (project, items, skipFile) => {
|
|
173771
173771
|
const updated = [];
|
|
@@ -173798,9 +173798,9 @@ var writeNew = (path, contents) => {
|
|
|
173798
173798
|
const css = planCss(routingText, project.stylesDir, pascal, kebab);
|
|
173799
173799
|
const navDataPath = join19(sharedDirFor(project, framework), "navData.ts");
|
|
173800
173800
|
const nav = upsertNavItem(navDataPath, { href: route, label: title });
|
|
173801
|
-
const navImportPath = toModuleSpecifier(
|
|
173801
|
+
const navImportPath = toModuleSpecifier(dirname10(pageFileAbs), navDataPath.replace(/\.ts$/, ""));
|
|
173802
173802
|
writeNew(pageFileAbs, pageTemplates[framework]({
|
|
173803
|
-
cssHref: toHref(
|
|
173803
|
+
cssHref: toHref(dirname10(pageFileAbs), css.cssFileAbs),
|
|
173804
173804
|
kebab,
|
|
173805
173805
|
navImportPath,
|
|
173806
173806
|
navItems: nav.items,
|
|
@@ -173867,13 +173867,13 @@ var SUBCOMMANDS, write = (text) => process.stdout.write(`${text}
|
|
|
173867
173867
|
consumed.add(idx + 1);
|
|
173868
173868
|
}
|
|
173869
173869
|
const positionals = args.filter((value, idx) => !consumed.has(idx) && !value.startsWith("--"));
|
|
173870
|
-
const
|
|
173870
|
+
const flagValue2 = (flag) => {
|
|
173871
173871
|
const idx = args.indexOf(flag);
|
|
173872
173872
|
return idx >= 0 ? args[idx + 1] : undefined;
|
|
173873
173873
|
};
|
|
173874
173874
|
return {
|
|
173875
|
-
config:
|
|
173876
|
-
framework:
|
|
173875
|
+
config: flagValue2("--config"),
|
|
173876
|
+
framework: flagValue2("--framework"),
|
|
173877
173877
|
name: positionals[1],
|
|
173878
173878
|
subcommand: positionals[0]
|
|
173879
173879
|
};
|
|
@@ -173985,7 +173985,7 @@ ${indent.repeat(level)}}`;
|
|
|
173985
173985
|
var init_serialize = () => {};
|
|
173986
173986
|
|
|
173987
173987
|
// src/cli/config/absolute/editAbsoluteConfig.ts
|
|
173988
|
-
import { readFileSync as readFileSync21, writeFileSync as
|
|
173988
|
+
import { readFileSync as readFileSync21, writeFileSync as writeFileSync13 } from "fs";
|
|
173989
173989
|
var import_typescript8, lineStartOffset = (text, position) => {
|
|
173990
173990
|
let index = position;
|
|
173991
173991
|
while (index > 0 && text[index - 1] !== `
|
|
@@ -174014,14 +174014,14 @@ var import_typescript8, lineStartOffset = (text, position) => {
|
|
|
174014
174014
|
if (text[end] === `
|
|
174015
174015
|
`)
|
|
174016
174016
|
end += 1;
|
|
174017
|
-
|
|
174017
|
+
writeFileSync13(configPath2, text.slice(0, start2) + text.slice(end), "utf-8");
|
|
174018
174018
|
return { message: `Removed ${request.name}`, ok: true };
|
|
174019
174019
|
}
|
|
174020
174020
|
const valueText = serializeValue(request.value);
|
|
174021
174021
|
if (existing) {
|
|
174022
174022
|
const start2 = existing.initializer.getStart(sourceFile);
|
|
174023
174023
|
const end = existing.initializer.getEnd();
|
|
174024
|
-
|
|
174024
|
+
writeFileSync13(configPath2, text.slice(0, start2) + valueText + text.slice(end), "utf-8");
|
|
174025
174025
|
return { message: `Updated ${request.name}`, ok: true };
|
|
174026
174026
|
}
|
|
174027
174027
|
const { properties } = object;
|
|
@@ -174041,14 +174041,14 @@ var import_typescript8, lineStartOffset = (text, position) => {
|
|
|
174041
174041
|
at += 1;
|
|
174042
174042
|
const insertion = `${hasComma ? "" : ","}
|
|
174043
174043
|
${indent}${entry}`;
|
|
174044
|
-
|
|
174044
|
+
writeFileSync13(configPath2, text.slice(0, at) + insertion + text.slice(at), "utf-8");
|
|
174045
174045
|
} else {
|
|
174046
174046
|
const at = object.getStart(sourceFile) + 1;
|
|
174047
174047
|
const indent = `${indentBefore2(text, object.getStart(sourceFile))} `;
|
|
174048
174048
|
const insertion = `
|
|
174049
174049
|
${indent}${entry}
|
|
174050
174050
|
${indentBefore2(text, object.getStart(sourceFile))}`;
|
|
174051
|
-
|
|
174051
|
+
writeFileSync13(configPath2, text.slice(0, at) + insertion + text.slice(at), "utf-8");
|
|
174052
174052
|
}
|
|
174053
174053
|
return { message: `Updated ${request.name}`, ok: true };
|
|
174054
174054
|
} catch (error) {
|
|
@@ -174962,8 +174962,8 @@ var init_resolveAuthState = __esm(() => {
|
|
|
174962
174962
|
});
|
|
174963
174963
|
|
|
174964
174964
|
// src/cli/config/auth/scaffoldAuthFeature.ts
|
|
174965
|
-
import { existsSync as existsSync25, writeFileSync as
|
|
174966
|
-
import { dirname as
|
|
174965
|
+
import { existsSync as existsSync25, writeFileSync as writeFileSync14 } from "fs";
|
|
174966
|
+
import { dirname as dirname11, join as join22, relative as relative7, resolve as resolve16 } from "path";
|
|
174967
174967
|
var renderScaffold = (scaffold) => {
|
|
174968
174968
|
const importNames = [...scaffold.imports, `type ${scaffold.typeName}`];
|
|
174969
174969
|
const importLine = `import { ${importNames.join(", ")} } from '@absolutejs/auth';`;
|
|
@@ -174988,7 +174988,7 @@ ${body}
|
|
|
174988
174988
|
}, targetDir = (cwd) => {
|
|
174989
174989
|
const { setupPath } = resolveAuthState(cwd);
|
|
174990
174990
|
if (setupPath)
|
|
174991
|
-
return
|
|
174991
|
+
return dirname11(resolve16(cwd, setupPath));
|
|
174992
174992
|
const src = join22(cwd, "src");
|
|
174993
174993
|
return existsSync25(src) ? src : cwd;
|
|
174994
174994
|
}, spreadFor = (scaffold) => `import { ${scaffold.exportName} } from './${scaffold.exportName}';
|
|
@@ -175016,7 +175016,7 @@ ${scaffold.configKey}: ${scaffold.exportName}`, failure2 = (message) => ({
|
|
|
175016
175016
|
}
|
|
175017
175017
|
const install = options.install ?? true;
|
|
175018
175018
|
const installOk = install && scaffold.packages.length > 0 ? installPackages(cwd, scaffold.packages) : true;
|
|
175019
|
-
|
|
175019
|
+
writeFileSync14(filePath, renderScaffold(scaffold));
|
|
175020
175020
|
return {
|
|
175021
175021
|
created: relPath,
|
|
175022
175022
|
installed: installOk,
|
|
@@ -175032,7 +175032,7 @@ var init_scaffoldAuthFeature = __esm(() => {
|
|
|
175032
175032
|
});
|
|
175033
175033
|
|
|
175034
175034
|
// src/cli/htmx/install.ts
|
|
175035
|
-
import { existsSync as existsSync26, mkdirSync as
|
|
175035
|
+
import { existsSync as existsSync26, mkdirSync as mkdirSync13, readFileSync as readFileSync25, writeFileSync as writeFileSync15 } from "fs";
|
|
175036
175036
|
import { join as join23 } from "path";
|
|
175037
175037
|
var VENDORED_HTMX_VERSION = "2.0.6", vendoredHtmxFile = () => [
|
|
175038
175038
|
join23(import.meta.dir, "htmx.min.js"),
|
|
@@ -175057,9 +175057,9 @@ var VENDORED_HTMX_VERSION = "2.0.6", vendoredHtmxFile = () => [
|
|
|
175057
175057
|
const file = vendoredHtmxFile();
|
|
175058
175058
|
return file ? readFileSync25(file, "utf-8") : null;
|
|
175059
175059
|
}, writeHtmx = (htmxDir, content) => {
|
|
175060
|
-
|
|
175060
|
+
mkdirSync13(htmxDir, { recursive: true });
|
|
175061
175061
|
const file = join23(htmxDir, "htmx.min.js");
|
|
175062
|
-
|
|
175062
|
+
writeFileSync15(file, content, "utf-8");
|
|
175063
175063
|
return file;
|
|
175064
175064
|
};
|
|
175065
175065
|
var init_install = () => {};
|
|
@@ -175069,7 +175069,7 @@ var exports_add = {};
|
|
|
175069
175069
|
__export(exports_add, {
|
|
175070
175070
|
runAdd: () => runAdd
|
|
175071
175071
|
});
|
|
175072
|
-
import { dirname as
|
|
175072
|
+
import { dirname as dirname12, join as join24, relative as relative8 } from "path";
|
|
175073
175073
|
var write2 = (text) => process.stdout.write(`${text}
|
|
175074
175074
|
`), fail2 = (message) => {
|
|
175075
175075
|
process.stdout.write(`${colors.red}${message}${colors.reset}
|
|
@@ -175084,7 +175084,7 @@ var write2 = (text) => process.stdout.write(`${text}
|
|
|
175084
175084
|
}, frontendRoot = (project, cwd) => {
|
|
175085
175085
|
const [firstKey] = configuredFrameworks(project);
|
|
175086
175086
|
const firstDir = firstKey ? project.frameworkDirs[firstKey] : undefined;
|
|
175087
|
-
return firstDir ?
|
|
175087
|
+
return firstDir ? dirname12(firstDir) : join24(cwd, "src", "frontend");
|
|
175088
175088
|
}, addIntegrationCli = (id, install) => {
|
|
175089
175089
|
const result = addIntegration(process.cwd(), id, { install });
|
|
175090
175090
|
if (!result.ok) {
|
|
@@ -175218,7 +175218,7 @@ var exports_analyze = {};
|
|
|
175218
175218
|
__export(exports_analyze, {
|
|
175219
175219
|
runAnalyze: () => runAnalyze
|
|
175220
175220
|
});
|
|
175221
|
-
import { existsSync as existsSync27, readFileSync as readFileSync26, statSync as statSync3, writeFileSync as
|
|
175221
|
+
import { existsSync as existsSync27, readFileSync as readFileSync26, statSync as statSync3, writeFileSync as writeFileSync16 } from "fs";
|
|
175222
175222
|
import { join as join25, resolve as resolve17 } from "path";
|
|
175223
175223
|
var BASELINE_FILE = ".absolute-size-baseline.json", TOP_CHANGES = 12, CATEGORY_WIDTH = 16, SIZE_WIDTH = 12, CHANGE_WIDTH = 10, CATEGORY_ORDER, categoryOf = (key) => {
|
|
175224
175224
|
if (key.startsWith("Island"))
|
|
@@ -175338,7 +175338,7 @@ var BASELINE_FILE = ".absolute-size-baseline.json", TOP_CHANGES = 12, CATEGORY_W
|
|
|
175338
175338
|
return;
|
|
175339
175339
|
}
|
|
175340
175340
|
if (args.includes("--save")) {
|
|
175341
|
-
|
|
175341
|
+
writeFileSync16(join25(cwd, BASELINE_FILE), `${JSON.stringify(sizes, null, 2)}
|
|
175342
175342
|
`);
|
|
175343
175343
|
process.stdout.write(`${colors.green}\u2713${colors.reset} Saved size baseline (${Object.keys(sizes).length} entries) to ${BASELINE_FILE}
|
|
175344
175344
|
`);
|
|
@@ -175794,7 +175794,7 @@ __export(exports_db, {
|
|
|
175794
175794
|
conflictClause: () => conflictClause,
|
|
175795
175795
|
chunkRows: () => chunkRows
|
|
175796
175796
|
});
|
|
175797
|
-
import { existsSync as existsSync30, mkdirSync as
|
|
175797
|
+
import { existsSync as existsSync30, mkdirSync as mkdirSync14, readFileSync as readFileSync29, writeFileSync as writeFileSync17 } from "fs";
|
|
175798
175798
|
import { join as join27 } from "path";
|
|
175799
175799
|
var {env: env4, spawn: spawn2, SQL } = globalThis.Bun;
|
|
175800
175800
|
var BACKUP_FORMAT_VERSION = 1, RESTORE_CHUNK_ROWS = 500, URL_ENV_KEYS, JSON_DATA_TYPES, SEED_CANDIDATES, VALUE_FLAGS, paint = (text, color) => `${color}${text}${colors.reset}`, chunkRows = (items, size) => Array.from({ length: Math.ceil(items.length / size) }, (_, idx) => items.slice(idx * size, idx * size + size)), quoteIdent = (name) => `"${name.replace(/"/g, '""')}"`, resolveUrl = (explicit) => {
|
|
@@ -175906,11 +175906,11 @@ var BACKUP_FORMAT_VERSION = 1, RESTORE_CHUNK_ROWS = 500, URL_ENV_KEYS, JSON_DATA
|
|
|
175906
175906
|
v: BACKUP_FORMAT_VERSION
|
|
175907
175907
|
};
|
|
175908
175908
|
const dir = options.out ?? join27(process.cwd(), "backups");
|
|
175909
|
-
|
|
175909
|
+
mkdirSync14(dir, { recursive: true });
|
|
175910
175910
|
const json = JSON.stringify(payload, (_, value) => typeof value === "bigint" ? value.toString() : value);
|
|
175911
175911
|
const file = join27(dir, `backup-${payload.at.replace(/[:.]/g, "-")}.json`);
|
|
175912
|
-
|
|
175913
|
-
|
|
175912
|
+
writeFileSync17(file, json);
|
|
175913
|
+
writeFileSync17(join27(dir, "latest.json"), json);
|
|
175914
175914
|
const total = chosen.reduce((sum, name) => sum + (tables[name]?.length ?? 0), 0);
|
|
175915
175915
|
console.log(paint(`\u2713 backup \u2192 ${file}`, colors.green));
|
|
175916
175916
|
console.log(paint(` ${chosen.length} tables, ${total} rows`, colors.dim));
|
|
@@ -175951,15 +175951,15 @@ var BACKUP_FORMAT_VERSION = 1, RESTORE_CHUNK_ROWS = 500, URL_ENV_KEYS, JSON_DATA
|
|
|
175951
175951
|
const code = await proc.exited;
|
|
175952
175952
|
if (code !== 0)
|
|
175953
175953
|
throw new Error(`Seed failed (exit ${code}).`);
|
|
175954
|
-
},
|
|
175954
|
+
}, flagValue2 = (rest, flag) => {
|
|
175955
175955
|
const idx = rest.indexOf(flag);
|
|
175956
175956
|
return idx === UNFOUND_INDEX ? undefined : rest[idx + 1];
|
|
175957
|
-
}, listValue = (rest, flag) => (
|
|
175957
|
+
}, listValue = (rest, flag) => (flagValue2(rest, flag) ?? "").split(",").map((part) => part.trim()).filter((part) => part !== ""), parseOptions = (rest) => ({
|
|
175958
175958
|
exclude: listValue(rest, "--exclude"),
|
|
175959
175959
|
only: listValue(rest, "--only"),
|
|
175960
|
-
out:
|
|
175960
|
+
out: flagValue2(rest, "--out"),
|
|
175961
175961
|
truncate: rest.includes("--truncate"),
|
|
175962
|
-
url: resolveUrl(
|
|
175962
|
+
url: resolveUrl(flagValue2(rest, "--url")),
|
|
175963
175963
|
yes: rest.includes("--yes") || rest.includes("-y")
|
|
175964
175964
|
}), positionalArgs = (rest) => rest.filter((arg, idx) => !arg.startsWith("-") && !VALUE_FLAGS.includes(rest[idx - 1] ?? "")), usage = () => {
|
|
175965
175965
|
console.error("Usage: absolute db <backup|restore|seed> [options]");
|
|
@@ -176090,7 +176090,7 @@ var exports_doctor = {};
|
|
|
176090
176090
|
__export(exports_doctor, {
|
|
176091
176091
|
runDoctor: () => runDoctor
|
|
176092
176092
|
});
|
|
176093
|
-
import { existsSync as existsSync32, mkdirSync as
|
|
176093
|
+
import { existsSync as existsSync32, mkdirSync as mkdirSync15, readFileSync as readFileSync30, writeFileSync as writeFileSync18 } from "fs";
|
|
176094
176094
|
import { createRequire } from "module";
|
|
176095
176095
|
import { arch as arch4, platform as platform5 } from "os";
|
|
176096
176096
|
import { join as join28 } from "path";
|
|
@@ -176180,7 +176180,7 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
|
|
|
176180
176180
|
const dir = readString(config, field);
|
|
176181
176181
|
if (dir === undefined || existsSync32(join28(cwd, dir)))
|
|
176182
176182
|
continue;
|
|
176183
|
-
|
|
176183
|
+
mkdirSync15(join28(cwd, dir, "pages"), { recursive: true });
|
|
176184
176184
|
fixes.push(`created ${dir}/pages`);
|
|
176185
176185
|
}
|
|
176186
176186
|
return fixes;
|
|
@@ -176198,7 +176198,7 @@ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim}
|
|
|
176198
176198
|
const prefix = existing === "" || existing.endsWith(`
|
|
176199
176199
|
`) ? existing : `${existing}
|
|
176200
176200
|
`;
|
|
176201
|
-
|
|
176201
|
+
writeFileSync18(envExample, `${prefix}${toAdd.map((entry) => `${entry.key}=`).join(`
|
|
176202
176202
|
`)}
|
|
176203
176203
|
`);
|
|
176204
176204
|
return `added ${toAdd.length} key(s) to .env.example`;
|
|
@@ -176634,7 +176634,7 @@ var init_sourceMetadata = __esm(() => {
|
|
|
176634
176634
|
|
|
176635
176635
|
// src/islands/pageMetadata.ts
|
|
176636
176636
|
import { readFileSync as readFileSync31 } from "fs";
|
|
176637
|
-
import { dirname as
|
|
176637
|
+
import { dirname as dirname13, resolve as resolve18 } from "path";
|
|
176638
176638
|
var pagePatterns, getPageDirs = (config) => [
|
|
176639
176639
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
176640
176640
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -176654,7 +176654,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
176654
176654
|
const source = definition.buildReference?.source;
|
|
176655
176655
|
if (!source)
|
|
176656
176656
|
continue;
|
|
176657
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve18(
|
|
176657
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve18(dirname13(buildInfo.resolvedRegistryPath), source);
|
|
176658
176658
|
lookup.set(`${definition.framework}:${definition.component}`, resolve18(resolvedSource));
|
|
176659
176659
|
}
|
|
176660
176660
|
return lookup;
|
|
@@ -176863,8 +176863,8 @@ var init_islands2 = __esm(() => {
|
|
|
176863
176863
|
});
|
|
176864
176864
|
|
|
176865
176865
|
// src/build/externalAssetPlugin.ts
|
|
176866
|
-
import { copyFileSync as copyFileSync2, existsSync as existsSync35, mkdirSync as
|
|
176867
|
-
import { basename as basename6, dirname as
|
|
176866
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync35, mkdirSync as mkdirSync16, statSync as statSync6 } from "fs";
|
|
176867
|
+
import { basename as basename6, dirname as dirname14, join as join30, resolve as resolve20 } from "path";
|
|
176868
176868
|
var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
176869
176869
|
name: "absolute-external-asset",
|
|
176870
176870
|
setup(bld) {
|
|
@@ -176879,7 +176879,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
176879
176879
|
return;
|
|
176880
176880
|
urlPattern.lastIndex = 0;
|
|
176881
176881
|
let match;
|
|
176882
|
-
const sourceDir =
|
|
176882
|
+
const sourceDir = dirname14(args.path);
|
|
176883
176883
|
while ((match = urlPattern.exec(source)) !== null) {
|
|
176884
176884
|
const relPath = match[1];
|
|
176885
176885
|
if (!relPath)
|
|
@@ -176892,7 +176892,7 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
176892
176892
|
const targetPath = join30(outDir, basename6(assetPath));
|
|
176893
176893
|
if (existsSync35(targetPath))
|
|
176894
176894
|
continue;
|
|
176895
|
-
|
|
176895
|
+
mkdirSync16(dirname14(targetPath), { recursive: true });
|
|
176896
176896
|
copyFileSync2(assetPath, targetPath);
|
|
176897
176897
|
}
|
|
176898
176898
|
return;
|
|
@@ -176911,16 +176911,16 @@ var {env: env5 } = globalThis.Bun;
|
|
|
176911
176911
|
import {
|
|
176912
176912
|
cpSync,
|
|
176913
176913
|
existsSync as existsSync36,
|
|
176914
|
-
mkdirSync as
|
|
176914
|
+
mkdirSync as mkdirSync17,
|
|
176915
176915
|
readdirSync as readdirSync7,
|
|
176916
176916
|
readFileSync as readFileSync33,
|
|
176917
176917
|
rmSync as rmSync5,
|
|
176918
176918
|
statSync as statSync7,
|
|
176919
176919
|
unlinkSync as unlinkSync4,
|
|
176920
|
-
writeFileSync as
|
|
176920
|
+
writeFileSync as writeFileSync19
|
|
176921
176921
|
} from "fs";
|
|
176922
176922
|
import { createRequire as createRequire2 } from "module";
|
|
176923
|
-
import { basename as basename7, dirname as
|
|
176923
|
+
import { basename as basename7, dirname as dirname15, join as join31, relative as relative11, resolve as resolve21 } from "path";
|
|
176924
176924
|
var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[cli]\x1B[0m ${color}${message}\x1B[0m`, compileBanner = (version2) => {
|
|
176925
176925
|
const resolvedVersion = version2 || "unknown";
|
|
176926
176926
|
console.log("");
|
|
@@ -176967,7 +176967,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
176967
176967
|
const copied = new Set;
|
|
176968
176968
|
const normalizedOutdir = resolve21(outdir);
|
|
176969
176969
|
const copyReference = (filePath, relPath) => {
|
|
176970
|
-
const assetSource = resolve21(
|
|
176970
|
+
const assetSource = resolve21(dirname15(filePath), relPath);
|
|
176971
176971
|
if (!existsSync36(assetSource) || !statSync7(assetSource).isFile())
|
|
176972
176972
|
return;
|
|
176973
176973
|
const assetTarget = resolve21(normalizedOutdir, relPath.replace(/^\.\//, ""));
|
|
@@ -176976,7 +176976,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
176976
176976
|
if (copied.has(assetTarget))
|
|
176977
176977
|
return;
|
|
176978
176978
|
copied.add(assetTarget);
|
|
176979
|
-
|
|
176979
|
+
mkdirSync17(dirname15(assetTarget), { recursive: true });
|
|
176980
176980
|
cpSync(assetSource, assetTarget, { force: true });
|
|
176981
176981
|
};
|
|
176982
176982
|
for (const filePath of collectProjectSourceFiles(process.cwd())) {
|
|
@@ -177167,7 +177167,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177167
177167
|
}
|
|
177168
177168
|
return specifiers.sort((a, b) => b.length - a.length);
|
|
177169
177169
|
}, ensureRelativeModuleSpecifier = (fromFile, toFile) => {
|
|
177170
|
-
const rel = relative11(
|
|
177170
|
+
const rel = relative11(dirname15(fromFile), toFile).replace(/\\/g, "/");
|
|
177171
177171
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
177172
177172
|
}, pickExportEntry = (value) => {
|
|
177173
177173
|
if (typeof value === "string")
|
|
@@ -177213,12 +177213,12 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177213
177213
|
];
|
|
177214
177214
|
return candidates.find((filePath) => isRuntimeJsFile(filePath) && isFile(filePath)) ?? null;
|
|
177215
177215
|
}, findContainingRuntimePackageDir = (filePath) => {
|
|
177216
|
-
let dir =
|
|
177217
|
-
while (dir !==
|
|
177216
|
+
let dir = dirname15(filePath);
|
|
177217
|
+
while (dir !== dirname15(dir)) {
|
|
177218
177218
|
if (isNodeModulesPath(dir) && existsSync36(join31(dir, "package.json"))) {
|
|
177219
177219
|
return dir;
|
|
177220
177220
|
}
|
|
177221
|
-
dir =
|
|
177221
|
+
dir = dirname15(dir);
|
|
177222
177222
|
}
|
|
177223
177223
|
return null;
|
|
177224
177224
|
}, resolvePackageImportEntryFile = (fromFile, specifier) => {
|
|
@@ -177235,7 +177235,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177235
177235
|
}, collectRuntimeRewriteRoots = (distDir) => collectFiles2(distDir).filter((filePath) => isRuntimeJsFile(filePath) && !isNodeModulesPath(filePath)), toTopLevelPackage = (specifier) => specifier.split("/").slice(0, specifier.startsWith("@") ? 2 : 1).join("/"), FRAMEWORK_PACKAGE_NAME = "@absolutejs/absolute", copyChunkReferencedPackages = (distDir, seen) => {
|
|
177236
177236
|
const distRoot = resolve21(distDir);
|
|
177237
177237
|
for (const filePath of collectRuntimeRewriteRoots(distDir)) {
|
|
177238
|
-
if (resolve21(
|
|
177238
|
+
if (resolve21(dirname15(filePath)) === distRoot)
|
|
177239
177239
|
continue;
|
|
177240
177240
|
const source = readFileSync33(filePath, "utf-8");
|
|
177241
177241
|
for (const match of source.matchAll(MODULE_SPECIFIER_RE)) {
|
|
@@ -177271,7 +177271,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177271
177271
|
const { masked, restore } = maskLiterals(source);
|
|
177272
177272
|
const rewrittenMasked = masked.replace(MODULE_SPECIFIER_RE, (match, prefix, quote, specifier) => {
|
|
177273
177273
|
if (typeof specifier === "string" && specifier.startsWith(".")) {
|
|
177274
|
-
enqueue(resolveRuntimeJsFile(resolve21(
|
|
177274
|
+
enqueue(resolveRuntimeJsFile(resolve21(dirname15(filePath), specifier)));
|
|
177275
177275
|
return match;
|
|
177276
177276
|
}
|
|
177277
177277
|
const packageImportTarget = resolveRuntimeJsFile(resolvePackageImportEntryFile(filePath, specifier) ?? "");
|
|
@@ -177287,7 +177287,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177287
177287
|
});
|
|
177288
177288
|
const rewritten = restore(rewrittenMasked);
|
|
177289
177289
|
if (rewritten !== source) {
|
|
177290
|
-
|
|
177290
|
+
writeFileSync19(filePath, rewritten);
|
|
177291
177291
|
}
|
|
177292
177292
|
}
|
|
177293
177293
|
}, generateEntrypoint = (distDir, serverEntry, prerenderMap, version2, buildConfig) => {
|
|
@@ -177888,7 +177888,7 @@ console.log(\`
|
|
|
177888
177888
|
if (scope !== "angular" || rest.length === 0)
|
|
177889
177889
|
continue;
|
|
177890
177890
|
const specifier = `@angular/${rest.join("/")}`;
|
|
177891
|
-
const relPath = relative11(
|
|
177891
|
+
const relPath = relative11(dirname15(outputPath), resolve21(vendorDir, file));
|
|
177892
177892
|
angularServerVendorPaths[specifier] = relPath.startsWith(".") ? relPath : `./${relPath}`;
|
|
177893
177893
|
}
|
|
177894
177894
|
if (Object.keys(angularServerVendorPaths).length > 0) {
|
|
@@ -177922,7 +177922,7 @@ console.log(\`
|
|
|
177922
177922
|
const entrypointCode = generateEntrypoint(resolvedOutdir, serverEntry, prerenderMap, absoluteVersion, buildConfig);
|
|
177923
177923
|
const entrypointPath = join31(resolvedOutdir, "_compile_entrypoint.ts");
|
|
177924
177924
|
await Bun.write(entrypointPath, entrypointCode);
|
|
177925
|
-
|
|
177925
|
+
mkdirSync17(dirname15(resolvedOutfile), { recursive: true });
|
|
177926
177926
|
const result = await Bun.build({
|
|
177927
177927
|
compile: { outfile: resolvedOutfile },
|
|
177928
177928
|
define: { "process.env.NODE_ENV": '"production"' },
|
|
@@ -179689,10 +179689,27 @@ var dev = async (serverEntry, configPath2) => {
|
|
|
179689
179689
|
};
|
|
179690
179690
|
|
|
179691
179691
|
// src/cli/scripts/eslint.ts
|
|
179692
|
-
import {
|
|
179693
|
-
import {
|
|
179692
|
+
import { createHash } from "crypto";
|
|
179693
|
+
import {
|
|
179694
|
+
existsSync as existsSync6,
|
|
179695
|
+
mkdirSync as mkdirSync5,
|
|
179696
|
+
readFileSync as readFileSync8,
|
|
179697
|
+
renameSync,
|
|
179698
|
+
rmSync as rmSync3,
|
|
179699
|
+
writeFileSync as writeFileSync5
|
|
179700
|
+
} from "fs";
|
|
179701
|
+
import { dirname as dirname3, resolve as resolve4 } from "path";
|
|
179694
179702
|
var DEFAULT_CACHE_LOCATION = ".absolutejs/eslint-cache";
|
|
179695
|
-
var
|
|
179703
|
+
var CACHE_CONTRACT_VERSION = "1";
|
|
179704
|
+
var CACHE_FINGERPRINT_SUFFIX = ".fingerprint";
|
|
179705
|
+
var flagValue = (args, flag) => {
|
|
179706
|
+
const assignment = args.find((arg) => arg.startsWith(`${flag}=`));
|
|
179707
|
+
if (assignment)
|
|
179708
|
+
return assignment.slice(flag.length + 1);
|
|
179709
|
+
const index = args.indexOf(flag);
|
|
179710
|
+
return index < 0 ? undefined : args[index + 1];
|
|
179711
|
+
};
|
|
179712
|
+
var getCacheLocation = (args) => flagValue(args, "--cache-location")?.trim() || process.env.ABSOLUTE_ESLINT_CACHE?.trim() || DEFAULT_CACHE_LOCATION;
|
|
179696
179713
|
var CONFIG_CANDIDATES = [
|
|
179697
179714
|
"eslint.config.js",
|
|
179698
179715
|
"eslint.config.mjs",
|
|
@@ -179744,8 +179761,7 @@ var hasUserPositional = (args) => {
|
|
|
179744
179761
|
}
|
|
179745
179762
|
return false;
|
|
179746
179763
|
};
|
|
179747
|
-
var findConfigPath = () => {
|
|
179748
|
-
const cwd = process.cwd();
|
|
179764
|
+
var findConfigPath = (cwd = process.cwd()) => {
|
|
179749
179765
|
for (const name of CONFIG_CANDIDATES) {
|
|
179750
179766
|
const candidate = resolve4(cwd, name);
|
|
179751
179767
|
if (existsSync6(candidate))
|
|
@@ -179753,6 +179769,107 @@ var findConfigPath = () => {
|
|
|
179753
179769
|
}
|
|
179754
179770
|
return null;
|
|
179755
179771
|
};
|
|
179772
|
+
var fingerprintLocation = (cacheLocation, cwd) => {
|
|
179773
|
+
const absolute = resolve4(cwd, cacheLocation);
|
|
179774
|
+
return /[\\/]$/.test(cacheLocation) ? resolve4(absolute, CACHE_FINGERPRINT_SUFFIX.slice(1)) : `${absolute}${CACHE_FINGERPRINT_SUFFIX}`;
|
|
179775
|
+
};
|
|
179776
|
+
var addFileToFingerprint = (hash, path, label) => {
|
|
179777
|
+
if (!existsSync6(path))
|
|
179778
|
+
return;
|
|
179779
|
+
hash.update(label);
|
|
179780
|
+
hash.update("\x00");
|
|
179781
|
+
hash.update(readFileSync8(path));
|
|
179782
|
+
hash.update("\x00");
|
|
179783
|
+
};
|
|
179784
|
+
var packageNameFor = (specifier) => {
|
|
179785
|
+
if (specifier.startsWith("@"))
|
|
179786
|
+
return specifier.split("/").slice(0, 2).join("/");
|
|
179787
|
+
const [name = specifier] = specifier.split("/");
|
|
179788
|
+
return name;
|
|
179789
|
+
};
|
|
179790
|
+
var configPackageNames = (configPath2) => {
|
|
179791
|
+
if (!configPath2)
|
|
179792
|
+
return [];
|
|
179793
|
+
const source = readFileSync8(configPath2, "utf-8");
|
|
179794
|
+
const names = new Set;
|
|
179795
|
+
for (const match of source.matchAll(/(?:from\s+|import\s*(?:\(\s*)?|require\s*\(\s*)(['"])([^'".][^'"]*)\1/g)) {
|
|
179796
|
+
const [, , specifier] = match;
|
|
179797
|
+
if (specifier)
|
|
179798
|
+
names.add(packageNameFor(specifier));
|
|
179799
|
+
}
|
|
179800
|
+
return [...names];
|
|
179801
|
+
};
|
|
179802
|
+
var manifestDependencyNames = (manifest) => {
|
|
179803
|
+
if (manifest === null || typeof manifest !== "object")
|
|
179804
|
+
return [];
|
|
179805
|
+
return Object.entries(manifest).flatMap(([key, value]) => {
|
|
179806
|
+
if (key !== "dependencies" && key !== "devDependencies")
|
|
179807
|
+
return [];
|
|
179808
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
179809
|
+
return [];
|
|
179810
|
+
return Object.keys(value);
|
|
179811
|
+
});
|
|
179812
|
+
};
|
|
179813
|
+
var lintDependencyNames = (cwd, configPath2) => {
|
|
179814
|
+
const manifestPath = resolve4(cwd, "package.json");
|
|
179815
|
+
if (!existsSync6(manifestPath))
|
|
179816
|
+
return configPackageNames(configPath2);
|
|
179817
|
+
try {
|
|
179818
|
+
const manifest = JSON.parse(readFileSync8(manifestPath, "utf-8"));
|
|
179819
|
+
const lintPackages = manifestDependencyNames(manifest).filter((name) => /eslint|typescript/.test(name));
|
|
179820
|
+
return [
|
|
179821
|
+
...new Set([...lintPackages, ...configPackageNames(configPath2)])
|
|
179822
|
+
];
|
|
179823
|
+
} catch {
|
|
179824
|
+
return configPackageNames(configPath2);
|
|
179825
|
+
}
|
|
179826
|
+
};
|
|
179827
|
+
var findInstalledManifest = (cwd, dependency) => {
|
|
179828
|
+
let directory = cwd;
|
|
179829
|
+
while (true) {
|
|
179830
|
+
const candidate = resolve4(directory, "node_modules", dependency, "package.json");
|
|
179831
|
+
if (existsSync6(candidate))
|
|
179832
|
+
return candidate;
|
|
179833
|
+
const parent = dirname3(directory);
|
|
179834
|
+
if (parent === directory)
|
|
179835
|
+
return null;
|
|
179836
|
+
directory = parent;
|
|
179837
|
+
}
|
|
179838
|
+
};
|
|
179839
|
+
var createEslintCacheFingerprint = (cwd = process.cwd()) => {
|
|
179840
|
+
const hash = createHash("sha256");
|
|
179841
|
+
hash.update(`absolute-eslint-cache:${CACHE_CONTRACT_VERSION}\x00`);
|
|
179842
|
+
const configPath2 = findConfigPath(cwd);
|
|
179843
|
+
if (configPath2)
|
|
179844
|
+
addFileToFingerprint(hash, configPath2, configPath2);
|
|
179845
|
+
for (const dependency of lintDependencyNames(cwd, configPath2).sort()) {
|
|
179846
|
+
const manifestPath = findInstalledManifest(cwd, dependency);
|
|
179847
|
+
if (manifestPath)
|
|
179848
|
+
addFileToFingerprint(hash, manifestPath, dependency);
|
|
179849
|
+
}
|
|
179850
|
+
return hash.digest("hex");
|
|
179851
|
+
};
|
|
179852
|
+
var writeFingerprint = (path, fingerprint) => {
|
|
179853
|
+
mkdirSync5(dirname3(path), { recursive: true });
|
|
179854
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
179855
|
+
writeFileSync5(temporary, `${fingerprint}
|
|
179856
|
+
`);
|
|
179857
|
+
renameSync(temporary, path);
|
|
179858
|
+
};
|
|
179859
|
+
var prepareEslintCache = (options) => {
|
|
179860
|
+
const cwd = options.cwd ?? process.cwd();
|
|
179861
|
+
const cachePath = resolve4(cwd, options.cacheLocation);
|
|
179862
|
+
const metadataPath = fingerprintLocation(options.cacheLocation, cwd);
|
|
179863
|
+
const fingerprint = options.fingerprint ?? createEslintCacheFingerprint(cwd);
|
|
179864
|
+
const prior = existsSync6(metadataPath) ? readFileSync8(metadataPath, "utf-8").trim() : null;
|
|
179865
|
+
if (prior === fingerprint)
|
|
179866
|
+
return false;
|
|
179867
|
+
rmSync3(cachePath, { force: true, recursive: true });
|
|
179868
|
+
if (metadataPath !== cachePath)
|
|
179869
|
+
rmSync3(metadataPath, { force: true, recursive: true });
|
|
179870
|
+
writeFingerprint(metadataPath, fingerprint);
|
|
179871
|
+
return true;
|
|
179872
|
+
};
|
|
179756
179873
|
var hasKey = (objectLiteralSource, key) => {
|
|
179757
179874
|
const pattern = new RegExp(`(^|[\\s,{])${key}\\s*:`, "m");
|
|
179758
179875
|
return pattern.test(objectLiteralSource);
|
|
@@ -179885,17 +180002,34 @@ var formatDuration = (ms) => {
|
|
|
179885
180002
|
const seconds = Math.round(ms % 60000 / 1000);
|
|
179886
180003
|
return `${minutes}m ${seconds}s`;
|
|
179887
180004
|
};
|
|
179888
|
-
var handleClearCache = (cacheLocation) => {
|
|
180005
|
+
var handleClearCache = (cacheLocation, cwd = process.cwd()) => {
|
|
179889
180006
|
try {
|
|
179890
|
-
|
|
180007
|
+
const cachePath = resolve4(cwd, cacheLocation);
|
|
180008
|
+
const metadataPath = fingerprintLocation(cacheLocation, cwd);
|
|
180009
|
+
rmSync3(cachePath, { force: true, recursive: true });
|
|
180010
|
+
rmSync3(metadataPath, { force: true, recursive: true });
|
|
179891
180011
|
console.log(`\x1B[32m\u2713\x1B[0m Cleared cache: ${cacheLocation}`);
|
|
179892
180012
|
} catch (err) {
|
|
179893
180013
|
console.error(`\x1B[31m\u2717\x1B[0m Failed to clear cache at ${cacheLocation}:`, err);
|
|
179894
180014
|
process.exit(1);
|
|
179895
180015
|
}
|
|
179896
180016
|
};
|
|
180017
|
+
var buildEslintCommand = (args, cacheLocation) => {
|
|
180018
|
+
const cacheEnabled = !args.includes("--no-cache");
|
|
180019
|
+
const hasCacheLocation = args.some((arg) => arg === "--cache-location" || arg.startsWith("--cache-location="));
|
|
180020
|
+
const hasCacheStrategy = args.some((arg) => arg === "--cache-strategy" || arg.startsWith("--cache-strategy="));
|
|
180021
|
+
return [
|
|
180022
|
+
"bun",
|
|
180023
|
+
"eslint",
|
|
180024
|
+
...cacheEnabled ? ["--cache"] : [],
|
|
180025
|
+
...cacheEnabled && !hasCacheLocation ? ["--cache-location", cacheLocation] : [],
|
|
180026
|
+
...cacheEnabled && !hasCacheStrategy ? ["--cache-strategy", "content"] : [],
|
|
180027
|
+
...args,
|
|
180028
|
+
...hasUserPositional(args) ? [] : ["."]
|
|
180029
|
+
];
|
|
180030
|
+
};
|
|
179897
180031
|
var eslint = async (args) => {
|
|
179898
|
-
const cacheLocation = getCacheLocation();
|
|
180032
|
+
const cacheLocation = getCacheLocation(args);
|
|
179899
180033
|
if (args.includes("--clear-cache")) {
|
|
179900
180034
|
handleClearCache(cacheLocation);
|
|
179901
180035
|
return;
|
|
@@ -179905,18 +180039,13 @@ var eslint = async (args) => {
|
|
|
179905
180039
|
process.exit(1);
|
|
179906
180040
|
}
|
|
179907
180041
|
checkForMisplacedIgnores();
|
|
179908
|
-
const
|
|
179909
|
-
|
|
179910
|
-
|
|
179911
|
-
|
|
179912
|
-
"--cache-location",
|
|
179913
|
-
cacheLocation,
|
|
179914
|
-
...args,
|
|
179915
|
-
...hasUserPositional(args) ? [] : ["."]
|
|
179916
|
-
];
|
|
180042
|
+
const cacheEnabled = !args.includes("--no-cache");
|
|
180043
|
+
if (cacheEnabled)
|
|
180044
|
+
prepareEslintCache({ cacheLocation });
|
|
180045
|
+
const command = buildEslintCommand(args, cacheLocation);
|
|
179917
180046
|
const dim = "\x1B[2m";
|
|
179918
180047
|
const reset = "\x1B[0m";
|
|
179919
|
-
console.log(`${dim}cache: ${cacheLocation} (
|
|
180048
|
+
console.log(cacheEnabled ? `${dim}cache: ${cacheLocation} (content-aware; lint-tool changes invalidate automatically)${reset}` : `${dim}cache: disabled${reset}`);
|
|
179920
180049
|
const startedAt = Date.now();
|
|
179921
180050
|
const proc = Bun.spawn(command, {
|
|
179922
180051
|
stderr: "inherit",
|
|
@@ -180185,6 +180314,27 @@ var saveCache = async (tool, data) => {
|
|
|
180185
180314
|
};
|
|
180186
180315
|
|
|
180187
180316
|
// src/cli/scripts/prettier.ts
|
|
180317
|
+
var FLAG_VALUE_FLAGS2 = new Set([
|
|
180318
|
+
"--cache-location",
|
|
180319
|
+
"--config",
|
|
180320
|
+
"--config-precedence",
|
|
180321
|
+
"--cursor-offset",
|
|
180322
|
+
"--embedded-language-formatting",
|
|
180323
|
+
"--end-of-line",
|
|
180324
|
+
"--ignore-path",
|
|
180325
|
+
"--insert-pragma",
|
|
180326
|
+
"--log-level",
|
|
180327
|
+
"--parser",
|
|
180328
|
+
"--plugin",
|
|
180329
|
+
"--print-width",
|
|
180330
|
+
"--prose-wrap",
|
|
180331
|
+
"--quote-props",
|
|
180332
|
+
"--range-end",
|
|
180333
|
+
"--range-start",
|
|
180334
|
+
"--tab-width",
|
|
180335
|
+
"--trailing-comma",
|
|
180336
|
+
"--use-tabs"
|
|
180337
|
+
]);
|
|
180188
180338
|
var prettierAdapter = {
|
|
180189
180339
|
configFiles: [".prettierrc.json"],
|
|
180190
180340
|
fileGlobs: [
|
|
@@ -180210,7 +180360,35 @@ var prettierAdapter = {
|
|
|
180210
180360
|
name: "prettier",
|
|
180211
180361
|
buildCommand: (files, args) => ["bun", "prettier", ...args, ...files]
|
|
180212
180362
|
};
|
|
180363
|
+
var buildTargetedPrettierCommand = (args) => [
|
|
180364
|
+
"bun",
|
|
180365
|
+
"prettier",
|
|
180366
|
+
...args
|
|
180367
|
+
];
|
|
180368
|
+
var hasPrettierTarget = (args) => {
|
|
180369
|
+
for (let index = 0;index < args.length; index++) {
|
|
180370
|
+
const argument = args[index];
|
|
180371
|
+
if (argument === undefined)
|
|
180372
|
+
continue;
|
|
180373
|
+
if (argument === "--")
|
|
180374
|
+
return index + 1 < args.length;
|
|
180375
|
+
if (!argument.startsWith("-"))
|
|
180376
|
+
return true;
|
|
180377
|
+
if (!argument.includes("=") && FLAG_VALUE_FLAGS2.has(argument))
|
|
180378
|
+
index++;
|
|
180379
|
+
}
|
|
180380
|
+
return false;
|
|
180381
|
+
};
|
|
180213
180382
|
var prettier = async (args) => {
|
|
180383
|
+
if (hasPrettierTarget(args)) {
|
|
180384
|
+
const child = Bun.spawn(buildTargetedPrettierCommand(args), {
|
|
180385
|
+
stderr: "inherit",
|
|
180386
|
+
stdout: "inherit"
|
|
180387
|
+
});
|
|
180388
|
+
if (await child.exited !== 0)
|
|
180389
|
+
process.exitCode = 1;
|
|
180390
|
+
return;
|
|
180391
|
+
}
|
|
180214
180392
|
await runTool(prettierAdapter, args);
|
|
180215
180393
|
};
|
|
180216
180394
|
|
|
@@ -180584,11 +180762,11 @@ init_instanceRegistry();
|
|
|
180584
180762
|
import {
|
|
180585
180763
|
appendFileSync,
|
|
180586
180764
|
existsSync as existsSync9,
|
|
180587
|
-
mkdirSync as
|
|
180765
|
+
mkdirSync as mkdirSync7,
|
|
180588
180766
|
readdirSync as readdirSync2,
|
|
180589
180767
|
readFileSync as readFileSync12,
|
|
180590
180768
|
unlinkSync as unlinkSync3,
|
|
180591
|
-
writeFileSync as
|
|
180769
|
+
writeFileSync as writeFileSync6
|
|
180592
180770
|
} from "fs";
|
|
180593
180771
|
import { createConnection } from "net";
|
|
180594
180772
|
import { resolve as resolve9 } from "path";
|
|
@@ -181153,10 +181331,10 @@ var stripAnsi2 = (value) => value.replace(ANSI_REGEX2, "");
|
|
|
181153
181331
|
var sanitizeLogFileName = (value) => value.replace(/[^a-zA-Z0-9._-]/g, "_") || "unknown";
|
|
181154
181332
|
var createWorkspaceLogSink = (appendLog) => {
|
|
181155
181333
|
const logDirectory = resolve9(".absolutejs", "workspace", "logs");
|
|
181156
|
-
|
|
181334
|
+
mkdirSync7(logDirectory, { recursive: true });
|
|
181157
181335
|
readdirSync2(logDirectory).filter((file) => file.endsWith(".log")).forEach((file) => unlinkSync3(resolve9(logDirectory, file)));
|
|
181158
|
-
|
|
181159
|
-
|
|
181336
|
+
writeFileSync6(resolve9(logDirectory, "all.log"), "");
|
|
181337
|
+
writeFileSync6(resolve9(logDirectory, "workspace.log"), "");
|
|
181160
181338
|
const initializedSources = new Set(["workspace"]);
|
|
181161
181339
|
const writeLog = (source, message, level) => {
|
|
181162
181340
|
const cleanMessage = stripAnsi2(message).trimEnd();
|
|
@@ -181168,7 +181346,7 @@ var createWorkspaceLogSink = (appendLog) => {
|
|
|
181168
181346
|
`;
|
|
181169
181347
|
const sourceFile = resolve9(logDirectory, `${sanitizeLogFileName(source)}.log`);
|
|
181170
181348
|
if (!initializedSources.has(source)) {
|
|
181171
|
-
|
|
181349
|
+
writeFileSync6(sourceFile, "");
|
|
181172
181350
|
initializedSources.add(source);
|
|
181173
181351
|
}
|
|
181174
181352
|
appendFileSync(sourceFile, line);
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
export declare const getCacheLocation: (args: string[]) => string;
|
|
2
|
+
export declare const createEslintCacheFingerprint: (cwd?: string) => string;
|
|
3
|
+
type EslintCacheOptions = {
|
|
4
|
+
cacheLocation: string;
|
|
5
|
+
cwd?: string;
|
|
6
|
+
fingerprint?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const prepareEslintCache: (options: EslintCacheOptions) => boolean;
|
|
9
|
+
export declare const buildEslintCommand: (args: string[], cacheLocation: string) => string[];
|
|
1
10
|
/**
|
|
2
11
|
* Run ESLint with sensible absolutejs defaults.
|
|
3
12
|
*
|
|
4
|
-
* - Caching: enabled by default
|
|
5
|
-
*
|
|
13
|
+
* - Caching: enabled by default with ESLint's content strategy, so Git
|
|
14
|
+
* operations that alter mtimes don't make unchanged files expensive.
|
|
15
|
+
* Installed lint-tool or config changes invalidate the cache automatically.
|
|
16
|
+
* The cache location is overridable via `ABSOLUTE_ESLINT_CACHE`
|
|
17
|
+
* (default: `.absolutejs/eslint-cache`).
|
|
6
18
|
* - Implicit lint target: `.` is appended only when the user hasn't
|
|
7
19
|
* supplied a positional path of their own. So `bun lint src/backend/`
|
|
8
20
|
* lints just that directory — not the whole repo plus `src/backend/`.
|
|
@@ -14,3 +26,4 @@
|
|
|
14
26
|
* spread through to the underlying `bun eslint` invocation.
|
|
15
27
|
*/
|
|
16
28
|
export declare const eslint: (args: string[]) => Promise<void>;
|
|
29
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { ToolAdapter } from '../../../types/tool';
|
|
2
2
|
export declare const prettierAdapter: ToolAdapter;
|
|
3
|
+
export declare const buildTargetedPrettierCommand: (args: string[]) => string[];
|
|
4
|
+
export declare const hasPrettierTarget: (args: string[]) => boolean;
|
|
3
5
|
export declare const prettier: (args: string[]) => Promise<void>;
|