Skip to content

Commit 3400cc5

Browse files
chore(setup): add dev tools (husky, prettier, ...)
1 parent b29212e commit 3400cc5

18 files changed

+39792
-504
lines changed

.commitlintrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
extends:
2+
- "@commitlint/config-conventional"

.eslintrc.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
env:
2+
es6: true
3+
node: true
4+
extends:
5+
- "plugin:@typescript-eslint/eslint-recommended"
6+
parser: "@typescript-eslint/parser"
7+
parserOptions:
8+
ecmaVersion: 2021
9+
sourceType: module
10+
plugins:
11+
- "@typescript-eslint"
12+
ignorePatterns:
13+
- "node_modules/*"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__tests__/runner/*
22

33
# comment out in distribution branches
4-
# node_modules/
4+
node_modules/
55

66
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
77
# Logs

.husky/commit-msg

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

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged && npm run build && git add dist/*

.lintstagedrc.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# we use tslint instead of ng lint, because we can't use --project (tsconfig specifying files with include, exclude )
2+
# and --files argument pointing to other files
3+
src/{**/,}!(*.+(spec|test)).ts:
4+
- npm run prettier:staged
5+
- npm run lint:staged
6+
# test folder and specs
7+
test/{**/,}*.ts,src/{**/,}*.+(spec|test).ts:
8+
- npm run prettier:staged
9+
- npm run lint:staged
10+
# e2e tests (mostly in client projects)
11+
e2e/{**/,}*.ts:
12+
- npm run prettier:staged
13+
- npm run lint:staged
14+
# sort package.json keys
15+
./package.json:
16+
- sort-package-json

.prettierrc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# https://github.com/prettier/prettier/blob/master/docs/options.md
2+
printWidth: 120
3+
singleQuote: true
4+
semi: false
5+
trailingComma: all

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ build:
3030
steps: ...
3131
```
3232
33+
## Development
34+
### new version
35+
1) implement your changes
36+
2) commit with `npx commit`
37+
3) set tag `git tag -a -m "my fancy release" v0.0.X`
38+
4) push with tags `git push --follow-tags`
39+
3340
## Publish to a distribution branch
3441

3542
Actions will be consumed from GitHub repos. All the dependencies must be pushed there. This means for JS also

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# check doc on https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs
22
name: 'Skip CI'
33
description: 'Sets output param depending on commit message'
4-
author: 'Michael Wittwer <michael.wittwer@shiftcode.ch>'
4+
author: 'shiftcode GmbH <team@shiftcode.ch>'
55
inputs:
66
skipOnCommitMsg:
77
description: 'defines an output variable depending if the commit message contains the skipOnCommitMsg string (output: true) or not (false).'
@@ -16,4 +16,4 @@ outputs:
1616
description: 'boolean value. True if the commit message contains the string provided in skipOnCommitMsg input param, false otherwise.'
1717
runs:
1818
using: 'node16'
19-
main: 'lib/main.js'
19+
main: 'dist/index.js'

0 commit comments

Comments
 (0)