Skip to content

Commit

Permalink
Working enviroment
Browse files Browse the repository at this point in the history
  • Loading branch information
unimonkiez committed Apr 13, 2016
0 parents commit a1474d0
Show file tree
Hide file tree
Showing 10 changed files with 313 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = crlf
indent_size = 2
indent_style = space
max_line_length = 200
trim_trailing_whitespace = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
154 changes: 154 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{
"root": true,
"parser": "babel-eslint",
"env": {
"es6": true,
"node": true,
"browser": false
},
"globals": {
"__DEV__": false,
"__PROD__": false
},
"rules": {
"comma-dangle": [2, "never"],
"no-cond-assign": [2, "except-parens"],
"no-console": 2,
"no-alert": 2,
"no-constant-condition": 0,
"no-control-regex": 0,
"no-debugger": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty": 0,
"no-ex-assign": 2,
"disallow-extra-boolean-casts": 0,
"no-extra-parens": 0,
"no-extra-semi": 2,
"no-func-assign": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-negated-in-lhs": 2,
"no-obj-calls": 2,
"no-regex-spaces": 2,
"no-sparse-arrays": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"use-isnan": 2,
"valid-jsdoc": 0,
"valid-typeof": 2,

"block-scoped-var": 0,
"complexity": 0,
"consistent-return": 0,
"default-case": 0,
"dot-location": [2, "property"],
"dot-notation": 0,
"eqeqeq": 0,
"no-caller": 2,
"no-case-declarations": 0,
"no-div-regex": 2,
"no-else-return": 0,
"no-labels": 2,
"no-empty-pattern": 1,
"no-eval": 0,
"no-implied-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 1,
"no-fallthrough": 2,
"no-implicit-coercion": 0,
"no-invalid-this": 0,
"no-lone-blocks": 0,
"no-loop-func": 0,
"no-magic-numbers": 0,
"no-multi-spaces": 0,
"no-multi-str": 2,
"no-native-reassign": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-octal-escape": 2,
"no-octal": 1,
"no-param-reassign": 0,
"no-process-env": 0,
"no-proto": 2,
"no-return-assign": [2, "except-parens"],
"no-self-compare": 2,
"no-sequences": 1,
"no-throw-literal": 2,
"no-unused-expressions": 2,
"no-useless-call": 2,
"no-useless-concat": 0,
"no-void": 0,
"no-warning-comments": 0,
"no-with": 2,
"radix": 1,
"vars-on-top": 0,
"wrap-iife": [2, "inside"],
"yoda": 0,
"strict": 0,
"init-declarations": 0,
"no-delete-var": 2,
"no-label-var": 2,
"no-shadow-restricted-names": 2,
"no-shadow": 0,
"no-undef-init": 0,
"no-undef": [2, {"typeof": true}],
"no-undefined": 0,
"no-unused-vars": 0,
"no-var": 2,
"no-new-require": 2,
"array-bracket-spacing": [2, "never"],
"block-spacing": 0,
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
"camelcase": 0,
"comma-spacing": [2, {"before": false, "after": true}],
"comma-style": [2, "last"],
"computed-property-spacing": [2, "never"],
"consistent-this": 0,
"func-names": 0,
"func-style": 0,
"id-length": 0,
"id-match": 0,
"indent": [2, 2],
"key-spacing": 0,
"lines-around-comment": 0,
"max-nested-callbacks": 0,
"new-parens": 2,
"newline-after-var": 0,
"no-array-constructor": 2,
"no-continue": 0,
"no-inline-comments": 0,
"no-lonely-if": 0,
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 1}],
"no-negated-condition": 0,
"no-nested-ternary": 0,
"no-new-object": 2,
"no-spaced-func": 2,
"no-ternary": 0,
"no-trailing-spaces": 2,
"no-underscore-dangle": 0,
"no-unneeded-ternary": 2,
"object-curly-spacing": [2, "never"],
"one-var": 0,
"operator-assignment": 0,
"operator-linebreak": [2, "after"],
"quote-props": 0,
"quotes": [2, "single", "avoid-escape"],
"require-jsdoc": 0,
"semi-spacing": [2, {"before": false, "after": true}],
"semi": [2, "always"],
"sort-vars": 0,
"keyword-spacing": "error",
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [2, {"words": true, "nonwords": false}],
"spaced-comment": 0,
"wrap-regex": 0
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
npm-debug.log
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Emoji window example</title>
<script type="text/javascript" src="dist/emoji-window.js"></script>
</head>
<body>
sdsssssds
</body>
</html>
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "emoji-window",
"version": "0.0.0",
"description": "Add window picker for emojis with different types of sets on your website. http://TimeToKnow.github.io/emoji-window/",
"main": "dist/emoji-window.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack-dev-server --port 8080 --inline --progress --colors --config ./webpack.dev.config.js"
},
"repository": {
"type": "git",
"url": "https://github.com/TimeToKnow/emoji-window"
},
"keywords": [
"emoji",
"picker",
"window",
"twitter",
"ios",
"android",
"emojione",
"google"
],
"author": "unimonkiez",
"license": "ISC",
"devDependencies": {
"babel-eslint": "^6.0.2",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"emoji-data": "git+https://github.com/iamcal/emoji-data.git",
"eslint": "^2.7.0",
"file-loader": "^0.8.5",
"html-webpack-plugin": "^2.15.0",
"json-loader": "^0.5.4",
"path": "^0.12.7",
"webpack": "^1.12.15",
"webpack-dev-server": "^1.14.1"
}
}
8 changes: 8 additions & 0 deletions src/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"root": true,
"parser": "babel-eslint",
"env": {
"browser": true,
"node": false
}
}
1 change: 1 addition & 0 deletions src/emoji-window.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert(12223);
58 changes: 58 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
'use strict';
const webpack = require('webpack');
const path = require('path');

const __PROD__ = process.env.NODE_ENV === 'production';
const __DEV__ = !__PROD__;

module.exports = {
devtool: __DEV__ ? 'source-map' : false,
entry: {
'emoji-window': [
'./src/emoji-window.js'
]
},
output: {
path: path.join(__dirname, 'dist'),
filename: `[name]${__PROD__ ? '.min' : ''}.js`,
publicPath: ''
},
plugins: [
new webpack.DefinePlugin({
__PROD__: JSON.stringify(__PROD__),
__DEV__: JSON.stringify(__DEV__),
'process.env': {
NODE_ENV: JSON.stringify(__PROD__ ? 'production' : 'development')
}
})
].concat(__PROD__ ? [
new webpack.optimize.UglifyJsPlugin({
output: {
comments: false
},
compress: {
warnings: false
},
sourceMap: false
})
] : []),
module: {
preLoaders: [
{
test: /\.json$/,
exclude: /node_modules/,
loader: 'json'
}
],
loaders: [
{
test: /\.js$/,
include: [path.resolve(__dirname, 'src')],
loader: 'babel',
query: {
presets: ['es2015']
}
}
]
}
};
21 changes: 21 additions & 0 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpackBaseConfig = require('./webpack.config');

module.exports =
Object.assign(webpackBaseConfig, {
entry: Object.assign(webpackBaseConfig.entry, {
base: [] // Hot model replacement code will be injected here
}),
output: Object.assign(webpackBaseConfig.output, {
publicPath: 'dist' // So that index.html won't need to change emoji-windiw.js import location also on github
}),
plugins: webpackBaseConfig.plugins.concat([
new HtmlWebpackPlugin({
chunks: ['base'],
template: './index.html',
inject: 'head'
})
])
});

0 comments on commit a1474d0

Please sign in to comment.