Skip to content

Commit 6a93276

Browse files
committed
build: enable minification and update manifest
1 parent 77fdce2 commit 6a93276

9 files changed

Lines changed: 14 additions & 121 deletions

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Deterministic local caching of external documentation for agents and tools
44

55
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
66
[![npm version](https://img.shields.io/npm/v/docs-cache)](https://www.npmjs.com/package/docs-cache)
7-
[![size](https://img.shields.io/badge/size-2.2%20kB-blue)](https://github.com/fbosch/docs-cache)
87
[![Audit](https://github.com/fbosch/docs-cache/actions/workflows/audit.yml/badge.svg)](https://github.com/fbosch/docs-cache/actions/workflows/audit.yml)
98

109
## Purpose

build.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ export default defineBuildConfig({
1212
rollup: {
1313
emitCJS: false,
1414
inlineDependencies: ["picocolors"],
15+
esbuild: {
16+
minify: true,
17+
},
1518
},
1619
});

scripts/update-size-badge.mjs

Lines changed: 0 additions & 109 deletions
This file was deleted.

src/manifest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type ManifestEntry = {
77
size: number;
88
};
99

10-
export const MANIFEST_FILENAME = ".manifest.ndjson";
10+
export const MANIFEST_FILENAME = ".manifest.jsonl";
1111

1212
export const readManifest = async (sourceDir: string) => {
1313
const manifestPath = path.join(sourceDir, MANIFEST_FILENAME);

tests/sync-index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ test("sync writes index.json when enabled", async () => {
5858
const outDir = path.join(cacheRoot, sourceId);
5959
await mkdir(outDir, { recursive: true });
6060
await writeFile(
61-
path.join(outDir, ".manifest.ndjson"),
61+
path.join(outDir, ".manifest.jsonl"),
6262
`${JSON.stringify({ path: "README.md", size: 5 })}\n`,
6363
);
6464
await writeFile(path.join(outDir, "README.md"), "hello", "utf8");

tests/sync-materialize.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ test("sync materializes via mocked fetch", async () => {
6363
const outDir = path.join(cacheRoot, sourceId);
6464
await mkdir(outDir, { recursive: true });
6565
await writeFile(
66-
path.join(outDir, ".manifest.ndjson"),
66+
path.join(outDir, ".manifest.jsonl"),
6767
`${JSON.stringify({ path: "README.md", size: 5 })}\n`,
6868
);
6969
await writeFile(path.join(outDir, "README.md"), "hello", "utf8");
@@ -126,7 +126,7 @@ test("sync re-materializes when docs missing even if commit unchanged", async ()
126126

127127
let materialized = false;
128128
let attempt = 0;
129-
const manifestPath = path.join(cacheDir, "local", ".manifest.ndjson");
129+
const manifestPath = path.join(cacheDir, "local", ".manifest.jsonl");
130130
await runSync(
131131
{
132132
configPath,
@@ -283,7 +283,7 @@ test("sync rebuilds corrupt cache when verify fails", async () => {
283283
const outDir = path.join(cacheRoot, sourceId);
284284
await mkdir(outDir, { recursive: true });
285285
await writeFile(
286-
path.join(outDir, ".manifest.ndjson"),
286+
path.join(outDir, ".manifest.jsonl"),
287287
`${JSON.stringify({ path: "README.md", size: 5 })}\n`,
288288
);
289289
await writeFile(path.join(outDir, "README.md"), "hello", "utf8");

tests/sync-offline-fail.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ test("sync offline uses lock entries without resolving remotes", async () => {
9393
const cacheSourceDir = path.join(cacheDir, "local");
9494
await mkdir(cacheSourceDir, { recursive: true });
9595
await writeFile(
96-
path.join(cacheSourceDir, ".manifest.ndjson"),
96+
path.join(cacheSourceDir, ".manifest.jsonl"),
9797
`${JSON.stringify({ path: "README.md", size: 5 })}\n`,
9898
);
9999
await writeFile(path.join(cacheSourceDir, "README.md"), "hello", "utf8");

tests/sync-targets.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ test("sync applies targetDir with copy mode", async () => {
5757
const outDir = path.join(cacheRoot, sourceId);
5858
await mkdir(outDir, { recursive: true });
5959
await writeFile(
60-
path.join(outDir, ".manifest.ndjson"),
60+
path.join(outDir, ".manifest.jsonl"),
6161
`${JSON.stringify({ path: "README.md", size: 5 })}\n`,
6262
);
6363
await writeFile(path.join(outDir, "README.md"), "hello", "utf8");
@@ -121,7 +121,7 @@ test("sync applies targetDir with symlink mode", async () => {
121121
const outDir = path.join(cacheRoot, sourceId);
122122
await mkdir(outDir, { recursive: true });
123123
await writeFile(
124-
path.join(outDir, ".manifest.ndjson"),
124+
path.join(outDir, ".manifest.jsonl"),
125125
`${JSON.stringify({ path: "README.md", size: 5 })}\n`,
126126
);
127127
await writeFile(path.join(outDir, "README.md"), "hello", "utf8");

tests/verify.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test("verify reports missing files", async () => {
1717

1818
await mkdir(sourceDir, { recursive: true });
1919
await writeFile(
20-
path.join(sourceDir, ".manifest.ndjson"),
20+
path.join(sourceDir, ".manifest.jsonl"),
2121
`${JSON.stringify({ path: "README.md", size: 5 })}\n`,
2222
);
2323
await writeFile(
@@ -48,12 +48,12 @@ test("verify checks target manifest for copy mode", async () => {
4848
await mkdir(sourceDir, { recursive: true });
4949
await mkdir(targetDir, { recursive: true });
5050
await writeFile(
51-
path.join(sourceDir, ".manifest.ndjson"),
51+
path.join(sourceDir, ".manifest.jsonl"),
5252
`${JSON.stringify({ path: "README.md", size: 5 })}\n`,
5353
);
5454
await writeFile(path.join(sourceDir, "README.md"), "hello", "utf8");
5555
await writeFile(
56-
path.join(targetDir, ".manifest.ndjson"),
56+
path.join(targetDir, ".manifest.jsonl"),
5757
`${JSON.stringify({ path: "README.md", size: 5 })}\n`,
5858
);
5959
await writeFile(path.join(targetDir, "README.md"), "nope", "utf8");

0 commit comments

Comments
 (0)