1.0.4 • Published 12 months ago

sy-api-pro v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

安装

  yarn add sy-api-pro -D 或 npm install sy-api-pro -D

.api-config.ts 配置文件生成

  npx sy-api-pro init

package.json

 {
   "scripts": {
     "api": "sy-api-pro create --config ./src/apis/.api-config.ts --project-id 888"
   }
 }

配置文件(./apis/.api-config.ts)

import { ConfigModels } from 'sy-api-pro';

const config: ConfigModels = {
  outputPath: null,        // 路径相对工程根目录【默认:'./src/apis'】
  api: 'http://xxx.com',   //
  projects: [
    {
      projectId: null,     // apidocs, url的 projectId 部分(与 package.json scripts 中 --project-id 必须一致)
      branchId: null,      // apidocs, url的 branchId 部分
      outputDirName: '',   // 默认为获取到的appName
      apiBaseName: '',     //
      creatBaseFile: true, // 生成基础文件 默认 true
      ignoreParamsDTO: [], // string[];
      deleteParentDTO: [], // (string | RegExp)[];
    },
  ],
  apiHeaderTemplate: [],   // api文件头部模版
};

module.exports = config;

api 生成

  yarn api -i 12345  或  yarn api --id 12345
1.0.2

12 months ago

1.0.1

12 months ago

0.1.10

12 months ago

1.0.0

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.3

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago