-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
274 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: '@narval/nestjs-shared CI' | ||
|
||
on: | ||
push: | ||
paths: | ||
- packages/nestjs-shared/** | ||
- .github/workflows/nestjs-shared.yml | ||
- jest.config.ts | ||
- jest.preset.js | ||
- .eslintrc.json | ||
- .prettierrc | ||
- package.json | ||
- package-lock.json | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build and test | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.4.0' | ||
|
||
- name: Install dependencies | ||
run: | | ||
make install/ci | ||
- name: Code format | ||
shell: bash | ||
run: | | ||
make nestjs-shared/format/check | ||
make nestjs-shared/lint/check | ||
- name: Test types | ||
shell: bash | ||
run: | | ||
make nestjs-shared/test/type | ||
- name: Test upstream application types | ||
shell: bash | ||
run: | | ||
make policy-engine/test/type | ||
make armory/test/type | ||
- name: Test unit | ||
shell: bash | ||
run: | | ||
make nestjs-shared/test/unit | ||
- name: Send Slack notification on failure | ||
if: failure() && github.ref == 'refs/heads/main' | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
username: GitHub | ||
author_name: '@narval/nestjs-shared CI failed' | ||
status: ${{ job.status }} | ||
fields: message,commit,author | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |
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
3 changes: 2 additions & 1 deletion
3
apps/armory/src/orchestration/http/rest/dto/transaction-request.dto.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
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
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,18 @@ | ||
{ | ||
"extends": ["../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"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,29 @@ | ||
NESTJS_SHARED_PROJECT_NAME := nestjs-shared | ||
NESTJS_SHARED_PROJECT_DIR := ./packages/nestjs-shared | ||
|
||
# == Code format == | ||
|
||
nestjs-shared/format: | ||
npx nx format:write --projects ${NESTJS_SHARED_PROJECT_NAME} | ||
|
||
nestjs-shared/lint: | ||
npx nx lint ${NESTJS_SHARED_PROJECT_NAME} -- --fix | ||
|
||
nestjs-shared/format/check: | ||
npx nx format:check --projects ${NESTJS_SHARED_PROJECT_NAME} | ||
|
||
nestjs-shared/lint/check: | ||
npx nx lint ${NESTJS_SHARED_PROJECT_NAME} | ||
|
||
# == Testing == | ||
|
||
nestjs-shared/test/type: | ||
npx tsc \ | ||
--project ${NESTJS_SHARED_PROJECT_DIR}/tsconfig.lib.json \ | ||
--noEmit | ||
|
||
nestjs-shared/test/unit: | ||
npx nx test:unit ${NESTJS_SHARED_PROJECT_NAME} -- ${ARGS} | ||
|
||
nestjs-shared/test/unit/watch: | ||
make nestjs-shared/test/unit ARGS=--watch |
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 @@ | ||
# NestJS Shared | ||
|
||
This library contains the shared nestjs utilities such as validators, DTOs and decorators. | ||
|
||
## Testing | ||
|
||
```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 | ||
``` |
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,18 @@ | ||
import type { Config } from 'jest' | ||
|
||
const config: Config = { | ||
displayName: 'nestjs-shared', | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], | ||
preset: '../../jest.preset.js', | ||
testEnvironment: 'node', | ||
transform: { | ||
'^.+\\.[tj]sx?$': [ | ||
'ts-jest', | ||
{ | ||
tsconfig: '<rootDir>/tsconfig.spec.json' | ||
} | ||
] | ||
} | ||
} | ||
|
||
export default config |
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,9 @@ | ||
import type { Config } from 'jest' | ||
import sharedConfig from './jest.config' | ||
|
||
const config: Config = { | ||
...sharedConfig, | ||
testMatch: ['<rootDir>/**/__test__/unit/**/*.spec.ts'] | ||
} | ||
|
||
export default config |
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,24 @@ | ||
{ | ||
"name": "nestjs-shared", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "packages/nestjs-shared/src", | ||
"projectType": "library", | ||
"targets": { | ||
"lint": { | ||
"executor": "@nx/eslint:lint", | ||
"outputs": ["{options.outputFile}"], | ||
"options": { | ||
"lintFilePatterns": ["packages/nestjs-shared/**/*.ts"] | ||
} | ||
}, | ||
"test:unit": { | ||
"executor": "@nx/jest:jest", | ||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], | ||
"options": { | ||
"jestConfig": "packages/nestjs-shared/jest.unit.ts", | ||
"verbose": true | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
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,2 @@ | ||
export * from './lib/decorators' | ||
export * from './lib/dto' |
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,5 @@ | ||
export * from './is-account-id.decorator' | ||
export * from './is-asset-id.decorator' | ||
export * from './is-hex-string.decorator' | ||
export * from './is-not-empty-array-enum.decorator' | ||
export * from './is-not-empty-array-string.decorator' |
2 changes: 1 addition & 1 deletion
2
...lib/decorators/is-account-id.decorator.ts → ...lib/decorators/is-account-id.decorator.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
2 changes: 1 addition & 1 deletion
2
...c/lib/decorators/is-asset-id.decorator.ts → ...c/lib/decorators/is-asset-id.decorator.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
2 changes: 1 addition & 1 deletion
2
...lib/decorators/is-hex-string.decorator.ts → ...lib/decorators/is-hex-string.decorator.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ine-shared/src/lib/dto/base-action.dto.ts → ...tjs-shared/src/lib/dto/base-action.dto.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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../lib/dto/sign-message-request-data-dto.ts → .../lib/dto/sign-message-request-data-dto.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
3 changes: 1 addition & 2 deletions
3
.../dto/sign-transaction-request-data.dto.ts → .../dto/sign-transaction-request-data.dto.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
File renamed without changes.
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.base.json", | ||
"compilerOptions": { | ||
"module": "commonjs" | ||
}, | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
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,11 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"outDir": "../../dist/out-tsc", | ||
"declaration": true, | ||
"types": ["node"] | ||
}, | ||
"exclude": ["jest.config.ts", "src/**/*.spec.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,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/out-tsc", | ||
"module": "commonjs", | ||
"types": ["jest", "node"] | ||
}, | ||
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] | ||
} |
Oops, something went wrong.