Skip to content

Commit

Permalink
Merge pull request #24 from Diaszano/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
Diaszano authored Dec 2, 2023
2 parents 6104455 + 2386dde commit 0a12766
Show file tree
Hide file tree
Showing 15 changed files with 1,737 additions and 791 deletions.
26 changes: 0 additions & 26 deletions .eslintrc.js

This file was deleted.

38 changes: 38 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"ignorePatterns": [
"*/**.spec.ts"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project" : ["./tsconfig.json"]
},
"plugins": [
"@typescript-eslint",
"security"
],
"rules": {
"@typescript-eslint/no-empty-function": [
"error",
{ "allow": ["constructors"] }
],
"no-alert": "error",
"no-console": "error",
"no-eval": "error",
"no-process-exit": "error",
"no-unused-vars": "error",
"security/detect-buffer-noassert": "warn",
"security/detect-child-process": "warn",
"security/detect-non-literal-regexp": "warn"
}
}
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: NPM Deployment

on:
push:
branches:
- main
workflow_run:
workflows: ["Run Tests", "Code Quality Check"]
types:
- completed

jobs:
npm_deploy:
name: Execute NPM Deployment
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout Source Code
uses: actions/checkout@v2

- name: Set Up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install Project Dependencies
run: npm ci

- name: Build Project
run: npm run build

- name: Generate Documentation
run: npm run build:docs

- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Code Quality Check

on:
pull_request:
workflow_dispatch:

jobs:
code_quality_verification:
name: Code Quality Verification
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout Source Code
uses: actions/checkout@v2

- name: Set Up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install Project Dependencies
run: npm ci

- name: Run Code Linting
run: npm run lint
37 changes: 0 additions & 37 deletions .github/workflows/npm-publish.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run Tests

on:
pull_request:
workflow_dispatch:

jobs:
run_tests:
name: Execute Code Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout Source Code
uses: actions/checkout@v2

- name: Set Up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install Project Dependencies
run: npm ci

- name: Run Code Tests
run: npm test
env:
LINKETRACK_USER: ${{secrets.LINKETRACK_USER}}
LINKETRACK_TOKEN: ${{secrets.LINKETRACK_TOKEN}}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.ts": [
"npm run lint"
]
}
28 changes: 28 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Diretórios de configuração do VSCode
.vscode/

# Configurações específicas do WebStorm
.idea/

# Arquivos e diretórios do sistema
.DS_Store
Thumbs.db

# Arquivos de configuração local
.env
.env.local
.env.*.local

# Arquivos TypeScript e diretórios de origem
src/
*.ts
*.tsx

# Diretório de saída do TypeScript
dist/

# Arquivos de teste
test/
*.spec.ts
*.test.ts
*.test.tsx
7 changes: 0 additions & 7 deletions .prettierrc.js

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80,
"tabWidth": 2,
"arrowParens": "always"
}
Loading

0 comments on commit 0a12766

Please sign in to comment.