{"id":16710552,"url":"https://github.com/andrewmacmurray/phoenix-elm-scaffold","last_synced_at":"2025-03-17T01:31:03.610Z","repository":{"id":57531960,"uuid":"91662093","full_name":"andrewMacmurray/phoenix-elm-scaffold","owner":"andrewMacmurray","description":"Mix Task to generate an elm app inside a Phoenix (1.3) app","archived":false,"fork":false,"pushed_at":"2018-03-23T12:24:50.000Z","size":52,"stargazers_count":37,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-27T15:47:07.671Z","etag":null,"topics":["elixir","elm","mix-tasks","phoenix"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/phoenix_elm_scaffold/Mix.Tasks.Phx.Gen.Elm.html","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewMacmurray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-18T07:23:38.000Z","updated_at":"2023-12-19T17:40:25.000Z","dependencies_parsed_at":"2022-09-26T18:11:55.786Z","dependency_job_id":null,"html_url":"https://github.com/andrewMacmurray/phoenix-elm-scaffold","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewMacmurray%2Fphoenix-elm-scaffold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewMacmurray%2Fphoenix-elm-scaffold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewMacmurray%2Fphoenix-elm-scaffold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewMacmurray%2Fphoenix-elm-scaffold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewMacmurray","download_url":"https://codeload.github.com/andrewMacmurray/phoenix-elm-scaffold/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243835959,"owners_count":20355613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","elm","mix-tasks","phoenix"],"created_at":"2024-10-12T20:08:53.894Z","updated_at":"2025-03-17T01:31:03.195Z","avatar_url":"https://github.com/andrewMacmurray.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phoenix Elm Scaffold\n\nMix Task to generate an elm app inside a Phoenix (1.3) app with the necessary scaffolding\n\n## Installation\n\nInstall the package by adding to `deps` and run `mix deps.get`\n\n```elixir\ndef deps do\n  [{:phoenix_elm_scaffold, \"~\u003e 0.2.6\"}]\nend\n```\n\n## Usage\n\nTo generate the scaffolding for an elm app, make sure you have [elm](https://guide.elm-lang.org/install.html) installed and run:\n\n```sh\n\u003e mix phx.gen.elm\n```\n\nthis will generate the following files and run install commands:\n\n```\n├── assets\n│   ├── elm\n│   │   ├── Main.elm\n│   │   ├── State.elm\n│   │   ├── Types.elm\n│   │   └── View.elm\n│   ├── elm-package.json\n│   ├── js\n│   │   └── elm-embed.js\n├── lib\n│   └── your_app\n│       └── web\n│           ├── controllers\n│           │   ├── elm_controller.ex\n│           ├── templates\n│           │   ├── elm\n│           │   │   └── index.html.eex\n│           └── views\n│               └── elm_view.ex\n└── test\n    └── elm\n        ├── Main.elm\n        ├── Sample.elm\n        └── elm-package.json\n```\n\n\nafter the command has finished follow the next steps:\n\n1: add the following to the `plugins` section of your `brunch-config.js`\n\n```js\nelmBrunch: {\n  elmFolder: \".\", // Set to path where elm-package.json is located, defaults to project root\n  mainModules: ['elm/Main.elm'],\n  outputFile: 'elm.js',\n  outputFolder: '../assets/js',\n  makeParameters: ['--debug'] // optional debugger for development\n}\n```\n\n2: add `elm` to the `watched` array in your `brunch-config.js`\n   You may also want to add `/elm\\\\.js/` to the babel ignore pattern to speed up compilation\n\n```js\nbabel: {\n  ignore: [/vendor/, /elm\\.js/]\n}\n```\n\n\n3: in your `app.js` file add the following\n\n```js\nimport ElmApp from './elm.js'\nimport elmEmbed from './elm-embed.js'\n\nelmEmbed.init(ElmApp)\n```\n\n\n4: and finally in your `router.ex` file add\n\n```elixir\nget \"/path-to-elm-app\", ElmController, :index\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewmacmurray%2Fphoenix-elm-scaffold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewmacmurray%2Fphoenix-elm-scaffold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewmacmurray%2Fphoenix-elm-scaffold/lists"}