• Stars
    star
    122
  • Rank 282,979 (Top 6 %)
  • Language
    Perl
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Upgrade Elm projects

elm-upgrade Build Status

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. elm-upgrade will do the following:

  • Convert your elm-package.json file to ...
    • ... an application elm.json if your project has no exposed modules
    • ... a package elm.json if your project has at least one exposed module
  • Try to upgrade all of your project dependencies
  • Warn you if some of your project dependencies don't support Elm 0.19 yet
  • Use elm-format --upgrade to upgrade your code, which includes the following:
    • Convert escaped characters in strings to the new syntax (\u{xxxx})
    • Inline uses of functions which were removed in Elm 0.19:
      • (,,), (,,,), etc tuple constructor functions
      • Platform.Cmd.(!)
      • flip, curry, uncurry, and rem from the Basics module
    • Upgrade code that uses Html.Attributes.style

elm-upgrade can also upgrade dependencies of your Elm 0.19 applications. If you are already using Elm 0.19, elm-upgrade will to the following:

  • check for newer versions of all your direct dependencies and try to install them

How to use elm-upgrade

First install Elm 0.19.1 and the latest version of elm-format. (If you want to install them locally for your project, you can do so with the following: )

cd path/to/my/elm/project
npm install [email protected]
npm install [email protected]

Then run the following in your terminal:

cd path/to/my/elm/project
npx elm-upgrade@latest

NOTE: 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.

After the automated upgrade, you will probably still have to fix a few things. See the Elm 0.19 upgrade guide for more details.

What it looks like

$ elm-upgrade
INFO: Found elm at /Users/avh4/workspace/elm-upgrade/node_modules/.bin/elm
INFO: Found elm 0.19.0
INFO: Found elm-format at /Users/avh4/workspace/elm-upgrade/node_modules/.bin/elm-format
INFO: Found elm-format 0.8.0
INFO: Cleaning ./elm-stuff before upgrading
INFO: Converting elm-package.json -> elm.json
INFO: Detected an application project (this project has no exposed modules)
INFO: Switching from elm-lang/core (deprecated) to elm/core
INFO: Installing latest version of elm/core
It is already installed!
INFO: Detected use of elm-lang/core#Random; installing elm/random
Here is my plan:

  Add:
    elm/random    1.0.0
    elm/time      1.0.0

Would you like me to update your elm.json accordingly? [Y/n]: y
Dependencies loaded from local cache.
Dependencies ready!
INFO: Detected use of elm-lang/core#Time; installing elm/time
I found it in your elm.json file, but in the "indirect" dependencies.
Should I move it into "direct" dependencies for more general use? [Y/n]: y
Dependencies loaded from local cache.
Dependencies ready!
INFO: Switching from elm-lang/html (deprecated) to elm/html
INFO: Installing latest version of elm/html
Here is my plan:

  Add:
    elm/html           1.0.0
    elm/virtual-dom    1.0.0

Would you like me to update your elm.json accordingly? [Y/n]: y
Dependencies loaded from local cache.
Dependencies ready!
INFO: Upgrading *.elm files in ./


SUCCESS! Your project's dependencies and code have been upgraded.
However, your project may not yet compile due to API changes in your
dependencies.

See <https://github.com/elm/compiler/blob/master/upgrade-docs/0.19.md>
and the documentation for your dependencies for more information.

Here are some common upgrade steps that you will need to do manually:

- elm/core
  - [ ] Replace uses of toString with String.fromInt, String.fromFloat, or Debug.toString as appropriate
- elm/html
  - [ ] If you used Html.program*, install elm/browser and switch to Browser.element or Browser.document
  - [ ] If you used Html.beginnerProgram, install elm/browser and switch Browser.sandbox

$ git add -N elm.json
$ git diff
diff --git a/Main.elm b/Main.elm
index 7dd0dfb..1cbcdea 100644
--- a/Main.elm
+++ b/Main.elm
@@ -1,4 +1,4 @@
-module Main exposing (..)
+module Main exposing (Model, Msg(..), height, init, main, update, view, width)

 import Html exposing (..)
 import Html.Attributes exposing (..)
@@ -122,31 +122,27 @@ view model =
         cursorY =
             toString model.yPosition ++ "px"
     in
