{"id":26516,"library":"ts2asl","title":"ts2asl","description":"ts2asl is a TypeScript-to-AWS State Language (ASL) transpiler that converts TypeScript code into Amazon States Language JSON, enabling developers to author AWS Step Functions using standard TypeScript syntax. Version 0.1.0 is the initial release with a focus on a subset of TypeScript features, including variables, conditionals, loops, and async/await. It targets Node >=12.0.0 and ships TypeScript types. Key differentiators vs direct ASL authoring: static type checking, IDE support, and the ability to use familiar programming constructs. Current limitations include no support for classes, enums, or complex generics. Release cadence is not yet established as it is a young project.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/Stedi/ts2asl","tags":["javascript","oclif","typescript"],"install":[{"cmd":"npm install ts2asl","lang":"bash","label":"npm"},{"cmd":"yarn add ts2asl","lang":"bash","label":"yarn"},{"cmd":"pnpm add ts2asl","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only; CommonJS require is not supported.","wrong":"const ts2asl = require('ts2asl')","symbol":"default","correct":"import ts2asl from 'ts2asl'"},{"note":"Named export compile() is the main entry point for transpilation.","wrong":"const { compile } = require('ts2asl')","symbol":"compile","correct":"import { compile } from 'ts2asl'"},{"note":"Use type import for TypeScript types to avoid runtime import.","wrong":"import { CompileOptions } from 'ts2asl'","symbol":"CompileOptions","correct":"import type { CompileOptions } from 'ts2asl'"}],"quickstart":{"code":"import { compile } from 'ts2asl';\n\nconst code = `\nasync function myFunction(input: { name: string }): Promise<string> {\n  const greeting = \"Hello, \" + input.name;\n  return greeting;\n}\n`;\n\nconst result = compile(code, {\n  fileName: 'myFunction.ts',\n  target: 'stepfunctions'\n});\n\nconsole.log(JSON.stringify(result.asl, null, 2));","lang":"typescript","description":"Converts a simple TypeScript async function into AWS Step Functions ASL format using compile()."},"warnings":[{"fix":"Refactor code to use only functions, variables, conditionals, loops, and async/await.","message":"ts2asl v0.1.0 does not support TypeScript classes, enums, or namespaces. Using these will cause compile errors or undefined behavior.","severity":"breaking","affected_versions":"0.1.0"},{"fix":"Check the supported features list: https://github.com/Stedi/ts2asl#supported-features","message":"Only a subset of JavaScript/TypeScript built-ins are supported. For example, Array.map, Promise.all, etc. may be silently ignored or cause errors.","severity":"gotcha","affected_versions":"0.1.0"},{"fix":"Ensure 'type': 'module' is set in your package.json.","message":"The package is ESM-only and requires Node.js >=12.0.0 with 'type': 'module' in package.json or .mjs extension.","severity":"gotcha","affected_versions":"0.1.0"},{"fix":"Stay tuned for future versions.","message":"No deprecation notices yet for v0.1.0 as it's the first release.","severity":"deprecated","affected_versions":"0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install ts2asl' and ensure 'type':'module' in package.json.","cause":"Package not installed or ESM configuration missing.","error":"Error: Cannot find module 'ts2asl'"},{"fix":"Use 'import { compile } from 'ts2asl'' instead of 'require'.","cause":"Using CommonJS require instead of ESM import.","error":"TypeError: compile is not a function"},{"fix":"Set 'type':'module' in package.json or use .mjs extension.","cause":"Running ESM code in a non-ESM context (e.g., Node.js <12 or CJS environment).","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Replace class with functions and objects.","cause":"ts2asl does not support classes in the current version.","error":"Error: Unsupported construct: ClassDeclaration"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}