Skip to content

Commit

Permalink
refactor: use gts instead of xo
Browse files Browse the repository at this point in the history
feat: add browser opening to test:notification
feat: add c8 and mocha for testing
feat: update Docker and ci
style: update editorconfig
  • Loading branch information
jef committed Jan 17, 2021
1 parent dbde781 commit f87053c
Show file tree
Hide file tree
Showing 184 changed files with 30,282 additions and 33,283 deletions.
5 changes: 0 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@ trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
indent_style = space
indent_size = 4

[*.ts]
indent_style = tab
indent_size = 4
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
docs/
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./node_modules/gts/"
}
13 changes: 7 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
jobs:
build-and-lint:
build-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -18,11 +18,12 @@ jobs:
restore-keys: ${{ runner.os }}-node-
- name: Add problem matcher
run: echo "::add-matcher::.github/xo-problem-matcher.json"
- name: Pull dependencies
run: |
npm ci
npm run build
npm run lint
- name: Install dependencies
run: npm ci
- name: Compile TypeScript
run: npm run compile
- name: Run linter
run: npm run lint
build-docker:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.vs/
.vscode/
build/
coverage/
node_modules/
src/config/*.yaml

.env
dotenv
Expand Down
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('gts/.prettierrc.json')
}
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14.15.0-alpine3.12 AS builder
FROM node:14.15.4-alpine3.12 AS builder

LABEL org.opencontainers.image.source="https://github.com/jef/streetmerchant"

Expand All @@ -12,20 +12,20 @@ COPY tsconfig.json tsconfig.json
RUN npm ci

COPY src/ src/
RUN npm run build
RUN npm run compile
RUN npm prune --production

FROM node:14.15.0-alpine3.12
FROM node:14.15.4-alpine3.12

RUN apk add --no-cache chromium

ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser \
DOCKER=true
DOCKER=true

RUN addgroup -S appuser && adduser -S -g appuser appuser \
&& mkdir -p /home/appuser/Downloads /app \
&& chown -R appuser:appuser /home/appuser \
&& chown -R appuser:appuser /app
&& mkdir -p /home/appuser/Downloads /app \
&& chown -R appuser:appuser /home/appuser \
&& chown -R appuser:appuser /app

USER appuser

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ To customize streetmerchant, make a copy of `dotenv-example` as `dotenv` and mak

The command `npm run start:dev` can be used instead of `npm run start` to automatically restart the project when filesystem changes are detected in the `src/` folder or `dotenv` file.

Use `npm run lint` to see any linting uses and `npm run lint:fix` to automatically fix the issues it can.
Use `npm run lint` to see any linting uses and `npm run fix` to automatically fix the issues it can.

### Developing in Docker

Expand Down
12 changes: 6 additions & 6 deletions docs/javascripts/tables.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
app.document$.subscribe(function() {
var tables = document.querySelectorAll("article table")
tables.forEach(function(table) {
new Tablesort(table)
})
})
app.document$.subscribe(() => {
const tables = document.querySelectorAll('article table');
tables.forEach(table => {
new Tablesort(table);
});
});

0 comments on commit f87053c

Please sign in to comment.