zce/caz

Cannot create template in TypeScript

ozeebee opened this issue · 1 comments

Hi,

I would like to create a custom template using TypeScript instead of JavaScript (using index.ts instead of index.js).
Since caz itself is written in TypeScript, I expected this to be supported out of the box.
But looks like it's not.
I could not find any example. All the existing templates are written in JavaScript.
It's a bit sad because the types already in caz.
I tried to modify the sample template to use TS (added required dependencies, etc).
But it fails to compile this empty template: index.ts

import { Template } from 'caz'

const templateDef: Template = {
  //...
}
export default templateDef

I get this error:

> tsc

node_modules/caz/lib/init/index.d.ts:1:44 - error TS2307: Cannot find module './types' or its corresponding type declarations.

1 import { Options, Context, Template } from './types';
                                             ~~~~~~~~~

Any idea/suggestion ?

zce commented

Fixed in v0.8.2