@malloy-publisher/server 0.10.2 → 0.10.4
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/app/api-doc.yaml +21 -10
- package/dist/app/assets/{EnvironmentPage-qOdFSQL1.js → EnvironmentPage-B9Q9ZYYM.js} +1 -1
- package/dist/app/assets/{HomePage-qPrsLgkV.js → HomePage-CVbXvH7c.js} +1 -1
- package/dist/app/assets/{MainPage-BfS_-PBR.js → MainPage-D1Fj4Wy1.js} +1 -1
- package/dist/app/assets/{ModelPage-Rgt_50mg.js → ModelPage-DmYocpWT.js} +2 -2
- package/dist/app/assets/{PackagePage-D6bXCeY6.js → PackagePage-4TwX_ajC.js} +1 -1
- package/dist/app/assets/RenderedResult-B_sW7neX.es-CFeRQyYD.js +179 -0
- package/dist/app/assets/{RouteError-D3qvottt.js → RouteError-BYb6Nj48.js} +1 -1
- package/dist/app/assets/ThemeEditorPage-CYe_2MfI.js +1 -0
- package/dist/app/assets/{ToggleButtonGroup-DnK5WHKM.js → ToggleButtonGroup-b325mGmL.js} +1 -1
- package/dist/app/assets/documentRoutes-D_C8snHV.js +1 -0
- package/dist/app/assets/{editPageMounted-po3c6RP3.js → editPageMounted-1X99LP7v.js} +2 -2
- package/dist/app/assets/{index-CNbuoYFM.js → index-3fArIYYK.js} +1 -1
- package/dist/app/assets/index-CGKV9Dxi.js +483 -0
- package/dist/app/assets/{index-4-yQ2uF2.js → index-DEj7hnfZ.js} +1 -1
- package/dist/app/assets/{index-a9NQPL4B.js → index-DWhQwvJR.js} +1 -1
- package/dist/app/assets/{index.es-C2AyMc9a.js → index.es-CMsNTB-h.js} +21 -21
- package/dist/app/index.html +1 -1
- package/dist/instrumentation.mjs +1 -1
- package/dist/package_load_worker.mjs +81 -48
- package/dist/server.mjs +382 -127
- package/package.json +1 -1
- package/dist/app/assets/RenderedResult-BCJC0ZVj.es-ThIM8SXj.js +0 -171
- package/dist/app/assets/ThemeEditorPage-UAf70V3Q.js +0 -1
- package/dist/app/assets/documentRoutes-CnLoYf4D.js +0 -1
- package/dist/app/assets/index-iyvwQg3j.js +0 -481
package/dist/app/index.html
CHANGED
|
@@ -16,7 +16,7 @@ SPDX-License-Identifier: MIT
|
|
|
16
16
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
|
|
17
17
|
/>
|
|
18
18
|
<title>Malloy Publisher</title>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-CGKV9Dxi.js"></script>
|
|
20
20
|
<link rel="stylesheet" crossorigin href="/assets/index-DUqldpo0.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
package/dist/instrumentation.mjs
CHANGED
|
@@ -164831,7 +164831,7 @@ var init_telemetry = __esm(() => {
|
|
|
164831
164831
|
});
|
|
164832
164832
|
|
|
164833
164833
|
// package.json
|
|
164834
|
-
var version = "0.10.
|
|
164834
|
+
var version = "0.10.4";
|
|
164835
164835
|
var init_package = () => {};
|
|
164836
164836
|
|
|
164837
164837
|
// src/version.ts
|
|
@@ -22216,7 +22216,7 @@ async function compileSynthesizedPreaggregation(args) {
|
|
|
22216
22216
|
const { runtime, importBaseURL } = await args.getRuntime(new Map([[synthesizedURL.href, text]]));
|
|
22217
22217
|
const materializer = runtime.loadModel(synthesizedURL, { importBaseURL });
|
|
22218
22218
|
const model = await materializer.getModel();
|
|
22219
|
-
return { plans, model, materializer, text };
|
|
22219
|
+
return { plans, model, materializer, runtime, text };
|
|
22220
22220
|
}
|
|
22221
22221
|
async function tryCompileSynthesizedPreaggregation(args) {
|
|
22222
22222
|
try {
|
|
@@ -23215,27 +23215,47 @@ function composeDeclaredQueryMetadata(layers) {
|
|
|
23215
23215
|
const resolved = Object.assign({}, ...ordered);
|
|
23216
23216
|
return Object.keys(resolved).length > 0 ? resolved : null;
|
|
23217
23217
|
}
|
|
23218
|
-
function
|
|
23219
|
-
|
|
23220
|
-
}
|
|
23221
|
-
|
|
23222
|
-
|
|
23223
|
-
|
|
23224
|
-
|
|
23225
|
-
|
|
23226
|
-
for (const dep of node.dependsOn) {
|
|
23227
|
-
yield* visit(dep);
|
|
23218
|
+
function sourceBuildOf(build, unbuildable) {
|
|
23219
|
+
const order = [];
|
|
23220
|
+
const dependsOn = {};
|
|
23221
|
+
for (const target of build.targets) {
|
|
23222
|
+
const reads = target.dependsOn.flatMap((t) => t.sources.map((s) => s.sourceID));
|
|
23223
|
+
for (const source of target.sources) {
|
|
23224
|
+
order.push(source.sourceID);
|
|
23225
|
+
dependsOn[source.sourceID] = reads;
|
|
23228
23226
|
}
|
|
23229
|
-
|
|
23230
|
-
|
|
23227
|
+
}
|
|
23228
|
+
for (const { source } of unbuildable) {
|
|
23229
|
+
if (source.connectionName !== build.connectionName)
|
|
23230
|
+
continue;
|
|
23231
|
+
order.push(source.sourceID);
|
|
23232
|
+
dependsOn[source.sourceID] = [];
|
|
23233
|
+
}
|
|
23234
|
+
return { connectionName: build.connectionName, order, dependsOn };
|
|
23235
|
+
}
|
|
23236
|
+
function sourceBuildsOf(targets) {
|
|
23237
|
+
const builds = targets.connections.map((c) => sourceBuildOf(c, targets.unbuildable));
|
|
23238
|
+
const planned = new Set(builds.map((b) => b.connectionName));
|
|
23239
|
+
for (const { source } of targets.unbuildable) {
|
|
23240
|
+
if (planned.has(source.connectionName))
|
|
23241
|
+
continue;
|
|
23242
|
+
planned.add(source.connectionName);
|
|
23243
|
+
builds.push(sourceBuildOf({ connectionName: source.connectionName, targets: [] }, targets.unbuildable));
|
|
23244
|
+
}
|
|
23245
|
+
return builds;
|
|
23246
|
+
}
|
|
23247
|
+
function plannedSources(targets) {
|
|
23248
|
+
return [
|
|
23249
|
+
...targets.connections.flatMap((c) => c.targets.flatMap((t) => t.sources)),
|
|
23250
|
+
...targets.unbuildable.map((u) => u.source)
|
|
23251
|
+
];
|
|
23252
|
+
}
|
|
23253
|
+
function* sourcesInBuildOrder(build, sources) {
|
|
23254
|
+
for (const sourceID of build.order) {
|
|
23255
|
+
const source = sources[sourceID];
|
|
23231
23256
|
if (source)
|
|
23232
23257
|
yield source;
|
|
23233
23258
|
}
|
|
23234
|
-
for (const level of graph.nodes) {
|
|
23235
|
-
for (const node of level) {
|
|
23236
|
-
yield* visit(node);
|
|
23237
|
-
}
|
|
23238
|
-
}
|
|
23239
23259
|
}
|
|
23240
23260
|
function computeSourceEntityId(source, connectionDigests) {
|
|
23241
23261
|
return source.makeBuildId(connectionDigests[source.connectionName], addressPartitionLayout(source, source.getSQL()));
|
|
@@ -23324,7 +23344,7 @@ async function classifyPersistSourceGate(persistSource, modelDef, materializer,
|
|
|
23324
23344
|
}
|
|
23325
23345
|
function emptyBuildPlanParts() {
|
|
23326
23346
|
return {
|
|
23327
|
-
|
|
23347
|
+
builds: [],
|
|
23328
23348
|
sources: {},
|
|
23329
23349
|
sourceModelPaths: {},
|
|
23330
23350
|
droppedPersistSources: [],
|
|
@@ -23333,7 +23353,7 @@ function emptyBuildPlanParts() {
|
|
|
23333
23353
|
};
|
|
23334
23354
|
}
|
|
23335
23355
|
function mergeBuildPlanParts(into, from) {
|
|
23336
|
-
into.
|
|
23356
|
+
into.builds.push(...from.builds);
|
|
23337
23357
|
Object.assign(into.sources, from.sources);
|
|
23338
23358
|
Object.assign(into.sourceModelPaths, from.sourceModelPaths);
|
|
23339
23359
|
into.droppedPersistSources.push(...from.droppedPersistSources);
|
|
@@ -23341,7 +23361,14 @@ function mergeBuildPlanParts(into, from) {
|
|
|
23341
23361
|
Object.assign(into.sourceGateOutcomes, from.sourceGateOutcomes);
|
|
23342
23362
|
}
|
|
23343
23363
|
async function collectModelBuildPlan(parts, args) {
|
|
23344
|
-
const {
|
|
23364
|
+
const {
|
|
23365
|
+
modelPath,
|
|
23366
|
+
packagePath,
|
|
23367
|
+
materializer,
|
|
23368
|
+
malloyModel,
|
|
23369
|
+
runtime,
|
|
23370
|
+
getRuntime
|
|
23371
|
+
} = args;
|
|
23345
23372
|
const synthesized = args.synthesized !== undefined ? args.synthesized : await tryCompileSynthesizedPreaggregation({
|
|
23346
23373
|
packagePath,
|
|
23347
23374
|
modelPath,
|
|
@@ -23349,14 +23376,14 @@ async function collectModelBuildPlan(parts, args) {
|
|
|
23349
23376
|
contents: malloyModel._modelDef?.contents ?? {}
|
|
23350
23377
|
});
|
|
23351
23378
|
if (synthesized) {
|
|
23352
|
-
const
|
|
23353
|
-
|
|
23354
|
-
parts.graphs.push(...rollupPlan.graphs);
|
|
23379
|
+
const rollupTargets = await synthesized.runtime.getBuildTargets(synthesized.model);
|
|
23380
|
+
parts.builds.push(...sourceBuildsOf(rollupTargets));
|
|
23355
23381
|
const planByName = new Map(synthesized.plans.map((p) => [p.rollupSourceName, p]));
|
|
23356
23382
|
let rollupClassificationCtx;
|
|
23357
|
-
for (const
|
|
23358
|
-
if (!
|
|
23383
|
+
for (const source of plannedSources(rollupTargets)) {
|
|
23384
|
+
if (!planByName.has(source.name))
|
|
23359
23385
|
continue;
|
|
23386
|
+
const sourceID = source.sourceID;
|
|
23360
23387
|
parts.sources[sourceID] = source;
|
|
23361
23388
|
parts.sourceModelPaths[sourceID] = modelPath;
|
|
23362
23389
|
const rollup = planByName.get(source.name);
|
|
@@ -23375,23 +23402,25 @@ async function collectModelBuildPlan(parts, args) {
|
|
|
23375
23402
|
const modelTag = malloyModel.modelAnnotations.parseAsTag("!").tag;
|
|
23376
23403
|
if (!modelTag.has("experimental", "persistence"))
|
|
23377
23404
|
return;
|
|
23378
|
-
const
|
|
23379
|
-
for (const msg of
|
|
23405
|
+
const targets = await runtime.getBuildTargets(malloyModel);
|
|
23406
|
+
for (const msg of targets.tagParseLog) {
|
|
23380
23407
|
logger.warn("Persist annotation issue", {
|
|
23381
23408
|
modelPath,
|
|
23382
23409
|
message: msg.message,
|
|
23383
23410
|
severity: msg.severity
|
|
23384
23411
|
});
|
|
23385
23412
|
}
|
|
23386
|
-
const
|
|
23413
|
+
const planned = plannedSources(targets);
|
|
23414
|
+
const recognizedNames = new Set(planned.map((s) => s.name));
|
|
23387
23415
|
for (const name of detectDroppedPersistSources(malloyModel, recognizedNames)) {
|
|
23388
23416
|
parts.droppedPersistSources.push({ name, modelPath });
|
|
23389
23417
|
}
|
|
23390
|
-
if (
|
|
23418
|
+
if (planned.length === 0)
|
|
23391
23419
|
return;
|
|
23392
|
-
parts.
|
|
23420
|
+
parts.builds.push(...sourceBuildsOf(targets));
|
|
23393
23421
|
let classificationCtx;
|
|
23394
|
-
for (const
|
|
23422
|
+
for (const source of planned) {
|
|
23423
|
+
const sourceID = source.sourceID;
|
|
23395
23424
|
parts.sources[sourceID] = source;
|
|
23396
23425
|
parts.sourceModelPaths[sourceID] = modelPath;
|
|
23397
23426
|
if (!classificationCtx) {
|
|
@@ -23404,28 +23433,30 @@ async function collectModelBuildPlan(parts, args) {
|
|
|
23404
23433
|
parts.sourceGateOutcomes[sourceID] = await classifyPersistSourceGate(source, classificationCtx.modelDef, materializer, classificationCtx.deps, modelPath);
|
|
23405
23434
|
}
|
|
23406
23435
|
}
|
|
23407
|
-
async function resolveConnectionDigests(connections,
|
|
23436
|
+
async function resolveConnectionDigests(connections, builds, onSkipped) {
|
|
23408
23437
|
const connectionDigests = {};
|
|
23409
|
-
for (const
|
|
23410
|
-
const conn = connections.get(
|
|
23438
|
+
for (const build of builds) {
|
|
23439
|
+
const conn = connections.get(build.connectionName);
|
|
23411
23440
|
if (!conn) {
|
|
23412
|
-
onSkipped(
|
|
23441
|
+
onSkipped(build.connectionName);
|
|
23413
23442
|
continue;
|
|
23414
23443
|
}
|
|
23415
|
-
if (!connectionDigests[
|
|
23416
|
-
connectionDigests[
|
|
23444
|
+
if (!connectionDigests[build.connectionName]) {
|
|
23445
|
+
connectionDigests[build.connectionName] = await conn.getDigest();
|
|
23417
23446
|
}
|
|
23418
23447
|
}
|
|
23419
23448
|
return connectionDigests;
|
|
23420
23449
|
}
|
|
23421
|
-
function deriveBuildPlan(
|
|
23450
|
+
function deriveBuildPlan(builds, sources, connectionDigests, sourceNames, sourceModelPaths, packageMaterialization, options) {
|
|
23422
23451
|
const include = sourceNames ? new Set(sourceNames) : null;
|
|
23423
|
-
const wireGraphs =
|
|
23424
|
-
connectionName:
|
|
23425
|
-
nodes:
|
|
23426
|
-
sourceID
|
|
23427
|
-
|
|
23428
|
-
|
|
23452
|
+
const wireGraphs = builds.map((build) => ({
|
|
23453
|
+
connectionName: build.connectionName,
|
|
23454
|
+
nodes: [
|
|
23455
|
+
build.order.map((sourceID) => ({
|
|
23456
|
+
sourceID,
|
|
23457
|
+
dependsOn: build.dependsOn[sourceID] ?? []
|
|
23458
|
+
}))
|
|
23459
|
+
]
|
|
23429
23460
|
}));
|
|
23430
23461
|
const wireSources = {};
|
|
23431
23462
|
const refusedSources = {};
|
|
@@ -23514,7 +23545,7 @@ function deriveBuildPlan(graphs, sources, connectionDigests, sourceNames, source
|
|
|
23514
23545
|
function deriveBuildPlanOutcome(compiled, materializationConfig) {
|
|
23515
23546
|
const droppedPersistSources = compiled.droppedPersistSources ?? [];
|
|
23516
23547
|
const incrementalDeclarations = collectIncrementalDeclarations(compiled.sources);
|
|
23517
|
-
const plan = compiled.
|
|
23548
|
+
const plan = compiled.builds.length === 0 ? null : deriveBuildPlan(compiled.builds, compiled.sources, compiled.connectionDigests, undefined, compiled.sourceModelPaths, materializationConfig, {
|
|
23518
23549
|
preaggregatePlans: compiled.preaggregatePlans,
|
|
23519
23550
|
sourceGateOutcomes: compiled.sourceGateOutcomes
|
|
23520
23551
|
});
|
|
@@ -24474,6 +24505,7 @@ async function compileMalloyModel(job, malloyConfig, modelPath, load) {
|
|
|
24474
24505
|
modelPath,
|
|
24475
24506
|
materializer: mm,
|
|
24476
24507
|
model: compiled,
|
|
24508
|
+
runtime,
|
|
24477
24509
|
importBaseURL,
|
|
24478
24510
|
queries,
|
|
24479
24511
|
sources
|
|
@@ -24559,6 +24591,7 @@ async function prepareForMainThread(job, malloyConfig, load, model) {
|
|
|
24559
24591
|
packagePath: job.packagePath,
|
|
24560
24592
|
materializer,
|
|
24561
24593
|
malloyModel: model.model,
|
|
24594
|
+
runtime: model.runtime,
|
|
24562
24595
|
getRuntime: companionRuntime,
|
|
24563
24596
|
synthesized: companion
|
|
24564
24597
|
});
|
|
@@ -24798,8 +24831,8 @@ async function finishWorkerBuildPlan(malloyConfig, modelPaths, load, materializa
|
|
|
24798
24831
|
}
|
|
24799
24832
|
const connections = await resolvePackageConnections({
|
|
24800
24833
|
getMalloyConnection: (name) => malloyConfig.connections.lookupConnection(name)
|
|
24801
|
-
}, parts.
|
|
24802
|
-
const connectionDigests = await resolveConnectionDigests(connections, parts.
|
|
24834
|
+
}, parts.builds.map((b) => b.connectionName));
|
|
24835
|
+
const connectionDigests = await resolveConnectionDigests(connections, parts.builds, (name) => digestSkipped.push(name));
|
|
24803
24836
|
const outcome = deriveBuildPlanOutcome({ ...parts, connectionDigests }, materializationConfig);
|
|
24804
24837
|
return {
|
|
24805
24838
|
ok: true,
|