@akanjs/devkit 3.3.0-rc.65 → 3.3.0-rc.66

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: akan-deps
3
- description: "Fix an import, dependency, or barrel problem in an Akan workspace — barrels are generated, and a third-party package may not be imported from most files."
3
+ description: "Fix an import, dependency, or barrel problem, or a file akan sync refuses, in an Akan workspace — barrels are generated, and a third-party package may not be imported from most files."
4
4
  ---
5
5
 
6
6
  # Akan imports, deps and barrels
@@ -16,6 +16,12 @@ contents.
16
16
  or `repair_generated`. A `ui/<Folder>/index.tsx` that builds a namespace is hand-written source; the
17
17
  distinguishing test is that a generated barrel contains nothing but `export * from "./X";` lines.
18
18
 
19
+ ## What sync refuses
20
+
21
+ `akan sync` refuses a root file or folder its allowlist lacks, a hand-written file or test in `lib/`'s root, a
22
+ module file named off the pattern, and an `index.tsx` / `.jsx` / `.mts` beside a generated barrel. The allowlists,
23
+ the module file names and what sync does to `package.json` are the `syncRule` reference.
24
+
19
25
  ## Where a dependency is declared
20
26
 
21
27
  Add the package to the `package.json` of the app or lib that imports it —
@@ -89,9 +89,12 @@ File names, stages, the `.render()` order and what a route file must never do ar
89
89
  const setGenre = (next: string) => router.replace(`/books?genre=${next}`, { shallow: true, scrollToTop: false });
90
90
  ```
91
91
 
92
- `searchParams` follows the replace and the back and forward buttons. Never keep the filter in `useState`: a shallow
93
- back draws no page, so the copy stays on the old value while the URL moves. Shallow holds only while the path stays
94
- the same; a server `.search()` sees the value at the next full navigation.
92
+ `searchParams` follows the replace and the back and forward buttons, and the server render reads the request's
93
+ query from it, so the first HTML already shows the filter the URL names. A text box is the same: `value` from
94
+ `searchParams` and a replace on every `onChange`, which writes `searchParams` before it returns, so no keystroke
95
+ lags. Never keep the filter in `useState`, with or without a `popstate` listener: a shallow back draws no page, so
96
+ the copy stays on the old value while the URL moves. Shallow holds only while the path stays the same; a server
97
+ `.search()` sees the value at the next full navigation.
95
98
  - On a web page's first render `st.use.searchParams()` is still the server's empty snapshot, synced right after
96
99
  hydration, so an effect that needs the query on its first run takes the page's `.search()` value as a prop.
97
100
  - A `Link` renders its page ahead of the click, guards included: on hover, on keyboard focus, or as it shows with
@@ -29,8 +29,14 @@ Raw `tsc` misses the generated barrels and reports false errors. Do not reach fo
29
29
  **Apply the real fix the rule intends. Do not silence the checker.** No blanket lint-disable, no throwaway
30
30
  re-export, no export-in-place trick, no `as any`, no non-null assertion. Gaming a check is a defect, not a
31
31
  fix. When a suppression is genuinely right it carries a reason:
32
- `// biome-ignore lint/<rule>: <why>` — and a grit plugin diagnostic is suppressed as `lint/plugin`, not the
33
- bare `plugin` category Biome's own message suggests.
32
+ `// biome-ignore lint/<rule>: <why>` — and a grit plugin diagnostic is suppressed as `lint/plugin`
33
+ (`// biome-ignore-all lint/plugin: <why>` for a whole file), not the bare `plugin` category Biome's own message
34
+ suggests. The grit plugins scope `apps/` and `libs/`, never `pkgs/`.
35
+
36
+ - **`biome.json` is strict JSON** — a comment breaks config resolution without an error (Biome falls back to
37
+ discovery and aborts on a nested config); rename it `biome.jsonc` to document a disabled rule.
38
+ - **`akan lint` prints up to 200 diagnostics** (`--max-diagnostics <n>`, `0` = all); Biome's own uncounted 20 reads
39
+ as progress when the mix merely changed.
34
40
 
35
41
  Common classes and their real fix:
36
42
 
@@ -54,7 +54,7 @@ export class AgentAssets {
54
54
  "framework",
55
55
  ],
56
56
  "akan-err": ["errorCodes"],
57
- "akan-deps": [],
57
+ "akan-deps": ["syncRule"],
58
58
  "akan-debug": [],
59
59
  "akan-page": ["pageRule", "akanApi#imports", "akanApi#routes", "akanApi#app-config"],
60
60
  "akan-query": ["queryRule"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/devkit",
3
- "version": "3.3.0-rc.65",
3
+ "version": "3.3.0-rc.66",
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.65",
53
+ "@akanjs/language": "3.3.0-rc.66",
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.65",
62
+ "akanjs": "3.3.0-rc.66",
63
63
  "chalk": "^6.0.1",
64
64
  "commander": "^15.0.0",
65
65
  "dayjs": "^1.11.23",
@@ -1,12 +1,14 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { readdir } from "node:fs/promises";
3
3
  import path from "node:path";
4
+ import { Prompter } from "../guideline/prompter";
4
5
  import {
5
6
  appRootAllowedDirs,
6
7
  appRootAllowedFiles,
7
8
  facetIndexShadowOf,
8
9
  isAllowedLibFacetRootFile,
9
10
  isScannedRootEntry,
11
+ libFacetRootAllowedFiles,
10
12
  libFacetRootHintOf,
11
13
  libRootAllowedDirs,
12
14
  libRootAllowedFiles,
@@ -195,3 +197,18 @@ describe("cli root tsconfig templates vs workspace scan allowlists", () => {
195
197
  }
196
198
  });
197
199
  });
200
+
201
+ describe("syncRule guideline", () => {
202
+ test("names every root file and folder the allowlists admit, and every lib/ root file", async () => {
203
+ const text = await Prompter.getInstruction("syncRule");
204
+ const named = new Set([...text.matchAll(/`([^`\s]+)`/g)].map((match) => match[1]));
205
+ const admitted = [
206
+ ...appRootAllowedFiles,
207
+ ...appRootAllowedDirs,
208
+ ...libRootAllowedFiles,
209
+ ...libRootAllowedDirs,
210
+ ...libFacetRootAllowedFiles,
211
+ ];
212
+ expect(admitted.filter((name) => !named.has(name))).toEqual([]);
213
+ });
214
+ });
@@ -1,6 +1,3 @@
1
- // The one source of the app/lib root allowlists (sync, doctor and quality scan read it); mirror a change into the
2
- // root AGENTS.md list.
3
-
4
1
  import { barrelFacetDirs } from "akanjs/common";
5
2
 
6
3
  export type SysType = "app" | "lib";