Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit cead62e

Browse files
authored
Merge pull request #95 from MathHubInfo/devel
Release version 16.0.0
2 parents 8abf2c9 + 24ecf37 commit cead62e

File tree

305 files changed

+8714
-9941
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+8714
-9941
lines changed

.babelrc

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{
2-
"presets": ["@babel/preset-env"],
3-
"plugins": [
4-
"syntax-dynamic-import",
5-
"@babel/plugin-proposal-object-rest-spread"
6-
],
7-
"env": {
8-
"production": {
9-
"presets": ["minify"]
10-
}
11-
}
2+
"presets": [
3+
"next/babel",
4+
"@zeit/next-typescript/babel"
5+
]
126
}

.dockerignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Please think carefully before adding a new item to Dockerignore
2+
## and sync this with .gitignore
3+
4+
# Distribution files
5+
dist/
6+
out/
7+
8+
# Generated static assets
9+
src/assets/generated
10+
11+
# Dependencies -- Yarn && NPM
12+
node_modules/
13+
.yarn-integrity
14+
.npm
15+
16+
# Build Cache
17+
.next
18+
19+
# Lots of log files
20+
logs
21+
*.log
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*
25+
26+
# Runtime Data Files
27+
pids
28+
*.pid
29+
*.seed
30+
*.pid.lock
31+
.eslintcache
32+
33+
# And in case somewant wants to debug by hand
34+
.node_repl_history

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33

44
# Distribution files
55
dist/
6-
lib/
6+
out/
7+
8+
# Generated static assets
9+
src/assets/generated
710

811
# Dependencies -- Yarn && NPM
912
node_modules/
1013
.yarn-integrity
1114
.npm
1215

1316
# Build Cache
14-
.awcache
17+
.next
1518

1619
# Lots of log files
1720
logs

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ node_js:
55
- 9
66
- 8
77
install: yarn
8-
env:
9-
- WEBPACK_CONFIG="webpack.config.js"
10-
- WEBPACK_CONFIG="webpack.config.prod.js"
118
script:
9+
- yarn tsc
1210
- yarn lint
13-
- yarn webpack --config=$WEBPACK_CONFIG
11+
- yarn dist

Dockerfile

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,60 @@
1-
# We need a node image with yarn
2-
FROM node as builder
1+
### Dockerfile for MathHub-Frontend
2+
3+
# Start from nodejs
4+
FROM node
5+
6+
# We have a lot of configurations that can be made
7+
# at compile time, but will be needed at runtime
8+
9+
ARG MATHHUB_THEME="classic"
10+
ENV MATHHUB_THEME=${MATHHUB_THEME}
311

4-
# The URL to MMT to use in the build
512
ARG MMT_URL="/:mathhub/"
613
ENV MMT_URL=${MMT_URL}
714

8-
ARG BROWSER_ROUTER="/"
9-
ENV BROWSER_ROUTER=${BROWSER_ROUTER}
10-
1115
ARG NEWS_URL="/news.json"
1216
ENV NEWS_URL=${NEWS_URL}
1317

1418
ARG GLOSSARY_URL=""
1519
ENV GLOSSARY_URL=${GLOSSARY_URL}
1620

17-
ARG RUNTIME_CONFIG_URL="/config.json"
18-
ENV RUNTIME_CONFIG_URL=${RUNTIME_CONFIG_URL}
21+
ARG TRANSLATION_URL=""
22+
ENV TRANSLATION_URL=${TRANSLATION_URL}
1923

2024
ARG UPSTREAM_BASE_URL="http://compositor:80/"
2125
ENV UPSTREAM_BASE_URL=${UPSTREAM_BASE_URL}
2226

23-
# Add all of the app into /app/
24-
ADD assets/ /app/assets/
25-
ADD build/ /app/build
26-
ADD src/ app/src/
27-
ADD .babelrc /app/
28-
ADD LICENSE.txt /app/
29-
ADD package.json /app/
30-
ADD tsconfig.json /app/
31-
ADD tsconfig.server.json /app/
32-
ADD webpack.config.js /app/
33-
ADD webpack.config.prod.js /app/
34-
ADD tslint.json /app/
35-
ADD yarn.lock /app/
36-
37-
38-
# Install and run build
39-
WORKDIR /app/
40-
RUN yarn && yarn dist && yarn sdist
27+
ARG RUNTIME_CONFIG_URL="/config.json"
28+
ENV RUNTIME_CONFIG_URL=${RUNTIME_CONFIG_URL}
29+
30+
31+
# We will place all our code into /app/
32+
WORKDIR /app/
33+
34+
# Add the dependency files first, then install them
35+
# This will take advantage of caching if the deps did not
36+
# change
37+
ADD package.json /app/package.json
38+
ADD yarn.lock /app/yarn.lock
39+
RUN yarn install
40+
41+
# Add all the remaining source code
42+
ADD config /app/config/
43+
ADD pages /app/pages/
44+
ADD src /app/src
45+
ADD static /app/static
46+
47+
ADD .babelrc /app/.babelrc
48+
ADD .gitignore /app/.gitignore
49+
ADD LICENSE.txt /app/LICENSE.txt
50+
ADD next.config.js next.config.js
51+
ADD README.md /app/README.md
52+
ADD tsconfig.json /app/tsconfig.json
53+
ADD tslint.json /app/tslint.json
54+
55+
# Generate a distribution
56+
RUN mkdir -p /app/src/assets/generated && yarn mklegal && yarn build
4157

4258
# and set up the server
4359
EXPOSE 8043
44-
CMD [ "yarn", "--silent", "server", "dist/", "8043", "0.0.0.0" ]
60+
CMD [ "yarn", "start", "--port", "8043", "--hostname", "0.0.0.0" ]

LICENSE.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found.
633633
Copyright (C) <year> <name of author>
634634

635635
This program is free software: you can redistribute it and/or modify
636-
it under the terms of the GNU Affero General Public License as published by
637-
the Free Software Foundation, either version 3 of the License, or
636+
it under the terms of the GNU Affero General Public License as published
637+
by the Free Software Foundation, either version 3 of the License, or
638638
(at your option) any later version.
639639

640640
This program is distributed in the hope that it will be useful,
@@ -658,4 +658,4 @@ specific requirements.
658658
You should also get your employer (if you work as a programmer) or school,
659659
if any, to sign a "copyright disclaimer" for the program, if necessary.
660660
For more information on this, and how to apply and follow the GNU AGPL, see
661-
<https://www.gnu.org/licenses/>.
661+
<https://www.gnu.org/licenses/>.

0 commit comments

Comments
 (0)