Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Apr 3, 2023
1 parent cdcab70 commit 7fdb271
Show file tree
Hide file tree
Showing 17 changed files with 90 additions and 4,026 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ indent_style = tab
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.yaml,*.yml]
indent_style = tab
indent_size = 2
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ v8-compile-cache*
private

# Build files
/src/client/public/app/*
/src/server/public/

# Environment Variables
.env
Expand Down
26 changes: 13 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,39 @@ sudo: required

language: node_js
node_js:
- "14"
- '14'
services:
- postgresql
- docker

addons:
postgresql: "10"
postgresql: '10'
apt:
packages:
- postgresql-10
- postgresql-client-10
packages:
- postgresql-10
- postgresql-client-10

env:
- OED_DB_USER=test OED_DB_PASSWORD=test OED_DB_DATABASE=travis_ci_dummy OED_DB_TEST_DATABASE=travis_ci_test OED_DB_HOST=localhost OED_DB_PORT=5432 OED_TOKEN_SECRET=travis OED_SERVER_PORT=3000 OED_TEST_SITE_READING_RATE=00:15:00 DOCKER_COMPOSE_VERSION=1.27.4 POSTGRES_PASSWORD=travisTest
- OED_DB_USER=test OED_DB_PASSWORD=test OED_DB_DATABASE=travis_ci_dummy OED_DB_TEST_DATABASE=travis_ci_test OED_DB_HOST=localhost OED_DB_PORT=5432 OED_TOKEN_SECRET=travis OED_SERVER_PORT=3000 OED_TEST_SITE_READING_RATE=00:15:00 DOCKER_COMPOSE_VERSION=1.27.4 POSTGRES_PASSWORD=travisTest

before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin

before_script:
# Database for non-Docker execution
# Database for non-Docker execution
- psql -c 'CREATE DATABASE travis_ci_test' -U postgres
- psql -c "CREATE USER test WITH PASSWORD 'test';" -U postgres
- psql -c 'CREATE EXTENSION IF NOT EXISTS btree_gist;' -U postgres -d travis_ci_test
# Database for Docker execution. No meters, with a default user.
- docker-compose run --rm web src/scripts/installOED.sh --nostart

script:
# Validate legal requirements on source files
# Validate legal requirements on source files
- npm run check:header
# Validate that all areas which are intended to be typed, are typed
# Validate that all areas which are intended to be typed, are typed
- npm run check:typescript
# Validate that the client's type system is internally consistent
- npm run check:types
Expand Down
18 changes: 9 additions & 9 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
const { Client } = require('pg');

const pgclient = new Client({
host: process.env.POSTGRES_HOST,
port: process.env.POSTGRES_PORT,
user: 'postgres',
password: process.env.POSTGRES_PASSWORD,
database: process.env.OED_DB_TEST_DATABASE
host: process.env.POSTGRES_HOST,
port: process.env.POSTGRES_PORT,
user: 'postgres',
password: process.env.POSTGRES_PASSWORD,
database: process.env.OED_DB_TEST_DATABASE
});

pgclient.connect();
Expand All @@ -19,14 +19,14 @@ const alterUser = "ALTER USER " + process.env.OED_DB_USER + " WITH SUPERUSER;"
const extension = "CREATE EXTENSION IF NOT EXISTS btree_gist;"

pgclient.query(createUser, (err, res) => {
if (err) throw err
if (err) throw err
});

pgclient.query(alterUser, (err, res) => {
if (err) throw err
if (err) throw err
});

pgclient.query(extension, (err, res) => {
if (err) throw err
pgclient.end()
if (err) throw err
pgclient.end()
});
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "node ./src/bin/www",
"start:dev": "nodemon --legacy-watch --inspect=0.0.0.0 ./src/bin/www",
"vite:dev": "vite --config ./src/vite.config.js",
"vite:build": "vite --config",
"vite:build": "vite --config ./src/vite.config.js build",
"check": "./src/scripts/devcheck.sh",
"check:header": "./src/scripts/checkHeader.sh",
"check:typescript": "./src/scripts/checkTypescript.sh",
Expand Down Expand Up @@ -98,7 +98,7 @@
"react-intl": "~5.22.0",
"react-notification-system": "~0.4.0",
"react-plotly.js": "~2.6.0",
"react-redux": "~7.2.5",
"react-redux": "~7.2.9",
"react-router": "~5.2.1",
"react-router-dom": "~5.3.0",
"react-select": "~5.2.0",
Expand All @@ -115,6 +115,7 @@
"@redux-devtools/core": "~3.11.0",
"@redux-devtools/extension": "~3.2.2",
"@types/core-js": "~0.9.43",
"@types/express-rate-limit": "~6.0.0",
"@types/history": "~4.7.2",
"@types/lodash": "~4.14.122",
"@types/moment": "~2.13.0",
Expand Down
Loading

0 comments on commit 7fdb271

Please sign in to comment.