@intentic/fileq 1.348.0 → 1.350.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentic/fileq",
3
- "version": "1.348.0",
3
+ "version": "1.350.0",
4
4
  "description": "fileq, agent-native file reading: any binary workspace file (docx, xlsx, pptx, pdf, images, audio, archives) as clean budgeted markdown, cached by content so a repeat read is instant",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -73,11 +73,11 @@
73
73
  }
74
74
  },
75
75
  "dependencies": {
76
- "@intentic/agent-cli": "1.348.0",
77
- "@intentic/base": "1.348.0",
78
- "@intentic/constants": "1.348.0",
79
- "@intentic/webq": "1.348.0",
80
- "@intentic/workspace-ignore": "1.348.0",
76
+ "@intentic/agent-cli": "1.350.0",
77
+ "@intentic/base": "1.350.0",
78
+ "@intentic/constants": "1.350.0",
79
+ "@intentic/webq": "1.350.0",
80
+ "@intentic/workspace-ignore": "1.350.0",
81
81
  "@stricli/core": "1.3.0",
82
82
  "exceljs": "4.4.0",
83
83
  "exifr": "7.1.3",
@@ -1,44 +0,0 @@
1
- import { readdir, readFile } from "node:fs/promises";
2
- import { join } from "node:path";
3
-
4
- // What a fileq run costs before it does anything. `derive.ts` imports all eleven derivers so `read` and `derive`
5
- // cannot disagree about a file, which means one deriver's top-level `import` is paid by every run of the CLI: an
6
- // agent reading a png, a read answered from the cache, `fileq --version`.
7
- // Measured when this guard was written, on the sandbox image: loading these three took ~1.3s of a ~1.4s no-op run,
8
- // and moving them inside `derive()` took `fileq --version` from ~560ms to ~120ms. A file of that format pays the
9
- // same load it always did, once, in the process that actually parses it.
10
- // Re-measure with: `node -e "import('exceljs')"` against the clock, and add anything else of that size here.
11
- const LOAD_LAZILY = ["exceljs", "mammoth", "music-metadata"];
12
-
13
- const HERE = import.meta.dirname;
14
-
15
- const deriverSources = async (): Promise<{ name: string; source: string }[]> => {
16
- const names = (await readdir(HERE)).filter((name) => name.endsWith(".ts") && !name.endsWith(".test.ts"));
17
- return Promise.all(names.map(async (name) => ({ name, source: await readFile(join(HERE, name), "utf8") })));
18
- };
19
-
20
- describe("what a deriver costs to load", () => {
21
- it("keeps the heavy parsers out of every run that does not use them", async () => {
22
- const statik: string[] = [];
23
- for (const { name, source } of await deriverSources()) {
24
- for (const module of LOAD_LAZILY) {
25
- // A value import: `import x from "exceljs"`. `import type` is erased by the compiler and costs nothing,
26
- // and `await import("exceljs")` inside derive() is the whole point.
27
- if (new RegExp(String.raw`^import (?!type )[^;]*from "${module}";`, "m").test(source)) {
28
- statik.push(`${name} → ${module}`);
29
- }
30
- }
31
- }
32
- expect(statik).toEqual([]);
33
- });
34
-
35
- // The same rule read from the other side: each of those parsers is still reachable, just later. A deriver that
36
- // dropped its parser entirely would pass the test above by doing nothing at all.
37
- it("still loads each of them where its own format is parsed", async () => {
38
- const sources = await deriverSources();
39
- for (const module of LOAD_LAZILY) {
40
- const users = sources.filter(({ source }) => source.includes(`await import("${module}")`));
41
- expect({ module, users: users.length }).toEqual({ module, users: 1 });
42
- }
43
- });
44
- });