gen icon indicating copy to clipboard operation
gen copied to clipboard

generalize to other frameworks

Open kobi2187 opened this issue 6 years ago • 3 comments

Hi, how about generalizing so that new:app, new:route, new:api will be jester:app, jester:route, jester:api

then add new ones for GUI app (e.g. nimx, nigui), TUI app (e.g. illwill), command line (parseopt or similar, and get going) and unit testing (the builtin unittest:suite macros -- maybe even find all procs in file and create skeleton tests for them).

that could be cool.

a nim.cfg with all the options commented out. a gitignore or hgignore file is also welcomed.

kobi2187 avatar Dec 09 '19 11:12 kobi2187

honestly, that's an interesting idea! will look into it, do you have background in GUI ... that way you can give me a sense of what's needed to scaffold for GUI apps as an example

Adeohluwa avatar Dec 09 '19 15:12 Adeohluwa

Thank you for the positive message, The main idea is to get to a working hello_world once you run your software. It can be for gui, tui, and others. I think combining them in the same code base is more than possible: for example, I think I would still split the code to files: domain.nim, views/nimx.nim and projectName.nim (which has the main "controller-like" logic), something like that, then have the main proc in the relevant view. (multiple main procs, and we choose which one to compile as the main program) Possibly fill the main proc with a raises: [] pragma (to check for all uncaught exceptions), and have an args variable, that just read the command line parameters. You can also be opinionated and choose a parseopt library, (I saw the new simple_parseopt, which looks great - but haven't tried)

Gui examples: (one for gui that looks the same everywhere -- makes it simple and consistent but sometimes foreign, the other gui looks like the OS it runs on -- native) https://github.com/yglukhov/nimx#usage https://github.com/trustable-code/NiGui/blob/master/examples/example_01_basic_app.nim

kobi2187 avatar Dec 11 '19 21:12 kobi2187

will certainly be adding Nigui... could you use the recent binary i just pushed update & tell me how well it works?

Adeohluwa avatar Dec 15 '19 18:12 Adeohluwa