Skip to content

Commit d839513

Browse files
authored
[TASK] code refactoring (#1)
1 parent 38d2f40 commit d839513

38 files changed

Lines changed: 15560 additions & 2388 deletions

.editorconfig

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ indent_style = space
1414
indent_size = 4
1515

1616
# TypeScript/JavaScript/JSON files
17-
[*.{ts,js,json}]
17+
[*.{ts,js,json,mjs}]
1818
indent_size = 2
1919

2020
# XLF/XML files
@@ -25,15 +25,6 @@ indent_style = tab
2525
[*.{yaml,yml}]
2626
indent_size = 2
2727

28-
# ReST-Files
29-
[*.rst]
30-
indent_size = 3
31-
32-
# SQL files
33-
[*.sql]
34-
indent_style = tab
35-
indent_size = 2
36-
3728
# HTML files
3829
[*.html]
3930
indent_size = 2

.github/workflows/git-commit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
check-commit-message:
1010
name: Check Commit Message
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 30
1213

1314
steps:
1415
- name: Check Commit Type

.github/workflows/publish-npm.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish NPM Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 30
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 20
16+
cache: 'npm'
17+
registry-url: https://registry.npmjs.org/
18+
- run: npm ci
19+
- run: npm test
20+
- run: npm publish
21+
env:
22+
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}

.github/workflows/test.yml

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,22 @@ on: [push, pull_request]
44

55
jobs:
66

7-
main:
8-
name: Run tests
7+
build:
8+
name: Node
99
runs-on: ubuntu-latest
10-
10+
timeout-minutes: 30
1111
strategy:
1212
matrix:
13-
node-version: [16.x]
14-
13+
node: [18, 20]
1514
steps:
16-
- uses: actions/checkout@v2
17-
18-
- name: Set up Node.js v${{ matrix.node-version }}
19-
uses: actions/setup-node@v2
20-
with:
21-
node-version: ${{ matrix.node-version }}
22-
23-
- name: Get npm cache directory
24-
id: npm-cache
25-
run: |
26-
echo "::set-output name=dir::$(npm config get cache)"
27-
28-
- uses: actions/cache@v2
15+
- uses: actions/checkout@v3
16+
- name: Setup Node.js v${{ matrix.node }}
17+
uses: actions/setup-node@v3
2918
with:
30-
path: ${{ steps.npm-cache.outputs.dir }}
31-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
32-
restore-keys: |
33-
${{ runner.os }}-node-
34-
35-
- name: Install npm@^8
36-
run: npm install -g npm@^8
37-
38-
- name: Install npm dependencies
39-
run: npm ci
40-
41-
- name: Run npm test
42-
run: npm test
19+
node-version: ${{ matrix.node }}
20+
cache: 'npm'
21+
- run: npm ci
22+
- run: npm test
4323

4424
- name: PKG versions
4525
run: |

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ node_modules
55
.env*
66
.idea
77
.tmp
8+
temp
9+
.DS_Store
10+
npm-debug.log
11+
*.sublime-*
12+
validation-status.json

.husky/pre-commit

100755100644
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npm test

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) Resultify <info@resultify.se> (https://www.resultify.se/)
3+
Copyright (c) 2022 - present Resultify
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

bin/rh-cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
2-
import { init } from '../lib/cli.js'
2+
import { init } from '../lib/init.js'
33
await init()

jsconfig.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"compilerOptions": {
3-
"target": "esnext",
43
"module": "esnext",
4+
"target": "esnext",
5+
"strict": true,
56
"checkJs": true,
7+
"forceConsistentCasingInFileNames": true,
8+
"useUnknownInCatchVariables": false,
69
"moduleResolution": "node"
7-
}
10+
},
11+
"include": ["lib/**/*", "bin/**/*"],
812
}

jsdoc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"plugins": ["plugins/markdown"],
3+
"source": {
4+
"include": ["lib/"]
5+
},
6+
"templates": {
7+
"cleverLinks": true,
8+
"default": {
9+
"includeDate": false
10+
}
11+
},
12+
"opts": {
13+
"template": "node_modules/modern-jsdoc-template/default",
14+
"readme": "./README.md",
15+
"destination": "./docs/",
16+
"recurse": true,
17+
"verbose": true
18+
},
19+
"markdown": {
20+
"idInHeadings": true
21+
}
22+
}

0 commit comments

Comments
 (0)