Skip to content

Commit 1254580

Browse files
committed
Merge pull request #2 from slamdata/0.7-updates
Updates for 0.7
2 parents fd7f96f + fbc16f5 commit 1254580

28 files changed

+139
-104
lines changed

.gitignore

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
bower_components
2-
coverage
3-
dist
4-
node_modules
5-
public
6-
.psci
7-
.psci_modules
8-
.publish
9-
site/psc.js
1+
/.*
2+
!/.gitignore
3+
!/.travis.yml
4+
/bower_components/
5+
/node_modules/
6+
/output/

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: node_js
2+
sudo: false
3+
node_js:
4+
- 0.10
5+
env:
6+
- TAG=v0.7.0 PATH=$HOME/bin:$PATH
7+
install:
8+
- mkdir $HOME/bin
9+
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
10+
- tar zxvf $HOME/purescript.tar.gz -C $HOME/bin purescript/psc{,i,-docs,-bundle,-publish} --strip-components=1
11+
- chmod a+x $HOME/bin/psc{,i,-docs,-bundle,-publish}
12+
- npm install bower gulp -g
13+
- npm install && bower install
14+
script:
15+
- gulp

bower.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "purescript-css",
3-
"version": "0.0.0",
43
"authors": [
54
"Brian McKenna <brian@brianmckenna.org>"
65
],
@@ -18,15 +17,13 @@
1817
"tests"
1918
],
2019
"dependencies": {
21-
"purescript-math": "~0.1.1",
22-
"purescript-nonempty-arrays": "~0.2.0",
23-
"purescript-profunctor": "~0.2.1",
24-
"purescript-strings": "~0.4.5",
25-
"purescript-these": "~0.2.0",
26-
"purescript-transformers": "~0.5.4"
20+
"purescript-nonempty-arrays": "garyb/purescript-nonempty-array#0.7-updates",
21+
"purescript-profunctor": "^0.3.0",
22+
"purescript-strings": "^0.5.2",
23+
"purescript-these": "^0.3.0",
24+
"purescript-transformers": "^0.6.1"
2725
},
2826
"devDependencies": {
29-
"purescript-exceptions": "~0.2.3",
30-
"purescript-dom": "~0.1.2"
27+
"purescript-exceptions": "^0.3.0"
3128
}
3229
}

gulpfile.js

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,34 @@
1-
var gulp = require('gulp')
2-
, browserify = require('gulp-browserify')
3-
, purescript = require('gulp-purescript')
4-
, ghPages = require('gulp-gh-pages');
1+
/* jshint node: true */
2+
"use strict";
53

6-
require("mandragora-bucket")(gulp);
4+
var gulp = require("gulp");
5+
var purescript = require("gulp-purescript");
6+
var run = require("gulp-run");
77

