mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-02-01 15:54:08 +00:00
* Add entity generation. * Add resolvers generation. * Add queries in resolvers generation. * Add indexer generation. * Extract helper code in utils. * Add server and artifacts generation. * Fix solidity-flattener issue. * Update readme and cleanup misc files. * Add queries to entity generation. * Add database generation. * Use snakecase in database. * Add readme generation. * Change template file names. * Add method descriptions. * Change mode to eth_call in readme. Co-authored-by: prathamesh <prathamesh.musale0@gmail.com>
22 lines
661 B
TypeScript
22 lines
661 B
TypeScript
//
|
|
// Copyright 2021 Vulcanize, Inc.
|
|
//
|
|
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
import Handlebars from 'handlebars';
|
|
import { Writable } from 'stream';
|
|
|
|
const TEMPLATE_FILE = './templates/tsconfig-template.handlebars';
|
|
|
|
/**
|
|
* Writes the tsconfig.json file generated from a template to a stream.
|
|
* @param outStream A writable output stream to write the tsconfig.json file to.
|
|
*/
|
|
export function exportTSConfig (outStream: Writable): void {
|
|
const templateString = fs.readFileSync(path.resolve(__dirname, TEMPLATE_FILE)).toString();
|
|
const template = Handlebars.compile(templateString);
|
|
const tsconfig = template({});
|
|
outStream.write(tsconfig);
|
|
}
|