mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-01-24 03:59:06 +00:00
nikugogoi
1bcabd64f2
* Update codegen with index-block CLI and remove graph-node * Add filter logs by contract flag * Skip generating GQL API for immutable variables * Add config for maxEventsBlockRange * Add new flags in existing watchers
22 lines
666 B
TypeScript
22 lines
666 B
TypeScript
//
|
|
// Copyright 2022 Vulcanize, Inc.
|
|
//
|
|
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
import Handlebars from 'handlebars';
|
|
import { Writable } from 'stream';
|
|
|
|
const TEMPLATE_FILE = './templates/index-block-template.handlebars';
|
|
|
|
/**
|
|
* Writes the index-block file generated from a template to a stream.
|
|
* @param outStream A writable output stream to write the index-block file to.
|
|
*/
|
|
export function exportIndexBlock (outStream: Writable): void {
|
|
const templateString = fs.readFileSync(path.resolve(__dirname, TEMPLATE_FILE)).toString();
|
|
const template = Handlebars.compile(templateString);
|
|
const indexBlock = template({});
|
|
outStream.write(indexBlock);
|
|
}
|