├── .editorconfig ├── .eslintrc.js ├── .github └── workflows │ ├── ci-cd.yml │ ├── generate-tag.yml │ ├── manual-deployment-by-branch.yml │ └── manual-deployment-by-tag.yml ├── .gitignore ├── .husky └── pre-commit ├── .nvmrc ├── README.md ├── deploy-local.sh ├── docker-compose.yml ├── package.json ├── prisma └── schema.prisma ├── serverless.local.yml ├── serverless.yml ├── src ├── config │ └── update-deps.ts └── functions │ ├── fastify-server.ts │ └── index.ts ├── tsconfig.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_size = 2 5 | indent_style = space 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | end_of_line = lf 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | es2021: true, 4 | node: true, 5 | }, 6 | extends: [ 7 | 'plugin:jest/recommended', 8 | 'standard', 9 | ], 10 | parser: '@typescript-eslint/parser', 11 | parserOptions: { 12 | ecmaVersion: 12, 13 | sourceType: 'module', 14 | }, 15 | plugins: [ 16 | '@typescript-eslint', 17 | ], 18 | rules: { 19 | quotes: ['error', 'single', { allowTemplateLiterals: true }], 20 | indent: ['error', 2, { 21 | SwitchCase: 1, 22 | ignoredNodes: ['PropertyDefinition'], 23 | }], 24 | 'no-useless-constructor': 'off', 25 | 'comma-dangle': ['error', { 26 | arrays: 'always-multiline', 27 | objects: 'always-multiline', 28 | imports: 'always-multiline', 29 | exports: 'always-multiline', 30 | functions: 'always-multiline', 31 | }], 32 | camelcase: 'off', 33 | 'no-warning-comments': 'warn', 34 | 'react/react-in-jsx-scope': 'off', 35 | 'react/prop-types': 'off', 36 | 'no-unused-vars': 'off', 37 | '@typescript-eslint/no-explicit-any': 'off', 38 | '@typescript-eslint/no-unused-vars': [ 39 | 'off', { 40 | ignoreRestSiblings: true, 41 | argsIgnorePattern: '^_', 42 | }, 43 | ], 44 | }, 45 | } 46 | -------------------------------------------------------------------------------- /.github/workflows/ci-cd.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | pull_request: 4 | 5 | jobs: 6 | ci: 7 | name: Checkout and Install dependencies 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | 12 | - name: Cache node modules 13 | uses: actions/cache@v2 14 | env: 15 | cache-name: cache-node-modules 16 | with: 17 | path: ~/.npm 18 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} 19 | restore-keys: | 20 | ${{ runner.os }}-build-${{ env.cache-name }}- 21 | ${{ runner.os }}-build- 22 | ${{ runner.os }}- 23 | 24 | - name: Use Node.js ${{ matrix.node-version }} 25 | uses: actions/setup-node@v1 26 | with: 27 | node-version: 16.x 28 | 29 | - name: Install dependencies 30 | run: yarn 31 | 32 | - uses: actions/cache@v2 33 | id: restore-build 34 | with: 35 | path: ./* 36 | key: ${{ github.sha }} 37 | 38 | - name: Type Checking and Linting 39 | run: yarn check-lint-type 40 | 41 | - name: Test 42 | run: yarn test --ci 43 | -------------------------------------------------------------------------------- /.github/workflows/generate-tag.yml: -------------------------------------------------------------------------------- 1 | name: Generate tag version 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | version: 6 | description: New version 7 | required: true 8 | default: 'patch' 9 | type: choice 10 | options: 11 | - patch 12 | - minor 13 | - major 14 | 15 | jobs: 16 | version: 17 | name: Create new version ${{ github.event.inputs.version }} 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@v3 21 | with: 22 | ref: main 23 | - run: | 24 | git config user.name github-actions 25 | git config user.email github-actions@github.com 26 | 27 | - name: Use Node.js ${{ matrix.node-version }} 28 | uses: actions/setup-node@v1 29 | with: 30 | node-version: 16.x 31 | 32 | - name: Generate new version 33 | run: npm version ${{ github.event.inputs.version }} 34 | 35 | - name: Push new version tag to repository 36 | run: git push origin main --tags 37 | -------------------------------------------------------------------------------- /.github/workflows/manual-deployment-by-branch.yml: -------------------------------------------------------------------------------- 1 | name: Manual Deployment by Branch 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | branch: 6 | description: Branch to deploy 7 | required: true 8 | env: 9 | description: Environment to deploy 10 | required: true 11 | default: 'dev' 12 | type: choice 13 | options: 14 | - dev 15 | - qa 16 | - prod 17 | 18 | jobs: 19 | deploy: 20 | name: Deploy branch ${{ github.event.inputs.branch }} to ${{ github.event.inputs.env }} env 21 | runs-on: ubuntu-latest 22 | steps: 23 | - uses: actions/checkout@v3 24 | with: 25 | ref: ${{ github.event.inputs.branch }} 26 | - name: Use Node.js ${{ matrix.node-version }} 27 | uses: actions/setup-node@v1 28 | with: 29 | node-version: 16.x 30 | - run: yarn 31 | 32 | - name: Type Checking and Linting 33 | run: yarn check-lint-type 34 | 35 | - name: Run Tests 36 | run: yarn test --ci 37 | 38 | - name: Deploy to ${{ github.event.inputs.env }} environment 39 | run: yarn deploy --stage ${{ github.event.inputs.env }} 40 | env: 41 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 42 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 43 | -------------------------------------------------------------------------------- /.github/workflows/manual-deployment-by-tag.yml: -------------------------------------------------------------------------------- 1 | name: Manual Deployment by Tag 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | tag: 6 | description: Tag version 7 | required: true 8 | env: 9 | description: Environment to deploy 10 | required: true 11 | default: 'dev' 12 | type: choice 13 | options: 14 | - dev 15 | - qa 16 | - prod 17 | 18 | jobs: 19 | deploy: 20 | name: Deploy tag ${{ github.event.inputs.tag }} to ${{ github.event.inputs.env }} env 21 | runs-on: ubuntu-latest 22 | steps: 23 | - uses: actions/checkout@v3 24 | with: 25 | ref: ${{ github.event.inputs.tag }} 26 | - name: Use Node.js ${{ matrix.node-version }} 27 | uses: actions/setup-node@v1 28 | with: 29 | node-version: 16.x 30 | - run: yarn 31 | 32 | - name: Type Checking and Linting 33 | run: yarn check-lint-type 34 | 35 | - name: Run Tests 36 | run: yarn test --ci 37 | 38 | - name: Deploy to ${{ github.event.inputs.env }} environment 39 | run: yarn deploy --stage ${{ github.event.inputs.env }} 40 | env: 41 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 42 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.* 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | TODO.md 107 | ./config/firebase/service-account-key.json 108 | .webpack 109 | .serverless 110 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | yarn type-check && yarn lint 5 | 6 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v16 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Boilerplate Node.js + TypeScript for Serverless 2 | 3 | > WIP - Boilerplate Node.js + TypeScript + Prisma + Serverless 4 | 5 | ## Setup 6 | 7 | ### Update project information 8 | 9 | - In `serverless.yml`, update `service` field with the name of your project; 10 | - In `package.json`, update `name` field with the name of your project; 11 | 12 | ### Choose your database 13 | 14 | To use with **Planet Scale** (MySQL serverless DB), you can use this env config: 15 | 16 | ```zsh 17 | DB_USER=mysqluser 18 | DB_ROOT_USER=root 19 | DB_PASSWORD=mysqlpass 20 | DB_HOST=0.0.0.0 21 | DB_PORT=3306 22 | DB_DATABASE=mydb 23 | DATABASE_URL="mysql://${DB_ROOT_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_DATABASE}" 24 | ``` 25 | 26 | To use with Mongo Atlas serverless, use this env config: 27 | 28 | ```zsh 29 | DB_USER=mongodbuser 30 | DB_PASSWORD=mongodbpass 31 | DB_HOST=mongodbhost 32 | DB_DATABASE=db 33 | DATABASE_URL="mongodb+srv://${DB_USER}:${DB_PASSWORD}@${DB_HOST}/${DB_DATABASE}?retryWrites=true&w=majority" 34 | ``` 35 | 36 | To use with MongoDB local (docker-compose), use this env config: 37 | 38 | ```zsh 39 | DB_USER=mongodbuser 40 | DB_PASSWORD=mongodbpass 41 | DB_HOST=0.0.0.0 42 | DB_PORT=27017 43 | DB_DATABASE=db 44 | DATABASE_URL="mongodb://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_DATABASE}?authSource=admin&retryWrites=true&w=majority" 45 | ``` 46 | 47 | ### Local server 48 | 49 | If you are using mongodb, you need to create TypeScript types to use with Prisma. Just run the command: 50 | 51 | ```zsh 52 | yarn generate 53 | ``` 54 | 55 | Get the docker up with the command: 56 | 57 | ```zsh 58 | DEBUG=1 yarn docker:up:logs 59 | ``` 60 | 61 | With this command, you can see if something is wrong by looking at the logs. 62 | You can use `Ctrl + C` any time to came back to your terminal prompt without 63 | get the process down. 64 | 65 | To get the docker down, you will have to use the command: 66 | 67 | ```zsh 68 | yarn docker:down 69 | ``` 70 | 71 | After the docker is up and running, just get your server up with the following command: 72 | 73 | ```zsh 74 | yarn dev 75 | ``` 76 | 77 | ### Deploy 78 | 79 | WIP 80 | 81 | ### Custom domain 82 | 83 | WIP 84 | -------------------------------------------------------------------------------- /deploy-local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Ajustando configuração..." 3 | mv serverless.yml serverless.yml.bkp 4 | mv serverless.local.yml serverless.yml 5 | echo "Configuração ajustada!" 6 | echo "Iniciando deploy..." 7 | 8 | yarn deploy:local 9 | 10 | echo "Deploy finalizado!" 11 | echo "Finalizando configuração..." 12 | mv serverless.yml serverless.local.yml 13 | mv serverless.yml.bkp serverless.yml 14 | echo "Configuração finalizada!" 15 | 16 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | localstack: 4 | container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}" 5 | image: localstack/localstack 6 | ports: 7 | - "127.0.0.1:4566:4566" # LocalStack Gateway 8 | - "127.0.0.1:4510-4559:4510-4559" # external services port range 9 | environment: 10 | - DEBUG=${DEBUG-} 11 | - PERSISTENCE=${PERSISTENCE-} 12 | - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-} 13 | - DOCKER_HOST=unix:///var/run/docker.sock 14 | volumes: 15 | - "${LOCALSTACK_VOLUME_DIR:-/tmp/volume}:/var/lib/localstack" 16 | - "/var/run/docker.sock:/var/run/docker.sock" 17 | 18 | mongo: 19 | # This image automatically creates a replica set required for transactions 20 | image: prismagraphql/mongo-single-replica:4.4.3-bionic 21 | environment: 22 | MONGO_INITDB_ROOT_USERNAME: ${DB_USER} 23 | MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD} 24 | INIT_WAIT_SEC: 3 25 | ports: 26 | - 27017:27017 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-service", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "npm run start:server", 7 | "test": "echo 1", 8 | "start:server": "serverless offline start --stage local", 9 | "docker:up": "docker-compose up -d", 10 | "docker:up:logs": "yarn docker:up && docker-compose logs -f", 11 | "docker:down": "docker-compose down", 12 | "docker:destroy": "docker-compose down --volumes --remove-orphans", 13 | "deploy:local": "serverless deploy --stage local", 14 | "deploy:dev": "serverless deploy --stage dev", 15 | "deploy": "serverless deploy", 16 | "generate": "prisma generate", 17 | "lint": "eslint . --ext js,ts", 18 | "lint:fix": "eslint --fix . --ext js,ts", 19 | "type-check": "tsc --project tsconfig.json --pretty --noEmit", 20 | "prepare": "husky install", 21 | "ci": "yarn lint && yarn type-check && yarn test", 22 | "check-lint-type": "yarn lint:fix && yarn type-check", 23 | "update-deps": "sucrase-node ./src/config/update-deps.ts" 24 | }, 25 | "engines": { 26 | "node": ">=16 <17" 27 | }, 28 | "dependencies": { 29 | "@fastify/aws-lambda": "3.1.3", 30 | "@prisma/client": "4.3.1", 31 | "fastify": "4.5.3" 32 | }, 33 | "devDependencies": { 34 | "@types/node": "18.7.18", 35 | "@typescript-eslint/eslint-plugin": "5.36.2", 36 | "@typescript-eslint/parser": "5.36.2", 37 | "eslint": "8.23.0", 38 | "eslint-config-standard": "17.0.0", 39 | "eslint-plugin-import": "2.26.0", 40 | "eslint-plugin-jest": "27.0.4", 41 | "eslint-plugin-n": "15.2.5", 42 | "eslint-plugin-promise": "6.0.1", 43 | "husky": "8.0.1", 44 | "prisma": "4.3.1", 45 | "serverless": "3.22.0", 46 | "serverless-bundle": "5.5.0", 47 | "serverless-domain-manager": "6.1.0", 48 | "serverless-dotenv-plugin": "4.0.2", 49 | "serverless-localstack": "1.0.0", 50 | "serverless-offline": "10.0.1", 51 | "sucrase": "3.25.0", 52 | "typescript": "4.8.3" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /prisma/schema.prisma: -------------------------------------------------------------------------------- 1 | // This is your Prisma schema file, 2 | // learn more about it in the docs: https://pris.ly/d/prisma-schema 3 | 4 | generator client { 5 | provider = "prisma-client-js" 6 | } 7 | 8 | datasource db { 9 | provider = "mongodb" 10 | url = env("DATABASE_URL") 11 | } 12 | 13 | model Post { 14 | id String @id @default(auto()) @map("_id") @db.ObjectId 15 | slug String @unique 16 | title String 17 | body String 18 | comments Comment[] 19 | author User @relation(fields: [authorId], references: [id]) 20 | authorId String @db.ObjectId 21 | } 22 | 23 | // Comments contain a comment string and connect back to the post. 24 | // postId must have @db.ObjectId to match up with Post's id type 25 | model Comment { 26 | id String @id @default(auto()) @map("_id") @db.ObjectId 27 | post Post @relation(fields: [postId], references: [id]) 28 | postId String @db.ObjectId 29 | comment String 30 | } 31 | 32 | model User { 33 | id String @id @default(auto()) @map("_id") @db.ObjectId 34 | email String @unique 35 | name String? 36 | posts Post[] 37 | } 38 | -------------------------------------------------------------------------------- /serverless.local.yml: -------------------------------------------------------------------------------- 1 | service: my-service 2 | 3 | provider: 4 | name: aws 5 | runtime: nodejs16.x 6 | region: us-east-1 7 | memorySize: 256 8 | apiGateway: 9 | shouldStartNameWithService: true 10 | 11 | iam: 12 | role: 13 | statements: 14 | - Effect: Allow 15 | Action: 16 | - lambda:* 17 | Resource: '*' 18 | 19 | environment: 20 | ENVIRONMENT: ${opt:stage, 'local'} 21 | 22 | package: 23 | individually: true 24 | 25 | functions: 26 | name_of_the_function: 27 | handler: src/functions/index.handler 28 | events: 29 | - http: 30 | method: get 31 | path: hello 32 | cors: true 33 | 34 | custom: 35 | # localstack 36 | localstack: 37 | stages: 38 | - local 39 | host: http://0.0.0.0 40 | 41 | # serverless-bundle 42 | bundle: 43 | sourcemaps: true 44 | 45 | plugins: 46 | - serverless-localstack 47 | - serverless-bundle 48 | - serverless-offline 49 | -------------------------------------------------------------------------------- /serverless.yml: -------------------------------------------------------------------------------- 1 | service: my-service 2 | 3 | provider: 4 | name: aws 5 | runtime: nodejs16.x 6 | region: us-east-1 7 | memorySize: 256 8 | httpApi: 9 | payload: '2.0' 10 | shouldStartNameWithService: true 11 | metrics: true 12 | cors: true 13 | 14 | iam: 15 | role: 16 | statements: 17 | - Effect: Allow 18 | Action: 19 | - lambda:* 20 | - ssm:* 21 | - secretmanager:* 22 | Resource: '*' 23 | 24 | environment: 25 | ENVIRONMENT: ${opt:stage, 'local'} 26 | DATABASE_URL: ${ssm:my-service-database-url-${opt:stage, 'dev'}, env:DATABASE_URL} 27 | 28 | package: 29 | individually: true 30 | 31 | functions: 32 | name_of_the_function: 33 | handler: src/functions/index.handler 34 | events: 35 | - httpApi: '*' 36 | 37 | custom: 38 | # localstack 39 | localstack: 40 | stages: 41 | - local 42 | host: http://0.0.0.0 43 | 44 | # serverless-bundle 45 | bundle: 46 | sourcemaps: true 47 | 48 | # serverless-domain-manager 49 | # customDomain: 50 | # domainName: serverless.foo.com 51 | # stage: ${opt:stage, 'dev'} 52 | # basePath: '' 53 | # certificateName: '*.foo.com' 54 | # createRoute53Record: true 55 | # createRoute53IPv6Record: true 56 | # endpointType: 'regional' 57 | # securityPolicy: tls_1_2 58 | # apiType: http 59 | # autoDomain: false 60 | 61 | plugins: 62 | - serverless-localstack 63 | - serverless-bundle 64 | - serverless-offline 65 | # - serverless-domain-manager 66 | - serverless-dotenv-plugin 67 | -------------------------------------------------------------------------------- /src/config/update-deps.ts: -------------------------------------------------------------------------------- 1 | import { spawn } from 'child_process' 2 | import pkg from '../../package.json' 3 | 4 | const dependencies = Object.keys(pkg.dependencies) 5 | const devDependencies = Object.keys(pkg.devDependencies) 6 | 7 | const add = (args: string[]) => { 8 | return spawn('yarn', ['add', '--exact'].concat(args), { stdio: 'inherit' }) 9 | } 10 | 11 | add(dependencies).on('close', () => { 12 | add(['--dev'].concat(devDependencies)) 13 | .on('close', (code) => process.exit(Number(code))) 14 | }) 15 | -------------------------------------------------------------------------------- /src/functions/fastify-server.ts: -------------------------------------------------------------------------------- 1 | import fastify from 'fastify' 2 | import { PrismaClient } from '@prisma/client' 3 | 4 | const prisma = new PrismaClient() 5 | 6 | const app = fastify() 7 | 8 | app.get('/', async (_req, reply) => { 9 | const databaseUrlString = 'DATABASE_URL' 10 | console.log('process.env.DATABASE_URL', process.env[databaseUrlString]) 11 | const newUser = await prisma.user.create({ 12 | data: { 13 | email: 'user@email.com', 14 | name: 'The user', 15 | }, 16 | }) 17 | console.log('\n\n\n', newUser, '\n\n\n') 18 | reply.send({ hello: 'world' }) 19 | }) 20 | 21 | export { app } 22 | -------------------------------------------------------------------------------- /src/functions/index.ts: -------------------------------------------------------------------------------- 1 | import awsLambdaFastify from '@fastify/aws-lambda' 2 | import { app } from './fastify-server' 3 | 4 | export const handler = awsLambdaFastify(app) 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "target": "ESNext", 5 | "module": "ES6", 6 | "sourceMap": true, 7 | "outDir": "./dist", 8 | "rootDir": "./", 9 | "lib": ["ESNext", "ESNext.AsyncIterable"], 10 | "noEmit": true, 11 | 12 | "strict": true, 13 | 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true, 18 | "noUncheckedIndexedAccess": true, 19 | "noPropertyAccessFromIndexSignature": true, 20 | "strictPropertyInitialization": false, 21 | 22 | "emitDecoratorMetadata": true, 23 | "experimentalDecorators": true, 24 | 25 | "moduleResolution": "node", 26 | "baseUrl": ".", 27 | "paths": { 28 | "@/*": ["./src/*"] 29 | }, 30 | "rootDirs": ["./src"], 31 | "allowSyntheticDefaultImports": true, 32 | "esModuleInterop": true, 33 | "resolveJsonModule": true, 34 | 35 | "skipLibCheck": true, 36 | "forceConsistentCasingInFileNames": true 37 | }, 38 | 39 | "include": [ 40 | "**/*.ts" 41 | ], 42 | "exclude": [ 43 | "node_modules", 44 | "dist" 45 | ] 46 | } 47 | --------------------------------------------------------------------------------