@akanjs/devkit 3.3.0-rc.45 → 3.3.0-rc.47

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/CHANGELOG.md CHANGED
@@ -417,6 +417,14 @@
417
417
  - f678e80: The skills no longer repeat the path rule an agent has already loaded for the same files: `akan-query` points at the `module` rule for its musts (500 rows, soft removal, hookless writes, secret projections, cascade direction), `akan-transport` at the `auth` rule for guards and drops what the `server` rule says about body types, the 30-second default deadline and remote errors, `akan-service`, `akan-err` and `akan-mcp` at the `server` rule, and `akan-ui`, `cssRule` and `componentRule` at the `style` rule for class order and the colour vocabulary. The `server` rule drops its in-page agent line, which the `akan-agent` skill already holds and which no service, signal or document file needs. Run `akan agent install` in a workspace to pick up the new files.
418
418
  - ce430ed: A coding agent reads less before its first page: the generated AGENTS.md is about 9% smaller, leaving to the path rules what they already say while still naming every check that breaks the build, and it now says that `i18n: { localePrefix: "as-needed" }` in `akan.config.ts` serves URLs without `/<locale>/`. The `akan-page` skill now holds the guard basics, the first-render `searchParams` snapshot and Link prefetch, so `pageRule` keeps only the deeper contract (12 KB to 7 KB), and the `@akanjs/cli` README tells an agent to read the workspace's `AGENTS.md`, rules and skills rather than the package's `guidelines/` folder. Run `akan agent install` in a workspace to pick up the new files.
419
419
  - c44d068: A coding agent reads less to build its first app: the `akanjs` README keeps the path to a first app and links the rest on akanjs.com (17 KB to 7 KB), the `akan-page` and `akan-service` skills ship the API reference one section at a time with every entry named in the skill's index (`Link` now lists the anchor attributes it takes and `Link.Back`, `Link.Close` and `Link.Lang`), the `akan-page` skill holds what a first page looks up while `pageRule` keeps the deeper contract, and each rule is stated once across AGENTS.md, the path rules and the skills. Run `akan agent install` in a workspace to pick up the new files.
