Skip to content
Permalink
Browse files

chore: config api-extractor

  • Loading branch information
simonwong committed Dec 26, 2019
1 parent 9bbe5b1 commit 4e4b3df2febf9f32f17e4bb06c3d734508e10b2c
Showing with 206 additions and 329 deletions.
  1. +1 −0 .gitignore
  2. +17 −0 api-extractor.json
  3. +2 −0 package.json
  4. +11 −0 src/add.ts
  5. +12 −0 src/hello.ts
  6. +2 −3 src/index.ts
  7. +13 −0 test/add.test.ts
  8. +13 −0 test/hello.test.ts
  9. +0 −13 test/index.test.ts
  10. +135 −313 yarn.lock
@@ -104,3 +104,4 @@ dist
.tern-port

lib
temp
@@ -0,0 +1,17 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./lib/index.d.ts",
"bundledPackages": [ ],
// 生成 api 报告,生成的还没 .d.ts 看的舒服,关了
"apiReport": {
"enabled": false,
"reportFolder": "./lib/"
},
"docModel": {
"enabled": true
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "./lib/index.d.ts"
}
}
@@ -15,11 +15,13 @@
"homepage": "https://github.com/simonwong/fly-helper#readme",
"scripts": {
"test": "jest --coverage --verbose -u",
"api": "api-extractor run",
"lint": "eslint --ext .js,.ts ./src",
"lint:fix": "eslint --fix --ext .js,.ts ./src"
},
"devDependencies": {
"@babel/preset-env": "^7.7.7",
"@microsoft/api-extractor": "^7.7.0",
"@types/jest": "^24.0.24",
"@typescript-eslint/eslint-plugin": "^2.13.0",
"@typescript-eslint/parser": "^2.13.0",
@@ -0,0 +1,11 @@
/**
* 1 + 1
* @returns 2
* @example
* ```ts
* add() => 2
* ```
*
* @beta
*/
export const add = () => 1 + 1
@@ -0,0 +1,12 @@
/**
* 返回 hello 开头的字符串
* @param str - input string
* @returns 'hello xxx'
* @example
* ```ts
* hello('ts') => 'hello ts'
* ```
*
* @beta
*/
export const hello = (str: string) => `hello ${str}`
@@ -1,3 +1,2 @@
export default function myFirstFunc (str: string) {
return `hello ${str}`
}
export * from './hello'
export * from './add'
@@ -0,0 +1,13 @@
import assert from 'assert'
import { add } from '../src/add'

describe('validate:', () => {
/**
* add
*/
describe('add', () => {
test(' return 2 ', () => {
assert.strictEqual(add(), 2)
})
})
})
@@ -0,0 +1,13 @@
import assert from 'assert'
import { hello } from '../src/hello'

describe('validate:', () => {
/**
* hello
*/
describe('hello', () => {
test(' return hello rollup ', () => {
assert.strictEqual(hello('rollup'), 'hello rollup')
})
})
})

This file was deleted.

0 comments on commit 4e4b3df

Please sign in to comment.
You can’t perform that action at this time.