package spin

  1. Overview
  2. Docs
OCaml project generator

Install

Dune Dependency

Authors

Maintainers

Sources

opam-spin-0.8.3.tbz
sha256=eeef9d3b89cca796d8d47ba425cee131bf14b5b0f1349927c4d8b22297b1f6b6
sha512=1850cad87f180b37e658e716986f6aa0ba76e57d6638d40b8f6e8ae2c6f60deee82218464e02356632022b394f49cc5a341e7255112aef455ffec9ca2db4cc32

Description

OCaml project generator

Published: 31 Jul 2021

README

README.md

Logo

OCaml project generator.

Build Status npm version

FeaturesInstallationTemplatesUsageRoadmapContributingLicenseAcknowledgements

Demo

Features

🚀 Quickly start new projects that are ready for the real world.

❤️ Have a great developer experience when developing with OCaml.

🏄 Be as productive as Ruby-on-Rails or Elixir's Mix users.

🔌 Establish a convention for projects organizations to make it easy to get into new projects.

Installation

Using Homebrew (macOS)

brew install tmattio/tap/spin

Using Opam

opam install spin

Using a script

curl -fsSL https://github.com/tmattio/spin/raw/main/script/install.sh | bash

Templates

You can generate a new project using a template with spin new. For instance:

spin new bin my_app

Will create a new binary application in the directory ./my_app/

Anyone can create new Spin templates, but we provide official templates for a lot of use cases.

Official templates

The official Spin templates templates are the following:

  • bin - Native project containing a binary.

  • cli - Command Line Interface releasable on Opam.

  • lib - Library releasable on Opam.

  • ppx - PPX library.

  • c-bindings - Bindings to a C library.

  • js - Js application with Js_of_ocaml.

If you'd like to add an official template, don't hesitate to open a PR!

Other OCaml templates

You can find community Spin templates for various projects here: https://github.com/ocaml-templates

Here are some non-official Spin templates that you can use:

Other non-OCaml templates

Although the focus of Spin is to offer a great project generator for the OCaml ecosystem, it can also be used to generate non-OCaml templates. Here are a few examples:

Usage

For a detailed documentation of Spin's CLI, run spin --help, or refer to the CLI documentation.

spin new TEMPLATE [PATH] [--default] [--ignore-config]

Create a new ReasonML/Ocaml project from a template.

PATH defaults to the current working directory.

When --default is passed, the user will not be prompted for configurations that have a default value.

When --ignore-config is passed, the configuration file will be ignored and the user will be prompted for all the configurations.

spin ls

List the official Spin templates.

spin config

Prompt the user for values that can be saved in the configuration file.

If a value is present in the configuration file, it will not be prompted when generating a new project.

Roadmap

See our development board for a list of selected features and issues.

Here are some of the improvements we'll be working on as well in for next releases:

  • [ ] Support windows

  • [ ] Support CLI options/args for configurations

  • [ ] Minimal hello template

  • [ ] Generators for lib/bin/test for all templates

Contributing

We'd love your help improving Spin!

Take a look at our Contributing Guide to get started.

License

Distributed under the ISC License. See LICENSE for more information.

Acknowledgements

Thanks to everyone who contributed to Spin!

Special thanks to @wesoudshoorn for creating Spin's logo.

Dependencies (10)

  1. logs
  2. cmdliner
  3. fpath
  4. fmt >= "0.8.9"
  5. jingoo >= "1.4.0"
  6. spawn >= "v0.13"
  7. sexplib >= "v0.13"
  8. crunch build
  9. dune >= "2.8"
  10. ocaml >= "4.10.0" & < "5.0.0"

Dev Dependencies (6)

  1. odoc with-doc
  2. ctypes with-test
  3. ppxlib with-test
  4. js_of_ocaml-ppx with-test
  5. js_of_ocaml with-test
  6. alcotest with-test

Used by (1)

  1. opam-spin >= "0.8.3"

Conflicts

None