Skip to content

Commit

Permalink
[TASK] update .editorconfig and .gitignore, add .npmrc, githooks and …
Browse files Browse the repository at this point in the history
…github actions
  • Loading branch information
dmh committed Jun 11, 2023
1 parent 6bdadba commit 9f49830
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 25 deletions.
32 changes: 27 additions & 5 deletions .editorconfig
@@ -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
19 changes: 19 additions & 0 deletions .github/workflows/git-commit.yml
@@ -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]".'
21 changes: 21 additions & 0 deletions .github/workflows/publish-npm.yml
@@ -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}}
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
@@ -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
7 changes: 4 additions & 3 deletions .gitignore
@@ -1,9 +1,10 @@
.vscode/*
!.vscode/settings.json
node_modules
site
.env
.env*
.tmp
temp
.sass-cache
bower_components
.DS_Store
npm-debug.log
*.sublime-*
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm test
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
engine-strict=true
8 changes: 0 additions & 8 deletions gif.md

This file was deleted.

9 changes: 0 additions & 9 deletions license

This file was deleted.

0 comments on commit 9f49830

Please sign in to comment.