Skip to content

Commit

Permalink
Merge pull request #20 from Sagacify/feat-typescript
Browse files Browse the repository at this point in the history
feat(*): migrate to typescript
  • Loading branch information
OlivierCuyp authored Sep 30, 2021
2 parents db0c6ce + 44fc26c commit 60b6ada
Show file tree
Hide file tree
Showing 18 changed files with 3,400 additions and 2,094 deletions.
76 changes: 0 additions & 76 deletions .circleci/config.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Continuous Integration
on:
push:
branches:
- master
- dryrun-*
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: Validate commit messages
if: ${{ github.ref != 'refs/heads/master' }}
uses: wagoid/commitlint-github-action@v3

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

- name: Install packages & build & run tests
run: |
npm ci
npm test
- name: Compile typescript
run: npm run build

- name: Semantic Release
id: semantic_release
if: ${{ github.ref == 'refs/heads/master' }}
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.SAGA_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
semantic_version: 17
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,18 @@ $ npm install @sagacify/autoroute

### Import in your project

```js
// require Autoroute
const { Autoroute } = require('@sagacify/autoroute');
// import Autoroute
import { Autoroute } from '@sagacify/autoroute';
```

### Create an instance

```js
const express = require('express');
const { Autoroute } = require('@sagacify/autoroute');
const { Router } = require('express');
// OR
import { Autoroute } from '@sagacify/autoroute';
import { Router } from 'express';

const autoroute = new Autoroute(
// Router class
express.Router,
Router,
// Mapping between controller actions & http verbs
{
exists: 'head',
Expand Down
Loading

0 comments on commit 60b6ada

Please sign in to comment.