Skip to content

Commit cae0467

Browse files
authored
V5 - complete rewrite (#404)
* Delete everything * Copy everything
1 parent 1da8238 commit cae0467

File tree

193 files changed

+10478
-11165
lines changed

Some content is hidden

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

193 files changed

+10478
-11165
lines changed

.circleci/config.yml

-34
This file was deleted.

.dockerignore

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
Dockerfile
2-
README.md
31
.dockerignore
2+
tsconfig.tsbuildinfo
3+
coverage/
4+
dist/
45
node_modules/
5-
venv/
6-
.git/

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules/
2+
/dist/
3+
/coverage/

.eslintrc.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"project": "./tsconfig.json"
5+
},
6+
"plugins": ["@typescript-eslint", "react-hooks", "jsx-a11y", "jest"],
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:react/recommended",
10+
"plugin:react-hooks/recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
13+
"plugin:jest/recommended",
14+
"plugin:jsx-a11y/strict"
15+
],
16+
"settings": {
17+
"react": {
18+
"version": "detect"
19+
}
20+
},
21+
"rules": {
22+
"eqeqeq": ["error", "smart"],
23+
"complexity": ["error", 40],
24+
"no-magic-numbers": ["error", { "ignore": [-1, 0, 1, 2, 3, 4, 10, 100, 200, 1000] }],
25+
"sort-imports": [
26+
"error",
27+
{
28+
"allowSeparatedGroups": true
29+
}
30+
],
31+
"spaced-comment": "error",
32+
"react/jsx-sort-props": "error",
33+
"react/self-closing-comp": "error",
34+
"jsx-a11y/no-autofocus": "off"
35+
},
36+
"overrides": [
37+
{
38+
"files": ["*.test.ts", "*.test.tsx"],
39+
"rules": {
40+
"no-magic-numbers": "off"
41+
}
42+
}
43+
]
44+
}

.flowconfig

-8
This file was deleted.

.github/workflows/build.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
build:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- name: Checkout repo
10+
uses: actions/checkout@v2
11+
12+
- name: Setup Node
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: '14.7.0'
16+
- name: Install dependencies
17+
uses: bahmutov/npm-install@v1
18+
19+
- name: Build
20+
run: yarn build --prod
21+
- name: Upload build
22+
uses: actions/upload-artifact@v2
23+
with:
24+
name: dist
25+
path: dist/

.github/workflows/check.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Check
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- name: Checkout repo
10+
uses: actions/checkout@v2
11+
12+
- name: Setup Node
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: '14.7.0'
16+
- name: Install dependencies
17+
uses: bahmutov/npm-install@v1
18+
19+
- name: Typecheck
20+
run: yarn tsc
21+
- name: Lint scripts
22+
run: yarn eslint
23+
- name: Lint styles
24+
run: yarn stylelint
25+
- name: Prettier
26+
run: yarn prettier
27+
test:
28+
runs-on: ubuntu-20.04
29+
steps:
30+
- name: Checkout repo
31+
uses: actions/checkout@v2
32+
33+
- name: Setup Node
34+
uses: actions/setup-node@v1
35+
with:
36+
node-version: '14.7.0'
37+
- name: Install dependencies
38+
uses: bahmutov/npm-install@v1
39+
40+
- name: Collect test coverage
41+
run: yarn coverage
42+
- name: Upload coverage
43+
uses: coverallsapp/github-action@master
44+
with:
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
46+
path-to-lcov: ./coverage/lcov.info
47+
48+
- name: Check strings
49+
run: make -C src/strings test

.gitignore

+6-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
1-
# Python
2-
__pycache__/
3-
venv/
4-
5-
# Node
6-
npm-debug.log*
7-
yarn-debug.log*
8-
yarn-error.log*
9-
node_modules/
10-
11-
# Build
12-
build/
13-
config.conf
14-
assets/js/config.js
15-
16-
# System
17-
.DS_Store
18-
.Spotlight-V100
19-
.Trashes
20-
Thumbs.db
21-
ehthumbs.db
1+
/node_modules/
2+
/yarn-error.log
3+
/meta.json
4+
/tsconfig.tsbuildinfo
5+
/coverage/
6+
/dist/

.hound.yml

-12
This file was deleted.

.htmlhintrc.json

-17
This file was deleted.

.node-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14.7.0

.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/dist/
2+
/coverage/
3+
/node_modules/
4+
/src/strings/
5+
/src/bootstrap.css
6+
/meta.json

.prettierrc.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
printWidth = 120
2+
singleQuote = true
3+
trailingComma = 'all'

.stylelintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/bootstrap.css
2+
src/**/*.tsx

.stylelintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["stylelint-config-standard", "stylelint-config-prettier"]
3+
}

Dockerfile

+9-20
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
FROM debian:jessie-slim
1+
FROM node:14-buster-slim
22
LABEL maintainer [email protected]
3-
ENV LANG C.UTF-8
43
WORKDIR /root
54

6-
# Install packaged dependencies
5+
RUN apt-get -qq update && \
6+
apt-get -qq install --no-install-recommends git
77

8-
RUN apt-get -qq update && apt-get -qq install \
9-
curl \
10-
git \
11-
inotify-tools \
12-
make \
13-
python3 \
14-
python3-pip \
15-
socat
8+
COPY package.json .
9+
COPY yarn.lock .
10+
RUN yarn install --dev
1611

17-
# Install some (optional) dependencies
18-
COPY requirements-prod.txt .
19-
RUN pip3 install -U -r requirements-prod.txt
12+
COPY . .
2013

21-
# Setup Html-tools
22-
23-
CMD (nohup socat TCP4-LISTEN:$APY_PORT,fork TCP4:apy:$APY_PORT &) && \
24-
(while ! curl --output /dev/null --silent --fail http://apy:$APY_PORT/listPairs; do sleep 1 && echo -n .; done;) && \
25-
cd apertium-html-tools && make -j32 -B && \
26-
while true; do inotifywait . -r -e MODIFY && make -j32; done;
14+
ENTRYPOINT ["yarn"]
15+
CMD ["build", "--prod"]

0 commit comments

Comments
 (0)