Registry / serialization / paperclip-compiler-base-jsx

paperclip-compiler-base-jsx

JSON →
library18.3.8jsnpmunverified

A JSX-specific base compiler for Paperclip, version 18.3.8. Paperclip is a design-to-code tool that compiles HTML templates into various frameworks. This package provides the core JSX compilation logic, intended for use within the Paperclip ecosystem. It is likely used internally by other Paperclip compilers and may not be directly consumed. Release cadence is tied to the Paperclip monorepo. Key differentiator: focuses on JSX output, handling HTML-to-JSX transformations.

npm install paperclip-compiler-base-jsx
INSTALL
IMPORT
SIG · PAPERCLIP-COMPILER
P
paperclip-compiler-base-jsx
serializationjavascriptv18.3.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compileJSX
import { compileJSX } from 'paperclip-compiler-base-jsx';
const compileJSX = require('paperclip-compiler-base-jsx');
ESM-only; no default export, named export only.
createJSXCompiler
import { createJSXCompiler } from 'paperclip-compiler-base-jsx';
import createJSXCompiler from 'paperclip-compiler-base-jsx';
Not a default export; use named import.
JSXCompilerOptions
import { JSXCompilerOptions } from 'paperclip-compiler-base-jsx';
import { JsxCompilerOptions } from 'paperclip-compiler-base-jsx';
TypeScript type; case-sensitive.

Shows basic usage of compileJSX to transform HTML to JSX code.

import { compileJSX } from 'paperclip-compiler-base-jsx'; const html = '<div class="container"><span>Hello</span></div>'; const result = compileJSX(html, { module: 'esm', jsxPragma: 'React.createElement' }); console.log(result.code); // Expected output: "React.createElement('div', { className: 'container' }, React.createElement('span', null, 'Hello'))"
Debug
Known issues
breakingVersion 18.x drops support for Node.js < 14.
fix
Upgrade Node.js to 14+ or use paperclip-compiler-base-jsx@17.
affects: >=18.0.0
breakingNamed export 'compileJSX' replaces former default export compileJSX() in v18.
fix
Change import from default to named: import { compileJSX } from 'paperclip-compiler-base-jsx'.
affects: >=18.0.0
deprecatedOptions property 'pragma' is deprecated in v18, use 'jsxPragma' instead.
fix
Replace 'pragma' with 'jsxPragma' in options object.
affects: >=18.0.0
gotchaCompiler expects strict HTML compliance; self-closing tags must be closed (e.g., `<br />`).
fix
Ensure HTML is valid XML/XHTML before passing to compileJSX.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'paperclip-compiler-base-jsx'
Package not installed or not in node_modules.
fix
Run `npm install paperclip-compiler-base-jsx@18.3.8`.
compileJSX is not a function
Incorrect import (default vs named) in version 18+.
fix
Use import { compileJSX } from 'paperclip-compiler-base-jsx'.
TypeError: Cannot destructure property 'code' of undefined
Failed compilation due to malformed HTML.
fix
Ensure input HTML is valid and call compileJSX with correct options.
Upgrade
Version history
18.3.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
paperclip-compiler-base-jsx — npm install paperclip-compiler-base-jsx · libregistry