Skip to content

Commit

Permalink
refactor: migrate codebase on TypeScript; remove babel; migrate on gi…
Browse files Browse the repository at this point in the history
…tlab actions; update dev dependencies.

BREAKING CHANGE: remove Flowtype declarations. There is no code changes but build now uses `tsc` instead of `babel`.
  • Loading branch information
nodkz committed Dec 14, 2021
1 parent bf3daa1 commit a92c8ae
Show file tree
Hide file tree
Showing 67 changed files with 4,978 additions and 14,215 deletions.
74 changes: 0 additions & 74 deletions .babelrc

This file was deleted.

5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
flow-typed
lib
mjs
esm
dist
dist
coverage
*.js
52 changes: 0 additions & 52 deletions .eslintrc

This file was deleted.

46 changes: 46 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const path = require('path');

module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
extends: ['plugin:@typescript-eslint/recommended', 'prettier', 'plugin:prettier/recommended'],
parserOptions: {
sourceType: 'module',
useJSXTextNode: true,
project: [path.resolve(__dirname, 'tsconfig.json')],
},
rules: {
'no-underscore-dangle': 0,
'arrow-body-style': 0,
'no-unused-expressions': 0,
'no-plusplus': 0,
'no-console': 0,
'func-names': 0,
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
},
],
'no-prototype-builtins': 0,
'prefer-destructuring': 0,
'no-else-return': 0,
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/ban-ts-comment': 0,
},
env: {
jasmine: true,
jest: true,
},
};
43 changes: 0 additions & 43 deletions .flowconfig

This file was deleted.

12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: [nodkz]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Patreon username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
54 changes: 54 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install node_modules
run: yarn
- name: Test – Jest
run: yarn coverage
env:
CI: true
- name: Test – Eslint
run: yarn eslint
- name: Test – TSCheck
run: yarn tscheck
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
with:
check_name: JUnit Annotations for Node ${{ matrix.node-version }}
report_paths: '**/coverage/junit/**/*.xml'
- name: Send codecov.io stats
run: bash <(curl -s https://codecov.io/bash) || echo ''

publish:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta'
needs: [tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install node_modules
run: yarn install
- name: Build
run: yarn build
- name: Semantic Release (publish to npm)
run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"printWidth": 100,
"trailingComma": "es5"
}
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"javascript.validate.enable": false
"javascript.validate.enable": false,
"cSpell.words": [
"constantize",
"Declention",
"firstname",
"lastname",
"lvovich",
"middlename"
]
}
Loading

0 comments on commit a92c8ae

Please sign in to comment.