Giter VIP home page Giter VIP logo

nest-mikro-template's Introduction

Nest Logo

Description

A real one Nest framework TypeScript repository.

Feature

  • MikroOrm
  • Mongodb
  • 自动验证传入参数
  • 自动转换传入参数
  • 自动生成 API 文档
  • 自动生成 API 接口调用
  • 识别环境(prod 生产, dev 预发, local 本地开发, ..)
  • 自动加载环境变量
  • 热重载(HMR)
  • API 版本管理(URL 方式)
  • 单元测试
  • E2E 测试
  • 支持 VSCode 单元测试
  • 支持 GitHook 自动 Prettier 格式化, 自动 ESlint 校验,自动校验 Commit
  • 无需编译直接运行模式(实验)npm run start:native

VSCode Plugin Installation

名称: Jest
ID: orta.vscode-jest
说明: Use Facebook's Jest With Pleasure.
版本: 4.1.2
发布者: Orta
VS Marketplace 链接: https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest
名称: ESLint
ID: dbaeumer.vscode-eslint
说明: Integrates ESLint JavaScript into VS Code.
版本: 2.1.25
发布者: Dirk Baeumer
VS Marketplace 链接: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
名称: Prettier - Code formatter
ID: esbenp.prettier-vscode
说明: Code formatter using prettier
版本: 8.1.0
发布者: Prettier
VS Marketplace 链接: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

Installation

$ npm install

Running the app

# local development
$ npm run start

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Env File

.env        通用环境变量文件,所有环境生效,相同变量会被下面环境覆盖
.env.local  本地环境生效
.env.dev    预发环境生效
.env.prod   生产环境生效

提示: 需要在生产环境的服务器设置 NODE_ENV 环境变量为 prod 才能正确识别环境 需要在预发环境的服务器设置 NODE_ENV 环境变量为 dev 才能正确识别环境 如果不设置默认为本地环境

Preset Environment Variables

MONGO_DEBUG = false # 是否开启MikroORM Debug
MONGO_CLIENT_URL = mongodb://localhost/hello # MONGO 链接地址

Commit Lint

type(scope?): subject

type

表示提交的类型

  'build',    打包构建之后
  'chore',    修改配置或者修改文件名等,相当于是其他
  'ci',       修改CI后
  'docs',     修改文档后
  'feat',     新的特性
  'fix',      修复bug
  'perf',     性能优化
  'refactor', 重构
  'revert',   重新提交
  'style',    样式相关
  'test'      测试相关

scope

表示模块

subject

做的事情

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

nest-mikro-template's People

Contributors

lydanne avatar

Stargazers

Lorenzo Stflorant avatar  avatar Hussein Fotouh avatar Ngai Kam Wing avatar  avatar

Watchers

James Cloos avatar  avatar

nest-mikro-template's Issues

讨论下热重载

nestjs的热重载hmr是webpack的热重载,会生成单文件main.js
而用typescript编译nestjs 只是把项目的ts编译成js,是多文件;
请教下如何解决wepback编译后的__dirname 路径指向main.js运行所在的路径

ts编译后的__dirname指向使用__dirname的路径呢?感谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.