From fbf13ed44462a0537aba65e107196c9538e1f4d2 Mon Sep 17 00:00:00 2001 From: "glm-5.1" Date: Tue, 19 May 2026 07:15:45 +0000 Subject: [PATCH] fix: update platform support docs for cross-runtime compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - README: Node.js 18+ → Node.js 18+, Deno, and Bun - package.json: add deno:true field - build-distribution.md: consolidate engine/platform sections --- README.md | 2 +- deno.lock | 1 + docs/architecture/build-distribution.md | 18 +++--------------- package.json | 5 +++-- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 62e3e7a..8c772e4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ UJSX treats JSX as an intermediate representation for multi-target rendering. Th npm install @alkdev/ujsx ``` -Requires Node.js 18+. Dual ESM/CJS output with TypeScript declarations. +Works in Node.js 18+, Deno, and Bun. Ships dual ESM/CJS with TypeScript declarations. No Node-specific APIs in core — runs anywhere `@preact/signals-core` and `@alkdev/typebox` do. ## Quick Start diff --git a/deno.lock b/deno.lock index 36af30e..4a0357b 100644 --- a/deno.lock +++ b/deno.lock @@ -33,6 +33,7 @@ ], "packageJson": { "dependencies": [ + "npm:@alkdev/pubsub@0.1", "npm:@alkdev/typebox@~0.34.49", "npm:@preact/signals-core@^1.14.1", "npm:@types/node@22", diff --git a/docs/architecture/build-distribution.md b/docs/architecture/build-distribution.md index b9c0a3f..1b5704a 100644 --- a/docs/architecture/build-distribution.md +++ b/docs/architecture/build-distribution.md @@ -122,23 +122,11 @@ Preact signals-core is the reactive layer. `ValuePointer` wraps `signal`, `Co No runtime dev dependencies. No test framework besides Vitest. No linter configuration (type checking via `tsc --noEmit` serves as the static analysis step). -## Engine Requirements +## Platform Support -```json -"engines": { "node": ">=18.0.0" } -``` +UJSX runs in Node.js 18+, Deno, and Bun. Core has no Node-specific API calls — no `fs`, `path`, `child_process`, or other builtins. `src/core/` and `src/transform/` are fully platform-agnostic. -Node 18 is the minimum for ESM support, `structuredClone`, and stable `fetch`. UJSX does not use Node-specific APIs in its core module paths — no `fs`, no `path`, no `child_process`. Platform-specific features (file I/O, Node APIs) should go in separate packages. - -## Platform Agnosticism - -UJSX core is platform-agnostic. It runs in: -- Node.js 18+ -- Deno (with npm specifiers) -- Bun -- Any browser that supports ESM and the `@preact/signals-core` package - -There are no Node-specific API calls in `src/core/` or `src/transform/`. The `src/host/` directory contains host configurations, but these are also platform-agnostic — they define what "create instance" and "update instance" mean for a given target, not how to interact with Node.js APIs. +The `engines` field in `package.json` specifies Node as a lower bound for npm consumers. Deno support is provided via `deno.json` with direct source imports. ## Published Files diff --git a/package.json b/package.json index b60c8ad..fd40277 100644 --- a/package.json +++ b/package.json @@ -146,5 +146,6 @@ }, "engines": { "node": ">=18.0.0" - } -} \ No newline at end of file + }, + "deno": true +}