Registry / devops / bali-type-compiler

bali-type-compiler

JSON →
library2.65.0jsnpmunverified

A JavaScript implementation of the compiler for the Bali Virtual Processor, which assembles and compiles Bali Nebula types. Current stable version is 2.65.0. The library is in active conversion to version 2 of base components and is not production-ready. It provides a JavaScript API for compiling Bali type definitions into executable code targeting the Bali Virtual Processor. Key differentiators include integration with the Bali Nebula ecosystem and a debug level control. Release cadence is not regularly published.

npm install bali-type-compiler
INSTALL
IMPORT
SIG · BALI-TYPE-COMPILER
B
bali-type-compiler
devopsjavascriptv2.65.0
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.

api
import { api } from 'bali-type-compiler';
const compiler = require('bali-type-compiler').api(debug);
The library supports both CJS and ESM. In ESM, the api function is a named export. For CJS, use require and call .api(debug).
default (module)
import baliTypeCompiler from 'bali-type-compiler';
const baliTypeCompiler = require('bali-type-compiler');
Default import gives the module object; you still need to call .api(). The CJS require returns the module export object.
Compiler class
import { Compiler } from 'bali-type-compiler';
If using TypeScript, the package may export a Compiler class directly; check version-specific documentation.

Shows how to require the library with a debug level and compile a Bali type definition string.

const debug = 2; const compiler = require('bali-type-compiler').api(debug); // Compile a simple Bali type definition const typeDefinition = ` type Person { name: String age: Int } `; const compiled = compiler.compile(typeDefinition); console.log(compiled);
Debug
Known issues
gotchaThis library is a conversion to version 2 of base components and is not yet production-ready.
fix
Use only for testing or development; avoid production use.
affects: >=2.0.0
breakingVersion 2 API changed from version 1; import path and function signature may differ.
fix
Check release notes for migration from v1 to v2.
affects: >=2.0.0
gotchaDebug level parameter is required and must be an integer between 0 and 3.
fix
Always pass a valid debug integer (0-3) to api().
affects: >=2.0.0
deprecatedThe require pattern with .api(debug) is deprecated in favor of named exports in ESM.
fix
Use import { api } from 'bali-type-compiler' and call api(debug).
affects: >=2.65.0
Errors
Common errors & fixes
TypeError: compiler.compile is not a function
Forgetting to call .api() on the required module.
fix
Call require('bali-type-compiler').api(debug) instead of just require('bali-type-compiler').
Error: Debug level must be an integer between 0 and 3
Passing a non-integer or out-of-range value to api().
fix
Ensure debug is an integer: 0, 1, 2, or 3.
Module not found: Can't resolve 'bali-type-compiler'
Package not installed or wrong import path.
fix
Run 'npm install bali-type-compiler' and check import is correct.
Upgrade
Version history
2.65.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
bali-type-compiler — npm install bali-type-compiler · libregistry