Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use typescript in gluegun cli, but still ship it for running on node? #451

Closed
danludwig opened this issue Jan 26, 2019 · 3 comments
Closed
Labels

Comments

@danludwig
Copy link

Is the only way to do it to have a build process that compiles the ts to js and then ships the js as the cli root (when someone does a npm i -g of the cli)? I can't get past the "unexpected token" errors when importing and exporting interfaces.

@jamonholmgren
Copy link
Member

jamonholmgren commented Jan 28, 2019

Hey @danludwig ! We have a build process built-in to the generated Gluegun CLI that you can run with yarn build. If you want it to generate TS types, add this to your tsconfig.json:

  "compilerOptions": {
    "declaration": true,
    "declarationDir": "build/types",

and this to your package.json:

  "types": "build/types/types.d.ts",

Then add a src/types.ts file that you export all your public-facing types from.

I may add this to our generated TypeScript CLI, actually.

@yordis
Copy link
Contributor

yordis commented Jul 29, 2019

I think this could be related to #401

@jamonholmgren
Copy link
Member

Tracking the idea of generating public types automatically in #611.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants