Registry / devops / tt-model-compiler

tt-model-compiler

JSON →
library0.1.5jsnpmunverified

Compiler package for tt-Model, a GraphQL and REST schema extractor from TypeScript code. Current stable version is 0.1.5. It allows you to compile TypeScript files to extract schemas using Gulp, standalone, or any task runner. Key differentiators: no need to learn new schema languages, works directly with TypeScript types, integrates via Gulp pipeline or direct API, and can transpile to JavaScript (.js, .mjs, .cjs). Release cadence is not specified; documentation warns of breaking changes.

npm install tt-model-compiler
INSTALL
IMPORT
SIG · TT-MODEL-COMPILER
T
tt-model-compiler
devopsjavascriptv0.1.5
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.

Compiler
import { Compiler } from 'tt-model-compiler'
const Compiler = require('tt-model-compiler')
The package supports both ESM and CJS; using named import in ESM is correct.
Compiler.compile
Compiler.compile(files, pretty, targetExtension)
compiler.compile(files, pretty, targetExtension)
compile() is a static method called on the Compiler class, not on an instance.
compiler.gulp()
compiler.gulp(pretty, targetExtension)
compiler.gulp({pretty: true, targetExtension: '.js'})
gulp() takes positional arguments, not an options object.

Shows how to use the Compiler with Gulp to extract schemas from TypeScript files and transpile to JavaScript.

import { Compiler } from 'tt-model-compiler'; import gulp from 'gulp'; import dest from 'gulp-dest'; const compiler = new Compiler('tsconfig.json'); export function compileCode() { return gulp.src('src/**/*.ts') .pipe(compiler.gulp(true, '.js')) .pipe(dest('dist')); }
Debug
Known issues
breakingBREAKING CHANGES ADDED as per documentation; verify documentation for details
fix
Review the release notes or documentation for breaking changes between versions.
affects: >=0.1.0
gotchaCompiler.compile() is a static method — calling it on an instance will fail
fix
Use Compiler.compile() directly, not compiler.compile().
affects: >=0.1.0
gotchagulp() method takes positional arguments, not an options object
fix
Call compiler.gulp(pretty, targetExtension) with boolean and string arguments.
affects: >=0.1.0
deprecatedNo explicit deprecations noted, but documentation is outdated per README
fix
Check for any deprecated API in newer versions.
affects: 0.1.5
Errors
Common errors & fixes
TypeError: compiler.compile is not a function
Attempting to call compile() on an instance instead of the class
fix
Use Compiler.compile() static method.
Error: Cannot find module 'tt-model'
Missing peer dependency tt-model
fix
Install tt-model: npm install tt-model
Argument of type '{ pretty: boolean; targetExtension: string; }' is not assignable to parameter of type 'boolean | undefined'
Passing an options object to compiler.gulp() instead of positional arguments
fix
Call compiler.gulp(true, '.js') instead of compiler.gulp({...})
Upgrade
Version history
0.1.5latest on npm
Audit
Dependencies
tt-modelrequiredCore peer dependency; compiles schemas for tt-model
Agent activity
4 hits · last 30 days
node
4
Resources
tt-model-compiler — npm install tt-model-compiler · libregistry