Skip to content

Commit

Permalink
chore: move dev tools
Browse files Browse the repository at this point in the history
  • Loading branch information
guiseek committed Sep 26, 2023
1 parent bb3174e commit bacffae
Show file tree
Hide file tree
Showing 67 changed files with 482 additions and 74 deletions.
4 changes: 3 additions & 1 deletion api/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import {Module} from '@nestjs/common'
import {ToolsResourceModule} from '@dev/tools-resource'
import {SharedResourceModule} from '@dev/shared-resource'
import {getAllEntities} from '@dev/shared-data-source'
import {Module} from '@nestjs/common'
import {env} from './envs/env'

@Module({
imports: [
SharedResourceModule.forRoot(env(getAllEntities())),
ToolsResourceModule.register(),
],
})
export class AppModule {}
4 changes: 2 additions & 2 deletions api/src/docs/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export const configSwagger = (
prefix = 'api'
) => {
const config = new DocumentBuilder()
.setTitle(`${name} API`)
.setDescription(`Helps devs use the ${name} API in their applications`)
.setTitle(`${name}`)
.setDescription(`${name} API docs`)
.setVersion('1.0')
.build()

Expand Down
2 changes: 1 addition & 1 deletion app/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {RouterTestingModule} from '@angular/router/testing'
import {LayoutModule} from '@angular/cdk/layout'
import {AppInterceptor} from './app.interceptor'
import {AppComponent} from './app.component'
import { SharedMaterial } from './shared'
import {SharedMaterial} from './shared'

describe('AppComponent', () => {
beforeEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export const appRoutes: Route[] = [
{
path: '',
loadChildren: () =>
import('@dev/dashboard-feature').then((m) => m.DashboardFeatureModule),
import('@dev/tools-feature').then((m) => m.ToolsFeatureModule),
},
]
2 changes: 1 addition & 1 deletion app/src/app/loader/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './loader.component';
export * from './loader.component'
2 changes: 1 addition & 1 deletion app/src/app/shared/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './material';
export * from './material'
7 changes: 0 additions & 7 deletions dashboard/resource/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions dashboard/resource/src/index.ts

This file was deleted.

18 changes: 0 additions & 18 deletions dashboard/resource/src/lib/dashboard-resource.controller.spec.ts

This file was deleted.

4 changes: 0 additions & 4 deletions dashboard/resource/src/lib/dashboard-resource.controller.ts

This file was deleted.

14 changes: 0 additions & 14 deletions dashboard/resource/src/lib/dashboard-resource.module.ts

This file was deleted.

25 changes: 25 additions & 0 deletions tools/domain/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
11 changes: 11 additions & 0 deletions tools/domain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# tools-domain

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build tools-domain` to build the library.

## Running unit tests

Run `nx test tools-domain` to execute the unit tests via [Jest](https://jestjs.io).
10 changes: 10 additions & 0 deletions tools/domain/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* eslint-disable */
export default {
displayName: 'tools-domain',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]s$': ['ts-jest', {tsconfig: '<rootDir>/tsconfig.spec.json'}],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/tools/domain',
}
10 changes: 10 additions & 0 deletions tools/domain/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@dev/tools-domain",
"version": "0.0.1",
"dependencies": {
"tslib": "^2.3.0"
},
"type": "commonjs",
"main": "./src/index.js",
"typings": "./src/index.d.ts"
}
43 changes: 43 additions & 0 deletions tools/domain/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "tools-domain",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "tools/domain/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/tools/domain",
"main": "tools/domain/src/index.ts",
"tsConfig": "tools/domain/tsconfig.lib.json",
"assets": ["tools/domain/*.md"]
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"tools/domain/**/*.ts",
"tools/domain/package.json"
]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "tools/domain/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"tags": ["", "type:domain", "scope:tools", "side:both"]
}
1 change: 1 addition & 0 deletions tools/domain/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './public-api'
3 changes: 3 additions & 0 deletions tools/domain/src/lib/dtos/create-domain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface CreateDomain {
name: string
}
2 changes: 2 additions & 0 deletions tools/domain/src/lib/dtos/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './create-domain'
export * from './update-domain'
5 changes: 5 additions & 0 deletions tools/domain/src/lib/dtos/update-domain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {CreateDomain} from './create-domain'

export interface UpdateDomain extends Partial<CreateDomain> {
id: string
}
6 changes: 6 additions & 0 deletions tools/domain/src/lib/entities/domain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface Domain {
id: string
name: string
createdAt: Date
updatedAt: Date
}
1 change: 1 addition & 0 deletions tools/domain/src/lib/entities/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './domain'
8 changes: 8 additions & 0 deletions tools/domain/src/lib/ports/domain.repository.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {CreateDomain, UpdateDomain} from '../dtos'
import {Repository} from '@dev/shared-util-data'
import {Domain} from '../entities'

export abstract class DomainRepository extends Repository<Domain> {
abstract override create(value: CreateDomain): Promise<Domain>
abstract override update(value: UpdateDomain): Promise<Domain>
}
9 changes: 9 additions & 0 deletions tools/domain/src/lib/ports/domain.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {CreateDomain, UpdateDomain} from '../dtos'
import {Service} from '@dev/shared-util-data'
import {Domain} from '../entities'
import {Observable} from 'rxjs'

export abstract class DomainService extends Service<Domain> {
abstract override create(value: CreateDomain): Observable<Domain>
abstract override update(value: UpdateDomain): Observable<Domain>
}
2 changes: 2 additions & 0 deletions tools/domain/src/lib/ports/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './domain.repository'
export * from './domain.service'
3 changes: 3 additions & 0 deletions tools/domain/src/public-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './lib/dtos'
export * from './lib/ports'
export * from './lib/entities'
16 changes: 16 additions & 0 deletions tools/domain/tsconfig.json
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"
}
]
}
10 changes: 10 additions & 0 deletions tools/domain/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
}
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions dashboard/feature/README.md → tools/feature/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# dashboard-feature
# tools-feature

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test dashboard-feature` to execute the unit tests.
Run `nx test tools-feature` to execute the unit tests.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable */
export default {
displayName: 'dashboard-feature',
displayName: 'tools-feature',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
coverageDirectory: '../../coverage/dashboard/feature',
coverageDirectory: '../../coverage/tools/feature',
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
Expand Down
11 changes: 4 additions & 7 deletions dashboard/feature/project.json → tools/feature/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dashboard-feature",
"name": "tools-feature",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "dashboard/feature/src",
"sourceRoot": "tools/feature/src",
"prefix": "dev",
"tags": ["type:feature", "scope:dashboard", "side:client"],
"projectType": "library",
Expand All @@ -10,7 +10,7 @@
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "dashboard/feature/jest.config.ts",
"jestConfig": "tools/feature/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
Expand All @@ -24,10 +24,7 @@
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"dashboard/feature/**/*.ts",
"dashboard/feature/**/*.html"
]
"lintFilePatterns": ["tools/feature/**/*.ts", "tools/feature/**/*.html"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './lib/dashboard-feature.module'
export * from './lib/tools-feature.module'
export * from './lib/dashboard-feature.routes'

export * from './lib/dashboard-feature.routes'
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ import {DashboardFeatureComponent} from './dashboard-feature.component'
],
declarations: [DashboardFeatureComponent],
})
export class DashboardFeatureModule {}
export class ToolsFeatureModule {}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tools/plugin/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
File renamed without changes.
7 changes: 7 additions & 0 deletions tools/resource/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# tools-resource

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test tools-resource` to execute the unit tests via [Jest](https://jestjs.io).
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable */
export default {
displayName: 'dashboard-resource',
displayName: 'tools-resource',
preset: '../../jest.preset.js',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': ['ts-jest', {tsconfig: '<rootDir>/tsconfig.spec.json'}],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/dashboard/resource',
coverageDirectory: '../../coverage/tools/resource',
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "dashboard-resource",
"name": "tools-resource",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "dashboard/resource/src",
"sourceRoot": "tools/resource/src",
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["dashboard/resource/**/*.ts"]
"lintFilePatterns": ["tools/resource/**/*.ts"]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "dashboard/resource/jest.config.ts",
"jestConfig": "tools/resource/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
Expand Down
2 changes: 2 additions & 0 deletions tools/resource/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './lib/tools-resource.controller'
export * from './lib/tools-resource.module'
Loading

0 comments on commit bacffae

Please sign in to comment.