420
+ - ad5e1ac: chore(lint): Biome 2.5.15, and `noUnnecessaryConditions` is `warn` again in the base config
421
+
422
+ Biome 2.5.14 read `RegExp.prototype.exec` as never returning null, so `/…/.exec(url)?.[1]` got "Unnecessary optional chaining" and `match ? … : …` got "This condition is always truthy" (biomejs/biome#11278, fixed in 2.5.15). A new workspace now pins `@biomejs/biome` 2.5.15 and its `biome.json` names the 2.5.15 schema, and the base config keeps the rule at `warn` as in 3.2.0. An existing workspace gets the fix by setting `@biomejs/biome` to 2.5.15 in its root `package.json` and the `$schema` in `biome.json` to `https://biomejs.dev/schemas/2.5.15/schema.json`.
423
+
424
+ 2.5.15 also knows the global `Array` type, so `useArraySortCompare` (on at `warn` through the base config's `types` domain) now reports a `.sort()` or `.toSorted()` with no compare function on any array, `Object.keys(…).sort()` included. `(a, b) => (a < b ? -1 : a > b ? 1 : 0)` keeps the order the default sort gives a string array.
425
+
426
+ `akan lint-all` now runs Biome once over every app, lib and package, then each target's own gates, instead of one Biome run per target at once. Each run scans the whole workspace for the type-aware rules, about 1.6 GB apiece on Biome 2.5.15 (1.0 GB on 2.5.14), so this repository's 13 parallel runs no longer fit a 16 GB Linux runner: the kernel killed some of them, and the npm wrapper reported the killed run as exit 0 with no output. One run here peaks under 3 GB and finishes in about 17 s. `BiomeCheck.run` takes `targets: string[]` in place of `target`.
427
+
420
428
  - 22791e7: A production page loads fewer, larger client files: the client entries exactly the same routes load are built as one.
421
429
 
422
430
  `akan build` gave every `"use client"` file, and every export of one it takes apart, an entry of its own. The bundler puts a module in a chunk of its own for every different set of entries that reach it, so an app with several hundred entries ended with hundreds of small files per page, many under 1 KB, where a file is served uncompressed. Entries that the same set of routes loads are now one entry, so what only they reach is one chunk. Entries any other set of routes loads stay apart, and a route still downloads nothing it did not download before.
@@ -511,14 +519,6 @@
511
519
 
512
520
  **Upgrading.** A failed `akan lint` now exits with 3, the code of a failed check, where it exited with 1. A script that tests for a non-zero exit needs no change; one that tests for exactly 1 does. To see what is wrong on a line of an env file, open the file at the position the diagnostic names.
513
521
 
514
- - fa19707: fix(lint): `noUnnecessaryConditions` is off in the base Biome config
515
-
516
- Biome 2.5.14 reads `RegExp.prototype.exec` as never returning null, so a workspace got "Unnecessary optional chaining"
517
- on `/…/.exec(url)?.[1]` and "This condition is always truthy" on `match ? … : …`. The fix it offers, `?.` to `.`,
518
- throws on every string that does not match, and `akan verify` printed the warning to agents that then tried to fix
519
- it. A workspace that wants the rule back sets `"noUnnecessaryConditions": "warn"` under `linter.rules.suspicious` in
520
- its own `biome.json`.
521
-
522
522
  - 537d28e: The first `akan sync` of a new checkout writes the client runtime files a second one used to, so the first production build of a clean tree loads its routes per module.
523
523
 
524
524
  - **The files under `lib/__client` are written after every scope's `lib/cnst.ts`.** They were written beside it, and on a tree with no generated files a module whose signal names another lib's constants as `cnst.<lib>.X` got a fetch file that imports the scope's whole constant barrel. A build of that tree measured the per-module runtime as larger and kept the whole client runtime on every route. On a real workspace of nine libs, 21 fetch files were written that way by the first sync and none by the second; the first build of a clean tree said `0 routes load per module, 235 keep the whole runtime`, and now says `235 routes load per module`, as its second build did.
@@ -619,6 +619,7 @@
619
619
  - Updated dependencies [19c6fa7]
620
620
  - Updated dependencies [217b061]
621
621
  - Updated dependencies [c7dee50]
622
+ - Updated dependencies [9a3e6b0]
622
623
  - Updated dependencies [c30e4df]
623
624
  - Updated dependencies [0baacae]
624
625
  - Updated dependencies [e704d16]
package/biome.base.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.5.15/schema.json",
3
3
  "vcs": {
4
4
  "enabled": true,
5
5
  "clientKind": "git",
@@ -24,7 +24,9 @@
24
24
  },
25
25
  "noArrayIndexKey": "off",
26
26
  "noShadowRestrictedNames": "off",
27
- "noUnnecessaryConditions": "off"
27
+ "noUnnecessaryConditions": {
28
+ "level": "warn"
29
+ }
28
30
  },
29
31
  "correctness": {
30
32
  "noUnusedFunctionParameters": "off",
@@ -360,7 +360,7 @@ describe.skipIf(!enabled)("dev HMR latency (minimal)", () => {
360
360
  report.consecutive = {
361
361
  latencies,
362
362
  median: median(latencies),
363
- shown: Object.keys(seen).sort(),
363
+ shown: Object.keys(seen).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)),
364
364
  settledAfterLastSave: (seen.c9 ?? 0) - (writtenAt.at(-1) ?? 0),
365
365
  };
366
366
  expect(await harness().reloaded()).toBe(false);
@@ -149,20 +149,28 @@ export class Executor {
149
149
  const readPath = this.getPath(dirPath);
150
150
  try {
151
151
  const glob = new Bun.Glob("*");
152
- return Array.from(glob.scanSync({ cwd: readPath, onlyFiles: false })).sort();
152
+ return Array.from(glob.scanSync({ cwd: readPath, onlyFiles: false })).sort((a, b) =>
153
+ a < b ? -1 : a > b ? 1 : 0,
154
+ );
153
155
  } catch {
154
156
  return [];
155
157
  }
156
158
  }
157
159
  async getAllFiles(pattern = "**/*", { cwd }: { cwd?: string } = {}): Promise<string[]> {
158
160
  const glob = new Bun.Glob(pattern);
159
- return Array.from(glob.scanSync({ cwd: cwd ?? this.cwdPath, onlyFiles: true })).sort();
161
+ return Array.from(glob.scanSync({ cwd: cwd ?? this.cwdPath, onlyFiles: true })).sort((a, b) =>
162
+ a < b ? -1 : a > b ? 1 : 0,
163
+ );
160
164
  }
161
165
  async getFilesAndDirs(dirPath: string): Promise<{ files: string[]; dirs: string[] }> {
162
166
  const fullDirPath = this.getPath(dirPath);
163
167
  const glob = new Bun.Glob("*");
164
- const files = Array.from(glob.scanSync({ cwd: fullDirPath, onlyFiles: true })).sort();
165
- const allEntries = Array.from(glob.scanSync({ cwd: fullDirPath, onlyFiles: false })).sort();
168
+ const files = Array.from(glob.scanSync({ cwd: fullDirPath, onlyFiles: true })).sort((a, b) =>
169
+ a < b ? -1 : a > b ? 1 : 0,
170
+ );
171
+ const allEntries = Array.from(glob.scanSync({ cwd: fullDirPath, onlyFiles: false })).sort((a, b) =>
172
+ a < b ? -1 : a > b ? 1 : 0,
173
+ );
166
174
  const dirs = allEntries.filter((entry) => !files.includes(entry));
167
175
  return { files, dirs };
168
176
  }
@@ -298,7 +298,10 @@ describe("route client store bootstrap", () => {
298
298
  expect(first.newEntries).toEqual([entryA, entryB]);
299
299
  expect(first.discoveredEntries).toEqual([entryA]);
300
300
  expect(first.clientDeps).not.toContain(entryB);
301
- expect(Object.keys(first.clientDepsByEntry ?? {}).sort()).toEqual([entryA, entryB]);
301
+ expect(Object.keys(first.clientDepsByEntry ?? {}).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))).toEqual([
302
+ entryA,
303
+ entryB,
304
+ ]);
302
305
  expect(second.newEntries).toEqual([]);
303
306
  expect(second.discoveredEntries).toEqual([entryB]);
304
307
  expect(Object.keys(second.manifestDelta)).toEqual([]);
@@ -823,7 +826,12 @@ export const getSerializedSignalOf = (name: string) => (name === "base" ? {} : {
823
826
  )
824
827
  ).join("\n");
825
828
  const idOf = (name: string) => manifestDelta[`apps/demo/ui/Pair.tsx#${name}`]?.id;
826
- return { rows: Object.keys(manifestDelta).sort(), idOf, a: await loadedBy("/a"), b: await loadedBy("/b") };
829
+ return {
830
+ rows: Object.keys(manifestDelta).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)),
831
+ idOf,
832
+ a: await loadedBy("/a"),
833
+ b: await loadedBy("/b"),
834
+ };
827
835
  };
