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

[Feature] Better docs #28

Open
NothingEverHappens opened this issue Sep 1, 2020 · 1 comment
Open

[Feature] Better docs #28

NothingEverHappens opened this issue Sep 1, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@NothingEverHappens
Copy link

While this library looks really cool, it's really hard to understand how to use it.

there are only 8 usages of this lib on github (half of them - this repo):
https://github.com/search?l=TypeScript&q=creator+ts-creator&type=Code

import creator from 'ts-creator'

const generatedFactoryCode = creator(`const foo = "your code here"`)

This generates a string?
I was hoping the result to be a list of ts.Statement, and I'm not sure how to convert those? Eval?

import { transformSourceFile } from 'ts-creator'

declare const file: ts.SourceFile
const factoryFile = transformSourceFile(file)

It's not clear what this does, what's factoryFile, and why does it need to take a source file?

import { transformNode } from 'ts-creator'

declare const node: ts.Expression
const factoryNode = transformNode(node)

Same as above. It promises some kind of transformation, but it's not clear how to use it.

https://ts-creator.js.org/ - The playground it cool, but it comes empty, and there are no samples.
If you look at the typescript playground it comes pre-populated with code, and has lots of samples that people can play with to better understand how things work.

I'd be happy to send a PR for some of those things, but may need some clarification first.

@NothingEverHappens NothingEverHappens added the enhancement New feature or request label Sep 1, 2020
@woodgear
Copy link

in fact, I have such confusion about what could I do to use this package, what the purpose of it? it seems interesting, but I don't get the point.

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

No branches or pull requests

2 participants