@sanity/ailf 4.0.4 → 4.0.5
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.
|
@@ -34,11 +34,16 @@ export class FetchDocsStep {
|
|
|
34
34
|
// a mismatch where configs reference context files that were never
|
|
35
35
|
// fetched.
|
|
36
36
|
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
37
|
+
// Adapter path: ctx.taskSource handles both content-lake and repo modes.
|
|
38
|
+
// The composition root wires the right adapter (ContentLakeTaskSource
|
|
39
|
+
// or RepoTaskSource) per taskSourceType. RepoTaskSource loads BOTH
|
|
40
|
+
// .yaml and .task.ts files — necessary for external-consumer evals
|
|
41
|
+
// that materialize inline tasks as YAML (W0148).
|
|
42
|
+
// Filesystem path: load from .task.ts files (legacy unset path —
|
|
43
|
+
// AILF defaults from tasks/${mode}/ + optional repoTasksPath augment).
|
|
40
44
|
let allTasks;
|
|
41
|
-
if (ctx.config.taskSourceType === "content-lake"
|
|
45
|
+
if (ctx.config.taskSourceType === "content-lake" ||
|
|
46
|
+
ctx.config.taskSourceType === "repo") {
|
|
42
47
|
const filter = {
|
|
43
48
|
...(ctx.config.areas?.length ? { areas: ctx.config.areas } : {}),
|
|
44
49
|
...(ctx.config.tasks?.length ? { taskIds: ctx.config.tasks } : {}),
|
|
@@ -19,13 +19,14 @@ export declare class GenerateConfigsStep implements PipelineStep {
|
|
|
19
19
|
private compileSingleMode;
|
|
20
20
|
private loadTasks;
|
|
21
21
|
/**
|
|
22
|
-
* Load tasks
|
|
22
|
+
* Load tasks via ctx.taskSource (the composition-root-wired adapter).
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* Used for both `taskSourceType === "content-lake"` (ContentLakeTaskSource)
|
|
25
|
+
* and `taskSourceType === "repo"` (RepoTaskSource). Filtering by
|
|
26
|
+
* area/task/tag is delegated to the adapter — ContentLakeTaskSource
|
|
27
|
+
* pushes it into the GROQ query, RepoTaskSource applies it in-memory.
|
|
27
28
|
*/
|
|
28
|
-
private
|
|
29
|
+
private loadTasksFromAdapter;
|
|
29
30
|
/**
|
|
30
31
|
* Load tasks from filesystem .task.ts files.
|
|
31
32
|
*
|
|
@@ -209,23 +209,30 @@ export class GenerateConfigsStep {
|
|
|
209
209
|
// Task loading — unified for all modes
|
|
210
210
|
// ---------------------------------------------------------------------------
|
|
211
211
|
async loadTasks(ctx, mode, state) {
|
|
212
|
-
//
|
|
213
|
-
//
|
|
214
|
-
// Studio-owned
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
// Adapter path — use ctx.taskSource. The composition root wires the
|
|
213
|
+
// right adapter for each taskSourceType:
|
|
214
|
+
// - "content-lake" → ContentLakeTaskSource (Studio-owned ailf.task docs)
|
|
215
|
+
// - "repo" → RepoTaskSource (loads .yaml AND .task.ts from repoTasksPath)
|
|
216
|
+
// Routing both through ctx.taskSource keeps the orchestration step
|
|
217
|
+
// file-format-agnostic (W0148: external-consumer evals materialize
|
|
218
|
+
// inline tasks as .yaml, which loadPipelineTasks can't read).
|
|
219
|
+
if (ctx.config.taskSourceType === "content-lake" ||
|
|
220
|
+
ctx.config.taskSourceType === "repo") {
|
|
221
|
+
return this.loadTasksFromAdapter(ctx, state);
|
|
217
222
|
}
|
|
218
|
-
// Filesystem path — load from .task.ts files (
|
|
223
|
+
// Filesystem path — load from .task.ts files (legacy unset path:
|
|
224
|
+
// AILF defaults from tasks/${mode}/ + optional repoTasksPath augment).
|
|
219
225
|
return this.loadTasksFromFilesystem(ctx, mode, state);
|
|
220
226
|
}
|
|
221
227
|
/**
|
|
222
|
-
* Load tasks
|
|
228
|
+
* Load tasks via ctx.taskSource (the composition-root-wired adapter).
|
|
223
229
|
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
230
|
+
* Used for both `taskSourceType === "content-lake"` (ContentLakeTaskSource)
|
|
231
|
+
* and `taskSourceType === "repo"` (RepoTaskSource). Filtering by
|
|
232
|
+
* area/task/tag is delegated to the adapter — ContentLakeTaskSource
|
|
233
|
+
* pushes it into the GROQ query, RepoTaskSource applies it in-memory.
|
|
227
234
|
*/
|
|
228
|
-
async
|
|
235
|
+
async loadTasksFromAdapter(ctx, state) {
|
|
229
236
|
const filter = {
|
|
230
237
|
...(ctx.config.areas?.length ? { areas: ctx.config.areas } : {}),
|
|
231
238
|
...(ctx.config.tasks?.length ? { taskIds: ctx.config.tasks } : {}),
|