Skip to content

Commit 3b49399

Browse files
committed
init
0 parents  commit 3b49399

9 files changed

+10161
-0
lines changed

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# etc
2+
.idea
3+
.DS_Store
4+
5+
# node
6+
node_modules
7+
npm-debug.log
8+
9+
# development
10+
.Gruntfile.js
11+
.tmp
12+
.sass-cache/
13+
14+
dist
15+
16+
.gitkeep

Gruntfile.coffee

+204
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
"use strict"
2+
3+
# Listen on port 35729
4+
LIVERELOAD_PORT = 35729
5+
6+
lrSnippet = require('connect-livereload')( port: LIVERELOAD_PORT )
7+
folderMount = (connect, base) ->
8+
console.log(base)
9+
# Serve static files.
10+
connect.static ( require("path").resolve base )
11+
12+
module.exports = (grunt) ->
13+
14+
# Project configuration.
15+
grunt.initConfig
16+
connect:
17+
options:
18+
port: 9000
19+
hostname: "localhost"
20+
dev:
21+
options:
22+
middleware: (connect, options) ->
23+
[
24+
lrSnippet
25+
folderMount(connect, ".tmp/public")
26+
folderMount(connect, "public")
27+
]
28+
29+
dist:
30+
options:
31+
middleware: (connect, options) ->
32+
[
33+
lrSnippet
34+
folderMount(connect, "dist")
35+
]
36+
37+
#Set compile settings
38+
sass:
39+
dev:
40+
files: [
41+
expand: true
42+
cwd: "public/css/"
43+
src: ["**/*.sass","**/*.scss"]
44+
dest: ".tmp/public/css/"
45+
ext: ".css"
46+
]
47+
48+
less:
49+
dev:
50+
files: [
51+
expand: true
52+
cwd: "public/css/"
53+
src: ["**/*.less"]
54+
dest: ".tmp/public/css/"
55+
ext: ".css"
56+
]
57+
58+
stylus:
59+
dev:
60+
files: [
61+
expand: true
62+
cwd: "public/css/"
63+
src: ["**/*.styl"]
64+
dest: ".tmp/public/css/"
65+
ext: ".css"
66+
]
67+
68+
coffee:
69+
grunt:
70+
files:
71+
".Gruntfile.js": "Gruntfile.coffee"
72+
73+
dev:
74+
files: [
75+
options:
76+
bare: true
77+
expand: true
78+
cwd: "public/js/"
79+
src: ['**/*.coffee']
80+
dest: ".tmp/public/js/"
81+
ext: '.js'
82+
]
83+
84+
typescript:
85+
dev:
86+
files: [
87+
expand: true
88+
cwd: "public/js/"
89+
src: ['**/*.ts']
90+
dest: ".tmp/public/js/"
91+
ext: '.js'
92+
]
93+
94+
babel:
95+
options:
96+
sourceMap: true
97+
dev:
98+
files:[
99+
expand: true
100+
cwd: "public/js/"
101+
src: ['**/*.es6']
102+
dest: ".tmp/public/js/"
103+
ext: '.js'
104+
]
105+
106+
# watch files settings
107+
watch:
108+
options:
109+
livereload: false
110+
111+
sass:
112+
options:
113+
cwd: "public/css"
114+
files: ["**/*.sass", "**/*.scss"]
115+
tasks: ["sass:dev"]
116+
117+
less:
118+
options:
119+
cwd: "public/css"
120+
files: ["**/*.less"]
121+
tasks: ["less:dev"]
122+
123+
stylus:
124+
options:
125+
cwd: "public/css"
126+
files: ["**/*.styl"]
127+
tasks: ["stylus:dev"]
128+
129+
babel:
130+
options:
131+
cwd: "public/js"
132+
files: ["**/*.es6"]
133+
tasks: ["babel:dev"]
134+
135+
coffee:
136+
options:
137+
cwd: "public/js"
138+
files: ["**/*.coffee"]
139+
tasks: ["coffee:dev"]
140+
141+
typescript:
142+
options:
143+
cwd: "public/js"
144+
files: ["**/*.ts"]
145+
tasks: ["typescript:dev"]
146+
147+
plain:
148+
options:
149+
cwd: "public"
150+
livereload: LIVERELOAD_PORT
151+
files: ["**/*.html", "css/**/*.css", "js/**/*.js"]
152+
153+
compiled:
154+
options:
155+
cwd: ".tmp/public"
156+
livereload: LIVERELOAD_PORT
157+
files: ["**/*.html", "css/**/*.css", "js/**/*.js"]
158+
159+
clean:
160+
grunt:
161+
src: ".Gruntfile.js"
162+
dev:
163+
src: [".tmp/**"]
164+
dist:
165+
src: ["dist/**"]
166+
167+
copy:
168+
dist:
169+
files:[
170+
{
171+
expand: true
172+
cwd: 'public/'
173+
src: ["**","!**/*.{coffee,ts,sass,scss,less,styl}"]
174+
dest: "dist/"
175+
},
176+
{
177+
expand: true,
178+
cwd: ".tmp/public/"
179+
src: ["**"],
180+
dest: "dist/"
181+
}
182+
]
183+
184+
# browser open
185+
open:
186+
server:
187+
path: "http://localhost:<%= connect.options.port %>"
188+
# app: 'Google Chrome Canary'
189+
190+
# modules load
191+
require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks
192+
193+
# task configure
194+
grunt.registerTask "default", ->
195+
grunt.task.run ["serve"];
196+
197+
grunt.registerTask "serve", ["clean", "coffee:grunt", "compile", "connect:dev", "open", "watch"]
198+
199+
grunt.registerTask "build", ["clean", "compile", "copy:dist"]
200+
201+
grunt.registerTask "dist", ["build", "connect:dist", "open", "watch"]
202+
203+
grunt.registerTask "compile", ["babel:dev", "coffee:dev", "typescript:dev", "sass:dev", "less:dev", "stylus:dev"]
204+

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2013 kamiyam
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
JS Dojo Vol.2
2+
========================
3+
4+
```
5+
git clone [email protected]:dh-js-dojo/vol2-slider.git && vol1-slider
6+
7+
npm i
8+
9+
grunt serve
10+
11+
```
12+
13+

