Skip to content

Commit

Permalink
feat: modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Nov 6, 2021
1 parent f7dcd78 commit 733cd89
Show file tree
Hide file tree
Showing 11 changed files with 3,355 additions and 3,319 deletions.
35 changes: 0 additions & 35 deletions .circleci/config.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: default

on: [push, workflow_dispatch]

jobs:
build-and-test-job:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
env:
NODE_OPTIONS: '--max-old-space-size=3200'
steps:
- { uses: actions/checkout@v2, with: { persist-credentials: false } }
- { uses: actions/setup-node@v2, with: { node-version: 16, cache: 'yarn' } }
- { name: yarn, run: yarn --frozen-lockfile }

- name: build
run: yarn build

- name: test
run: yarn test-ci
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: release

on:
push:
branches: [master, next, act]

jobs:
release-job:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
env: { NODE_OPTIONS: '--max-old-space-size=3200' }
steps:
- { uses: actions/checkout@v2, with: { persist-credentials: true } }
- { uses: actions/setup-node@v2, with: { node-version: 16, cache: 'yarn' } }

# Cache for npm/npx in ~/.npm
- uses: actions/cache@v2
with:
path: ~/.npm
key: npm-v1-${{ runner.os }}

- name: yarn
run: yarn --frozen-lockfile

- name: build
run: yarn build-prod

- name: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx @naturalcycles/semantic-release
6 changes: 6 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
[ -n "$CI" ] && exit 0
. "$(dirname "$0")/_/husky.sh"

node_modules/.bin/commitlint-def $1
# exit 1 # uncomment to debug
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
[ -n "$CI" ] && exit 0
. "$(dirname "$0")/_/husky.sh"

node_modules/.bin/lint-staged-def
3 changes: 0 additions & 3 deletions husky.config.js

This file was deleted.

29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
{
"name": "@naturalcycles/grafana-lib",
"scripts": {
"prepare": "husky install",
"serve": "DEBUG=nc* yarn tsn ./src/test/startServer.ts"
},
"dependencies": {
"@naturalcycles/db-lib": "^8.3.0",
"@naturalcycles/js-lib": "^14.6.0",
"@naturalcycles/nodejs-lib": "^12.4.0",
"@naturalcycles/time-lib": "^3.0.4",
"@types/express": "^4.17.8",
"@naturalcycles/db-lib": "^8.23.0",
"@naturalcycles/js-lib": "^14.58.0",
"@naturalcycles/nodejs-lib": "^12.50.0",
"@naturalcycles/time-lib": "^3.4.1",
"@types/express": "^4.17.13",
"express": "^4.17.1",
"express-promise-router": "^4.0.1"
"express-promise-router": "^4.1.0"
},
"devDependencies": {
"@naturalcycles/backend-lib": "^2.50.1",
"@naturalcycles/dev-lib": "^10.19.0",
"@naturalcycles/github-db": "^1.2.4",
"@sentry/node": "^6.1.0",
"@types/node": "^14.14.2",
"dotenv": "^8.2.0",
"jest": "^26.6.1"
"@naturalcycles/backend-lib": "^2.62.0",
"@naturalcycles/dev-lib": "^12.12.1",
"@naturalcycles/github-db": "^1.2.6",
"@sentry/node": "^6.14.1",
"@types/node": "^16.11.6",
"dotenv": "^10.0.0",
"jest": "^27.3.1"
},
"files": [
"dist",
Expand All @@ -39,7 +40,7 @@
"url": "https://github.com/NaturalCycles/grafana-lib"
},
"engines": {
"node": ">=12.13.1"
"node": ">=14.15.0"
},
"version": "1.0.2",
"description": "Exposes CommonDB as Grafana Json Datasource (express middleware)",
Expand Down
1 change: 0 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
> (express middleware)
[![npm](https://img.shields.io/npm/v/@naturalcycles/grafana-lib/latest.svg)](https://www.npmjs.com/package/@naturalcycles/grafana-lib)
[![](https://circleci.com/gh/NaturalCycles/grafana-lib.svg?style=shield&circle-token=123)](https://circleci.com/gh/NaturalCycles/grafana-lib)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

# Example
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@naturalcycles/dev-lib/cfg/tsconfig.json",
"compilerOptions": {
"sourceMap": true,
"outDir": "dist"
},
"include": ["src"],
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"sourceMap": true
"sourceMap": false
},
"exclude": ["**/__exclude", "src/test", "src/**/*.test.*"]
}
Loading

0 comments on commit 733cd89

Please sign in to comment.