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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ TypeScript-to-JavaScript migration:

Renaming an implementation to `.f.mjs` therefore never requires renaming its
proof in the same change, and never removes it from proof discovery or from Node
and Deno coverage: `shouldLoad` in [`fjs/dev/module.f.ts`](./fjs/dev/module.f.ts)
and Deno coverage: `shouldLoad` in [`fjs/dev/module.f.mjs`](./fjs/dev/module.f.mjs)
matches both authored extensions, and both `npm run cov` and `deno task cov`
include `module.f.ts` and `module.f.mjs`. Ordinary (non-FunctionalScript) `.mjs`
files stay opt-in through the `proof.mjs` filename convention. Stage 1 ends with
Expand Down
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,61 @@ history.

## Unreleased

- **BREAKING CHANGES:** `fjs/fsc/json.f.ts` and `fjs/fsc/bnf.f.ts` migrate
from authored TypeScript to JSDoc-typed JavaScript (`.f.mjs`) — no
local types to split, both use only `Rule`/`TerminalRange` from
`fjs/bnf/types.ts`. Importers must use the `.f.mjs` specifier
[#1494](https://github.com/functionalscript/functionalscript/pull/1494)
- **BREAKING CHANGES:** `fjs/media/json/tokenizer` migrates from
authored TypeScript (`.f.ts`) to JSDoc-typed JavaScript (`.f.mjs`),
splitting `JsonToken` and the internal `_ScanState`/`_ScanInput`
types into a sibling `types.ts` — importers must use the `.f.mjs`
specifier for runtime values and the `types.ts` specifier for types.
`proof.f.ts` stays TypeScript for now (it depends on
`djs/serializer/module.f.ts`, still unmigrated)
[#1494](https://github.com/functionalscript/functionalscript/pull/1494)
- **BREAKING CHANGES:** `fjs/js/tokenizer/module.f.ts` migrates from
authored TypeScript (`.f.ts`) to JSDoc-typed JavaScript (`.f.mjs`),
splitting `StringToken`, `NumberToken`, `BigIntToken`, `ErrorToken`,
`WhitespaceToken`, `NewLineToken`, `IdToken`, `CommentToken`,
`EofToken`, `JsToken`, `TokenMetadata`, `JsTokenWithMetadata`, and a
large set of internal state-machine types into a sibling `types.ts` —
importers must use the `.f.mjs` specifier for runtime values and the
`types.ts` specifier for types. `proof.f.ts` stays TypeScript for now
(it depends on `djs/serializer/module.f.ts`, still unmigrated)
[#1494](https://github.com/functionalscript/functionalscript/pull/1494)
- **BREAKING CHANGES:** `fjs/emergent_testing/module.f.ts` migrates from
authored TypeScript (`.f.ts`) to JSDoc-typed JavaScript (`.f.mjs`),
splitting `TestFn`, `TestEntry`, `TestSet`, `Path`, `Reporter`, and the
internal `_TestState`/`_TestAndPath` types into a sibling `types.ts` —
importers must use the `.f.mjs` specifier for runtime values and the
`types.ts` specifier for types. `proof.f.ts` stays TypeScript for now
(it depends on `media/json/module.f.ts`, still unmigrated)
[#1494](https://github.com/functionalscript/functionalscript/pull/1494)
- **BREAKING CHANGES:** `fjs/cas/cli` migrates from authored TypeScript
(`.f.ts`) to JSDoc-typed JavaScript (`.f.mjs`) — no local types to
split. `proof.f.ts` migrates alongside it. Importers must use the
`.f.mjs` specifier
[#1494](https://github.com/functionalscript/functionalscript/pull/1494)
- **BREAKING CHANGES:** `fjs/cas` migrates from authored TypeScript
(`.f.ts`) to JSDoc-typed JavaScript (`.f.mjs`), splitting `Cas`,
`FileCas`, and `FileCasOperation` into a sibling `types.ts` —
importers must use the `.f.mjs` specifier for runtime values and the
`types.ts` specifier for types. `proof.f.ts` migrates alongside it
[#1494](https://github.com/functionalscript/functionalscript/pull/1494)
- **BREAKING CHANGES:** `fjs/dev` migrates from authored TypeScript
(`.f.ts`) to JSDoc-typed JavaScript (`.f.mjs`), splitting `Module`,
`ModuleMap`, and `LoadModuleOperations` into a sibling `types.ts` —
importers must use the `.f.mjs` specifier for runtime values and the
`types.ts` specifier for types. `proof.f.ts` migrates alongside it
[#1494](https://github.com/functionalscript/functionalscript/pull/1494)
- **BREAKING CHANGES:** `fjs/effects/node/virtual` migrates from authored
TypeScript (`.f.ts`) to JSDoc-typed JavaScript (`.f.mjs`), splitting
`Dir`, `State`, and `JsModule` into a sibling `types.ts`, and narrowing
the previously-exported `Entity` to the internal `_Entity` — importers
must use the `.f.mjs` specifier for runtime values and the `types.ts`
specifier for types. `proof.f.ts` migrates alongside it
[#1494](https://github.com/functionalscript/functionalscript/pull/1494)
- **BREAKING CHANGES:** `fjs/media/type` migrates from authored
TypeScript (`.f.ts`) to JSDoc-typed JavaScript (`.f.mjs`), splitting
`DetectState`, `DetectMeta`, and the internal `_Signature`/`_MagicState`/
Expand Down
2 changes: 1 addition & 1 deletion fjs/bnf/todo/new-parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ position in a file. Errors instead use metadata:

For matched spans, every ordinary matched symbol arrives with
`DjsTokenWithMetadata`, so a rule's span has a first and last token and each
`TokenMetadata` (`{ path, line, column }`, `fjs/js/tokenizer/module.f.ts:158`)
`TokenMetadata` (`{ path, line, column }`, `fjs/js/tokenizer/types.ts:99-103`)
gives a real position. `ParseError` (`{ message, metadata: TokenMetadata | null }`,
`fjs/djs/parser/module.f.ts:16`) widens from a single point to the required range
where applicable.
Expand Down
4 changes: 2 additions & 2 deletions fjs/cas/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CAS

Content-addressable storage: blobs on disk, addressed by content hash
([fjs/cas/module.f.ts](module.f.ts)). The store is type-agnostic — it keeps
([fjs/cas/module.f.mjs](module.f.mjs)). The store is type-agnostic — it keeps
raw bytes only, sharded by cBase32 hash under `~/.cas/` — and never records a
mutable pointer or a per-blob type tag; both are recovered at the edges that
need them.
Expand All @@ -10,7 +10,7 @@ need them.
media-type detection: `cas_add` / `cas_get` / `cas_list` plus
[fjs/cas/evo](evo/)'s `evo_list` / `evo_head` / `evo_revision` / `evo_add`,
all served from one process.
- [`cas` CLI](cli/module.f.ts) — direct filesystem access for content larger
- [`cas` CLI](cli/module.f.mjs) — direct filesystem access for content larger
than the MCP inline-content cap.
- [fjs/cas/evo](evo/) — the Evo API: subjects and revision heads
([vnd.fjs.revision](../media/revision/)) cached in memory over this
Expand Down
13 changes: 8 additions & 5 deletions fjs/cas/cli/module.f.ts → fjs/cas/cli/module.f.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
*
* @module
*/

import { sha256 } from '../../crypto/sha2/module.f.mjs'
import { cBase32ToVec, vecToCBase32 } from '../../basen/cbase32/module.f.mjs'
import { forEachStep, pure, step } from '../../effects/module.f.mjs'
import { errorExit, log, writeFromStream } from '../../effects/node/module.f.mjs'
import type { All, Read, Write, WriteFile } from '../../effects/node/types.ts'
/** @import { All, Read, Write, WriteFile } from '../../effects/node/types.ts' */
import { dispatch } from '../../cli/module.f.mjs'
import type { Commands } from '../../cli/types.ts'
import type { MemOp } from '../../effects/memory/types.ts'
import { casAddFile, fileCas, type FileCasOperation } from '../module.f.ts'
/** @import { Commands } from '../../cli/types.ts' */
/** @import { MemOp } from '../../effects/memory/types.ts' */
import { casAddFile, fileCas } from '../module.f.mjs'
/** @import { FileCasOperation } from '../types.ts' */

export const commands: Commands<FileCasOperation | WriteFile | Write | All | MemOp | Read> = [
/** @type {Commands<FileCasOperation | WriteFile | Write | All | MemOp | Read>} */
export const commands = [
{
names: ['add'],
description: 'Store file content and print its hash',
Expand Down
9 changes: 5 additions & 4 deletions fjs/cas/cli/proof.f.ts → fjs/cas/cli/proof.f.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { commands } from './module.f.ts'
import { commands } from './module.f.mjs'
import { computeSync, sha256 } from '../../crypto/sha2/module.f.mjs'
import { maxLength, vec, vec8 } from '../../types/bit_vec/module.f.mjs'
import { defaultNodeProgramOptions, emptyState, virtual } from '../../effects/node/virtual/module.f.ts'
import type { NodeProgramOptions } from '../../effects/node/types.ts'
import { defaultNodeProgramOptions, emptyState, virtual } from '../../effects/node/virtual/module.f.mjs'
/** @import { NodeProgramOptions } from '../../effects/node/types.ts' */
import { dispatch } from '../../cli/module.f.mjs'
import { vecToCBase32 } from '../../basen/cbase32/module.f.mjs'
import { assert, assertEq } from '../../asserts/module.f.mjs'

const makeOptions = (args: readonly string[]): NodeProgramOptions =>
/** @type {(args: readonly string[]) => NodeProgramOptions} */
const makeOptions = args =>
({ ...defaultNodeProgramOptions, args })

const main = dispatch(commands)
Expand Down
3 changes: 2 additions & 1 deletion fjs/cas/evo/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ import type { Effect, Operation } from '../../effects/types.ts'
import { eff } from '../../effects/eff/module.f.mjs'
import { create, read, write } from '../../effects/memory/module.f.mjs'
import type { Key, MemOp } from '../../effects/memory/types.ts'
import { collectRead, type Cas } from '../module.f.ts'
import { collectRead } from '../module.f.mjs'
import type { Cas } from '../types.ts'
import { cBase32ToVec, vecToCBase32 } from '../../basen/cbase32/module.f.mjs'
import { fromVec } from '../../text/utf8/module.f.mjs'
import { tryUtf8 } from '../../text/module.f.mjs'
Expand Down
5 changes: 3 additions & 2 deletions fjs/cas/evo/proof.f.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { assert, assertEq } from '../../asserts/module.f.mjs'
import { pure } from '../../effects/module.f.mjs'
import { fileCas, type Cas } from '../module.f.ts'
import { fileCas } from '../module.f.mjs'
import type { Cas } from '../types.ts'
import { sha256 } from '../../crypto/sha2/module.f.mjs'
import { emptyState, virtual } from '../../effects/node/virtual/module.f.ts'
import { emptyState, virtual } from '../../effects/node/virtual/module.f.mjs'
import type { Vec } from '../../types/bit_vec/types.ts'
import { vec, vec8 } from '../../types/bit_vec/module.f.mjs'
import { cBase32ToVec, vecToCBase32 } from '../../basen/cbase32/module.f.mjs'
Expand Down
Loading
Loading