merge magic-dev into master #1

Merged
icedream merged 11 commits from master into magic-dev 2017-08-19 21:25:11 +00:00
8 changed files with 203 additions and 22 deletions

View File

@ -1,11 +1,35 @@
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# Deployed apps should consider commenting this line out:
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules
# Webpack output
/dist
### ###
.git*
Dockerfile Dockerfile
.dockerignore
docker-compose.yml docker-compose.yml
.git*
*.md *.md

28
.eslintignore Normal file
View File

@ -0,0 +1,28 @@
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# Deployed apps should consider commenting this line out:
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules
# Webpack output
/dist

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM icedream/caddy
COPY . /src/
RUN \
(cd /src \
&& apk add --no-cache --virtual .build-deps \
nodejs-lts \
&& npm i \
&& NODE_ENV=production npm run build \
&& rm -rf /data \
&& mv dist /data \
&& apk del --no-cache .build-deps \
) \
&& rm -rf /src /tmp/* /var/tmp/*
WORKDIR /data
EXPOSE 2015

View File

@ -12,6 +12,10 @@ module.exports = {
}, },
webpack: { webpack: {
aliases: {
'moment-timezone': 'moment-timezone/builds/moment-timezone-with-data-2012-2022.js',
},
autoprefixer: '> 1%, last 2 versions, Firefox ESR, ios >= 8', autoprefixer: '> 1%, last 2 versions, Firefox ESR, ios >= 8',
extra: { extra: {
@ -35,3 +39,13 @@ module.exports = {
}, },
}, },
}; };
// @HACK - workaround for https://github.com/webpack/webpack/issues/1866
function batchresolve(arr) {
return arr.map(require.resolve);
}
module.exports.babel.presets = batchresolve(module.exports.babel.presets);
module.exports.babel.plugins = batchresolve(module.exports.babel.plugins);

109
package-lock.json generated
View File

@ -3454,14 +3454,14 @@
} }
}, },
"eslint": { "eslint": {
"version": "4.4.1", "version": "4.5.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-4.4.1.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.5.0.tgz",
"integrity": "sha1-mc1+r8/8ov+Zpcj18qR01jZLS9M=", "integrity": "sha1-u3XTuL3pf7XhPvzVOXRGd/6wGcM=",
"dev": true, "dev": true,
"requires": { "requires": {
"ajv": "5.2.2", "ajv": "5.2.2",
"babel-code-frame": "6.26.0", "babel-code-frame": "6.26.0",
"chalk": "1.1.3", "chalk": "2.1.0",
"concat-stream": "1.6.0", "concat-stream": "1.6.0",
"cross-spawn": "5.1.0", "cross-spawn": "5.1.0",
"debug": "2.6.8", "debug": "2.6.8",
@ -3492,9 +3492,56 @@
"progress": "2.0.0", "progress": "2.0.0",
"require-uncached": "1.0.3", "require-uncached": "1.0.3",
"semver": "5.4.1", "semver": "5.4.1",
"strip-ansi": "4.0.0",
"strip-json-comments": "2.0.1", "strip-json-comments": "2.0.1",
"table": "4.0.1", "table": "4.0.1",
"text-table": "0.2.0" "text-table": "0.2.0"
},
"dependencies": {
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
},
"ansi-styles": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
"integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
"dev": true,
"requires": {
"color-convert": "1.9.0"
}
},
"chalk": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
"integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
"dev": true,
"requires": {
"ansi-styles": "3.2.0",
"escape-string-regexp": "1.0.5",
"supports-color": "4.2.1"
}
},
"strip-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
"dev": true,
"requires": {
"ansi-regex": "3.0.0"
}
},
"supports-color": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz",
"integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==",
"dev": true,
"requires": {
"has-flag": "2.0.0"
}
}
} }
}, },
"eslint-config-airbnb": { "eslint-config-airbnb": {
@ -3581,9 +3628,9 @@
} }
}, },
"eslint-plugin-jsx-a11y": { "eslint-plugin-jsx-a11y": {
"version": "6.0.2", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.0.2.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.1.1.tgz",
"integrity": "sha1-ZZJ3p1iwNsMFp+ShMFfDAc075z8=", "integrity": "sha512-5I9SpoP7gT4wBFOtXT8/tXNPYohHBVfyVfO17vkbC7r9kEIxYJF12D3pKqhk8+xnk12rfxKClS3WCFpVckFTPQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"aria-query": "0.7.0", "aria-query": "0.7.0",
@ -4933,6 +4980,14 @@
"integrity": "sha1-QyNS5XrM2HqzEQ6C0/6g5HgSFW0=", "integrity": "sha1-QyNS5XrM2HqzEQ6C0/6g5HgSFW0=",
"dev": true "dev": true
}, },
"immutability-helper": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/immutability-helper/-/immutability-helper-2.3.1.tgz",
"integrity": "sha1-jM/OkhVyCMEgsq+tftBcERFMCG4=",
"requires": {
"invariant": "2.2.2"
}
},
"imurmurhash": { "imurmurhash": {
"version": "0.1.4", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
@ -8705,6 +8760,36 @@
} }
} }
}, },
"preact": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/preact/-/preact-8.2.1.tgz",
"integrity": "sha1-Z0JD3wyEeITQGYNARKovzTEecu0="
},
"preact-compat": {
"version": "3.17.0",
"resolved": "https://registry.npmjs.org/preact-compat/-/preact-compat-3.17.0.tgz",
"integrity": "sha1-Uoz9/DARkMGg9HVnM2vh9L4CZrM=",
"requires": {
"immutability-helper": "2.3.1",
"preact-render-to-string": "3.6.3",
"preact-transition-group": "1.1.1",
"prop-types": "15.5.10",
"standalone-react-addons-pure-render-mixin": "0.1.1"
}
},
"preact-render-to-string": {
"version": "3.6.3",
"resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-3.6.3.tgz",
"integrity": "sha1-SB0NW9rJGS0zR1V0N9XNAKoxIEM=",
"requires": {
"pretty-format": "3.8.0"
}
},
"preact-transition-group": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/preact-transition-group/-/preact-transition-group-1.1.1.tgz",
"integrity": "sha1-8KSTJ+pRXs406ivoZMSn0p5dbhA="
},
"prelude-ls": { "prelude-ls": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
@ -8733,6 +8818,11 @@
"utila": "0.4.0" "utila": "0.4.0"
} }
}, },
"pretty-format": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz",
"integrity": "sha1-v77VbV6ad2ZF9LH/eqGjrE+jw4U="
},
"private": { "private": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz",
@ -10225,6 +10315,11 @@
"integrity": "sha1-M6qE8Rd6VUjIk1Uzy/6zQgl19aQ=", "integrity": "sha1-M6qE8Rd6VUjIk1Uzy/6zQgl19aQ=",
"dev": true "dev": true
}, },
"standalone-react-addons-pure-render-mixin": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/standalone-react-addons-pure-render-mixin/-/standalone-react-addons-pure-render-mixin-0.1.1.tgz",
"integrity": "sha1-PHQJ9MecQN6axyxhbPZ5qZTzdVE="
},
"statuses": { "statuses": {
"version": "1.3.1", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz",

View File

@ -5,7 +5,7 @@
"private": true, "private": true,
"main": "src/index.jsx", "main": "src/index.jsx",
"scripts": { "scripts": {
"build": "nwb build-react-app ./src", "build": "nwb build-react-app ./src --preact",
"clean": "nwb clean-app", "clean": "nwb clean-app",
"start": "nwb serve-react-app ./src", "start": "nwb serve-react-app ./src",
"test": "nwb test-react", "test": "nwb test-react",
@ -30,12 +30,12 @@
"babel-eslint": "^7.2.3", "babel-eslint": "^7.2.3",
"babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.6.0", "babel-preset-env": "^1.6.0",
"eslint": "^4.4.1", "eslint": "^4.5.0",
"eslint-config-airbnb": "^15.1.0", "eslint-config-airbnb": "^15.1.0",
"eslint-plugin-babel": "^4.1.2", "eslint-plugin-babel": "^4.1.2",
"eslint-plugin-import": "^2.7.0", "eslint-plugin-import": "^2.7.0",
"eslint-plugin-json": "^1.2.0", "eslint-plugin-json": "^1.2.0",
"eslint-plugin-jsx-a11y": "^6.0.2", "eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.2.1", "eslint-plugin-react": "^7.2.1",
"file-loader": "^0.11.2", "file-loader": "^0.11.2",
"nwb": "^0.18.10", "nwb": "^0.18.10",
@ -45,6 +45,8 @@
"dependencies": { "dependencies": {
"moment-timezone": "^0.5.13", "moment-timezone": "^0.5.13",
"normalize-scss": "^7.0.0", "normalize-scss": "^7.0.0",
"preact": "^8.2.1",
"preact-compat": "^3.17.0",
"prop-types": "^15.5.10", "prop-types": "^15.5.10",
"react": "^15.6.1", "react": "^15.6.1",
"react-dom": "^15.6.1", "react-dom": "^15.6.1",

View File

@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import moment from 'moment-timezone'; import moment from 'moment-timezone';
import Countdown from './Countdown'; import Countdown from './Countdown';
import Header from './Header'; import Header from './Header';
import ProgressCircle from './ProgressCircle';
import getUpcomingDate from './getUpcomingDate'; import getUpcomingDate from './getUpcomingDate';
import FontAwesome from 'react-fontawesome'; import FontAwesome from 'react-fontawesome';
import WebFont from 'webfontloader'; import WebFont from 'webfontloader';
@ -60,6 +59,9 @@ class App extends React.Component {
} }
const { nextUpcomingDate } = this.state; const { nextUpcomingDate } = this.state;
if (!nextUpcomingDate) {
return null;
}
return ( return (
<div className={style.app}> <div className={style.app}>
@ -68,7 +70,6 @@ class App extends React.Component {
</Header> </Header>
<div className={style.content}> <div className={style.content}>
<div className={style.contentContainer}>
<p> <p>
The next VIzon draw is on {nextUpcomingDate.format('dddd')}, {nextUpcomingDate.format('L LT z')}. The next VIzon draw is on {nextUpcomingDate.format('dddd')}, {nextUpcomingDate.format('L LT z')}.
</p> </p>
@ -78,7 +79,6 @@ class App extends React.Component {
Made by Icedream & MAGIC Made by Icedream & MAGIC
</div> </div>
</div> </div>
</div>
); );
} }
} }

View File

@ -7,4 +7,5 @@ import App from './App';
// Create div node to render app in // Create div node to render app in
const rootContainer = document.createElement('div'); const rootContainer = document.createElement('div');
document.body.appendChild(rootContainer); document.body.appendChild(rootContainer);
render(<App />, rootContainer); render(<App />, rootContainer);