{"id":27402,"library":"smartface-transpiler","title":"Smartface Transpiler","description":"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.","status":"active","version":"6.9.17-beta.5","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install smartface-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add smartface-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add smartface-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only exports in v6; CommonJS not supported.","wrong":"const transpile = require('smartface-transpiler').transpile","symbol":"transpile","correct":"import { transpile } from 'smartface-transpiler'"},{"note":"Type import only for TypeScript users; it is not a value.","wrong":"import { TranspileOptions } from 'smartface-transpiler'","symbol":"TranspileOptions","correct":"import type { TranspileOptions } from 'smartface-transpiler'"},{"note":"Default export is the transpile function itself.","wrong":"import { default as transpile } from 'smartface-transpiler'","symbol":"default","correct":"import transpile from 'smartface-transpiler'"}],"quickstart":{"code":"import { transpile } from 'smartface-transpiler';\n\nconst sourceCode = `\nconst x = 1;\nconsole.log(x);\n`;\n\nconst result = transpile(sourceCode, {\n  platform: 'android',\n  moduleType: 'commonjs',\n  sourceType: 'script',\n});\n\nconsole.log(result.code);\nconsole.log(result.map);","lang":"typescript","description":"Shows basic transpilation of a JavaScript snippet targeting Android platform with CommonJS modules."},"warnings":[{"fix":"Use async/await or .then() when calling transpile.","message":"In v6, the transpile function changed from a synchronous to an asynchronous API.","severity":"breaking","affected_versions":">=6.0.0 <6.9.17"},{"fix":"Replace 'ios' with 'iosx' in platform option.","message":"Use of 'options.platform' with value 'ios' is deprecated; use 'iosx' instead.","severity":"deprecated","affected_versions":">=6.5.0"},{"fix":"Set sourceType to 'module' when transpiling ES modules.","message":"The transpiler expects source type 'module' for ES module code; using 'script' will cause syntax errors on imports.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Use the Smartface TypeScript plugin or preprocess with tsc.","message":"TypeScript support requires additional plugins; transpiler alone does not strip types.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Review generated code for compatibility if relying on global function declarations.","message":"In v6.9, the output code format changed: all functions are now wrapped in IIFEs.","severity":"breaking","affected_versions":">=6.9.0"}],"env_vars":null,"search_vec":"'6.9.17':20 'app':14 'ast':59 'beta':66 'beta.5':21 'build':29 'cadenc':62 'central':25 'code':5,38 'compat':37 'convert':31 'cross':11 'cross-platform':10 'current':16 'custom':58 'develop':15 'differenti':48 'enabl':9 'featur':70 'integr':51 'irregular':64 'javascript':71 'javascript/typescript':4 'js/ts':33 'mobil':13 'modul':45 'new':69 'packag':23 'pipelin':30 'platform':8,12,41 'platform-specif':40 'polyfil':43 'provid':57 'releas':61 'resolut':46 'runtim':55 'smartfac':1,7,27,36,53 'smartface-compat':35 'specif':42 'stabl':17 'standard':32 'tight':50 'transform':60 'transpil':2,3 'version':18,67","created_at":"2026-05-01T17:46:04.365191+00:00","updated_at":"2026-05-01T17:46:04.365191+00:00","problems":[{"fix":"Use import { transpile } from 'smartface-transpiler'; or import transpile from 'smartface-transpiler'; if using default export.","cause":"Importing incorrectly (e.g., using require instead of ES import).","error":"TypeError: transpile is not a function"},{"fix":"Add platform: 'android' or 'iosx' to options object.","cause":"Missing required 'platform' option in transpile call.","error":"Error: No platform specified"},{"fix":"Set sourceType: 'module' in options for ES module code.","cause":"sourceType is set to 'script' but code contains ES module syntax.","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Run npm install smartface-transpiler --save or yarn add smartface-transpiler.","cause":"Package not installed or not in node_modules.","error":"Module not found: 'smartface-transpiler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://smartface.io","github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/smartface-transpiler","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}