Skip to content

Commit

Permalink
Move TodoMVC examples to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jlavelle committed Nov 12, 2019
1 parent a77d8bd commit 25efa2c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
/.psa*
/.spago
/.cache
/bundle/bundle.js
/bundle/
/dist
24 changes: 24 additions & 0 deletions examples/todomvc/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Template • TodoMVC</title>
<link rel="stylesheet" href="../../node_modules/todomvc-common/base.css">
<link rel="stylesheet" href="../../node_modules/todomvc-app-css/index.css">
</head>
<body>

<div id="container"></div>

<footer class="info">
<p>Double-click to edit a todo</p>
<!-- Change this out with your name and url ↓ -->
<p>Created by <a href="https://github.com/masaeedu">Asad Saeeduddin</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>

<script src="../../node_modules/todomvc-common/base.js"></script>
<script src="../../bundle/todomvc/bundle.js"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions src/Main.purs → examples/todomvc/src/Main.purs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Main where
module Examples.TodoMVC.Main where

import Prelude

Expand All @@ -12,8 +12,8 @@ import Effect.Ref as Ref
import Snap (snap)
import Snap.React (reactTarget, refSnapper)
import Snap.SYTC.Component (contraHoist)
import TodoMVC.State (initialState)
import TodoMVC.UI (app)
import Examples.TodoMVC.State (initialState)
import Examples.TodoMVC.UI (app)
import Web.DOM (Element)
import Web.DOM.NonElementParentNode (getElementById)
import Web.HTML (window)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module TodoMVC.State where
module Examples.TodoMVC.State where

import Prelude

Expand Down
6 changes: 3 additions & 3 deletions src/TodoMVC/UI.purs → examples/todomvc/src/TodoMVC/UI.purs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module TodoMVC.UI where
module Examples.TodoMVC.UI where

import Prelude hiding (map,apply)

Expand All @@ -17,8 +17,8 @@ import Snap.React.Component ((|-), (|<), (|=), (|~))
import Snap.React.Component as S
import Snap.SYTC.Component (Cmp, Cmp', (<$>!), (<*>!))
import Snap.SYTC.Component as C
import TodoMVC.State (App, Filter(..), Todo, Todos)
import TodoMVC.State (_dirty, _done, _filter, _hovered, _newTodo, _state, _todos, _value, className, createTodo, defaultNewTodo) as T
import Examples.TodoMVC.State (App, Filter(..), Todo, Todos)
import Examples.TodoMVC.State (_dirty, _done, _filter, _hovered, _newTodo, _state, _todos, _value, className, createTodo, defaultNewTodo) as T

-- #### UI

Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"scripts": {
"bundle": "npm run spago && npm run parcel",
"spago": "spago bundle-app --main Main --to bundle/bundle.js",
"parcel": "parcel index.html",
"pscid:build": "spago build"
"build": "spago build",
"build:todomvc": "spago bundle-app --main Examples.TodoMVC.Main --to bundle/todomvc/bundle.js",
"todomvc": "npm run build:todomvc && parcel examples/todomvc/index.html"
},
"dependencies": {
"react": "^16.8.6",
Expand Down
2 changes: 1 addition & 1 deletion spago.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Welcome to a Spago project!
You can edit this file as you like.
-}
{ sources =
[ "src/**/*.purs", "test/**/*.purs" ]
[ "src/**/*.purs", "test/**/*.purs", "examples/**/*.purs" ]
, name =
"my-project"
, dependencies =
Expand Down

0 comments on commit 25efa2c

Please sign in to comment.