├── .dockerignore ├── .editorconfig ├── .eslintrc.js ├── .github └── workflows │ └── nodejs.yml ├── .gitignore ├── .nvmrc ├── .prettierrc ├── Dockerfile ├── Makefile ├── README.md ├── cucumber.js ├── jest.config.js ├── package-lock.json ├── package.json ├── src ├── Contexts │ └── Mooc │ │ └── Courses │ │ ├── application │ │ └── CourseCreator.ts │ │ └── domain │ │ ├── Course.ts │ │ └── CourseRepository.ts └── apps │ └── mooc │ └── backend │ ├── MoocBackendApp.ts │ ├── controllers │ ├── Controller.ts │ ├── CoursePutController.ts │ └── StatusGetController.ts │ ├── dependency-injection │ ├── application.yaml │ ├── application_dev.yaml │ ├── application_production.yaml │ ├── application_test.yaml │ ├── apps │ │ └── application.yaml │ └── index.ts │ ├── routes │ ├── courses.route.ts │ ├── index.ts │ └── status.route.ts │ ├── server.ts │ └── start.ts ├── tests ├── Contexts │ └── Mooc │ │ └── Courses │ │ ├── __mocks__ │ │ └── CourseRepositoryMock.ts │ │ └── application │ │ └── CourseCreator.test.ts └── apps │ ├── mooc │ └── backend │ │ └── features │ │ ├── courses │ │ └── create-course.feature │ │ ├── status.feature │ │ └── step_definitions │ │ └── controller.steps.ts │ └── tsconfig.json ├── tsconfig.json └── tsconfig.prod.json /.dockerignore: -------------------------------------------------------------------------------- 1 | .dockerignore 2 | .git 3 | docker-compose.yml 4 | Dockerfile 5 | node_modules 6 | dist 7 | data 8 | logs 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | indent_style = space 10 | indent_size = 2 11 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['eslint-config-codely/typescript'], 3 | rules: { 4 | 'no-console': 'warn' 5 | }, 6 | overrides: [ 7 | { 8 | files: ['*.ts', '*.tsx'], 9 | parserOptions: { 10 | project: ['./tsconfig.json'] 11 | }, 12 | rules: { 13 | '@typescript-eslint/no-floating-promises': 'warn' 14 | } 15 | } 16 | ] 17 | }; 18 | -------------------------------------------------------------------------------- /.github/workflows/nodejs.yml: -------------------------------------------------------------------------------- 1 | name: Node CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | strategy: 10 | matrix: 11 | node-version: [14.x, 15.x] 12 | steps: 13 | - uses: actions/checkout@v1 14 | - name: Use Node.js ${{ matrix.node-version }} 15 | uses: actions/setup-node@v1 16 | with: 17 | node-version: ${{ matrix.node-version }} 18 | - name: npm install 19 | run: | 20 | npm install 21 | - name: npm run lint 22 | run: | 23 | npm run lint 24 | - name: npm run build 25 | run: | 26 | npm run build --if-present 27 | - name: npm test 28 | run: | 29 | npm test 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | .tmp 4 | logs/ 5 | data 6 | test-results.xml 7 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v14.18.0 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "tabWidth": 2, 4 | "singleQuote": true, 5 | "trailingComma": "none", 6 | "semicolons": true, 7 | "quoteProps": "as-needed", 8 | "arrowParens": "avoid" 9 | } 10 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:14-slim 2 | 3 | WORKDIR /code 4 | 5 | COPY package.json package-lock.json ./ 6 | RUN npm install 7 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY = default deps build test start-mooc-backend clean start-database start-backoffice-frontend 2 | 3 | # Shell to use for running scripts 4 | SHELL := $(shell which bash) 5 | IMAGE_NAME := codelytv/typescript-ddd-skeleton 6 | SERVICE_NAME := app 7 | MOOC_APP_NAME := mooc 8 | BACKOFFICE_APP_NAME := backoffice 9 | 10 | # Test if the dependencies we need to run this Makefile are installed 11 | DOCKER := $(shell command -v docker) 12 | DOCKER_COMPOSE := $(shell command -v docker-compose) 13 | deps: 14 | ifndef DOCKER 15 | @echo "Docker is not available. Please install docker" 16 | @exit 1 17 | endif 18 | ifndef DOCKER_COMPOSE 19 | @echo "docker-compose is not available. Please install docker-compose" 20 | @exit 1 21 | endif 22 | 23 | default: build 24 | 25 | # Build image 26 | build: 27 | docker build -t $(IMAGE_NAME):dev . 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TypeScript basic skeleton 2 | 3 | For now, you have all the code example available in this other repository: https://github.com/CodelyTV/typescript-ddd-example 4 | 5 | The idea is that we'll move the basic parts (folder structure and bare minimum code to serve as skeleton) to this repository (`typescript-ddd-skeleton`) once we completely finish the `typescript-ddd-example` code. Current progress: ~95% 6 | -------------------------------------------------------------------------------- /cucumber.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable camelcase */ 2 | const common = [ 3 | '--require-module ts-node/register' // Load TypeScript module 4 | ]; 5 | 6 | const mooc_backend = [ 7 | ...common, 8 | 'tests/apps/mooc/backend/features/**/*.feature', 9 | '--require tests/apps/mooc/backend/features/step_definitions/*.steps.ts' 10 | ].join(' '); 11 | 12 | module.exports = { 13 | mooc_backend 14 | }; 15 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'node', 4 | cacheDirectory: '.tmp/jestCache' 5 | }; 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-ddd-skeleton", 3 | "version": "1.0.0", 4 | "description": "", 5 | "repository": { 6 | "url": "https://github.com/CodelyTV/typescript-ddd-skeleton" 7 | }, 8 | "license": "", 9 | "engines": { 10 | "node": ">=14.0.0", 11 | "npm": ">=6.14.0" 12 | }, 13 | "scripts": { 14 | "dev:mooc:backend": "NODE_ENV=dev ts-node-dev --ignore-watch node_modules ./src/apps/mooc/backend/start.ts", 15 | "lint": "eslint --ignore-path .gitignore .", 16 | "lint:fix": "npm run lint -- --fix", 17 | "test": "npm run test:unit && npm run test:features", 18 | "test:unit": "NODE_ENV=test jest", 19 | "start:mooc:backend": "NODE_ENV=production node dist/src/apps/mooc/backend/start", 20 | "test:features": "npm run test:mooc:backend:features", 21 | "test:mooc:backend:features": "NODE_ENV=test cucumber-js -p mooc_backend", 22 | "build": "npm run build:clean && npm run build:tsc && npm run build:di", 23 | "build:tsc": "tsc -p tsconfig.prod.json", 24 | "build:di": "copy 'src/**/*.{json,yaml,html,png}' dist/src", 25 | "build:clean": "rm -r dist; exit 0" 26 | }, 27 | "dependencies": { 28 | "body-parser": "^1.19.0", 29 | "bodybuilder": "^2.4.0", 30 | "bson": "^4.5.2", 31 | "compression": "^1.7.4", 32 | "connect-flash": "^0.1.1", 33 | "cookie-parser": "^1.4.5", 34 | "cookie-session": "^1.4.0", 35 | "copy": "^0.3.2", 36 | "errorhandler": "^1.5.1", 37 | "express": "^4.17.1", 38 | "express-promise-router": "^4.1.0", 39 | "express-validator": "^6.12.2", 40 | "glob": "^7.2.0", 41 | "helmet": "^4.6.0", 42 | "http-status": "^1.5.0", 43 | "node-dependency-injection": "^2.7.1", 44 | "nunjucks": "^3.2.3", 45 | "ts-node": "^10.2.1", 46 | "typescript": "^4.4.3", 47 | "winston": "^3.3.3" 48 | }, 49 | "devDependencies": { 50 | "@types/bson": "^4.0.5", 51 | "@types/compression": "^1.7.2", 52 | "@types/connect-flash": "0.0.37", 53 | "@types/cookie-parser": "^1.4.2", 54 | "@types/cookie-session": "^2.0.43", 55 | "@types/cucumber": "^6.0.1", 56 | "@types/errorhandler": "1.5.0", 57 | "@types/express": "^4.17.13", 58 | "@types/faker": "^5.5.8", 59 | "@types/glob": "^7.1.4", 60 | "@types/helmet": "0.0.48", 61 | "@types/jest": "^27.0.2", 62 | "@types/node": "^16.10.2", 63 | "@types/nunjucks": "^3.2.0", 64 | "@types/supertest": "^2.0.11", 65 | "cucumber": "^6.0.5", 66 | "eslint": "^8.33.0", 67 | "eslint-config-codely": "^2.1.3", 68 | "faker": "^5.5.3", 69 | "husky": "^7.0.2", 70 | "jest": "^27.2.4", 71 | "lint-staged": "11.2.0", 72 | "prettier": "^2.4.1", 73 | "supertest": "^6.1.6", 74 | "ts-jest": "^27.0.5", 75 | "ts-node-dev": "^1.1.8" 76 | }, 77 | "husky": { 78 | "hooks": { 79 | "pre-commit": "lint-staged" 80 | } 81 | }, 82 | "lint-staged": { 83 | "{src,tests}/**/*.ts": [ 84 | "npm run lint:fix", 85 | "git add" 86 | ] 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/Contexts/Mooc/Courses/application/CourseCreator.ts: -------------------------------------------------------------------------------- 1 | import { Course } from '../domain/Course'; 2 | import { CourseRepository } from '../domain/CourseRepository'; 3 | 4 | export class CourseCreator { 5 | private readonly repository: CourseRepository; 6 | 7 | constructor(repository: CourseRepository) { 8 | this.repository = repository; 9 | } 10 | 11 | async run(id: string, name: string, duration: string): Promise { 12 | const course = new Course({ id, name, duration }); 13 | 14 | return this.repository.save(course); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Contexts/Mooc/Courses/domain/Course.ts: -------------------------------------------------------------------------------- 1 | export class Course { 2 | readonly id: string; 3 | readonly name: string; 4 | readonly duration: string; 5 | 6 | constructor({ id, name, duration }: { id: string; name: string; duration: string }) { 7 | this.id = id; 8 | this.name = name; 9 | this.duration = duration; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Contexts/Mooc/Courses/domain/CourseRepository.ts: -------------------------------------------------------------------------------- 1 | import { Course } from './Course'; 2 | 3 | export interface CourseRepository { 4 | save(course: Course): Promise; 5 | } 6 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/MoocBackendApp.ts: -------------------------------------------------------------------------------- 1 | import { Server } from './server'; 2 | 3 | export class MoocBackendApp { 4 | server?: Server; 5 | 6 | async start(): Promise { 7 | const port = process.env.PORT ?? '5000'; 8 | this.server = new Server(port); 9 | 10 | return this.server.listen(); 11 | } 12 | 13 | get httpServer(): Server['httpServer'] | undefined { 14 | return this.server?.getHTTPServer(); 15 | } 16 | 17 | async stop(): Promise { 18 | return this.server?.stop(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/controllers/Controller.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response } from 'express'; 2 | 3 | export interface Controller { 4 | run(req: Request, res: Response): Promise | void; 5 | } 6 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/controllers/CoursePutController.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response } from 'express'; 2 | import httpStatus from 'http-status'; 3 | 4 | import { Controller } from './Controller'; 5 | 6 | export class CoursePutController implements Controller { 7 | run(req: Request, res: Response): void { 8 | res.status(httpStatus.CREATED).send(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/controllers/StatusGetController.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response } from 'express'; 2 | import httpStatus from 'http-status'; 3 | 4 | import { Controller } from './Controller'; 5 | 6 | export default class StatusGetController implements Controller { 7 | run(req: Request, res: Response): void { 8 | res.status(httpStatus.OK).send(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/dependency-injection/application.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: ./apps/application.yaml } 3 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/dependency-injection/application_dev.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: ./application.yaml } 3 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/dependency-injection/application_production.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: ./application.yaml } 3 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/dependency-injection/application_test.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: ./application.yaml } 3 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/dependency-injection/apps/application.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | 3 | Apps.mooc.controllers.StatusGetController: 4 | class: ../../controllers/StatusGetController 5 | arguments: [] 6 | 7 | Apps.mooc.controllers.CoursePutController: 8 | class: ../../controllers/CoursePutController 9 | arguments: [""] 10 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/dependency-injection/index.ts: -------------------------------------------------------------------------------- 1 | import { ContainerBuilder, YamlFileLoader } from 'node-dependency-injection'; 2 | 3 | const container = new ContainerBuilder(); 4 | const loader = new YamlFileLoader(container); 5 | const env = process.env.NODE_ENV ?? 'dev'; 6 | 7 | loader.load(`${__dirname}/application_${env}.yaml`); 8 | 9 | export default container; 10 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/routes/courses.route.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response, Router } from 'express'; 2 | 3 | import { CoursePutController } from '../controllers/CoursePutController'; 4 | import container from '../dependency-injection'; 5 | 6 | export const register = (router: Router): void => { 7 | const coursePutController = container.get( 8 | 'Apps.mooc.controllers.CoursePutController' 9 | ); 10 | router.put('/courses/:id', (req: Request, res: Response) => coursePutController.run(req, res)); 11 | }; 12 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/routes/index.ts: -------------------------------------------------------------------------------- 1 | import { Router } from 'express'; 2 | import glob from 'glob'; 3 | 4 | export function registerRoutes(router: Router): void { 5 | const routes = glob.sync(`${__dirname}/**/*.route.*`); 6 | routes.map(route => register(route, router)); 7 | } 8 | 9 | function register(routePath: string, router: Router) { 10 | // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires 11 | const { register } = require(routePath) as { register: (router: Router) => void }; 12 | register(router); 13 | } 14 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/routes/status.route.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response, Router } from 'express'; 2 | 3 | import StatusController from '../controllers/StatusGetController'; 4 | import container from '../dependency-injection'; 5 | 6 | export const register = (router: Router): void => { 7 | const controller = container.get('Apps.mooc.controllers.StatusGetController'); 8 | router.get('/status', (req: Request, res: Response) => { 9 | controller.run(req, res); 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/server.ts: -------------------------------------------------------------------------------- 1 | import { json, urlencoded } from 'body-parser'; 2 | import compress from 'compression'; 3 | import errorHandler from 'errorhandler'; 4 | import express, { Request, Response } from 'express'; 5 | import Router from 'express-promise-router'; 6 | import helmet from 'helmet'; 7 | import * as http from 'http'; 8 | import httpStatus from 'http-status'; 9 | 10 | import { registerRoutes } from './routes'; 11 | 12 | export class Server { 13 | private readonly express: express.Express; 14 | private readonly port: string; 15 | private httpServer?: http.Server; 16 | 17 | constructor(port: string) { 18 | this.port = port; 19 | this.express = express(); 20 | this.express.use(json()); 21 | this.express.use(urlencoded({ extended: true })); 22 | this.express.use(helmet.xssFilter()); 23 | this.express.use(helmet.noSniff()); 24 | this.express.use(helmet.hidePoweredBy()); 25 | this.express.use(helmet.frameguard({ action: 'deny' })); 26 | this.express.use(compress()); 27 | const router = Router(); 28 | router.use(errorHandler()); 29 | this.express.use(router); 30 | 31 | registerRoutes(router); 32 | 33 | router.use((err: Error, req: Request, res: Response, _next: () => void) => { 34 | console.log(err); 35 | res.status(httpStatus.INTERNAL_SERVER_ERROR).send(err.message); 36 | }); 37 | } 38 | 39 | async listen(): Promise { 40 | return new Promise(resolve => { 41 | const env = this.express.get('env') as string; 42 | this.httpServer = this.express.listen(this.port, () => { 43 | console.log( 44 | ` Mock Backend App is running at http://localhost:${this.port} in ${env} mode` 45 | ); 46 | console.log(' Press CTRL-C to stop\n'); 47 | resolve(); 48 | }); 49 | }); 50 | } 51 | 52 | getHTTPServer(): Server['httpServer'] { 53 | return this.httpServer; 54 | } 55 | 56 | async stop(): Promise { 57 | return new Promise((resolve, reject) => { 58 | if (this.httpServer) { 59 | this.httpServer.close(error => { 60 | if (error) { 61 | reject(error); 62 | 63 | return; 64 | } 65 | 66 | resolve(); 67 | }); 68 | } 69 | 70 | resolve(); 71 | }); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/apps/mooc/backend/start.ts: -------------------------------------------------------------------------------- 1 | import { MoocBackendApp } from './MoocBackendApp'; 2 | 3 | try { 4 | new MoocBackendApp().start(); 5 | } catch (e) { 6 | console.log(e); 7 | process.exit(1); 8 | } 9 | 10 | process.on('uncaughtException', err => { 11 | console.log('uncaughtException', err); 12 | process.exit(1); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/Contexts/Mooc/Courses/__mocks__/CourseRepositoryMock.ts: -------------------------------------------------------------------------------- 1 | import { Course } from '../../../../../src/Contexts/Mooc/Courses/domain/Course'; 2 | import { CourseRepository } from '../../../../../src/Contexts/Mooc/Courses/domain/CourseRepository'; 3 | 4 | export class CourseRepositoryMock implements CourseRepository { 5 | private readonly mockSave = jest.fn(); 6 | 7 | async save(course: Course): Promise { 8 | await this.mockSave(course); 9 | } 10 | 11 | assertLastSavedCourseIs(expected: Course): void { 12 | const mock = this.mockSave.mock; 13 | const lastSavedCourse = (mock.calls[mock.calls.length - 1] as Course[])[0]; 14 | expect(lastSavedCourse).toBeInstanceOf(Course); 15 | expect(lastSavedCourse.id).toEqual(expected.id); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/Contexts/Mooc/Courses/application/CourseCreator.test.ts: -------------------------------------------------------------------------------- 1 | import { CourseCreator } from '../../../../../src/Contexts/Mooc/Courses/application/CourseCreator'; 2 | import { Course } from '../../../../../src/Contexts/Mooc/Courses/domain/Course'; 3 | import { CourseRepositoryMock } from '../__mocks__/CourseRepositoryMock'; 4 | 5 | let repository: CourseRepositoryMock; 6 | let creator: CourseCreator; 7 | 8 | beforeEach(() => { 9 | repository = new CourseRepositoryMock(); 10 | creator = new CourseCreator(repository); 11 | }); 12 | 13 | describe('CourseCreator', () => { 14 | it('should create a valid course', async () => { 15 | const id = 'some-id'; 16 | const name = 'some-name'; 17 | const duration = 'some-duration'; 18 | 19 | const course = new Course({ id, name, duration }); 20 | 21 | await creator.run(id, name, duration); 22 | 23 | repository.assertLastSavedCourseIs(course); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/apps/mooc/backend/features/courses/create-course.feature: -------------------------------------------------------------------------------- 1 | Feature: Create a new course 2 | In order to have courses in the platform 3 | As a user with admin permissions 4 | I want to create a new course 5 | 6 | Scenario: A valid non existing course 7 | Given I send a PUT request to "/courses/ef8ac118-8d7f-49cc-abec-78e0d05af80a" with body: 8 | """ 9 | { 10 | "name": "The best course", 11 | "duration": "5 hours" 12 | } 13 | """ 14 | Then the response status code should be 201 15 | And the response should be empty 16 | -------------------------------------------------------------------------------- /tests/apps/mooc/backend/features/status.feature: -------------------------------------------------------------------------------- 1 | Feature: Api status 2 | In order to know the server is up and running 3 | As a health check 4 | I want to check the api status 5 | 6 | Scenario: Check the api status 7 | Given I send a GET request to "/status" 8 | Then the response status code should be 200 9 | -------------------------------------------------------------------------------- /tests/apps/mooc/backend/features/step_definitions/controller.steps.ts: -------------------------------------------------------------------------------- 1 | import assert from 'assert'; 2 | import { AfterAll, BeforeAll, Given, Then } from 'cucumber'; 3 | import request from 'supertest'; 4 | 5 | import { MoocBackendApp } from '../../../../../../src/apps/mooc/backend/MoocBackendApp'; 6 | 7 | let _request: request.Test; 8 | let application: MoocBackendApp; 9 | let _response: request.Response; 10 | 11 | Given('I send a GET request to {string}', (route: string) => { 12 | _request = request(application.httpServer).get(route); 13 | }); 14 | 15 | Then('the response status code should be {int}', async (status: number) => { 16 | _response = await _request.expect(status); 17 | }); 18 | 19 | Given('I send a PUT request to {string} with body:', (route: string, body: string) => { 20 | _request = request(application.httpServer) 21 | .put(route) 22 | .send(JSON.parse(body) as object); 23 | }); 24 | 25 | Then('the response should be empty', () => { 26 | assert.deepStrictEqual(_response.body, {}); 27 | }); 28 | 29 | BeforeAll(() => { 30 | application = new MoocBackendApp(); 31 | application.start(); 32 | }); 33 | 34 | AfterAll(() => { 35 | application.stop(); 36 | }); 37 | -------------------------------------------------------------------------------- /tests/apps/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "lib": ["es2015", "dom"], 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "esModuleInterop": true, 5 | "target": "es6", 6 | "noImplicitAny": true, 7 | "moduleResolution": "node", 8 | "sourceMap": false, 9 | "rootDir": ".", 10 | "strict": true, 11 | "noEmit": false, 12 | "resolveJsonModule": true, 13 | "noUnusedLocals": true, 14 | "outDir": "./dist" 15 | }, 16 | "include": [ 17 | "src/**/**.ts", 18 | "tests/**/**.ts" 19 | ], 20 | "exclude": ["node_modules"] 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | }, 6 | "exclude": ["node_modules", "tests"] 7 | } 8 | --------------------------------------------------------------------------------