Skip to content

Commit

Permalink
Merge pull request #298 from knorm/chore/monorepo
Browse files Browse the repository at this point in the history
chore: merge all knorm code into a single repository
  • Loading branch information
joelmukuthu committed Apr 11, 2020
2 parents 43c2c37 + d4d84bf commit 362f463
Show file tree
Hide file tree
Showing 146 changed files with 172,305 additions and 23,232 deletions.
13 changes: 12 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
node_modules
coverage

# nyc output directories
.nyc_output
coverage

# local yarn install
.yarn

# documentation site
website

# typescript build output directories
packages/*/lib
53 changes: 51 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
{
"parser": "@typescript-eslint/parser",
"env": {
"mocha": true,
"node": true,
"es6": true
},
"plugins": [
"mocha"
],
"extends": [
"ganintegrity"
]
"eslint:recommended",
"standard",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:mocha/recommended",
"prettier/standard",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"rules": {
"curly": [
"error",
"all"
],
"eqeqeq": [
"error",
"always"
],
"no-var": "error",
"no-console": "error",
"no-unused-vars": [
"error",
{
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": true
}
],
"prefer-const": "error",
"prettier/prettier": [
"error"
],
"mocha/no-mocha-arrows": "off",
"mocha/no-sibling-hooks": "off",
"mocha/no-hooks-for-single-case": "off",
"require-atomic-updates": "off",
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/no-this-alias": "warn",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/camelcase": "warn"
}
}
204 changes: 204 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
name: CI

on:
push:
branches: [ master, v* ]
pull_request:
branches: [ master, v* ]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Use yarn cache
uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --frozen-lockfile

- name: Run lint
run: yarn lint

test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [8.x, 10.x, 12.x]

services:
postgres9:
image: postgres:9.6-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres10:
image: postgres:9.6-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
- 5433:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres11:
image: postgres:9.6-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
- 5434:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres12:
image: postgres:9.6-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
- 5435:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install psql
run: sudo apt-get update && sudo apt-get install -y postgresql-client

- name: Create test databases
run: |
psql -Atx postgres://postgres:postgres@localhost:5432/postgres -f util/create-databases.sql
psql -Atx postgres://postgres:postgres@localhost:5433/postgres -f util/create-databases.sql
psql -Atx postgres://postgres:postgres@localhost:5434/postgres -f util/create-databases.sql
psql -Atx postgres://postgres:postgres@localhost:5435/postgres -f util/create-databases.sql
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Use yarn cache
uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies on Node.js 8
if: matrix.node-version == '8.x'
# @docusaurus/core requires node >= 10 but since we don't use it in
# tests, we can ignore that check here
run: yarn --frozen-lockfile --ignore-engines

- name: Install dependencies on Node.js != 8
if: matrix.node-version != '8.x'
run: yarn --frozen-lockfile

- name: Run tests on PostgreSQL 9.6
run: yarn mocha
env:
PGHOST: localhost
PGPORT: 5432

- name: Run tests on PostgreSQL 10
run: yarn mocha
env:
PGHOST: localhost
PGPORT: 5433

- name: Run tests on PostgreSQL 11
run: yarn mocha
env:
PGHOST: localhost
PGPORT: 5434

- name: Run coverage on PostgreSQL 12
run: yarn nyc
env:
PGHOST: localhost
PGPORT: 5435

- name: Run example on PostgreSQL 9.6
run: yarn workspace postgres-example start
env:
PGHOST: localhost
PGPORT: 5432

- name: Run example on PostgreSQL 10
run: yarn workspace postgres-example start
env:
PGHOST: localhost
PGPORT: 5433

- name: Run example on PostgreSQL 11
run: yarn workspace postgres-example start
env:
PGHOST: localhost
PGPORT: 5434

- name: Run example on PostgreSQL 12
run: yarn workspace postgres-example start
env:
PGHOST: localhost
PGPORT: 5435

- name: Send coverage to coveralls
if: matrix.node-version == '12.x'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

docs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@master

- name: Publish docs
uses: netlify/actions/build@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# node.js modules
node_modules
coverage

# nyc coverage output directories
.nyc_output
coverage

# typescript output directories
packages/*/lib

# typescript build files
tsconfig.tsbuildinfo

# yarn log output files
yarn-debug.log
yarn-error.log
14 changes: 14 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"exit": true,
"extension": [
"js",
"ts"
],
"spec": [
"packages/*/test/*.spec.*"
],
"require": [
"tsconfig-paths/register",
"ts-node/register"
]
}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
12
7 changes: 4 additions & 3 deletions .nycrc → .nycrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"all": true,
"cache": true,
"include": [
"lib"
"packages/*/src"
],
"exclude": [
"index.js"
"reporter": [
"lcov",
"text"
]
}
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true
}
22 changes: 0 additions & 22 deletions .releaserc.json

This file was deleted.

36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

0 comments on commit 362f463

Please sign in to comment.