npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@esydoc/resolver-doc

v1.0.19

Published

> TODO: description

Downloads

36

Readme

@esydoc/resolver-doc

一个解析 Api 源码生成文档的解析器

Installation

npm i @esydoc/resolver-qa -D

Usage

esydoc.config.js文件中的resolves字段添加@esydoc/resolver-doc对应的配置就 ok 拉。

// for example in esydoc.config.js
{
  resolves: {
    '@esydoc/resolver-doc': {
      pathPrefix: 'global.hyExt',
      output: {
        template: "doc-website",
        dist: path.join(__dirname, "doc-website")
      }
    },
  }
}

Esydoc Extra Config

pathPrefix

调用路径前缀

hostContext

无。

API 配置文件对应配置

所有resolver-doc的配置都在命名空间doc内。

// api config file
{
  doc: {
    // resolver-doc config
  }
}

esydoc整套体系来说,API的配置可分两种,第一种是扫描代码自动生成的,另外一种是手动填写。

自动生成部分

  • example:string - resolver-doc会自动生成 demo 的代码,非常便利,生成的调用数据取得都是数据类型默认值, 所以有些时候需要我们补上定制化的调用参数。

手动填写部分

  • explanation?:string[] - resolver-doc会自动添加接口描述和版本号,所以这个字段是为了文档说明的填写补充。
  • compatibility:Compatibility[] - 接口兼容性的描述配置。
  • qa: QA[] - 接口 QA 的描述配置。

compatibilityqa的配置在resolver-doc内部有默认值,会帮助我们减少配置量。

Compatibility

兼容性配置的数据结构和默认值如下:

enum Status {
  pending, // 从0开始
  success,
  fail,
  noImplement,
  uninvolved
}

type Compatibility = {
  version: string
  web: Status.uninvolved
  app_ios: Status.uninvolved
  app_android: Status.uninvolved
  zs_ios: Status.uninvolved
  zs_android: Status.uninvolved
  pc_viewer: Status.uninvolved
  pc_streamer: Status.uninvolved
}

type CompatibilityList = Compatibility[]

QA

QA 配置的数据结构和默认值如下:

enum Status {
  pending, // 从0开始
  success,
  fail,
  noImplement,
  uninvolved
}

type QA = {
  platformName: string // web | app_ios | ..., 跟Compatibility内的平台有关字段保持一致
  platform: string
  auth: Status.success
  pass: Status.success
  reason: Status.pending
  frequency: Status.pending
}

type QAList = QA[]

DEMO

advance.showLogin为例子:

接口配置:

{
  demo: {
    compatibility: [
      {
        version: '1.5.0',
        web: 1,
        app_ios: '7.13.353.15465',
        app_android: '7.13.6-34249',
        pc_viewer: '5.4.1.0',
        zs_ios: 4,
        zs_android: 4,
        pc_streamer: 4
      }
    ],
    qa: [
      {
        platform: 'pc_viewer',
        auth: 0,
      }
    ],
  }
}

生成结果:

advance.showLogin.md