-    div [ style [ ( "position", "relative" ) ] ]
+    div [ style "position" "relative" ]
         [ img
-            [ style
-                [ ( "width", "100%" )
-                , ( "max-width", toString width ++ "px" )
-                , ( "margin-left", "-50%" )
-                , ( "position", "absolute" )
-                , ( "left", "50%" )
-                ]
+            [ style "width" "100%"
+            , style "max-width" (toString width ++ "px")
+            , style "margin-left" "-50%"
+            , style "position" "absolute"
+            , style "left" "50%"
             , src "assets/oujia_6.jpeg"
             ]
             []
         ]
diff --git a/elm-package.json b/elm-package.json
deleted file mode 100644
index f5ba1c5..0000000
--- a/elm-package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "version": "1.0.0",
-    "summary": "helpful summary of your project, less than 80 characters",
-    "repository": "https://github.com/user/project.git",
-    "license": "BSD3",
-    "source-directories": [
-        "."
-    ],
-    "exposed-modules": [],
-    "dependencies": {
-        "elm-lang/core": "5.1.1 <= v < 6.0.0",
-        "elm-lang/html": "2.0.0 <= v < 3.0.0"
-    },
-    "elm-version": "0.18.0 <= v < 0.19.0"
-}
diff --git a/elm.json b/elm.json
index e69de29..65d31f3 100644
--- a/elm.json
+++ b/elm.json
@@ -0,0 +1,23 @@
+{
+    "type": "application",
+    "source-directories": [
+        "."
+    ],
+    "elm-version": "0.19.0",
+    "dependencies": {
+        "direct": {
+            "elm/core": "1.0.0",
+            "elm/html": "1.0.0",
+            "elm/random": "1.0.0",
+            "elm/time": "1.0.0"
+        },
+        "indirect": {
+            "elm/json": "1.0.0",
+            "elm/virtual-dom": "1.0.0"
+        }
+    },
+    "test-dependencies": {
+        "direct": {},
+        "indirect": {}
+    }
+}
\ No newline at end of file

Development info for contributors to elm-upgrade

See CONTRIBUTING.md.

More Repositories

1

elm-format

elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
Haskell
1,308
star
2

elm-program-test

Test Elm programs
Elm
92
star
3

elm-beautiful-example

Create beautiful examples to show off your Elm packages and projects
Elm
49
star
4

elm-desktop-app

the simplest way to write desktop applications in Elm
Elm
45
star
5

elm-testable

Makes Cmds and Tasks testable
Elm
41
star
6

binwrap

Distribute binaries via npm
JavaScript
38
star
7

time-tracker-for-mac

This repository is out of date-- use the SVN repository at http://code.google.com/p/time-tracker-mac/source/browse/
Objective-C
34
star
8

codevember-2016

30 Elm graphics experiments (WebGL, SVG, HTML)
HTML
33
star
9

elm-mario

The Elm Mario example updated for Elm 0.18
HTML
28
star
10

hero-extant

Java port of Hero Extant: World Generator - This world generator uses fractal terrains and various simulations to generate highly detailed random map data.
Java
23
star
11

elm-debug-controls

Easily build interactive UIs for complex data structures
Elm
23
star
12

elm-color

