docs/TECHNOLOGY.md

Technology choices

This document records SDK and website tooling, consumer support and release policy. Use the repository guide for setup and file locations

SDK

AreaSelected choice
Package@neontechspace/fluxerly, initially one published package with internal module boundaries
LanguageTypeScript 7
Module formatECMAScript modules (ESM)
RuntimeTested against Node.js 24.15 or newer
Internal implementationEffect 4
WebSocket transportws, kept behind internal SDK boundaries
Public entry pointsDefault JavaScript/TypeScript and Effect, sharing one implementation
Public error resultsneverthrow Result for default synchronous operations and ResultAsync for default async operations, typed Effect failures for the native API
Initial buildTypeScript 7 compiler-only ESM output, public declarations and source maps
TestsVitest runtime tests and separate TypeScript 7 consumer checks
Distributionnpm from a separately staged package

Consumer support

The SDK supports JavaScript and TypeScript 7. TypeScript 6 and earlier are outside the SDK's support policy. JavaScript consumers do not need a TypeScript installation

Fluxerly is tested against Node.js 24.15 or newer, the oldest Node 24 release that npm 12 supports. Use current security updates within a supported Node.js release line. The development pin is maintained separately from this compatibility floor

Support policy

  • Raising the minimum Node.js version is a breaking change that increases MAJOR
  • A Node.js release line is dropped no sooner than six months after its end of life
  • The Effect peer accepts releases of one Effect major starting at the supported minimum, independently of the development dependency. Raising that minimum or changing the Effect major is a breaking change that increases MAJOR

Versioning and release stages

The SDK uses Epoch Semantic Versioning, with this SemVer-compatible package version format:

text
1(EPOCH * 1000 + MAJOR).MINOR.PATCH[-STAGE.NUMBER]

The epoch identifies a major project generation. Within an epoch, MAJOR increases for breaking public API changes, MINOR for backward-compatible features and PATCH for backward-compatible fixes. MAJOR ranges from 0 to 999 with this mapping. The release suffix describes readiness, independently of compatibility changes

SuffixMeaning
-nightly.YYYYMMDD.NAutomatic build of main, published daily when the SDK changed. It can include breaking changes at any time
-rc.NRelease candidate for the next Stable, with no known release blockers, under final validation. It can still include breaking changes
No suffixStable release supported for public use

There is no literal -none suffix. Release targets reflect compatibility with the preceding stable release, not the preceding preview. The initial release cycle targets 1000.0.0, including breaking changes between its previews. Later cycles accumulate compatibility changes against their stable starting version, so repeated major notes do not repeatedly increase the target major. An increased compatibility impact can raise the target, but an already selected target never decreases. Preview-to-preview breaking changes still require migration notes

Nightly and RC releases can always include breaking changes against any earlier preview, including after the first stable release. Only between Stable releases does the version tell what kind of change a release contains: MAJOR for breaking changes, MINOR for compatible features and PATCH for compatible fixes. A patch or minor release can go straight to Stable. A new major version or epoch is published as an RC first, and Stable then publishes that RC's package content unchanged. While an RC is waiting for Stable, no other Stable at or above its version can be published. Release stages lists the exact rules

A nightly version is never committed. Its core is the version the next RC would target, and the rest is the UTC date of its preparation followed by the preparing run's number, such as 1000.1.0-nightly.20261019.57. The date comes first so builds sort by day, and run numbers only grow but can skip values. A nightly's core can still drop, for example when a pending minor note is removed. Nightly versions from before this format use -nightly.N and sort below every dated nightly of their core. Nightly builds sit outside the RC and Stable rules, so they never block or wait for another release

The first stable public generation is called Epoch 1 and starts at 1000.0.0, not 1.0.0

Example releasePackage version
First release candidate1000.0.0-rc.0
First stable release1000.0.0
Nightly build after the first stable release1000.0.1-nightly.20261019.57
Compatible bug fix1000.0.1
Compatible feature1000.1.0
Breaking API change within Epoch 11001.0.0
Next major project generation2000.0.0

These examples illustrate versioning, not the current release inventory. Use the SDK source manifest for the checkout's version and npm registry metadata for published versions. The release channels are Nightly, RC and Stable, with the npm distribution tags nightly, rc and latest. Until the first Stable release, latest points to a release candidate that the maintainer moves there by hand. Release tooling moves only the published channel's tag, so previews never move latest. Release documentation snapshots use the matching exact package version, including its prerelease suffix

Canary was the earlier preview channel. Its -canary.N versions were removed from npm and GitHub, and no new Canary is published

Effect and diagnostics

