Code Monkey home page Code Monkey logo

danet-cli's Introduction

Danet Logo

CI codecov Made for Deno

A command-line interface tool that helps you to initialize your Danet applications.

In the future, it will assist in multiple ways, including scaffolding the project, serving it in development mode, and building and bundling the application for production distribution. It embodies best-practice architectural patterns to encourage well-structured apps.

Installation

Installing Deno packages as a commands is simple. You can install them under any name you want. For simplicity's sake, we install our danet-cli under the name danet.

$ deno install --allow-read --allow-write --allow-run --allow-env -n danet https://deno.land/x/danet_cli/main.ts

Basic workflow

Once installed, you can invoke CLI commands directly from your OS command line through the danet command. See the available danet commands by entering the following:

$ danet --help

To create, run a new basic Danet project, go to the folder that should be the parent of your new project, and run the following commands:

$ danet new my-danet-project
$ cd my-danet-project
$ danet develop //run with file watching
$ danet start  //run without file watching

In your browser, open http://localhost:3000 to see the new application running.

Database Options

When creating a new project, Danet CLI will ask you what database provider you want to use between mongodb, postgres and in-memory and will generate all the required code.

The only thing left if you use mongodb or postgres will be to set environment variables or put them in a .env file in your project's root folder.

However, if you need it to be less interactive, you can pass the followings options when calling danet new :

  • --mongodb
  • --postgres
  • --in-memory

Deploy to Deno Deploy

As easy as :

danet deploy

Here are the options:

Usage: danet deploy

Description:

  Deploy your project to Deno Deploy

Options:

  -h, --help                      - Show this help.                                                                                    
  -p, --project     <project>     - Deno deploy project name. If no value is given, Deno deploy will generate a                        
                                    random name                                                                                        
  -e, --entrypoint  <entrypoint>  - Bundle entrypoint file                                                       (Default: "run.ts")   
  -b, --bundle      <bundle>      - Bundle output file name, also used as deployctl entrypoint                   (Default: "bundle.js")

Commands:

  help  [command]  - Show this help or the help of a sub-command.

danet-cli's People

Contributors

sorikairox avatar snider avatar marco-souza avatar

Stargazers

Thomas Huber avatar Daniel Bodnar avatar Kengo Yamashita avatar Ibrahim H. avatar  avatar  avatar mrisho avatar ely cheikh SMAIL avatar  avatar

danet-cli's Issues

danet health subcommand

I suggess introduce
danet health subcommand.
This command staticlty analyse danet modules, submodules, controller, services and ensure that all services used in controller are declared as provider in parent module, if there some services not respect this rule it will list them.
This will increase the productivity.

danet new throw errors

context:
OS: Windows 11
deno version:
deno 1.32.3 (release, x86_64-pc-windows-msvc)
v8 11.2.214.9
typescript 5.0.3
danet cli version: ?
command: danet new --in-memory danetapp

Error:
danet new --in-memory danetapp Sun, 02 Apr 2023 21:55:20 GMT [Danet-CLI] Cloning starter project from https://github.com/Savory/Danet-Starter.git into danetapp Sun, 02 Apr 2023 21:55:22 GMT [Danet-CLI] Keeping code as is due to in-memory being selected Sun, 02 Apr 2023 21:55:22 GMT [Danet-CLI] Deleting database folder Sun, 02 Apr 2023 21:55:22 GMT [Danet-CLI] Danet's project creation done ! You can run it with the following commands: cd danetapp && deno task launch-server Tests can be run with: deno task test error: Uncaught Error: Deno.core.runMicrotasks() is not supported in this environment throw new Error( ^ at Object.runMicrotasks (https://deno.land/[email protected]/node/_core.ts:22:13) at processTicksAndRejections (https://deno.land/[email protected]/node/_next_tick.ts:62:10) at https://deno.land/[email protected]/node/process.ts:375:7 at innerInvokeEventListeners (ext:deno_web/02_event.js:783:7) at invokeEventListeners (ext:deno_web/02_event.js:823:5) at dispatch (ext:deno_web/02_event.js:692:9) at dispatchEvent (ext:deno_web/02_event.js:1082:12) at [ext:cli\worker.rs:90:38]:1:1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.