-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rdrf #602 copied Tamas' changes into RDRF mutatis mutandum
- Loading branch information
Showing
18 changed files
with
5,834 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,5 +38,6 @@ startup | |
*.po | ||
*.mo | ||
.ropeproject | ||
yarn_cache/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Container used to build bpaotu | ||
FROM node:9.11.1 | ||
MAINTAINER https://github.com/muccg/bpaotu | ||
|
||
RUN env | sort | ||
|
||
COPY docker-entrypoint-node.sh /app/docker-entrypoint-node.sh | ||
|
||
VOLUME ["/data"] | ||
|
||
ENV HOME /data | ||
WORKDIR /data | ||
|
||
ENTRYPOINT ["/app/docker-entrypoint-node.sh"] | ||
CMD ["build"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
info () { | ||
printf "\r [\033[00;34mINFO\033[0m] %s\n" "$1" | ||
} | ||
|
||
trap exit SIGHUP SIGINT SIGTERM | ||
env | grep -iv PASS | sort | ||
|
||
if [ "$1" = 'build' ]; then | ||
info "[Run] Building frontend JS bundle" | ||
info "BUILD_VERSION ${BUILD_VERSION}" | ||
info "PROJECT_SOURCE ${PROJECT_SOURCE}" | ||
|
||
set -x | ||
yarn install --frozen-lockfile | ||
npm run build | ||
|
||
exit 0 | ||
fi | ||
|
||
if [ "$1" = 'watch' ]; then | ||
info "[Run] Watch source and recompile on change" | ||
|
||
yarn install | ||
npm run watch | ||
|
||
exit 0 | ||
fi | ||
|
||
info "[RUN]: Builtin command not provided [build|watch]" | ||
info "[RUN]: $*" | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "rdrf", | ||
"version": "1.0.0", | ||
"description": "Frontend code for RDRF", | ||
"main": "main.js", | ||
"scripts": { | ||
"build": "webpack --config webpack.prod.js --mode production", | ||
"watch": "webpack --config webpack.dev.js --mode development --watch" | ||
}, | ||
"sideEffects": false, | ||
"repository": "https://github.com/muccg/rdrf", | ||
"author": "Centre of Comparitive Genomics", | ||
"license": "AGPL-3.0", | ||
"private": false, | ||
"devDependencies": { | ||
"@types/datatables.net": "^1.10.9", | ||
"@types/jquery": "^3.3.1", | ||
"@types/lodash": "^4.14.108", | ||
"bootstrap": "3", | ||
"css-loader": "^0.28.11", | ||
"datatables.net": "^1.10.16", | ||
"datatables.net-bs": "^1.10.16", | ||
"file-loader": "^1.1.11", | ||
"jquery": "^3.3.1", | ||
"lodash": "^4.17.10", | ||
"popper.js": "^1.14.3", | ||
"spin.js": "^4.0.0", | ||
"style-loader": "^0.21.0", | ||
"ts-loader": "^4.3.0", | ||
"typescript": "^2.8.3", | ||
"uglifyjs-webpack-plugin": "^1.2.5", | ||
"url-loader": "^1.0.1", | ||
"webpack": "^4.8.1", | ||
"webpack-bundle-analyzer": "^2.13.0", | ||
"webpack-cli": "^2.1.3", | ||
"webpack-merge": "^4.1.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'bootstrap'; | ||
import 'bootstrap/dist/css/bootstrap.min.css'; | ||
import * as search from './search'; | ||
|
||
|
||
declare global { | ||
interface Window { | ||
otu_search_config: search.SearchConfig | ||
} | ||
}; | ||
|
||
// TODO revise if we should switch to multiple entry points instead. | ||
// ie. one entrypoint for each page | ||
export { init as init_tables } from './tables'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
export function info(msg: string) { | ||
console.log(msg); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"sourceMap": true, | ||
"noImplicitAny": true, | ||
"target": "es5", | ||
"lib": ["es2015", "es2017", "dom"], | ||
"jsx": "preserve", | ||
"allowJs": true, | ||
}, | ||
"files": [ | ||
"src/index.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
|
||
module.exports = { | ||
entry: './src/index.ts', | ||
plugins: [ | ||
new webpack.ProvidePlugin({ | ||
$: 'jquery', | ||
jQuery: 'jquery' | ||
}) | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, | ||
loader: 'ts-loader', | ||
options: { | ||
configFile: path.resolve(__dirname, 'tsconfig.js') | ||
} | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: ['style-loader', 'css-loader'] | ||
}, | ||
{ | ||
test: /\.(png|woff|woff2|eot|ttf|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: 'url-loader' | ||
} | ||
] | ||
}, | ||
resolve: { | ||
extensions: [ '.tsx', '.ts', '.js' ] | ||
}, | ||
output: { | ||
filename: '[name]-bundle.js', | ||
path: path.resolve(__dirname, '../static/js'), | ||
library: 'otu', | ||
libraryTarget: 'var' | ||
}, | ||
optimization: { | ||
runtimeChunk: 'single', | ||
splitChunks: { | ||
chunks: 'all', | ||
cacheGroups: { | ||
default: { | ||
enforce: true, | ||
priority: 1 | ||
}, | ||
vendors: { | ||
test: /[\\/]node_modules[\\/]/, | ||
priority: 2, | ||
name: 'vendors', | ||
enforce: true, | ||
chunks: 'all' | ||
} | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const merge = require('webpack-merge'); | ||
const common = require('./webpack.common.js'); | ||
|
||
module.exports = merge(common, { | ||
devtool: 'inline-source-map' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const webpack = require('webpack'); | ||
const merge = require('webpack-merge'); | ||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | ||
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | ||
|
||
const common = require('./webpack.common.js'); | ||
|
||
module.exports = merge(common, { | ||
output: { | ||
filename: '[name]-bundle.min.js' | ||
}, | ||
plugins: [ | ||
/* | ||
new BundleAnalyzerPlugin({ | ||
analyzerMode: 'static' | ||
}), | ||
*/ | ||
new UglifyJSPlugin({ | ||
sourceMap: true | ||
}), | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify('production') | ||
}) | ||
] | ||
}); |
Oops, something went wrong.