lat.md 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -131,28 +131,14 @@ export function parseSections(filePath, content, latticeDir) {
131
131
  }
132
132
  return roots;
133
133
  }
134
- const sectionsCache = new Map();
135
- export function loadAllSections(latticeDir) {
136
- const noCache = !!process.env._LAT_TEST_DISABLE_FS_CACHE;
137
- const key = resolve(latticeDir);
138
- if (!noCache) {
139
- const cached = sectionsCache.get(key);
140
- if (cached)
141
- return cached;
134
+ export async function loadAllSections(latticeDir) {
135
+ const files = await listLatticeFiles(latticeDir);
136
+ const all = [];
137
+ for (const file of files) {
138
+ const content = await readFile(file, 'utf-8');
139
+ all.push(...parseSections(file, content, latticeDir));
142
140
  }
143
- const result = (async () => {
144
- const files = await listLatticeFiles(latticeDir);
145
- const all = [];
146
- for (const file of files) {
147
- const content = await readFile(file, 'utf-8');
148
- all.push(...parseSections(file, content, latticeDir));
149
- }
150
- return all;
151
- })();
152
- if (!noCache) {
153
- sectionsCache.set(key, result);
154
- }
155
- return result;
141
+ return all;
156
142
  }
157
143
  export function flattenSections(sections) {
158
144
  const result = [];
@@ -2,10 +2,6 @@
2
2
  * Walk a directory tree respecting .gitignore rules. Returns relative paths
3
3
  * of all non-ignored files, excluding .git/ and dotfiles (e.g. .gitignore).
4
4
  *
5
- * Results are memoized by resolved directory path — safe because CLI commands
6
- * don't modify the filesystem during a run. Set _LAT_TEST_DISABLE_FS_CACHE=1
7
- * to bypass caching in tests that mutate the filesystem mid-run.
8
- *
9
5
  * This is the single entry point for all directory walking in lat.md — both
10
6
  * code-ref scanning and lat.md/ index validation use it so .gitignore rules
11
7
  * are consistently honored.
package/dist/src/walk.js CHANGED
@@ -1,32 +1,16 @@
1
- import { resolve } from 'node:path';
2
1
  // @ts-expect-error -- no type declarations
3
2
  import walk from 'ignore-walk';
4
- const cache = new Map();
5
3
  /**
6
4
  * Walk a directory tree respecting .gitignore rules. Returns relative paths
7
5
  * of all non-ignored files, excluding .git/ and dotfiles (e.g. .gitignore).
8
6
  *
9
- * Results are memoized by resolved directory path — safe because CLI commands
10
- * don't modify the filesystem during a run. Set _LAT_TEST_DISABLE_FS_CACHE=1
11
- * to bypass caching in tests that mutate the filesystem mid-run.
12
- *
13
7
  * This is the single entry point for all directory walking in lat.md — both
14
8
  * code-ref scanning and lat.md/ index validation use it so .gitignore rules
15
9
  * are consistently honored.
16
10
  */
17
11
  export function walkEntries(dir) {
18
- const noCache = !!process.env._LAT_TEST_DISABLE_FS_CACHE;
19
- if (!noCache) {
20
- const cached = cache.get(resolve(dir));
21
- if (cached)
22
- return cached;
23
- }
24
- const result = walk({
12
+ return walk({
25
13
  path: dir,
26
14
  ignoreFiles: ['.gitignore'],
27
15
  }).then((entries) => entries.filter((e) => !e.startsWith('.git/') && !e.startsWith('.')));
28
- if (!noCache) {
29
- cache.set(resolve(dir), result);
30
- }
31
- return result;
32
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lat.md",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "A knowledge graph for your codebase, written in markdown",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.30.2",