Code Monkey home page Code Monkey logo

ts-doc's Introduction

通过puppeteer、ts-morph和commander编写命令行工具,抓取api文档的接口数据,利用事件监听响应机制,动态生成ts文档以及支持智能添加

该工具共有三个功能,init/add/config

  1. 先通过tsdoc config xxx.js命令初始化配置信息(其中xxx.js为实际的配置文件地址),进行初始化。

  2. 在对应的文件夹下执行tsdoc init xxx命令,初始化请求api对应的index.ts文件和对应类型以及注释的type.ts文件(其中xxx为实际的api接口地址)。如果想覆盖已经生成的index.ts文件和type.ts文件,可以通过添加-f参数,强制覆盖:tsdoc init -f xxx

  3. 在已经生成文件的目录下,可以通过执行tsdoc add xxx命令,在源文件上动态添加新的api文档描述

需要先手动执行tsdoc config命令进行初始化,不然无法执行后续的命令

config文件的格式如下

// config.js文件
module.exports = {
	username: "", // 实际的用户名
	password: "", // 实际的用户密码
	fetchfilePath: "@/utils/fetch/index", // 实际的请求文件地址
	responsefilePath: "@/utils/fetch/type", // 实际的请求类型文件地址
};

ts-doc's People

Contributors

dependabot[bot] avatar wind4gis avatar

Stargazers

 avatar

Watchers

 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.