Skip to content

Commit 1c04343

Browse files
committed
helpers init
1 parent c34fab4 commit 1c04343

10 files changed

+160
-1
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# node-waf configuration
20+
.lock-wscript
21+
22+
# Compiled binary addons (http://nodejs.org/api/addons.html)
23+
build/Release
24+
25+
# Dependency directory
26+
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
27+
node_modules
28+
29+
.DS_Store
30+
31+
dist
32+
bundle
33+
bundle.*

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 Scratch
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, 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,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
# Scratch-Helpers
1+
# Scratch Helpers
2+
Helper classes for scratch framework

index.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html >
2+
<html lang="en-US">
3+
<head>
4+
<title>Scratch</title>
5+
<link rel="stylesheet" type="text/css" href="bundle.css">
6+
</head>
7+
<body>
8+
<h1>Do you see two columns below?</h1>
9+
<br>
10+
<div class="flexible row">
11+
<div class="cell">Yes</div>
12+
<div class="cell">Yes</div>
13+
14+
</div>
15+
<script type="text/javascript" src="bundle.js"></script>
16+
</body>
17+
</html>

index.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
'use strict'
2+
require('./lib/index.css')

lib/align.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.align {
2+
&-left { text-align: left }
3+
&-center { text-align: center }
4+
&-right { text-align: right }
5+
}

lib/index.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* scratch library */
2+
@import '../node_modules/@nikoloza/scratch/lib/config/index.css';
3+
4+
/* helper imports */
5+
@import './align.css';

package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "@nikoloza/helpers",
3+
"version": "0.1.0",
4+
"description": "",
5+
"main": "lib/index.css",
6+
"scripts": {
7+
"start": "webpack-dev-server",
8+
"dev": "webpack-dev-server --watch",
9+
"build": "webpack",
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"author": "",
13+
"license": "",
14+
"dependencies": {
15+
"@nikoloza/scratch": "0.1.0"
16+
},
17+
"devDependencies": {
18+
"babel-core": "^6.14.0",
19+
"babel-loader": "^6.2.5",
20+
"babel-plugin-transform-class-properties": "^6.11.5",
21+
"babel-preset-es2015": "^6.14.0",
22+
"css-loader": "^0.25.0",
23+
"extract-text-webpack-plugin": "^1.0.1",
24+
"postcss-cssnext": "^2.8.0",
25+
"postcss-import": "^8.1.2",
26+
"postcss-loader": "^0.13.0",
27+
"postcss-url": "^5.1.2",
28+
"precss": "^1.4.0",
29+
"style-loader": "^0.13.1",
30+
"webpack": "^1.13.2",
31+
"webpack-dev-server": "^1.15.1"
32+
}
33+
}

webpack.config.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
var precss = require('precss')
2+
var cssimport = require('postcss-import')
3+
var cssnext = require('postcss-cssnext')
4+
var ExtractTextPlugin = require('extract-text-webpack-plugin')
5+
6+
module.exports = {
7+
entry: './index.js',
8+
template: './index.html',
9+
output: {
10+
filename: 'bundle.js'
11+
},
12+
module: {
13+
loaders: [{
14+
test: /\.css$/,
15+
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader')
16+
}]
17+
},
18+
postcss: function (webpack) {
19+
return [
20+
precss,
21+
cssimport({
22+
addDependencyTo: webpack
23+
}),
24+
cssnext()
25+
]
26+
},
27+
plugins: [
28+
new ExtractTextPlugin('bundle.css')
29+
]
30+
}

0 commit comments

Comments
 (0)