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

Official Command Line Tool #44

Closed
shadowtime2000 opened this issue Oct 18, 2020 · 12 comments
Closed

Official Command Line Tool #44

shadowtime2000 opened this issue Oct 18, 2020 · 12 comments

Comments

@shadowtime2000
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
There is no official CLI for eta.

Describe the solution you'd like
A CLI preferably written in Typescript using yargs. It should be able to facilitate testing to make sure it is working properly.

Describe alternatives you've considered
Not having a CLI.

Additional context
I could work on this, I just want to see what people think.

@shadowtime2000
Copy link
Collaborator Author

@nebrelbug Thoughts?

@nebrelbug
Copy link
Collaborator

This is a great idea!

We should look at https://github.com/mde/ejs and https://github.com/pugjs/pug-cli for some examples of similar tools.

Ideally a CLI would accept configuration options through command line flags or through a config file like eta.config.js (maybe eta-vscode could use the same file?)

We'd need to think about how we'd handle partials and layouts.

@shadowtime2000
Copy link
Collaborator Author

I was thinking it would do the prerendering of templates and then add the ability to render templates.

@shadowtime2000
Copy link
Collaborator Author

Also, should we keep the CLI within this eta package or a new package such as etajs-cli (eta-cli) is already taken.

@shadowtime2000
Copy link
Collaborator Author

Just as a side note, it could also seem like a good idea to use a framework like oclif. It may add a little bit of structure.

@nebrelbug
Copy link
Collaborator

@shadowtime2000 I think it's probably best to keep the CLI inside the eta repo since the eta-cli package is taken. This will also make it easier for users to use npx eta. We could put the CLI code in a folder called /cli.

I love the idea of using oclif! I especially like its support for plugins.

@shadowtime2000
Copy link
Collaborator Author

@nebrelbug I think oclif is more built and structured for the CLI to be in its own package because of the complexity of it and how it may interfere with the current package.json build and other processes. I would prefer to just use yargs because it is simple but also testable. I think it is a more popular practice to keep the CLI code in a folder called /bin.

@nebrelbug
Copy link
Collaborator

@shadowtime2000 my bad, /bin is better 😃

I think either option -- yargs in the main repo or oclif in a separate repo -- would be great.

@shadowtime2000
Copy link
Collaborator Author

shadowtime2000 commented Oct 21, 2020

@nebrelbug We could also just use yargs in a separate repo because it is a little simpler and easier to test. I am going to start working on that but if you think that should change feel free to tell me 😃

@shadowtime2000
Copy link
Collaborator Author

I completed the CLI with basic compiling functionality and I have unit tests with Jest. Now I think it is time to decide the package name. Since eta-cli is taken the name I am using rn is etajs-cli. Any suggestions?

@nebrelbug
Copy link
Collaborator

@shadowtime2000 great! etajs-cli sounds good to me; I'm thinking we should just have the script called eta.

@shadowtime2000
Copy link
Collaborator Author

I am going to close this now because the CLI has been published.

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

No branches or pull requests

2 participants