Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] update .editorconfig and .gitignore, add .npmrc, githooks and …
…github actions
- Loading branch information
Showing
9 changed files
with
102 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
# Get rid of whitespace to avoid diffs with a bunch of EOL changes | ||
trim_trailing_whitespace = true | ||
# Unix-style newlines with a newline ending every file | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# TypeScript/JavaScript/JSON files | ||
[*.{ts,js,json,mjs}] | ||
indent_size = 2 | ||
|
||
# XLF/XML files | ||
[*.{xlf,xml}] | ||
indent_style = tab | ||
|
||
# YAML-Files | ||
[*.{yaml,yml}] | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
# HTML files | ||
[*.html] | ||
indent_size = 2 | ||
|
||
# CSS/SCSS files | ||
[*.{css,scss}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Check Commit Message | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, reopened, synchronize, ready_for_review, review_requested] | ||
|
||
jobs: | ||
|
||
check-commit-message: | ||
name: Check Commit Message | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check Commit Type | ||
uses: gsactions/commit-message-checker@v1 | ||
with: | ||
pattern: '^(|\[(!!!)\])\[(FEATURE|BUGFIX|TASK|TEST|DOC|WIP)\] .+$' | ||
flags: 'gm' | ||
error: 'Your first line has to contain a commit prefix like "[FEATURE|BUGFIX|TASK|TEST|DOC|WIP]".' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Publish NPM Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish-npm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: 'npm' | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm ci | ||
- run: npm test | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Run tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
build: | ||
name: Node | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [16, 18] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Node.js v${{ matrix.node }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm test | ||
|
||
- name: PKG versions | ||
run: | | ||
node -v | ||
npm -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |