Skip to content

Commit

Permalink
feat: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
andreafspeziale committed Sep 27, 2022
0 parents commit 1208cb3
Show file tree
Hide file tree
Showing 29 changed files with 21,478 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,40 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin', 'unused-imports'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js', '/index.js', '/index.ts', '/index.d.ts', '/jest.config.js', '/dist'],
rules: {
'no-console': 2,
'@typescript-eslint/explicit-function-return-type': 1,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/no-shadow': 1,
'@typescript-eslint/no-unused-vars': [1, { ignoreRestSiblings: true }],
'import/namespace': 0,
'import/no-extraneous-dependencies': 2,
'import/order': [
2,
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'never',
},
],
'lines-between-class-members': [2, 'always', { exceptAfterSingleLine: true }],
'unused-imports/no-unused-imports': 2,
},
};
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,39 @@
name: Release
on:
workflow_dispatch:
workflow_run:
workflows: [Test]
branches: [main]
types: [completed]
jobs:
release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18.5.0
- name: Git config
run: |
git config user.name ${{ secrets.CI_GITHUB_USER }}
git config user.email ${{ secrets.CI_GITHUB_EMAIL }}
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Set registry
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.CI_NPM_TOKEN }}
- name: Release
run: npm run release
- name: Update develop
run: |
git branch
git checkout develop
git rebase main
git push
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,26 @@
name: Test
on:
push:
branches: [develop, main]
pull_request:
branches: [develop, main]
jobs:
test:
runs-on: ubuntu-latest
services:
memcached:
image: bitnami/memcached:1.6.17
ports:
- 11211:11211
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.5.0
- name: Install
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm run test
37 changes: 37 additions & 0 deletions .gitignore
@@ -0,0 +1,37 @@
# compiled output
/dist
/node_modules

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Environment
.env
4 changes: 4 additions & 0 deletions .husky/commit-msg
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
4 changes: 4 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
12 changes: 12 additions & 0 deletions .npmignore
@@ -0,0 +1,12 @@
/coverage
.github
.husky
/lib
.eslintrc.js
.prettierrc
.release-it.json
docker-compose.test.yml
jest.config.js
package-lock.json
tsconfig.build.json
tsconfig.json
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
save-exact=true
4 changes: 4 additions & 0 deletions .prettierrc
@@ -0,0 +1,4 @@
{
"printWidth": 100,
"singleQuote": true
}
34 changes: 34 additions & 0 deletions .release-it.json
@@ -0,0 +1,34 @@
{
"git": {
"commitMessage": "chore: release v${version}",
"requireBranch": "main"
},
"github": {
"release": true
},
"npm": {
"skipChecks": true
},
"plugins": {
"@release-it/conventional-changelog": {
"infile": "CHANGELOG.md",
"preset": {
"name": "conventionalcommits",
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "chore",
"section": "Miscellaneous"
}
]
}
}
}
}
22 changes: 22 additions & 0 deletions LICENSE
@@ -0,0 +1,22 @@
(The MIT License)

Copyright (c) 2022 Andrea Francesco Speziale

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 comments on commit 1208cb3

Please sign in to comment.