Skip to content

Commit fe93dca

Browse files
committed
refactor: build website into web/build
1 parent 0514271 commit fe93dca

21 files changed

+53
-110
lines changed

Diff for: .gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ coverage.txt
2727

2828
# Packd
2929
/packrd
30-
*-packr.go
30+
*-packr.go
31+
32+
# Web
33+
/web/build

Diff for: Gopkg.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Makefile

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@ TAG := $(shell git tag -l --points-at @)
33
setup:
44
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
55
go get -u golang.org/x/tools/cmd/cover
6+
go get -u github.com/gobuffalo/packr/v2/packr2
67
npm install
78
dep ensure
89

910
build:
1011
npm run build
1112

12-
test:
13+
clean:
14+
rm -rf web/build
15+
rm -rf docs/public
16+
rm -rf dist
17+
packr2 clean
18+
19+
mest:
1320
go test -race -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic ./...
1421

1522
release:
@@ -32,4 +39,4 @@ docs:
3239

3340
ci: build test codecov release
3441

35-
.PHONY: test docs
42+
.PHONY: test docs clean

Diff for: app/app.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/tympanix/supper/types"
1818
)
1919

20-
const webRoot = "../web"
20+
const webRoot = "../web/build"
2121

2222
var filetypes = []string{
2323
".avi", ".mkv", ".mp4", ".m4v", ".flv", ".mov", ".wmv", ".webm", ".mpg", ".mpeg",

Diff for: package.json

+18-16
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,34 @@
2020
"devDependencies": {
2121
"axios": "^0.18.0",
2222
"babel-core": "^6.26.3",
23-
"babel-loader": "^7.1.4",
23+
"babel-loader": "^7.1.5",
2424
"babel-plugin-transform-class-properties": "^6.24.1",
2525
"babel-preset-env": "^1.7.0",
2626
"babel-preset-react": "^6.24.1",
2727
"css-loader": "^0.28.11",
28+
"favicons-webpack-plugin": "0.0.9",
2829
"file-loader": "^1.1.11",
29-
"flag-icon-css": "^3.0.0",
30+
"flag-icon-css": "^3.3.0",
31+
"html-webpack-plugin": "^3.2.0",
3032
"install": "^0.10.4",
31-
"mini-css-extract-plugin": "^0.4.0",
33+
"mini-css-extract-plugin": "^0.4.5",
3234
"miqu": "^0.1.0",
33-
"node-sass": "^4.9.0",
35+
"node-sass": "^4.11.0",
3436
"npm": "^5.10.0",
35-
"react": "^16.4.0",
36-
"react-dom": "^16.4.0",
37-
"react-router": "^4.3.1",
38-
"react-router-dom": "^4.3.1",
39-
"react-router-scroll-memory": "^1.0.1",
40-
"react-tabs": "^2.2.2",
41-
"react-transition-group": "^2.3.1",
37+
"react": "^16.8.4",
38+
"react-dom": "^16.8.4",
39+
"react-router": "^4.4.0",
40+
"react-router-dom": "^4.4.0",
41+
"react-router-scroll-memory": "^1.0.4",
42+
"react-tabs": "^2.3.0",
43+
"react-transition-group": "^2.6.1",
4244
"sass-loader": "^6.0.7",
4345
"style-loader": "^0.21.0",
4446
"svg-url-loader": "^2.3.2",
45-
"uglifyjs-webpack-plugin": "^1.2.5",
46-
"webpack": "^4.12.0",
47-
"webpack-cli": "^3.0.3",
48-
"webpack-dev-server": "^3.1.4",
49-
"webpack-merge": "^4.1.2"
47+
"uglifyjs-webpack-plugin": "^1.3.0",
48+
"webpack": "^4.29.6",
49+
"webpack-cli": "^3.3.0",
50+
"webpack-dev-server": "^3.2.1",
51+
"webpack-merge": "^4.2.1"
5052
}
5153
}