Effect handles internal concurrency, cancellation, resource management and logging. Convert results to neverthrow only at the default public API. The SDK contracts define shared ownership, failure and diagnostic constraints

Optional consumer Effect integration

The SDK development dependency pins an exact stable Effect 4 version within the required peer range. Packed consumers separately test the range's minimum, such as 4.0.0 for ^4.0.0. Updating the development dependency does not raise that minimum. Other releases within the range are accepted but are not individually tested. Effect 3 and Effect 4 prereleases are unsupported

Modern npm, pnpm and Bun install required peers automatically by default. Consumers that disable peer installation must install an Effect version within the declared range themselves

Build and package optimization

Start with TypeScript 7 compiler-only output: Readable ESM JavaScript, public type declarations and source maps. Keep deliberate public exports and clean package contents. Validate the packed artifacts through default JavaScript, TypeScript 7 and native Effect consumers rather than relying only on source imports

The SDK source manifest stays private and records the version used for local package checks and release preparation. Its tarball includes readable compiled output, public declarations, JavaScript and declaration maps, and sources for navigation. The staged npm package includes the package README, consumer agent guidance and Apache-2.0 license, plus the Changesets changelog when present

The staged npm manifest takes its public package name and release version from the private SDK source manifest. TypeScript 7 remains authoritative for SDK compilation and consumer checks. Manual release workflows and immutable candidate tooling enforce the registry publication contract

Compiler-only output is the selected release format. No bundler is selected

Minification is off by default. A smaller package must demonstrate enough benefit to justify less readable output and another code transformation. A proposed change to that default requires runtime, type, source-map and diagnostic checks. Bundling or minification requires a separate decision

Test tooling

Use Vitest for runtime tests and separate TypeScript 7 compiler checks for consumer examples. Exercise default and native entry points, including failure, interruption and cleanup behavior. Examples must use supported public imports without casts that bypass the intended API or repeated low-level orchestration on the main path. Runtime success does not establish type correctness, and compiler success does not establish runtime behavior

An Effect-specific Vitest adapter, coverage target and additional test libraries have not been selected. The SDK validation requirements identify the behavior those tests must establish

The current Effect and test-tool declarations require DOM and explicit-resource-management library types during SDK compilation. The SDK build includes DOM and ESNext.Disposable alongside ES2024 without disabling dependency declaration checking. The default packed TypeScript consumer checks with ES2024 and Node.js types, because handler signals are AbortSignal values and clients support await using. It does not import Effect types. The native packed TypeScript consumer includes the additional libraries required by Effect's declarations. These compiler libraries do not add browser runtime support

Transport choice

The default transport uses ws, not the runtime's built-in WebSocket or Effect's unstable HTTP/socket modules. The built-in WebSocket lacks bounded forced closure, which is required to release owned resources before shutdown completes, and the Effect adapter showed a cleanup limitation. Use the selected ws transport rather than abandoning a socket after a timeout

Selected ws dependency

Keep ws and its types behind internal boundaries, with Effect owning cancellation and cleanup. Only the socket transport imports ws. The gateway implementation owns protocol behavior through that transport seam

Documentation website

AreaSelected choice
FrameworkAstro
Documentation UIReact and Fumadocs, integrated into Astro routes
HostingCloudflare Pages
Tooling compilerTypeScript 6 until the website toolchain supports TypeScript 7 and migration is approved
SDK reference generatorTypeDoc with typedoc-plugin-markdown, reading TypeScript 7-generated declarations

TypeScript 6 is a compatibility exception for the website and reference-generation tooling, not SDK consumer support. The website is separate from the SDK's npm package. The implemented documentation UI uses a dark, cozy theme with a 20px reading body. Temporary public delivery is Preview only, with no SEO or sitemap and explicit noindex controls. The permanent cinematic website remains deferred until the first stable SDK release. Use documentation maintenance for generation, exact-version snapshots and delivery setup

SDK reference generation

TypeScript 7 builds the SDK and emits its public declarations with authored documentation comments. TypeDoc runs with TypeScript 6 in the documentation tooling to read those declarations. This keeps the SDK compiler and TypeScript consumer policy on TypeScript 7

Generated Markdown provides the API reference in Astro, alongside handwritten guides and examples. The website must explicitly map generated reference links to its page routes and preserve fragment targets. Generated reference files must not require manual link edits

The generator and route integration are implemented in projects/web/

Handwritten guides remain website source, and Changesets owns the package changelog rendered by the website and GitHub release notes

Documentation placement and the public API documentation completion gate are in documentation maintenance

Shared development tooling

