esy-peasy
v0.0.5
Published
Esy-Peasy: Simple Esy Project Builder With Almost No Configuration
Downloads
4
Readme
esy-peasy
- Easiest way to make native Reason programs and libraries.
- Merlin and LSP integration out of the box.
- For a project named
my-project, produces single sharable library namedmy-projectand a single executable namedMyProject.
Build An Example:
npm install -g esy@next
git clone [email protected]:jordwalke/esy-peasy-starter.git
esy install
esy buildMake It Your Own Package:
- Change the
namefield in thepackage.jsonand rebuild.
How Are The Binary And Library Built?
- The single
.refile inbin/becomes theMyProjectexecutable. - The contents of
lib/becomes themy-projectnamed library. - Your binary
.refile can automatically see themy-projectlibrary as theYourProjectLibmodule. - Packages that depend on your package can then use your
my-projectlibrary, which then allows them to see theYourProjectLibmodule.
Testing The Binary:
Use the standard esy x any-command-here command to run any-command-here as
if you had installed the package. For example esy x YourPackage --args builds
and runs your YourPackage executable with arguments.
Customize:
- Omit the
lib/directory if everything fits into the single file inbin/. - You may rename the
bin/Index.refile to bebin/YourProjectNameCamelCased.re.
Adding New Package Dependencies:
esy add @opam/dep-name@versionautomatically builds and adds a new dependency topackage.json.- Find the name of the library inside of that new package by running
esy ls-libs. - Add that library name to
package.jsonlike this:"peasyLibs": ["the-library-name"]. - Use that library in your code and run
esy build.
Note: After adding/building a new dependency you can use
esy ls-modulesto see which named modules become available to you by adding thepeasyLibsentry.
Publish Prebuilt binaries of your executables to npm.
Use esy to make prebuilt binary releases of your program that can be installed
from plain npm.
esy release bin
cd _release/bin-darwin
npm publish --tag darwinTradeoffs:
esy-peasy is good for rapidly making new small executables/libraries. Once they
grow, you'll want to "eject out" of esy-peasy and begin customizing using a more
advanced build system.
