Registry / devops / smartface-transpiler

smartface-transpiler

JSON →
library6.9.17-beta.5jsnpmunverified

Transpiles JavaScript/TypeScript code for Smartface platform, enabling cross-platform mobile app development. Current stable version is 6.9.17-beta.5. This package is central to Smartface's build pipeline, converting standard JS/TS to Smartface-compatible code with platform-specific polyfills and module resolution. It differentiates by tightly integrating with Smartface's runtime and providing custom AST transformations. Release cadence is irregular with beta versions for new features.

npm install smartface-transpiler
INSTALL
IMPORT
SIG · SMARTFACE-TRANSPIL
S
smartface-transpiler
devopsjavascriptv6.9.17-beta.5
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.

transpile
import { transpile } from 'smartface-transpiler'
const transpile = require('smartface-transpiler').transpile
ESM-only exports in v6; CommonJS not supported.
TranspileOptions
import type { TranspileOptions } from 'smartface-transpiler'
import { TranspileOptions } from 'smartface-transpiler'
Type import only for TypeScript users; it is not a value.
default
import transpile from 'smartface-transpiler'
import { default as transpile } from 'smartface-transpiler'
Default export is the transpile function itself.

Shows basic transpilation of a JavaScript snippet targeting Android platform with CommonJS modules.

import { transpile } from 'smartface-transpiler'; const sourceCode = ` const x = 1; console.log(x); `; const result = transpile(sourceCode, { platform: 'android', moduleType: 'commonjs', sourceType: 'script', }); console.log(result.code); console.log(result.map);
Debug
Known issues
breakingIn v6, the transpile function changed from a synchronous to an asynchronous API.
fix
Use async/await or .then() when calling transpile.
affects: >=6.0.0 <6.9.17
deprecatedUse of 'options.platform' with value 'ios' is deprecated; use 'iosx' instead.
fix
Replace 'ios' with 'iosx' in platform option.
affects: >=6.5.0
gotchaThe transpiler expects source type 'module' for ES module code; using 'script' will cause syntax errors on imports.
fix
Set sourceType to 'module' when transpiling ES modules.
affects: >=6.0.0
gotchaTypeScript support requires additional plugins; transpiler alone does not strip types.
fix
Use the Smartface TypeScript plugin or preprocess with tsc.
affects: >=6.0.0
breakingIn v6.9, the output code format changed: all functions are now wrapped in IIFEs.
fix
Review generated code for compatibility if relying on global function declarations.
affects: >=6.9.0
Errors
Common errors & fixes
TypeError: transpile is not a function
Importing incorrectly (e.g., using require instead of ES import).
fix
Use import { transpile } from 'smartface-transpiler'; or import transpile from 'smartface-transpiler'; if using default export.
Error: No platform specified
Missing required 'platform' option in transpile call.
fix
Add platform: 'android' or 'iosx' to options object.
SyntaxError: Unexpected token 'export'
sourceType is set to 'script' but code contains ES module syntax.
fix
Set sourceType: 'module' in options for ES module code.
Module not found: 'smartface-transpiler'
Package not installed or not in node_modules.
fix
Run npm install smartface-transpiler --save or yarn add smartface-transpiler.
Upgrade
Version history
6.9.17-beta.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
smartface-transpiler — npm install smartface-transpiler · libregistry