Expand documentation for compile command and CAS features - #1450
Conversation
The root README's Getting Started section lost its `fjs compile` examples in #1198, an unrelated CAS bugfix PR, which replaced them with inline CAS and MCP command listings that duplicate (and had drifted from) fjs/cas/README.md and fjs/mcp/README.md — `fjs cas get` takes a hash *and* a destination path, not a hash alone. Getting Started now shows a real, verified compilation: a two-module input, the two output formats picked by extension, and the emitted JavaScript and JSON, including why the JS output keeps a shared value as a `const` and the JSON one does not. The CAS and MCP sections collapse into the CLI command table, where every command links to the README that documents it. fjs/README.md's table gains the same links plus a short `fjs compile` section. Also drop the trailing semicolon from fjs/djs/examples/input.f.ts, the example the DJS README points at: the parser rejects it, so the example did not compile. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MbDEXSgXRuNhGDWzHdhqDH
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
functionalscript | c3ff117 | Commit Preview URL Branch Preview URL |
Aug 07 2026, 09:16 PM |
Single-letter aliases in prose and examples are noise: a reader has to map `fjs t`/`fjs c`/`fjs r`/`fjs m` back to the command before the sentence means anything. Documentation now spells every command out — `fjs test`, `fjs compile`, `fjs run`, `npx functionalscript mcp` — and the Alias columns are gone from the README command tables. The aliases still work; they are simply no longer documented. Two places keep a literal alias because they quote generated output rather than advise the reader: fjs/ci/README.md describes the workflow that fjs/ci/node/module.f.ts emits, which runs `fjs t`. Released CHANGELOG entries are left as written. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MbDEXSgXRuNhGDWzHdhqDH
o2alexanderfedin
left a comment
There was a problem hiding this comment.
Reviewed by checking out the branch and running the things it documents. The fjs compile section is excellent — I ran the example verbatim and the output matches the README byte for byte, both formats. All seven new documentation links resolve. Two problems with the alias→full-name change itself.
1. npx fjs <command> runs somebody else's package
README.md:31:
or run the CLI without installing it, with
npx fjs <command>.
npx resolves by package name, not bin name. fjs is a real, unrelated package on npm:
$ npm view fjs name version description repository.url
name = 'fjs'
version = '0.5.0'
description = 'Utilities for Functional Javascript'
repository.url = 'git@github.com:idottv/fjs.git'
So npx fjs test downloads and executes that stranger's package rather than FunctionalScript. Every other npx line in the repo gets this right — AGENTS.md:70, fjs/cas/evo/README.md:242, fjs/mcp/README.md all say npx functionalscript .... Suggest the same here.
The same bug already exists at fjs/README.md:12 (npx fjs <command> [args]) — it predates this PR, but since this PR is precisely about how the CLI is invoked in the docs, it seems like the right place to fix both.
2. Docs and the CLI now disagree about aliases
The commit is titled "Use full command names in documentation, drop CLI aliases", but the aliases are not dropped. fjs/module.f.ts still declares them:
names: ['test', 't'] / ['compile', 'c'] / ['cas', 's'] / ['mcp', 'm'] / ['ci', 'i'] / ['run', 'r']
and node ./fjs/module.ts t still runs the full suite (2354 passing). Meanwhile fjs/README.md drops the Alias column entirely, and README.md adds "Run fjs help for the same list" — but fjs help on this branch prints:
Available commands:
test, t Run the FunctionalScript test suite
compile, c Compile a FunctionalScript module to JavaScript
...
help, h, ? Print this help message
That is not the same list. Either drop the aliases in fjs/module.f.ts / fjs/cli/module.f.ts so the help output matches, or keep documenting them. As it stands fjs help is a live counter-example to the README's own claim.
Happy to approve once the npx line is corrected; the alias question is your call on which direction to take it.
o2alexanderfedin
left a comment
There was a problem hiding this comment.
Re-checked at a9377224. The update since my last review is the merge from main — it's clean, no conflict markers, and #1449's new JSDoc/variance section in AGENTS.md survived intact. The documentation content itself is unchanged, so both earlier points are still open:
npx fjs <command>— still atREADME.md:31andfjs/README.md:12.npxresolves by package name, andfjsis a real unrelated package on npm (fjs@0.5.0, "Utilities for Functional Javascript"), so this line tells users to run someone else's code. This is the one I'd call blocking; it's a one-word fix tonpx functionalscript <command>.- Aliases —
fjs/module.f.tsstill declares['test','t'],['compile','c'], etc., andfjs helpstill prints them, while the tables no longer do andREADME.mdsaysfjs helpgives "the same list".
No new problems. Everything else I verified before still holds on this head.
The generated workflow was the last place still invoking the CLI by alias, and it was also what forced fjs/ci/README.md to keep documenting `fjs t` — the docs were quoting real output. The generator now emits `fjs test`, `deno run ... npm:functionalscript@<version> test`, and `bunx functionalscript@<version> test`, so generated CI and the documentation agree. The pinned bootstrap release the generated jobs install (0.41.0) already accepts the full names — its command table is `['test', 't']` — so the jobs run exactly as before. .github/workflows/ci.yml is regenerated with `npm run ci-update`; the Node 26 drift check would fail otherwise. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MbDEXSgXRuNhGDWzHdhqDH
`fjs` is a real, unrelated package on npm (fjs@0.5.0, "Utilities for Functional Javascript"), so `npx fjs <command>` downloads and runs that instead of FunctionalScript. Both places now say `npx functionalscript <command>`, matching every other npx invocation in the repository, and fjs/README.md notes why. Reported in review of #1450. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MbDEXSgXRuNhGDWzHdhqDH
The command tables no longer show aliases, but `fjs help` still does, so "Run `fjs help` for the same list" was false. Both READMEs now say plainly that the commands accept short aliases and that `fjs help` prints them, while the documentation uses the full names throughout. The CLI is unchanged — the aliases keep working. Reported in review of #1450. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MbDEXSgXRuNhGDWzHdhqDH
|
Both points addressed — thanks, the 1.
The remaining 2. Aliases (3c6cd4b). You were right that the commit title overstated it: the aliases were never dropped, only undocumented. The maintainer's call is to keep them in the CLI, so the READMEs no longer pretend otherwise — the false "Run Head is Generated by Claude Code |
o2alexanderfedin
left a comment
There was a problem hiding this comment.
Approving at c3ff1173. Both points are fixed, and the second one you took further than I suggested.
npx — now npx functionalscript <command> in both places, and fjs/README.md:16 explains why rather than just changing the string:
fjsis a different package on npm, sonpx fjs …would run somebody else's code.
That note is the part that keeps it from regressing.
Aliases — instead of picking one side, you removed the false claim and made the docs state the actual arrangement: aliases exist, fjs help prints them, the documentation uses full names throughout. That's more accurate than either option I offered.
ci: generate full command names — this was the right root-cause fix and it's the one I checked hardest, since it changes a generator rather than prose. Verified:
npm run ci-updateregenerates.github/workflows/ci.ymland leaves the working tree clean — the committed workflow is exactly what the generator produces, so generated CI and docs can't drift apart.npx tscclean;npm test→pass: 2354, fail: 0, total: 2354.- No
t-alias remnants left in the generated workflow ordeno.json.
Catching that fjs/ci/README.md was documenting fjs t only because it was quoting real generator output — and fixing the generator instead of the quote — is the correct direction.
Summary
This PR significantly expands the documentation for FunctionalScript's compiler and CLI, with a focus on explaining the
fjs compilecommand and its capabilities. The changes reorganize and enhance the README files to provide clearer guidance for users.Key Changes
Enhanced main README.md:
npxwithout installationconstsharing) and JSON output (tree format with expanded values)fjs helpcommandEnhanced fjs/README.md:
Minor cleanup:
fjs/djs/examples/input.f.ts) for consistencyNotable Details
The documentation now clearly explains the compiler's dual-output capability: JavaScript modules that maintain object identity through
constdeclarations, versus JSON trees where shared values are expanded. This helps users understand when to use each format based on their needs.https://claude.ai/code/session_01MbDEXSgXRuNhGDWzHdhqDH