828
836
 
829
837
  const built = await buildAs("build");
@@ -875,7 +883,12 @@ export const getSerializedSignalOf = (name: string) => (name === "base" ? {} : {
875
883
  return (loaded[row?.name ?? ""] as () => string)();
876
884
  };
877
885
  const onServer = (key: string) => ssrManifestDelta.moduleMap[rowOf(key)?.id ?? ""]?.[rowOf(key)?.name ?? ""];
878
- return { rows: Object.keys(manifestDelta).sort(), rowOf, answered, onServer };
886
+ return {
887
+ rows: Object.keys(manifestDelta).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)),
888
+ rowOf,
889
+ answered,
890
+ onServer,
891
+ };
879
892
  };
880
893
  const keys = ["One.tsx#default", "Solo.tsx#Solo", "Two.tsx#default"];
881
894
 
@@ -110,7 +110,7 @@ export class GraphClientEntryDiscovery implements ClientEntryDiscovery {
110
110
  const walk: DiscoveryWalk = { visiting: new Set(), partial: new Set(), memo: new Map(), importsAs, reachable };
111
111
  for (const entry of await this.#discoverFromFile(seed, walk)) entries.add(entry);
112
112
  }
113
- return Array.from(entries).sort();
113
+ return Array.from(entries).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
114
114
  }
