Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
"@babel/env", "@babel/typescript"],
"plugins": [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread"
],
"sourceMaps": "inline"
}
124 changes: 124 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
extends:
- eslint:recommended
- plugin:import/errors
- plugin:import/warnings
env:
browser: true
es6: true
parserOptions:
ecmaVersion: 10
ignorePatterns:
- node_modules/
- coverage/
- dist/
- doc/
rules:
comma-dangle: error
curly: error
dot-notation: error
eol-last: error
eqeqeq: [error, always]
id-match: error
new-parens: error
no-bitwise: error
no-caller: error
no-debugger: error
no-duplicate-imports: error
no-empty: error
no-eval: error
no-fallthrough: error
no-invalid-this: error
no-new-wrappers: error
no-param-reassign: error
no-redeclare: error
no-sequences: error
no-shadow:
- error
- hoist: all
no-trailing-spaces: error
no-unused-expressions: error
no-unused-labels: error
no-var: error
prefer-const: error
radix: error
space-in-parens: warn
spaced-comment: error
use-isnan: error
overrides:
- files: '**/*.ts'
parser: '@typescript-eslint/parser'
parserOptions:
project: tsconfig.json
sourceType: module
plugins:
- '@typescript-eslint'
- '@typescript-eslint/tslint'
- eslint-plugin-tsdoc
extends:
- plugin:import/typescript
- plugin:@typescript-eslint/recommended
rules:
'@typescript-eslint/class-name-casing': error
'@typescript-eslint/explicit-member-accessibility':
- error
- accessibility: explicit
'@typescript-eslint/member-delimiter-style':
- error
- multiline:
delimiter: semi
requireLast: true
singleline:
delimiter: semi
requireLast: false
'@typescript-eslint/no-empty-function': error
'@typescript-eslint/no-namespace': error
'@typescript-eslint/no-require-imports': error
'@typescript-eslint/no-var-requires': error
'@typescript-eslint/prefer-namespace-keyword': error
'@typescript-eslint/prefer-readonly': error
'@typescript-eslint/triple-slash-reference': error
'@typescript-eslint/type-annotation-spacing': error
'@typescript-eslint/tslint/config':
- error
- rules:
one-line:
- true,
- check-catch
- check-finally
- check-else
- check-open-brace
- check-whitespace
typedef:
- true
- call-signature
- parameter
- property-declaration
whitespace:
- true
- check-branch
- check-decl
- check-operator
- check-module
- check-separator
- check-type
no-invalid-this: off # seem not to work correctly with TypeScript
'@typescript-eslint/explicit-function-return-type':
- warn
- allowExpressions: true
allowTypedFunctionExpressions: true
allowHigherOrderFunctions: true
'@typescript-eslint/camelcase':
- warn
- allow:
- total_replies
- hidden_replies
'@typescript-eslint/no-use-before-define':
- error
- functions: false
classes: false
'no-unused-expressions': off
'@typescript-eslint/no-unused-expressions': error
'@typescript-eslint/no-non-null-assertion': off
- files: 'test/**/*'
env:
jest: true
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10, 12, 13]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-nodejs-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-nodejs
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Prepare
run: npm ci
- name: Lint
run: npm run lint
- name: Unit Tests
run: npm run unit-test
- name: Integration Tests
run: npm run integration-test

release:
name: Release Check
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-nodejs-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-nodejs
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Prepare
run: npm ci
- name: Release Check
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Documentation
/doc

# Build output
/dist

# Logs
logs
*.log
Expand Down
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.idea/
.vscode/
coverage/
dist/
doc/
node_modules/
package.json
package-lock.json
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"useTabs": true,
"singleQuote": true,
"printWidth": 100
}
28 changes: 13 additions & 15 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"extends": [
"config:base"
],
"pinVersions": true,
"lockFileMaintenance": { "enabled": true },
"packageRules": [
{
"depTypeList": ["engines"],
"enabled": false
},
{
"updateTypes": ["minor", "patch", "pin", "digest", "lockFileMaintenance"],
"automerge": true
}
]
"extends": ["config:base"],
"pinVersions": true,
"lockFileMaintenance": { "enabled": true },
"packageRules": [
{
"depTypeList": ["engines"],
"enabled": false
},
{
"updateTypes": ["minor", "patch", "pin", "digest", "lockFileMaintenance"],
"automerge": true
}
]
}
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

