Skip to content

Add execute.md support and per-item frontmatter sources for execute operations#7

Closed
antfu wants to merge 2 commits intomainfrom
codex/add-execution-layer-for-multiple-action-sources-5rc35d
Closed

Add execute.md support and per-item frontmatter sources for execute operations#7
antfu wants to merge 2 commits intomainfrom
codex/add-execution-layer-for-multiple-action-sources-5rc35d

Conversation

@antfu
Copy link
Owner

@antfu antfu commented Mar 5, 2026

Motivation

  • Enable users to author execute operations in a simple execute.md alongside execute.yml and derive per-item operations from tracked markdown frontmatter.
  • Surface parsing warnings to the CLI so users are informed about malformed or unrecognized execute.md lines.

Description

  • Added EXECUTE_MD_FILE_NAME constant and EXECUTE_MD_FILE_PLACEHOLDER, and ensure execute.md is created by ensureExecuteArtifacts when missing.
  • Implemented execute sources with loadExecuteSources that merges execute.yml, execute.md (via readExecuteMdFile / execute-md-parser), and per-item frontmatter-derived ops (per-item), and exposes writeRemaining for persisting progress.
  • Reworked executePendingChanges to use loadExecuteSources, emit onWarning callbacks for parsing warnings, and call the provided writeRemaining to persist remaining operations.
  • Added parsing utilities (parseExecuteMdLine, md reader/writer, per-item frontmatter diff logic) and tests; updated execute tests and CLI to forward warnings to printer.warn.

Testing

  • Ran the unit test suite with vitest, including new and updated tests: src/execute/index.test.ts, src/execute/schema.test.ts, src/execute/sources.test.ts, src/execute/sources/* tests (execute-md-parser.test.ts, execute-md.test.ts, per-item.test.ts), and they all passed.

Codex Task

@antfu antfu closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant