Registry / devops / sui-ts-transpiler-advanced

sui-ts-transpiler-advanced

JSON →
library1.0.0jsnpmunverified

A CLI tool and SDK (v1.0.0) that converts TypeScript smart contracts to Sui Move language with full logic preservation, not just structural mapping. Released as an initial stable version, it offers commands for project init, transpilation, and build. Key differentiators include support for classes, type mappings (string→vector<u8>, number→u64, bigint→u256), and programmatic usage via import. Suitable for developers working with Sui blockchain who prefer TypeScript over Move.

npm install sui-ts-transpiler-advanced
INSTALL
IMPORT
SIG · SUI-TS-TRANSPILER-
S
sui-ts-transpiler-advanced
devopsjavascriptv1.0.0
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.

SuiMoveTranspiler
import { SuiMoveTranspiler } from 'sui-ts-transpiler-advanced'
const SuiMoveTranspiler = require('sui-ts-transpiler-advanced')
ESM-only; CJS require not supported in v1.0.0
default
import SuiMoveTranspiler from 'sui-ts-transpiler-advanced'
import { SuiMoveTranspiler } from 'sui-ts-transpiler-advanced'
Default export available; named import also works but default is preferred for single-class usage
SuiMoveTranspilerOptions
import type { SuiMoveTranspilerOptions } from 'sui-ts-transpiler-advanced'
Type-only import for TypeScript; no runtime value

Programmatic usage of sui-ts-transpiler-advanced to transpile a TypeScript class to Sui Move

import { SuiMoveTranspiler } from 'sui-ts-transpiler-advanced'; const transpiler = new SuiMoveTranspiler({ outputDir: 'build', moduleName: 'my_contract', packageName: 'my_package' }); const tsCode = ` class Token { private name: string; private supply: number; constructor(name: string, supply: number) { this.name = name; this.supply = supply; } } `; const result = transpiler.transpile(tsCode); if (result.success) { console.log('Generated Move code:', result.moveCode); } else { console.error('Errors:', result.errors); }
sui-ts --version
Debug
Known issues
breakingRequires Node >=16.0.0; lower versions will fail to load the package.
fix
Upgrade Node.js to version 16+.
affects: <16.0.0
breakingESM-only package; attempting require() will throw ERR_REQUIRE_ESM.
fix
Use import syntax or dynamic import() instead of require().
affects: >=1.0.0
deprecatedThe --verbose flag is deprecated in favor of environment variable DEBUG=sui-ts-transpiler.
fix
Use DEBUG=sui-ts-transpiler sui-ts transpile instead of -v/--verbose.
affects: >=1.0.0
gotchaTypeScript private fields are not transpiled to Move private fields; Move uses module-level visibility.
fix
All class fields become public struct fields in Move; adjust security assumptions.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/sui-ts-transpiler-advanced/index.js from /path/to/file.js not supported.
Package is ESM-only; CommonJS require() is not supported.
fix
Convert your file to ES module (use 'type': 'module' in package.json) or use dynamic import() instead.
SyntaxError: Cannot use import statement outside a module
The import statement is used in a CommonJS file.
fix
Add 'type': 'module' to your package.json or rename file to .mjs.
TypeError: Class constructor SuiMoveTranspiler cannot be invoked without 'new'
SuiMoveTranspiler must be instantiated with the new keyword; it is not a factory function.
fix
Use 'new SuiMoveTranspiler(options)' instead of calling it as a function.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
typescriptoptionalFor transpiling TypeScript source code
Agent activity
4 hits · last 30 days
node
4
Resources
sui-ts-transpiler-advanced — npm install sui-ts-transpiler-advanced · libregistry