Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ Commands and Rust coding style: [nanvm-lib/AGENTS.md](./nanvm-lib/AGENTS.md).
A PR implements only one feature or improvement, with minimal code changes, and
every check above passing. Its title and description become the squash commit on
`main`, so write them as one: a `<topic>: <short description>` title and a
description ending in a mandatory `Changelog:` section. A PR that changes code
adds `changelog/unreleased/<PR>.md`, named by the real PR number once the PR
exists; a PR that only touches `todo/`, `AGENTS.md`, or other documentation
writes `Changelog: none` instead. Breaking changes are welcome when they improve
the API — prefix the entry with `**BREAKING CHANGES:**` and update every importer
in the same PR.
description ending in a mandatory `Changelog:` section. A PR that changes
behavior or the public API adds `changelog/unreleased/<PR>.md`, named by the
real PR number once the PR exists; a PR that doesn't — internal refactors,
test-only changes, and PRs that only touch `todo/`, `AGENTS.md`, or other
documentation — writes `Changelog: none` instead. Breaking changes are welcome
when they improve the API — prefix the entry with `**BREAKING CHANGES:**` and
update every importer in the same PR.

Commit-message format and the PR checklist: [CONTRIBUTING.md](./CONTRIBUTING.md#opening-a-pull-request).
Changelog entry rules, breaking changes, and versioning:
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ For tool details and package-consumer setup for Claude and Codex, see

A pull request implements only one feature or improvement, with minimal code
changes. Before submitting, ensure every check above passes, delete the `todo/`
issue file in the same pull request, and — for code changes — add a changelog
entry as `changelog/unreleased/<PR>.md`, named by the real pull request number
once the pull request exists (see
issue file in the same pull request, and — when the change affects behavior or
the public API — add a changelog entry as `changelog/unreleased/<PR>.md`, named
by the real pull request number once the pull request exists (see
[changelog/README.md](./changelog/README.md)). The everyday workflow around
this is [AGENTS.md §1](./AGENTS.md#1-workflow).

Expand Down Expand Up @@ -197,9 +197,9 @@ squash, so their messages are working notes.
The section holds exactly the list items of `changelog/unreleased/<PR>.md` —
same Markdown subset, same `**BREAKING CHANGES:**` prefix where it applies,
no PR link ([changelog/README.md](./changelog/README.md#entries)). A pull
request that needs no entry writes `Changelog: none`. The section is
**mandatory** either way, so a forgotten entry is a visible omission rather
than a silent one.
request that doesn't change behavior or the public API needs no entry and
writes `Changelog: none`. The section is **mandatory** either way, so a
forgotten entry is a visible omission rather than a silent one.

It duplicates the entry file on purpose: the file is what today's release
process reads, the section is what a generator reading Git history would
Expand Down
8 changes: 5 additions & 3 deletions changelog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ inside the file — the file name already carries the number, and a renderer
derives the link from it. A pull request with several entries puts them all in
its one file, most important first.

Only add entries for code changes — pull requests that only touch `todo/`,
`AGENTS.md`, or other documentation files do not need one, and say
`Changelog: none` in the description instead.
Only add entries for changes that affect behavior or the public API — a pull
request that doesn't (internal refactors, test-only changes, coverage
improvements, and pull requests that only touch `todo/`, `AGENTS.md`, or other
documentation files) does not need one, and says `Changelog: none` in the
description instead.

- **Keep it short.** An entry is **at most a few lines** (about three wrapped
lines, ~250 characters) — what changed and, when it isn't obvious, why. It is a
Expand Down
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"tasks": {
"fjs": "deno run --allow-read --allow-write --allow-env --allow-net --allow-sys ./fjs/module.mjs",
"test": "deno test --allow-read --allow-env --allow-sys",
"cov": "deno test --allow-read --allow-env --allow-sys --coverage && deno coverage --include='.*module\\.f\\.mjs'"
"cov": "deno test --allow-read --allow-env --allow-sys --coverage && deno coverage --include='.*module\\.f\\.mjs'",
"cov-html": "deno test --allow-read --allow-env --allow-sys --coverage && deno coverage --html --include='.*module\\.f\\.mjs$'"
},
"fmt": {
"indentWidth": 4,
Expand Down
16 changes: 5 additions & 11 deletions fjs/types/btree/set/module.f.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import { collapseRoot } from '../types/module.f.mjs'
import { find } from '../find/module.f.mjs'
import { fold } from '../../list/module.f.mjs'
import { assert } from '../../../asserts/module.f.mjs'

/**
* @template T
Expand Down Expand Up @@ -79,31 +80,24 @@ const nodeSet = c => g => node => {
case 2: {
// insert
const value = g(null)
// TODO: remove after TSGO fix the regression.
// const _xl: 1|2 = x.length
switch (x.length) {
case 1: { return [[x[0], value]] }
case 2: { return [[x[0]], value, [x[1]]] }
}
// TODO: remove after TSGO fix the regression.
// See https://github.com/microsoft/typescript-go/issues/4613
throw 'unreachable'
}
case 3: {
// replace
// TODO: remove after TSGO fix the regression.
// const _xl: 2|5 = x.length
switch (x.length) {
const xL = x.length
// See https://github.com/microsoft/typescript-go/issues/4613
assert(xL === 2 || xL === 5)
switch (xL) {
case 2: { return [[x[0], g(x[1])]] }
case 5: { return [[x[0], x[1], x[2], g(x[3]), x[4]]] }
}
// TODO: remove after TSGO fix the regression.
throw 'unreachable'
}
case 4: {
// insert
// TODO: remove after TSGO fix the regression.
// const _xl: 2 = x.length
const [v0, v1] = x
return [[v0], v1, [g(null)]]
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"scripts": {
"prepack": "tsc --noEmit false --emitDeclarationOnly && tsc",
"test": "tsc && node ./fjs/module.mjs t",
"cov": "node --test --experimental-test-coverage --test-coverage-include=**/module.f.mjs fjs/emergent_testing/all.test.mjs",
"cov": "node --test --experimental-test-coverage --test-coverage-include=**/module.f.mjs",
"start": "node ./fjs/module.mjs",
"ci-update": "node ./fjs/module.mjs ci && node ./fjs/module.mjs r ./fjs/nanvm/update/module.f.mjs",
"dev-update": "node ./fjs/module.mjs r ./fjs/dev/update/module.f.mjs",
Expand Down
Loading