GithubHelp home page GithubHelp logo

rebel's Introduction

Rebel

Build system that conforms to the ideal Reason build spec found here and here (summary below). Implemented with Jenga, Jane Street's all-purpose build system.

Features

  • Lightning build speed: fast startup, incremental, parallel, etc.
  • rebel to build everything. No need for sub-build commands since only changed things are rebuilt.
  • Works with npm-style node_modules third-party dependencies that follows the spec (see next section).
  • Works with OPAM/ocamlfind dependencies: put them in the rebel.ocamlfindDependencies field, like so.
  • Works with Reason and vanilla OCaml syntax, out of the box.
  • Generates JavaScript output through js_of_ocaml or bucklescript.
  • Peace-of-mind "wipe the whole world" : just remove _build/.
  • Share your work through the normal npm workflow: npm publish.

Coming soon:

  • Integrated BetterErrors.
  • Generates the correct .merlin files for Merlin, for editor assistance.
  • Generates utop/rtop bootstrap file.
  • Generates documentation based on mli/rei interface files.
  • Easier installation: bundle Jenga, etc.

"Ideal Reason Project" Spec

  • Needs a flat src/ directory.
  • Third-party libraries go into node_modules/, flat list of all transitive dependencies.
  • Third-party libraries names of the format foo-bar are transformed into FooBar when used as module name (source file names aren't allowed to have kebab-case).
  • Every library (including the current one) needs a package.json that lists its npm dependencies in dependencies (as usual). OPAM/ocamlfind dependencies go into rebel.ocamlfindDependencies, same format as dependencies.
  • Refer to your own files e.g. myFoo as the module MyFoo in other files in the current project.
  • Refer to third-party files e.g. node_modules/bar/src/index.re as Bar.Index in the current project.

For Consumers

  • npm install --save-dev reasonml/rebel
  • Write some files in your src/, or install some spec compliant (see above) npm packages.
  • ./node_modules/.bin/rebel. ๐ŸŽ‰ ๐ŸŽ‰!
  • Binary in _build/src/app.out

Rebel Config

  • backend (string): One of "jsoo", "native", "bucklescript".
  • targets ([string]): entry points for reason application. Currently only works with bucklescript.
  • ocamlfindDependencies (array) : list of ocaml packages that work with ocamlfind

More Info

What to put in gitignore and npmignore when developing a jengaboot compliant project?

Jenga generates a .jenga directory that caches the build info. _build/ (where the artifacts live) cannot be easily shared yet (ocamlc's artifacts are sometimes laptop-specific). .merlin is auto-generated by the build.

In short, put .jenga, _build and .merlin in your .gitignore and .npmignore.

For Contributors

Ping me on IRC (chenglou), Twitter (@_chenglou), Gitter, etc. for specific details.

  • git clone this repo
  • npm install
  • Modify logic in src
  • To test examples run npm run rebel:bs or npm run rebel:re

Things to test

  • Support for source/interface interface files that are (uncapitalized, Capitalized) and (snake_cased, camelCased). Support third-party library names of the latter pair (npm modules can no longer be capitalized).
  • Compiles dangling unused source files and unused dependencies (for merlin editor integration, e.g. add a new dependency, compile, then start autocompleting that previously unused module).
  • Dependencies that contain the same source file names.
  • Third-party sources with unique names.
  • Compiling A and B that both require C.
  • .rei interface files referencing third-party modules that source files don't (extra dependencies).
  • opening a third-party library to refer to its module that happens to have the same name as one of our first-party modules.
  • Compile libraries with mixed re, rei, ml and mli files.
  • Symlinks (relative and absolute).
  • Third-party folders with kebab-case, snake_case, camelCase and CamelCase.
  • Not compiling unused dependencies.

Credits

The whole Jane Street team for making Jenga and helping me understanding it. Also to the whole Reason team of course.

rebel's People

Contributors

charlesetc avatar chenglou avatar jaredly avatar jordwalke avatar threepointone avatar vramana avatar yunxing avatar

Watchers

 avatar  avatar  avatar

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.