Repository navigation
feat: support Node.js and publish to npm and JSR - #14
Merged
Merged
Conversation
Deno is no longer a supported development runtime for this package, so the Deno workspace config, lockfile, editor settings, publish workflow, and the Oak example are removed ahead of the Node migration. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Build the package with tsc into ESM JavaScript and type declarations under dist/ and publish it to npm as well as JSR (raw TypeScript). The source is erasable-only TypeScript with isolated declarations, so JSR accepts it without slow-type errors. The @std/http/status dependency is replaced by a typed status table inlined in src/status.ts, adapted from @std/http under its MIT license, so the package has no runtime dependencies and imports no Node.js modules. The public API of mod.ts is unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Every behavioral assertion from the Deno suite is kept. Brittle assertions are tightened: the default-name table is explicit instead of derived from the status table, the response statusText assertion is unconditional, and the invalid JSON test no longer matches V8's error message text. Added coverage for the old error-name conversion, exposed message defaults, and the status table. The Hono example exports its app and is exercised with app.request() instead of a spawned server. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Run lint, formatting, type checks, and tests on Node 22, 24, and 26 on Linux and on Node 24 on Windows and macOS, upload coverage to Codecov, and smoke-test the packed npm tarball as a consumer would. Releases run semantic-release on main to publish to npm (OIDC trusted publishing with provenance) and JSR, and stay off until the RELEASE_ENABLED repository variable is true. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Remove the Deno and Oak instructions and run the Hono example on Node. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2 of 3 tasks
|
🎉 This PR is included in version 0.12.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates
@udibo/http-errorfrom Deno to Node + TypeScript, cross-published to npm and JSR (slice 2 of udibo/udibo#2148). The public API ofmod.tsis unchanged; the first release will be 0.12.0 (the commit analyzer, run as a dry run against this branch, computes 0.12.0 from0.11.1).src/mod.ts(moved withgit mv), tests assrc/*.test.ts,examples/hono.ts+ test. The Oak example,deno.json,deno.lock,.vscodeDeno settings, and the Deno workflows are removed.@std/http/statusis replaced by a typed status table inlined insrc/status.ts(adapted from@std/http, MIT, attributed in the file). It is byte-for-byte equivalent to@std/http@1.0.22forSTATUS_CODEandSTATUS_TEXT(verified once with a deepEqual script). Zero runtime dependencies and nonode:imports insrc/, so it works in browsers.strict,erasableSyntaxOnly,verbatimModuleSyntax,isolatedDeclarations,rewriteRelativeImportExtensions,.tsimport extensions, ES2022, NodeNext), built with TypeScript 7tsctodist/(ESM +.d.ts).minimumReleaseAge: 4320(@udibo/*excluded),.nvmrc26,engines.node >=22, lockfile committed.@vitest/coverage-v8(text + lcov).statusTextassertion, no match on V8's JSON error text). New tests cover old-format name conversion, exposed-message defaults per status, the status table, and the in-process Hono example (app.request(), no subprocess).scripts/npm-smoke.ts(Node, type stripping):pnpm pack, installs the tarball in an empty project, checks the tarball contents and zero dependencies, type-checks a consumer under NodeNext, runs it..github/workflows/ci.yml: check + test on Node 22/24/26 (ubuntu) and Node 24 on Windows and macOS, Codecov upload, package build + npm smoke on Node 22/24/26, JSR dry run. Areleasejob runs semantic-release onmainto publish to npm (OIDC trusted publishing, provenance) and JSR (OIDC); it is gated on the repository variableRELEASE_ENABLED == 'true', so merging does not publish yet.PUBLISHING.mdlists the one-time setup.Verification
Run locally on Node 26.11.1 / pnpm 12.10.1 from a clean
node_modules:pnpm install --frozen-lockfile: passespnpm check(oxlint type-aware + type-check, oxfmt --check, tsc --noEmit): passes, no warningspnpm test:coverage: 120 tests pass; statements 100% (122/122), branches 100% (114/114), functions 100%, lines 100% (Deno baseline onmain: branches 97.6%, functions 100%, lines 99.4%)pnpm build: passes;dist/has nonode:importspnpm smoke: passes (and fails whendistis mutated)pnpm jsr:dry-run(jsr publish --dry-run): passes, no slow-types errors, test files excludedsemantic-release --dry-runwith only the analyzer plugins: next version 0.12.0CI on this PR is green on Node 22/24/26 (ubuntu), Node 24 on Windows and macOS, the npm smoke on Node 22/24/26, the JSR dry run, and Codecov. Not verified: the release job (skipped until
RELEASE_ENABLEDis set) and actual npm/JSR publishing.Founder setup steps (one time; details in PUBLISHING.md)
@udibo/http-erroris linked toudibo/http-errorin the package settings (OIDC publishing, no token).@udiboscope as the repository secretNPM_TOKEN.RELEASE_ENABLED=true.feat:title; the release job publishes 0.12.0 to npm (with provenance) and JSR and tags it.@udibo/http-error: organizationudibo, repositoryhttp-error, workflowci.yml, no environment.NPM_TOKENsecret and revoke the token.Squash-merge with a
feat:title (no!); the release rules treat breaking changes as minor releases while the version is 0.x, so 0.12.0 is the result either way.🤖 Generated with Claude Code