{"id":17795725,"url":"https://github.com/avh4/elm-upgrade","last_synced_at":"2025-04-09T20:04:05.669Z","repository":{"id":12672247,"uuid":"72509352","full_name":"avh4/elm-upgrade","owner":"avh4","description":"Upgrade Elm projects","archived":false,"fork":false,"pushed_at":"2022-12-07T23:29:12.000Z","size":275,"stargazers_count":122,"open_issues_count":24,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-09T20:04:00.333Z","etag":null,"topics":["automated-upgrades","code-transformation","elm"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/elm-upgrade","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avh4.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-01T06:17:08.000Z","updated_at":"2024-05-10T11:51:33.000Z","dependencies_parsed_at":"2023-01-13T17:04:36.903Z","dependency_job_id":null,"html_url":"https://github.com/avh4/elm-upgrade","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avh4%2Felm-upgrade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avh4%2Felm-upgrade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avh4%2Felm-upgrade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avh4%2Felm-upgrade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avh4","download_url":"https://codeload.github.com/avh4/elm-upgrade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103865,"owners_count":21048245,"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":["automated-upgrades","code-transformation","elm"],"created_at":"2024-10-27T11:38:00.818Z","updated_at":"2025-04-09T20:04:05.630Z","avatar_url":"https://github.com/avh4.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"## elm-upgrade [![](https://img.shields.io/npm/v/elm-upgrade.svg)](https://www.npmjs.com/package/elm-upgrade) [![Build Status](https://travis-ci.org/avh4/elm-upgrade.svg?branch=master)](https://travis-ci.org/avh4/elm-upgrade)\n\n`elm-upgrade` can help you **upgrade your Elm 0.18 projects to Elm 0.19**.  It attempts to automate many of the steps in the [Elm 0.19 upgrade guide][upgrade].  `elm-upgrade` will do the following:\n  - Convert your `elm-package.json` file to ...\n    - ... an application `elm.json` if your project has no exposed modules\n    - ... a package `elm.json` if your project has at least one exposed module\n  - Try to upgrade all of your project dependencies\n  - Warn you if some of your project dependencies don't support Elm 0.19 yet\n  - Use [elm-format](https://github.com/avh4/elm-format) `--upgrade` to upgrade your code, which includes the following:\n    - Convert escaped characters in strings to the new syntax (`\\u{xxxx}`)\n    - Inline uses of functions which were removed in Elm 0.19:\n      - `(,,)`, `(,,,)`, etc tuple constructor functions\n      - `Platform.Cmd.(!)`\n      - `flip`, `curry`, `uncurry`, and `rem` from the `Basics` module\n    - Upgrade code that uses `Html.Attributes.style`\n\n`elm-upgrade` can also **upgrade dependencies of your Elm 0.19 applications**.\nIf you are already using Elm 0.19, `elm-upgrade` will to the following:\n  - check for newer versions of all your direct dependencies and try to install them\n\n\n## How to use **elm-upgrade**\n\nFirst install Elm 0.19.1 and the latest version of [elm-format](https://github.com/avh4/elm-format#installation-).  (If you want to install them locally for your project, you can do so with the following: )\n\n```sh\ncd path/to/my/elm/project\nnpm install elm@latest-0.19.1\nnpm install elm-format@latest-0.19.1\n```\n\nThen run the following in your terminal:\n\n```sh\ncd path/to/my/elm/project\nnpx elm-upgrade@latest\n```\n\nNOTE:  `npx` ships with node 8.2 and later.  If you need to use an older version of node, you can still use elm-upgrade with `npm install -g elm-upgrade; elm-upgrade`.\n\nAfter the automated upgrade, you will probably still have to fix a few things.  See the [Elm 0.19 upgrade guide][upgrade] for more details.\n\n[upgrade]: https://github.com/elm/compiler/blob/master/docs/upgrade-instructions/0.19.0.md\n\n## What it looks like\n\n```\n$ elm-upgrade\nINFO: Found elm at /Users/avh4/workspace/elm-upgrade/node_modules/.bin/elm\nINFO: Found elm 0.19.0\nINFO: Found elm-format at /Users/avh4/workspace/elm-upgrade/node_modules/.bin/elm-format\nINFO: Found elm-format 0.8.0\nINFO: Cleaning ./elm-stuff before upgrading\nINFO: Converting elm-package.json -\u003e elm.json\nINFO: Detected an application project (this project has no exposed modules)\nINFO: Switching from elm-lang/core (deprecated) to elm/core\nINFO: Installing latest version of elm/core\nIt is already installed!\nINFO: Detected use of elm-lang/core#Random; installing elm/random\nHere is my plan:\n\n  Add:\n    elm/random    1.0.0\n    elm/time      1.0.0\n\nWould you like me to update your elm.json accordingly? [Y/n]: y\nDependencies loaded from local cache.\nDependencies ready!\nINFO: Detected use of elm-lang/core#Time; installing elm/time\nI found it in your elm.json file, but in the \"indirect\" dependencies.\nShould I move it into \"direct\" dependencies for more general use? [Y/n]: y\nDependencies loaded from local cache.\nDependencies ready!\nINFO: Switching from elm-lang/html (deprecated) to elm/html\nINFO: Installing latest version of elm/html\nHere is my plan:\n\n  Add:\n    elm/html           1.0.0\n    elm/virtual-dom    1.0.0\n\nWould you like me to update your elm.json accordingly? [Y/n]: y\nDependencies loaded from local cache.\nDependencies ready!\nINFO: Upgrading *.elm files in ./\n\n\nSUCCESS! Your project's dependencies and code have been upgraded.\nHowever, your project may not yet compile due to API changes in your\ndependencies.\n\nSee \u003chttps://github.com/elm/compiler/blob/master/upgrade-docs/0.19.md\u003e\nand the documentation for your dependencies for more information.\n\nHere are some common upgrade steps that you will need to do manually:\n\n- elm/core\n  - [ ] Replace uses of toString with String.fromInt, String.fromFloat, or Debug.toString as appropriate\n- elm/html\n  - [ ] If you used Html.program*, install elm/browser and switch to Browser.element or Browser.document\n  - [ ] If you used Html.beginnerProgram, install elm/browser and switch Browser.sandbox\n\n$ git add -N elm.json\n$ git diff\n```\n```diff\ndiff --git a/Main.elm b/Main.elm\nindex 7dd0dfb..1cbcdea 100644\n--- a/Main.elm\n+++ b/Main.elm\n@@ -1,4 +1,4 @@\n-module Main exposing (..)\n+module Main exposing (Model, Msg(..), height, init, main, update, view, width)\n\n import Html exposing (..)\n import Html.Attributes exposing (..)\n@@ -122,31 +122,27 @@ view model =\n         cursorY =\n             toString model.yPosition ++ \"px\"\n     in\n-    div [ style [ ( \"position\", \"relative\" ) ] ]\n+    div [ style \"position\" \"relative\" ]\n         [ img\n-            [ style\n-                [ ( \"width\", \"100%\" )\n-                , ( \"max-width\", toString width ++ \"px\" )\n-                , ( \"margin-left\", \"-50%\" )\n-                , ( \"position\", \"absolute\" )\n-                , ( \"left\", \"50%\" )\n-                ]\n+            [ style \"width\" \"100%\"\n+            , style \"max-width\" (toString width ++ \"px\")\n+            , style \"margin-left\" \"-50%\"\n+            , style \"position\" \"absolute\"\n+            , style \"left\" \"50%\"\n             , src \"assets/oujia_6.jpeg\"\n             ]\n             []\n         ]\ndiff --git a/elm-package.json b/elm-package.json\ndeleted file mode 100644\nindex f5ba1c5..0000000\n--- a/elm-package.json\n+++ /dev/null\n@@ -1,15 +0,0 @@\n-{\n-    \"version\": \"1.0.0\",\n-    \"summary\": \"helpful summary of your project, less than 80 characters\",\n-    \"repository\": \"https://github.com/user/project.git\",\n-    \"license\": \"BSD3\",\n-    \"source-directories\": [\n-        \".\"\n-    ],\n-    \"exposed-modules\": [],\n-    \"dependencies\": {\n-        \"elm-lang/core\": \"5.1.1 \u003c= v \u003c 6.0.0\",\n-        \"elm-lang/html\": \"2.0.0 \u003c= v \u003c 3.0.0\"\n-    },\n-    \"elm-version\": \"0.18.0 \u003c= v \u003c 0.19.0\"\n-}\ndiff --git a/elm.json b/elm.json\nindex e69de29..65d31f3 100644\n--- a/elm.json\n+++ b/elm.json\n@@ -0,0 +1,23 @@\n+{\n+    \"type\": \"application\",\n+    \"source-directories\": [\n+        \".\"\n+    ],\n+    \"elm-version\": \"0.19.0\",\n+    \"dependencies\": {\n+        \"direct\": {\n+            \"elm/core\": \"1.0.0\",\n+            \"elm/html\": \"1.0.0\",\n+            \"elm/random\": \"1.0.0\",\n+            \"elm/time\": \"1.0.0\"\n+        },\n+        \"indirect\": {\n+            \"elm/json\": \"1.0.0\",\n+            \"elm/virtual-dom\": \"1.0.0\"\n+        }\n+    },\n+    \"test-dependencies\": {\n+        \"direct\": {},\n+        \"indirect\": {}\n+    }\n+}\n\\ No newline at end of file\n```\n\n\n## Development info for contributors to elm-upgrade\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favh4%2Felm-upgrade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favh4%2Felm-upgrade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favh4%2Felm-upgrade/lists"}