-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
load namespace queues topic subscriptions + styling
- Loading branch information
1 parent
7ec82f5
commit 7e60ae2
Showing
41 changed files
with
523 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# @service-bus-browser/logs-services | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Running unit tests | ||
|
||
Run `nx test @service-bus-browser/logs-services` to execute the unit tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const nx = require('@nx/eslint-plugin'); | ||
const baseConfig = require('../../../eslint.config.js'); | ||
|
||
module.exports = [ | ||
...baseConfig, | ||
...nx.configs['flat/angular'], | ||
...nx.configs['flat/angular-template'], | ||
{ | ||
files: ['**/*.ts'], | ||
rules: { | ||
'@angular-eslint/directive-selector': [ | ||
'error', | ||
{ | ||
type: 'attribute', | ||
prefix: 'lib', | ||
style: 'camelCase', | ||
}, | ||
], | ||
'@angular-eslint/component-selector': [ | ||
'error', | ||
{ | ||
type: 'element', | ||
prefix: 'lib', | ||
style: 'kebab-case', | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.html'], | ||
// Override or add rules here | ||
rules: {}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export default { | ||
displayName: '@service-bus-browser/logs-services', | ||
preset: '../../../jest.preset.js', | ||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], | ||
coverageDirectory: '../../../coverage/libs/logs/services', | ||
transform: { | ||
'^.+\\.(ts|mjs|js|html)$': [ | ||
'jest-preset-angular', | ||
{ | ||
tsconfig: '<rootDir>/tsconfig.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
}, | ||
], | ||
}, | ||
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], | ||
snapshotSerializers: [ | ||
'jest-preset-angular/build/serializers/no-ng-attributes', | ||
'jest-preset-angular/build/serializers/ng-snapshot', | ||
'jest-preset-angular/build/serializers/html-comment', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@service-bus-browser/logs-services", | ||
"$schema": "../../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "libs/logs/services/src", | ||
"prefix": "lib", | ||
"projectType": "library", | ||
"tags": [], | ||
"targets": { | ||
"test": { | ||
"executor": "@nx/jest:jest", | ||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], | ||
"options": { | ||
"jestConfig": "libs/logs/services/jest.config.ts" | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nx/eslint:lint" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Logger } from './lib/logger'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { inject, Injectable } from '@angular/core'; | ||
import { Store } from '@ngrx/store'; | ||
import { LogLineSeverity } from '@service-bus-browser/logs-contracts'; | ||
import { LogsActions } from '@service-bus-browser/logs-store'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class Logger { | ||
store = inject(Store); | ||
|
||
log(message: string, severity: LogLineSeverity, context?: unknown) { | ||
this.store.dispatch(LogsActions.writeLog({ | ||
context, | ||
message, | ||
severity | ||
})); | ||
} | ||
|
||
verbose(message: string, context?: unknown) { | ||
this.log(message, 'verbose', context); | ||
} | ||
|
||
info(message: string, context?: unknown) { | ||
this.log(message, 'info', context); | ||
} | ||
|
||
warn(message: string, context?: unknown) { | ||
this.log(message, 'warn', context); | ||
} | ||
|
||
error(message: string, context?: unknown) { | ||
this.log(message, 'error', context); | ||
} | ||
|
||
critical(message: string, context?: unknown) { | ||
this.log(message, 'critical', context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone'; | ||
|
||
setupZoneTestEnv({ | ||
errorOnUnknownElements: true, | ||
errorOnUnknownProperties: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2022", | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"noImplicitOverride": true, | ||
"noPropertyAccessFromIndexSignature": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
], | ||
"extends": "../../../tsconfig.base.json", | ||
"angularCompilerOptions": { | ||
"enableI18nLegacyMessageIdFormat": false, | ||
"strictInjectionParameters": true, | ||
"strictInputAccessModifiers": true, | ||
"strictTemplates": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../../dist/out-tsc", | ||
"declaration": true, | ||
"declarationMap": true, | ||
"inlineSources": true, | ||
"types": [] | ||
}, | ||
"exclude": [ | ||
"src/**/*.spec.ts", | ||
"src/test-setup.ts", | ||
"jest.config.ts", | ||
"src/**/*.test.ts" | ||
], | ||
"include": ["src/**/*.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../../dist/out-tsc", | ||
"module": "commonjs", | ||
"target": "es2016", | ||
"types": ["jest", "node"] | ||
}, | ||
"files": ["src/test-setup.ts"], | ||
"include": [ | ||
"jest.config.ts", | ||
"src/**/*.test.ts", | ||
"src/**/*.spec.ts", | ||
"src/**/*.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import { createAction, props } from '@ngrx/store'; | ||
import { LogLine } from '@service-bus-browser/logs-contracts'; | ||
import { LogLineSeverity } from '@service-bus-browser/logs-contracts'; | ||
|
||
export const writeLog = createAction( | ||
'[Logs] Write a log line', | ||
props<{ log: LogLine }>() | ||
props<{ | ||
severity: LogLineSeverity; | ||
message: string; | ||
context?: unknown; | ||
}>() | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.