Skip to content

Commit

Permalink
refactor: move app-logic to a src-folder, style changes to example (#74)
Browse files Browse the repository at this point in the history
* refactor: move example-code to src-folder, styling

* refactor: try to simplify quick-start

* docs: update REDME

* chore: add some more padding

* docs(README): add line nr to run-script

* docs(README): remove no longer existing text

* chore: remove unused variable, format dune-file

* chore: remove code that was accidentally pasted

* chore: use revery from github

* chore: remove comments about opens, put them somewhere else

* chore: remove JS-build for now until it runs again

* chore: lockfiles

* chore: pin revery
  • Loading branch information
lessp authored Jun 6, 2020
1 parent adf67ae commit f085453
Show file tree
Hide file tree
Showing 107 changed files with 279 additions and 7,410 deletions.
6 changes: 0 additions & 6 deletions .ci/esy-build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,3 @@ steps:
- script: esy build
displayName: 'esy build'
- script: revery-packager
# Run tests or any additional steps here
# - script: esy b dune runtest
#- script: esy @js install
# displayName: 'esy @js install'
#- script: esy @js build
# displayName: 'esy @js build'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ _release/
*.install
.merlin

# misc
.DS_Store
111 changes: 0 additions & 111 deletions App.re

This file was deleted.

7 changes: 0 additions & 7 deletions AppJs.opam

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Bryan Phelps
Copyright (c) 2020 Bryan Phelps

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
76 changes: 37 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,55 @@
[![Build Status](https://dev.azure.com/revery-ui/revery/_apis/build/status/revery-ui.revery-quick-start?branchName=master)](https://dev.azure.com/revery-ui/revery/_build/latest?definitionId=4?branchName=master)

# revery-quick-start

---

__Clone and run for a quick way to see Revery in action.__
# Revery Quick Start

This is a minimal Revery application to get you started.

The most important file here is:
- `App.re` - This is the core application code, responsible for __creating a window__ and __rendering__.

A Revery application also needs these files:
- `package.json` - [esy configuration]() - lists the OCaml/Reason dependencies.
- `dune` / `dune-project` - build configuration files used by [Dune](https://dune.readthedocs.io/en/latest/).
- `.opam` - metadata used by the build system.

### Prerequisites
## Prerequisites

See the [requirements for building Revery](https://github.com/revery-ui/revery/wiki/Building-&-Installing)

### Native Build

- `esy install`
- `esy build`

The binary will be in the `_build/install/default/bin` - you can run it like:

- `_build/install/default/bin/App`

or with esy:

- `esy run`
## Getting started

```
# Clone the repository
git clone https://github.com/revery-ui/revery-quick-start
# Go into the repository
cd revery-quick-start
# Install dependencies
esy install
# Build dependencies
esy build
# Run the app
esy run
```

> __NOTE:__ The first build will take a while - building the OCaml compiler and dependencies takes time! Subsequent builds, though, should be very fast.
> **NOTE:** The first build will take a while - building the OCaml compiler and dependencies takes time! Subsequent builds, though, should be very fast.
Once built, the application binary will be in the `_build/install/default/bin` - you can run it like:

- `_build/install/default/bin/App`

or using esy with the script specified in [package.json](package.json#L8):

- `esy run`

## What are all these files?

### Releasing
The most important files are:

- [`src/App.re`](./src/App.re) - This is the core application code, responsible for **creating a window** and **rendering**.
- [`src/SimpleButton.re`](./src/SimpleButton.re) - A simple button with hover and active-styling.
- [`src/AnimatedText.re`](./src/AnimatedText.re) - A component showcasing some neat animations.
- [`src/Theme.re`](./src/Theme.re) - A module holding some colors etc.

A Revery application also needs the following files:

- [`package.json`](package.json) - [esy configuration](https://esy.sh/docs/en/configuration.html) - lists the Reason/OCaml dependencies.
- `dune` / `dune-project` - build configuration files used by [Dune](https://dune.readthedocs.io/en/latest/).
- `.opam` - metadata used by the build system.

## Releasing

To create packages for distribution, follow these steps:

Expand All @@ -60,22 +61,19 @@ From the `revery-quick-start` folder, run:

Once complete, there will be application packages available in the `_release` folder.

### Resources
## Resources

- Check out the [official reason docs](https://reasonml.github.io/docs/en/what-and-why) to learn more about reason
- Visit the Reason [discord channel](https://discordapp.com/invite/reasonml) and say hi!
- Check out the [Reason-documentation](https://reasonml.org) to learn more about Reason
- Visit the Reason [Discord-channel](https://discordapp.com/invite/reasonml) and say hi!

### Next steps
## Next steps

Here's a few challenges to see if you've got the basics:

- Change the text from 'Hello World' to something more interesting!
- Add an Image component (Hint - you'll need to add the resource to the `dune` file, too)
- Add an Image component
- Respond to user input
- Create a frameless window

### License
## License

[MIT License](LICENSE)

Revery-quick-start also includes some assets (font files, etc) that have their own licensing terms. For these, see [ThirdPartyLicenses.txt](ThirdPartyLicenses.txt)
Loading

0 comments on commit f085453

Please sign in to comment.