Initial boilerplate setup
This commit is contained in:
1 parent
739aca9495
commit
8ee9e8a838
17 files changed
+29239
No files matched your search
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"presets": ["@babel/preset-env", "@babel/preset-react"],
|
||||
"plugins": ["@babel/plugin-proposal-class-properties"]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"settings": {
|
||||
"react": {
|
||||
"pragma": "React",
|
||||
"version": "16.0"
|
||||
}
|
||||
},
|
||||
"extends": ["standard", "standard-react"]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.prod
|
||||
|
||||
# Build folder js files
|
||||
build/
|
||||
dist/
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode
|
||||
|
||||
#Mac specific files
|
||||
.DS_Store
|
||||
@@ -0,0 +1,17 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Advanced Algos</title>
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Responsible for loading all web modules and running them">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<link href="https://fonts.googleapis.com/css?family=Saira+Condensed:300,600|Saira:300,600&subset=latin-ext,vietnamese" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+20579
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"name": "master-app-client",
|
||||
"version": "0.0.1",
|
||||
"description": "Responsible for loading all web modules and running them.",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"dev": "NODE_ENV=development webpack-serve --port 3100 --config ./webpack.config.js",
|
||||
"lint": "prettier-standard 'src/**/*.js'"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Algoteers/MasterApp.git"
|
||||
},
|
||||
"author": "Advanced Algos, ltd.",
|
||||
"license": "SEE LICENSE IN LICENSE.MD",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Algoteers/MasterApp/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Algoteers/MasterApp#readme",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.1.2",
|
||||
"@babel/plugin-proposal-class-properties": "^7.1.0",
|
||||
"@babel/preset-env": "^7.1.0",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"autoprefixer": "^9.1.5",
|
||||
"babel-loader": "^8.0.4",
|
||||
"connect-history-api-fallback": "^1.5.0",
|
||||
"css-loader": "^1.0.0",
|
||||
"dotenv-webpack": "^1.5.7",
|
||||
"eslint-config-standard": "^12.0.0",
|
||||
"eslint-config-standard-react": "^7.0.2",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-node": "^7.0.1",
|
||||
"eslint-plugin-prettier": "^3.0.0",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"file-loader": "^2.0.0",
|
||||
"html-webpack-harddisk-plugin": "^0.2.0",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"koa-connect": "^2.0.1",
|
||||
"node-sass": "^4.9.3",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"prettier": "^1.14.3",
|
||||
"prettier-standard": "^8.0.1",
|
||||
"sass-loader": "^7.1.0",
|
||||
"script-ext-html-webpack-plugin": "^2.0.1",
|
||||
"style-loader": "^0.23.1",
|
||||
"webpack": "^4.20.2",
|
||||
"webpack-build": "^1.0.1",
|
||||
"webpack-cli": "^3.1.2",
|
||||
"webpack-merge": "^4.1.4",
|
||||
"webpack-serve": "^2.0.2"
|
||||
},
|
||||
"standard": {
|
||||
"parser": "babel-eslint",
|
||||
"ignore": [
|
||||
"dist/",
|
||||
"build/"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@advancedalgos/key-vault-client": "0.0.5",
|
||||
"@advancedalgos/teams-client": "0.0.8",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"react": "^16.5.2",
|
||||
"react-dom": "^16.5.2",
|
||||
"react-router-dom": "^4.3.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require('autoprefixer')
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import React, { Component } from 'react'
|
||||
import { Route, BrowserRouter, Switch } from 'react-router-dom'
|
||||
|
||||
import App from '@advancedalgos/teams-client'
|
||||
import App2 from '@advancedalgos/key-vault-client'
|
||||
|
||||
export const Master = () => (
|
||||
<BrowserRouter>
|
||||
<Switch>
|
||||
<Route exact path='/' component={App} />
|
||||
<Route exact path='/key-vault' component={App2} />
|
||||
</Switch>
|
||||
</BrowserRouter>
|
||||
)
|
||||
|
||||
export const Temporary = () =>(
|
||||
<div>Hello Advanced Alogs!</div>
|
||||
)
|
||||
|
||||
export default Master
|
||||
@@ -0,0 +1,24 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
|
||||
import App from './App'
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'))
|
||||
|
||||
let frontendReloadCount = 0
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (module.hot) {
|
||||
module.hot.accept()
|
||||
|
||||
module.hot.accept('./index', () => {
|
||||
try {
|
||||
log.debug('Updating front-end')
|
||||
frontendReloadCount = (frontendReloadCount || 0) + 1
|
||||
} catch (err) {
|
||||
log(err.stack)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
const pathConfig = require('./webpack.path.config')
|
||||
|
||||
module.exports = {
|
||||
context: pathConfig.context,
|
||||
|
||||
entry: ['babel-polyfill', './src/index.js'],
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
|
||||
{
|
||||
test: /\.(png|svg|jpg|gif)$/,
|
||||
use: [{ loader: 'file-loader' }
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
const path = require('path')
|
||||
|
||||
const context = path.resolve(__dirname, '../../..')
|
||||
|
||||
module.exports = {
|
||||
context
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
const webpack = require('webpack')
|
||||
const Dotenv = require('dotenv-webpack')
|
||||
const path = require('path')
|
||||
const merge = require('webpack-merge')
|
||||
const history = require('connect-history-api-fallback')
|
||||
const convert = require('koa-connect')
|
||||
const commonConfig = require('./helpers/webpack.common.config')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin')
|
||||
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
|
||||
|
||||
module.exports = merge(commonConfig, {
|
||||
mode: 'development',
|
||||
devtool: 'inline-sourcemap',
|
||||
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../../build'),
|
||||
filename: 'script.js'
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new Dotenv({
|
||||
path: '.env'
|
||||
}),
|
||||
new webpack.NamedModulesPlugin(),
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'html/index.html',
|
||||
alwaysWriteToDisk: true
|
||||
}),
|
||||
new ScriptExtHtmlWebpackPlugin({
|
||||
defaultAttribute: 'async'
|
||||
}),
|
||||
new HtmlWebpackHarddiskPlugin()
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s?[ac]ss$/,
|
||||
loader: 'style-loader!css-loader!postcss-loader!sass-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
target: 'web'
|
||||
})
|
||||
|
||||
module.exports.serve = {
|
||||
hot: {
|
||||
port: 4536
|
||||
},
|
||||
host: 'localhost',
|
||||
add: (app, middleware, options) => {
|
||||
app.use(convert(history()))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
const webpack = require('webpack')
|
||||
const path = require('path')
|
||||
const merge = require('webpack-merge')
|
||||
const commonConfig = require('./helpers/webpack.common.config')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin')
|
||||
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
|
||||
const Dotenv = require('dotenv-webpack')
|
||||
|
||||
module.exports = merge(commonConfig, {
|
||||
mode: 'production',
|
||||
devtool: 'inline-sourcemap',
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../../build'),
|
||||
filename: 'script.js'
|
||||
},
|
||||
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new UglifyJsPlugin({
|
||||
cache: true,
|
||||
parallel: true,
|
||||
sourceMap: false
|
||||
}),
|
||||
new OptimizeCSSAssetsPlugin({})
|
||||
],
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
styles: {
|
||||
name: 'styles',
|
||||
test: /\.css$/,
|
||||
chunks: 'all',
|
||||
enforce: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new Dotenv(),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
chunkFilename: '[id].css'
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'html/index.html',
|
||||
alwaysWriteToDisk: true
|
||||
}),
|
||||
new ScriptExtHtmlWebpackPlugin({
|
||||
defaultAttribute: 'async'
|
||||
}),
|
||||
new HtmlWebpackHarddiskPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify('production')
|
||||
})
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{ loader: 'css-loader', options: { importLoaders: 2 } },
|
||||
'postcss-loader',
|
||||
{ loader: 'sass-loader' }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
target: 'web'
|
||||
})
|
||||
@@ -0,0 +1,9 @@
|
||||
let config = null
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
config = require('./tools/webpack/webpack.prod.config.js')
|
||||
} else {
|
||||
config = require('./tools/webpack/webpack.dev.config.js')
|
||||
}
|
||||
|
||||
module.exports = config
|
||||
Generated
+8281
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "master-app",
|
||||
"version": "0.0.1",
|
||||
"description": "Responsible for loading all web modules and running them.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Algoteers/MasterApp.git"
|
||||
},
|
||||
"author": "Advanced Algos, ltd.",
|
||||
"license": "SEE LICENSE IN LICENSE.MD",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Algoteers/MasterApp/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Algoteers/MasterApp#readme"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "master-app-server",
|
||||
"version": "0.0.1",
|
||||
"description": "Responsible for loading all web modules and running them.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Algoteers/MasterApp.git"
|
||||
},
|
||||
"author": "Advanced Algos, ltd.",
|
||||
"license": "SEE LICENSE IN LICENSE.MD",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Algoteers/MasterApp/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Algoteers/MasterApp#readme"
|
||||
}
|
||||
Reference in new issue
Block a user