Standard representation of colors, encouraging sharing between packages. (This replaces elm-lang/core#Color from Elm 0.18.)
Elm
21
star
13

elm-aws-cognito

Example of using AWS Cognito in Elm via ports
Elm
21
star
14

elm-animations

Elm
17
star
15

elm-dropbox

Unofficial Dropbox API for Elm
Elm
15
star
16

junit-nested

JUnit-Nested - Testing tool for Java
Java
15
star
17

imagecomparison

Tools for comparing images and writing image-based approval tests. This library is published on Maven Central.
Java
8
star
18

elm-github-v3

Unofficial GitHub v3 API for Elm
Elm
8
star
19

elm-spec

Elm
7
star
20

elm-compile-html

Compile HTML templates into Elm code
Elm
7
star
21

khan-academy

Fork of the hg repository: Khan Academy main web application
Python
7
star
22

sleep-as-android-parser

JavaScript
6
star
23

burndown-charts

A library for plotting burndown charts
Elm
6
star
24

ruby-sync

sync local directories to FTP
Ruby
6
star
25

jbehave-junit-monitor

fine grained monitoring of jbehave scenarios using junit runner (fork from svn project)
Java
5
star
26

elm-diff

Elm
5
star
27

elm-favicon

Get icons for URLs
Elm
5
star
28

rubyviz

generate diagrams of class and method collaboration in ruby to aid in refactoring
Ruby
5
star
29

picocontainer-example

How to use PicoContainer with dynamically-created dependencies
Java
4
star
30

rbiphonetest-example

An example of using rbiphonetest and playing around to add rspec support.
Objective-C
4
star
31

react-charts

SVG charting library for React.js
JavaScript
4
star
32

map-toolkit

Java
4
star
33

elm-refactor

4
star
34

system_keychain

Store account credentials in the OS keychain
Ruby
3
star
35

elm-meshes

3D meshes (useful for WebGL in Elm)
Elm
3
star
36

jfugue

Mirror of subversion repository: JFugue - Java API for Music Programming
Java
3
star
37

ocmock

git mirror of the OCMock subversion repository
Objective-C
3
star
38

elm-fifo

first in, first out (FIFO) queue
Elm
3
star
39

elm-realtime-drive

Elm bindings for Google Drive Realtime API
JavaScript
3
star
40

elm-dataviz

simple rendering of tabular data
Elm
3
star
41

scratch

A scratch space for trying out new things and doing project spikes. See branches.
2
star
42

master

Starting points for software development. I am slowly migrating this functionality into my "apro" rubigen package. See branches.
2
star
43

apro

rubigen components for my projects (and perhaps your projects as well)
Objective-C
2
star
44

lightning-select

Randomizer for choosing lightning talk speakers
HTML
2
star
45

avh4-util

Useful things for Java
Java
2
star
46

gitpod-template-elm

An Elm template for Gitpod (www.gitpod.io)
Elm
2
star
47

xadisk

Mirror of XADisk - Transaction with File Systems in Java
Java
2
star
48

socketactor

SocketChannel facade for actor frameworks
Java
2
star
49

atom-elm-format

2
star
50

elm-dlang

WIP
Haskell
2
star
51

website-templates

Design/layout templates for web pages.
2
star
52

netbeans-junit-example

A simple example project of using junit from NetBeans 6.1
Java
2
star
53

uilayer

A scenegraph GUI framework designed for easy, robust automated UI testing with backends for Android, Swing and iOS.
Java
2
star
54

avh4.github.com

My github pages repository
2
star
55

literate-ruby

A new way of writing ruby apps based on Donald Knuth's Literate Programming
Ruby
2
star
56

google-toolbox-for-mac

Google toolbox for mac (SVN repo mirror)
Objective-C
2
star
57

xcodeproj-reader

vaporware - will allow reading (and eventually writing) of Xcode project files
Ruby
2
star
58

mp3-my-oggs

A command-line script to convert ogg files to mp3 files while maintaining all the file metadata, developed using BDD with cucumber
Ruby
2
star
59

ukulele-songbook

Java
1
star
60

wire-game

network topology game in Elm
Elm
1
star
61

tcheatsheats

JavaScript
1
star
62

elm-branches

Elm
1
star
63

lisp-parser

LISP parser for Java
Java
1
star
64

elm-wiki

Experiment in elm inspired by fedwiki
Elm
1
star
65

geometry

Java
1
star
66

outlin

Elm
1
star
67

robot-factory

Java
1
star
68

Schwarzwald

Fast, stable integration testing for OS X
C++
1
star
69

deft

An experimental API design for functional GUI development.
Clojure
1
star
70

elm-typist

typing tutor
Elm
1
star
71

cukes.info

Source for http://cukes.info
JavaScript
1
star
72

hde

Happy Development Environment
Java
1
star
73

platform

Ruby
1
star
74

lifeline-galaxy

Java
1
star
75

paper-less

LESS (CSS) styles for components and patterns in the Google Material Design ("Paper") style guide
CSS
1
star
76

phpfundthermo

Fork of http://sourceforge.net/projects/phpfundthermo/
PHP
1
star
77

madlibs

Java
1
star
78

avh4_soloist

Mac OSX workstation setup
1
star
79

rectified

Simple, expressive, and programmer-friendly UI design
Java
1
star
80

setup

Shell scripts for setting up computers the way I like them
Shell
1
star
81

glucose_plot

Python
1
star
82

home

Home directory (mainly dotfiles)
Shell
1
star
83

platform-java

Java
1
star
84

elm-elm

Elm AST in Elm
Elm
1
star
85

java-1.6-archetype

DEPRECATED -- Please use https://github.com/archetypes/java-1.6 instead
1
star
86

picard-recordingdate

MusicBrainz Picard plugin for recording date metadata
Python
1
star
87

elm-mind-map

Elm
1
star
88

avh4_workstation

Chef cookbook for workstation setup (See also pivotal/pivotal_workstation)
Ruby
1
star
89

structstore-osx

Objective-C
1
star
90

imagecomparison-clj

Tools for comparing images and writing image-based approval tests.
Clojure
1
star
91

statistics-simulator

Chrome extension for keeping it real... maybe too real
JavaScript
1
star
92

check-all

Ad-hoc build tool for rapid TDD
Nix
1
star
93

platform-docs

1
star
94

sandbox

Create and manage temporary folders to simplify integration testing
Java
1
star
95

wysiwyg-editor-toolkit

Elm
1
star
96

codejam-bowls

Java
1
star
97

project_lint

Keep your projects up to date
Ruby
1
star
98

elm-persistent-data

(WIP) experimental framework for building Elm apps with user-owned data persistence
Elm
1
star
99

elm-number-format

Number formatting
Elm
1
star