@sanity/ailf 0.1.12 → 0.1.13

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.
@@ -271,18 +271,27 @@ export async function executePipeline(cliOpts) {
271
271
  process.exit(1);
272
272
  }
273
273
  const { FileConfigAdapter } = await import("../adapters/config-sources/file-config-adapter.js");
274
+ const { createAppContext } = await import("../composition-root.js");
275
+ const callerCwd = process.env.AILF_CALLER_CWD ?? process.cwd();
274
276
  const adapter = new FileConfigAdapter(cliOpts.config, ROOT);
275
277
  const config = await adapter.resolve();
276
- const ctx = buildAppContext(
277
- // Build a minimal ResolvedOptions to satisfy the bridge.
278
- // FileConfigAdapter already resolved to ResolvedConfig, so we
279
- // pass it through by constructing AppContext directly.
280
- computeResolvedOptions(cliOpts), ROOT);
281
- // Override config with the file-based config
282
- const fileCtx = { ...ctx, config };
278
+ // Merge CLI-only flags that aren't in the config file.
279
+ // The file config (from the API payload) has taskSourceType and other
280
+ // pipeline options, but CLI-only args like --repo-tasks-path and
281
+ // --output are only available from the command line.
282
+ if (cliOpts.repoTasksPath) {
283
+ config.repoTasksPath = resolve(callerCwd, cliOpts.repoTasksPath);
284
+ }
285
+ if (cliOpts.output) {
286
+ config.outputPath = resolve(callerCwd, cliOpts.output);
287
+ }
288
+ // Create AppContext directly from the merged config so adapters
289
+ // (especially taskSource) are wired from the file config's
290
+ // taskSourceType — not from CLI defaults.
291
+ const ctx = createAppContext(config);
283
292
  const pipelineStart = Date.now();
284
- const steps = buildStepSequence(fileCtx, pipelineStart);
285
- const result = await orchestratePipeline(fileCtx, steps);
293
+ const steps = buildStepSequence(ctx, pipelineStart);
294
+ const result = await orchestratePipeline(ctx, steps);
286
295
  writePipelineResult(result);
287
296
  process.exit(result.success ? 0 : 1);
288
297
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ailf",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "restricted"