
Product
Introducing Manifest Alerts
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.
@isl-lang/codegen
Advanced tools
ISL code generators - umbrella package for all code generation targets
ISL code generators - umbrella package for all code generation targets.
npm install @isl-lang/codegen
For individual generators (better tree-shaking):
npm install @isl-lang/codegen-python
npm install @isl-lang/codegen-openapi
npm install @isl-lang/codegen-graphql
import { generatePython, generateOpenAPI, generateGraphQL } from '@isl-lang/codegen';
import { parse } from '@isl-lang/parser';
const ast = parse(`
domain UserAPI {
type User {
id: uuid
name: string
email: email
}
intent CreateUser {
input { name: string, email: email }
output { user: User }
}
}
`);
// Generate Python (Pydantic + FastAPI)
const pythonCode = generatePython(ast, {
framework: 'fastapi',
pydantic: 'v2',
});
// Generate OpenAPI 3.1 spec
const openapi = generateOpenAPI(ast, {
info: { title: 'User API', version: '1.0.0' },
});
// Generate GraphQL schema
const graphql = generateGraphQL(ast);
| Generator | Package | Description |
|---|---|---|
| Python | @isl-lang/codegen-python | Pydantic models, FastAPI/Flask endpoints |
| OpenAPI | @isl-lang/codegen-openapi | OpenAPI 3.1 specifications |
| GraphQL | @isl-lang/codegen-graphql | GraphQL schemas and resolvers |
| TypeScript | @isl-lang/codegen-types | TypeScript types and interfaces |
| Rust | @isl-lang/codegen-rust | Rust structs with serde |
| Go | @isl-lang/codegen-go | Go structs and handlers |
| Validators | @isl-lang/codegen-validators | Runtime validators |
| Tests | @isl-lang/codegen-tests | Test cases from contracts |
| Mocks | @isl-lang/codegen-mocks | Mock implementations |
| Docs | @isl-lang/codegen-docs | Documentation generation |
For better tree-shaking, use subpath imports:
// Only imports Python generator
import { generatePython } from '@isl-lang/codegen/python';
// Only imports OpenAPI generator
import { generateOpenAPI } from '@isl-lang/codegen/openapi';
# Via the ISL CLI
isl generate --target python specs/
# Multiple targets
isl generate --target typescript,openapi specs/
Generators accept options for customization:
// Python options
generatePython(ast, {
framework: 'fastapi' | 'flask' | 'django',
pydantic: 'v1' | 'v2',
asyncMode: true,
outputDir: './src/generated',
});
// OpenAPI options
generateOpenAPI(ast, {
info: { title: 'My API', version: '1.0.0' },
servers: [{ url: 'https://api.example.com' }],
security: [{ bearerAuth: [] }],
});
// TypeScript options
generateTypeScript(ast, {
runtime: true, // Include runtime validators
zod: true, // Generate Zod schemas
strict: true, // Strict TypeScript
});
Full documentation: https://isl-lang.dev/docs/codegen
MIT
FAQs
ISL code generators - umbrella package for all code generation targets
We found that @isl-lang/codegen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.