You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 747e3a5
Browse filesBrowse the repository at this point in the historyBrowse files
Assertions come from `tests/asserts.ts` (relative path, e.g. `../asserts.ts` from `tests/unit/`), never from a std assertion module directly; the Runtime Boundary check flags a direct std import in tests. Exports: `assert`, `assertEquals`, `assertThrows`, `assertRejects`, `assertMatch`, `assertObjectMatch`, `assertStringIncludes`, `fail`, `AssertionError`
88
88
89
+
Tests follow the same runtime rule as `src/`: no new `Deno.*` calls, import the equivalent from `src/deno_ral/` (`fs.ts`, `temp.ts`, `path.ts`). The Runtime Boundary check counts `Deno.*` calls in `tests/` against a baseline and fails the PR on an increase. Before accepting an increase, check `src/deno_ral/` and `tests/utils.ts` (`writeFixture`, `withTempDir`) for an existing helper. See `.claude/rules/typescript/deno-ral.md`.
@@ -60,8 +64,18 @@ const result = await execProcess({
60
64
## Module Loading Order
61
65
62
66
`src/quarto.ts` loads monkey patches first:
67
+
63
68
```typescript
64
-
import"./core/deno/monkey-patch.ts"; // Must be first!
69
+
import"./core/deno/monkey-patch.ts"; // Must be first!
65
70
```
66
71
67
72
This ensures compatibility shims load before any code runs.
73
+
74
+
## Moving code off `Deno.*`
75
+
76
+
Outside `deno_ral/`, never add new `Deno.*` calls; import the equivalent from `deno_ral/`. The `deno_ral/` modules themselves implement those functions with `Deno.*`. To migrate existing files mechanically:
77
+
78
+
quarto run --dev tools/codemod-deno-ral.ts --rules fs,temp --dir src/<dir> --dry-run
79
+
quarto run --dev tools/codemod-deno-ral.ts --rules fs,temp --dir src/<dir>
80
+
81
+
The tool reports local-name collisions (left as `Deno.*`; fix with an alias import such as `import { stat as fsStat } ...`, which later runs reuse) and skips files that assign to `Deno.*`, `src/core/lib` and the standalone scripts. Replace `instanceof Deno.errors.X` with the predicates in `deno_ral/errors.ts`. After a rebase conflict in a codemodded file, reset the file to `main` and re-run the codemod; never resolve by hand. `--reverse` produces the `Deno.*` form for backports (`dev-docs/checklist-backport-a-pr.md`).
0 commit comments