https://github.com/exercism/elm-representer
https://github.com/exercism/elm-representer
community-contributions-accepted exercism-representer exercism-tooling maintained
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/exercism/elm-representer
- Owner: exercism
- License: agpl-3.0
- Created: 2020-08-10T17:03:37.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T08:46:37.000Z (10 months ago)
- Last Synced: 2025-04-29T05:29:02.118Z (about 2 months ago)
- Topics: community-contributions-accepted, exercism-representer, exercism-tooling, maintained
- Language: Elm
- Size: 97.7 KB
- Stars: 1
- Watchers: 5
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Elm Representer
This outputs a normalized representation of Elm Code, to make automated analysis easier within Exercism.
Thanks to [Elm Platform Worker Example](https://github.com/jxxcarlson/elm-platform-worker-example) for the initial template.
## Install
```bash
npm install
```## Build
To compile the representer code, you can run `elm make --optimize src/Main.elm --output=src/main.js` in your terminal.
Alternatively, you can simply use the following npm script, configured in the `package.json` file.```bash
npm run make
```If the code requires the `Debug` module (which it currently doesn't), use instead `npm run make-debug` that remove the `--optimize` from the command.
## Usage
To normalise a file (bob.elm) and save normalized code to bob-normalized.elm and identifier mapping to mapping.json
```bash
cat bob.elm | node src/cli.js mapping.json > bob-normalized.elm
```To normalize all the example files in this repo
```bash
sh normalize-examples.sh
```## Test
```sh
elm-test
```## Docker
This repo also contains the Docker configuration for integration with Exercism.
To normalise an Exercism solution using a Docker container:
```sh
# Mac / Linux
./bin/run-in-docker.sh bob /PathToThisRepo/example-bob-solution/ /PathToThisRepo/example-output/
``````ps
# Windows
./bin/run-in-docker.ps1 bob /PathToThisRepo/example-bob-solution/ /PathToThisRepo/example-output/
```