frintjs / frint

Modular JavaScript framework for building scalable and reactive applications
https://frint.js.org/
MIT License
755 stars 34 forks source link

frint-cli: Support `new` subcommand #220

Closed fahad19 closed 7 years ago

fahad19 commented 7 years ago

Current situation

We currently have frint init command, which initializes an example app in an empty directory.

The process is as follows:

$ mkdir my-directory
$ cd my-directory

$ frint init

We require the user to create a new directory before they can run the init.

Proposed subcommand

We can additionally support a new subcommand, which will take care of creating the directory too.

$ frint new example-name [my-directory]

We can expect the command above to create a new my-directory, and then initialize the kitchensink example there.

If the directory argument is not present, then it would initialize the app in current working directory.

Sources

If the example name as no / in the string, we would get it from our monorepo's examples/[example-name] directory.

But we can also provide a way to initialize examples from other repositories:

$ frint new "frintjs-templates/foo"

The above command means, it will initialize an example app from https://github.com/frintjs-templates/foo repository.

discosultan commented 7 years ago

I'd scope this particular issue to build upon the current frint init command so that it only adds the directory creation and working directory specific rules.

Being able to fetch examples from sources other then the official repository should apply both for frint init and frint new commands and be handled as a separate issue blocked by this.