Code Monkey home page Code Monkey logo

vapor-maker-commands's Introduction

final class Lloople: Developer {

  static let name: String = "David Llop"
  
  static let location: String = "Girona"
  
  func work() -> Company {
    return Company(
      name: "GNA Hotel Solutions", 
      as: "Lead Backend Developer"
    )
  }
  
  func website() -> String {
    return "https://davidllop.com"
  }
  
  func contact(mail: Mail) -> Bool {
    return Mailer().to("[email protected]").send(mail)
  }
}

vapor-maker-commands's People

Contributors

hsharghi avatar lloople avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hsharghi tnassar

vapor-maker-commands's Issues

Enhancement in restful controller stub

I want to add a piece of code to RestController.stub and make it testable and usable out of the box.

struct {{name}}: RouteCollection {

  func boot(routes: RoutesBuilder) throws {  
      let routeGroup = routes.grouped("{{routeName}}")
      routeGroup.get(use: index)
      routeGroup.get("create", use: create)
      routeGroup.post(use: store)
      routeGroup.group(":ID") { rotue in
          rotue.get("edit", use: edit)
          rotue.get(use: show)
          rotue.put(use: update)
          rotue.delete(use: destroy)
      }
}

Any idea how to generate {{routeName}} from name?
e.g generate players string from PlayersController

As it is for making controllers testable, and for sure in most cases developers will change the generated string for the route collection, maybe just generating a simple string like this would be sufficient.

"PlayersController".replacingOccurrences(of: "Controller", with: "").lowercased()      // players

Check file existence

All the commands should check if the destination file already exists before creating it:

  • If it exists, it would fail with a message
  • Using the command with the flag --force or -f would override the file

!! Tests

I need a way to create files, check the content and delete them right after the assertions.

I would need to emulate the Vapor app folder structure Sources/App somehow ๐Ÿค”

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.