Registry / web-framework / polysol-js-core

polysol-js-core

JSON →
library1.0.1jsnpmunverified

PolySol-JS is a modular transpiler that converts JavaScript/TypeScript source code into an intermediate JSON representation (IR) and then into Solidity smart contracts. Version 1.0.1 is the current stable release. The project is in early stages with no public npm release, only installation via git clone. Its key differentiators are a standardized IR decoupling parsing from code generation, enabling extensibility to other source languages and target blockchains, and an educational focus on transpiler internals. Alternatives like Sol2Ink compile Solidity to Rust, while PolySol-JS targets Solidity from JS/TS.

npm install polysol-js-core
INSTALL
IMPORT
SIG · POLYSOL-JS-CORE
P
polysol-js-core
web-frameworkjavascriptv1.0.1
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.

PolySol
import { PolySol } from 'polysol-js-core'
const PolySol = require('polysol-js-core')
ESM-only; package does not provide CommonJS exports.
IRSchema
import { IRSchema } from 'polysol-js-core/ir'
import { IRSchema } from 'polysol-js-core'
IRSchema is in a subpath; not exported from main entry.
Parser
import { Parser } from 'polysol-js-core/parser'
import Parser from 'polysol-js-core'
Parser is a named export from a subpath, not default export.

Shows how to transpile a JS file to Solidity using the modular parser and generator.

import { parseJavaScript } from 'polysol-js-core/parser'; import { generateSolidity } from 'polysol-js-core/generator'; import { readFileSync } from 'fs'; const sourceCode = readFileSync('contract.js', 'utf8'); const ir = parseJavaScript(sourceCode); // returns IR object const solidityCode = generateSolidity(ir); console.log(solidityCode);
Debug
Known issues
breakingESM-only: Package does not support CommonJS require().
fix
Use import syntax or configure Node.js for ESM (type: 'module' in package.json).
affects: >=1.0.0
gotchaSubpath exports: Core symbols are not re-exported from the main entry.
fix
Import directly from subpaths like 'polysol-js-core/parser', 'polysol-js-core/generator'.
affects: >=1.0.0
deprecatedNo public npm registry: Install via git clone only.
fix
Run: git clone https://github.com/your-username/polysol-js.git
affects: >=0.0.0
gotchaRequires Node.js v14+; older versions will throw syntax errors.
fix
Upgrade Node.js to v14 or higher.
affects: >=1.0.0
gotchaParser and generator prototypes; actual transpilation is not yet implemented.
fix
Check repository roadmap; currently using the IR schema only.
affects: >=1.0.0
deprecatednpm start command may not work due to missing build step.
fix
Run 'npm run build' first, then 'npm start' (if scripts are configured).
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'polysol-js-core'
Package not published to npm; installed via git clone.
fix
Install locally: npm install /path/to/polysol-js
require() of ES Module not supported
Package is ESM-only, CommonJS require() fails.
fix
Use import syntax or set type: 'module' and use import().
Module 'polysol-js-core' has no exported member 'IRSchema'
Importing from main entry instead of subpath 'polysol-js-core/ir'.
fix
Use import { IRSchema } from 'polysol-js-core/ir'
SyntaxError: Unexpected token 'export'
Running as CommonJS without ESM support.
fix
Add "type": "module" to package.json or use .mjs extension.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
typescriptoptionalUsed for TypeScript compilation; listed as devDependency but needed for development.
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
polysol-js-core — npm install polysol-js-core · libregistry