Skip to content

Commit 213c9ee

Browse files
committed
feat: finish lib setup
1 parent f1f5084 commit 213c9ee

24 files changed

+13494
-1
lines changed

.github/workflows/pipeline.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: pipe
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types:
8+
- opened
9+
- synchronize
10+
11+
concurrency:
12+
group: ${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
pipe:
17+
uses: platform-mesh/.github/.github/workflows/pipeline-node-module.yml@main
18+
secrets: inherit

.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# compiled output
2+
/dist
3+
/node_modules
4+
/build
5+
/test-run-reports
6+
7+
# Logs
8+
logs
9+
*.log
10+
npm-debug.log*
11+
pnpm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
lerna-debug.log*
15+
16+
# OS
17+
.DS_Store
18+
19+
# Tests
20+
/coverage
21+
/.nyc_output
22+
23+
# IDEs and editors
24+
/.idea
25+
.project
26+
.classpath
27+
.c9/
28+
*.launch
29+
.settings/
30+
*.sublime-workspace
31+
32+
# IDE - VSCode
33+
.vscode/*
34+
!.vscode/settings.json
35+
!.vscode/tasks.json
36+
!.vscode/launch.json
37+
!.vscode/extensions.json
38+
39+
# dotenv environment variable files
40+
.env
41+
.env.development.local
42+
.env.test.local
43+
.env.production.local
44+
.env.local
45+
46+
# temp directory
47+
.temp
48+
.tmp
49+
50+
# Runtime data
51+
pids
52+
*.pid
53+
*.seed
54+
*.pid.lock
55+
56+
# Diagnostic reports (https://nodejs.org/api/report.html)
57+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@openmfp:registry=https://npm.pkg.github.com
2+
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}

.prettierrc.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import openMfpConfig from '@openmfp/config-prettier';
2+
3+
export default {
4+
...openMfpConfig,
5+
importOrderParserPlugins: ['typescript', 'decorators-legacy'],
6+
};

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
# portal-server-lib
1+
# Portal Server Library
2+
3+
This library helps you to setup BE application using @openmfp/portal-server-lib by providing set of required implmentation in scope of the Platform Mesh functionalities.
4+
5+
![Build Status](https://github.com/platform-mesh/portal-server-lib/actions/workflows/pipeline.yaml/badge.svg)
6+
7+
## Project setup
8+
9+
```bash
10+
$ npm install
11+
```
12+
13+
## Build
14+
15+
```bash
16+
$ npm run build
17+
```
18+
19+
## Running unit tests
20+
Run `npm run test` to execute the unit tests via Jest

base.jest.config.cjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
testEnvironment: 'node',
3+
coverageReporters: ['text', 'cobertura', 'lcov'],
4+
transform: {
5+
'^.+\\.(t|j)s$': [
6+
'ts-jest',
7+
{
8+
tsconfig: 'tsconfig.test.json',
9+
},
10+
],
11+
},
12+
moduleNameMapper: {
13+
'^(\\.{1,2}/.*)\\.js$': '$1',
14+
},
15+
};

eslint.config.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// @ts-check
2+
import tsPlugin from 'typescript-eslint';
3+
4+
export default tsPlugin.config(
5+
...tsPlugin.configs.recommended,
6+
{
7+
ignores: ['dist'],
8+
},
9+
{
10+
languageOptions: {
11+
parserOptions: {
12+
projectService: true,
13+
tsconfigRootDir: import.meta.dirname,
14+
},
15+
},
16+
},
17+
{
18+
files: ['**/*.ts'],
19+
rules: {
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
},
22+
},
23+
{
24+
files: ['**/*.{js,mjs,cjs}'],
25+
extends: [tsPlugin.configs.disableTypeChecked],
26+
},
27+
);

jest.config.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* eslint-disable @typescript-eslint/no-require-imports */
2+
const baseConfig = require('./base.jest.config.cjs');
3+
4+
module.exports = {
5+
...baseConfig,
6+
rootDir: 'src',
7+
testRegex: '.spec.ts$',
8+
collectCoverage: true,
9+
reporters: ['default'],
10+
coverageThreshold: {
11+
global: {
12+
branches: 78,
13+
functions: 80,
14+
lines: 95,
15+
statements: -10,
16+
},
17+
},
18+
coveragePathIgnorePatterns: ['/node_modules/', '/integration-tests/'],
19+
coverageDirectory: '../test-run-reports/coverage/unit',
20+
transformIgnorePatterns: ['node_modules/(?!@openmfp/portal-server-lib/)'],
21+
};

nest-cli.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "library",
3+
"root": ".",
4+
"collection": "@nestjs/schematics",
5+
"sourceRoot": "src"
6+
}

0 commit comments

Comments
 (0)