Diff for: web/android-chrome-192x192.png

-16 KB
Binary file not shown.

Diff for: web/android-chrome-256x256.png

-23.3 KB
Binary file not shown.

Diff for: web/apple-touch-icon.png

-10.6 KB
Binary file not shown.

Diff for: web/browserconfig.xml

-11
This file was deleted.

Diff for: web/favicon-16x16.png

-1.44 KB
Binary file not shown.

Diff for: web/favicon-32x32.png

-2.13 KB
Binary file not shown.

Diff for: web/favicon.ico

-14.7 KB
Binary file not shown.
File renamed without changes.

Diff for: web/index.html

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
<html>
22
<head>
3-
<title>Supper - Subtitle Download Manager</title>
3+
<title>Supper - A blazingly fast multimedia manager</title>
44
<meta name="viewport" content="width=device-width">
55
<link href="https://fonts.googleapis.com/css?family=Work+Sans" rel="stylesheet">
6-
<link rel="stylesheet" href="./static/styles.css">
7-
8-
<link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png">
9-
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png">
10-
<link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png">
11-
<link rel="manifest" href="./manifest.json">
12-
<link rel="mask-icon" href="./safari-pinned-tab.svg" color="#5bbad5">
13-
<meta name="apple-mobile-web-app-title" content="Supper">
14-
<meta name="application-name" content="Supper">
15-
<meta name="theme-color" content="#3498db">
166
</head>
177
<body>
188
<main class="main" id="root"></main>
19-
<script src="./static/bundle.js"></script>
209
</body>
2110
</html>

Diff for: web/manifest.json

-18
This file was deleted.

Diff for: web/mstile-150x150.png

-11.3 KB
Binary file not shown.

Diff for: web/mstile-310x150.png

-12.2 KB
Binary file not shown.

Diff for: web/mstile-310x310.png

-25.5 KB
Binary file not shown.

Diff for: web/safari-pinned-tab.svg

-39
This file was deleted.

Diff for: web/webpack/webpack.common.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
const path = require('path');
22
const webpack = require('webpack');
33
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
4+
const HtmlWebpackPlugin = require('html-webpack-plugin');
45

56
var devMode = process.env.NODE_ENV === "development"
67

78
module.exports = {
89
entry: path.join(__dirname, '../js/index.js'),
910
output: {
10-
path: path.join(__dirname, '../static'),
11-
publicPath: "/static/",
11+
path: path.join(__dirname, '../build'),
1212
filename: 'bundle.js'
1313
},
1414
plugins: [
1515
new MiniCssExtractPlugin({
1616
filename: "styles.css",
1717
}),
18+
new HtmlWebpackPlugin({
19+
filename: 'index.html',
20+
template: path.resolve(__dirname, '../index.html')
21+
}),
1822
],
1923
module: {
2024
rules: [

Diff for: web/webpack/webpack.prod.js

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
const { DefinePlugin } = require('webpack');
2-
const merge = require('webpack-merge');
3-
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
4-
const common = require('./webpack.common.js');
1+
const { DefinePlugin } = require("webpack");
2+
const path = require("path");
3+
const merge = require("webpack-merge");
4+
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
5+
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
6+
const common = require("./webpack.common.js");
57

68
module.exports = merge(common, {
7-
mode: 'production',
8-
devtool: 'source-map',
9+
mode: "production",
10+
devtool: "source-map",
911
plugins: [
1012
new UglifyJSPlugin({
1113
sourceMap: true
1214
}),
1315
new DefinePlugin({
14-
'process.env.NODE_ENV': JSON.stringify('production')
16+
"process.env.NODE_ENV": JSON.stringify("production")
17+
}),
18+
new FaviconsWebpackPlugin({
19+
logo: path.join(__dirname, "../favicon.png"),
20+
prefix: "favicon/",
21+
title: "Supper"
1522
})
1623
]
1724
});

0 commit comments

Comments
 (0)