Merge pull request #180 from jndrm/typescript

Add .editorconfig file & upgrade webpack
This commit is contained in:
chrisgarrity 2018-09-26 11:28:25 -04:00 committed by GitHub
commit 6d022384de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 42 additions and 12 deletions

12
.editorconfig Normal file
View file

@ -0,0 +1,12 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

View file

@ -4,7 +4,9 @@
"description": "ScratchJr",
"scripts": {
"lint": "eslint src/**",
"build": "webpack"
"watch": "webpack --mode=development --progress --hide-modules --watch",
"dev": "webpack --mode=development --progress --hide-modules",
"build": "webpack --mode=production --progress --hide-modules"
},
"author": "Massachusetts Institute of Technology",
"license": "BSD-3-Clause",
@ -15,7 +17,7 @@
"devDependencies": {
"babel-core": "^6.4.0",
"babel-eslint": "^4.1.6",
"babel-loader": "^6.2.1",
"babel-loader": "^7.1.4",
"babel-preset-es2015": "^6.3.13",
"esformatter": "^0.8.1",
"esformatter-braces": "^1.2.1",
@ -25,7 +27,9 @@
"eslint": "^1.10.3",
"expose-loader": "^0.7.1",
"strip-sourcemap-loader": "0.0.1",
"webpack": "^1.12.11"
"webpack": "^4.18.0",
"webpack-cli": "^3.1.0",
"webpack-notifier": "^1.6.0"
},
"dependencies": {
"intl": "^1.0.1",

View file

@ -379,7 +379,7 @@ export default class ScratchJr {
}
}
static saveAndFlip (e){
static saveAndFlip (e) {
onHold = true;
ScratchJr.stopStripsFromTop(e);
ScratchJr.unfocus(e);

View file

@ -471,7 +471,7 @@ export default class Scripts {
getEncodableBlocks () {
var list = [];
var sc = this.sc;
for (var i =0; i < sc.childElementCount; i++){
for (var i = 0; i < sc.childElementCount; i++) {
var b = sc.childNodes[i].owner;
if (!b || b.type != 'block') {
continue;

View file

@ -20,7 +20,7 @@ export function gettingStartedMain () {
var urlvars = getUrlVars();
place = urlvars['place'];
document.ontouchmove = function (e){
document.ontouchmove = function (e) {
e.preventDefault();
};
}

View file

@ -19,7 +19,7 @@ require('intl/locale-data/jsonp/sv.js');
require('intl/locale-data/jsonp/th.js');
require('intl/locale-data/jsonp/zh.js');
require('expose?IntlMessageFormat!intl-messageformat');
require('expose-loader?IntlMessageFormat!intl-messageformat');
require('intl-messageformat/dist/locale-data/ca');
require('intl-messageformat/dist/locale-data/de');
require('intl-messageformat/dist/locale-data/en');
@ -94,7 +94,7 @@ export default class Localization {
// ensure it's lower case to match filename
topLevel = currentLocale.toLowerCase();
}
// Get messages
IO.requestFromServer(localizationRoot + 'localizations/' + topLevel + '.json', (result) => {
localizationMessages = JSON.parse(result);

View file

@ -66,7 +66,7 @@ export function preprocessAndLoadCss (baseUrl, url) {
const head = document.head;
let style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
if (style.styleSheet) {
style.styleSheet.cssText = cssData;
} else {
style.appendChild(document.createTextNode(cssData));

View file

@ -1,14 +1,22 @@
var WebpackNotifierPlugin = require('webpack-notifier');
module.exports = {
devtool: 'source-map',
entry: {
app: './src/entry/app.js'
},
output: {
path: './src/build/bundles',
path: __dirname + '/src/build/bundles',
filename: '[name].bundle.js'
},
performance: {
hints: false
},
watchOptions: {
ignored: ["node_modules", "src/build/**/*"]
},
module: {
loaders: [
rules: [
{
test: /\.js$/,
include: /node_modules/,
@ -23,5 +31,11 @@ module.exports = {
}
}
]
}
},
plugins: [
new WebpackNotifierPlugin({
title: "ScratchJr",
alwaysNotify: true
})
]
};