Skip to content

Commit

Permalink
Deploy 2017-12-23 12:23:00 (elchemy#28)
Browse files Browse the repository at this point in the history
* removing aff removed avar

* explicit return on readFile

* Allow FF keycode for Ctrl/Cmd (elchemy#22)

* Allow FF keycode for Ctrl/Cmd

* Prefer `Set` over `List` for readability

* smaller bundles
  • Loading branch information
Luke Westby authored Dec 23, 2017
1 parent 33ee720 commit e4d84f5
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 27 deletions.
31 changes: 27 additions & 4 deletions client/src/Data/Ellie/KeyCombo.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Data.Ellie.KeyCombo exposing (..)

import Keyboard
import Set exposing (Set)


type alias KeyCombo =
Expand All @@ -9,6 +10,28 @@ type alias KeyCombo =
}


controlKeyCodes : Set Int
controlKeyCodes =
Set.fromList [ 91, 92, 93, 224 ]


controlKey : Int -> Bool
controlKey code =
controlKeyCodes
|> Set.member code


shiftKeyCodes : Set Int
shiftKeyCodes =
Set.singleton 16


shiftKey : Int -> Bool
shiftKey code =
shiftKeyCodes
|> Set.member code


type Msg
= ControlDown
| ControlUp
Expand All @@ -22,18 +45,18 @@ subscriptions =
Sub.batch
[ Keyboard.downs
(\code ->
if code == 91 || code == 93 then
if controlKey code then
ControlDown
else if code == 16 then
else if shiftKey code then
ShiftDown
else
NoOp
)
, Keyboard.ups
(\code ->
if code == 91 || code == 93 then
if controlKey code then
ControlUp
else if code == 16 then
else if shiftKey code then
ShiftUp
else
NoOp
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@
"repository": "https://github.com/lukewestby/ellie.git",
"version": "1.0.0",
"license": "BSD-3-Clause",
"cacheDirectories": ["node_modules", "make/0.18.0/node_modules", "make/0.18.0/bower_components"],
"cacheDirectories": [
"node_modules",
"make/0.18.0/node_modules",
"make/0.18.0/bower_components"
],
"engines": {
"node": "6.9.5"
},
"dependencies": {
"autoprefixer": "7.1.4",
"babel-core": "6.25.0",
"babel-loader": "7.1.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-elm-pre-minify": "0.1.2",
"babel-plugin-syntax-dynamic-import": "6.18.0",
"babel-preset-env": "1.6.0",
"babel-preset-es2017": "6.24.1",
"codemirror": "5.27.4",
Expand All @@ -27,7 +32,7 @@
"json-loader": "0.5.4",
"nodemon": "1.12.1",
"npm-run-all": "4.1.1",
"opbeat-js": "^3.1.4",
"opbeat-js": "3.1.4",
"postcss-loader": "2.0.6",
"string-replace-webpack-plugin": "0.1.3",
"style-loader": "0.18.2",
Expand Down
10 changes: 5 additions & 5 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ module.exports = {
loader: 'babel-loader',
options: {
presets: ['es2017'],
plugins: ['syntax-dynamic-import']
}
}
plugins: ['syntax-dynamic-import'],
},
},
},
{
test: /\.css$/,
loader: 'style-loader!css-loader',
},
{ test: /\.json$/,
loader: 'json-loader'
loader: 'json-loader',
},
{
test: /\.elm$/,
Expand Down Expand Up @@ -95,7 +95,7 @@ module.exports = {
OPBEAT_ORGANIZATION_ID: JSON.stringify(process.env.OPBEAT_ORGANIZATION_ID),
'process.env.NODE_ENV': JSON.stringify('development')
}),
new StringReplacePlugin(),
new StringReplacePlugin()
],

devServer: {
Expand Down
34 changes: 19 additions & 15 deletions webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,23 @@ module.exports = {
{ pattern: /\%ENV\%/g, replacement: () => process.env.ENV },
]
}),
`elm-webpack-loader?yes&cwd=${path.join(__dirname, 'client')}`,
{
loader: 'babel-loader',
options: {
presets: [
[ 'env', { 'targets': { 'uglify': true } } ]
],
plugins: ['elm-pre-minify']
},
},
{
loader: 'elm-webpack-loader',
options: {
yes: true,
debug: false,
cwd: path.join(__dirname, 'client'),
}
}
]
},
]
Expand All @@ -95,20 +111,8 @@ module.exports = {
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
warnings: false,
dead_code: true,
pure_funcs: ['A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', '_elm_lang$core$Native_Utils.update', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9'],
passes: 2
},
mangle: {
screw_ie8: true
},
output: {
comments: false,
screw_ie8: true
}
compress: true,
mangle: true,
}),
new ManifestPlugin(),
new StringReplacePlugin(),
Expand Down

0 comments on commit e4d84f5

Please sign in to comment.