AreaSelected choice
Package managerpnpm 12
WorkspaceOne pnpm workspace and lockfile under projects/
Development Node versionOne shared version source in projects/.node-version
Git line endingsGit attributes
LicenseApache-2.0 for the SDK, website code and authored documentation

The development Node version is pinned in .node-version, separately from the SDK's consumer minimum

The workspace declares the pnpm range >=12 <13 through devEngines.packageManager in projects/package.json. The shared lockfile records the resolved pnpm version, which is reused while it satisfies that range. The onFail: "download" setting enables automatic download and version switching

Updates within pnpm 12 are deliberate, not automatic on each run. Run pnpm self-update 12 from projects/, then pnpm install --lockfile-only to refresh the lockfile. Review and commit the resulting manifest and lockfile changes together. Moving to pnpm 13 requires a separate decision

Dependabot proposes weekly GitHub Actions and npm updates for the workspace, configured in .github/dependabot.yml. It ignores effect, whose development pin and public peer minimum are updated separately by decision, and major typescript and @types/node updates. The SDK runtime dependencies neverthrow and ws are grouped into their own pull request, so their update can carry a Changeset

The repository's Actions settings allow only selected actions, each pinned to a full commit SHA (allowed_actions: selected and sha_pinning_required: true). A Dependabot GitHub Actions pull request therefore fails Check with a startup failure until its new SHAs are on the allowlist:

  1. Collect the new SHAs, including those of actions used inside an updated composite action, such as the github/codeql-action/upload-sarif step in zizmor-action. Those do not appear in the pull request diff
  2. Verify that each new SHA is the commit of its release tag, for example with gh api repos/OWNER/REPO/git/ref/tags/TAG, where OWNER/REPO is the repository part of the action path, such as github/codeql-action for github/codeql-action/upload-sarif. For an annotated tag, dereference the returned tag object to its commit
  3. Add the new entries to the allowlist under Settings, Actions, General, or through the API. Each entry is the full action path from the uses: line, OWNER/REPO[/PATH]@SHA, such as github/codeql-action/upload-sarif@SHA. The API replaces the whole setting, so save the output of gh api repos/NeonTechSpace/Fluxerly.js/actions/permissions/selected-actions, edit patterns_allowed to keep the existing entries and add the new ones, and send the complete payload with github_owned_allowed and verified_allowed as they currently are. Use gh api -X PUT on the same path with --input payload.json, so booleans and arrays keep their JSON types. Read the setting again to verify it
  4. Ask Dependabot to rebase the pull request, then merge it once Check passes
  5. Remove the old SHAs the same way once no workflow on main uses them

Prettier is an SDK development dependency, with its version recorded in the manifest and lockfile. Its configuration selects a 120-column target, 4-space indentation, LF endings and no optional semicolons. Other formatting options use Prettier's stable defaults, without plugins or experimental formatting

The development checks include SDK formatting validation and linting. Oxlint lints SDK source, scripts, examples and tests, release tooling and website scripts with type-aware rules through oxlint-tsgolint. Knip reports unused SDK files and exports, and CSpell checks SDK source comments, website guides and repository documents against the project word list. These tools are exact workspace development dependencies configured in projects/. In CI, actionlint lints the workflow files and zizmor audits them. Website formatting has not been selected.

The Effect language service for TypeScript 7, @effect/tsgo, checks SDK source, tests and examples for Effect mistakes, such as an Effect that is built but never run. Its errors and warnings fail the lint. Its style suggestions appear in editors and in pnpm build after the editor setup. The SDK tsconfig turns off lazyEffect, because zero-argument public methods such as connect() return a new Effect by design. Source that keeps a failure from a caller's store, hook or callback as it is turns off unknownInEffectCatch for that line with an @effect-diagnostics-next-line comment. A session store timeout is reported as a plain Error among those failures, so its line turns off globalErrorInEffectFailure the same way. Tests turn both rules off. Type tests build Effect values without running them, so they also skip floatingEffect and missingEffectContext

The SDK build and test tools are installed and configured. The workspace's allowBuilds policy enables the esbuild and workerd install scripts and explicitly disables the optional transitive msgpackr-extract script. Unreviewed dependency builds still fail installation rather than being enabled globally

Check, version PR, candidate preparation, publication, Preview and daily upstream drift workflows are configured under .github/workflows. Check on main dispatches candidate preparation after a passing run that changed the SDK to an unpublished version, and a daily schedule prepares a nightly build and publishes it when the SDK changed since the most recent nightly or release of that source. Releasing describes each trigger and when a nightly is skipped. Preview releases are published to npm, and the Preview documentation website is live. Use npm registry metadata for the published versions