Giter Site home page Giter Site logo

demos's Introduction

使用方法

  • 安装全局的 lerna 环境 npm install --global lerna

issue

  1. 为什么根目录不装 jest,packages 里面 jest 会报红

创建 monerepo 工程

  1. npm install --global lerna
  2. git init monorepo-example cd monorepo-example
  3. lerna init

ts 配置

  1. 创建 tsconfig.json 文件
  2. https://www.tslang.cn/docs/handbook/tsconfig-json.html 参照链接进行配置

test 模块 jest

  1. jest --init

  2. add babel yarn add --dev babel-jest @babel/core @babel/preset-env

  3. create babel.config.js

    // babel.config.js
    module.exports = {
      presets: [
        [
          '@babel/preset-env',
          {
            targets: {
              node: 'current',
            },
          },
        ],
      ],
    };
  4. 支持 ts yarn add --dev @babel/preset-typescript

  5. yarn install --dev @types/jest

prettier

  1. yarn global add tslint typescript

  2. tslint --init

  3. tslint file

    {
      "extends": ["tslint-plugin-prettier", "tslint-config-prettier"],
      "rules": {
        "prettier": true
      }
    }
  4. vscode install Prettier - Code formatter

  5. yarn global add prettier

  6. yarn add --dev tslint-plugin-prettier prettier

demos's People

Watchers

James Cloos avatar  avatar

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.