Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed Mar 26, 2024
1 parent 2fab72d commit 86cfddd
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 22 deletions.
21 changes: 17 additions & 4 deletions packages/nestjs-shared/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# nestjs-shared
# NestJS Shared

This library was generated with [Nx](https://nx.dev).
This library contains the shared nestjs utilities such as validators, DTOs and decorators.

## Running unit tests
## Testing

Run `nx test nestjs-shared` to execute the unit tests via [Jest](https://jestjs.io).
```bash
make nestjs-shared/test/unit
make nestjs-shared/test/unit/watch
```

## Formatting

```bash
make nestjs-shared/format
make nestjs-shared/lint

make nestjs-shared/format/check
make nestjs-shared/lint/check
```
19 changes: 13 additions & 6 deletions packages/nestjs-shared/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
/* eslint-disable */
export default {
import type { Config } from 'jest'

const config: Config = {
displayName: 'nestjs-shared',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
preset: '../../jest.preset.js',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }]
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/packages/nestjs-shared'
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json'
}
]
}
}

export default config
9 changes: 9 additions & 0 deletions packages/nestjs-shared/jest.unit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Config } from 'jest'
import sharedConfig from './jest.config'

const config: Config = {
...sharedConfig,
testMatch: ['<rootDir>/**/__test__/unit/**/*.spec.ts']
}

export default config
4 changes: 2 additions & 2 deletions packages/nestjs-shared/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/policy-engine-shared/**/*.ts"]
"lintFilePatterns": ["packages/nestjs-shared/**/*.ts"]
}
},
"test:unit": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/policy-engine-shared/jest.unit.ts",
"jestConfig": "packages/nestjs-shared/jest.unit.ts",
"verbose": true
}
}
Expand Down
20 changes: 10 additions & 10 deletions packages/policy-engine-shared/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# AuthZ Shared
# Policy Engine Shared

This library contains the shared kernel like types and utility functions of the
AuthZ application.
Policy Engine application.

## Testing

```bash
make authz-shared/test/unit
make authz-shared/test/unit/watch
make policy-engine-shared/test/unit
make policy-engine-shared/test/unit/watch
```

## Formatting

```bash
make authz-shared/format
make authz-shared/lint
make policy-engine-shared/format
make policy-engine-shared/lint

make authz-shared/format/check
make authz-shared/lint/check
make policy-engine-shared/format/check
make policy-engine-shared/lint/check
```

## Account & Asset ID API (CAIP-10/19)

You can find a CAIP-10/19 implementation to what concerns Narval domain at
[caip.util.ts](packages/authz-shared/src/lib/util/caip.util.ts).
[caip.util.ts](packages/policy-engine-shared/src/lib/util/caip.util.ts).

> For more complete examples, please check
> [caip.util.spec.ts](packages/authz-shared/src/lib/util/__test__/unit/caip.util.spec.ts).
> [caip.util.spec.ts](packages/policy-engine-shared/src/lib/util/__test__/unit/caip.util.spec.ts).
API for [CAIP-10 Account ID
Specification](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-10.md).
Expand Down

0 comments on commit 86cfddd

Please sign in to comment.