Skip to content

Commit

Permalink
Merge pull request #17 from JohanWinther/elm-debug-from-env
Browse files Browse the repository at this point in the history
Add support for `ELM_DEBUG` environment variable
  • Loading branch information
hojberg authored Nov 1, 2023
2 parents 1b274f7 + 1c4ad06 commit 642b586
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the UI you see when you type `ui` into `ucm`.

## Running Development Server

🔔 You should only need to run the UI development server if you're contributing to the UI. If you just want to run the UI to see your Unison codebase, it should either come pre-installed with `ucm` or if you built from source can be downloaded with a script: `./dev-ui-install.hs` from the `unison` repository ([Running Unison](https://github.com/unisonweb/unison/blob/trunk/development.markdown#running-unison)).
> 🔔 You should only need to run the UI development server if you're contributing to the UI. If you just want to run the UI to see your Unison codebase, it should either come pre-installed with `ucm` or if you built from source it can be downloaded with a script: `./dev-ui-install.hs` from the `unison` repository ([Running Unison](https://github.com/unisonweb/unison/blob/trunk/development.markdown#running-unison)).
1. Start `ucm` (the executable is `unison` instead of `ucm` if you built the [unison repository](https://github.com/unisonweb/unison) from source) in headless mode: `ucm headless`, and copy the API URL (this URL
is uniquely generated by `ucm` at start-up) from the `ucm` start-up output
Expand All @@ -19,6 +19,8 @@ This is the UI you see when you type `ui` into `ucm`.

4. Visit `http://localhost:1234` in a browser.

> 💡 Set the environment variable `ELM_DEBUG=1` before starting the dev server to enable Elm's time-travelling debugger.
## Dependencies

This depends on the [ui-core package](https://github.com/unisonweb/ui-core) via
Expand Down
3 changes: 2 additions & 1 deletion webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const postcssPresetEnv = require("postcss-preset-env");
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");

const API_URL = process.env.API_URL || "127.0.0.1:8080";
const ELM_DEBUG = process.env.ELM_DEBUG || false;
const UI_CORE_SRC = "elm-stuff/gitdeps/github.com/unisonweb/ui-core/src";

module.exports = {
Expand Down Expand Up @@ -63,7 +64,7 @@ module.exports = {
{
loader: "elm-webpack-loader",
options: {
debug: false,
debug: ELM_DEBUG,
cwd: __dirname,
},
},
Expand Down

0 comments on commit 642b586

Please sign in to comment.