Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NODE_ENV=development
CONSOLE_LOG_ENABLED=true
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
"env": {
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"no-unused-vars": "off",
"indent": ["error", 2],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/no-explicit-any": "off"
}
};


57 changes: 57 additions & 0 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: AptyNodeUtilities
on:
push:
branches:
- development
- rc**
- feature/**/*
pull_request:
branches:
- development
- rc**
- feature/**/*
jobs:
rules:
name: Rules
runs-on: ubuntu-latest
outputs:
branch_name: ${{ steps.validations.outputs.branch_name }}
steps:
- name: Fetch Branch Name
uses: aptyInc/gha-branch-name@master
id: validations

lint:
name: Lint
runs-on: ubuntu-latest
needs: rules
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18.16.1'

- name: Caching node modules
id: AptyNodeUtilities
uses: actions/cache@v2
with:
path: "./node_modules"
key: node-modules-${{ hashFiles('./package.json') }}

- name: Install Deps
if: steps.AptyNodeUtilities.outputs.cache-hit != 'true'
run: sudo npm install

- name: Run lint
run: npm run lint

- name: Run tests
run: npm run test

- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
coverage
.env
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

# apty-nodejs-logger
Temporary repository for apty nodejs logger need to merge this to apty-nodejs-utilities once we fix private library pulling issues in CI docker build
Temporary repository for apty nodejs logger need to merge this to apty-nodejs-utilities once we fix private library pulling issues in CI docker build
19 changes: 19 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: "ts-jest",
testEnvironment: "node",
moduleFileExtensions: ["js", "json", "ts"],
transform: {
"^.+\\.ts$": "ts-jest",
},
roots: ["<rootDir>/src/__tests__"],
testRegex: "(/__tests__/.*\\.test\\.ts)$",
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
},
globals: {
"ts-jest": {
tsconfig: "tsconfig.json",
},
},
};
1 change: 1 addition & 0 deletions lib/__tests__/logger.helper.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "../logger.helper";
22 changes: 22 additions & 0 deletions lib/__tests__/logger.helper.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/__tests__/logger.helper.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import "./logger.helper";
export * from "./logger.helper";
20 changes: 20 additions & 0 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/logger.helper.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
52 changes: 52 additions & 0 deletions lib/logger.helper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/logger.helper.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading