Skip to content

Commit 1754375

Browse files
authored
refactor: Rename lock file to docs-lock.json (#16)
* refactor(lock): rename lock file to docs-lock.json * fix: missing lock fixture * fix(git): add Path and PATHEXT to env * refactor(git): replace execFileAsync with execa
1 parent a0cb45d commit 1754375

22 files changed

Lines changed: 199 additions & 52 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pnpm-debug.log*
77
npm-debug.log*
88
yarn-debug.log*
99
docs.config.json
10-
docs.lock
10+
/docs-lock.json
1111
coverage
1212
TODO.md
1313
.docs/

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pnpm.
2222
## Cache layout
2323

2424
- Materialized sources live at `.docs/<id>/`.
25-
- Lock file lives next to `docs.config.json` as `docs.lock`.
25+
- Lock file lives next to `docs.config.json` as `docs-lock.json`.
2626

2727
## CLI architecture
2828

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Documentation is cached in a gitignored location, exposed to agent and tool targ
1515
## Features
1616

1717
- **Local only**: Cache lives in the directory `.docs` (or a custom location) and _should_ be gitignored.
18-
- **Deterministic**: `docs.lock` pins commits and file metadata.
18+
- **Deterministic**: `docs-lock.json` pins commits and file metadata.
1919
- **Fast**: Local cache avoids network roundtrips after sync.
2020
- **Flexible**: Cache full repos or just the subdirectories you need.
2121

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"dependencies": {
5959
"@clack/prompts": "^1.0.0",
6060
"cac": "^6.7.14",
61+
"execa": "^9.6.1",
6162
"fast-glob": "^3.3.2",
6263
"picocolors": "^1.1.1",
6364
"picomatch": "^2.3.1",

pnpm-lock.yaml

Lines changed: 121 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/benchmarks/run.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
verifyCache,
1919
} from "../../dist/api.mjs";
2020
import {
21+
DEFAULT_LOCK_FILENAME,
2122
readLock,
2223
resolveLockPath,
2324
validateLock,
@@ -286,7 +287,7 @@ const main = async () => {
286287
() => {
287288
const tempLock = path.join(
288289
benchRoot,
289-
`docs.lock.${Math.random().toString(36).slice(2)}`,
290+
`${DEFAULT_LOCK_FILENAME}.${Math.random().toString(36).slice(2)}`,
290291
);
291292
return writeLock(tempLock, lockData);
292293
},

src/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export { loadConfig } from "./config";
55
export { redactRepoUrl } from "./git/redact";
66
export { enforceHostAllowlist, parseLsRemote } from "./git/resolve-remote";
77
export { initConfig } from "./init";
8+
export { DEFAULT_LOCK_FILENAME } from "./lock";
89
export { pruneCache } from "./prune";
910
export { removeSources } from "./remove";
1011
export { resolveRepoInput } from "./resolve-repo";

0 commit comments

Comments
 (0)