@absolutejs/absolute 0.19.0-beta.946 → 0.19.0-beta.948
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +14 -3
- package/dist/angular/index.js.map +3 -3
- package/dist/angular/server.js +14 -3
- package/dist/angular/server.js.map +3 -3
- package/dist/build.js +304 -104
- package/dist/build.js.map +8 -7
- package/dist/index.js +224 -130
- package/dist/index.js.map +8 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8337,6 +8337,114 @@ var init_staticIslandPages = __esm(() => {
|
|
|
8337
8337
|
HTMX_STREAM_SLOT_TAG_RE = /<abs-htmx-stream-slot\b([^>]*?)(?:\/>|>([\s\S]*?)<\/abs-htmx-stream-slot>)/gi;
|
|
8338
8338
|
});
|
|
8339
8339
|
|
|
8340
|
+
// src/utils/loadConfig.ts
|
|
8341
|
+
var exports_loadConfig = {};
|
|
8342
|
+
__export(exports_loadConfig, {
|
|
8343
|
+
loadRawConfig: () => loadRawConfig,
|
|
8344
|
+
loadConfig: () => loadConfig,
|
|
8345
|
+
isWorkspaceConfig: () => isWorkspaceConfig,
|
|
8346
|
+
getWorkspaceServices: () => getWorkspaceServices
|
|
8347
|
+
});
|
|
8348
|
+
import { resolve as resolve8 } from "path";
|
|
8349
|
+
var RESERVED_TOP_LEVEL_KEYS, isObject = (value) => typeof value === "object" && value !== null, isCommandService = (service) => service.kind === "command" || Array.isArray(service.command), isServiceCandidate = (value) => isObject(value) && (typeof value.entry === "string" || Array.isArray(value.command)), isWorkspaceConfig = (config) => {
|
|
8350
|
+
if (!isObject(config)) {
|
|
8351
|
+
return false;
|
|
8352
|
+
}
|
|
8353
|
+
const entries = Object.entries(config);
|
|
8354
|
+
if (entries.length === 0) {
|
|
8355
|
+
return false;
|
|
8356
|
+
}
|
|
8357
|
+
if (entries.some(([key]) => RESERVED_TOP_LEVEL_KEYS.has(key))) {
|
|
8358
|
+
return false;
|
|
8359
|
+
}
|
|
8360
|
+
return entries.every(([, value]) => isServiceCandidate(value));
|
|
8361
|
+
}, isConfigInput = (value) => isObject(value), getWorkspaceServices = (config) => {
|
|
8362
|
+
if (!isWorkspaceConfig(config)) {
|
|
8363
|
+
throw new Error("absolute.config.ts is not a multi-service config. Define top-level named services with `entry` or `command` before using `absolute workspace dev`.");
|
|
8364
|
+
}
|
|
8365
|
+
return config;
|
|
8366
|
+
}, projectServiceConfig = (config, serviceName) => {
|
|
8367
|
+
const services = getWorkspaceServices(config);
|
|
8368
|
+
const service = services[serviceName];
|
|
8369
|
+
if (!service) {
|
|
8370
|
+
throw new Error(`Config file does not define service "${serviceName}".`);
|
|
8371
|
+
}
|
|
8372
|
+
if (isCommandService(service)) {
|
|
8373
|
+
throw new Error(`Service "${serviceName}" is a command service and cannot be loaded as an AbsoluteJS app config.`);
|
|
8374
|
+
}
|
|
8375
|
+
const {
|
|
8376
|
+
command: _command,
|
|
8377
|
+
config: _config,
|
|
8378
|
+
cwd: _cwd,
|
|
8379
|
+
dependsOn: _dependsOn,
|
|
8380
|
+
env: _env,
|
|
8381
|
+
kind: _kind,
|
|
8382
|
+
port: _port,
|
|
8383
|
+
ready: _ready,
|
|
8384
|
+
visibility: _visibility,
|
|
8385
|
+
...serviceConfig
|
|
8386
|
+
} = service;
|
|
8387
|
+
return serviceConfig;
|
|
8388
|
+
}, loadConfig = async (configPath) => {
|
|
8389
|
+
const config = await loadRawConfig(configPath);
|
|
8390
|
+
const serviceName = process.env.ABSOLUTE_WORKSPACE_SERVICE_NAME;
|
|
8391
|
+
if (typeof serviceName === "string" && serviceName.length > 0) {
|
|
8392
|
+
return projectServiceConfig(config, serviceName);
|
|
8393
|
+
}
|
|
8394
|
+
if (isWorkspaceConfig(config)) {
|
|
8395
|
+
throw new Error("absolute.config.ts defines multiple services. Use `absolute workspace dev` or set ABSOLUTE_WORKSPACE_SERVICE_NAME before loading a specific service config.");
|
|
8396
|
+
}
|
|
8397
|
+
return config;
|
|
8398
|
+
}, loadRawConfig = async (configPath) => {
|
|
8399
|
+
const resolved = resolve8(configPath ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
8400
|
+
const mod = await import(resolved);
|
|
8401
|
+
const config = mod.default ?? mod.config;
|
|
8402
|
+
if (!config) {
|
|
8403
|
+
throw new Error(`Config file "${resolved}" does not export a valid configuration.
|
|
8404
|
+
Expected: export default defineConfig({ ... })`);
|
|
8405
|
+
}
|
|
8406
|
+
if (!isConfigInput(config)) {
|
|
8407
|
+
throw new Error(`Config file "${resolved}" must export an object configuration.`);
|
|
8408
|
+
}
|
|
8409
|
+
return config;
|
|
8410
|
+
};
|
|
8411
|
+
var init_loadConfig = __esm(() => {
|
|
8412
|
+
RESERVED_TOP_LEVEL_KEYS = new Set([
|
|
8413
|
+
"assetsDirectory",
|
|
8414
|
+
"astroDirectory",
|
|
8415
|
+
"buildDirectory",
|
|
8416
|
+
"bunBuild",
|
|
8417
|
+
"command",
|
|
8418
|
+
"config",
|
|
8419
|
+
"cwd",
|
|
8420
|
+
"dependsOn",
|
|
8421
|
+
"dev",
|
|
8422
|
+
"emberDirectory",
|
|
8423
|
+
"entry",
|
|
8424
|
+
"env",
|
|
8425
|
+
"htmlDirectory",
|
|
8426
|
+
"htmxDirectory",
|
|
8427
|
+
"images",
|
|
8428
|
+
"incrementalFiles",
|
|
8429
|
+
"islands",
|
|
8430
|
+
"kind",
|
|
8431
|
+
"mode",
|
|
8432
|
+
"options",
|
|
8433
|
+
"port",
|
|
8434
|
+
"postcss",
|
|
8435
|
+
"publicDirectory",
|
|
8436
|
+
"reactDirectory",
|
|
8437
|
+
"sitemap",
|
|
8438
|
+
"static",
|
|
8439
|
+
"stylesConfig",
|
|
8440
|
+
"svelteDirectory",
|
|
8441
|
+
"tailwind",
|
|
8442
|
+
"ready",
|
|
8443
|
+
"visibility",
|
|
8444
|
+
"vueDirectory"
|
|
8445
|
+
]);
|
|
8446
|
+
});
|
|
8447
|
+
|
|
8340
8448
|
// src/build/scanEntryPoints.ts
|
|
8341
8449
|
import { existsSync as existsSync6 } from "fs";
|
|
8342
8450
|
var {Glob } = globalThis.Bun;
|
|
@@ -12076,7 +12184,7 @@ var traceAngularPhase = async (name, fn2, metadata2) => {
|
|
|
12076
12184
|
if (fileName.startsWith(outDir))
|
|
12077
12185
|
return fileName.substring(outDir.length + 1);
|
|
12078
12186
|
return fileName;
|
|
12079
|
-
}, hasJsLikeExtension = (path) => /\.(js|ts|mjs|cjs)$/.test(path), splitSpecifierAndQuery = (specifier) => {
|
|
12187
|
+
}, hasJsLikeExtension = (path) => /\.(js|ts|mjs|cjs|json)$/.test(path), splitSpecifierAndQuery = (specifier) => {
|
|
12080
12188
|
const separator = specifier.indexOf("?");
|
|
12081
12189
|
if (separator === -1) {
|
|
12082
12190
|
return {
|
|
@@ -12636,11 +12744,12 @@ ${fields}
|
|
|
12636
12744
|
});
|
|
12637
12745
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
12638
12746
|
const resolveSourceFile2 = (candidate) => {
|
|
12639
|
-
const candidates = candidate.match(/\.[cm]?[tj]sx
|
|
12747
|
+
const candidates = candidate.match(/\.(?:[cm]?[tj]sx?|json)$/) ? [candidate] : [
|
|
12640
12748
|
`${candidate}.ts`,
|
|
12641
12749
|
`${candidate}.tsx`,
|
|
12642
12750
|
`${candidate}.js`,
|
|
12643
12751
|
`${candidate}.jsx`,
|
|
12752
|
+
`${candidate}.json`,
|
|
12644
12753
|
join19(candidate, "index.ts"),
|
|
12645
12754
|
join19(candidate, "index.tsx"),
|
|
12646
12755
|
join19(candidate, "index.js"),
|
|
@@ -12718,6 +12827,16 @@ ${fields}
|
|
|
12718
12827
|
if (visited.has(resolved))
|
|
12719
12828
|
return;
|
|
12720
12829
|
visited.add(resolved);
|
|
12830
|
+
if (resolved.endsWith(".json") && existsSync17(resolved)) {
|
|
12831
|
+
const inputDir2 = dirname14(resolved);
|
|
12832
|
+
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
12833
|
+
const targetDir2 = join19(outDir, relativeDir2);
|
|
12834
|
+
const targetPath2 = join19(targetDir2, basename7(resolved));
|
|
12835
|
+
await fs.mkdir(targetDir2, { recursive: true });
|
|
12836
|
+
await fs.copyFile(resolved, targetPath2);
|
|
12837
|
+
allOutputs.push(targetPath2);
|
|
12838
|
+
return;
|
|
12839
|
+
}
|
|
12721
12840
|
let actualPath = resolved;
|
|
12722
12841
|
if (!actualPath.endsWith(".ts"))
|
|
12723
12842
|
actualPath += ".ts";
|
|
@@ -15021,7 +15140,18 @@ var fail = (reason, detail, location) => ({
|
|
|
15021
15140
|
if (!initializerShapeIsStructural(init))
|
|
15022
15141
|
continue;
|
|
15023
15142
|
const name = member.name.getText();
|
|
15024
|
-
|
|
15143
|
+
let bodyText;
|
|
15144
|
+
try {
|
|
15145
|
+
const printer = ts6.createPrinter({
|
|
15146
|
+
newLine: ts6.NewLineKind.LineFeed,
|
|
15147
|
+
omitTrailingSemicolon: true,
|
|
15148
|
+
removeComments: true
|
|
15149
|
+
});
|
|
15150
|
+
bodyText = printer.printNode(ts6.EmitHint.Unspecified, init, cls.getSourceFile());
|
|
15151
|
+
} catch {
|
|
15152
|
+
bodyText = init.getText();
|
|
15153
|
+
}
|
|
15154
|
+
const bodyHash = djb2Hash(bodyText);
|
|
15025
15155
|
entries.push(`${name}:${bodyHash}`);
|
|
15026
15156
|
}
|
|
15027
15157
|
return entries.sort();
|
|
@@ -15230,15 +15360,21 @@ var fail = (reason, detail, location) => ({
|
|
|
15230
15360
|
const providerImportSig = extractProviderImportSig(decoratorMeta.importsExpr, sourceFile, componentDir);
|
|
15231
15361
|
const topLevelImports = extractTopLevelImports(sourceFile);
|
|
15232
15362
|
const propertyFieldNames = extractPropertyFieldNames(cls);
|
|
15233
|
-
const
|
|
15234
|
-
|
|
15235
|
-
|
|
15236
|
-
|
|
15237
|
-
|
|
15238
|
-
const
|
|
15239
|
-
const
|
|
15240
|
-
const
|
|
15241
|
-
const
|
|
15363
|
+
const printer = ts6.createPrinter({
|
|
15364
|
+
newLine: ts6.NewLineKind.LineFeed,
|
|
15365
|
+
omitTrailingSemicolon: true,
|
|
15366
|
+
removeComments: true
|
|
15367
|
+
});
|
|
15368
|
+
const canonicalText = (node) => printer.printNode(ts6.EmitHint.Unspecified, node, sourceFile);
|
|
15369
|
+
const importsArraySig = decoratorMeta.importsExpr ? djb2Hash(canonicalText(decoratorMeta.importsExpr)) : "";
|
|
15370
|
+
const hostDirectivesSig = decoratorMeta.hostDirectivesExpr ? djb2Hash(canonicalText(decoratorMeta.hostDirectivesExpr)) : "";
|
|
15371
|
+
const animationsArraySig = decoratorMeta.animationsExpr ? djb2Hash(canonicalText(decoratorMeta.animationsExpr)) : "";
|
|
15372
|
+
const providersArraySig = decoratorMeta.providersExpr ? djb2Hash(canonicalText(decoratorMeta.providersExpr)) : "";
|
|
15373
|
+
const viewProvidersArraySig = decoratorMeta.viewProvidersExpr ? djb2Hash(canonicalText(decoratorMeta.viewProvidersExpr)) : "";
|
|
15374
|
+
const decoratorInputsArraySig = decoratorMeta.inputsArrayExpr ? djb2Hash(canonicalText(decoratorMeta.inputsArrayExpr)) : "";
|
|
15375
|
+
const decoratorOutputsArraySig = decoratorMeta.outputsArrayExpr ? djb2Hash(canonicalText(decoratorMeta.outputsArrayExpr)) : "";
|
|
15376
|
+
const hostBindingsSig = decoratorMeta.hostExpr ? djb2Hash(canonicalText(decoratorMeta.hostExpr)) : "";
|
|
15377
|
+
const schemasSig = decoratorMeta.schemasExpr ? djb2Hash(canonicalText(decoratorMeta.schemasExpr)) : "";
|
|
15242
15378
|
const PAGE_EXPORT_NAMES = new Set(["providers", "routes"]);
|
|
15243
15379
|
const pageExportEntries = [];
|
|
15244
15380
|
for (const stmt of sourceFile.statements) {
|
|
@@ -15254,7 +15390,7 @@ var fail = (reason, detail, location) => ({
|
|
|
15254
15390
|
continue;
|
|
15255
15391
|
if (!decl.initializer)
|
|
15256
15392
|
continue;
|
|
15257
|
-
pageExportEntries.push(`${decl.name.text}=${djb2Hash(decl.initializer
|
|
15393
|
+
pageExportEntries.push(`${decl.name.text}=${djb2Hash(canonicalText(decl.initializer))}`);
|
|
15258
15394
|
}
|
|
15259
15395
|
}
|
|
15260
15396
|
pageExportEntries.sort();
|
|
@@ -20853,6 +20989,54 @@ export default {};
|
|
|
20853
20989
|
}, transformAndCache = async (filePath, ext, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
20854
20990
|
if (ext === ".css")
|
|
20855
20991
|
return jsResponse(handleCssRequest(filePath));
|
|
20992
|
+
if (ext === ".json") {
|
|
20993
|
+
try {
|
|
20994
|
+
const { readFile: readFile6, stat: stat4 } = await import("fs/promises");
|
|
20995
|
+
const fileExists = async (p2) => {
|
|
20996
|
+
try {
|
|
20997
|
+
await stat4(p2);
|
|
20998
|
+
return true;
|
|
20999
|
+
} catch {
|
|
21000
|
+
return false;
|
|
21001
|
+
}
|
|
21002
|
+
};
|
|
21003
|
+
let sourcePath = filePath;
|
|
21004
|
+
if (!await fileExists(sourcePath)) {
|
|
21005
|
+
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
21006
|
+
const generatedAngularRoot = getFrameworkGeneratedDir2("angular").replace(/\\/g, "/");
|
|
21007
|
+
const normalized = filePath.replace(/\\/g, "/");
|
|
21008
|
+
if (normalized.startsWith(generatedAngularRoot + "/") || normalized.startsWith(generatedAngularRoot)) {
|
|
21009
|
+
const tail = normalized.slice(generatedAngularRoot.length + 1);
|
|
21010
|
+
const absoluteCandidate = "/" + tail.replace(/^\/+/, "");
|
|
21011
|
+
const candidates = [
|
|
21012
|
+
absoluteCandidate,
|
|
21013
|
+
resolve35(projectRoot, tail)
|
|
21014
|
+
];
|
|
21015
|
+
try {
|
|
21016
|
+
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loadConfig(), exports_loadConfig));
|
|
21017
|
+
const cfg = await loadConfig2();
|
|
21018
|
+
const angularDir = cfg.angularDirectory && resolve35(projectRoot, cfg.angularDirectory);
|
|
21019
|
+
if (angularDir)
|
|
21020
|
+
candidates.push(resolve35(angularDir, tail));
|
|
21021
|
+
} catch {}
|
|
21022
|
+
for (const candidate of candidates) {
|
|
21023
|
+
if (await fileExists(candidate)) {
|
|
21024
|
+
sourcePath = candidate;
|
|
21025
|
+
break;
|
|
21026
|
+
}
|
|
21027
|
+
}
|
|
21028
|
+
}
|
|
21029
|
+
}
|
|
21030
|
+
const text = await readFile6(sourcePath, "utf-8");
|
|
21031
|
+
JSON.parse(text);
|
|
21032
|
+
return jsResponse(`export default ${text};`);
|
|
21033
|
+
} catch (err) {
|
|
21034
|
+
return new Response(`console.error('[ModuleServer] JSON load error in ${filePath}:', ${JSON.stringify(String(err))});`, {
|
|
21035
|
+
headers: { "Content-Type": "application/javascript" },
|
|
21036
|
+
status: 500
|
|
21037
|
+
});
|
|
21038
|
+
}
|
|
21039
|
+
}
|
|
20856
21040
|
const isSvelte = ext === ".svelte" || filePath.endsWith(".svelte.ts") || filePath.endsWith(".svelte.js");
|
|
20857
21041
|
const cached = getTransformed(filePath);
|
|
20858
21042
|
if (cached)
|
|
@@ -21586,33 +21770,49 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21586
21770
|
if (framework === "ignored") {
|
|
21587
21771
|
return;
|
|
21588
21772
|
}
|
|
21773
|
+
if (/\.(spec|test)\.(?:m?[tj]sx?)$/i.test(filePath) || /[\\/]__tests__[\\/]/.test(filePath)) {
|
|
21774
|
+
return;
|
|
21775
|
+
}
|
|
21589
21776
|
const currentHash = computeFileHash(filePath);
|
|
21590
21777
|
if (!hasFileChanged(filePath, currentHash, state.fileHashes)) {
|
|
21591
21778
|
return;
|
|
21592
21779
|
}
|
|
21593
21780
|
const publicDir = state.resolvedPaths.publicDir;
|
|
21594
|
-
|
|
21781
|
+
const assetsDir = state.resolvedPaths.assetsDir;
|
|
21782
|
+
const handleStaticMirror = async (sourceDir, urlPrefix) => {
|
|
21783
|
+
const absSource = resolve39(filePath);
|
|
21784
|
+
const normalizedSource = absSource.replace(/\\/g, "/");
|
|
21785
|
+
const normalizedDir = sourceDir.replace(/\\/g, "/");
|
|
21786
|
+
if (!normalizedSource.startsWith(normalizedDir + "/"))
|
|
21787
|
+
return false;
|
|
21595
21788
|
try {
|
|
21596
|
-
const
|
|
21597
|
-
const relFromPublic = absSource.replace(/\\/g, "/").slice(publicDir.length + 1);
|
|
21789
|
+
const relFromDir = normalizedSource.slice(normalizedDir.length + 1);
|
|
21598
21790
|
const buildDir = state.resolvedPaths.buildDir;
|
|
21599
|
-
const destPath = resolve39(buildDir,
|
|
21791
|
+
const destPath = resolve39(buildDir, urlPrefix ? `${urlPrefix}/${relFromDir}` : relFromDir);
|
|
21600
21792
|
const { mkdir: mkdir7, copyFile, readFile: readFile6 } = await import("fs/promises");
|
|
21601
21793
|
const { dirname: dirname23 } = await import("path");
|
|
21602
21794
|
await mkdir7(dirname23(destPath), { recursive: true });
|
|
21603
21795
|
await copyFile(absSource, destPath);
|
|
21604
21796
|
const bytes = await readFile6(destPath);
|
|
21605
|
-
|
|
21797
|
+
const webPath = urlPrefix ? `/${urlPrefix}/${relFromDir}` : `/${relFromDir}`;
|
|
21798
|
+
state.assetStore.set(webPath, new Uint8Array(bytes));
|
|
21606
21799
|
state.fileHashes.set(absSource, currentHash);
|
|
21607
21800
|
logHmrUpdate(relative16(process.cwd(), filePath));
|
|
21608
21801
|
broadcastToClients(state, {
|
|
21609
|
-
data: {
|
|
21610
|
-
|
|
21802
|
+
data: {
|
|
21803
|
+
framework: urlPrefix || "public",
|
|
21804
|
+
manifest: state.manifest
|
|
21805
|
+
},
|
|
21806
|
+
message: `${urlPrefix || "Public"} asset updated`,
|
|
21611
21807
|
type: "style-update"
|
|
21612
21808
|
});
|
|
21613
21809
|
} catch {}
|
|
21810
|
+
return true;
|
|
21811
|
+
};
|
|
21812
|
+
if (publicDir && await handleStaticMirror(publicDir, ""))
|
|
21813
|
+
return;
|
|
21814
|
+
if (assetsDir && await handleStaticMirror(assetsDir, "assets"))
|
|
21614
21815
|
return;
|
|
21615
|
-
}
|
|
21616
21816
|
if (framework === "unknown") {
|
|
21617
21817
|
invalidate(resolve39(filePath));
|
|
21618
21818
|
const relPath = relative16(process.cwd(), filePath);
|
|
@@ -21897,7 +22097,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
21897
22097
|
tier: 1
|
|
21898
22098
|
};
|
|
21899
22099
|
}
|
|
21900
|
-
if (owners.length === 0 && editedFile.endsWith(".ts") && !editedFile.endsWith(".d.ts")) {
|
|
22100
|
+
if (owners.length === 0 && (editedFile.endsWith(".ts") || editedFile.endsWith(".json")) && !editedFile.endsWith(".d.ts")) {
|
|
21901
22101
|
const normalized = editedFile.replace(/\\/g, "/");
|
|
21902
22102
|
const angularDirAbs = resolve39(angularDir).replace(/\\/g, "/");
|
|
21903
22103
|
if (normalized.startsWith(angularDirAbs + "/")) {
|
|
@@ -25195,117 +25395,11 @@ var handleHTMXPageRequest = async (pagePath) => {
|
|
|
25195
25395
|
});
|
|
25196
25396
|
};
|
|
25197
25397
|
// src/core/prepare.ts
|
|
25398
|
+
init_loadConfig();
|
|
25198
25399
|
import { existsSync as existsSync30, readdirSync as readdirSync3, readFileSync as readFileSync23 } from "fs";
|
|
25199
25400
|
import { basename as basename13, join as join34, relative as relative17, resolve as resolve43 } from "path";
|
|
25200
25401
|
import { Elysia as Elysia5 } from "elysia";
|
|
25201
25402
|
|
|
25202
|
-
// src/utils/loadConfig.ts
|
|
25203
|
-
import { resolve as resolve8 } from "path";
|
|
25204
|
-
var RESERVED_TOP_LEVEL_KEYS = new Set([
|
|
25205
|
-
"assetsDirectory",
|
|
25206
|
-
"astroDirectory",
|
|
25207
|
-
"buildDirectory",
|
|
25208
|
-
"bunBuild",
|
|
25209
|
-
"command",
|
|
25210
|
-
"config",
|
|
25211
|
-
"cwd",
|
|
25212
|
-
"dependsOn",
|
|
25213
|
-
"dev",
|
|
25214
|
-
"emberDirectory",
|
|
25215
|
-
"entry",
|
|
25216
|
-
"env",
|
|
25217
|
-
"htmlDirectory",
|
|
25218
|
-
"htmxDirectory",
|
|
25219
|
-
"images",
|
|
25220
|
-
"incrementalFiles",
|
|
25221
|
-
"islands",
|
|
25222
|
-
"kind",
|
|
25223
|
-
"mode",
|
|
25224
|
-
"options",
|
|
25225
|
-
"port",
|
|
25226
|
-
"postcss",
|
|
25227
|
-
"publicDirectory",
|
|
25228
|
-
"reactDirectory",
|
|
25229
|
-
"sitemap",
|
|
25230
|
-
"static",
|
|
25231
|
-
"stylesConfig",
|
|
25232
|
-
"svelteDirectory",
|
|
25233
|
-
"tailwind",
|
|
25234
|
-
"ready",
|
|
25235
|
-
"visibility",
|
|
25236
|
-
"vueDirectory"
|
|
25237
|
-
]);
|
|
25238
|
-
var isObject = (value) => typeof value === "object" && value !== null;
|
|
25239
|
-
var isCommandService = (service) => service.kind === "command" || Array.isArray(service.command);
|
|
25240
|
-
var isServiceCandidate = (value) => isObject(value) && (typeof value.entry === "string" || Array.isArray(value.command));
|
|
25241
|
-
var isWorkspaceConfig = (config) => {
|
|
25242
|
-
if (!isObject(config)) {
|
|
25243
|
-
return false;
|
|
25244
|
-
}
|
|
25245
|
-
const entries = Object.entries(config);
|
|
25246
|
-
if (entries.length === 0) {
|
|
25247
|
-
return false;
|
|
25248
|
-
}
|
|
25249
|
-
if (entries.some(([key]) => RESERVED_TOP_LEVEL_KEYS.has(key))) {
|
|
25250
|
-
return false;
|
|
25251
|
-
}
|
|
25252
|
-
return entries.every(([, value]) => isServiceCandidate(value));
|
|
25253
|
-
};
|
|
25254
|
-
var isConfigInput = (value) => isObject(value);
|
|
25255
|
-
var getWorkspaceServices = (config) => {
|
|
25256
|
-
if (!isWorkspaceConfig(config)) {
|
|
25257
|
-
throw new Error("absolute.config.ts is not a multi-service config. Define top-level named services with `entry` or `command` before using `absolute workspace dev`.");
|
|
25258
|
-
}
|
|
25259
|
-
return config;
|
|
25260
|
-
};
|
|
25261
|
-
var projectServiceConfig = (config, serviceName) => {
|
|
25262
|
-
const services = getWorkspaceServices(config);
|
|
25263
|
-
const service = services[serviceName];
|
|
25264
|
-
if (!service) {
|
|
25265
|
-
throw new Error(`Config file does not define service "${serviceName}".`);
|
|
25266
|
-
}
|
|
25267
|
-
if (isCommandService(service)) {
|
|
25268
|
-
throw new Error(`Service "${serviceName}" is a command service and cannot be loaded as an AbsoluteJS app config.`);
|
|
25269
|
-
}
|
|
25270
|
-
const {
|
|
25271
|
-
command: _command,
|
|
25272
|
-
config: _config,
|
|
25273
|
-
cwd: _cwd,
|
|
25274
|
-
dependsOn: _dependsOn,
|
|
25275
|
-
env: _env,
|
|
25276
|
-
kind: _kind,
|
|
25277
|
-
port: _port,
|
|
25278
|
-
ready: _ready,
|
|
25279
|
-
visibility: _visibility,
|
|
25280
|
-
...serviceConfig
|
|
25281
|
-
} = service;
|
|
25282
|
-
return serviceConfig;
|
|
25283
|
-
};
|
|
25284
|
-
var loadConfig = async (configPath) => {
|
|
25285
|
-
const config = await loadRawConfig(configPath);
|
|
25286
|
-
const serviceName = process.env.ABSOLUTE_WORKSPACE_SERVICE_NAME;
|
|
25287
|
-
if (typeof serviceName === "string" && serviceName.length > 0) {
|
|
25288
|
-
return projectServiceConfig(config, serviceName);
|
|
25289
|
-
}
|
|
25290
|
-
if (isWorkspaceConfig(config)) {
|
|
25291
|
-
throw new Error("absolute.config.ts defines multiple services. Use `absolute workspace dev` or set ABSOLUTE_WORKSPACE_SERVICE_NAME before loading a specific service config.");
|
|
25292
|
-
}
|
|
25293
|
-
return config;
|
|
25294
|
-
};
|
|
25295
|
-
var loadRawConfig = async (configPath) => {
|
|
25296
|
-
const resolved = resolve8(configPath ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
25297
|
-
const mod = await import(resolved);
|
|
25298
|
-
const config = mod.default ?? mod.config;
|
|
25299
|
-
if (!config) {
|
|
25300
|
-
throw new Error(`Config file "${resolved}" does not export a valid configuration.
|
|
25301
|
-
Expected: export default defineConfig({ ... })`);
|
|
25302
|
-
}
|
|
25303
|
-
if (!isConfigInput(config)) {
|
|
25304
|
-
throw new Error(`Config file "${resolved}" must export an object configuration.`);
|
|
25305
|
-
}
|
|
25306
|
-
return config;
|
|
25307
|
-
};
|
|
25308
|
-
|
|
25309
25403
|
// src/core/loadIslandRegistry.ts
|
|
25310
25404
|
init_islandEntries();
|
|
25311
25405
|
import { resolve as resolve9 } from "path";
|
|
@@ -32573,5 +32667,5 @@ export {
|
|
|
32573
32667
|
ANGULAR_INIT_TIMEOUT_MS
|
|
32574
32668
|
};
|
|
32575
32669
|
|
|
32576
|
-
//# debugId=
|
|
32670
|
+
//# debugId=FCFA0DD89CA7835164756E2164756E21
|
|
32577
32671
|
//# sourceMappingURL=index.js.map
|