Skip to content

Instantly share code, notes, and snippets.

@dmmulroy
Created January 4, 2024 18:53
Show Gist options
  • Select an option

  • Save dmmulroy/5c9dd58f8369812a76b397316cfeac12 to your computer and use it in GitHub Desktop.

Select an option

Save dmmulroy/5c9dd58f8369812a76b397316cfeac12 to your computer and use it in GitHub Desktop.
cma readme sample

Your project layout

{{name}}
├── src
│   │   // This is a React Component and the entry point to your application
│   ├── App.re
│   │
│   │   // This is an example of how you can create additional React Components
│   ├── Configuration.re
│   │
│   │   // This directory is home to your bindings. Bindings are code you'll
│   │   // write to "bind" to and communicate with external JavaScript code.
│   ├── bindings
│   │   │
│   │   │   // This file controls exporting bindings that you write and makes
│   │   │   // them available to the rest of your project/code
│   │   ├── bindings.re
│   │   │
│   │   │   // This is an example of writing bindings to JavaScript DOM APIs
│   │   ├── browser.re
│   │   │
│   │   │   // This dune file configures your bindings library. In {{ReasonML}},
│   │   │   // each library has its own dune file. Generally, each library is
│   │   │   // contained in its own directory and is the standard way of
│   │   │   // organizing your code.
│   │   └── dune
│   │
│   │   // This directory is an example of a {{ReasonML}} library. It contains
│   │   // code and modules used to interact with your projects configuration.
│   ├── create_melange_app
│   │   │
│   │   │   // This file controls exporting the modules within the
│   │   │   // `create_melange_app` library, making them available to the rest
│   │   │   // of your project/code.
│   │   ├── create_melange_app.re
│   │   │
│   │   │   // These are individual {{ReasonML}} modules that compose the
│   │   │   // `create_melange_app` library.
│   │   ├── node_package_manager.re
│   │   ├── bundler.re
│   │   ├── configuration.re
│   │   │
│   │   │   // This `dune` file configures the `create_melange_app` library.
│   │   └── dune
│   │
│   │   // This `dune` file configures your root/application library. It wraps
│   │   // and composes all of the libraries that are used in your application.
│   │   // When you add new libraries to your project, you will need to add
│   │   // them to the `libraries` stanza in this file.
│   └── dune
│
│   // This directory is generated by 'Dune', {{ReasonML}}'s build tool.
│   // It contains compiled files and other artifacts from the build process.
│   // Note: This is _not_ where your application bundle/output/dist will be.
├── _build/
│
│   // This directory is created by `Opam`, {{ReasonML}}'s package manager. It
│   // contains your "local switch" and packages for your {{ReasonML}}
│   // environment, specific to this project. You can think of the `_opam`
│   // folder and switches as {{ReasonML}}'s `node_modules`.
├── _opam/
│
│   // This is where your applications bundle or output will be located after
│   // running `npm run build`.
├── dist/
│
│   // This `dune` file configures `Melange`'s build process and settings. In
│   // addition, it also configures `{{Vite}}` to be ran by and integrated with
│   // `Dune`.
├── dune
│
│   // This file contains the overall configuration for your project, such as
│   // the name, version, metadata, and dependencies other settings understood
│   // by `dune`. You can think of this file as {{ReasonML}}'s `package.json`.
├── dune-project
│
│   // This file is generated by `Dune` and should not be manually edited. It
│   // Similar to your `dune-project` file, it contains dependencies and
│   // configuration settings for building your project. It is also similar to
│   // `package.json`. In the near future, `Dune` and `Opam` will be more
│   // tightly integrated as one tool.
├── first_try.opam
│
├── index.html
├── package-lock.json
├── package.json
├── vite.config.js
├── README
└── node_modules/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment