{"id":25770,"library":"isomor-transpiler","title":"Isomor Transpiler","description":"The isomor-transpiler package (v3.0.4) is the Babel-based transpiler for isomor, a full-stack framework that automatically generates API layers between frontend and backend in a single TypeScript project. Instead of writing REST/GraphQL endpoints, isomor transpiler extracts server-side function calls from client code and creates the necessary communication stubs. This package handles the actual transpilation of .ts/.tsx files, converting decorated functions into fetch calls. It is part of the isomor ecosystem, which aims to reduce boilerplate and enforce type safety across the stack. Release cadence is irregular but maintained. Key differentiator: seamless integration with TypeScript, allowing direct imports of server functions without manual API definition.","status":"active","version":"3.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/apiel/isomor","tags":["javascript","typescript"],"install":[{"cmd":"npm install isomor-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add isomor-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add isomor-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core Babel compiler used for transpilation","package":"@babel/core","optional":false},{"reason":"The main framework uses this transpiler internally","package":"isomor","optional":true}],"imports":[{"note":"ESM-only package; CJS require will fail with ERR_REQUIRE_ESM. Use dynamic import if needed.","wrong":"const transpiler = require('isomor-transpiler')","symbol":"default","correct":"import transpiler from 'isomor-transpiler'"},{"note":"Type-only import to avoid runtime side effects; recommended for TypeScript users.","wrong":"import { TransformOptions } from 'isomor-transpiler'","symbol":"TransformOptions","correct":"import type { TransformOptions } from 'isomor-transpiler'"},{"note":"Direct named import; no known wrong pattern.","wrong":"import { transformSync } from 'isomor-transpiler'","symbol":"transformSync","correct":"import { transformSync } from 'isomor-transpiler'"}],"quickstart":{"code":"import transpiler from 'isomor-transpiler';\nimport { transformSync } from '@babel/core';\n\nconst code = `\n  import { getUsers } from '../server/user';\n  // @isomor is added automatically by the transpiler\n  export default function MyComponent() {\n    getUsers().then(console.log);\n  }\n`;\n\nconst result = transpiler.transform(code, {\n  filename: 'MyComponent.tsx',\n  sourceMaps: true\n});\n\nconsole.log(result.code);","lang":"typescript","description":"Demonstrates how to use the transpiler to process a TypeScript file, transforming server imports into API calls. Requires Babel core."},"warnings":[{"fix":"Update Node.js to v11 or later. If using older Node, stick with v2.x.","message":"Node.js >=11 required; requires ESM support.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Ensure any server functions used in client code are side-effect free and do not rely on Node built-ins.","message":"The transpiler output is designed to be used in a browser context; some Node.js specific APIs may not be polyfilled.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Replace transpiler.transform with transpiler.transformSync for synchronous use, or use async APIs.","message":"The 'transform' function is deprecated in favor of 'transformSync' for synchronous usage.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Enable Babel decorator plugin and set isomor-related options in babel config.","message":"TypeScript decorators may not be fully supported; ensure @isomor decorator is used correctly.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Use inline source maps or verify with tool-specific settings.","message":"Source maps may be inaccurate if input code contains multiple imports from isomor server modules.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install isomor-transpiler (and ensure ESM context). If using CommonJS, use dynamic import.","cause":"Package not installed or ESM-only; requires 'type': 'module' in package.json or .mjs extension.","error":"Error: Cannot find module 'isomor-transpiler'"},{"fix":"Switch to import syntax: import transpiler from 'isomor-transpiler'","cause":"Using require() on ESM-only package; the package exports a default function but is not wrapped for CJS.","error":"TypeError: isomor_transpiler_1.default is not a function"},{"fix":"Set sourceType: 'module' in Babel config or pass options to transpiler: { sourceType: 'module' }","cause":"The input code has top-level export but the transpiler may be configured in a non-module mode.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}