{"_id":"@booga/vrenderer","_rev":"2-b6cf44228c79bfc0f0e268ab9a3f5ff0","name":"@booga/vrenderer","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@booga/vrenderer","version":"0.1.0","author":{"name":"bvasilenko"},"license":"MIT","_id":"@booga/vrenderer@0.1.0","maintainers":[{"name":"dreaktor","email":"me@dreaktor.com"}],"dist":{"shasum":"ef8bac88bd31af1fd862b0afc5bd0f0fe0b63442","tarball":"https://registry.npmjs.org/@booga/vrenderer/-/vrenderer-0.1.0.tgz","fileCount":9,"integrity":"sha512-FLD3oQC9dVsJf8SDA//1R1a0ncaQpmhjGNQFvBQdtv8HmNuyC/2dk4/Z6Ta7iAI+YrQB3uJOUkYgC+kxJuuqnQ==","signatures":[{"sig":"MEYCIQDbs6M5FqmMwdDx7eyksD9tzLjolg5PsIwpAqse1O32QAIhANXhc6spem015l4XCjjZZrgXxf2SJouXBkxQ71XnKa4H","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69964},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"179eeb6feee86d6dde908dd2d803ed3f2c298685","scripts":{"dev":"tsup --watch","lint":"eslint .","test":"vitest run --coverage","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"dreaktor","email":"me@dreaktor.com"},"_npmVersion":"10.9.3","description":"Static React renderer. Walks a component tree, emits HTML with Tailwind class strings and data-class token maps. Server-only, hydration-free, deterministic.","directories":{},"sideEffects":false,"_nodeVersion":"22.19.0","dependencies":{"@booga/vdsl":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","react":"^18.0.0","eslint":"^9.0.0","vitest":"^2.1.0","globals":"^15.0.0","@eslint/js":"^9.0.0","typescript":"^5.0.0","@types/node":"^25.7.0","@types/react":"^18.3.0","typescript-eslint":"^8.0.0","@vitejs/plugin-react":"^4.0.0","@vitest/coverage-istanbul":"^2.1.9"},"peerDependencies":{"react":"^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vrenderer_0.1.0_1778662163927_0.6745507465519893","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@booga/vrenderer","version":"0.1.1","description":"Static React renderer. Walks a component tree, emits HTML with Tailwind class strings and data-class token maps. Server-only, hydration-free, deterministic.","type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"tsc --noEmit","lint":"eslint .","test":"vitest run --coverage","test:watch":"vitest"},"dependencies":{"@booga/vdsl":"^0.2.0"},"peerDependencies":{"react":"^18.0.0"},"devDependencies":{"@eslint/js":"^9.0.0","@types/node":"^25.7.0","@types/react":"^18.3.0","@vitejs/plugin-react":"^4.0.0","@vitest/coverage-istanbul":"^2.1.9","eslint":"^9.0.0","globals":"^15.0.0","react":"^18.0.0","tsup":"^8.0.0","typescript":"^5.0.0","typescript-eslint":"^8.0.0","vitest":"^2.1.0"},"publishConfig":{"access":"public"},"license":"MIT","author":{"name":"bvasilenko"},"_id":"@booga/vrenderer@0.1.1","gitHead":"2fc0e84c12b61f6a33c0c96373038ee14e01fb13","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-L1zxKA440Wc+YxRCzhW8MAoYaMS3mMR11stP2KZPYfx7CebMS0Hd6OAYVCt6sLKgiXPbGzfljrxYwvyL/d0VEQ==","shasum":"d338a349a71a55e61f6cf5ba09593000f1019bd9","tarball":"https://registry.npmjs.org/@booga/vrenderer/-/vrenderer-0.1.1.tgz","fileCount":9,"unpackedSize":69964,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAXo9p43zq97O/n2sNpEvosQT8RQkOsCt8N5GNH8CX4hAiEAl7t+m1uyYa51gByUGU9xczsrN2BarBihf+QEiSfDFyA="}]},"_npmUser":{"name":"dreaktor","email":"me@dreaktor.com"},"directories":{},"maintainers":[{"name":"dreaktor","email":"me@dreaktor.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vrenderer_0.1.1_1779126007709_0.11983897420848799"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-13T08:49:23.804Z","modified":"2026-05-18T17:40:08.004Z","0.1.0":"2026-05-13T08:49:24.053Z","0.1.1":"2026-05-18T17:40:07.866Z"},"author":{"name":"bvasilenko"},"license":"MIT","description":"Static React renderer. Walks a component tree, emits HTML with Tailwind class strings and data-class token maps. Server-only, hydration-free, deterministic.","maintainers":[{"name":"dreaktor","email":"me@dreaktor.com"}],"readme":"# vRenderer\n\nStatic React renderer. Walks a component tree, emits deterministic HTML with Tailwind class strings and `data-class` token maps. Server-only; hydration-free. Downstream `vSsg` ingests the `data-class` attributes for semantic CSS rewrite.\n\n## Install\n\n```sh\nnpm install @booga/vrenderer\n```\n\nPeer dependency: `react ^18`.\n\n## Usage\n\n```ts\nimport { render, renderToFile } from \"@booga/vrenderer\";\nimport { createElement } from \"react\";\n\nconst html = render(createElement(\"div\", { p: 2, variant: \"primary\" }, \"hello\"));\n// → <div class=\"p-2 variant-primary\" data-class=\"p-2 variant-primary\">hello</div>\n\nawait renderToFile(tree, \"./out/index.html\");\n```\n\n## API\n\n### `render(tree, options?): string`\n\nSynchronous. Throws if called in a browser environment (use `allowBrowser: true` in tests).\n\n### `renderToFile(tree, path, options?): Promise<void>`\n\nCalls `render()`, writes result to `path` as UTF-8.\n\n### `RenderOptions`\n\n| Option | Default | Description |\n|---|---|---|\n| `pretty` | `false` | Indent output with two spaces per nesting level |\n| `sortAttrs` | `true` | Sort HTML attributes lexicographically |\n| `emitDataClass` | `true` | Emit `data-class` attribute from DSL token props |\n| `allowBrowser` | `false` | Suppress server-only guard (testing only) |\n\n## DSL props\n\nProps from `@booga/vdsl` (`p`, `m`, `variant`, `size`, `bg`, …) are partitioned before emit:\n\n- removed from the raw HTML attribute set\n- compiled to a `class` string via `resolveClasses`\n- mirrored to `data-class` via `extractDataClass`\n\n`className` merges with any DSL-derived class into a single `class` attribute.\n\n## What is emitted\n\n- Void tags (`img`, `br`, `input`, …) self-close\n- Event handlers (`on*`) stripped\n- `key` and `ref` stripped\n- `style` objects serialized to inline CSS\n- `dangerouslySetInnerHTML.__html` emitted raw\n- Text content and attribute values HTML-escaped\n\n## Code of conduct\n\n[Contributor Covenant 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/)\n\n## License\n\nMIT © 2026 bvasilenko\n","readmeFilename":"README.md"}