From e641c33f560902e3df6b4cac06a56e680d237863 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Sat, 28 Feb 2026 01:42:09 +0000 Subject: [PATCH] Rename package to @nym.sh/jrx Co-authored-by: Ona --- .devcontainer/devcontainer.json | 2 +- README.md | 28 +++++++++---------- example/bun.lock | 10 +++---- example/components.ts | 14 +++++----- example/package.json | 4 +-- example/specs/full.tsx | 4 +-- example/specs/simple.tsx | 6 ++--- example/src/App.tsx | 2 +- example/src/index.html | 2 +- example/src/server.ts | 2 +- package.json | 2 +- src/index.ts | 4 +-- src/integration.test.tsx | 48 ++++++++++++++++----------------- src/jsx-runtime.ts | 32 +++++++++++----------- src/jsx.test.tsx | 14 +++++----- src/render.test.tsx | 6 ++--- src/render.ts | 24 ++++++++--------- src/spec-validator.test.tsx | 8 +++--- src/test-components.ts | 22 +++++++-------- src/types.ts | 44 +++++++++++++++--------------- tsconfig.json | 6 ++--- 21 files changed, 142 insertions(+), 142 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 816e67a..8bbedf9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "jsonsx", + "name": "@nym.sh/jrx", "build": { "context": ".", "dockerfile": "Dockerfile" diff --git a/README.md b/README.md index fe22f12..4bd53c0 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ -# jsonsx +# @nym.sh/jrx JSX factory for [json-render](https://github.com/vercel-labs/json-render). Write JSX, get Spec JSON. ## Install ```bash -bun add jsonsx @json-render/core +bun add @nym.sh/jrx @json-render/core ``` ## Setup -Configure your `tsconfig.json` to use jsonsx as the JSX source: +Configure your `tsconfig.json` to use @nym.sh/jrx as the JSX source: ```json { "compilerOptions": { "jsx": "react-jsx", - "jsxImportSource": "jsonsx" + "jsxImportSource": "@nym.sh/jrx" } } ``` @@ -24,7 +24,7 @@ Configure your `tsconfig.json` to use jsonsx as the JSX source: Or use a per-file pragma: ```tsx -/** @jsxImportSource jsonsx */ +/** @jsxImportSource @nym.sh/jrx */ ``` ## Usage @@ -34,18 +34,18 @@ Or use a per-file pragma: Create wrapper functions that map JSX tags to json-render component type names: ```ts -import { jsx } from "jsonsx/jsx-runtime"; -import type { JsonsxNode } from "jsonsx"; +import { jsx } from "@nym.sh/jrx/jsx-runtime"; +import type { JrxNode } from "@nym.sh/jrx"; -export function Stack(props: Record): JsonsxNode { +export function Stack(props: Record): JrxNode { return jsx("Stack", props); } -export function Text(props: Record): JsonsxNode { +export function Text(props: Record): JrxNode { return jsx("Text", props); } -export function Button(props: Record): JsonsxNode { +export function Button(props: Record): JrxNode { return jsx("Button", props); } ``` @@ -53,12 +53,12 @@ export function Button(props: Record): JsonsxNode { ### Render JSX to Spec JSON ```tsx -import { render } from "jsonsx"; +import { render } from "@nym.sh/jrx"; import { Stack, Text, Button } from "./components"; const spec = render( - +