39 changes: 20 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# isso-clientlib [![Build Status](https://travis-ci.org/jGleitz/isso-clientlib.svg?branch=master)](https://travis-ci.org/jGleitz/isso-clientlib) [![codecov](https://codecov.io/gh/jGleitz/isso-clientlib/branch/master/graph/badge.svg)](https://codecov.io/gh/jGleitz/isso-clientlib)
# isso-clientlib [![Build Status](https://travis-ci.org/jGleitz/isso-clientlib.svg?branch=master)](https://travis-ci.org/jGleitz/isso-clientlib) [![codecov](https://codecov.io/gh/jGleitz/isso-clientlib/branch/master/graph/badge.svg)](https://codecov.io/gh/jGleitz/isso-clientlib)

A client library to interact with the isso commenting server. [API Documentation](https://jgleitz.github.io/isso-clientlib/)

Expand All @@ -8,32 +8,33 @@ This library is written in [TypeScript](https://www.typescriptlang.org/). To get

Relevant projects and libraries are:

* [SuperAgent](http://visionmedia.github.io/superagent/), the HTTP library
* [ts-events](https://github.com/rogierschouten/ts-events) for asynchronous events
* [jest](https://jestjs.io/), the test framework
* [ts-lint](https://palantir.github.io/tslint/), used for checking the code for style
* [typedoc](https://typedoc.org/) to render the [API Documentation](https://jgleitz.github.io/isso-clientlib/)
- [SuperAgent](http://visionmedia.github.io/superagent/), the HTTP library
- [ts-events](https://github.com/rogierschouten/ts-events) for asynchronous events
- [jest](https://jestjs.io/), the test framework
- [ts-lint](https://palantir.github.io/tslint/), used for checking the code for style
- [typedoc](https://typedoc.org/) to render the [API Documentation](https://jgleitz.github.io/isso-clientlib/)

### Testing

Tests are very important to this project. It’s intended to be a library users can rely on. The library is tested using both *unit* and *integration* tests. The integration test spins up real isso instance to make sure the library is always compatible to the latest version of isso.
Tests are very important to this project. It’s intended to be a library users can rely on. The library is tested using both _unit_ and _integration_ tests. The integration test spins up real isso instance to make sure the library is always compatible to the latest version of isso.

#### Prerequisite

In order to run the integration test, you need to install python, the python headers and virtualenv. On Debian/Ubuntu, run:

```bash
sudo apt install python3 python3-dev python3-venv
```
In order to run the integration test, you need to have [`podman`](https://podman.io/) or [`docker`](https://docs.docker.com/install/) installed.

### Scripts

To check the code, you can use these tasks:

Task | Description
--- | ---
`npm test` | run all checks
`npm start` | start the jest in watch mode to continuously run the *unit* tests on changed code
`npm run lint` | lint the code
`npm run unit-test` | run only unit tests
`npm run integration-test` | run only the integration test
| Task | Description |
| -------------------------- | --------------------------------------------------------------------------------- |
| `npm test` | run all checks |
| `npm start` | start the jest in watch mode to continuously run the _unit_ tests on changed code |
| `npm run typecheck` | typecheck the code |
| `npm run lint` | lint the code |
| `npm run format` | fix formatting problems automatically |
| `npm run unit-test` | run only unit tests |
| `npm run integration-test` | run only the integration test |
| `npm run doc` | generate the documentation |

To execute the integration test while offline, set the environment variable `OFFLINE` to `true`.
Loading