feat(cli): add mex export (bundle scaffold to a single Markdown file) - #183
Open
abhinav-phi wants to merge 2 commits into
Open
feat(cli): add mex export (bundle scaffold to a single Markdown file)#183abhinav-phi wants to merge 2 commits into
abhinav-phi wants to merge 2 commits into
Conversation
Concatenates every scaffold file the drift scanner discovers (DEFAULT_SCAFFOLD_PATTERNS through findScaffoldFiles) into a single Markdown document with a '## <path>' section header per source file, so what gets exported is exactly what mex check scans. Output goes to stdout by default, or to a path via --out (parent directories created). An empty scaffold fails with the setup guidance. Resolves mex-memory#56
src/export.ts writes one bundle file to a user-specified path — a brand-new file, never scaffold bytes — which is exactly the class the allowlist's own comment carves out. Registered by write call with its exemption, per the rule that a new writer names its scope.
Contributor
Author
|
CI caught this PR violating the wiki-architecture write pin: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #56.
What
mex exportconcatenates the whole scaffold into one Markdown document, for pasting into tools that don't read files well:mex check— reusesfindScaffoldFiles+DEFAULT_SCAFFOLD_PATTERNS, so the export is exactly what the drift scanner sees, never a divergent file list.## <scaffold-relative-path>header, with content trimmed of trailing whitespace so the document stays clean.mex export→ stdout;mex export --out exports/scaffold.md→ file (parent directories created) plus a one-line count report.No scaffold files found. Run: mex setup.Tests
Three cases in
test/export.test.ts: full bundle (headers, content, deterministic order),--outwrite + count report, and missing-scaffold guidance.npm run typecheckgreen.