feat: ignore LaTeX build artifacts and add .olignore support (#19)#20
Merged
feat: ignore LaTeX build artifacts and add .olignore support (#19)#20
Conversation
Closes #19. Local LaTeX compilers (pdflatex/xelatex/lualatex/latexmk/biber/etc.) drop build artifacts next to source files. Previously `olcli sync` happily uploaded these to Overleaf, which would either break Overleaf's compile (stale .aux pinned) or produce wrong PDFs (compiled against stale .bbl instead of regenerating it). This change adds a layered ignore subsystem: 1. Built-in defaults (43 patterns) — LaTeX intermediates, OS noise, common build dirs. Always on, opt out with --no-default-ignore. 2. .olignore — gitignore-style project-level patterns, version controlled, supports negation. 3. .olignore.local — machine-specific, never committed. Special PDF rule: ignore X.pdf only if a same-named X.tex (or .ltx) exists in the same folder. This kills thesis.pdf next to thesis.tex but preserves a hand-uploaded figures/diagram.pdf. New CLI surface: olcli sync --no-default-ignore only .olignore applies olcli sync --no-ignore uploads everything (escape hatch) olcli sync --show-ignored prints what was filtered olcli push --no-default-ignore same flags on push olcli push --no-ignore olcli push --show-ignored olcli ignored [dir] list patterns currently in effect New module: src/ignore.ts (loadIgnore, shouldIgnore, buildTexSiblingSet, DEFAULT_IGNORE_PATTERNS). New dep: ignore (~30KB, zero deps, used by ESLint/Prettier). Tests: test/e2e-ignore.sh — 31 assertions covering defaults, .olignore, .olignore.local, negation, the PDF sibling rule, the --no-* escape hatches, and a real round-trip upload smoke test that verifies ignored files actually do not reach the Overleaf project. Also re-ran test/e2e-issue7.sh: 22/22 still passing.
README: - Features list mentions two-way deletions, delete/rename, smart ignore - Commands table adds 'olcli ignored', notes rm/mv aliases - 'Sync Behavior' section documents deletion-propagation manifest - New 'Ignoring files' section: three layers, PDF special rule, .olignore example, --no-default-ignore / --no-ignore / --show-ignored flags - Push section mentions ignore filtering and --show-ignored SKILL.md: - Bumped metadata version 1.1 → 1.2 - 'Edit and sync changes' shows --no-delete flag - New 'Delete or rename remote files' subsection (delete/rm + rename/mv) - New 'Inspect ignore rules' subsection - Commands table adds delete/rename/ignored - Tips: documents two-way deletes, ignore defaults, PDF rule docs/index.html: - Hero badge bumped v0.1.6 → v0.3.0 - Feature grid: bidirectional sync card mentions deletion propagation - New 'Smart Ignore' feature card
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.
Closes #19.
What
Local LaTeX compilers drop build artifacts (
.aux,.bbl,.log,.fls,.synctex.gz, beamer/biber/glossaries/minted intermediates, …) next to source files. Previouslyolcli syncuploaded these to Overleaf, which would either:.auxpinned), or.bblinstead of regenerating it).This PR adds a layered ignore subsystem to prevent that.
Layered design
--no-default-ignore.olignore(gitignore-style).olignore.localSpecial PDF rule
X.pdfis ignored only if a same-namedX.tex(or.ltx) exists in the same folder. Killsthesis.pdfnext tothesis.texbut preserves a hand-uploadedfigures/diagram.pdf.CLI surface
New code
src/ignore.ts—loadIgnore(),shouldIgnore(),buildTexSiblingSet(),DEFAULT_IGNORE_PATTERNSsrc/cli.ts— wired intoscanDir(push) andscanLocalFiles(sync); newignoredsubcommandignore(~30KB, zero deps, used by ESLint/Prettier)Tests
test/e2e-ignore.sh— 31/31 passing. Covers:olcli ignored--no-default-ignorehides defaults.olignoreloaded with negation support.olignore.localstacks on toppush --dry-runfilters.aux/.bbl/.log/.synctex.gzwhile keeping.texand standalone.pdf.pdfrule fires correctly--no-default-ignorere-enables artifact upload--no-ignorebypasses both defaults and.olignoretest/e2e-issue7.sh(deletion-propagation regression) — 22/22 still passing.Versioning
v0.3.0 — minor bump per pre-1.0 policy: new feature, new file format (
.olignore), new flags.