8-
gulp.task('site', function() {
9-
return gulp.src(['site/Main.purs', 'src/**/*.purs', 'bower_components/purescript-*/src/**/*.purs']).pipe(purescript.psc({
10-
main: 'Site',
11-
modules: ['Site']
12-
})).pipe(browserify({})).pipe(gulp.dest('site'));
8+
var sources = [
9+
"src/**/*.purs",
10+
"bower_components/purescript-*/src/**/*.purs",
11+
"test/**/*.purs"
12+
];
13+
14+
var foreigns = [
15+
"src/**/*.js",
16+
"bower_components/purescript-*/src/**/*.js",
17+
"test/**/*.js"
18+
];
19+
20+
gulp.task("make", function() {
21+
return purescript.psc({ src: sources, ffi: foreigns });
1322
});
1423

15-
gulp.task('deploy', ['site'], function() {
16-
return gulp.src('site/**/*')
17-
.pipe(ghPages());
24+
gulp.task("test", ["make"], function() {
25+
return purescript.pscBundle({ src: "output/**/*.js", main: "Test.Main" })
26+
.pipe(run("node"));
1827
});
28+
29+
gulp.task("dotpsci", function () {
30+
return purescript.psci({ src: sources, ffi: foreigns })
31+
.pipe(gulp.dest("."));
32+
});
33+
34+
gulp.task("default", ["test", "dotpsci"]);

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2-
"dependencies": {
3-
"gulp": "^3.8.11",
4-
"mandragora-bucket": "^0.2.3"
5-
},
2+
"private": true,
63
"devDependencies": {
7-
"gulp-browserify": "^0.5.1",
8-
"gulp-gh-pages": "^0.5.0",
9-
"gulp-purescript": "^0.3.1"
4+
"gulp": "^3.8.11",
5+
"gulp-jscs": "^1.6.0",
6+
"gulp-jshint": "^1.11.2",
7+
"gulp-purescript": "^0.5.0",
8+
"gulp-run": "^1.6.8"
109
}
1110
}

src/Css/Animation.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Animation where
22

3+
import Prelude
34
import Css.Property
45
import Css.String
56
import Css.Stylesheet

src/Css/Background.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Background where
22

3+
import Prelude
34
import Css.Color
45
import Css.Property
56
import Css.String

src/Css/Border.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Border where
22

3+
import Prelude
34
import Css.Color
45
import Css.Property
56
import Css.Size

src/Css/Color.purs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module Css.Color where
22

3+
import Prelude
34
import Css.Property
45
import Css.String
56
import Data.Foldable
6-
import Math hiding (tan)
77

8-
data Color = Rgba Number Number Number Number
8+
data Color = Rgba Int Int Int Int
99
| Hsla Number Number Number Number
1010
| Other Value
1111

@@ -17,14 +17,14 @@ instance valColor :: Val Color where
1717
value (Rgba r g b a) = Value <<< fromString $ "rgba(" <> intercalate ", " [show r, show g, show b, show a] <> ")"
1818
value (Other v) = v
1919

20-
rgba :: Number -> Number -> Number -> Number -> Color
20+
rgba :: Int -> Int -> Int -> Int -> Color
2121
rgba = Rgba
2222

23-
rgb :: Number -> Number -> Number -> Color
23+
rgb :: Int -> Int -> Int -> Color
2424
rgb r g b = Rgba r g b 255
2525

26-
clamp :: Number -> Number
27-
clamp = max 0 <<< min 255
26+
clamp :: Int -> Int
27+
clamp n = if n < 0 then 0 else if n > 255 then 255 else n
2828

2929
aliceblue = rgb 240 248 255
3030
antiquewhite = rgb 250 235 215

src/Css/Display.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Display where
22

3+
import Prelude
34
import Css.Property
45
import Css.String
56
import Css.Stylesheet

src/Css/Elements.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Elements where
22

3+
import Prelude
34
import Css.Selector
45
import Css.String
56

src/Css/Font.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Font where
22

3+
import Prelude
34
import Css.Color
45
import Css.Property
56
import Css.Size
@@ -18,7 +19,7 @@ instance valGenericFontFamily :: Val GenericFontFamily where
1819
sansSerif :: GenericFontFamily
1920
sansSerif = GenericFontFamily $ fromString "sans-serif"
2021

21-
fontFamily :: [String] -> NEL.NonEmpty GenericFontFamily -> Css
22+
fontFamily :: Array String -> NEL.NonEmpty GenericFontFamily -> Css
2223
fontFamily a b = key (fromString "font-family") <<< value $ (value <<< quote <$> a) <> NEL.toArray (value <$> b)
2324

2425
fontSize :: forall a. Size a -> Css

src/Css/FontFace.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.FontFace where
22

3+
import Prelude
34
import Css.Property
45
import Css.String
56
import Css.Stylesheet

src/Css/Geometry.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Geometry where
22

3+
import Prelude hiding (top, bottom)
34
import Css.Size
45
import Css.String
56
import Css.Stylesheet

src/Css/Gradient.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Gradient where
22

3+
import Prelude
34
import Css.Background
45
import Css.Color
56
import Css.Property
@@ -9,7 +10,7 @@ import Data.Foldable
910

1011
data ColorPoint = ColorPoint Color (Size Rel)
1112

12-
linearGradient :: forall a. Angle a -> ColorPoint -> [ColorPoint] -> ColorPoint-> BackgroundImage
13+
linearGradient :: forall a. Angle a -> ColorPoint -> Array ColorPoint -> ColorPoint-> BackgroundImage
1314
linearGradient a b cs e = BackgroundImage $ fromString "linear-gradient(" <> value a <> fromString ", " <> points <> fromString ")"
1415
where colorPoint (ColorPoint a b) = value a <> fromString " " <> value b
1516
points = intercalate (fromString ", ") $ [colorPoint b] <> (colorPoint <$> cs) <> [colorPoint e]

src/Css/Media.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Media where
22

3+
import Prelude
34
import Css.Property
45
import Css.Size
56
import Css.String

src/Css/Property.purs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Property where
22

3+
import Prelude
34
import Css.String
45
import Data.Foldable
56
import Data.Maybe
@@ -8,16 +9,16 @@ import Data.Profunctor.Strong
89
import Data.Tuple
910
import qualified Data.Array.NonEmpty as NEL
1011

11-
data Prefixed = Prefixed [Tuple String String]
12+
data Prefixed = Prefixed (Array (Tuple String String))
1213
| Plain String
1314

1415
instance isStringPrefixed :: IsString Prefixed where
1516
fromString = Plain
1617

1718
instance semigroupPrefixed :: Semigroup Prefixed where
18-
(<>) (Plain x) (Plain y) = Plain $ x <> y
19-
(<>) (Plain x) (Prefixed ys) = Prefixed $ second (x <>) <$> ys
20-
(<>) (Prefixed xs) (Plain y) = Prefixed $ second (y <>) <$> xs
19+
append (Plain x) (Plain y) = Plain $ x <> y
20+
append (Plain x) (Prefixed ys) = Prefixed $ second (x <>) <$> ys
21+
append (Prefixed xs) (Plain y) = Prefixed $ second (y <>) <$> xs
2122
-- (<>) (Prefixed xs) (Prefixed ys)
2223

2324
instance monoidPrefixed :: Monoid Prefixed where
@@ -45,7 +46,7 @@ instance isStringValue :: IsString Value where
4546
fromString = Value <<< fromString
4647

4748
instance semigroupValue :: Semigroup Value where
48-
(<>) (Value a) (Value b) = Value $ a <> b
49+
append (Value a) (Value b) = Value $ a <> b
4950

5051
instance monoidValue :: Monoid Value where
5152
mempty = Value mempty
@@ -70,11 +71,11 @@ instance valTuple :: (Val a, Val b) => Val (Tuple a b) where
7071
instance valNumber :: Val Number where
7172
value = fromString <<< show
7273

73-
instance valList :: (Val a) => Val [a] where
74+
instance valList :: (Val a) => Val (Array a) where
7475
value = intercalate (fromString ", ") <<< (value <$>)
7576

7677
instance valNonEmpty :: (Val a) => Val (NEL.NonEmpty a) where
7778
value = value <<< NEL.toArray
7879

79-
noCommas :: forall a. (Val a) => [a] -> Value
80+
noCommas :: forall a. (Val a) => Array a -> Value
8081
noCommas = intercalate (fromString " ") <<< (value <$>)

src/Css/Pseudo.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Css.Pseudo where
22

3+
import Prelude
34
import Css.Selector
45
import Css.String
56

0 commit comments

Comments
 (0)