Closed so99ynoodles closed 2 years ago
Hi, is anyone working on this issue now? If not, I am willing to give it a try and make a PR
@BWsix Awesome! It would be great if you give it a try! (Sorry that the specs are not organized enough)
Sure! I'll submit a PR with the changes in a day or two.
@so99ynoodles I am thinking of the following implementations, which one looks better to you or we do this in another way?:
app name
), and ask questions for missing informations.
This is easier and don't require a lot of changes to the create-liff-app.ts
since we can do this using commander in index.ts
and pass the provided flags to create-liff-app.ts
.app name
and flag template
, liffid
required and set default values for other flags.
This will be done by replacing inquirer with commander and requires more changes to the create-liff-app.ts
.Btw, now that we're adding flags to reduce the time answering questions, what do you think we infer package manager automatically and let users change package manager by adding flags (--use-npm
, --use-yarn
) like create-next-app
does?
This can be easily done by borrowing their code.
Also, there's a page (link) on Line Developer which talks about the create-liff-app
that hasn't been updated and still uses the previous version of cla. Maybe someone would need to update that page (after the flag feature?)
Also, is the main
field in root level package.json
required or it can be removed? It causes path error after build to JavaScript when I import and use package.json
in ts file.
I am thinking of the following implementations, which one looks better to you or we do this in another way?:
I think option.1 is a better choice since it won't change users' experience! (or command to start with)
Btw, now that we're adding flags to reduce the time answering questions, what do you think we infer package manager automatically and let users change package manager by adding flags (--use-npm, --use-yarn) like create-next-app does?
I think it can be a better experience for some users, but I'm little concerned about setting their default package manager manually since we cannot use yarn create
to start create-liff-app
since it has @line
prefix, so yarn users will be frustrated if they don't know about --use-yarn
flag.
Also, there's a page (link) on Line Developer which talks about the create-liff-app that hasn't been updated and still uses the previous version of cla. Maybe someone would need to update that page (after the flag feature?)
We are gonna make a contact with the LINE document team. Thank you for notifying it 🙏
Also, is the main field in root level package.json required or it can be removed? It causes path error after build to JavaScript when I import and use package.json in ts file.
Yes, it can be deleted.
Thank you for the informative reply!
we cannot use yarn create to start create-liff-app since it has @line prefix
I didn't know that! I'll not make changes to the package manager part.
🙋 Feature Request
Add flags to the CLI
🤔 Expected Behavior
Users can set their information as flags so they can skip the process of pressing enters several times.
😯 Current Behavior
There is no way to
create-liff-app
without pressing enters.💁 Possible Solution
There can be flags or args of all parameters. This is just an example ↓
We may use libraries like
commander
oryargs
to implement this.💻 Examples
You can check the
create-next-app
implementation. https://github.com/vercel/next.js/blob/canary/packages/create-next-app/index.ts