Code Monkey home page Code Monkey logo

lettuce's Introduction

Lettuce 🥬

Lettuce is a generic server process that checks the files within an elixir project that has lettuce as a dependency and then runs iex -S mix. It initialises the state of the generic server with the .ex files inside lib and their last modified time. By default lib is used but you may specify which folders you want to be watched.

Elixir CI status Hex version badge codecov

lettuce

Configuration example

use Mix.Config

config :lettuce, folders_to_watch: ["apps"]
...

You can also change the refresh time to control how often the project files will be checked.

use Mix.Config

config :lettuce, refresh_time: 1500
...

Even though the start_link will throw an error if the Mix.env equals to :dev it is recommended to explicitly select the extra applications by environment in the mix file.

...
def application do
  [
    extra_applications: extra_applications(Mix.env(), [:logger, ...])
  ]
end

defp extra_applications(:dev, default), do: default ++ [:lettuce]
defp extra_applications(_, default), do: default
...

Mix compiler task options

You might send special parameters to the compiler task that lettuce runs. This is not required. In your project of parameters in config.exs:

config :lettuce,
  folders_to_watch: ["lib"],
  compiler_opts: [
    "--ignore-module-conflict",
    "--verbose"
  ]

For the available options check the Mix.Tasks.Compile.Elixir docs.

Installation

If available in Hex, the package can be installed by adding lettuce to your list of dependencies in mix.exs:

...
def deps do
  [
    {:lettuce, "~> 0.3.0", only: :dev}
  ]
end
...

Inspiration

While giving Node.js lessons as part of a charity called MigraCode in El Borne, Barcelona. We were reviewing some exercises and one of the steps in the instructions was to npm install nodemon, which reminded me of all the times I was inside IEx debbuging and I had to call recompile.

Author

Josep Lluis Giralt D'Lacoste.

License

Lettuce is released under the MIT License. See the LICENSE file for further details.

lettuce's People

Contributors

dependabot-preview[bot] avatar gilacost avatar kristerv avatar renovate[bot] avatar sztheory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lettuce's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/elixir.yml
  • actions/checkout v4
  • erlef/setup-beam v1
  • actions/cache v3
  • actions/cache v3
  • codecov/codecov-action v3
  • ubuntu 20.04
mix
mix.exs
  • ex_doc ~> 0.30.0
  • excoveralls ~> 0.17.0
  • dialyxir ~> 1.3.0

  • Check this box to trigger a request for Renovate to run again on this repository

Elixir 1.15 gives error

hey. thanks for this package.

when lettuce is compiling inside of a project it gives a nasty error

==> lettuce
warning: the dependency :lettuce requires Elixir "~> 1.13.2" but you are running on v1.15.4

it still works, but the error is big red and scary :)

updating to lettuce 0.3.0 fixed it, so it's the docs that need changing.

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.