115
115
 
116
116
  //? Without `byExport`, and never beyond it, this is what `discover` answers.
@@ -110,7 +110,7 @@ export class CsrDevArtifactWriter {
110
110
  async writeVendor(graph: CsrDevGraph): Promise<string> {
111
111
  const ids = Object.keys(graph.modules)
112
112
  .filter((id) => graph.modules[id]?.vendor)
113
- .sort();
113
+ .sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
114
114
  const stubs = new Set(Object.values(graph.modules).flatMap((module) => module.deps.filter(CsrDevPaths.isStub)));
115
115
  const lines = [await this.#helperDefinitions(graph, ids), ...(await this.#defineLines(ids))];
116
116
  for (const stub of [...stubs].sort()) {
@@ -138,7 +138,7 @@ export class CsrDevArtifactWriter {
138
138
  ): Promise<void> {
139
139
  const ids = Object.keys(graph.modules)
140
140
  .filter((id) => !graph.modules[id]?.vendor)
141
- .sort();
141
+ .sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
142
142
  const lines = await this.#defineLines(ids, code);
143
143
  const blocks = ids.map((id, index) => [id, lines[index] ?? ""] as [string, string]);
144
144
  const start = this.#library
@@ -350,7 +350,7 @@ describe("CsrDevPatcher", () => {
350
350
  await Bun.write(file("ui/C.tsx"), 'export const C = () => "c2";\n');
351
351
  expect(changedIds(await patcher.update([file("ui/C.tsx")]))).toEqual(["apps/demo/ui/C.tsx"]);
352
352
  const graph = (await bundler.writer.readJson<CsrDevGraph>("graph.json")) as CsrDevGraph;
353
- expect(Object.keys(graph.modules).sort()).toEqual([
353
+ expect(Object.keys(graph.modules).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))).toEqual([
354
354
  "apps/demo/entry.ts",
355
355
  "apps/demo/ui/C.tsx",
356
356
  "apps/demo/ui/I.tsx",
@@ -52,7 +52,7 @@ describe("DevBarrelImports", () => {
52
52
  expect(Object.keys(server?.narrowed ?? {})).toEqual([key]);
53
53
  expect(server?.narrowed[key]?.names).toEqual(["@server", "Zone.View"]);
54
54
  expect(client?.narrowed[key]?.names).toEqual(["@client", "Zone.View"]);
55
- expect(Object.keys((await stamp())?.read ?? {}).sort()).toEqual([
55
+ expect(Object.keys((await stamp())?.read ?? {}).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))).toEqual([
56
56
  "lib/memo",
57
57
  "lib/memo/Memo.Template.tsx",
58
58
  "lib/memo/Memo.Zone.tsx",
@@ -114,7 +114,7 @@ describe("DevBarrelImports", () => {
114
114
  'import { Text as Field$Text } from "../ui/Field/Text.tsx";\nexport const Page = () => <Field$Text />;\n',
115
115
  );
116
116
  expect(rewrite?.narrowed[key]?.names).toEqual(["@server", "Text"]);
117
- expect(Object.keys(before?.read ?? {}).sort()).toEqual([
117
+ expect(Object.keys(before?.read ?? {}).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))).toEqual([
118
118
  "ui",
119
119
  "ui/Field",
120
120
  "ui/Field/Text.tsx",
@@ -322,7 +322,12 @@ describe("DictionaryAssetBuilder", () => {
322
322
  expect(merged[group]).toEqual(page.default[group]);
323
323
  expect(merged.util).toBeUndefined();
324
324
  }
325
- expect(Object.keys(table.default).sort()).toEqual(["base", "memo", "user", "util"]);
325
+ expect(Object.keys(table.default).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))).toEqual([
326
+ "base",
327
+ "memo",
328
+ "user",
329
+ "util",
330
+ ]);
326
331
  expect(built.routes?.["/:lang/memo"]).not.toContain(table.default.util);
327
332
  expect(built.routes?.["/:lang/user"]).not.toContain(table.default.util);
328
333
  }
@@ -25,6 +25,10 @@ const execProbe = `export const idOf = (url: string) => {
25
25
  return match ? Number(match[1]) : 0;
26
26
  };
27
27
  export const idOfChained = (url: string) => Number(/\\/(\\d+)\\/?$/.exec(url)?.[1] ?? 0);
28
+ export const always = (n: number) => {
29
+ const label = "x";
30
+ return label ? n : 0;
31
+ };
28
32
  `;
29
33
 
30
34
  const tempDirs: string[] = [];
@@ -44,14 +48,14 @@ const runBiome = (args: string[], cwd: string) =>
44
48
  proc.on("close", () => resolve(stdout || stderr));
45
49
  });
46
50
 
47
- const lintWorkspace = async (files: string[], probe = hookProbe, config: object = { extends: [biomeBaseConfig] }) => {
51
+ const lintWorkspace = async (files: string[], probe = hookProbe) => {
48
52
  const dir = await mkdtemp(path.join(os.tmpdir(), "biome-base-"));
49
53
  tempDirs.push(dir);
50
54
  //? The base config names its plugins as `./node_modules/@akanjs/devkit/…`, resolved from the extending config's
51
55
  //? folder. A junction needs no privilege on Windows, and the type is ignored elsewhere.
52
56
  await mkdir(path.join(dir, "node_modules", "@akanjs"), { recursive: true });
53
57
  await symlink(devkitDir, path.join(dir, "node_modules", "@akanjs", "devkit"), "junction");
54
- await writeFile(path.join(dir, "biome.json"), JSON.stringify(config));
58
+ await writeFile(path.join(dir, "biome.json"), JSON.stringify({ extends: [biomeBaseConfig] }));
55
59
  for (const file of files) {
56
60
  await mkdir(path.dirname(path.join(dir, file)), { recursive: true });
57
61
  await writeFile(path.join(dir, file), probe);
@@ -83,16 +87,11 @@ describe("biome.base.json", () => {
83
87
  ]);
84
88
  });
85
89
 
86
- test("leaves a null check on RegExp.exec alone, which Biome reads as never null", async () => {
87
- const unnecessary = (diagnostics: Awaited<ReturnType<typeof lintWorkspace>>) =>
88
- diagnostics.filter((diagnostic) => diagnostic.category === "lint/suspicious/noUnnecessaryConditions").length;
89
-
90
- expect(unnecessary(await lintWorkspace(["apps/demo/common/idOf.ts"], execProbe))).toBe(0);
91
-
92
- //? Pins the Biome 2.5.14 misreading: once this is 0, the base config can turn the rule back on.
93
- const ruleOnly = {
94
- linter: { rules: { recommended: false, suspicious: { noUnnecessaryConditions: "warn" } } },
95
- };
96
- expect(unnecessary(await lintWorkspace(["apps/demo/common/idOf.ts"], execProbe, ruleOnly))).toBe(2);
90
+ test("warns on an always-true condition but not on a null check of RegExp.exec", async () => {
91
+ const diagnostics = await lintWorkspace(["apps/demo/common/idOf.ts"], execProbe);
92
+ const unnecessary = diagnostics
93
+ .filter((diagnostic) => diagnostic.category === "lint/suspicious/noUnnecessaryConditions")
94
+ .map((diagnostic) => `${diagnostic.location?.start?.line} ${diagnostic.severity}`);
95
+ expect(unnecessary).toEqual(["8 warning"]);
97
96
  });
98
97
  });
package/lint/biomeBase.ts CHANGED
@@ -3,4 +3,4 @@ export const biomeBaseConfig = "@akanjs/devkit/biome.base.json";
3
3
 
4
4
  // Pinned: Biome moves rules between groups across minors and a stale position is a hard config error. Bump it with
5
5
  // `biome.base.json` in one commit, running `biome migrate --write` in the workspace root and in this package.
6
- export const biomeVersion = "2.5.14";
6
+ export const biomeVersion = "2.5.15";
@@ -27,11 +27,14 @@ const workspace = async () => {
27
27
  return root;
28
28
  };
29
29
 
30
- const run = async (root: string, options: { write: boolean; maxDiagnostics: number }) => {
30
+ const run = async (
31
+ root: string,
32
+ { targets = ["apps/demo"], ...options }: { write: boolean; maxDiagnostics: number; targets?: string[] },
33
+ ) => {
31
34
  const printed: string[] = [];
32
35
  const error = await BiomeCheck.run({
33
36
  root,
34
- target: path.join(root, "apps/demo"),
37
+ targets: targets.map((target) => path.join(root, target)),
35
38
  configPath: path.join(root, "biome.json"),
36
39
  print: (text) => printed.push(text),
37
40
  ...options,
@@ -76,6 +79,20 @@ describe.skipIf(!hasBiome)("BiomeCheck", () => {
76
79
  expect(capped.error).not.toBeNull();
77
80
  }, 60_000);
78
81
 
82
+ test("checks every target it is given in one run", async () => {
83
+ const root = await workspace();
84
+ await writeText(path.join(root, "apps/demo/env/env.server.main.ts"), "export const env = {};\n");
85
+ await writeText(path.join(root, "libs/shared/ui/badge.ts"), "export const badge: any = 1;\n");
86
+ const { output, error } = await run(root, {
87
+ write: false,
88
+ maxDiagnostics: 0,
89
+ targets: ["apps/demo", "libs/shared"],
90
+ });
91
+ expect(output).toContain("export const card: any = 1;");
92
+ expect(output).toContain("export const badge: any = 1;");
93
+ expect(error?.message).toBe("Lint found 2 errors.");
94
+ }, 60_000);
95
+
79
96
  test("explains a biome.json Biome cannot read, in Biome's own words", async () => {
80
97
  const root = await workspace();
81
98
  await writeText(path.join(root, "biome.json"), '{ // a comment\n "vcs": { "enabled": false } }');
@@ -4,7 +4,7 @@ import { WithheldEnvFile } from "./withheldEnvFile";
4
4
 
5
5
  export interface BiomeCheckOptions {
6
6
  root: string;
7
- target: string;
7
+ targets: string[];
8
8
  configPath: string | null;
9
9
  write: boolean;
10
10
  //? 0 shows every diagnostic.
@@ -20,7 +20,7 @@ export class BiomeCheck {
20
20
  // biome-ignore lint/suspicious/noControlCharactersInRegex: an ANSI colour sequence starts with the escape character
21
21
  static readonly #colour = /\u001b\[[0-9;]*m/g;
22
22
 
23
- static async run({ root, target, configPath, write, maxDiagnostics, print }: BiomeCheckOptions) {
23
+ static async run({ root, targets, configPath, write, maxDiagnostics, print }: BiomeCheckOptions) {
24
24
  const [biome, ...biomeArgs] = Linter.biomeCommand(root);
25
25
  //? Pinned: without it a malformed biome.json makes Biome fall back to discovery and name the wrong file.
26
26
  const config = configPath ? ["--config-path", configPath] : [];
@@ -34,7 +34,7 @@ export class BiomeCheck {
34
34
  "--max-diagnostics=none",
35
35
  "--no-errors-on-unmatched",
36
36
  ...config,
37
- target,
37
+ ...targets,
38
38
  ],
39
39
  { cwd: root, stdout: "pipe", stderr: "pipe" },
40
40
  );
@@ -82,17 +82,22 @@ describe("parseBiomeReport", () => {
82
82
  });
83
83
 
84
84
  describe("Linter", () => {
85
- test.skipIf(!hasBiome || process.platform === "win32")("runs Biome where no node is on PATH", async () => {
86
- const pathBefore = process.env.PATH;
87
- process.env.PATH = path.join(tmpdir(), "akan-path-without-node");
88
- try {
89
- const { results, errors } = await new Linter(import.meta.dir).lintFile(path.join(import.meta.dir, "linter.ts"));
90
- expect(results).toHaveLength(1);
91
- expect(errors).toEqual([]);
92
- } finally {
93
- process.env.PATH = pathBefore;
94
- }
95
- });
85
+ //? Biome 2.5.15 scans the whole repository before it lints the file: about 6 s on a 4-core Linux runner.
86
+ test.skipIf(!hasBiome || process.platform === "win32")(
87
+ "runs Biome where no node is on PATH",
88
+ async () => {
89
+ const pathBefore = process.env.PATH;
90
+ process.env.PATH = path.join(tmpdir(), "akan-path-without-node");
91
+ try {
92
+ const { results, errors } = await new Linter(import.meta.dir).lintFile(path.join(import.meta.dir, "linter.ts"));
93
+ expect(results).toHaveLength(1);
94
+ expect(errors).toEqual([]);
95
+ } finally {
96
+ process.env.PATH = pathBefore;
97
+ }
98
+ },
99
+ 30_000,
100
+ );
96
101
 
97
102
  test("splits path arguments into batches that stay under the command-line budget", () => {
98
103
  const args = Array.from({ length: 10 }, (_, idx) => `apps/demo/lib/file${idx}.ts`);
@@ -74,7 +74,11 @@ describe("DesktopServerStage", () => {
74
74
 
75
75
  const { dependencies } = DesktopServerStage.packageJson(config, built);
76
76
 
77
- expect(Object.keys(dependencies ?? {}).sort()).toEqual(["@external/runtime", "react", "react-dom"]);
77
+ expect(Object.keys(dependencies ?? {}).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))).toEqual([
78
+ "@external/runtime",
79
+ "react",
80
+ "react-dom",
81
+ ]);
78
82
  for (const driver of drivers) expect(Object.keys(built.dependencies ?? {})).toContain(driver);
79
83
  });
80
84
 
@@ -176,7 +180,10 @@ describe("DesktopServerStage", () => {
176
180
 
177
181
  expect(spawned).toEqual([[process.execPath, ["install", "--production", "--prefer-offline"], { cwd: stage.dir }]]);
178
182
  const installed = (await Bun.file(path.join(stage.dir, "package.json")).json()) as PackageJson;
179
- expect(Object.keys(installed.dependencies ?? {}).sort()).toEqual(["react", "react-dom"]);
183
+ expect(Object.keys(installed.dependencies ?? {}).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))).toEqual([
184
+ "react",
185
+ "react-dom",
186
+ ]);
180
187
  });
181
188
 
182
189
  test("an omitted package another dependency still installs stops the stage, naming who needs it", async () => {
@@ -27,7 +27,7 @@ export class NativePublicEnv {
27
27
  return Object.fromEntries(
28
28
  Object.keys(env)
29
29
  .filter((key) => key.startsWith("AKAN_PUBLIC_") && !NativePublicEnv.derivedKeys.includes(key))
30
- .sort()
30
+ .sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
31
31
  .map((key) => [key, String(env[key])]),
32
32
  );
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/devkit",
3
- "version": "3.3.0-rc.45",
3
+ "version": "3.3.0-rc.47",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -50,7 +50,7 @@
50
50
  "./workspace/getRelatedCnsts": "./workspace/getRelatedCnsts.ts"
51
51
  },
52
52
  "dependencies": {
53
- "@akanjs/language": "3.3.0-rc.45",
53
+ "@akanjs/language": "3.3.0-rc.47",
54
54
  "@earendil-works/pi-agent-core": "1.5.2",
55
55
  "@earendil-works/pi-ai": "1.5.2",
56
56
  "@earendil-works/pi-codemode": "1.5.2",
@@ -59,7 +59,7 @@
59
59
  "@earendil-works/pi-tui": "1.5.2",
60
60
  "@inquirer/prompts": "^8.7.3",
61
61
  "@tailwindcss/node": "^4.3.3",
62
- "akanjs": "3.3.0-rc.45",
62
+ "akanjs": "3.3.0-rc.47",
63
63
  "chalk": "^6.0.1",
64
64
  "commander": "^15.0.0",
65
65
  "dayjs": "^1.11.23",
@@ -17,7 +17,7 @@ const framework = {
17
17
  const pinsOf = (files: Record<string, string>) => {
18
18
  const all: Record<string, string> = { ...framework, ...files };
19
19
  const reach = new RuntimeMarkerReach(root, (absPath) => all[absPath.slice(root.length + 1)] ?? null);
20
- return reach.pinsOf(Object.keys(files).sort());
20
+ return reach.pinsOf(Object.keys(files).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)));
21
21
  };
22
22
  const relationChain = [
23
23
  "akanjs/ui/Field/index.tsx",
@@ -534,7 +534,11 @@ describe("ObjectMemberImports on an object that copies an imported one in", () =
534
534
  });
535
535
 
536
536
  const inputs = Object.keys(built.metafile?.inputs ?? {}).map((input) => path.relative(root, path.resolve(input)));
537
- expect(inputs.sort()).toEqual(["page/_index.tsx", "ui/Field/Text.tsx", "wrap/Label.tsx"]);
537
+ expect(inputs.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))).toEqual([
538
+ "page/_index.tsx",
539
+ "ui/Field/Text.tsx",
540
+ "wrap/Label.tsx",
541
+ ]);
538
542
  });
539
543
  });
540
544
 
@@ -514,7 +514,7 @@ describe("a build planned over the bundle that loads the whole runtime everywher
514
514
  routes: ["/read"],
515
515
  });
516
516
  expect([...target.keep([uiFile("Side")], { ...measured, route: "/side" })].sort()).toEqual(
517
- Object.keys(files).sort(),
517
+ Object.keys(files).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)),
518
518
  );
519
519
  });
520
520
 
@@ -534,7 +534,7 @@ describe("a build planned over the bundle that loads the whole runtime everywher
534
534
  ]);
535
535
  expect(mixed.target.takenFromPieces(`${root}/apps/demo/lib/st.ts`)).toBeNull();
536
536
  const everyWhole = plan({ files, entries, routes: { "/run": [uiFile("Run"), uiFile("Card")] } });
537
- expect(everyWhole.kept).toEqual(entries.sort());
537
+ expect(everyWhole.kept).toEqual(entries.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)));
538
538
  expect(everyWhole.target.takenFromPieces(whole)).toBeNull();
539
539
  });
540
540
 
@@ -98,7 +98,7 @@ export class SlicePlanner {
98
98
  } as PackageJson;
99
99
  const pruned = Object.keys({ ...rootPackageJson.dependencies, ...rootPackageJson.devDependencies })
100
100
  .filter((name) => !keep.has(name))
101
- .sort();
101
+ .sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
102
102
  return { packageJson, pruned, warnings: [] as string[] };
103
103
  }
104
104