Code Monkey home page Code Monkey logo

elixir-templates's Introduction

Introduction

Phoenix/Mix template for projects at Nimble.

Prerequisites

NimbleTemplate has been developed and actively tested with the below environment:

  • Mix 1.13.3
  • Elixir 1.13.3
  • Erlang/OTP 24.2.2
  • Phoenix 1.6.11
  • Node 16.15.0

Installation

Note: NimbleTemplate only works on a new Phoenix/Mix project, applying it to an existing Phoenix/Mix project might not work as expected.

Step 1: Generate a new project

# New Phoenix project
mix phx.new awesome_project

# New Mix project
mix new awesome_project

Step 2: Add nimble_template dependency to mix.exs:

def deps do
  [
    {:nimble_template, "~> 4.3.0", only: :dev, runtime: false},
    # other dependencies ...
  ]
end

Step 3: Fetch and install dependencies

Run this command in the root of the project directory to install NimbleTemplate.

mix do deps.get, deps.compile

Usage

mix help nimble_template.gen # Print help

mix nimble_template.gen -v # Print the version

# Phoenix application
mix nimble_template.gen --web   # Apply the Web template
mix nimble_template.gen --api   # Apply the API template
mix nimble_template.gen --live  # Apply the LiveView template

# Non-Phoenix application
mix nimble_template.gen --mix # Apply the Mix template

Running tests

The testing documentation is on Wiki

Release process

The release documentation is on Wiki

Contributing

Contributions, issues, and feature requests are welcome!
Feel free to check issues page.

FAQ

1. Getting (Mix) The task "phx.new" could not be found error

The Phoenix application generator is missing. By solving this problem, you need to run

mix archive.install hex phx_new

or

mix archive.install hex phx_new #{specific-version}

2. Getting Wallaby can't find chromedriver error

Your OS is missing/not installing chromedriver, you need to run:

Homebrew

brew install --cask chromedriver

Debian/Ubuntu

apt install chromium-chromedriver

Or download the package on the official site: https://chromedriver.chromium.org/downloads

License

This project is Copyright (c) 2014 and onwards. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About

Nimble

This project is maintained and funded by Nimble.

We love open source and do our part in sharing our work with the community! See our other projects or hire our team to help build your product.

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.