package.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "js-dojo-vol2",
3+
"version": "0.0.1",
4+
"description": "js-dojo-vol2",
5+
"main": "npm start",
6+
"devDependencies": {
7+
"connect-livereload": "^0.3.2",
8+
"grunt": "^0.4.5",
9+
"grunt-babel": "^5.0.3",
10+
"grunt-contrib-clean": "^0.5.0",
11+
"grunt-contrib-coffee": "^0.7.0",
12+
"grunt-contrib-connect": "^0.5.0",
13+
"grunt-contrib-copy": "^0.5.0",
14+
"grunt-contrib-less": "^0.8.3",
15+
"grunt-contrib-sass": "^0.5.1",
16+
"grunt-contrib-stylus": "^0.11.0",
17+
"grunt-contrib-watch": "^0.5.3",
18+
"grunt-open": "^0.2.3",
19+
"grunt-typescript": "~0.2.7",
20+
"matchdep": "^0.3.0"
21+
},
22+
"scripts": {
23+
"start": "grunt",
24+
"test": "echo \"Error: no test specified\" && exit 1"
25+
},
26+
"repository": {
27+
"type": "git",
28+
"url": "git://github.com/dh-js-dojo/vol1-slider"
29+
},
30+
"keywords": [
31+
"javascript",
32+
"html"
33+
],
34+
"author": "dh-js-dojo",
35+
"license": "MIT",
36+
"readmeFilename": "README.md",
37+
"bugs": {
38+
"url": "https://github.com/dh-js-dojo/vol2-slider/issues"
39+
}
40+
}

public/css/style.styl

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ul
2+
list-style: none;
3+
4+
.container {
5+
width: 100vw;
6+
height: 100vh;
7+
margin: 0 auto;
8+
}

public/index.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE HTML>
2+
<html lang="ja_JP">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>JS Dojo</title>
6+
<link rel="stylesheet" href="css/style.css"/>
7+
<script src="js/jquery.js"></script>
8+
<script src="js/index.js"></script>
9+
</head>
10+
<body>
11+
<div class="container">
12+
<ul class="grid">
13+
<li>
14+
<img src="http://placekitten.com/2000/1600?image=1" alt="">
15+
</li>
16+
</ul>
17+
</div>
18+
19+
</body>
20+
</html>

public/js/index.es6

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(function($){
2+
//
3+
$(function(){
4+
5+
});
6+
})(jQuery);
7+
8+
9+

0 commit comments

Comments
 (0)